1 //
2 // aegis - project change supervisor
3 // Copyright (C) 2012 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or (at
8 // your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program. If not, see <http://www.gnu.org/licenses/>.
17 //
18 
19 #include <common/ac/assert.h>
20 #include <common/ac/stdlib.h>
21 
22 #include <common/error.h>
23 #include <common/nstring/list.h>
24 #include <common/trace.h>
25 #include <libaegis/os.h>
26 #include <libaegis/project.h>
27 
28 #include <aemakegen/process_data.h>
29 #include <aemakegen/util.h>
30 
31 
~process_data()32 process_data::~process_data()
33 {
34 }
35 
36 
process_data()37 process_data::process_data() :
38     use_libtool_flag(false),
39     use_lib_la_files_flag(false),
40     use_x11_flag(false),
41     use_i18n_flag(false),
42     seen_c_flag(false),
43     seen_c_plus_plus_flag(false),
44     need_yacc_flag(false),
45     have_yacc_flag(false),
46     need_lex_flag(false),
47     have_lex_flag(false),
48     library_file_extension("a"),
49     object_file_extension("o"),
50     install_script_macro(false),
51     etc_test_sh_flag(false),
52     have_groff_flag(false),
53     need_groff_flag(false),
54     have_soelim_flag(false),
55     need_soelim_flag(false),
56     seen_datadir_flag(false),
57     seen_datarootdir_flag(false),
58     seen_libdir_flag(false),
59     seen_sysconfdir_flag(false),
60     have_nlsdir_flag(false),
61     etc_msgfmt_sh_flag(false),
62     groff_macro_flag(false),
63     install_data_macro(false),
64     have_ar_flag(false),
65     have_ranlib_flag(false),
66     need_ghostscript_flag(false),
67     read_only(false) // must be last
68 {
69 }
70 
71 
72 void
notify_preprocess_complete(void)73 process_data::notify_preprocess_complete(void)
74 {
75     read_only = true;
76 }
77 
78 
79 #if HAVE_BACKTRACE
80 
81 #include <common/ac/execinfo.h>
82 
83 static void
emit_backtrace(void)84 emit_backtrace(void)
85 {
86     enum { BT_MAX_DEPTH = 20 };
87     void **bt_info = new void * [BT_MAX_DEPTH];
88     if (bt_info)
89     {
90         int bt_depth = backtrace(bt_info, BT_MAX_DEPTH);
91         char **symbol = backtrace_symbols(bt_info, bt_depth);
92         for (int j = 0; j < bt_depth; ++j)
93         {
94             error_raw("%d: %s", j, symbol[j]);
95         }
96         delete [] bt_info;
97     }
98 }
99 
100 #endif
101 
102 
103 void
check_read_write(const char * method_name)104 process_data::check_read_write(const char *method_name)
105 {
106     if (read_only)
107     {
108 #if HAVE_BACKTRACE
109         emit_backtrace();
110 #endif
111 
112         // This will be fatal_raw shortly.
113         error_raw
114         (
115             "read-only mode in effect, may no longer call %s",
116             method_name
117         );
118     }
119 }
120 
121 
122 void
set_use_libtool(void)123 process_data::set_use_libtool(void)
124 {
125     check_read_write(__PRETTY_FUNCTION__);
126     use_libtool_flag = true;
127 
128     set_libext_libtool();
129 
130     // This is so the install rule can use $(INSTALL_DATA)
131     set_install_data_macro();
132 }
133 
134 
135 void
set_use_lib_la_files(void)136 process_data::set_use_lib_la_files(void)
137 {
138     check_read_write(__PRETTY_FUNCTION__);
139     use_lib_la_files_flag = true;
140 }
141 
142 
143 void
set_use_x11(void)144 process_data::set_use_x11(void)
145 {
146     check_read_write(__PRETTY_FUNCTION__);
147     use_x11_flag = true;
148 }
149 
150 
151 void
set_version_info(const nstring & text)152 process_data::set_version_info(const nstring &text)
153 {
154     check_read_write(__PRETTY_FUNCTION__);
155     nstring_list nl1;
156     nl1.split(text, ":");
157     nstring_list nl2;
158     while (nl2.size() < 3)
159     {
160         if (nl1.size() > nl2.size())
161         {
162             long n = nl1[nl2.size()].to_long();
163             nl2.push_back(nstring::format("%ld", n));
164         }
165         else
166             nl2.push_back("0");
167     }
168     version_info = nl2.unsplit(":");
169 }
170 
171 
172 nstring
get_version_info(void) const173 process_data::get_version_info(void)
174     const
175 {
176     return version_info;
177 }
178 
179 
180 nstring
get_version_info_major(void) const181 process_data::get_version_info_major(void)
182     const
183 {
184     //
185     // This is weirder than you think.  It actually wants $1-$3
186     // (revision - age) not just $1 (revision), because this is the name
187     // that libtool actually links to.  Sigh.
188     //
189     nstring_list parts;
190     parts.split(version_info, ":");
191     switch (parts.size())
192     {
193     case 0:
194         // Should never happen, but cope.
195         return "0";
196 
197     case 1:
198     case 2:
199         // Should never happen, but cope.
200         return parts[0];
201 
202     case 3:
203         // This is the normal case.
204         break;
205 
206     default:
207         assert(!"this should not happen, because we already sanitized it");
208         break;
209     }
210 
211     return nstring::format("%ld", parts[0].to_long() - parts[2].to_long());
212 }
213 
214 
215 void
set_library_directory(change_identifier & cid,const nstring_list & filenames)216 process_data::set_library_directory(change_identifier &cid,
217     const nstring_list &filenames)
218 {
219     check_read_write(__PRETTY_FUNCTION__);
220     project_name = nstring(cid.get_pp()->trunk_get()->name_get());
221 
222     //
223     // scan the list of file names, looking for a "lib*" directory with
224     // C++ or C files in it.  Use the first one as the library directory.
225     //
226     library_directory =
227         cid.get_cp()->pconf_attributes_find("aemakegen:library-directory");
228     if (!library_directory.empty())
229     {
230         library_name = library_directory;
231         if (library_directory == "lib")
232             library_name = project_name;
233         if (!library_name.starts_with("lib"))
234             library_name = "lib" + library_name;
235     }
236     else
237     {
238         nstring_list libdirs;
239         for (size_t j = 0; j < filenames.size(); ++j)
240         {
241             nstring filename = filenames[j];
242             if (filename.starts_with("lib") && is_a_source_file(filename))
243             {
244                 nstring dir = filename.first_dirname();
245                 // libdir is supposed to contain files to be installed
246                 // into $(libdir), not sources.
247                 if (dir != "." && dir != "libdir")
248                     libdirs.push_back_unique(dir);
249             }
250         }
251         libdirs.sort();
252         if (!libdirs.empty())
253         {
254             library_directory = libdirs[0];
255             library_name = library_directory;
256             if (library_directory == "lib")
257                 library_name = project_name;
258             if (!library_name.starts_with("lib"))
259                 library_name = "lib" + library_name;
260         }
261     }
262 }
263 
264 
265 void
remember_explicit_noinst(const nstring & progname)266 process_data::remember_explicit_noinst(const nstring &progname)
267 {
268     check_read_write(__PRETTY_FUNCTION__);
269     explicit_noinst.push_back_unique(progname);
270 }
271 
272 
273 bool
is_explicit_noinst(const nstring & progname) const274 process_data::is_explicit_noinst(const nstring &progname)
275     const
276 {
277     return explicit_noinst.member(progname);
278 }
279 
280 
281 bool
uses_pkgconfig(void) const282 process_data::uses_pkgconfig(void)
283     const
284 {
285     return (use_libtool_flag && seen_pkgconfig_source());
286 }
287 
288 
289 void
remember_clean_misc_file(const nstring & filename)290 process_data::remember_clean_misc_file(const nstring &filename)
291 {
292     clean_misc_files.push_back_unique(filename);
293 }
294 
295 
296 void
remember_clean_obj_file(const nstring & filename)297 process_data::remember_clean_obj_file(const nstring &filename)
298 {
299     check_read_write(__PRETTY_FUNCTION__);
300     clean_obj_files.push_back_unique(filename);
301 }
302 
303 
304 void
remember_dist_clean_file(const nstring & filename)305 process_data::remember_dist_clean_file(const nstring &filename)
306 {
307     dist_clean_files.push_back_unique(filename);
308 }
309 
310 
311 void
remember_dist_clean_dir(const nstring & path)312 process_data::remember_dist_clean_dir(const nstring &path)
313 {
314     dist_clean_dirs.push_back_unique(path);
315 }
316 
317 
318 void
set_exeext(void)319 process_data::set_exeext(void)
320 {
321     check_read_write(__PRETTY_FUNCTION__);
322     executable_file_extension = "$(EXEEXT)";
323 }
324 
325 
326 nstring
libext(void) const327 process_data::libext(void)
328     const
329 {
330     if (use_libtool_flag)
331         return "la";
332     return library_file_extension;
333 }
334 
335 
336 void
set_libext(void)337 process_data::set_libext(void)
338 {
339     check_read_write(__PRETTY_FUNCTION__);
340     library_file_extension = "$(LIBEXT)";
341 }
342 
343 
344 void
set_libext_libtool(void)345 process_data::set_libext_libtool(void)
346 {
347     check_read_write(__PRETTY_FUNCTION__);
348     library_file_extension = "la";
349 }
350 
351 
352 void
set_objext(void)353 process_data::set_objext(void)
354 {
355     check_read_write(__PRETTY_FUNCTION__);
356     object_file_extension = "$(OBJEXT)";
357 }
358 
359 
360 void
remember_source_file(const nstring & path)361 process_data::remember_source_file(const nstring &path)
362 {
363     trace(("%s {\n", __PRETTY_FUNCTION__));
364     trace(("path = %s\n", path.quote_c().c_str()));
365     check_read_write(__PRETTY_FUNCTION__);
366     nstring srcdir = progname_from_dir_of(path);
367     trace(("srcdir = %s\n", srcdir.quote_c().c_str()));
368     source_list_t::iterator it = source_list.find(srcdir);
369     if (it == source_list.end())
370     {
371         nstring_list tmp;
372         tmp.push_back(path);
373         source_list.insert(source_list_t::value_type(srcdir, tmp));
374     }
375     else
376     {
377         it->second.push_back(path);
378     }
379     trace(("}\n"));
380 }
381 
382 
383 const nstring_list &
get_source_files_by_dir(const nstring & dir) const384 process_data::get_source_files_by_dir(const nstring &dir)
385     const
386 {
387     source_list_t::const_iterator it = source_list.find(dir);
388     if (it == source_list.end())
389     {
390         static nstring_list fail;
391         return fail;
392     }
393     return it->second;
394 }
395 
396 
397 void
remember_include_files_by_dir(const nstring & path)398 process_data::remember_include_files_by_dir(const nstring &path)
399 {
400     trace(("%s {\n", __PRETTY_FUNCTION__));
401     trace(("path = %s\n", path.quote_c().c_str()));
402     check_read_write(__PRETTY_FUNCTION__);
403     assert(is_an_include_file(path));
404     nstring objdir = progname_from_dir_of(path);
405     trace(("objdir = %s\n", objdir.quote_c().c_str()));
406     include_list_t::iterator it = include_list.find(objdir);
407     if (it == include_list.end())
408     {
409         nstring_list tmp;
410         tmp.push_back(path);
411         include_list.insert(include_list_t::value_type(objdir, tmp));
412     }
413     else
414     {
415         it->second.push_back(path);
416     }
417     trace(("}\n"));
418 }
419 
420 
421 const nstring_list &
get_include_files_by_dir(const nstring & dir) const422 process_data::get_include_files_by_dir(const nstring &dir)
423     const
424 {
425     include_list_t::const_iterator it = include_list.find(dir);
426     if (it == include_list.end())
427     {
428         static nstring_list fail;
429         return fail;
430     }
431     return it->second;
432 }
433 
434 
435 void
remember_object_file(const nstring & path)436 process_data::remember_object_file(const nstring &path)
437 {
438     trace(("%s {\n", __PRETTY_FUNCTION__));
439     trace(("path = %s\n", path.quote_c().c_str()));
440     check_read_write(__PRETTY_FUNCTION__);
441     assert(path.ends_with("." + objext()) || path.ends_with(".o")
442         || path.ends_with(".lo"));
443 
444     //
445     // See if the path is below any of the progdirs.
446     // Otherwise, just use the first dir.
447     //
448     nstring objdir = path.first_dirname();
449     for (size_t j = 0; j < progdirs.size(); ++j)
450     {
451         nstring dir = progdirs[j];
452         nstring relative = os_below_dir(dir, path);
453         trace(("relative = %s\n", relative.quote_c().c_str()));
454         if (!relative.empty())
455         {
456             assert(relative != ".");
457             objdir = dir;
458             break;
459         }
460     }
461     trace(("objdir = %s\n", objdir.quote_c().c_str()));
462 
463     object_list_t::iterator it = object_list.find(objdir);
464     if (it == object_list.end())
465     {
466         nstring_list tmp;
467         tmp.push_back(path);
468         object_list.insert(object_list_t::value_type(objdir, tmp));
469     }
470     else
471     {
472         it->second.push_back(path);
473     }
474     remember_clean_obj_file(path);
475     trace(("}\n"));
476 }
477 
478 
479 const nstring_list &
get_object_files_by_dir(const nstring & dir) const480 process_data::get_object_files_by_dir(const nstring &dir)
481     const
482 {
483     object_list_t::const_iterator it = object_list.find(dir);
484     if (it == object_list.end())
485     {
486         static nstring_list fail;
487         return fail;
488     }
489     return it->second;
490 }
491 
492 
493 void
library_plus_library(const nstring & to_name,const nstring & from_name)494 process_data::library_plus_library(const nstring &to_name,
495     const nstring &from_name)
496 {
497     check_read_write(__PRETTY_FUNCTION__);
498     object_list_t::iterator to_obj_list = object_list.find(to_name);
499     if (to_obj_list == object_list.end())
500         return;
501     object_list_t::const_iterator from_obj_list = object_list.find(from_name);
502     if (from_obj_list == object_list.end())
503         return;
504     to_obj_list->second.push_back(from_obj_list->second);
505 }
506 
507 
508 void
program_needs_library(const nstring & prog_name,const nstring & lib_name)509 process_data::program_needs_library(const nstring &prog_name,
510     const nstring &lib_name)
511 {
512     check_read_write(__PRETTY_FUNCTION__);
513     library_list_t::iterator lnames = library_list.find(prog_name);
514     if (lnames == library_list.end())
515     {
516         nstring_list tmp;
517         library_list.insert(library_list_t::value_type(prog_name, tmp));
518         lnames = library_list.find(prog_name);
519         assert(lnames != library_list.end());
520     }
521 
522     // If you want to say "this program has no library dependencies"
523     // pass the empty string for the library name.
524     if (lib_name.empty())
525         return;
526 
527     nstring library_dirname = lib_name;
528     nstring library_libname = library_dirname;
529     if (library_libname == "lib")
530         library_libname = project_name;
531     if (!library_libname.starts_with("lib"))
532         library_libname = "lib" + library_libname;
533     nstring path = library_dirname + "/" + library_libname + "." + libext();
534     lnames->second.push_back(path);
535 }
536 
537 
538 const nstring_list &
get_library_list_by_program(const nstring & prog_name) const539 process_data::get_library_list_by_program(const nstring &prog_name)
540     const
541 {
542     library_list_t::const_iterator it = library_list.find(prog_name);
543     if (it == library_list.end())
544     {
545         static nstring_list fail;
546         return fail;
547     }
548     return it->second;
549 }
550 
551 
552 void
remember_progdir(const nstring & progdir)553 process_data::remember_progdir(const nstring &progdir)
554 {
555     trace(("%s\n", __PRETTY_FUNCTION__));
556     trace(("progdir = %s\n", progdir.quote_c().c_str()));
557     check_read_write(__PRETTY_FUNCTION__);
558     progdirs.push_back_unique(progdir);
559 }
560 
561 
562 void
remember_all_bin(const nstring & filename)563 process_data::remember_all_bin(const nstring &filename)
564 {
565     check_read_write(__PRETTY_FUNCTION__);
566     all_bin.push_back_unique(filename);
567 }
568 
569 
570 void
remember_install_directory_for(const nstring & filename)571 process_data::remember_install_directory_for(const nstring &filename)
572 {
573     assert(filename[0] == '$');
574     nstring dir = filename.dirname();
575     for (;;)
576     {
577         // When we get to the top of the directory tree, we are done.
578         if (dir == "." || dir == "/")
579             break;
580 
581         // if the directory is already known, nothing more needs to be done.
582         if (install_directories.find(dir) != install_directories.end())
583             break;
584 
585         // Add the directory to the set of known directories.
586         install_directories.insert(install_directories_t::value_type(dir, 1));
587         remember_clean_misc_file(make_pseudo_dir(dir));
588 
589         // Move one level up the directory tree.
590         dir = dir.dirname();
591     }
592 }
593 
594 
595 nstring_list
get_install_directories(void) const596 process_data::get_install_directories(void)
597     const
598 {
599     nstring_list result;
600     for
601     (
602         install_directories_t::const_iterator it = install_directories.begin();
603         it != install_directories.end();
604         ++it
605     )
606     {
607         result.push_back(it->first);
608     }
609     return result;
610 }
611 
612 
613 void
remember_install_bin(const nstring & filename)614 process_data::remember_install_bin(const nstring &filename)
615 {
616     check_read_write(__PRETTY_FUNCTION__);
617     install_bin.push_back_unique(filename);
618     remember_install_directory_for(filename);
619 }
620 
621 
622 void
remember_test_source(const nstring & filename)623 process_data::remember_test_source(const nstring &filename)
624 {
625     check_read_write(__PRETTY_FUNCTION__);
626     test_sources.push_back_unique(filename);
627 }
628 
629 
630 void
remember_test_file(const nstring & filename)631 process_data::remember_test_file(const nstring &filename)
632 {
633     check_read_write(__PRETTY_FUNCTION__);
634     test_files.push_back_unique(filename);
635 }
636 
637 
638 void
remember_install_datadir(const nstring & filename)639 process_data::remember_install_datadir(const nstring &filename)
640 {
641     check_read_write(__PRETTY_FUNCTION__);
642     install_datadir.push_back_unique(filename);
643     remember_install_directory_for(filename);
644     set_install_data_macro();
645 }
646 
647 
648 void
remember_pkgconfig_source(const nstring & filename)649 process_data::remember_pkgconfig_source(const nstring &filename)
650 {
651     check_read_write(__PRETTY_FUNCTION__);
652     pkgconfig_sources.push_back_unique(filename);
653 }
654 
655 
656 void
remember_install_libdir(const nstring & filename)657 process_data::remember_install_libdir(const nstring &filename)
658 {
659     check_read_write(__PRETTY_FUNCTION__);
660     install_libdir.push_back_unique(filename);
661     remember_install_directory_for(filename);
662     set_install_data_macro();
663     set_seen_libdir();
664 }
665 
666 
667 void
remember_man_sources(const nstring & filename)668 process_data::remember_man_sources(const nstring &filename)
669 {
670     check_read_write(__PRETTY_FUNCTION__);
671     man_sources.push_back_unique(filename);
672 }
673 
674 
675 void
remember_install_mandir(const nstring & filename)676 process_data::remember_install_mandir(const nstring &filename)
677 {
678     check_read_write(__PRETTY_FUNCTION__);
679     install_mandir.push_back_unique(filename);
680     remember_install_directory_for(filename);
681     set_install_data_macro();
682 }
683 
684 
685 void
remember_all_doc(const nstring & filename)686 process_data::remember_all_doc(const nstring &filename)
687 {
688     check_read_write(__PRETTY_FUNCTION__);
689     all_doc.push_back_unique(filename);
690 }
691 
692 
693 void
remember_install_doc(const nstring & filename)694 process_data::remember_install_doc(const nstring &filename)
695 {
696     check_read_write(__PRETTY_FUNCTION__);
697     install_doc.push_back_unique(filename);
698     remember_install_directory_for(filename);
699     set_install_data_macro();
700 }
701 
702 
703 void
set_program_prefix(void)704 process_data::set_program_prefix(void)
705 {
706     program_prefix = "$(PROGRAM_PREFIX)";
707 }
708 
709 
710 void
set_program_suffix(void)711 process_data::set_program_suffix(void)
712 {
713     program_suffix = "$(PROGRAM_SUFFIX)";
714 }
715 
716 
717 void
remember_all_i18n(const nstring & filename)718 process_data::remember_all_i18n(const nstring &filename)
719 {
720     check_read_write(__PRETTY_FUNCTION__);
721     all_i18n.push_back_unique(filename);
722 }
723 
724 
725 void
remember_install_i18n(const nstring & filename)726 process_data::remember_install_i18n(const nstring &filename)
727 {
728     check_read_write(__PRETTY_FUNCTION__);
729     install_i18n.push_back_unique(filename);
730     remember_install_directory_for(filename);
731     set_install_data_macro();
732 }
733 
734 
735 void
set_etc_msgfmt_sh(void)736 process_data::set_etc_msgfmt_sh(void)
737 {
738     check_read_write(__PRETTY_FUNCTION__);
739     etc_msgfmt_sh_flag = true;
740 }
741 
742 
743 void
remember_install_include_source(const nstring & filename)744 process_data::remember_install_include_source(const nstring &filename)
745 {
746     check_read_write(__PRETTY_FUNCTION__);
747     assert(filename[0] != '$');
748     assert(filename[0] != '/');
749     install_include_sources.push_back_unique(filename);
750 }
751 
752 
753 void
remember_install_include(const nstring & filename)754 process_data::remember_install_include(const nstring &filename)
755 {
756     check_read_write(__PRETTY_FUNCTION__);
757     assert(filename[0] == '$');
758     install_include.push_back_unique(filename);
759     remember_install_directory_for(filename);
760     set_install_data_macro();
761 }
762 
763 
764 void
set_groff_macro(void)765 process_data::set_groff_macro(void)
766 {
767     check_read_write(__PRETTY_FUNCTION__);
768     groff_macro_flag = true;
769 }
770 
771 
772 bool
seen_programs(void) const773 process_data::seen_programs(void)
774     const
775 {
776     return !progdirs.empty();
777 }
778 
779 
780 nstring
progdir_from_progname(const nstring & progname) const781 process_data::progdir_from_progname(const nstring &progname)
782     const
783 {
784     for (size_t j = 0; j < progdirs.size(); ++j)
785     {
786         nstring dir = progdirs[j];
787         nstring pn2 = progname_from_dir_of(dir + "/main.c");
788         if (progname == pn2)
789             return dir;
790     }
791     return nstring();
792 }
793 
794 
795 nstring_list
get_programs(void) const796 process_data::get_programs(void)
797     const
798 {
799     nstring_list result;
800     for (size_t j = 0; j < progdirs.size(); ++j)
801     {
802         nstring dir = progdirs[j];
803         nstring progname = progname_from_dir_of(dir + "/main.c");
804         result.push_back(progname);
805     }
806     result.sort();
807     return result;
808 }
809 
810 
811 nstring_list
get_list_of_library_directories(void) const812 process_data::get_list_of_library_directories(void)
813     const
814 {
815     // Use a map for efficiency.  Some of my projects have both many
816     // directories and many programs, and the O(n**2) shows up very
817     // quickly, so change to O(n*log(n))
818     typedef std::map<nstring, int> progs_t;
819     progs_t progs;
820     for (size_t j = 0; j < progdirs.size(); ++j)
821     {
822         progs[progdirs[j]] = 1;
823     }
824 
825     //
826     // Build a list of directories that contain object files that
827     // are not listed in the 'programs' list.  They may not all be
828     // libraries, but its a reasonably good guess.
829     //
830     nstring_list result;
831     for
832     (
833         object_list_t::const_iterator it = object_list.begin();
834         it != object_list.end();
835         ++it
836     )
837     {
838         if (progs.find(it->first) == progs.end())
839         {
840             result.push_back(it->first);
841         }
842     }
843     return result;
844 }
845 
846 
847 void
remember_extra_dist(const nstring & filename)848 process_data::remember_extra_dist(const nstring &filename)
849 {
850     check_read_write(__PRETTY_FUNCTION__);
851     extra_dist.push_back_unique(filename);
852 }
853 
854 
855 void
remember_built_sources(const nstring & filename)856 process_data::remember_built_sources(const nstring &filename)
857 {
858     check_read_write(__PRETTY_FUNCTION__);
859     built_sources.push_back_unique(filename);
860 }
861 
862 
863 void
set_install_data_macro(void)864 process_data::set_install_data_macro(void)
865 {
866     check_read_write(__PRETTY_FUNCTION__);
867     install_data_macro = true;
868 }
869 
870 
871 void
set_have_ar(void)872 process_data::set_have_ar(void)
873 {
874     check_read_write(__PRETTY_FUNCTION__);
875     have_ar_flag = true;
876 }
877 
878 
879 void
set_have_groff(void)880 process_data::set_have_groff(void)
881 {
882     check_read_write(__PRETTY_FUNCTION__);
883     have_groff_flag = true;
884 }
885 
886 
887 void
set_need_groff(void)888 process_data::set_need_groff(void)
889 {
890     check_read_write(__PRETTY_FUNCTION__);
891     need_groff_flag = true;
892     if (!have_groff_flag)
893     {
894         fatal_raw
895         (
896             "The \"configure.ac\" file fails to invoke "
897             "\"AC_CHECK_PROGS(GROFF, groff roff)\" and yet the project source "
898             "files would appear to require it."
899         );
900     }
901 }
902 
903 
904 void
set_have_soelim(void)905 process_data::set_have_soelim(void)
906 {
907     check_read_write(__PRETTY_FUNCTION__);
908     have_soelim_flag = true;
909 }
910 
911 
912 void
set_need_soelim(void)913 process_data::set_need_soelim(void)
914 {
915     check_read_write(__PRETTY_FUNCTION__);
916     need_soelim_flag = true;
917     if (!have_soelim_flag)
918     {
919         fatal_raw
920         (
921             "The \"configure.ac\" file fails to invoke "
922             "\"AC_CHECK_PROGS(SOELIM, gsoelim soelim)\" and yet the project "
923             "source files would appear to require it."
924         );
925     }
926 }
927 
928 
929 void
set_have_ranlib(void)930 process_data::set_have_ranlib(void)
931 {
932     check_read_write(__PRETTY_FUNCTION__);
933     have_ranlib_flag = true;
934 }
935 
936 
937 void
set_need_ghostscript(void)938 process_data::set_need_ghostscript(void)
939 {
940     check_read_write(__PRETTY_FUNCTION__);
941     need_ghostscript_flag = true;
942 }
943 
944 
945 void
remember_am_data_data(const nstring & filename)946 process_data::remember_am_data_data(const nstring &filename)
947 {
948     check_read_write(__PRETTY_FUNCTION__);
949     am_data_data.push_back_unique(filename);
950 }
951 
952 
953 void
set_have_nlsdir(void)954 process_data::set_have_nlsdir(void)
955 {
956     check_read_write(__PRETTY_FUNCTION__);
957     have_nlsdir_flag = true;
958 }
959 
960 
961 // vim: set ts=8 sw=4 et :
962