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