Add configure operations to support MINGW on Windows.
[make.git] / ChangeLog
blob701501e7ab6bca90db86f462e1c759b65b2f3d1e
1 2005-02-24  Jonathan Grant  <jg@jguk.org>
3         * configure.in: Add MinGW configuration options, and extra w32 code
4         directory.
5         * Makefile.am: Add MinGW configuration options, and extra w32 code
6         directory.
7         * main.c: Determine correct program string (after last \ without .exe).
8         * subproc/sub_proc.c: `GetExitCodeProcess' from incompatible pointer
9         type fix x2
10         * w32/Makefile.am: Import to build win32 lib of sub_proc etc.
11         * subproc/w32err.c: MSVC thread directive not applied to MinGW builds.
12         * tests/run_make_tests.pl, tests/test_driver.pl: MSYS testing
13         environment support.
15 2005-02-09  Paul D. Smith  <psmith@gnu.org>
17         * maintMakefile: Update the CVS download URL to simplify them.
18         Also, the ftp://ftp.gnu.org/GNUinfo site was removed so I'm
19         downloading the .texi files from Savannah now.
21         Fixed these issues reported by Markus Mauhart <qwe123@chello.at>:
23         * main.c (handle_non_switch_argument): Only add variables to
24         command_variables if they're not already there: duplicate settings
25         waste space and can be confusing to read.
27         * w32/include/sub_proc.h: Remove WINDOWS32.  It's not needed since
28         this header is never included by non-WINDOWS32 code, and it
29         requires <config.h> to define which isn't always included first.
31         * dir.c (read_dirstream) [MINGW]: Use proper macro names when
32         testing MINGW32 versions.
34         * main.c (log_working_directory): flush stdout to be sure the WD
35         change is printed before any stderr messages show up.
37 2005-02-01  Paul D. Smith  <psmith@gnu.org>
39         * maintMakefile (po_repo): Update the GNU translation site URL.
41 2004-12-01  Paul D. Smith  <psmith@gnu.org>
43         * main.c (main): Change char* env_shell to struct variable shell_var.
44         * variable.c (target_environment): Use new shell_var.
46 2004-11-30  Paul D. Smith  <psmith@gnu.org>
48         * configure.in: The old way we avoided creating build.sh from
49         build.sh.in before build.sh.in exists doesn't work anymore; we
50         have to use raw M4 (thanks to Andreas Schwab <schwab@suse.de> for
51         the help!).  This also keeps automake from complaining.
52         * Makefile.am (README): Add a dummy target so automake won't
53         complain that this file doesn't exist when we checkout from CVS.
54         * maintMakefile (.dep_segment): Rewrite this rule since newer
55         versions of automake don't provide DEP_FILES.
57 2004-11-30  Boris Kolpackov  <boris@kolpackov.net>
59         Implementation of `realpath' and `abspath' built-in functions.
61         * configure.in: Check for realpath.
62         * function.c (abspath): Return an absolute file name that does
63         not contain any `.' or `..' components, nor repeated `/'.
64         * function.c (func_abspath): For each name call abspath.
65         * function.c (func_realpath): For each name call realpath
66         from libc or delegate to abspath if realpath is not available.
67         * doc/make.texi (Functions for File Names): Document new functions.
68         * doc/make.texi (Quick Reference): Ditto.
70 2004-11-28  Paul D. Smith  <psmith@gnu.org>
72         * main.c (main) [WINDOWS32]: Remove any trailing slashes from -C
73         arguments.  Fixes bug #10252.
75         Fix for bug #1276: Handle SHELL according to POSIX requirements.
77         * main.c (main): Set SHELL to v_noexport by default.  Remember the
78         original environment setting of SHELL in the env_shell variable.
79         * main.h: Export new env_shell variable.
80         * variable.c (target_environment): If we find a v_noexport
81         variable for SHELL, add a SHELL variable with the env_shell value.
82         * doc/make.texi (Quick Reference): Document the POSIX behavior.
83         * doc/make.texi (Variables/Recursion): Ditto.
85 2004-11-28  Paul D. Smith  <psmith@gnu.org>
87         * main.c (find_and_set_default_shell) [WINDOWS32]: check for
88         equality of "cmd"/"cmd.exe", not inequality.  Fixes bug #11155.
89         Patch by Alessandro Vesely.
91 2004-11-12  Paul D. Smith  <psmith@gnu.org>
93         * job.c (child_execute_job) [VMS]: Don't treat "#" as a comment on
94         the command line if it's inside a string.
95         Patch by: Hartmut Becker <Hartmut.Becker@hp.com>
97 2004-10-21  Boris Kolpackov  <boris@kolpackov.net>
99         * function.c (func_lastword): New function: return last word
100         from the list of words.
101         * doc/make.texi: Document $(lastword ). Fix broken links in
102         Quick Reference section.
104 2004-10-06  Paul D. Smith  <psmith@gnu.org>
106         Apply patch from Alessandro Vesely, provided with bug # 9748.
107         Fix use of tmpnam() to work with Borland C.
109         * job.c (construct_command_argv_internal) [WINDOWS32]: Remove
110         construction of a temporary filename, and call new function
111         create_batch_filename().
112         (create_batch_filename) [WINDOWS32]: New function to create a
113         temporary filename.
115 2004-10-05  Boris Kolpackov  <boris@kolpackov.net>
117         * read.c (record_target_var): Expand simple pattern-specific
118         variable.
119         * variable.c (initialize_file_variables): Do not expand simple
120         pattern-specific variable.
122 2004-09-28  Boris Kolpackov  <boris@kolpackov.net>
124         * remake.c (update_file_1): When rebuilding makefiles inherit
125         dontcare flag from a target that triggered update.
127 2004-09-27  Boris Kolpackov  <boris@kolpackov.net>
129         * variable.c (initialize_file_variables): Mark pattern-specific
130         variable as a per-target and copy export status.
132 2004-09-21  Boris Kolpackov  <boris@kolpackov.net>
134         * file.c (snap_deps): Mark .PHONY prerequisites as targets.
136         * implicit.c (pattern_search): When considering an implicit rule's
137         prerequisite check that it is actually a target rather then
138         just an entry in the file hashtable.
140 2004-09-21  Paul D. Smith  <psmith@gnu.org>
142         * read.c (readstring): Fix some logic errors in backslash handling.
143         (eval): Remove some unnecessary processing in buffer handling.
144         (record_target_var): Assert that parse_variable_definition() succeeded.
145         Reported by: Markus Mauhart <qwe123@chello.at>.
147         * misc.c: Removed the sindex() function.  All instances of this
148         function were trivially replaceable by the standard strstr()
149         function, and that function will always have better (or certainly
150         no worse) performance than the very simple-minded algorithm
151         sindex() used.  This can matter with complex makefiles.
152         * make.h: Remove the prototype for sindex().
153         * function.c (subst_expand): Convert sindex() call to strstr().
154         This means we no longer need to track the TLEN value so remove that.
155         (func_findstring): Convert sindex() to strstr().
156         * commands.c (chop_commands): Convert sindex() calls to strstr().
157         Suggested by: Markus Mauhart <qwe123@chello.at>.
159         * main.c (find_and_set_default_shell) [WINDOWS32]: Implement the
160         idea behind Savannah Patch #3144 from david.baird@homemail.com.
161         If SHELL is set to CMD.EXE then assume it's batch-mode and
162         non-unixy.  I wrote the code differently from the patch, though,
163         to make it safer.  This also resolves bug #9174.
165 2004-09-20  Paul D. Smith  <psmith@gnu.org>
167         * expand.c (variable_expand_string): Modify to invoke
168         patsubst_expand() instead of subst_expand(); the latter didn't
169         handle suffix patterns correctly.
170         * function.c (subst_expand): Remove the SUFFIX_ONLY parameter; it
171         was used only from variable_expand_string() and is no longer used
172         there.
173         (func_subst): Ditto, on call to subst_expand().
174         (patsubst_expand): Require the percent pointers to point to the
175         character after the %, not to the % itself.
176         * read.c (record_files): New call criteria for patsubst_expand().
177         * variable.h: Remove SUFFIX_ONLY from subst_expand() prototype.
178         This is to fix a bug reported by Markus Mauhart <qwe123@chello.at>.
180 2004-09-19  Paul D. Smith  <psmith@gnu.org>
182         * function.c (subst_expand): Fix a check in by_word: look for a
183         previous blank if we're beyond the beginning of the string, not
184         the beginning of the word.
185         Bugs reported by Markus Mauhart <qwe123@chello.at>.
187 2004-05-16  Paul D. Smith  <psmith@gnu.org>
189         * remake.c (update_goal_chain): Change the argument specifying
190         whether we're rebuilding makefiles to be a global variable,
191         REBUILDING_MAKEFILES.
192         (complain): Extract the code that complains about no rules to make
193         a target into a separate function.
194         (update_file_1): If we tried to rebuild a file during the makefile
195         rebuild phase and it was dontcare, then no message was printed.
196         If we then try to build the same file during the normal build,
197         print a message this time.
198         (remake_file): Don't complain about un-remake-able files when
199         we're rebuilding makefiles.
201 2004-05-11  Paul D. Smith  <psmith@gnu.org>
203         * job.c (construct_command_argv_internal): OS/2 patches from
204         Andreas Buening <andreas.buening@nexgo.de>.
206 2004-05-10  Paul D. Smith  <psmith@gnu.org>
208         * remake.c (update_file): Don't walk the double-colon chain unless
209         this is a double-colon rule.  Fix suggested by Boris Kolpackov
210         <boris@kolpackov.net>.
212         * makefile.vms (CFLAGS): Remove glob/globfree (see readme.vms docs)
213         * readme.vms: New section describing OpenVMS support and issues.
214         * default.c (default_variables): Add support for IA64.
215         * job.c (tryToSetupYAst) [VMS]: On VMS running make in batch mode
216         without some privilege aborts make with the error
217         %SYSTEM-F-NOPRIV. It happens when setting up a handler for
218         pressing Ctrl+Y and the input device is no terminal. The change
219         catches this error and just continues.
221         Patches by Hartmut Becker <Hartmut.Becker@hp.com>
223 2004-04-25  Paul D. Smith  <psmith@gnu.org>
225         * commands.c (set_file_variables): Set $< properly in the face of
226         order-only prerequisites.
227         Patch from Boris Kolpackov <boris@kolpackov.net>
229 2004-04-21  Bob Byrnes  <byrnes@curl.com>
231         * main.c (main): Notice failures to remake makefiles.
233 2004-03-28  Paul D. Smith  <psmith@gnu.org>
235         Patches for Acorn RISC OS by Peter Naulls <peter@chocky.org>
237         * job.c: No default shell for RISC OS.
238         (load_too_high): Hard-code the return to 1.
239         (construct_command_argv_internal): No sh_chars or sh_cmds.
240         * getloadavg.c: Don't set LOAD_AVE_TYPE on RISC OS.
242 2004-03-20  Paul D. Smith  <psmith@gnu.org>
244         * variable.c (do_variable_definition): Don't append from the
245         global set if a previous non-appending target-specific variable
246         definition exists.  Reported by Oliver Schmidt <oschmidt@gmx.net>
247         (with fix).
249         * expand.c (reference_variable): Don't give up on variables with
250         no value that have the target-specific append flag set: they might
251         have a value after all.  Reported by Oliver Schmidt
252         <oschmidt@gmx.net> (with fix) and also by Maksim A. Nikulin
253         <nikulin@dx1cmd.inp.nsk.su>.
255         * rule.c (count_implicit_rule_limits): Don't delete patterns which
256         refer to absolute pathnames in directories that don't exist: some
257         portion of the makefile could create those directories before we
258         match the pattern.  Fixes bugs #775 and #108.
260         Fixes from Jonathan R. Grant  <jg-make@jguk.org>:
262         * main.c (main): Free makefile_mtimes if we have any.
263         * README.W32.template: Update documentation for the current status
264         of the MS-Windows port.
265         * NMakefile.template (MAKE): Add "MAKE = nmake".  A conflicting
266         environment variable is sometimes already defined which causes the
267         build to fail.
268         * main.c (debug_signal_handler): Only define this function if
269         SIGUSR1 is available.
271         Fixes for OS/2 from Andreas Beuning <andreas.buening@nexgo.de>:
273         * configure.in [OS/2]: Relocate setting of HAVE_SA_RESTART for OS/2.
274         * README.OS2.template: Documentation updates.
275         * build.template: Add LIBINTL into LOADLIBES.  Add $CFLAGS to the
276         link line for safety.
277         * maintMakefile (build.sh.in): Remove an extraneous ")".
278         * job.c (child_execute_job): Close saved FDs.
279         * job.c (exec_command) [OS/2]: exec_command(): If the command
280         can't be exec'ed and if the shell is not Unix-sh, then try again
281         with argv = { "cmd", "/c", ... }. Normally, this code is never
282         reached for the cmd shell unless the command really doesn't exist.
283         (construct_command_argv_internal) [OS/2]: The code for cmd
284         handling now uses new_argv = { "cmd", "/c", "original line", NULL}.
285         The CMD builtin commands are case insensitive so use strcasecmp().
287 2004-03-19  Paul D. Smith  <psmith@gnu.org>
289         * read.c (do_define): Re-order line counter increment so the count
290         is accurate (we were losing one line per define).  Reported by
291         Dave Yost <Dave@Yost.com>.
293 2004-03-06  Paul D. Smith  <psmith@gnu.org>
295         * configure.in (HAVE_ANSI_COMPILER): Define if we have an ANSI/ISO
296         compiler.
297         * make.h: Convert uses of __STDC__ to HAVE_ANSI_COMPILER.
298         * misc.c (message,error,fatal): Ditto.
299         * configh.dos.template: Define HAVE_ANSI_COMPILER.
300         * config.h.W32.template: Ditto.
301         * config.h-vms.template: Ditto.
302         * config.ami.template: Ditto.
304 2004-03-04  Paul D. Smith  <psmith@gnu.org>
306         * README.template: Add a note about broken /bin/sh on SunOS
307         4.1.3_U1 & 4.1.4.  Fix up Savannah links.
309         * misc.c (message, error, fatal): Don't use "..." if we're using
310         varargs.  ansi2knr should handle this but it doesn't work: it
311         translates "..." to va_dcl etc. but _AFTER_ the preprocessor is
312         done.  On many systems (SunOS for example) va_dcl is a #define.
313         So, force the use of the non-"..." version on pre-ANSI compilers.
315         * maintMakefile (sign-dist): Create some rules to help automate
316         the new GNU ftp upload method.
318 2004-02-24  Paul D. Smith  <psmith@gnu.org>
320         * config.h.W32.template: Add HAVE_STDARG_H
321         * config.h-vms.template: Ditto.
322         * config.ami.template: Ditto.
324 2004-02-23  Jonathan Grant  <jg-make@jguk.org>
326         * README.W32.template: Add a notation about -j with BATCH_MODE_ONLY.
327         * build_w32.bat: Remove extra "+".
329 2004-02-23  Paul D. Smith  <psmith@gnu.org>
331         * make.h: Create an UNUSED macro to mark unused parameters.
332         * (many): Clean up warnings by applying UNUSED, fixing
333         signed/unsigned incompatibilities, etc.
335         * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add quoting to silence
336         autoconf warnings.
337         * filedef.h: Name the command_state enumeration.
338         * file.c (set_command_state): Use the enumeration in the function
339         argument.
341         * configure.in: Explicitly set SET_MAKE to empty, to disable
342         MAKE=make even when no make already exists.  Fix bug #3823.
344 2004-02-22  Paul D. Smith  <psmith@gnu.org>
346         * maintMakefile: Perl script to clean up all non-CVS files.  Use
347         it on all the subdirectories for the cvs-clean target.
349         * main.c (decode_switches): Require non-empty strings for all our
350         string command-line options.  Fixes Debian bug # 164165.
352         * configure.in: Check for stdarg.h and varargs.h.
353         * make.h (USE_VARIADIC): Set this if we can use variadic functions
354         for printing messages.
355         * misc.c: Check USE_VARIADIC instead of (obsolete) HAVE_STDVARARGS.
356         (message): Ditto.
357         (error): Ditto.
358         (fatal): Ditto.
360         A number of patches for OS/2 support from Andreas Buening
361         <andreas.buening@nexgo.de>:
363         * job.c (child_handler) [OS/2]: Allow this on OS/2 but we have to
364         disable the SIGCHLD handler.
365         (reap_children) [OS/2]: Remove special handling of job_rfd.
366         (set_child_handler_action_flags) [OS/2]: Use this function in OS/2.
367         (new_job) [OS/2]: Disable the SIGCHLD handler on OS/2.
368         * main.c (main) [OS/2]: Special handling for paths in OS/2.
369         * configure.in [OS/2]: Force SA_RESTART for OS/2.
370         * Makefile.am (check-regression): Use $(EXEEXT) for Windows-type
371         systems.
373 2004-02-21  Paul D. Smith  <psmith@gnu.org>
375         * w32/subproc/sub_proc.c (process_easy) [W32]: Christoph Schulz
376         <mail@kristov.de> reports that if process_begin() fails we don't
377         handle the error condition correctly in all cases.
378         * w32/subproc/w32err.c (map_windows32_error_to_string): Make sure
379         to have a newline on the message.
381         * job.c (construct_command_argv_internal): Add "test" to UNIX
382         sh_cmds[].  Fixes Savannah bug # 7606.
384 2004-02-04  Paul D. Smith  <psmith@gnu.org>
386         * job.c (vms_handle_apos) [VMS]: Fix various string handling
387         situations in VMS DCL.  Fixes Savannah bug #5533.  Fix provided by
388         Hartmut Becker <Hartmut.Becker@hp.com>.
390 2004-01-21  Paul D. Smith  <psmith@gnu.org>
392         * job.c (load_too_high): Implement an algorithm to control the
393         "thundering herd" problem when using -l to control job creation
394         via the load average.  The system only recomputes the load once a
395         second but we can start many jobs in a second.  To solve this we
396         keep track of the number of jobs started in the last second and
397         apply a weight to try to guess what a correct load would be.
398         The algorithm was provided by Thomas Riedl <thomas.riedl@siemens.com>.
399         Also fixes bug #4693.
400         (reap_children): Decrease the job count for this second.
401         (start_job_command): Increase the job count for this second.
403         * read.c (conditional_line): Expand the text after ifn?def before
404         checking to see if it's a single word.  Fixes bug #7257.
406 2004-01-09  Paul D. Smith  <psmith@gnu.org>
408         * file.c (print_file): Recurse to print all targets in
409         double-colon rules.  Fixes bug #4518, reported (with patch) by
410         Andrew Chatham <chatham@google.com>.
412 2004-01-07  Paul D. Smith  <psmith@gnu.org>
414         * acinclude.m4: Remove make_FUNC_SETVBUF_REVERSED.
415         * configure.in: Change make_FUNC_SETVBUF_REVERSED to
416         AC_FUNC_SETVBUF_REVERSED.
418         * doc/make.texi (Target-specific): Fix Savannah bug #1772.
419         (MAKE Variable): Fix Savannah bug #4898.
421         * job.c (construct_command_argv_internal): Add "!" to the list of
422         shell escape chars.  POSIX sh allows it to appear before a
423         command, to negate the exit code.  Fixes bug #6404.
425         * implicit.c (pattern_search): When matching an implicit rule,
426         remember which dependencies have the ignore_mtime flag set.
427         Original fix provided in Savannah patch #2349, by Benoit
428         Poulot-Cazajous <Benoit.Poulot-Cazajous@jaluna.com>.
430 2003-11-22  Paul D. Smith  <psmith@gnu.org>
432         * README.W32.template (Outputs): Clarification on -j with
433         BATCH_MODE_ONLY_SEHLL suggested by Jonathan R. Grant
434         <jg-make@jguk.org>.
436 2003-11-02  Paul D. Smith  <psmith@gnu.org>
438         * function.c (func_if): Strip all the trailing whitespace from the
439         condition, then don't expand it.  Fixed bug # 5798.
441         * expand.c (recursively_expand_for_file): If we're expanding a
442         variable with no file context, then use the variable's context.
443         Fixes bug # 6195.
445 2003-10-21  Paul D. Smith  <psmith@gnu.org>
447         * main.c (log_working_directory): Add newlines to printf()s.
449         * README.cvs: Add a note to ignore warnings during autoreconf.
451         * maintMakefile (po_repo): Set a new URL for PO file updates.
452         (get-config/config.guess get-config/config.sub): Get these files
453         from the Savannah config project instead of ftp.gnu.org.
455 2003-10-05  Paul Eggert  <eggert@twinsun.com>
457         * main.c (main): Avoid potential subscript error if environ has
458         short strings.
460 2003-08-22  Paul D. Smith  <psmith@gnu.org>
462         * misc.c (xmalloc, xrealloc): Add one to 0 sizes, to cater to
463         systems which don't yet implement the C89 standard :-/.
465 2003-07-18  Paul D. Smith  <psmith@gnu.org>
467         * dir.c (directory_contents_hash_1, directory_contents_hash_1)
468         [WINDOWS32]: Initialize hash.
470 2003-06-19  Earnie Boyd  <earnie@uses.sf.net>
472         * dir.c (read_dirstream): Provide a workaround for broken versions of
473         the MinGW dirent structure.
475 2003-05-30  Earnie Boyd  <earnie@users.sf.net>
477         * w32/include/dirent.h: Add __MINGW32__ filter.
479 2003-05-30  Earnie Boyd  <earnie@users.sf.net>
481         * make.h: Add global declaration of *make_host.
482         * main.c (print_usage): Remove local declaration of *make_host.
483         (print_version): Display "This program built for ..." after Copyright
484         notice.
486 2003-05-30  Earnie Boyd  <earnie@users.sf.net>
488         * doc/make.texi: Change "ifinfo" to "ifnottex" as suggested by the
489         execution of "makeinfo --html make.texi".
491 2003-04-30  Paul D. Smith  <psmith@gnu.org>
493         * build.template: Make some changes to maybe allow this script to
494         work on DOS/Windows/OS2 systems.  Suggested by Andreas Buening.
496         * README.OS2.template: New file for OS/2 support.  Original
497         contributed by Andreas Buening.
498         * configure.in: Invoke new pds_AC_DOS_PATHS macro to test for
499         DOS-style paths.
501 2003-04-19  Paul D. Smith  <psmith@gnu.org>
503         Fix bug #1405: allow a target to match multiple pattern-specific
504         variables.
506         * rule.c (create_pattern_var, lookup_pattern_var): Move these to
507         variable.c, where they've always belonged.
508         * rule.h: Move the prototypes and struct pattern_var as well.
509         * variable.c (initialize_file_variables): Invoke
510         lookup_pattern_var() in a loop, until no more matches are found.
511         If a match is found, create a new variable set for the target's
512         pattern variables.  Then merge the contents of each matching
513         pattern variable set into the target's pattern variable set.
514         (lookup_pattern_var): Change this function to be usable
515         in a loop.  It takes a starting position: if NULL, start at the
516         beginning; if non-NULL, start with the pattern variable after that
517         position, and return the next matching pattern.
518         (create_pattern_var): Create a unique instance of
519         pattern-specific variables for every definition in the makefile.
520         Don't combine the same pattern together.  This allows us to
521         process the variable handling properly even when the same pattern
522         is used multiple times.
523         (parse_variable_definition): New function: break out the parsing
524         of a variable definition line from try_variable_definition.
525         (try_variable_definition): Call parse_variable_definition to
526         parse.
527         (print_variable_data_base): Print out pattern-specific variables.
528         * variable.h (struct variable): Remember when a variable is
529         conditional.  Also remember its flavor.
530         (struct pattern_var): Instead of keeping a variable set, we just
531         keep a single variable for each pattern.
532         * read.c (record_target_var): Each pattern variable contains only a
533         single variable, not a set, so create it properly.
534         * doc/make.texi (Pattern-specific): Document the new behavior.
536 2003-04-17  Paul D. Smith  <psmith@gnu.org>
538         * dir.c (file_exists_p) [VMS]: Patch provided with Bug #3018 by
539         Jean-Pierre Portier <portierjp2@free.fr>.  I don't understand the
540         file/directory naming rules for VMS so I can't tell whether this
541         is correct or not.
543 2003-04-09  Paul D. Smith  <psmith@gnu.org>
545         * configure.in (HAVE_DOS_PATHS): Define this on systems that need
546         DOS-style pathnames: backslash separators and drive specifiers.
548 2003-03-28  Paul D. Smith  <psmith@gnu.org>
550         * file.c (snap_deps): If .SECONDARY with no targets is given, set
551         the intermediate flag on all targets.  Fixes bug #2515.
553 2003-03-24  Paul D. Smith  <psmith@gnu.org>
555         * configure.in, Makefile.am, glob/Makefile.am, doc/Makefile.am:
556         Upgrade to autoconf 2.57 and automake 1.7.3.
558         * job.c: More OS/2 changes from Andreas Buening.
560         * file.c (print_file): Fix variable initialization.
561         Fixes bug #2892.
563         * remake.c (notice_finished_file):
565         * make.h (ENULLLOOP): Set errno = 0 before invoking the command;
566         some calls (like readdir()) return NULL in valid situations
567         without resetting errno.  Fixes bug #2846.
569 2003-02-25  Paul D. Smith  <psmith@gnu.org>
571         Port to OS/2 (__EMX__) by Andreas Buening <andreas.buening@nexgo.de>.
573         * job.c (_is_unixy_shell) [OS/2]: New function.
574         Set default shell to /bin/sh.
575         (reap_children): Close the job_rfd pipe here since we don't use a
576         SIGCHLD handler.
577         (set_child_handler_action_flags): define this to empty on OS/2.
578         (start_job_command): Close the jobserver pipe and use
579         child_execute_job() instead of fork/exec.
580         (child_execute_job): Rewrite to handle stdin/stdout FDs and spawn
581         rather than exec'ing, then reconfigure stdin/stdout.
582         (exec_command): Rewrite to use spawn instead of exec.  Return the
583         PID of the child.
585         * main.c (main) [OS/2]: Call initialize_main().  Handle argv[0] as
586         in DOS.  Handle the TEMP environment variable as in DOS.  Don't
587         use a SIGCHLD handler on OS/2.  Choose a shell as in DOS.  Don't
588         use -j in DOS mode.  Use child_execute_job() instead of
589         exec_command().
591         * function.c (func_shell) [OS/2]: Can't use fork/exec on OS/2: use
592         spawn() instead.
594         * job.h [OS/2]: Move CLOSE_ON_EXEC here from job.c.  Add
595         prototypes that return values.
597         * remake.c (f_mtime) [OS/2]: Handle FAT timestamp offsets for OS/2.
599         * read.c (readline) [OS/2]: Don't handle CRLF specially on OS/2.
600         * default.c (default_suffixes) [OS/2]: Set proper default suffixes
601         for OS/2.
602         * vpath.c (construct_vpath_list) [OS/2]: Handle OS/2 paths like
603         DOS paths.
605 2003-02-24  Paul D. Smith  <psmith@gnu.org>
607         * default.c [VMS]: New default rules for .cxx -> .obj compiles.
608         * job.c (child_execute_job) [VMS]: New code for handling spawn().
609         (child_execute_job) [VMS]: Handle error status properly.
610         Patches provided by Hartmut Becker <Hartmut.Becker@compaq.com>.
612         * function.c (func_shell): Use EINTRLOOP() while reading from the
613         subshell pipe (Fixes bug #2502).
614         * job.c (free_child): Use EINTRLOOP() while writing tokens to the
615         jobserver pipe.
616         * main.c (main): Ditto.
618 2003-01-30  Paul D. Smith  <psmith@gnu.org>
620         * read.c (eval): eval() was not fully reentrant, because the
621         collapsed buffer was static.  Change it to be an automatic
622         variable so that eval() can be invoked recursively.
623         Fixes bug # 2238.
624         (eval): Apply patch # 1022: fix memory reference error on long
625         target-specific variable lines.
626         Patch provided by Steve Brown <Steve.Brown@macquarie.com>.
628         * function.c (check_numeric): Combine the is_numeric() function
629         into this function, since it's only called from one place.
630         Constify this function.  Have it print the incorrect string in the
631         error message.  Fixes bug #2407.
632         (strip_whitespace): Constify.
633         (func_if): Constify.
634         * expand.c (expand_argument): Constify.
636 2003-01-29  Paul D. Smith  <psmith@gnu.org>
638         Fix bug # 2169, also reported by other people on various systems.
640         * make.h: Some systems, such as Solaris and PTX, do not fully
641         implement POSIX-compliant SA_RESTART functionality; important
642         system calls like stat() and readdir() can still fail with EINTR
643         even if SA_RESTART has been set on the signal handler.  So,
644         introduce macros EINTRLOOP() and ENULLLOOP() which can loop on
645         EINTR for system calls which return -1 or 0 (NULL), respectively,
646         on error.
647         Also, remove the old atomic_stat()/atomic_readdir() and
648         HAVE_BROKEN_RESTART handling.
650         * configure.in: Remove setting of HAVE_BROKEN_RESTART.
652         * arscan.c (ar_member_touch): Use EINTRLOOP() to wrap fstat().
653         * remake.c (touch_file): Ditto.
655         * commands.c (delete_target): Use EINTRLOOP() to wrap stat().
656         * read.c (construct_include_path): Ditto.
657         * remake.c (name_mtime): Ditto.
658         * vpath.c (selective_vpath_search): Ditto.
659         * dir.c (find_directory): Ditto.
660         (local_stat): Ditto.
661         (find_directory): Use ENULLLOOP() to wrap opendir().
662         (dir_contents_file_exists_p): Use ENULLLOOP() to wrap readdir().
664         * misc.c: Remove HAVE_BROKEN_RESTART, atomic_stat(), and
665         atomic_readdir() handling.
667 2003-01-22  Paul D. Smith  <psmith@gnu.org>
669         * function.c (func_call): Fix Bug #1744.  If we're inside a
670         recursive invocation of $(call ...), mask any of the outer
671         invocation's arguments that aren't used by this one, so that this
672         invocation doesn't "inherit" them accidentally.
674 2002-12-05  Paul D. Smith  <psmith@gnu.org>
676         * function.c (subst_expand): Valery Khamenia reported a
677         pathological performance hit when doing substitutions on very
678         large values with lots of words: turns out we were invoking
679         strlen() a ridiculous number of times.  Instead of having each
680         call to sindex() call strlen() again, keep track of how much of
681         the text we've seen and pass the length to sindex().
683 2002-11-19  Paul D. Smith  <psmith@gnu.org>
685         * README.cvs, configure.in: Upgrade to require autoconf 2.56.
688 2002-11-16  Paul D. Smith  <psmith@gnu.org>
690         * NMakefile.template (OBJS): Add hash.c object file.
691         * SMakefile.template (srcs): Ditto.
692         * Makefile.ami (objs): Ditto.
693         * build_w32.bat: Ditto.
695         * Makefile.DOS.template: Remove extra dependencies.
697 2002-10-25  Paul D. Smith  <psmith@gnu.org>
699         * expand.c (install_variable_buffer): New function.  Install a new
700         variable_buffer context and return the previous one.
701         (restore_variable_buffer): New function.  Free the current
702         variable_buffer context and put a previously saved one back.
703         * variable.h: Prototypes for {install,restore}_variable_buffer.
704         * function.c (func_eval): Push a new variable_buffer context
705         before we eval, then restore the old one when we're done.
706         Fixes Bug #1517.
708         * read.c (install_conditionals): New function.  Install a new
709         conditional context and return the previous one.
710         (restore_conditionals): New function.  Free the current
711         conditional context and put a previously saved one back.
712         (eval): Use the {install,restore}_conditionals for "include"
713         handling.
714         (eval_buffer): Use {install,restore}_conditionals to preserve the
715         present conditional state before we evaluate the buffer.
716         Fixes Bug #1516.
718         * doc/make.texi (Quick Reference): Add references to $(eval ...)
719         and $(value ...).
720         (Recursion): Add a variable index entry for CURDIR.
722         * README.cvs: Update to appropriate versions.
723         * Makefile.am (nodist_loadavg_SOURCES): automake gurus point out I
724         don't need to copy loadavg.c: automake is smart enough to create
725         it for me.  Still have a bug in automake related to ansi2knr tho.
727 2002-10-14  Paul D. Smith  <psmith@gnu.org>
729         * remake.c (notice_finished_file): Only touch targets if they have
730         at least one command (as per POSIX).  Resolve Bug #1418.
732         * *.c: Convert to using ANSI C-style function definitions.
733         * Makefile.am: Enable the ansi2knr feature of automake.
734         * configure.in: ditto.
736 2002-10-13  Paul D. Smith  <psmith@gnu.org>
738         * commands.c (set_file_variables): Bug #1379: Don't use alloca()
739         for automatic variable values like $^, etc.  In the case of very
740         large lists of prerequisites this causes problems.  Instead reuse
741         a static buffer (resizeable) for each variable.
743         * read.c (eval): Fix Bug #1391: allow "export" keyword in
744         target-specific variable definitions.  Check for it and set an
745         "exported" flag.
746         (record_target_var): Set the export field to v_export if the
747         "exported" flag is set.
748         * doc/make.texi (Target-specific): Document the ability to use
749         "export".
751         * doc/make.texi: Change the name of the section on automatic
752         variables from "Automatic" to "Automatic Variables".  Added text
753         clarifying the scope of automatic variables.
755 2002-10-04  Paul D. Smith  <psmith@gnu.org>
757         * read.c (eval): Allow SysV $$@ variables to use {} braces as well
758         as () braces.
759         (record_files): Ditto.
761         * expand.c (variable_expand_string): In $(A:x=y) expansion limit
762         the search for the '=' to only within the enclosing parens.
764 2002-10-03  Paul D. Smith  <psmith@gnu.org>
766         Version 3.80 released.
768         * dir.c: Change hash functions to use K&R function definition style.
769         * function.c: Ditto.
770         * read.c: Ditto.
771         * variable.c: Ditto.
773         Update to automake 1.7.
775         * Makefile.am (AUTOMAKE_OPTIONS): Update to require 1.7.
776         (pdf): Remove this target as automake now provides one.
778         * configure.in: Change AM_CONFIG_HEADER to AC_CONFIG_HEADERS.
780 2002-09-30  Martin P.J. Zinser  <zinser@decus.de>
782         * makefile.com: Updates for GNU make 3.80.
783         * makefile.vms: Ditto.
785 2002-09-23  Paul D. Smith  <psmith@gnu.org>
787         * read.c (enum make_word_type): Remove w_comment.
788         (get_next_mword): Don't treat comment characters as special; where
789         this function is used we will never see a comment (it's stripped
790         before we get here) and treating comments specially means that
791         targets like "foo\#bar" aren't handled properly.
793 2002-09-18  Paul D. Smith  <psmith@gnu.org>
795         * doc/make.texi (Bugs): Update with some info on Savannah, etc.
797         * read.c (eval): Expansion of arguments to export/unexport was
798         ignoring all arguments after the first one.  Change the algorithm
799         to expand the whole line once, then parse the results.
801 2002-09-17  Paul D. Smith  <psmith@gnu.org>
803         Fix Bug #940 (plus another bug I found while looking at this):
805         * read.c (record_target_var): enter_file() will add a new entry if
806         it's a double-colon target: we don't want to do that in this
807         situation.  Invoke lookup_file() and only enter_file() if it does
808         not already exist.  If the file we get back is a double-colon then
809         add this variable to the "root" double-colon target.
811         * variable.c (initialize_file_variables): If this file is a
812         double-colon target but is not the "root" target, then initialize
813         the root and make the root's variable list the parent of our
814         variable list.
816 2002-09-13  Paul D. Smith  <psmith@gnu.org>
818         * doc/make.texi (MAKE Variable): Add some indexing for "+".
820         * hash.c (round_up_2): Get rid of a warning.
822 2002-09-12  Paul D. Smith  <psmith@gnu.org>
824         * Makefile.am (loadavg_SOURCES, loadavg.c): Tiptoe around automake
825         so it doesn't complain about getloadavg.c.
827         * commands.c (set_file_variables): Make sure we always alloca() at
828         least 1 character for the value of $? (for '\0').
830 2002-09-11  Paul D. Smith  <psmith@gnu.org>
832         * hash.h (STRING_COMPARE, ISTRING_COMPARE, STRING_N_COMPARE): Fix
833         macro to use RESULT instead of the incorrect _RESULT_.
835         * make.h (HAVE_BROKEN_RESTART): Add prototypes for atomic_stat()
836         and atomic_readdir().  We need to #include dirent.h to get this to
837         work.
838         * misc.c (atomic_readdir): Fix typos.
840 2002-09-10  Paul D. Smith  <psmith@gnu.org>
842         * read.c (eval): Expand variable lists given to export and
843         unexport, so that "export $(LIST_OF_VARIABLES)" (etc.) works.
844         (conditional_line): Ditto for "ifdef".  Fixes bug #103.
846         * doc/make.texi (Variables/Recursion): Document this.
847         (Conditional Syntax): And here.
849 2002-09-09  Paul D. Smith  <psmith@gnu.org>
851         * configure.in: Check for memmove().
853 2002-09-07  Paul D. Smith  <psmith@gnu.org>
855         * configure.in (HAVE_BROKEN_RESTART): Define this on PTX systems;
856         Michael Sterrett <msterret@coat.com> reports that while it has
857         SA_RESTART, it does not work properly.
859         * misc.c (atomic_stat): If HAVE_BROKEN_RESTART, create a function
860         that invokes stat() and loops to do it again if it returns EINTR.
861         (atomic_readdir): Ditto, with readdir().
863         * make.h (stat, readdir): If HAVE_BROKEN_RESTART, alias stat()
864         and readdir() to atomic_stat() and atomic_readdir().
866 2002-09-04  Paul D. Smith  <psmith@gnu.org>
868         * implicit.c (pattern_search): Daniel <barkalow@reputation.com>
869         reports that GNU make sometimes doesn't recognize that targets can
870         be made, when directories can be created as prerequisites.  He
871         reports that changing the order of predicates in the DEP->changed
872         flag test so that lookup_file() is always performed, solves this
873         problem.
875 2002-08-08  Paul D. Smith  <psmith@gnu.org>
877         * configure.in: Require a newer version of gettext.
879         * misc.c (perror_with_name): Translate the format string (for
880         right-to-left language support).
881         (pfatal_with_name): Ditto.
883         * main.c: Create a static array of strings to store the usage
884         text.  This is done to facilitate translations.
885         (struct command_switch): Remove argdesc and description fields.
886         (switches): Remove values for obsolete fields.
887         (print_usage): Print each element of the usage array.
889         * hash.c: Change function definitions to be K&R style.
891 2002-08-02  Paul D. Smith  <psmith@gnu.org>
893         * NEWS: Remove the mention of .TARGETS; we aren't going to publish
894         this one because it's too hard to get right.  We'll look at it for
895         a future release.
896         * main.c (main): Don't create the .TARGETS variable.
897         * variable.c (handle_special_var): Don't handle .TARGETS.
899 2002-08-01  Paul D. Smith  <psmith@gnu.org>
901         * main.c (switches): Add a new option, -B (--always-make).  If
902         specified, make will rebuild all targets that it encounters even
903         if they don't appear to be out of date.
904         (always_make_flag): New flag.
905         * make.h: Extern always_make_flag.
906         * remake.c (update_file_1): Check always_make_flag; if it's set we
907         will always rebuild any target we can, even if none of its
908         prerequisites are newer.
909         * NEWS: Mention it.
911         * doc/make.texi (Shell Function): Make it clear that make
912         variables marked as "export" are not passed to instances of the
913         shell function.
915         Add new introspection variable .VARIABLES and .TARGETS.
917         * variable.c (handle_special_var): New function.  If the variable
918         reference passed in is "special" (.VARIABLES or .TARGETS),
919         calculate the new value if necessary.  .VARIABLES is handled here:
920         walk through the hash of defined variables and construct a value
921         which is a list of the names.  .TARGETS is handled by
922         build_target_list().
923         (lookup_variable): Invoke handle_special_var().
924         * file.c (build_target_list): Walk through the hask of known files
925         and construct a list of the names of all the ones marked as
926         targets.
927         * main.c (main): Initialize them to empty (and as simple variables).
928         * doc/make.texi (Special Variables): Document them.
929         * NEWS: Mention them.
931         * variable.h (struct variable): Add a new flag "exportable" which
932         is true if the variable name is valid for export.
933         * variable.c (define_variable_in_set): Set "exportable" when a new
934         variable is defined.
935         (target_environment): Use the "exportable" flag instead of
936         re-checking the name here... an efficiency improvement.
938 2002-07-31  Paul D. Smith  <psmith@gnu.org>
940         * config.h-vms.template: Updates to build on VMS.  Thanks to
941         Brian_Benning@aksteel.com for helping verify the build.
942         * makefile.com: Build the new hash.c file.
943         * hash.h: Use strcpmi(), not stricmp(), in the
944         HAVE_CASE_INSENSITIVE_FS case.
946 2002-07-30  Paul D. Smith  <psmith@gnu.org>
948         * hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Add missing
949         backslashes to the HAVE_CASE_INSENSITIVE_FS case.
950         Reported by <Brian_Benning@aksteel.com>.
952 2002-07-10  Paul D. Smith  <psmith@gnu.org>
954         * variable.c (pop_variable_scope): Remove variable made unused by
955         new hash infrastructure.
956         * read.c (dep_hash_cmp): Rewrite this to handle ignore_mtime
957         comparisons as well as name comparisons.
958         * variable.h: Add a prototype for new hash_init_function_table().
959         * file.c (lookup_file): Remove variables made unused by new hash
960         infrastructure.
961         * dir.c (directory_contents_hash_2): Missing return of hash value.
962         (dir_contents_file_exists_p): Remove variables made unused by new
963         hash infrastructure.
966         Installed Greg McGary's integration of the hash functions from the
967         GNU id-utils package:
969 2002-07-10  Greg McGary  <greg@mcgary.org>
971         * scripts/functions/filter-out: Add literals to to the
972         pattern space in order to add complexity, and trigger
973         use of an internal hash table.  Fix documentation strings.
974         * scripts/targets/INTERMEDIATE: Reverse order of files
975         passed to expected `rm' command.
977 2002-07-10  Greg McGary  <greg@mcgary.org>
979         * Makefile.am (SRCS): Add hash.c (noinst_HEADERS): Add hash.h
980         * hash.c: New file, taken from id-utils.
981         * hash.h: New file, taken from id-utils.
983         * make.h (HASH, HASHI): Remove macros.
984         (find_char_unquote): Change arglist in decl.
985         (hash_init_directories): New function decl.
986         * variable.h (hash.h): New #include.
987         (MAKELEVEL_NAME, MAKELEVEL_LENGTH): New constants.
988         * filedef.h (hash.h): New #include.
989         (struct file) [next]: Remove member.
990         (file_hash_enter): Remove function decl.
991         (init_hash_files): New function decl.
993         * ar.c (ar_name): Delay call to strlen until needed.
994         * main.c (initialize_global_hash_tables): New function.
995         (main): Call it.  Use MAKELEVEL_NAME & MAKELEVEL_LENGTH.
996         * misc.c (remove_comments): Pass char constants to find_char_unquote.
997         * remake.c (notice_finished_file): Update last_mtime on `prev' chain.
999         * dir.c (hash.h): New #include.
1000         (struct directory_contents) [next, files]: Remove members.
1001         [ctime]: Add member for VMS.  [dirfiles]: Add hash-table member.
1002         (directory_contents_hash_1, directory_contents_hash_2,
1003         directory_contents_hash_cmp): New functions.
1004         (directories_contents): Change type to `struct hash_table'.
1005         (struct directory) [next]: Remove member.
1006         (directory_hash_1, directory_hash_2, directory_hash_cmp): New funcs.
1007         (directory): Change type to `struct hash_table'.
1008         (struct dirfile) [next]: Remove member.
1009         [length]: Add member.  [impossible]: widen type to fill alignment gap.
1010         (dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp): New functions.
1011         (find_directory): Use new hash table package.
1012         (dir_contents_file_exists_p): Likewise.
1013         (file_impossible): Likewise.
1014         (file_impossible_p): Likewise.
1015         (print_dir_data_base): Likewise.
1016         (open_dirstream): Likewise.
1017         (read_dirstream): Likewise.
1018         (hash_init_directories): New function.
1020         * file.c (hash.h): New #include.
1021         (file_hash_1, file_hash_2, file_hash_cmp): New functions.
1022         (files): Change type to `struct hash_table'.
1023         (lookup_file): Use new hash table package.
1024         (enter_file): Likewise.
1025         (remove_intermediates): Likewise.
1026         (snap_deps): Likewise.
1027         (print_file_data_base): Likewise.
1029         * function.c
1030         (function_table_entry_hash_1, function_table_entry_hash_2,
1031         function_table_entry_hash_cmp): New functions.
1032         (lookup_function): Remove `table' argument.
1033         Use new hash table package.
1034         (struct a_word) [chain, length]: New members.
1035         (a_word_hash_1, a_word_hash_2, a_word_hash_cmp): New functions.
1036         (struct a_pattern): New struct.
1037         (func_filter_filterout): Pass through patterns noting boundaries
1038         and '%', if present.  Note a_word length.  Use a hash table if
1039         arglists are large enough to justify cost.
1040         (function_table_init): Renamed from function_table.
1041         (function_table): Declare as `struct hash_table'.
1042         (FUNCTION_TABLE_ENTRIES): New constant.
1043         (hash_init_function_table): New function.
1045         * read.c (hash.h): New #include.
1046         (read_makefile): Pass char constants to find_char_unquote.
1047         (dep_hash_1, dep_hash_2, dep_hash_cmp): New functions.
1048         (uniquize_deps): Use hash table to efficiently identify duplicates.
1049         (find_char_unquote): Accept two char-constant stop chars, rather
1050         than a string constant, avoiding zillions of calls to strchr.
1051         Tighten inner search loops to test only for desired delimiters.
1053         * variable.c (variable_hash_1, variable_hash_2,
1054         variable_hash_cmp): New functions.
1055         (variable_table): Declare as `struct hash_table'.
1056         (global_variable_set): Remove initialization.
1057         (init_hash_global_variable_set): New function.
1058         (define_variable_in_set): Use new hash table package.
1059         (lookup_variable): Likewise.
1060         (lookup_variable_in_set): Likewise.
1061         (initialize_file_variables): Likewise.
1062         (pop_variable_scope): Likewise.
1063         (create_new_variable_set): Likewise.
1064         (merge_variable_sets): Likewise.
1065         (define_automatic_variables): Likewise.
1066         (target_environment): Likewise.
1067         (print_variable_set): Likewise.
1069 2002-07-10  Paul D. Smith  <psmith@gnu.org>
1071         Implement the SysV make syntax $$@, $$(@D), and $$(@F) in the
1072         prerequisite list.  A real SysV make will expand the entire
1073         prerequisites list _twice_: we don't do that as it's a big
1074         backward-compatibility problem.  We only replace those specific
1075         variables.
1077         * read.c (record_files): Replace any $@, $(@D), and $(@F) variable
1078         references left in the list of prerequisites.  Check for .POSIX as
1079         we record targets, so we can disable non-POSIX behavior while
1080         reading makefiles as well as running them.
1081         (eval): Check the prerequisite list to see if we have anything
1082         that looks like a SysV prerequisite variable reference.
1084 2002-07-09  Paul D. Smith  <psmith@gnu.org>
1086         * doc/make.texi (Prerequisite Types): Add a new section describing
1087         order-only prerequisites.
1089         * read.c (uniquize_deps): If we have the same file as both a
1090         normal and order-only prereq, get rid of the order-only prereq,
1091         since the normal one supersedes it.
1093 2002-07-08  Paul D. Smith  <psmith@gnu.org>
1095         * AUTHORS: Added Greg McGary to the AUTHORS file.
1096         * NEWS: Blurbed order-only prerequisites.
1097         * file.c (print_file): Show order-only deps properly when printing
1098         the database.
1100         * maintMakefile: Add "update" targets for wget'ing the latest
1101         versions of various external files.  Taken from Makefile.maint in
1102         autoconf, etc.
1104         * dosbuild.bat: Somehow we got _double_ ^M's.  Remove them.
1105         Reported by Eli Zaretskii <eliz@is.elta.co.il>.
1107 2002-07-07  Paul D. Smith  <psmith@gnu.org>
1109         * po/*.po: Remove.  We'll use wget to retrieve them at release
1110         time.
1112         * variable.c (do_variable_definition) [W32]: On W32 using cmd
1113         rather than a shell you get an exception.  Make sure we look up
1114         the variable.  Patch provided by Eli Zaretskii <eliz@is.elta.co.il>.
1116         * remake.c (notice_finished_file): Fix handling of -t flag.
1117         Patch provided by Henning Makholm <henning@makholm.net>.
1119         * implicit.c (pattern_search): Some systems apparently run short
1120         of stack space, and using alloca() in this function caused an
1121         overrun.  I modified it to use xmalloc() on the two variables
1122         which seemed like they might get large.  Fixes Bug #476.
1124         * main.c (print_version): Update copyright notice to conform with
1125         GNU standards.
1126         (print_usage): Update help output.
1128         * function.c (func_eval): Create a new make function, $(eval
1129         ...).  Expand the arguments, put them into a buffer, then invoke
1130         eval_buffer() on the resulting string.
1131         (func_quote): Create a new function, $(quote VARNAME).  Inserts
1132         the value of the variable VARNAME without expanding it any
1133         further.
1135         * read.c (struct ebuffer): Change the linebuffer structure to an
1136         "eval buffer", which can be either a file or a buffer.
1137         (eval_makefile): Move the code in the old read_makefile() which
1138         located a makefile into here: create a struct ebuffer with that
1139         information.  Have it invoke the new function eval() with that
1140         ebuffer.
1141         (eval_buffer): Create a new function that creates a struct ebuffer
1142         that holds a string buffer instead of a file.  Have it invoke
1143         eval() with that ebuffer.
1144         (eval): New function that contains the guts of the old
1145         read_makefile() function: this function parses makefiles.  Obtains
1146         data to parse from the provided ebuffer.  Some modifications to
1147         make the flow of the function cleaner and clearer.  Still could
1148         use some work here...
1149         (do_define): Takes a struct ebuffer instead of a FILE*.  Read the
1150         contents of the define/endef variable from the ebuffer.
1151         (readstring): Read the next line from a string-style ebuffer.
1152         (readline): Read the next line from an ebuffer.  If it's a string
1153         ebuffer, invoke readstring().  If it's a FILE* ebuffer, read it
1154         from the file.
1156         * dep.h (eval_buffer): Prototype eval_buffer();
1158         * variable.c (do_variable_definition): Make sure that all
1159         non-target-specific variables are registered in the global set.
1160         If we're invoked from an $(eval ...) we might be inside a $(call
1161         ...) or other function which has pushed a variable scope; we still
1162         want to define our variables from evaluated makefile code in the
1163         global scope.
1165 2002-07-03  Greg McGary  <greg@mcgary.org>
1167         * dep.h (struct dep) [ignore_mtime]: New member.
1168         [changed]: convert to a bitfield.
1169         * implicit.c (pattern_search): Zero ignore_mtime.
1170         * main.c (main, handle_non_switch_argument): Likewise.
1171         * rule.c (convert_suffix_rule): Likewise.
1172         * read.c (read_all_makefiles, read_makefile, multi_glob): Likewise.
1173         (read_makefile): Parse '|' in prerequisite list.
1174         (uniquize_deps): Consider ignore_mtime when comparing deps.
1175         * remake.c (update_file_1, check_dep): Don't force remake for
1176         dependencies that have d->ignore_mtime.
1177         * commands.c (FILE_LIST_SEPARATOR): New constant.
1178         (set_file_variables): Don't include a
1179         prerequisite in $+, $^ or $? if d->ignore_mtime.
1180         Define $|.
1182 2002-06-18  Paul D. Smith  <psmith@gnu.org>
1184         * make.texinfo: Updates for next revision.  New date/rev/etc.
1185         Recreate all Info menus.  Change license on the manual to the GNU
1186         Free Documentation License.  A number of typos.
1187         (Variables Simplify): Don't use "-" before it's defined.
1188         (Automatic Prerequisites): Rewrite the target example to work
1189         properly if the compile fails.  Remove incorrect comments about
1190         how "set -e" behaves.
1191         (Text Functions): Move the "word", "wordlist", "words", and
1192         "firstword" functions here, from "File Name Functions".
1193         * make-stds.texi: Update from latest GNU version.
1194         * fdl.texi: (created) Import the latest GNU version.
1196 2002-06-06  Paul D. Smith  <psmith@gnu.org>
1198         * variable.c (do_variable_definition): New function: extract the
1199         part of try_variable_definition() that actually sets the value
1200         into a separate function.
1201         (try_variable_definition): Call do_variable_definition() after
1202         parsing the variable definition string.
1203         (define_variable_in_set): Make the name argument const.
1205         * variable.h (enum variable_flavor): Make public.
1206         (do_variable_definition): Create prototype.
1208         * read.c (read_all_makefiles): Create a new built-in variable,
1209         MAKEFILE_LIST.
1210         (read_makefile): Add each makefile read in to this variable value.
1212 2002-05-18  Eli Zaretskii  <eliz@is.elta.co.il>
1214         * Makefile.DOS.template: Tweak according to changes in the
1215         distribution.  Add back the dependencies of *.o files.
1217         * configh.dos.template: Synchronize with config.h.in.
1219 2002-05-09  Paul D. Smith  <psmith@gnu.org>
1221         * file.c (file_timestamp_now): Use K&R function declaration.
1223         * getloadavg.c (getloadavg): Merge setlocale() fix from sh-utils
1224         getloadavg.c.  Autoconf thinks QNX is SVR4-like, but it isn't, so
1225         #undef it.  Remove predefined setup of NLIST_STRUCT.  Decide
1226         whether to include nlist.h based on HAVE_NLIST_H.  Change obsolete
1227         NLIST_NAME_UNION to new HAVE_STRUCT_NLIST_N_UN_N_NAME.
1228         * configure.in (NLIST_STRUCT): Define this if we have nlist.h and
1229         nlist.n_name is a pointer rather than an array.
1231         * acinclude.m4 (make_FUNC_SETVBUF_REVERSED): Grab the latest
1232         version of AC_FUNC_SETVBUF_REVERSED from autoconf CVS.
1233         * configure.in: Use it instead of the old version.
1235         * main.c (main): Prefer setvbuf() to setlinebuf().
1237 2002-05-08  Paul D. Smith  <psmith@gnu.org>
1239         * Makefile.am (make_LDADD): Add GETLOADAVG_LIBS.
1240         (loadavg_LDADD): Ditto.
1242 2002-04-29  Paul D. Smith  <psmith@gnu.org>
1244         * expand.c (recursively_expand_for_file): Rename
1245         recursively_expand() to recursively_expand_for_file() and provide
1246         an extra argument, struct file.  If the argument is provided, set
1247         the variable scope to that of the file before expanding.
1248         * variable.h (recursively_expand): Make this a macro that invokes
1249         recursively_expand_for_file() with a NULL file pointer.
1250         * variable.c (target_environment): Call the renamed function and
1251         provide the current file context.
1252         Fixes Debian bug #144306.
1254 2002-04-28  Paul D. Smith  <psmith@gnu.org>
1256         Allow $(call ...) user-defined variables to be self-referencing
1257         without throwing an error.  Allows implementation of transitive
1258         closures, among other possibly useful things.
1259         Requested by: Philip Guenther <guenther@sendmail.com>
1261         * variable.h (struct variable): Add a new field: exp_count, and
1262         new macros to hold its size and maximum value.
1263         (warn_undefined): Make this a macro.
1264         * variable.c (define_variable_in_set): Initialize it.
1265         * expand.c (recursively_expand): If we detect recursive expansion
1266         of a variable, check the exp_count field.  If it's greater than 0
1267         allow the recursion and decrement the count.
1268         (warn_undefined): Remove this (now a macro in variable.h).
1269         * function.c (func_call): Before we expand the user-defined
1270         function, modify its exp_count field to contain the maximum
1271         number of recursive calls we'll allow.  After the call, reset it
1272         to 0.
1274 2002-04-21  Paul D. Smith  <psmith@gnu.org>
1276         Modified to use latest autoconf (2.53), automake (1.6.1), and
1277         gettext (0.11.1).  We're using gettext's new "external" support,
1278         to avoid including libintl source with GNU make.
1280         * README.cvs: New file.  Explain how to build GNU make from CVS.
1282         * configure.in: Modify checking for the system glob library.
1283         Use AC_EGREP_CPP instead of AC_TRY_CPP.  Remove the setting of
1284         GLOBDIR (we will always put "glob" in SUBDIRS, so automake
1285         etc. will manage it correctly).  Set an automake conditional
1286         USE_LOCAL_GLOB to decide whether to compile the glob library.
1288         * getloadavg.c (main): Include make.h in the "TEST" program to
1289         avoid warnings.
1291         * Makefile.am: Remove special rules for loadavg.  Replace them
1292         with Automake capabilities for building extra programs.
1294         * signame.c: This file does nothing if the system provide
1295         strsignal().  If not, it implements strsignal().  If the system
1296         doesn't define sys_siglist, then we make our own; otherwise we use
1297         the system version.
1298         * signame.h: Removed.
1300         * main.c (main): No need to invoke signame_init().  Update copyright.
1302         * ABOUT-NLS: Removed.
1303         * gettext.c: Removed.
1304         * gettext.h: Get a simplified copy from the gettext package.
1305         * po/*: Created.
1306         * i18n/*.po: Moved to po/.
1307         * i18n/: Removed.
1309         * config/*: Created.  Contains package configuration helper files.
1310         * config.guess, config.sub: Moved to config directory.
1312         * configure.in (AC_CONFIG_FILES): Add po/Makefile.in, config/Makefile.
1313         Rework to use new-style autoconf features.  Use the "external"
1314         mode for gettext.  Make the build.sh config file conditional on
1315         whether build.sh.in exists, to avoid autoconf errors.
1316         * acinclude.m4: Removed almost all macros as being obsolete.
1317         Rewrote remaining macros to use AC_DEFINE.
1318         * acconfig.h: Removed.
1320         * Makefile.am (EXTRA_DIST): Add config/config.rpath.  Use a
1321         conditional to handle customs support.  Remove special handling
1322         for i18n features.
1324 2002-04-20  Paul D. Smith  <psmith@gnu.org>
1326         * function.c (func_call): Don't mark the argument variables $1,
1327         etc. as recursive.  They've already been fully expanded so
1328         there's no need to do it again, and doing so strips escaped $'s.
1329         Reported by Sebastian Glita <glseba@yahoo.com>.
1331         * remake.c (notice_finished_file): Walk through double-colon
1332         entries via the prev field, not the next field!
1333         Reported by Greg McGary <greg@mcgary.org>.
1335         * main.c (main): If the user specifies -q and asks for a specific
1336         target which is a makefile, we got an assert.  In that case it
1337         turns out we should continue normally instead.
1339         * i18n/de.po, i18n/fr.po: Installed an updated translation.
1341         * i18n/he.po: Installed a new translation.
1343 2002-01-07  Paul D. Smith  <psmith@gnu.org>
1345         * i18n/es.po, i18n/ru.po: Installed an updated translation.
1347 2001-12-04  Paul D. Smith  <psmith@gnu.org>
1349         * i18n/ja.po: Installed an updated translation.
1351 2001-09-06  Paul Eggert  <eggert@twinsun.com>
1353         * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
1354         (AC_CHECK_FUNCS): Add getrlimit, setrlimit.
1356         * main.c: Include <sys/resource.h> if it, getrlimit, and setrlimit
1357         are available.
1358         (main): Get rid of any avoidable limit on stack size.
1360 2001-09-04  Paul D. Smith  <psmith@gnu.org>
1362         * i18n/da.po: Installed an updated translation.
1364 2001-08-03  Paul D. Smith  <psmith@gnu.org>
1366         * i18n/fr.po: Installed an updated translation.
1367         Resolves Debian bug #106720.
1369 2001-06-13  Paul D. Smith  <psmith@gnu.org>
1371         * i18n/da.po, configure.in (ALL_LINGUAS): Installed a new
1372         translation.
1374 2001-06-11  Paul D. Smith  <psmith@gnu.org>
1376         * i18n/ko.po: Installed a new translation.
1378 2001-05-06  Paul D. Smith  <psmith@gnu.org>
1380         Modify the EINTR handling.
1382         * job.c (new_job): Reorganize the jobserver algorithm.  Reorder
1383         the way in which we manage the file descriptor/signal handler race
1384         trap to be more efficient.
1386 2001-05-06  Paul Eggert  <eggert@twinsun.com>
1388         Restart almost all system calls that are interrupted, instead
1389         of worrying about EINTR.  The lone exception is the read() for
1390         job tokens.
1392         * configure.in (HAVE_SA_RESTART): New macro.
1393         (MAKE_JOBSERVER): Define to 1 only if HAVE_SA_RESTART.
1394         * main.c (main): Use SA_RESTART instead of the old,
1395         nonstandard SA_INTERRUPT.
1397         * configure.in (AC_CHECK_FUNCS): Add bsd_signal.
1398         * main.c (bsd_signal): New function or macro,
1399         if the implementation doesn't supply it.
1400         (The bsd_signal function will be in POSIX 1003.1-200x.)
1401         (HANDLESIG): Remove.
1402         (main, FATAL_SIG): Use bsd_signal instead of signal or HANDLESIG.
1404         * make.h (EINTR_SET): Remove.
1405         (SA_RESTART): New macro.
1407         * arscan.c (ar_member_touch): Don't worry about EINTR.
1408         * function.c (func_shell): Likewise.
1409         * job.c (reap_children, free_child, new_job): Likewise.
1410         * main.c (main): Likewise.
1411         * remake.c (touch_file, name_mtime): Likewise.
1413         * arscan.c (ar_member_touch): Fix bug uncovered by EINTR removal;
1414         if fstat failed with errno!=EINTR, the error was ignored.
1416         * job.c (set_child_handler_action_flags): New function.
1417         (new_job): Use it to temporarily clear the SIGCHLD action flags
1418         while reading the token.
1420 2001-05-02  Paul D. Smith  <psmith@gnu.org>
1422         * job.c (start_job_command): Don't add define/endef per-line flags
1423         to the top-level flags setting.
1425 2001-04-03  Paul D. Smith  <psmith@gnu.org>
1427         * arscan.c (VMS_get_member_info,ar_scan) [VMS]: VMS sets the low
1428         bit on error, so check for odd return values, not non-0 return
1429         values.
1430         (VMS_get_member_info): Calculate the timezone differences correctly.
1431         Reported by John Fowler <jfowler@nyx.net>.
1434 2001-03-14  Paul D. Smith  <psmith@gnu.org>
1436         * variable.c (lookup_variable) [VMS]: Null-terminate the variable
1437         value before invoking define_variable().
1438         Reported by John Fowler <jfowler@nyx.net>.
1440 2001-02-07  Paul D. Smith  <psmith@gnu.org>
1442         * read.c (record_target_var): If we reset the variable due to a
1443         command-line variable setting overriding it, turn off the "append"
1444         flag.
1446 2001-01-17  Paul D. Smith  <psmith@gnu.org>
1448         * variable.c (lookup_variable) [VMS]: When getting values from the
1449         environment, allocate enough space for the _value_ plus escapes,
1450         not enough space for the name plus escapes :-/.
1451         Reported by John Fowler <jfowler@nyx.net>.
1453         * remake.c (f_mtime): Removed the "***" prefix from the mod time
1454         warnings that make generates, so it doesn't look like an error.
1455         Reported by Karl Berry <karl@gnu.org>.
1458         Fix for PR/2020:  Rework appended target-specific variables.  I'm
1459         fairly confident this algorithm is finally correct.
1461         * expand.c (allocated_variable_append): Rewrite.  Instead of
1462         expanding each appended variable then adding all the expanded
1463         strings together, we append all the unexpanded values going up
1464         through the variable set contexts, then expand the final result.
1465         This behaves just like non-target-specific appended variable
1466         values, while the old way didn't in various corner cases.
1467         (variable_append): New function: recursively append the unexpanded
1468         value of a variable, walking from the outermost variable scope to
1469         the innermost.
1470         * variable.c (lookup_variable): Remove the code that looked up the
1471         variable set list if the found variable was "append".  We don't
1472         need this anymore.
1473         (lookup_variable_in_set): Make this non-static so we can use it
1474         elsewhere.
1475         (try_variable_definition): Use lookup_variable_in_set() rather
1476         than faking out current_variable_set_list by hand (cleanup).
1477         * variable.h: Add a prototype for the now non-static
1478         lookup_variable_in_set().
1480 2000-11-17  Paul D. Smith  <psmith@gnu.org>
1482         * remake.c (f_mtime) [WINDOWS32]: On various advice, I changed the
1483         WINDOWS32 port to assume timestamps can be up to 3 seconds away
1484         before throwing a fit.
1486 2000-11-17  Paul D. Smith  <psmith@gnu.org>
1488         * read.c (readline): CRLF calculations had a hole, if you hit the
1489         buffer grow scenario just right.  Reworked the algorithm to avoid
1490         the need for len or lastlen at all.  Problem description with
1491         sample code chages provided by Chris Faylor <cgf@redhat.com>.
1493 2000-10-24  Paul D. Smith  <psmith@gnu.org>
1495         * gettext.c (SWAP): Declare this with the prototype, otherwise
1496         some systems don't work (non-32-bit?  Reported for Cray T3E).
1497         Reported by Thorstein Thorsteinsson <thor@signe.teokem.lu.se>.
1499 2000-10-05  Paul D. Smith  <psmith@gnu.org>
1501         * acinclude.m4 (AM_LC_MESSAGES): Remove undefined macro
1502         AM_LC_MESSAGES; it doesn't seem to do anything anyway??
1504         * i18n/gl.po, configure.in (ALL_LINGUAS): New Galician translation.
1506 2000-09-22  Paul D. Smith  <psmith@gnu.org>
1508         * gettext.c: Don't #define _GETTEXT_H here; we only include some
1509         parts of the real gettext.h here, and we expect to really include
1510         the real gettext.h later.  If we keep this #define, it's ignored.
1512 2000-09-21  Paul D. Smith  <psmith@gnu.org>
1514         * main.c (log_working_directory): Rework the text to use complete
1515         sentences, to make life simpler for the translators.
1517 2000-08-29  Paul D. Smith  <psmith@gnu.org>
1519         * file.c (remove_intermediates): Print a debug message before we
1520         remove intermediate files, so the user (if she uses -d) knows
1521         what's going on.
1523 2000-08-21  Paul D. Smith  <psmith@gnu.org>
1525         * variable.c (try_variable_definition): Change how we handle
1526         target-specific append variable defns: instead of just setting the
1527         value, expand it as an append _but_ only within the current
1528         target's context.  Otherwise we lose all but the last value if the
1529         variable is appended more than once within the current target
1530         context.  Fixes PR/1831.
1532 2000-08-16  Paul D. Smith  <psmith@gnu.org>
1534         * function.c (func_shell): Nul-terminate the buffer before
1535         printing an exec error message (just in case it's not!).
1536         Fixes PR/1860, reported by Joey Hess <joey@valinux.com>.
1538 2000-07-25  Paul D. Smith  <psmith@gnu.org>
1540         * job.c (construct_command_argv_internal): Add "~" to the list of
1541         sh_chars[] which disallow optimizing out the shell call.
1543 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1545         * NEWS, make.texinfo: Document .LOW_RESOLUTION_TIME, which
1546         supersedes --disable-nsec-timestamps.
1547         * make.texinfo: Consistently use "time stamp" instead of "timestamp".
1548         * README: Remove --disable-nsec-timestamps.
1550         * filedef.h (struct file.low_resolution_time): New member.
1551         * file.c (snap_deps): Add support for .LOW_RESOLUTION_TIME.
1552         * remake.c (update_file_1):
1553         Avoid spurious rebuilds due to low resolution time stamps,
1554         generalizing the earlier code that applied only to archive members.
1555         (f_mtime): Archive members always have low resolution time stamps.
1557         * configure.in: Remove --disable-nsec-timestamps, as this has
1558         been superseded by .LOW_RESOLUTION_TIME.
1560 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1562         * configure.in (enable_nsec_timestamps): Renamed from
1563         make_cv_nsec_timestamps, since enable/disable options
1564         shouldn't be cached.
1566 2000-07-23  Bruno Haible  <haible@clisp.cons.org>
1567        and  Paul Eggert  <eggert@twinsun.com>
1569         * file.c (file_timestamp_now):
1570         Use preprocessor-time check for FILE_TIMESTAMP_HI_RES
1571         so that clock_gettime is not linked unless needed.
1573         * filedef.h (FILE_TIMESTAMP_HI_RES):
1574         Remove definition; "configure" now does this.
1576         * configure.in (jm_AC_TYPE_UINTMAX_T): Move up,
1577         to before high resolution file timestamp check,
1578         since that check now uses uintmax_t.
1579         (FILE_TIMESTAMP_HI_RES): Define to nonzero if the code should use
1580         high resolution file timestamps.
1581         (HAVE_CLOCK_GETTIME): Do not define if !FILE_TIMESTAMP_HI_RES,
1582         so that we don't link in clock_gettime unnecessarily.
1584 2000-07-17  Paul D. Smith  <psmith@gnu.org>
1586         * i18n/ja.po: New version of the translation file.
1588 2000-07-07  Paul D. Smith  <psmith@gnu.org>
1590         * remake.c (f_mtime): If NO_FLOAT is defined, don't bother with
1591         the offset calculation.
1592         (name_mtime): Replace EINTR test with EINTR_SET macro.
1594 2000-07-07  Paul Eggert  <eggert@twinsun.com>
1596         Fix for PR/1811:
1598         * remake.c (update_file_1):
1599         Avoid spurious rebuilds of archive members due to their
1600         timestamp resolution being only one second.
1601         (f_mtime): Avoid spurious warnings of timestamps in the future due to
1602         the clock's resolution being lower than file timestamps'.
1603         When warning about future timestamps, report only the discrepancy,
1604         not the absolute value of the timestamp and the current time.
1606         * file.c (file_timestamp_now): New arg RESOLUTION.
1607         * filedef.h (file_timestamp_now): Likewise.
1608         (FILE_TIMESTAMP_NS): Now returns int.  All uses changed.
1610 2000-07-05  Paul D. Smith  <psmith@gnu.org>
1612         * variable.c (lookup_variable) [VMS]: Remove vestigial references
1613         to listp.  Fixes PR/1793.
1615 2000-06-26  Paul Eggert  <eggert@twinsun.com>
1617         * Makefile.am (MAINTAINERCLEANFILES): New macro, with stamp-pot in it.
1619         * dir.c (vms_hash): Ensure ctype macro args are nonnegative.
1621         * remake.c (f_mtime): Remove unused var memtime.
1623 2000-06-25  Martin Buchholz  <martin@xemacs.org>
1625         * make.texinfo, NEWS, TODO.private: Minor spelling corrections.
1626         Ran spell-check on make.texinfo.
1628 2000-06-23  Paul D. Smith  <psmith@gnu.org>
1630         * main.c (main): Replace EXIT_SUCCESS, EXIT_FAILURE, and
1631         EXIT_TROUBLE with MAKE_SUCCESS, MAKE_FAILURE, and MAKE_TROUBLE.
1632         * make.h: Define these macros.
1634         * Version 3.79.1 released.
1636         * configure.in: Add a new option, --disable-nsec-timestamps, to
1637         avoid using sub-second timestamps on systems that support it.  It
1638         can lead to problems, e.g. if your makefile relies on "cp -p".
1639         * README.template: Document the issue with "cp -p".
1641         * config.guess, config.sub: Updated.
1645 See ChangeLog.2, available in the CVS repository at:
1647         http://savannah.gnu.org/cvs/?group=make
1649 for earlier changes.