Create a new function $(file ...)
[make.git] / ChangeLog
blobfacb4cc40cbe4a8c291576c26246df6594615e6b
1 2012-01-29  Paul Smith  <psmith@gnu.org>
3         * function.c (func_file): Create a new function, $(file ...)
4         * doc/make.texi (File Function): Document the $(file ..) function.
5         * NEWS: Announce it.
7         * gmk-default.scm (to-string-maybe): Use a more portable way to
8         test for unprintable characters.
9         * configure.in [GUILE]: Guile 1.6 doesn't have pkg-config
10         * build_w32.bat: Ditto.
12 2012-01-28  Eli Zaretskii  <eliz@gnu.org>
14         * config.h.W32.template: Update from config.h.in.
16         Support a Windows build with Guile.
18         * README.W32.template: Update with instructions for building with
19         Guile.
21         * build_w32.bat: Support building with Guile.
23         * make.h [HAVE_STDINT_H]: Include stdint.h.
25         * main.c (main, clean_jobserver): Move declarations of variables
26         not used in the WINDOWS32 build to the #else branch, to avoid
27         compiler warnings.
29         Fix failures on MS-Windows when Make's standard handles are invalid.
30         This can happen when Make is invoked from a GUI application.
32         * w32/subproc/sub_proc.c (process_init_fd): Don't dereference
33         pproc if it is a NULL pointer.
34         (process_begin, process_cleanup): Don't try to close pipe handles
35         whose value is INVALID_HANDLE_VALUE.
36         (process_easy): Initialize hIn, hOut, and hErr to
37         INVALID_HANDLE_VALUE.  If DuplicateHandle fails with
38         ERROR_INVALID_HANDLE, duplicate a handle for the null device
39         instead of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE or
40         STD_ERROR_HANDLE.  Don't try to close pipe handles whose value is
41         INVALID_HANDLE_VALUE.
43         * function.c (windows32_openpipe): Initialize hIn and hErr to
44         INVALID_HANDLE_VALUE.  If DuplicateHandle fails with
45         ERROR_INVALID_HANDLE, duplicate a handle for the null device
46         instead of STD_INPUT_HANDLE or STD_ERROR_HANDLE.  Fix indentation.
47         Don't try to close handles whose value is INVALID_HANDLE_VALUE.
49 2012-01-25  Eli Zaretskii  <eliz@gnu.org>
51         * function.c (define_new_function): Fix format strings in calls to
52         `fatal'.
54 2012-01-17  Paul Smith  <psmith@gnu.org>
56         * guile.c (func_guile): Handle NULL returns from Guile.
58 2012-01-16  Paul Smith  <psmith@gnu.org>
60         * make.h (PATH_SEPARATOR_CHAR): Allow resetting for crosscompiling
61         for Windows.  Patch by Chris Sutcliffe <ir0nh34d@gmail.com>
62         Fixes Savannah bug #34818.
64 2012-01-15  Paul Smith  <psmith@gnu.org>
66         * variable.h: Prototype an interface for defining new make functions.
67         * function.c (define_new_function): Define it.
68         (func_guile): Remove the "guile" function.
69         (function_table_init): Ditto.
70         * guile.c (func_guile): Add the "guile" function here.
71         (setup_guile): Call define_new_function() to define it.
72         (guile_eval_string): Obsolete.
74         * all: Update copyright notices.
76 2012-01-12  Paul Smith  <psmith@gnu.org>
78         Support GNU Guile as an embedded extension language for GNU make.
80         * NEWS: Note the new Guile capability.
81         * Makefile.am (EXTRA_DIST, make_SOURCES): Add new guile source files.
82         (AM_CFLAGS): Add Guile compiler flags.
83         (guile): Add a rule for converting default SCM into a C header.
84         * configure.in: Add support for --with-guile.
85         Also, convert the entire file to properly escaped autoconf m4, and
86         utilize newer features such as AS_IF() and AS_CASE().
87         * doc/make.texi (Guile Function): Document the GNU guile integration.
88         * make.h (guile_eval_string, guile_boot): Prototypes for Guile.
89         * main.c (main): Run guile_boot() to handle main().
90         (real_main): All the previous content of main() is here.
91         (real_main): Add "guile" to the .FEATURES variable.
92         * function.c (func_guile): Call Guile.
93         * guile.c: New file implementing GNU make integration with GNU Guile.
94         * gmk-default.scm: The integration of GNU make with Guile uses
95         Guile itself for much of the parsing and conversion of return
96         types, etc.  This implementation is embedded into GNU make.
97         * config.h-vms.template: Disable Guile support.
98         * config.h.W32.template: Ditto.
99         * configh.dos.template: Ditto.
100         * config.ami.template: Ditto.
101         * makefile.vms: Add new Guile files.
102         * Makefile.DOS.template: Ditto.
103         * Makefile.ami: Ditto.
104         * NMakefile.template: Ditto.
105         * SMakefile.template: Ditto.
106         * build_w32.bat: Ditto.
107         * dosbuild.bat: Ditto.
108         * make_msvc_net2001.vcproj: Ditto.
110 2011-11-15  Paul Smith  <psmith@gnu.org>
112         * main.c (main): Use %ld when printing DWORD values.
113         * job.c (new_job): Ditto.
114         * w32/include/sub_proc.h: Use const.
115         * w32/subproc/sub_proc.c (open_jobserver_semaphore): Use const.
116         Fixes Savannah bug #34830.  Changes suggested by Ozkan Sezer.
118         * configure.in (MAKE_JOBSERVER): Enable jobserver on W32 systems.
119         * config.h.W32.template (MAKE_JOBSERVER): Ditto.
121 2011-11-14  Paul Smith  <psmith@gnu.org>
123         * read.c (eval): parse_file_seq() might shorten the string due to
124         backslash removal.  Start parsing again at the colon.
125         Fixes Savannah bug #33399.
127 2011-11-13  Paul Smith  <psmith@gnu.org>
129         * file.c (file_timestamp_cons): Match up data types to avoid warnings.
130         * filedef.h: Ditto.
131         * misc.c (concat): Ditto.
132         * read.c (eval): Assign value to avoid warnings.
133         * function.c (func_shell_base): Use fork() instead of vfork() to
134         avoid warnings.
135         * make.h (INTEGER_TYPE_SIGNED): Use <=0 to avoid warnings.
136         Fixes Savannah bug #34608.
138         * job.c (construct_command_argv): Remove _p.
139         (construct_command_argv_internal): Remove _ptr.
140         Fixes Savannah bug #32567.
142         * main.c (clean_jobserver): Don't write the free token to the pipe.
143         Change suggested by Tim Newsome <tnewsome@aristanetworks.com>
145         * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add support for Darwin.
146         * filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Ditto.
147         Patch provided by Troy Runkel <Troy.Runkel@mathworks.com>
149 2011-10-11  Troy Runkel  <Troy.Runkel@mathworks.com>
151         * config.h.W32: Enable job server support for Windows.
152         * main.c [WINDOWS32]: Include sub_proc.h
153         (main): Create a named semaphore to implement the job server.
154         (clean_jobserver): Free the job server semaphore when make is finished.
155         * job.c [WINDOWS32]: Define WAIT_NOHANG
156         (reap_children): Support non-blocking wait for child processes.
157         (free_child): Release job server semaphore when child process finished.
158         (job_noop): Don't define function on Windows.
159         (set_child_handler_action_flags): Don't define function on Windows.
160         (new_job): Wait for job server semaphore or child process termination.
161         (exec_command): Pass new parameters to process_wait_for_any.
162         * w32/include/sub_proc.h [WINDOWS32]: New/updated EXTERN_DECL entries.
163         * w32/subproc/sub_proc.c [WINDOWS32]: Added job server implementation.
164         (open_jobserver_semaphore): Open existing job server semaphore by name.
165         (create_jobserver_semaphore): Create new job server named semaphore.
166         (free_jobserver_semaphore): Close existing job server semaphore.
167         (acquire_jobserver_semaphore): Decrement job server semaphore count.
168         (release_jobserver_semaphore): Increment job server semaphore count.
169         (has_jobserver_semaphore): Returns whether job server semaphore exists.
170         (get_jobserver_semaphore_name): Returns name of job server semaphore.
171         (wait_for_semaphore_or_child_process): Wait for either the job server
172         semaphore to become signalled or a child process to terminate.
173         (process_wait_for_any_private): Support for non-blocking wait for child.
174         (process_wait_for_any): Added support for non-blocking wait for child.
175         (process_file_io): Pass new parameters to process_wait_for_any_private.
177 2011-09-18  Paul Smith  <psmith@gnu.org>
179         * main.c (main): If we're re-exec'ing and we're the master make,
180         then restore the job_slots value so it goes back into MAKEFLAGS
181         properly.  See Savannah bug #33873.
183         * remake.c (library_search): STD_DIRS is computed when other
184         static vars like buflen etc. are computed, so it must be static
185         as well.  See Savannah bug #32511.
187 2011-09-16  Paul Smith  <psmith@gnu.org>
189         * maintMakefile (do-po-update): Apparently we have to avoid
190         certificate checks on the http://translationproject.org site now.
192 2011-09-12  Paul Smith  <psmith@gnu.org>
194         * read.c (eval): Ensure exported variables are defined in the
195         global scope.  Fixes Savannah bug #32498.
197 2011-09-11  Paul Smith  <psmith@gnu.org>
199         * Makefile.am (dist-hook): Remove w32/Makefile and .deps/ from the
200         dist file.  Fixes Savannah bug #31489.
202         * doc/make.texi (Complex Makefile): Add a hint about using
203         #!/usr/bin/make (for Savannah support request #106459)
205 2011-09-02  Paul Smith  <psmith@gnu.org>
207         * remake.c (touch_file): If we have both -n and -t, -n takes
208         precedence.  Patch from Michael Witten <mfwitten@gmail.com>
210 2011-08-29  Paul Smith  <psmith@gnu.org>
212         * expand.c (variable_expand_string): Always allocate a new buffer
213         for a string we're expanding.  The string we're working on can get
214         freed while we work on it (for example if it's the value of a
215         variable which modifies itself using an eval operation).
216         See Savannah patch #7534 for the original report by Lubomir Rintel.
218 2011-06-12  Paul Smith  <psmith@gnu.org>
220         * read.c (parse_file_seq): Move the check for empty members out of
221         the loop so we can go to the next member properly.
222         Another fix for Savannah bug #30612.
224         * config.h-vms.template: Newer versions of VMS have strncasecmp()
225         Patch provided by: Hartmut Becker <becker.ismaning@freenet.de>
227 2011-05-07  Paul Smith  <psmith@gnu.org>
229         * expand.c (variable_append): Add a LOCAL argument to track
230         whether this is the first invocation or not.  If it's not and
231         private_var is set, then skip this variable and try the next one.
232         Fixes Savannah bug #32872.
234         * read.c (parse_file_seq): Ensure existence checks use glob().
236 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
238         * job.c (construct_command_argv_internal): Don't assume shellflags
239         is always non-NULL.  Escape-protect characters special to the
240         shell when copying the value of SHELL into new_line.  Fixes
241         Savannah bug #23922.
243 2011-05-02  Paul Smith  <psmith@gnu.org>
245         * doc/make.texi (Special Variables): Add documentation for the new
246         words in .FEATURES.  Fixes Savannah bug #32058.
247         (Flavor Function): Rewrite the section on the flavor function.
248         Fixes Savannah bug #31582.
250         * function.c (func_sort): Use the same algorithm to count the
251         number of words we will get after the split, as we use to split.
252         Based on a patch from Matthias Hopf.  Fixes Savannah bug #33125.
254         * make.h: Make global variable stack_limit extern.
255         Fixes Savannah bug #32753.
257 2011-05-01  Paul Smith  <psmith@gnu.org>
259         * read.c (parse_file_seq): Don't try to invoke glob() unless there
260         are potential wildcard characters in the filename.  Performance
261         enhancement suggested by Michael Meeks <michael.meeks@novell.com>
263 2011-04-29 Boris Kolpackov  <boris@codesynthesis.com>
265         * read.c (eval_makefile): Delay caching of the file name until after
266         all the expansions and searches.
268 2011-04-17  David A. Wheeler  <dwheeler@dwheeler.com>
270         * doc/make.texi (Reading Makefiles): Document "!=".
271         (Setting): Ditto.
272         (Features): Ditto.
273         * variable.h (enum variable_flavor): New type "f_shell".
274         * variable.c (shell_result): Send a string to the shell and store
275         the output.
276         (do_variable_definition): Handle f_shell variables: expand the
277         value, then send it to the shell and store the result.
278         (parse_variable_definition): Parse "!=" shell assignments.
279         * read.c (get_next_mword): Treat "!=" as a varassign word.
280         * function.c (fold_newlines): If trim_newlines is set remove all
281         trailing newlines; otherwise remove only the last newline.
282         (func_shell_base): Move the guts of the shell function here.
283         (func_shell): Call func_shell_base().
285 2011-02-21  Paul Smith  <psmith@gnu.org>
287         * strcache.c (various): Increase performance based on comments
288         from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.  Stop looking for
289         a buffer when we find the first one that fits, not the best fit.
290         If there is not enough free space in a buffer move it to a
291         separate list so we don't have to walk it again.
292         * make.h (NDEBUG): Turn off asserts unless maintainer mode is set.
293         (strcache_add_len, strcache_setbufsize): Use unsigned length/size.
294         * maintMakefile (AM_CPPFLAGS): Enable MAKE_MAINTAINER_MODE.
296         * remake.c (complain): Move translation lookups closer to use.
298 2011-02-13  Paul Smith  <psmith@gnu.org>
300         * doc/make.texi: Clean up references to "static" variables and
301         semicolon errors.  Patch from Michael Witten <mfwitten@gmail.com>.
303 2010-12-27  Paul Smith  <psmith@gnu.org>
305         * make.1: Update the header/footer info in the man page.
307 2010-11-28  Paul Smith  <psmith@gnu.org>
309         * read.c (record_target_var): Don't reset v if it's the same as
310         the global version.  Fixes Savannah bug #31743.
312 2010-11-06  Paul Smith  <psmith@gnu.org>
314         * variable.c (print_auto_variable): Print auto variables; ignore others.
315         (print_noauto_variable): Print non-auto variables; ignore others.
316         (print_variable_set): Allow the caller to select which type to print.
317         (print_target_variables): Show all the non-auto variables for a target.
319         * default.c (install_default_suffix_rules): Initialize recipe_prefix.
320         * rule.c (install_pattern_rule): Ditto.
321         * read.c (record_files): Pass in the current recipe prefix.  Remember
322         it in the struct command for these targets.
323         (eval): Remember the value of RECIPEPREFIX when we start parsing.
324         Do not remove recipe prefixes from the recipe here: we'll do it later.
325         * job.c (start_job_command): Remove recipe prefix characters early,
326         before we print the output or chop it up.
327         * file.c (print_file): If recipe_prefix is not standard, reset it
328         in -p output.  Assign target variables in -p output as well.
330         * commands.c (chop_commands): Max command lines is USHRT_MAX.
331         Set any_recurse as a bitfield.
332         * make.h (USHRT_MAX): Define if not set.
334 2010-10-27  Paul Smith  <psmith@gnu.org>
336         * commands.h (struct commands): Rearrange to make better use of
337         memory.  Add new recipe_prefix value.
339 2010-10-26  Paul Smith  <psmith@gnu.org>
341         * doc/make.texi (Setting): Document the treatment of
342         backslash-newline in variable values.
343         * misc.c (collapse_continuations): Do not collapse multiple
344         backslash-newlines into a single space.  Fixes Savannah bug #16670.
346 2010-08-29  Paul Smith  <psmith@gnu.org>
348         * doc/make.texi (Implicit Variables): Document LDLIBS and LOADLIBES.
349         Fixes Savannah bug #30807.
350         (Instead of Execution): Mention that included makefiles are still
351         rebuilt even with -n.  Fixes Savannah bug #30762.
353         * configure.in: Bump to 3.82.90.
355         * make.h: Add trace_flag variable.
356         * main.c (switches): Add --trace option.
357         (trace_flag): Declare variable.
358         * job.c (start_job_command): Show recipe if trace_flag is set.
359         (new_job): Show trace messages if trace_flag is set.
360         * doc/make.texi (Options Summary): Document the new --trace option.
361         * make.1: Add --trace documentation.
362         * NEWS: Mention --trace.
364         * job.c (child_error): Show recipe filename/linenumber on error.
365         Also show "(ignored)" when appropriate even for signals/coredumps.
366         * NEWS: Mention file/linenumber change.
368         * main.c (main): Print version info when DB_BASIC is set.
370         * job.c (construct_command_argv_internal): If shellflags is not
371         set, choose an appropriate default value.  Fixes Savannah bug #30748.
373 2010-08-27  Eli Zaretskii  <eliz@gnu.org>
375         * variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]:
376         Remove trailing backslashes in $(@D), $(<D), etc., for consistency
377         with forward slashes.  Fixes Savannah bug #30795.
379 2010-08-13  Paul Smith  <psmith@gnu.org>
381         * NEWS: Accidentally forgot to back out the sorted wildcard
382         enhancement in 3.82, so update NEWS.
383         Also add NEWS about the error check for explicit and pattern
384         targets in the same rule, added to 3.82.
386         * main.c (main): Add "oneshell" to $(.FEATURES) (forgot to add
387         this in 3.82!)
389         * read.c (parse_file_seq): Fix various errors parsing archives
390         with multiple objects in the parenthesis, as well as wildcards.
391         Fixes Savannah bug #30612.
393 2010-08-10  Paul Smith  <psmith@gnu.org>
395         * main.c (main): Expand MAKEFLAGS before adding it to the
396         environment when re-exec'ing.  Fixes Savannah bug #30723.
398 2010-08-07  Eli Zaretskii  <eliz@gnu.org>
400         * w32/subproc/build.bat: Make all 3 cl.exe compile command lines
401         use the same /I switches.  Fixes Savannah bug #30662.
403         * function.c (func_shell) [WINDOWS32]: Reset just_print_flag
404         around the call to construct_command_argv, so that a temporary
405         batch file _is_ created when needed for $(shell).
406         Fixes Savannah bug #16362.
408 2010-08-07 Juan Manuel Guerrero  <juan.guerrero@gmx.de>
410         * configh.dos.template (HAVE_STRNCASECMP): Define.
412 2010-07-28  Paul Smith  <psmith@gnu.org>
414         Version 3.82 released.
416         * configure.in: Change release version.
417         * NEWS: Change the date.
419         * read.c (parse_file_seq): Remove GLOB_NOSORT for
420         backward-compatibility.  We'll add it back in next release.
421         * NEWS: Note it.
423 2010-07-24  Eli Zaretskii  <eliz@gnu.org>
425         * job.c (pid2str) [WINDOWS32]: Fix CPP conditionals for using %Id
426         format.
428 2010-07-18  Paul Smith  <psmith@gnu.org>
430         * configure.in: Switch bsd_signal to AC_CHECK_DECLS() to make sure
431         we have a declaration.  Fixes Savannah bug #25713 (maybe?)
432         * doc/make.texi (Complex Makefile): Cleanup variable assignments.
433         (One Shell): New subsection for the .ONESHELL special target.
435         Patches by Ozkan Sezer <sezeroz@gmail.com>:
437         * misc.c (strncasecmp): Local implementation for systems without.
438         * config.h.W32.template (HAVE_STRNICMP): Define on Windows.
439         * configure.in: Check for strncasecmp/strncmpi/strnicmp.
440         * job.c [WINDOWS32]: Don't define dup2 on Windows.
441         (pid2str): Use "%Id" even with MSVC
442         (exec_command): Cast to pid_t when calling pid2str().
443         * w32/subproc/sub_proc.c [WINDOWS32]: Include config.h first.
444         Use stddef.h on MSVC to get intptr_t.
445         * w32/subproc/misc.c [WINDOWS32]: Include config.h first.
446         * w32/compat/dirent.c [WINDOWS32]: Include config.h first.
447         (readdir): Cast -1 to correct type for d_ino.
448         * w32/pathstuff.c [WINDOWS32]: Ensure make.h is included first.
449         * make.h [WINDOWS32]: Don't prototype alloca() on Windows.
450         Add configuration for strncasecmp().
451         * main.c (ADD_SIG) [WINDOWS32]: Avoid warnings in MSVC.
452         * config.h.W32.template [WINDOWS32]: Don't warn on unsafe
453         functions or variables.
454         * NMakefile.template [WINDOWS32]: Remove /MACHINE:I386.
455         * main.c (clean_jobserver): Cast due to MSVC brokenness.
456         (decode_switches): Ditto.
457         * vpath.c (construct_vpath_list): Ditto.
458         * rule.c (freerule): Ditto.
459         * ar.c (ar_glob): Ditto.
461 2010-07-16  Boris Kolpackov  <boris@codesynthesis.com>
463         * misc.c (concat): Fix buffer overrun.
465 2010-07-12  Paul Smith  <psmith@gnu.org>
467         Update copyrights to add 2010.
469         * build_w32.bat: Support for MSVC Windows x86_64 builds.
470         * job.c: Don't define execve() on MSVC/64bit.
471         Patch by Viktor Szakats.  Fixes Savannah bug #27590.
473 2010-07-12  Eli Zaretskii  <eliz@gnu.org>
475         * make.h (alloca) [!__GNUC__]: Don't define prototype.
476         (int w32_kill): Use pid_t for process ID argument.
477         Fixes Savannah bug #27809.
479 2010-07-12  Paul Smith  <psmith@gnu.org>
481         Integrated new .ONESHELL feature.
482         Patch by David Boyce <dsb@boyski.com>.  Modified by me.
484         * NEWS: Add a note about the new feature.
485         * job.c (is_bourne_compatible_shell): Determine whether we're
486         using a standard POSIX shell or not.
487         (start_job_command): Accept '-ec' as POSIX shell flags.
488         (construct_command_argv_internal): If one_shell is set and we are
489         using a POSIX shell, remove "interior" prefix characters such as
490         "@", "+", "-".  Also treat "\n" as a special character when
491         choosing the slow path, if ONESHELL is set.
492         * job.h (is_bourne_compatible_argv): Define the new function.
494         * make.h (one_shell): New global variable to remember setting.
495         * main.c: Declare it.
496         * read.c (record_files): Set it.
497         * commands.c (chop_commands): If one_shell is set, don't chop
498         commands into multiple lines; just keep one line.
500 2010-07-09  Eli Zaretskii  <eliz@gnu.org>
502         * w32/subproc/sub_proc.c: Include stdint.h.
503         (sub_process_t): Use intptr_t for file handles and pid_t for
504         process ID.
505         (process_pipes, process_init_fd, process_begin): Use intptr_t for
506         file handles and pid_t for process ID.  Fixes Savannah bug #27809.
507         Patch by Ozkan Sezer <sezeroz@gmail.com>
509         * function.c (abspath): Support absolute file names in UNC format.
510         Fixes Savannah bug #30312.
512         * job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
513         (exec_command) [WINDOWS32]: Use pid2str instead of non-portable
514         %Id.
516         * main.c (handle_runtime_exceptions): Use %p to print addresses,
517         to DTRT on both 32-bit and 64-bit hosts.  Savannah bug #27809.
519         * job.c (w32_kill, start_job_command, create_batch_file): Use
520         pid_t for process IDs and intptr_t for the 1st arg of
521         _open_osfhandle.
522         * function.c (windows32_openpipe): Use pid_t for process IDs and
523         intptr_t for the 1st arg of _open_osfhandle.
524         (func_shell): Use pid_t for process IDs.
525         * main.c (main) [WINDOWS32]: Pacify the compiler.
526         * config.h.W32.template (pid_t): Add a definition for 64-bit
527         Windows builds that don't use GCC.  Fixes Savannah bug #27809.
528         Patch by Ozkan Sezer <sezeroz@gmail.com>
530 2010-07-07  Paul Smith  <psmith@gnu.org>
532         * configure.in: Bump to a new prerelease version 3.81.91.
534 2010-07-06  Paul Smith  <psmith@gnu.org>
536         * main.c (main): Set a default value of "-c" for .SHELLFLAGS.
537         * NEWS: Mention the new behavior of .POSIX and the new .SHELLFLAGS
538         variable.
539         * job.c (construct_command_argv): Retrieve the .SHELLFLAGS value
540         and pass it to construct_command_argv_internal().
541         (construct_command_argv_internal): If .SHELLFLAGS is non-standard
542         use the slow path.  Use that value instead of hard-coded "-c".
544 2010-07-05  Paul Smith  <psmith@gnu.org>
546         * implicit.c (pattern_search): lastslash can be const.
547         * dir.c (downcase): Remove unused variable.
548         * hash.c (hash_init): Cast sizeof for error message.
549         * arscan.c (ar_scan): Cast to char* for WINDOWS32.
550         (ar_member_touch): Ditto.
551         * ar.c (glob_pattern_p): Avoid symbol collision: open -> opened
552         * signame.c (strsignal): Ditto: signal -> sig
553         * job.c (create_batch_file): Ditto: error -> error_string
554         (pid2str): Portably convert a pid_t into a string
555         (reap_children): Use it.
556         (start_waiting_job): Use it.
557         Savannah bug #27809.  Patch by Ozkan Sezer <sezeroz@gmail.com>
559 2010-07-03  Paul Smith  <psmith@gnu.org>
561         * read.c (parse_file_seq): All archive groups must end with ')' as
562         the LAST character in a word.  If there is no word ending in ')'
563         then it's not an archive group.  Fixes Savannah bug #28525.
565 2010-07-01  Paul Smith  <psmith@gnu.org>
567         * main.c (main): Append optional features using separate calls.
568         Not as efficient but not all compilers allow conditionals inside
569         macro calls.  Fixes Savannah bug #29244.
571 2010-01-10  Paul Smith  <psmith@gnu.org>
573         * make.h (patheq): Rename strieq() to patheq() for clarity.
574         * dir.c (dir_contents_file_exists_p): Use it.
576         * dir.c (file_impossible): Convert xmalloc/memset to xcalloc.
577         * file.c (enter_file): Ditto.
578         * job.c (new_job): Ditto.
580 2009-12-11  Eli Zaretskii  <eliz@gnu.org>
582         * job.c (construct_command_argv_internal) <sh_cmds_dos>
583         [WINDOWS32]: Add "echo." and a few more commands that are built
584         into cmd.exe.  Fixes Savannah bug #28126.
586         * file.c (lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do
587         with '/'.
589 2009-11-15  Paul Smith  <psmith@gnu.org>
591         Patches for VMS provided by Hartmut Becker <Hartmut.Becker@hp.com>
593         * vmsjobs.c (ctrlYPressed) [VMS]: Deal with CTRL-Y.
594         (vmsHandleChildTerm) [VMS]: Ditto.
595         (astYHandler) [VMS]: Ditto.
596         (tryToSetupYAst) [VMS]: Ditto.
597         (child_execute_job) [VMS]: Ditto.
599         * vmsify.c (trnlog) [VMS]: Fix const errors.
600         (vmsify) [VMS]: Ditto.
602         * readme.vms [VMS]: Update with notes for 3.82.
604         * job.h (comname) [VMS]: Remember the temporary command filename
606         * dir.c (vmsify) [VMS]: Fix const errors.
607         (vms_hash) [VMS]: Ditto.
608         (vmsstat_dir) [VMS]: Ditto.
609         (find_directory) [VMS]: Fix case-insensitive option for VMS
610         (dir_contents_file_exists_p) [VMS]: Ditto.
611         (file_impossible) [VMS]: Ditto.
613         * config.h-vms.template (HAVE_FDOPEN) [VMS]: Have it.
614         (HAVE_STRCASECMP) [VMS]: Ditto.
616         * arscan.c (VMS_get_member_info) [VMS]: Fix timezone computation.
617         (ar_scan) [VMS]: Fix const error.
619 2009-11-12  Boris Kolpackov  <boris@codesynthesis.com>
621         * vpath.c (vpath_search, selective_vpath_search): Add index arguments
622         which allows the caller to get the index of the matching directory.
624         * make.h (vpath_search): Update prototype.
626         * remake.c (library_search): Implement linker-compatible library
627         search. Use the new VPATH_SEARCH index functionality to keep track
628         of the directory index for each match. Select the match with the
629         lowest directory index.
631         * implicit.c (pattern_search): Pass NULL for the index arguments in
632         the VPATH_SEARCH call.
634         * doc/make.texi (Directory Search for Link Libraries): Describe the
635         new search behavior.
637         * NEWS: Add a note about the new behavior.
639 2009-10-25  Paul Smith  <psmith@gnu.org>
641         * AUTHORS, et.al.: Update copyright years.
643         * implicit.c (stemlen_compare): Fix qsort() compare bug that
644         caused implicit rules with equal stem lengths to be sorted
645         indeterminately.
647 2009-10-24  Paul Smith  <psmith@gnu.org>
649         * main.c (usage): Add --eval to the usage string.
650         (switches): Add the --eval switch.
651         (main): If --eval is given, add them to the simply-expanded variable
652         -*-eval-flags-*- (necessary to allow recursion to work properly).
653         (define_makeflags): Add -*-eval-flags-*- to MAKEFLAGS.
655         * NEWS: Describe the new --eval command line argument.
656         * doc/make.texi (Options Summary): Document --eval.
658         * dep.h: eval_buffer() returns void.
659         * read.c (eval_buffer): Ditto.
660         (eval): Ditto.
662         * variable.h (define_variable_cname): New macro for constant
663         variable names.
664         * default.c (set_default_suffixes): Use it.
665         * main.c (main): Ditto.
666         (handle_non_switch_argument): Ditto.
667         (define_makeflags): Ditto.
668         * read.c (read_all_makefiles): Ditto.
669         * variable.c (define_automatic_variables): Ditto.
671         * commands.c (dep_hash_cmp): Avoid casts.
672         (dep_hash_1): Ditto.
673         (dep_hash_2): Ditto.
675 2009-10-22  Boris Kolpackov  <boris@codesynthesis.com>
677         * read.c (read_all_makefiles): Mark the default makefile dependency
678         dontcare.
680 2009-10-07  Boris Kolpackov  <boris@codesynthesis.com>
682         * read.c (do_undefine): Free the expanded variable name.
684         * commands.c (dep_hash_cmp, set_file_variables): Move the order-only
685         to normal upgrade logic from  dep_hash_cmp to set_file_variables.
687 2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
689         * dep.h (uniquize_deps): Remove.
691         * read.c (uniquize_deps): Merge into set_file_variables in
692         commands.c.
693         (dep_hash_1, dep_hash_2, dep_hash_cmp): Move to commands.c.
695         * commands.c (set_file_variables): Avoid modifying the dep
696         chain to achieve uniqueness. Fixes savannah bug 25780.
698         * implicit.c (pattern_search): Instead of re-setting all automatic
699         variables for each rule we try, just update $*.
701 2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
703         * variable.h (undefine_variable_in_set): New function declaration.
704         (undefine_variable_global): New macro.
706         * variable.c (undefine_variable_in_set): New function implementation.
708         * read.c (vmodifiers): Add undefine_v modifier.
709         (parse_var_assignment): Parse undefine.
710         (do_undefine): Handle the undefine directive.
711         (eval): Call do_undefine if undefine_v is set.
713         * main.c (.FEATURES): Add a keyword to indicate the new feature.
715         * doc/make.texi (Undefine Directive): Describe the new directive.
717         * NEWS: Add a note about the new directive.
719 2009-10-05  Boris Kolpackov  <boris@codesynthesis.com>
721         * implicit.c (pattern_search): Initialize file variables only
722         if we need to parse a rule that requires the second expansion.
724 2009-10-03  Paul Smith  <psmith@gnu.org>
726         * make.h: Include <alloca.h> even on systems where __GNUC__ is
727         defined.  Not sure why it was done the other way.
728         Requested by David Boyce <dsb@boyski.com>.
730 2009-09-30  Boris Kolpackov  <boris@codesynthesis.com>
732         * dep.h (dep): Add the DONTCARE bitfield.
734         * filedef.h (file):Add the NO_DIAG bitfield.
736         * read.c (eval_makefile): Set the DONTCARE flag in struct dep,
737         not struct file (a file can be a dependency of many targets,
738         some don't care, some do).
740         * remake.c (update_goal_chain): Propagate DONTCARE from struct
741         dep to struct file before updating the goal and restore it
742         afterwards.
743         (update_file): Don't prune the dependency graph if this target
744         has failed but the diagnostics hasn't been issued.
745         (complain): Scan the file's dependency graph to find the file
746         that caused the failure.
747         (update_file_1): Use NO_DIAG instead of DONTCARE to decide
748         whether to print diagnostics.
750         Fixes Savannah bugs #15110, #25493, #12686, and #17740.
752 2009-09-28  Paul Smith  <psmith@gnu.org>
754         * doc/make.texi (Pattern Intro): Move the match algorithm
755         discussion into the "Pattern Match" node.
756         (Pattern Match): Expand on the pattern rule matching algorithm.
758 2009-09-28  Andreas Buening  <andreas.buening@nexgo.de>
760         * job.c (construct_command_argv_internal) [OS2]: Don't eat too
761         much of the command line on a single pass.
763 2009-09-28  Boris Kolpackov  <boris@codesynthesis.com>
765         * varible.c (create_pattern_var): Insert variables into the
766         PATTERN_VARS list in the shortest patterns first order.
768         * implicit.c (tryrule): Add STEMLEN and ORDER members. These are
769         used to sort the rules.
770         (stemlen_compare): Compare two tryrule elements.
771         (pattern_search): Sort the rules so that they are in the shortest
772         stem first order.
774         * main.c (.FEATURES): Add a keyword to indicate the new behavior.
776         * doc/make.texi (Pattern-specific Variable Values): Describe the
777         new pattern-specific variables application order.
778         (Introduction to Pattern Rules): Describe the new pattern rules
779         search order.
781         * NEWS: Add a note about the new behavior.
783 2009-09-27  Paul Smith  <psmith@gnu.org>
785         * doc/make.texi (Double-Colon): Mention that pattern rules with
786         double-colons have a different meaning.  Savannah bug #27497.
788 2009-09-27  Juan Manuel Guerrero  <juan.guerrero@gmx.de>
790         * configh.dos.template: Remove unconditional definition of
791         SYS_SIGLIST_DECLARED.
792         Include <sys/version.h> because ports of GCC 4.3.0 and later no
793         longer include it, so macros like __DJGPP_MINOR__ are no longer
794         defined automatically.
796         * Makefile.DOS.template (INCLUDES): Use $(prefix) and the
797         corresponding variables to define LIBDIR, INCLUDEDIR and LOCALEDIR
798         instead of using the hardcoded ones.
799         (SUBDIRS): doc subdir added.
800         (INFO_DEPS, DVIS): Values changed to 'make.info' and 'make.dvi'.
801         (TEXI2HTML, TEXI2HTML_FLAGS): Removed.  Use makeinfo --html to
802         create html formated docs.  texi2html may not be ported to DOS.
803         (make.info, make.dvi, make.ps, make.html): Make targets depend on
804         'make.texi'.
805         (.texi.info, .texi, .texi.dvi): Now invoked recursively.  Change
806         -I switch to look in ./ instead of ./doc.
807         (html): Target depend on html-recursive instead of make_1.html.
808         (make_1.html): Removed.
809         (mostlyclean-aminfo): Use $(srcdir)/doc instead of ./ as prefix.
810         (all-recursive): Allow for more than one subdir in the build
811         process.
812         (mostlyclean-recursive, clean-recursive, distclean-recursive)
813         (maintainer-clean-recursive, check-recursive): Enter in doc/ too.
814         (tags-recursive): Allow for more than one subdir in the build
815         process.
816         (info-recursive, dvi-recursive, ps-recursive, html-recursive): New
817         targets.  Enter into doc/ to produce the targets.
818         (all-am): $(INFO_DEPS) replaced by info.
820 2009-09-26  Paul Smith  <psmith@gnu.org>
822         * read.c (record_files): Use free_ns() to free struct nameseq.
823         (eval): Ditto.
825         * rule.c (freerule): Use free_dep_chain().
827         * read.c (record_files): Free FILENAMES chain for implicit rules.
828         (eval): Static pattern targets go into the string cache.
830         * function.c (string_glob): Free NAME in the nameseq chain.
832 2009-09-25  Boris Kolpackov  <boris@codesynthesis.com>
834         * implicit.c (pattern_search): Terminate early if we haven't
835         found any rules to try (performance improvement).
837 2009-09-25  Boris Kolpackov  <boris@codesynthesis.com>
839         * implicit.c (pattern_search): Merge three parallel arrays,
840         TRYRULES, MATCHES, and CHECKED_LASTSLASH, into one array
841         of struct TRYRULE. In the old version the latter two arrays
842         had insufficient length.
844 2009-09-24  Paul Smith  <psmith@gnu.org>
846         * implicit.c (pattern_search): Add back support for order-only
847         prerequisites for secondary expansion implicit rules, that were
848         accidentally dropped.  If we find a "|", enable order-only mode
849         and set IGNORE_MTIME on all deps that are seen afterward.
850         (pattern_search): Fix memory leaks: for intermediate files where
851         we've already set the file variable and pattern variable sets, be
852         sure to either save or free them as appropriate.
854 2009-09-23  Paul Smith  <psmith@gnu.org>
856         Rework the way secondary expansion is stored, for efficiency.
857         This changes secondary expansion so that ONLY WHEN we know we have
858         a possibility of needing secondary expansion, do we defer the
859         secondary expansion.  This means more parsing the deps but we use
860         a lot less memory (due to the strcache).  Also, this fixes
861         Savannah bug #18622.
863         * read.c (eval): Don't parse the dep string here anymore.
864         (record_files): Take the dep argument as an unparsed string.  If
865         secondary expansion is enabled AND the prereq string has a '$' in
866         it, then set NEED_2ND_EXPANSION and keep the entire string.
867         Otherwise, parse the dep string here to construct the dep list
868         with the names in the strcache.
870         * misc.c (copy_dep_chain): For NEED_2ND_EXPANSION, we need to
871         duplicate the name string (others are in the strcache).
873         * implicit.c: Remove struct idep and free_idep_chain(): unused.
874         (struct patdeps): New structure to store prereq information.
875         (pattern_search): Use the NEED_2ND_EXPANSION flag to determine
876         which prerequisites need expansion, and expand only those.
878         * file.c (split_prereqs): Break parse_prereqs() into two parts: this
879         and enter_prereqs().  split_prereqs() takes a fully-expanded string
880         and splits it into a DEP list, handling order-only prereqs.
881         (enter_prereqs): This function enters a list of DEPs into the file
882         database.  If there's a stem defined, expand any pattern chars.
883         (expand_deps): Only try to expand DEPs which have NEED_2ND_EXPANSION
884         set.  Use the above functions.
885         (snap_deps): Only perform second expansion on prereqs that need it,
886         as defined by the NEED_2ND_EXPANSION flag.
887         (print_prereqs): New function to print the prereqs
888         (print_file): Call print_prereqs() rather than print inline.
890         * hash.h (STRING_COMPARE): Take advantage of strcache() by
891         comparing pointers.
892         (STRING_N_COMPARE): Ditto.
893         (ISTRING_COMPARE): Ditto.
895         * dep.h (PARSE_FILE_SEQ): New macro to reduce casts.
896         (parse_file_seq): Return void*
897         * read.c (parse_file_seq): Return void*.
898         (eval): Invoke macroized version of parse_file_seq()
899         * default.c (set_default_suffixes): Ditto.
900         * file.c (split_prereqs): Ditto.
901         * function.c (string_glob): Ditto.
902         * main.c (main): Ditto.
903         * rule.c (install_pattern_rule): Ditto.
905         * filedef.h: Add split_prereqs(), enter_prereqs(), etc.
907 2009-09-16  Paul Smith  <psmith@gnu.org>
909         * misc.c (alloc_dep, free_dep): Now that we have xcalloc(),
910         convert to macros.
911         * dep.h: Create alloc_dep() / free_dep() macros.
913         * implicit.c (pattern_search): Take advantage of the new
914         parse_file_seq() to add the directory prefix to each prereq.
916         * dep.h: Remove multi_glob() and enhance parse_file_seq() to do it
917         all.  Avoid reversing chains.  Support adding prefixes.
918         * read.c (parse_file_seq): Rewrite to support globbing.  Allow for
919         cached/non-cached results.
920         (eval): Remove multi_glob() & invoke new parse_file_seq().
921         * rule.c (install_pattern_rule): Ditto.
922         * main.c (main): Ditto.
923         * implicit.c (pattern_search): Ditto.
924         * function.c (string_glob): Ditto.
925         * file.c (parse_prereqs): Ditto.
926         * default.c (set_default_suffixes): Ditto.
928         * variable.c (parse_variable_definition): Don't run off the end of
929         the string if it ends in whitespace (found with valgrind).
931         * commands.c (set_file_variables): Keep space for all targets in
932         $? if -B is given (found with valgrind).
934 2009-09-15  Paul Smith  <psmith@gnu.org>
936         * misc.c (concat): Make concat() variadic so it takes >3 arguments.
937         (xcalloc): Add new function.
938         * make.h: New declarations.
940         * ar.c (ar_glob_match): New calling method for concat().
941         * main.c (main): Ditto.
942         (decode_env_switches): Ditto.
943         * read.c (eval_makefile): Ditto.
944         (tilde_expand): Ditto.
945         (parse_file_seq): Ditto.
946         * variable.c (target_environment): Ditto.
947         (sync_Path_environment): Ditto.
949         * ar.c (ar_glob_match): Use xcalloc().
950         * dir.c (file_impossible): Ditto.
951         * file.c (enter_file): Ditto.
952         * job.c (new_job): Ditto.
953         * read.c (parse_file_seq): Ditto.
954         * vmsfunctions.c (opendir): Ditto.
956 2009-09-14  Rafi Einstein  <rafi.einstein@gmail.com>  (tiny patch)
958         * w32/subproc/sub_proc.c (process_begin): Check *ep non-NULL
959         inside the loop that looks up environment for PATH.
961 2009-08-31  Eli Zaretskii  <eliz@gnu.org>
963         * function.c (windows32_openpipe): Update envp after calling
964         sync_Path_environment.
966 2009-08-02  Paul Smith  <psmith@gnu.org>
968         * remake.c (notice_finished_file): Ensure file->cmds is not null
969         before looping through them.  Fixes Savannah bug #21824.
971         * doc/make.texi (Wildcard Examples): Clarify when objects is
972         wildcard-expanded.  Fixes Savannah bug #24509.  Patch by Martin Dorey.
973         (Include): Clarify the behavior of -include.
974         Fixes Savannah bug #18963.
976 2009-08-01  Paul Smith  <psmith@gnu.org>
978         * doc/make.texi (Catalogue of Rules): Clarify where -c, -F,
979         etc. come on the command line.  Fixes Savannah bug #27093.
981         * expand.c (expand_argument): If the argument is large enough use
982         xmalloc() instead of alloca().  Fixes Savannah bug #27143.
984         * variable.c (do_variable_definition): Avoid using alloca() to
985         hold values, which can be large.  Fixes Savannah bug #23960.
987         * job.c (new_job): Use memmove() instead of strcpy() since both
988         pointers are in the same memory block.  Fixes Savannah bug #27148.
989         Patch by Petr Machata.
991 2009-07-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
993         * job.c (construct_command_argv_internal): Add "ulimit" and
994         "unset" to the sh_cmds for Unixy shells.
996 2009-07-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
998         * configure.in: Move side-effects outside AC_CACHE_VAL arguments
999         that set make_cv_sys_gnu_glob, so they are also correctly set
1000         when the cache has been populated before.
1002 2009-07-04  Eli Zaretskii  <eliz@gnu.org>
1004         * function.c (func_realpath) [!HAVE_REALPATH]: Require the file to
1005         exist, as realpath(3) does where it's supported.
1007 2006-07-04  Eli Zaretskii  <eliz@gnu.org>
1009         * function.c (IS_ABSOLUTE, ROOT_LEN): New macros.
1010         (abspath): Support systems that define HAVE_DOS_PATHS (have
1011         drive letters in their file names).  Use IS_PATHSEP instead of a
1012         literal '/' comparison.  Fixes Savannah bug #26886.
1014 2009-06-14  Paul Smith  <psmith@gnu.org>
1016         * remake.c (update_file_1): Remember the original file we marked
1017         as updating, so we can clear that flag again.  If we find a target
1018         via vpath, FILE might change.
1019         (check_dep): Ditto.  Fixes Savannah bug #13529.
1020         Patch by Reid Madsen <reid.madsen@tek.com>.
1022 2009-06-13  Paul Smith  <psmith@gnu.org>
1024         * doc/make.texi (MAKEFILES Variable): Be explicit that files
1025         included by MAKEFILES cannot give default goals.
1026         * read.c (eval): If set_default is not set, pass the no-default-goal
1027         value when we read included makefiles.  Fixes Savannah bug #13401.
1029         * ar.c (ar_name): Ensure that targets with empty parens aren't
1030         considered archive member references: archive members must have a
1031         non-empty "member" string.  Fixes Savannah bug #18435.
1033         * function.c (string_glob): Rely on multi_glob() to determine
1034         whether files exist or not.  Remove call to file_exists_p() which
1035         is not always correct.  Fixes Savannah bug #21231.
1036         * read.c (multi_glob): Add a new argument EXISTS_ONLY; if true
1037         then only files that really exist will be returned.
1038         * dep.h: Add new argument to multi_glob().
1039         * rule.c (install_pattern_rule): Ditto.
1040         * read.c (eval): Ditto.
1041         * main.c (main): Ditto.
1042         * implicit.c (pattern_search): Ditto.
1043         * file.c (parse_prereqs): Ditto.
1044         * default.c (set_default_suffixes): Ditto.
1046 2009-06-09  Paul Smith  <psmith@gnu.org>
1048         * commands.c (set_file_variables): If always_make_flag is set,
1049         always add the prereq to $?.  Fixes Savannah bug #17825.
1051         * remake.c (update_file_1): When rebuilding deps of FILE, also try
1052         to rebuild the deps of all the also_make targets for that file.
1053         Fixes Savannah bug #19108.
1055         * implicit.c (pattern_search): Undo test for is_target, added by
1056         BorisK on 21 Sep 2004.  This goes against step 5c in the "Implicit
1057         Rule Search Algorithm".  Fixes Savannah bug #17752.
1059         * main.c (clean_jobserver): Clear the jobserver_fds options and
1060         set job_slots to the default when we clean up.
1061         (define_makeflags): Return the new MAKEFLAGS value.
1062         (main): Reset MAKEFLAGS in the environment when we re-exec.
1063         Fixes Savannah bug #18124.
1065 2009-06-08  Paul Smith  <psmith@gnu.org>
1067         * read.c (eval): Collapse continuations post-semicolon on target-
1068         specific variables.  Fixes Savannah bug #17521.
1070 2009-06-07  Paul Smith  <psmith@gnu.org>
1072         * job.c (reap_children): For older systems without waitpid() (are
1073         there any of these left?) run wait(2) inside EINTRLOOP to handle
1074         EINTR errors.  Fixes Savannah bug #16401.
1076         * (various): Debug message cleanup.  Fixes Savannah bug #16469.
1078         * main.c: Fix bsd_signal() typedef.  Fixes Savannah bug #16473.
1080         * file.c (snap_deps): Set SNAPPED_DEPS at the start of snapping,
1081         not the end, to catch second expansion $(eval ...) defining new
1082         target/prereq relationships during snap_deps.
1083         Fixes Savannah bug #24622.
1085         * read.c (record_files): The second-expansion "f->updating" hack
1086         was not completely correct: if assumed that the target with
1087         commands always had prerequisites; if one didn't then the ordering
1088         was messed up.  Fixed for now to use f->updating to decide whether
1089         to preserve the last element in the deps list... but this whole
1090         area of constructing and reversing the deps list is too confusing
1091         and needs to be reworked.  Fixes Savannah bug #21198.
1093 2009-06-06  Paul Smith  <psmith@gnu.org>
1095         * hash.c (hash_insert): Remove useless test for NULL.
1096         Fixes Savannah bug #21823.
1098         * make.h: Move SET_STACK_SIZE determination to make.h.
1099         * main.c (main): New global variable, STACK_LIMIT, holds the
1100         original stack limit when make was started.
1101         * job.c (start_job_command): Reset the stack limit, if we changed it.
1102         Fixes Savannah bug #22010.
1104         * remake.c (check_dep): Only set the target's state to not-started
1105         if it's not already running.  Found this while testing -j10 builds
1106         of glibc: various targets were being rebuilt multiple times.
1107         Fix from Knut St. Osmundsen; fixes a problem reported in Savannah
1108         bug #15919.
1110         * read.c (multi_glob): Don't pass GLOB_NOCHECK to glob(3); instead
1111         handle the GLOB_NOMATCH error.  This is to work around Sourceware.org
1112         Bugzilla bug 10246.
1114 2009-06-04  Paul Smith  <psmith@gnu.org>
1116         * read.c (eval): Skip initial whitespace (ffeed, vtab, etc.)
1118         * maintMakefile: Modify access of config and gnulib Savannah
1119         modules to use GIT instead of CVS.
1121         * main.c (main): Initialize the LENGTH field in SHELL_VAR.
1122         Fixes Savannah bug #24655.
1124         * read.c (eval_buffer): Don't dereference reading_file if it's NULL;
1125         this can happen during some invocations of $(eval ...) for example.
1126         Fixes Savannah bug #24588.  Patch by Lars Jessen <ljessen@ljessen.dk>
1128 2009-06-02  Paul Smith  <psmith@gnu.org>
1130         * configure.in: Check for fileno()
1131         * read.c (eval_makefile): If fileno() is available, set CLOSE_ON_EXEC
1132         for the makefile file so invocations of $(shell ...) don't inherit it.
1133         Fixes Savannah bug #24277.
1135 2009-06-01  Paul Smith  <psmith@gnu.org>
1137         * main.c (main): The previous fix for .DEFAULT_GOAL had issues;
1138         expansion was handled incorrectly.  Rework the default goal
1139         handling to save the variable only.  Remove default_goal_file and
1140         default_goal_name.
1141         * read.c (eval): Check default_goal_var, not default_goal_name.
1142         * read.c (record_target_var): Don't check default_goal_file here.
1144 2009-05-31  Paul Smith  <psmith@gnu.org>
1146         * main.c (main): Expand the .DEFAULT_GOAL variable before using
1147         it, and if the multi_glob() returns nothing (say it expanded to
1148         nothing but spaces) then don't crash.  Fixes Savannah bug #25697.
1150         * doc/make.texi (Quick Reference): Add $(if ..), $(or ..), and
1151         $(and ..) to the reference.  Fixes Savannah bug #25694.
1153         * make.1: Be clear that some recipes will be executed even with -n.
1154         * doc/make.texi: Ditto.  Fixes Savannah bug #25460.
1156         * doc/make.texi (Override Directive): Make more clear how
1157         overrides and appends interact.
1158         Elucidates part of Savannah bug #26207.
1160         * read.c (record_target_var): Don't reset the origin on
1161         target-specific variables; try_variable_definition() will handle
1162         this correctly.  Fixes Savannah bug #26207.
1164         * maintMakefile (do-po-update): Copy PO files into $(top_srcdir).
1165         Fixes Savannah bug #25712.
1167         * implicit.c (pattern_search): Keep a pointer to the beginning of
1168         the filename and save that instead of the constructed pointer.
1169         Fixes Savannah bug #26593.
1170         Patch by Mark Seaborn <mrs@mythic-beasts.com>
1172 2009-05-30  Paul Smith  <psmith@gnu.org>
1174         * doc/make.texi (Multi-Line): Add a description of the new abilities
1175         of define/endef.  Rename "Sequences" to "Multi-Line" and fix some
1176         "command sequence" vs. "recipe" syntax.
1177         * read.c (do_define): Modify to allow assignment tokens (=, :=, etc.)
1178         after a define, to create variables with those flavors.
1180 2009-05-25  Paul Smith  <psmith@gnu.org>
1182         Reworked the parser for variable assignments to allow multiple
1183         modifiers, and in any order.  Also allows variable and
1184         prerequisites to be modifier names ('export', 'private', etc.)
1186         * NEWS: Add notes about user-visible changes.
1188         * read.c (struct vmodifiers): Remember what modifiers were seen.
1189         (parse_var_assignment): New function to parse variable assignments.
1190         (eval): Call the new function.  Handle variable assignments earlier.
1192         * variable.c (parse_variable_definition): Only parse; don't create var.
1193         (assign_variable_definition): Call parse, then create the var.
1195 2009-05-24  Paul Smith  <psmith@gnu.org>
1197         * doc/make.texi: Fix the ISBN for the GNU make manual.  Incorrect
1198         value noticed by Hans Stol <hans.stol@nc3a.nato.int>.
1200 2009-03-14  Eli Zaretskii  <eliz@gnu.org>
1202         * w32/pathstuff.c (convert_Path_to_windows32): Fix last change.
1203         Fixes Savannah bug #25412.
1205         * w32/subproc/sub_proc.c <top level>: Update Copyright years.  Add
1206         prototype for xmalloc.
1207         (find_file): Accept 3 arguments PATH_VAR, FULL_FNAME, and FULL_LEN
1208         instead of an LPOFSTRUCT pointer.  Use xmalloc instead of malloc.
1209         Loop over an array of extensions, instead of duplicating the same
1210         code inline.  Use SearchPath followed by CreateFile, instead of
1211         the obsolete OpenFile.  Fixes Savannah bug #17277.
1212         (process_begin): Find $(PATH) in `envp', and pass a pointer to it
1213         to `find_file'.  Fixes Savannah bug #25662.
1215 2009-03-07  Eli Zaretskii  <eliz@gnu.org>
1217         * function.c (func_shell): Don't close pipedes[1] if it is -1.
1218         Fixes Savannah bug #20495.
1220 2009-02-28  Ralf Wildenhues  <address@hidden>
1222         * doc/make.texi (Instead of Execution): Document interaction of
1223         -t with phony targets.
1225 2009-02-23  Ramon Garcia  <ramon.garcia.f@gmail.com>
1227         Introduce a new keyword "private" which applies to target-specific
1228         variables and prevents their values from being inherited.
1230         * variable.h (struct variable): Add private_var flag to each variable.
1231         Add a flag to specify which list entry switches to the parent target.
1232         * variable.c (define_variable_in_set): Initialize private_var flag.
1233         (lookup_variable): Skip private variables in parent contexts.
1234         (initialize_file_variables): Set next_is_parent appropriately.
1235         (print_variable): Show the private_var flag.
1236         * read.c (eval): Recognize the private keyword.
1237         (record_target_var): Set private_var.
1238         * doc/make.texi (Suppressing Inheritance): Add documentation.
1240 2008-10-26  Paul Smith  <psmith@gnu.org>
1242         * configure.in: Check for strndup().
1243         * misc.c (xstrndup): Rename savestring to xstrndup.  Use strndup
1244         if it's available.
1245         * make.h: Rename savestring to xstrndup.
1246         * commands.c (chop_commands): Ditto.
1247         * function.c (func_foreach): Ditto.
1248         * read.c (eval, record_files): Ditto.
1249         * variable.c (define_variable_in_set): Ditto.
1251 2008-09-30  Eli Zaretskii  <eliz@gnu.org>
1253         * build_w32.bat (GCCBuild): Use "-gdwarf-2 -g3" instead of
1254         "-gstabs+ -ggdb3".
1256         * w32/subproc/build.bat (GCCBuild): Likewise.
1258 2008-09-30  David Russo  <d-russo@ti.com>  (tiny change)
1260         * job.c (construct_command_argv_internal): Avoid extra backslash
1261         in batch-mode Unixy shells.  Under DB_JOBS, display the contents
1262         of the batch file.
1264 2008-05-31  Eli Zaretskii  <eliz@gnu.org>
1266         * README.W32.template: Remove obsolete text about non-support for
1267         -jN without Unixy shell.  Remove obsolete text about not supplying
1268         Visual Studio project files (we do supply them).  Modify text to
1269         prefer GCC builds to MSC builds.
1271 2008-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1273         * doc/make.texi (Empty Targets): Fix typo.
1275 2008-03-27  Paul Smith  <psmith@gnu.org>
1277         Fix Savannah bug #22379:
1278         * ar.c (ar_glob_match): Zero the allocated structure.
1279         * read.c (parse_file_seq): Ditto.
1281 2008-03-08  Brian Dessent  <brian@dessent.net>
1283         * maintMakefile: Update Translation Project location.
1285 2008-01-26  Eli Zaretskii  <eliz@gnu.org>
1287         * variable.c (target_environment): Don't use shell_var if its
1288         `value' field is NULL.
1290 2007-12-22  Eli Zaretskii  <eliz@gnu.org>
1292         Suggested by Juan Manuel Guerrero <juan.guerrero@gmx.de>:
1294         * Makefile.DOS.template (info_TEXINFOS): Remove unused variable.
1295         (TEXINFOS): Value changed to `doc/make.texi'.
1296         (.SUFFIXES): Use .texi instead of .texinfo.
1297         (make.info, make.dvi): Depend on doc/make.texi.
1298         (.texi.info): New target, instead of ".texinfo.info".  Change -I
1299         switch to $(MAKEINFO) to look in doc/.  Use --no-split.
1300         (.texi): New target, instead of ".texinfo".  Change -I switch to
1301         $(MAKEINFO) to look in doc/.  Use --no-split.
1302         (.texi.dvi): New target, instead of ".texinfo.dvi".  Change -I
1303         switch to $(MAKEINFO) to look in doc/.
1304         (install-info-am, uninstall-info): Don't look for "*.i[0-9]" and
1305         "*.i[0-9][0-9]" (due to --no-split above).
1306         (noinst_TEXINFOS, TEXI2HTML, TEXI2HTML_FLAGS): New variables.
1307         (html, make_1.html): New targets.
1308         (.PHONY): Add "html".
1309         (.SUFFIXES): Add .html.
1311 2007-12-22  Juan Manuel Guerrero  <juan.guerrero@gmx.de>  (tiny change)
1313         * configh.dos.template [__DJGPP__]: Replace HAVE_SYS_SIGLIST with
1314         HAVE_DECL_SYS_SIGLIST.
1316         * job.c (child_execute_job): Remove __MSDOS__ because MSDOS/DJGPP
1317         build does not use child_execute_job.
1319         * variable.c (define_automatic_variables) [__MSDOS__]: Always
1320         export the SHELL environment variable to the child.
1322 2007-12-22  Eli Zaretskii  <eliz@gnu.org>
1324         * config.h.W32: Include sys/types.h.
1325         [!_PID_T_] (pid_t): Define only if not already defined by sys/types.h.
1327         * vpath.c (construct_vpath_list) [HAVE_DOS_PATHS]: Support VPATH
1328         values that use `:' in drive letters, when PATH_SEPARATOR_CHAR is
1329         also `:'.
1331 2007-11-04  Paul Smith  <psmith@gnu.org>
1333         * doc/make.texi: Convert references to "commands", "command
1334         lines", and "command script" to "recipe".
1335         * NEWS: Ditto.
1336         * commands.c, file.c, job.c, remake.c, read.c, variable.c, main.c:
1337         Ditto.
1339 2007-10-27  Bruno Haible  <bruno@clisp.org>
1341         * remake.c (f_mtime): Print time difference values between 100 and
1342         ULONG_MAX in fixed-point notation rather than in exponention notation.
1344 2007-10-12  Eli Zaretskii  <eliz@gnu.org>
1346         * variable.c (do_variable_definition): Allow $(SHELL) to expand to
1347         a more complex value than a simple shell: if it's not a default
1348         shell now then expand it and see if is a default shell then.
1350 2007-10-10  Eli Zaretskii  <eliz@gnu.org>
1352         * dir.c (find_directory) [WINDOWS32]: Remove trailing slashes from
1353         pathnames, with const strings.
1354         * build_w32.bat [WINDOWS32]: If no config.h.W32 exists, create one
1355         from the template (used for building from CVS, not a dist).
1357 2007-10-10  Paul Smith  <psmith@gnu.org>
1359         * make.h: Add a prototype for w32_kill() (change suggested by
1360         Yongwei Wu <wuyongwei@gmail.com>).
1362 2007-09-21  Eli Zaretskii  <eliz@gnu.org>
1364         * w32/pathstuff.c (convert_Path_to_windows32): Handle quoted
1365         directories in Path.
1367 2007-09-12  Paul Smith  <psmith@gnu.org>
1369         * doc/make.texi: Applied wording cleanups from Savannah patch #6195.
1370         Provided by Diego Biurrun <diego@biurrun.de>
1371         (Complex Makefile): Remove .PHONY setting for tar: patch #6196.
1372         Provided by Diego Biurrun <diego@biurrun.de>
1374 2007-09-11  Paul Smith  <psmith@gnu.org>
1376         * doc/make.texi (Special Variables): Moved this into the "How to
1377         Use Variables" chapter.  Added a table entry for .RECIPEPREFIX.
1378         (MAKEFILE_LIST) No longer a section; this was added into the
1379         "Special Variables" section.
1380         (Rule Introduction): Reference .RECIPEPREFIX.
1381         (Simple Makefile): Ditto.
1382         (Rule Syntax): Ditto.
1383         (Command Syntax): Ditto.
1384         (Error Messages): Ditto.
1386 2007-09-10  Paul Smith  <psmith@gnu.org>
1388         * commands.c (print_commands): Don't print an extra line in the
1389         command scripts.  Prefix the command scripts with cmd_prefix, not \t.
1391         * read.c (construct_include_path): Add the full string to the cache; we
1392         were chopping the last char.
1394         * NEWS: Announce the .RECIPEPREFIX special variable.
1395         * variable.c (lookup_special_var): Rename from handle_special_var().
1396         (lookup_variable): Call the new name.
1397         (set_special_var): New function: handle setting of special variables.
1398         When setting .RECIPEPREFIX, reset the cmd_prefix global variable.
1399         (do_variable_definition): Call it.
1400         * make.h (RECIPEPREFIX_DEFAULT): Define the default command prefix char.
1401         (RECIPEPREFIX_NAME): Define the command prefix special variable name.
1402         * main.c (main): Create the .RECIPEPREFIX special variable.
1403         * read.c (eval): Remove the cmd_prefix characters from the command
1404         scripts here, so they're not stored in the commands array at all,
1405         rather than waiting and stripping them out during command construction.
1406         * job.c (construct_command_argv_internal): Don't skip cmd_prefix here.
1408 2007-08-15  Paul Smith  <psmith@gnu.org>
1410         * doc/make.texi (GNU Free Documentation License): The fdl.texi
1411         file has had the section info removed, so add some to make.texi
1412         before we include it.
1414 2007-08-15  Icarus Sparry  <savannah@icarus.freeuk.com>
1416         * remake.c (check_dep): Reset the target state for intermediate
1417         files.  They might have been considered before but not updated
1418         then (order-only for example) but they will be this time.
1419         Fixes Savannah bug #'s 3330 and 15919.
1421 2007-07-21  Eli Zaretskii  <eliz@gnu.org>
1423         Fix Savannah bug #20549:
1424         * function.c (func_shell): Call construct_command_argv with zero
1425         value of FLAGS.
1426         * job.c (construct_command_argv_internal): New argument FLAGS; all
1427         callers changed.
1428         [WINDOWS32]: If FLAGS has the COMMANDS_RECURSE bit set, ignore
1429         just_print_flag.
1430         * job.h (construct_command_argv_internal): Update prototype.
1432 2007-07-13  Paul Smith  <psmith@gnu.org>
1434         * file.c (expand_deps): Use variable_buffer as the start of the
1435         buffer, not the original pointer (in case it was reallocated).
1436         Fix suggested by Rafi Einstein <rafi.einstein@formalism-labs.com>.
1437         Fixes Savannah bug #20452.
1439 2007-07-04  Paul Smith  <psmith@gnu.org>
1441         * (ALL FILES): Update to GPLv3.
1442         * (ALL FILES): Update copyright for 2007.
1444         * main.c (print_version): Move the host type info to the second line.
1446 2007-06-29  Thiemo Seufer  <ths@mips.com>
1448         * maintMakefile: Update Translation Project location.
1450 2007-06-13  Paul Smith  <psmith@gnu.org>
1452         * doc/make.texi (Reading Makefiles): "Expansion of deferred" ->
1453         "Expansion of a deferred"
1454         Fixes Savannah bug #20018.
1456         * expand.c (variable_expand_for_file): Preserve the value of
1457         reading_file rather than setting it to 0 at the end.
1458         Fixes Savannah bug #20033.
1460 2007-05-11  Paul Smith  <psmith@gnu.org>
1462         * job.c (new_job): Add debug info to specify where make found the
1463         command script it is running to build a target.
1464         Fixes Savannah bug #18617.
1466         * default.c (default_suffixes,default_suffix_rules,default_variables):
1467         Add support for Objective C.  Fixes Savannah bug #16389.
1468         Based on a patch provided by Peter O'Gorman <peter@pogma.com>.
1470         * function.c (func_lastword): Initialize p.
1472         * doc/make.texi (Eval Function, Implicit Variables, Special Targets):
1473         Doc fixes noticed by Bob <twobanjobob@sbcglobal.net>.  Patch from
1474         Dave Korn <dave.korn@artimi.com>
1476 2007-05-08  Paul Smith  <psmith@gnu.org>
1478         Fix Savannah bug #19656:
1480         * configure.in: Check for strcasecmp(), strcmpi(), and stricmp().
1482         * make.h: Change all case-insensitive string compares to use
1483         strcasecmp() (from POSIX).  If we don't have that but do have one
1484         of the others, define strcasecmp to be one of those instead.  If
1485         we don't have any, declare a prototype for our own version.
1487         * misc.c (strcasecmp): Use this if we can't find any native
1488         case-insensitive string comparison function.
1489         * vmsfunctions.c: Remove strcmpi(); we'll use misc.c:strcasecmp().
1490         * main.c (find_and_set_default_shell): Use strcasecmp() instead of
1491         strcmpi().
1492         * job.c (_is_unixy_shell, construct_command_argv_internal): Use
1493         strcasecmp() instead of stricmp().
1494         * hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Use strcasecmp()
1495         instead of strcmpi().
1496         * acinclude.m4: Remove the strcasecmp() check from here.
1498 2007-03-21  Paul Smith  <psmith@gnu.org>
1500         * configure.in: Don't turn on case-insensitive file system support
1501         if --disable-... is given.  Fixes Savannah bug #19348.
1503 2007-03-19  Paul Smith  <psmith@gnu.org>
1505         * ALL: Use the strcache for all file name strings, or other
1506         strings which we will never free.  The goal is to save memory by
1507         avoiding duplicate copies of strings.  However, at the moment this
1508         doesn't save much memory in most situations: due to secondary
1509         expansion we actually save prerequisite lists twice (once before
1510         the secondary expansion, and then again after it's been parsed
1511         into individual file names in the dep list).  We will resolve this
1512         in a future change, by doing the parsing up-front for targets
1513         where secondary expansion is not set.
1515         Moving things into the strcache also allows us to use const
1516         pointers in many more places.
1518 2007-01-03  Paul Smith  <psmith@gnu.org>
1520         * make.h (ENULLLOOP): Reset errno after each failed invocation of
1521         the function, not just the first.  Fixes Savannah bug #18680.
1523 2006-11-18  Paul Smith  <psmith@gnu.org>
1525         * strcache.c (strcache_add_len): Don't allocate a new buffer
1526         unless the string is not already nil-terminated.  Technically this
1527         is a violation of the standard, since we may be passed an array
1528         that is not long enough to test one past.  However, in make this
1529         is never true since we only use nil-terminated strings or
1530         sub-strings thereof.
1532         * read.c (eval, do_define): Use cmd_prefix instead of '\t'.
1534         * main.c: New global cmd_prefix, defaults to '\t'.
1535         * job.c (construct_command_argv_internal): Use cmd_prefix instead
1536         of '\t'.
1538         * dir.c: Constified.
1539         (dir_contents_file_exists_p): Check for an error return from
1540         readdir(), just in case.
1542         * commands.c: Constified.
1543         * default.c: Constified.
1544         * expand.c: Constified.
1545         * function.c: Partial constification.
1546         * variable.c: Partial constification.
1547         * vmsify.c: Constification.  Hard to test this but I hope I didn't
1548         screw it up!
1549         * vpath.c: Partial constification.
1550         * w32/pathstuff.c: Partial constification.
1552 2006-11-16  Eli Zaretskii  <eliz@gnu.org>
1554         * main.c (main) [HAVE_DOS_PATHS]: Treat DOS style argv[0] with
1555         backslashes and drive letters as absolute.
1557 2006-10-22  Paul Smith  <psmith@gnu.org>
1559         * main.c (struct command_switch): Use const and void*.
1561 2006-10-21  Paul Smith  <psmith@gnu.org>
1563         * ar.c: Constified.
1564         * arscan.c: Constified.
1566 2006-09-30  Paul Smith  <psmith@gnu.org>
1568         * doc/make.texi (MAKEFILE_LIST Variable): Modify reference to
1569         point to lastword since the example was updated.
1570         Fixes Savannah bug #16304.
1571         (Secondary Expansion): Correct example description.
1572         Fixes Savannah bug #16468.
1573         (Makefile Contents): Clarify that comments cannot appear within
1574         variable references or function calls.
1575         Fixes Savannah bug #16577.
1576         (Special Targets): Clarify how .NOTPARALLEL works in recursion.
1577         Fixes Savannah bug #17701.
1578         Reported by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
1579         (Prerequisite Types): Added an example of using order-only
1580         prerequisites.  Fixes Savannah bug #17880.
1581         (Rule Syntax): "lise" -> "list"
1582         (Multiple Rules): ... -> @dots{}
1583         (Splitting Lines): ditto.
1585         * remake.c (update_file_1): Prereqs that don't exist should be
1586         considered changed, for the purposes of $?.
1587         Fixes Savannah bug #16051.
1589         * make.1: Remove extraneous "+".
1590         Fixes Savannah bug #16652.
1592 2006-09-06  Paul D. Smith  <psmith@gnu.org>
1594         * configure.in: Include sys/types.h when checking for sys/wait.h.
1596 2006-08-18  Eli Zaretskii  <eliz@gnu.org>
1598         * configure.in (PATH_SEPARATOR_CHAR): Define to the value of
1599         $PATH_SEPARATOR.
1601         * make.h (PATH_SEPARATOR_CHAR): Define only if still undefined.
1602         Normally, it is defined in config.h.
1604         * config/dospaths.m4 <ac_cv_dos_paths>: Define to yes on Cygwin as
1605         well.
1607         * job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]: Define
1608         sh_chars_sh for Windows platforms that emulate Unix.
1610 2006-05-07  Paul D. Smith  <psmith@gnu.org>
1612         * README.OS2.template: Updates provided by Andreas Buening
1613         <andreas.buening@nexgo.de>.
1615 2006-04-30  Paul D. Smith  <psmith@gnu.org>
1617         * make.h: Include <direct.h> if HAVE_DIRECT_H.
1618         * config.h.W32.template (HAVE_DIRECT_H): Set it if it's available.
1620 2006-04-26  Paul D. Smith  <psmith@gnu.org>
1622         * README.cvs: Add a reminder to notify the GNU translation robot.
1624         * doc/make.texi: Change @direcategory (requested by Karl Berry).
1626 2006-04-20  Paul D. Smith  <psmith@gnu.org>
1628         * maintMakefile (po-check): Use Perl instead of grep -E, for systems
1629         that don't have extended grep.
1630         (cvsclean): Use $(PERL) instead of perl.
1632 2006-04-09  Paul D. Smith  <psmith@gnu.org>
1634         * maintMakefile: Add some extra warning options (GCC 4.1 only?)
1636         * expand.c, implicit.c, main.c, read.c: Rename variables so that
1637         inner-scope variables don't mask outer-scope variables.
1639         * ar.c, arscan.c, commands.c, default.c, dir.c, expand.c, file.c:
1640         * function.c, getloadavg.c, implicit.c, job.c, main.c, misc.c, read.c:
1641         * remake.c, remote-cstms.c, rule.c, strcache.c, variable.c:
1642         * vmsfunctions.c, vmsify.c, vpath.c: Remove all casts of returned
1643         values from memory allocation functions: they return void* and so
1644         don't need to be cast.  Also remove (char *) casts of arguments to
1645         xrealloc().
1647         * configure.in: Remove checks for memcpy/memmove/strchr.
1649         * make.h: Remove bcmp/bcopy/bzero/strchr/strrchr macros.
1651         * ar.c, arscan.c, commands.c, dir.c: Convert all bzero/bcopy/bcmp
1652         calls to memset/memcpy/memmove/memcmp calls.
1653         * expand.c, file.c, function.c, getloadavg.c, implicit.c: Ditto.
1654         * job.c, main.c, misc.c, read.c, remake.c, rule.c: Ditto.
1655         * variable.c, vpath.c: Ditto.
1657         * make.h (EXIT_FAILURE): Should be 1, not 0.
1659 2006-04-06  Paul D. Smith  <psmith@gnu.org>
1661         * configure.in: Removed AM_C_PROTOTYPES.  Starting now on we
1662         require an ISO C 1989 standard compiler and runtime library.
1664         * Makefile.am: Remove the ansi2knr feature.
1666         * make.h: Remove the PARAMS() macro definition and all uses of it.
1668         * amiga.h, ar.c, arscan.c: Remove all uses of the PARAMS() macro.
1669         * commands.c, commands.h, config.h-vms.template: Ditto.
1670         * dep.h, dir.c, expand.c, filedef.h, function.c: Ditto.
1671         * implicit.c, job.c, job.h, main.c, read.c, remake.c: Ditto.
1672         * rule.c, rule.h, variable.h, vmsdir.h, vmsjobs.c, vpath.c: Ditto.
1674         * NEWS: Update.
1676 2006-04-01  Paul D. Smith  <psmith@gnu.org>
1678         Version 3.81 released.
1680         * NEWS: Updated for 3.81.
1682         * README.cvs: Mention that vpath builds are not supported out of
1683         CVS.  Fixes Savannah bug #16236.
1684         Remove update of make.texi from the list of things to do; we use
1685         version.texi now.
1687 2006-03-26  Paul D. Smith  <psmith@gnu.org>
1689         * doc/make.texi: Clean up licensing.  Use @copying and version.texi
1690         support from automake, as described in the Texinfo manual.
1692 2006-03-25  Eli Zaretskii  <eliz@gnu.org>
1694         * implicit.c (pattern_search) [HAVE_DOS_PATHS]: Don't compare b
1695         with lastslash, since the latter points to filename, not to
1696         target.
1697         * job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]:
1698         Declare and define sh_chars_sh[].
1700 2006-03-23  Paul D. Smith  <psmith@gnu.org>
1702         * configure.in: Look for build.sh.in in $srcdir so it will be
1703         built for remote configurations as well.
1705         * Makefile.am: Make sure to clean up build.sh during distclean.
1706         Fixes Savannah bug #16166.
1708         * misc.c (log_access): Takes a const char *.
1709         * function.c (fold_newlines): Takes an unsigned int *.
1710         Both fixes for Savannah bug #16170.
1712 2006-03-22  Boris Kolpackov  <boris@kolpackov.net>
1714         * implicit.c (pattern_search): Call set_file_variables only
1715         if we have prerequisites that need second expansion. Fixes
1716         Savannah bug #16140.
1718 2006-03-19  Paul D. Smith  <psmith@gnu.org>
1720         * remake.c (update_file): Add alloca(0) to clean up alloca'd
1721         memory on hosts that don't support it directly.
1723         * README.cvs: Add information on steps for making a release (to
1724         make sure I don't forget any).
1726         * main.c (clean_jobserver): Move jobserver cleanup code into a new
1727         function.
1728         (die): Cleanup code was removed from here; call the new function.
1729         (main): If we are re-execing, clean up the jobserver first so we
1730         don't leak file descriptors.
1731         Reported by Craig Fithian <craig.fithian@citigroup.com>
1733 2006-03-17  Paul D. Smith  <psmith@gnu.org>
1735         * maintMakefile (do-po-update): Rewrite this rule to clean up and
1736         allow multiple concurrent runs.
1737         Patch from Joseph Myers <joseph@codesourcery.com>
1739 2006-03-17  Boris Kolpackov  <boris@kolpackov.net>
1741         * dep.h (struct dep): Add the stem field.
1742         * misc.c (alloc_dep, free_dep): New functions.
1743         (copy_dep_chain): Copy stem.
1744         (free_dep_chain): Use free_dep.
1745         * read.c (record_files): Store stem in the dependency line.
1746         * file.c (expand_deps): Use stem stored in the dependency line. Use
1747         free_dep_chain instead of free_ns_chain.
1748         * implicit.c (pattern_search): Use alloc_dep and free_dep.
1749         * read.c (read_all_makefiles, eval_makefile, eval): Ditto.
1750         * main.c (main, handle_non_switch_argument): Ditto.
1751         * remake.c (check_dep): Ditto.
1752         * rule.c (convert_suffix_rule, freerule): Ditto.
1754 2006-03-14  Paul D. Smith  <psmith@gnu.org>
1756         * expand.c (variable_append): Instead of appending everything then
1757         expanding the result, we expand (or not, if it's simple) each part
1758         as we add it.
1759         (allocated_variable_append): Don't expand the final result.
1760         Fixes Savannah bug #15913.
1762 2006-03-09  Paul Smith  <psmith@gnu.org>
1764         * remake.c (update_file_1): Revert the change of 3 Jan 2006 which
1765         listed non-existent files as changed.  Turns out there's a bug in
1766         the Linux kernel builds which means that this change causes
1767         everything to rebuild every time.  We will re-introduce this fix
1768         in the next release, to give them time to fix their build system.
1769         Fixes Savannah bug #16002.
1770         Introduces Savannah bug #16051.
1772         * implicit.c (pattern_search) [DOS_PATHS]: Look for DOS paths if
1773         we *don't* find UNIX "/".
1774         Reported by David Ergo <david.ergo@alterface.com>
1776 2006-03-04  Eli Zaretskii  <eliz@gnu.org>
1778         * variable.c (do_variable_definition) [WINDOWS32]: Call the shell
1779         locator function find_and_set_default_shell if SHELL came from the
1780         command line.
1782 2006-02-20  Paul D. Smith  <psmith@gnu.org>
1784         * variable.c (merge_variable_set_lists): It's legal for *setlist0
1785         to be null; don't core in that case.
1787 2006-02-19  Paul D. Smith  <psmith@gnu.org>
1789         * commands.c (set_file_variables): Realloc, not malloc, the static
1790         string values to avoid memory leaks.
1792         * expand.c (recursively_expand_for_file): Only set reading_file to
1793         an initialized value.
1795         * implicit.c (pattern_search): We need to make a copy of the stem
1796         if we get it from an intermediate dep, since those get freed.
1798         * file.c (lookup_file) [VMS]: Don't lowercase special targets that
1799         begin with ".".
1800         (enter_file) [VMS]: Ditto.
1801         Patch provided by Hartmut Becker <Hartmut.Becker@hp.com>.
1803 2006-02-24  Eli Zaretskii  <eliz@gnu.org>
1805         * job.c (construct_command_argv_internal): Fix last change.
1807         * w32/subproc/sub_proc.c (process_pipe_io): Make dwStdin,
1808         dwStdout, and dwStderr unsigned int: avoids compiler warnings in
1809         the calls to _beginthreadex.
1811         * expand.c (recursively_expand_for_file): Initialize `save' to
1812         prevent compiler warnings.
1814 2006-02-18  Eli Zaretskii  <eliz@gnu.org>
1816         * job.c (construct_command_argv_internal): Don't create a temporary
1817         script/batch file if we are under -n.  Call _setmode to switch the
1818         script file stream to text mode.
1820 2006-02-17  Paul D. Smith  <psmith@gnu.org>
1822         * variable.c (merge_variable_set_lists): Don't try to merge the
1823         global_setlist.  Not only is this useless, but it can lead to
1824         circularities in the linked list, if global_setlist->next in one
1825         list gets set to point to another list which also ends in
1826         global_setlist.
1827         Fixes Savannah bug #15757.
1829 2006-02-15  Paul D. Smith  <psmith@gnu.org>
1831         Fix for Savannah bug #106.
1833         * expand.c (expanding_var): Keep track of which variable we're
1834         expanding.  If no variable is being expanded, it's the same as
1835         reading_file.
1836         * make.h (expanding_var): Declare it.
1837         * expand.c (recursively_expand_for_file): Set expanding_var to the
1838         current variable we're expanding, unless there's no file info in
1839         it (could happen if it comes from the command line or a default
1840         variable).  Restore it before we exit.
1841         * expand.c (variable_expand_string): Use the expanding_var file
1842         info instead of the reading_file info.
1843         * function.c (check_numeric): Ditto.
1844         (func_word): Ditto.
1845         (func_wordlist): Ditto.
1846         (func_error): Ditto.
1847         (expand_builtin_function): Ditto.
1848         (handle_function): Ditto.
1850 2006-02-14  Paul D. Smith  <psmith@gnu.org>
1852         * read.c (eval): Even if the included filenames expands to the
1853         empty string we still need to free the allocated buffer.
1855         * implicit.c (pattern_search): If we allocated a variable set for
1856         an impossible file, free it.
1857         * variable.c (free_variable_set): New function.
1858         * variable.h: Declare it.
1860         * read.c (read_all_makefiles): Makefile names are kept in the
1861         strcache, so there's never any need to alloc/free them.
1862         (eval): Ditto.
1864         * main.c (main): Add "archives" to the .FEATURES variable if
1865         archive support is enabled.
1866         * doc/make.texi (Special Variables): Document it.
1868 2006-02-13  Paul D. Smith  <psmith@gnu.org>
1870         * implicit.c (pattern_search): Add checking for DOS pathnames to
1871         the pattern rule target LASTSLASH manipulation.
1872         Fixes Savannah bug #11183.
1874 2006-02-11  Paul D. Smith  <psmith@gnu.org>
1876         * (ALL FILES): Updated copyright and license notices.
1878 2006-02-10  Paul D. Smith  <psmith@gnu.org>
1880         A new internal capability: the string cache is a read-only cache
1881         of strings, with a hash table interface for fast lookup.  Nothing
1882         in the cache will ever be freed, so there's no need for reference
1883         counting, etc.  This is the beginning of a full solution for
1884         Savannah bug #15182, but for now we only store makefile names here.
1886         * strcache.c: New file.  Implement a read-only string cache.
1887         * make.h: Add prototypes for new functions.
1888         * main.c (initialize_global_hash_tables): Initialize the string cache.
1889         (print_data_base): Print string cache stats.
1890         * read.c (eval_makefile): Use the string cache to store makefile
1891         names.  Rewrite the string allocation to be sure we free everything.
1893 2006-02-10  Eli Zaretskii  <eliz@gnu.org>
1895         * dir.c (dir_contents_file_exists_p): Don't opendir if the
1896         directory time stamp didn't change, except on FAT filesystems.
1897         Suggested by J. David Bryan <jdbryan@acm.org>.
1899 2006-02-09  Paul D. Smith  <psmith@gnu.org>
1901         * function.c (func_or): Implement a short-circuiting OR function.
1902         (func_and): Implement a short-circuiting AND function.
1903         (function_table_init): Update the table with the new functions.
1904         * doc/make.texi (Conditional Functions): Changed the "if" section
1905         to one on general conditional functions.  Added documentation for
1906         $(and ...) and $(or ...) functions.
1907         * NEWS: Note new $(and ...) and $(or ...) functions.
1909 2006-02-08  Boris Kolpackov  <boris@kolpackov.net>
1911         * job.h (struct child): Add the dontcare bitfield.
1912         * job.c (new_job): Cache dontcare flag.
1913         * job.c (reap_children): Use cached dontcare flag instead of the
1914         one in struct file. Fixes Savannah bug #15641.
1916 2006-02-06  Paul D. Smith  <psmith@gnu.org>
1918         * vpath.c (selective_vpath_search): If the file we find has a
1919         timestamp from -o or -W, use that instead of the real time.
1920         * remake.c (f_mtime): If the mtime is a special token from -o or
1921         -W, don't overwrite it with the real mtime.
1922         Fixes Savannah bug #15341.
1924         Updates from Markus Mauhart <qwe123@chello.at>:
1926         * w32/subproc/sub_proc.c (process_begin): Remove no-op tests.
1927         (process_signal, process_last_err, process_exit_code): Manage
1928         invalid handle values.
1929         (process_{outbuf,errbuf,outcnt,errcnt,pipes}): Unused and don't
1930         manage invalid handles; remove them.
1931         * job.c (start_job_command) [WINDOWS32]: Jump out on error.
1932         * config.h.W32.template [WINDOWS32]: Set flags for Windows builds.
1933         * README.cvs: Updates for building from CVS.
1935 2006-02-05  Paul D. Smith  <psmith@gnu.org>
1937         * file.c (enter_file): Keep track of the last double_colon entry,
1938         to avoid walking the list every time we want to add a new one.
1939         Fixes Savannah bug #15533.
1940         * filedef.h (struct file): Add a new LAST pointer.
1942         * dir.c (directory_contents_hash_cmp): Don't use subtraction to do
1943         the comparison.  For 64-bits systems the result of the subtraction
1944         might not fit into an int.  Use comparison instead.
1945         Fixes Savannah bug #15534.
1947         * doc/make.texi: Update the chapter on writing commands to reflect
1948         the changes made in 3.81 for backslash/newline and SHELL handling.
1950 2006-02-01  Paul D. Smith  <psmith@gnu.org>
1952         * dir.c (dir_contents_file_exists_p) [WINDOWS32]: Make sure
1953         variable st is not used when it's not initialized.
1954         Patch from Eli Zaretskii <eliz@gnu.org>.
1956 2006-01-31  Paul D. Smith  <psmith@gnu.org>
1958         * README.W32.template: Applied patch #4785 from
1959         Markus Mauhart <qwe123@chello.at>.
1960         * README.cvs: Applied patch #4786 from
1961         Markus Mauhart <qwe123@chello.at>.
1962         * make_msvc_net2003.vcproj [WINDOWS32]: New version from
1963         J. Grant <jg@jguk.org>.
1965         * main.c: Update the copyright year in the version output.
1966         * prepare_w32.bat: Remove this file from the distribution.
1968 2006-01-21  Eli Zaretskii  <eliz@gnu.org>
1970         * remake.c (update_goal_chain): Set g->changed instead of
1971         incrementing it, as it is only 8-bit wide, and could overflow if
1972         many commands got started in update_file.
1974         * w32/include/sub_proc.h: Add a prototype for process_used_slots.
1976         * w32/subproc/sub_proc.c: Change dimension of proc_array[] to
1977         MAXIMUM_WAIT_OBJECTS.
1978         (process_wait_for_any_private): Change dimension of handles[]
1979         array to MAXIMUM_WAIT_OBJECTS.
1980         (process_used_slots): New function.
1981         (process_register): Don't register more processes than the
1982         available number of slots.
1983         (process_easy): Don't start new processes if all slots are used up.
1985         * job.c (load_too_high, start_waiting_jobs) [WINDOWS32]: If there
1986         are already more children than sub_proc.c can handle, behave as if
1987         the load were too high.
1988         (start_job_command): Fix a typo in error message when process_easy
1989         fails.
1991 2006-01-14  Eli Zaretskii  <eliz@gnu.org>
1993         * main.c (main) [WINDOWS32]: Don't refuse to run with -jN, even if
1994         the shell is not sh.exe.
1996         * job.c (create_batch_file): Renamed from create_batch_filename;
1997         all callers changed.  Don't close the temporary file; return its
1998         file descriptor instead.  New arg FD allows to return the file
1999         descriptor.
2000         (construct_command_argv_internal): Use _fdopen instead of fopen to
2001         open the batch file.
2003 2006-01-04  Paul D. Smith  <psmith@gnu.org>
2005         * readme.vms: Updates for case-insensitive VMS file systems from
2006         Hartmut Becker <Hartmut.Becker@hp.com>.
2007         * dir.c (vms_hash): Ditto.
2008         * vmsify.c (copyto): Ditto.
2009         * vmsfunctions.c (readdir): Ditto.
2011         * make.1: Add a section on the exit codes for make.
2013         * doc/make.texi: A number of minor updates to the documentation.
2015 2006-01-03  Paul D. Smith  <psmith@gnu.org>
2017         * remake.c (update_file_1): Mark a prerequisite changed if it
2018         doesn't exist.
2020         * read.c (eval): Be sure to strip off trailing whitespace from the
2021         prerequisites list properly.  Also, initialize all fields in
2022         struct dep when creating a new one.
2024 2005-12-28  Paul D. Smith  <psmith@gnu.org>
2026         * config.h.W32.template [WINDOWS32]: Add in some pragmas to
2027         disable warnings for MSC.
2028         Patch by Rob Tulloh <rtulloh@yahoo.com>.
2030 2005-12-17  Eli Zaretskii  <eliz@gnu.org>
2032         * doc/make.texi (Execution): Add a footnote about changes in
2033         handling of backslash-newline sequences.  Mention the differences
2034         on MS-DOS and MS-Windows.
2036         * NEWS: More details about building the MinGW port and a pointer
2037         to README.W32.  Fix the section name that describes the new
2038         backward-incompatible processing of backslash-newline sequences.
2039         The special processing of SHELL set to "cmd" is only relevant to
2040         MS-Windows, not MS-DOS.
2042 2005-12-17  Eli Zaretskii  <eliz@gnu.org>
2044         * main.c (handle_runtime_exceptions): Cast exrec->ExceptionAddress
2045         to DWORD, to avoid compiler warnings.
2046         * job.c (exec_command): Cast hWaitPID and hPID to DWORD, and
2047         use %ld in format, to avoid compiler warnings.
2049         * doc/make.texi (Special Targets): Fix a typo.
2050         (Appending): Fix cross-reference to Setting.
2051         (Special Variables, Secondary Expansion, File Name Functions)
2052         (Flavor Function, Pattern Match, Quick Reference): Ensure two
2053         periods after a sentence.
2054         (Execution): Add @: after "e.g.".
2055         (Environment): Fix punctuation.
2056         (Target-specific, Call Function, Quick Reference): Add @: after "etc."
2057         (Shell Function, Target-specific): Add @: after "vs."
2059 2005-12-14  Boris Kolpackov  <boris@kolpackov.net>
2061         * read.c (record_target_var): Initialize variable's export field
2062         with v_default instead of leaving it "initialized" by whatever
2063         garbage happened to be on the heap.
2065 2005-12-12  Paul D. Smith  <psmith@gnu.org>
2067         * make.1: Fix some display errors and document all existing options.
2068         Patch by Mike Frysinger <vapier@gentoo.org>.
2070 2005-12-11  Paul D. Smith  <psmith@gnu.org>
2072         * implicit.c (pattern_search): If 2nd expansion is not set for
2073         this implicit rule, replace the pattern with the stem directly,
2074         and don't re-expand the variable list.  Along with the other
2075         .SECONDEXPANSION changes below, fixes bug #13781.
2077 2005-12-09  Boris Kolpackov  <boris@kolpackov.net>
2079         * implicit.c (pattern_search): Mark other files that this rule
2080         builds as targets so that they are not treated as intermediates
2081         by the pattern rule search algorithm. Fixes bug #13022.
2083 2005-12-07  Boris Kolpackov  <boris@kolpackov.net>
2085         * remake.c (notice_finished_file): Propagate the change of
2086         modification time to all the double-colon entries only if
2087         it is the last one to be updated. Fixes bug #14334.
2089 2005-11-17  Boris Kolpackov  <boris@kolpackov.net>
2091         * function.c (func_flavor): Implement the flavor function which
2092         returns the flavor of a variable.
2093         * doc/make.texi (Functions for Transforming Text): Document it.
2094         * NEWS: Add it to the list of new functions.
2096 2005-11-14  Boris Kolpackov  <boris@kolpackov.net>
2098         * read.c (construct_include_path): Set the .INCLUDE_DIRS special
2099         variable.
2100         * doc/make.texi (Special Variables): Document .INCLUDE_DIRS.
2101         * NEWS: Add .INCLUDE_DIRS to the list of new special variables.
2103 2005-10-26  Paul Smith  <psmith@gnu.org>
2105         * read.c (record_files): Don't set deps flags if there are no deps.
2106         * maintMakefile: We only need to build the templates when we are
2107         creating a distribution, so don't do it for "all".
2109 2005-10-24  Paul D. Smith  <psmith@gnu.org>
2111         Make secondary expansion optional: its enabled by declaring the
2112         special target .SECONDEXPANSION.
2114         * NEWS: Update information on second expansion capabilities.
2115         * doc/make.texi (Secondary Expansion): Document the
2116         .SECONDEXPANSION special target and its behavior.
2117         * dep.h (struct dep): Add a flag STATICPATTERN, set to true if the
2118         prerequisite list was found in a static pattern rule.
2119         (free_dep_chain): Declare a prototype.
2120         * file.c (parse_prereqs): New function: break out some complexity
2121         from expand_deps().
2122         (expand_deps): If we aren't doing second expansion, replace % with
2123         the stem for static pattern rules.  Call the new function.
2124         * filedef.h (parse_prereqs): Declare a prototype.
2125         * implicit.c (pattern_search): Initialize the new staticpattern
2126         field.
2127         * main.c (second_expansion): Declare a global variable to remember
2128         if the special target has been seen.  Initialize the new
2129         staticpattern field for prerequisites.
2130         * make.h: Extern for second_expansion.
2131         * misc.c (free_dep_chain): New function: frees a struct dep list.
2132         * read.c (read_all_makefiles): Initialize the staticpattern field.
2133         (eval_makefile): Ditto.
2134         (record_files): Check for the .SECONDEXPANSION target and set
2135         second_expansion global if it's found.
2136         Use the new free_dep_chain() instead of doing it by hand.
2137         Set the staticpattern field for prereqs of static pattern targets.
2139 2005-10-16  Paul D. Smith  <psmith@gnu.org>
2141         * main.c (main): Set CURDIR to be a file variable instead of a
2142         default, so that values of CURDIR inherited from the environment
2143         won't override the make value.
2145 2005-09-26  Paul D. Smith  <psmith@gnu.org>
2147         * job.c (construct_command_argv_internal): If the line is empty
2148         remember to free the temporary argv strings.
2149         Fixes bug # 14527.
2151 2005-09-16  Paul D. Smith  <psmith@gnu.org>
2153         * job.c (start_job_command): The noerror flag is a boolean (single
2154         bit); set it appropriately.
2155         Reported by Mark Eichin <eichin@metacarta.com>
2157 2005-08-29  Paul D. Smith  <psmith@gnu.org>
2159         * function.c (func_error): On Windows, output from $(info ...)
2160         seems to come in the wrong order.  Try to force it with fflush().
2162 2005-08-10  Boris Kolpackov  <boris@kolpackov.net>
2164         * read.c (record_files): Move code that sets stem for static
2165         pattern rules out of the if (!two_colon) condition so it is
2166         also executed for two-colon rules. Fixes Savannah bug #13881.
2168 2005-08-08  Paul D. Smith  <psmith@gnu.org>
2170         * make.h: Don't test that __STDC__ is non-0.  Some compilers
2171         (Windows for example) set it to 0 to denote "ISO C + extensions".
2172         Fixes bug # 13594.
2174 2005-08-07  Paul D. Smith  <psmith@gnu.org>
2176         * w32/pathstuff.c (getcwd_fs): Fix warning about assignment in a
2177         conditional (slightly different version of a fix from Eli).
2179         Fix a bug reported by Michael Matz <matz@suse.de>: patch included.
2180         If make is running in parallel without -k and two jobs die in a
2181         row, but not too close to each other, then make will quit without
2182         waiting for the rest of the jobs to die.
2184         * main.c (die): Don't reset err before calling reap_children() the
2185         second time: we still want it to be in the error condition.
2186         * job.c (reap_children): Use a static variable, rather than err,
2187         to control whether or not the error message should be printed.
2189 2005-08-06  Eli Zaretskii  <eliz@gnu.org>
2191         * w32/subproc/sub_proc.c: Include signal.h.
2192         (process_pipe_io, process_file_io): Pass a pointer to a local
2193         DWORD variable to GetExitCodeProcess.  If the exit code is
2194         CONTROL_C_EXIT, put SIGINT into pproc->signal.
2196         * job.c [WINDOWS32]: Include windows.h.
2197         (main_thread) [WINDOWS32]: New global variable.
2198         (reap_children) [WINDOWS32]: Get the handle for the main thread
2199         and store it in main_thread.
2201         * commands.c [WINDOWS32]: Include windows.h and w32err.h.
2202         (fatal_error_signal) [WINDOWS32]: Suspend the main thread before
2203         doing anything else.  When we are done, close the main thread
2204         handle and exit with status 130.
2206 2005-07-30  Eli Zaretskii  <eliz@gnu.org>
2208         * w32/subproc/sub_proc.c (process_begin): Don't pass a NULL
2209         pointer to fprintf.
2211         * main.c (find_and_set_default_shell): If found a DOSish shell,
2212         set sh_found and the value of default_shell, and report the
2213         findings in debug mode.
2215         * job.c (construct_command_argv_internal): Check unixy_shell, not
2216         no_default_sh_exe, to decide whether to use Unixy or DOSish
2217         builtin commands.
2219         * README.W32: Update with info about the MinGW build.
2221         * build_w32.bat: Support MinGW.
2223         * w32/subproc/build.bat: Likewise.
2225         * w32/subproc/sub_proc.c (process_easy): Fix format strings for
2226         printing DWORD args.
2228         * function.c (windows32_openpipe): Fix format strings for printing
2229         DWORD args.
2231         * job.c (reap_children) [WINDOWS32]: Don't declare 'status' and
2232         'reap_mode'.
2233         (start_job_command): Fix format string for printing the result of
2234         process_easy.
2235         (start_job_command) [WINDOWS32]: Do not define.
2236         (exec_command): Fix format string for printing HANDLE args.
2238         * main.c (handle_runtime_exceptions): Fix sprintf format strings
2239         to avoid compiler warnings.
2240         (open_tmpfile): Declare fd only if HAVE_FDOPEN is defined.
2241         (Note: some of these fixes were submitted independently by J. Grant)
2243 2005-07-30  J. Grant <jg@jguk.org>
2245         * prepare_w32.bat: Copy config.h.w32 to config.h if not exist.
2246         * make_msvc_net2003.vcproj, make_msvc_net2003.sln: MSVC Project files.
2247         * Makefile.am (EXTRA_DIST): Add MSVC Project files.
2249 2005-07-15  Paul Smith  <psmith@gnu.org>
2251         * job.c (construct_command_argv_internal) [DOS,WINDOWS32,OS/2]: If
2252         we don't have a POSIX shell, then revert to the old
2253         backslash-newline behavior (where they are stripped).
2254         Fixes bug #13665.
2256 2005-07-08  Paul D. Smith  <psmith@gnu.org>
2258         * config.h.W32.template: Reorder to match the standard config.h,
2259         for easier comparisons.
2260         From J. Grant <jg@jguk.org>
2262         * maintMakefile: Remove .dep_segment before overwriting it, in
2263         case it's not writable or noclobber is set.
2264         * expand.c (variable_expand_string): Cast result of pointer
2265         arithmetic to avoid a warning.
2266         * main.c (switches): Add full-fledged final initializer.
2268 2005-07-06  Paul D. Smith  <psmith@gnu.org>
2270         * configure.in: IRIX has _sys_siglist.  Tru64 UNIX has __sys_siglist.
2271         * signame.c (strsignal): If we found _sys_siglist[] or
2272         __sys_siglist[] use those instead of sys_siglist[].
2273         From Albert Chin <china@thewrittenword.com>
2275 2005-07-04  Paul D. Smith  <psmith@gnu.org>
2277         * config.h-vms.template [VMS]: Latest VMS has its own glob() and
2278         globfree(); set up to use the GNU versions.
2279         From Martin Zinser <zinser@zinser.no-ip.info>
2281 2005-07-03  Paul D. Smith  <psmith@gnu.org>
2283         From J. Grant <jg@jguk.org>:
2285         * README.W32.template: Update the Windows and tested MSVC versions.
2286         * NMakefile.template (CFLAGS_any): Change warning level from W3 to W4.
2287         * w32/subproc/NMakefile (CFLAGS_any): Ditto.
2288         * build_w32.bat: Ditto.
2289         * w32/subproc/build.bat: Ditto.
2291 2005-06-28  Paul D. Smith  <psmith@gnu.org>
2293         * signame.c: HAVE_DECL_* macros are set to 0, not undef, if the
2294         declaration was checked but not present.
2296 2005-06-27  Paul D. Smith  <psmith@gnu.org>
2298         * dir.c (find_directory): Change type of fs_serno/fs_flags/fs_len
2299         to unsigned long.  Fixes Savannah bug #13550.
2301         * w32/subproc/sub_proc.c: Remove (HANDLE) casts on lvalues.
2302         (process_pipe_io): Initialize tStdin/tStdout/tStderr variables.
2303         Fixes Savannah bug #13551.
2305 2005-06-26  Paul D. Smith  <psmith@gnu.org>
2307         * make.h: Fix bug in ANSI_STRING/strerror() handling; only define
2308         it if ANSI_STRING is not set.
2310 2005-06-25  Paul D. Smith  <psmith@gnu.org>
2312         * read.c (eval): If no filenames are passed to any of the
2313         "include" variants, don't print an error.
2314         * doc/make.texi (Include): Document this.
2315         Fixes Savannah bug #1761.
2317         * job.c (construct_command_argv_internal): Sanitize handling of
2318         backslash/newline pairs according to POSIX: that is, keep the
2319         backslash-newline in the command script, but remove a following
2320         TAB character, if present.  In the fast path, make sure that the
2321         behavior matches what the shell would do both inside and outside
2322         of quotes.  In the slow path, quote the backslash and put a
2323         literal newline in the string.
2324         Fixes Savannah bug #1332.
2325         * doc/make.texi (Execution): Document the new behavior and give
2326         some examples.
2327         * NEWS: Make a note of the new behavior.
2329         * make.h [WINDOWS32]: #include <direct.h>.
2330         Fixes Savannah bug #13478.
2332         * remake.c (name_mtime): If the stat() of a file fails and the -L
2333         option was given and the file is a symlink, take the best mtime of
2334         the symlink we can get as the mtime of the file and don't fail.
2335         Fixes Savannah bug #13280.
2337         * read.c (find_char_unquote): Accept a new argument IGNOREVARS.
2338         If it's set, then don't stop on STOPCHARs or BLANKs if they're
2339         inside a variable reference.  Make this function static as it's
2340         only used here.
2341         (eval): Call find_char_unquote() with IGNOREVARS set when we're
2342         parsing an unexpanded line looking for semicolons.
2343         Fixes Savannah bug #1454.
2344         * misc.c (remove_comments): Move this to read.c and make it static
2345         as it's only used there.  Call find_char_unquote() with new arg.
2346         * make.h: Remove prototypes for find_char_unquote() and
2347         remove_comments() since they're static now.
2349         * main.c (main): If we see MAKE_RESTARTS in the environment, unset
2350         its export flag and obtain its value.  When we need to re-exec,
2351         increment the value and add it into the environment.
2352         * doc/make.texi (Special Variables): Document MAKE_RESTARTS.
2353         * NEWS: Mention MAKE_RESTARTS.
2354         * main.c (always_make_set): New variable.  Change the -B option to
2355         set this one instead.
2356         (main): When checking makefiles, only set always_make_flag if
2357         always_make_set is set AND the restarts flag is 0.  When building
2358         normal targets, set it IFF always_make_set is set.
2359         (main): Avoid infinite recursion with -W, too: only set what-if
2360         files to NEW before we check makefiles if we've never restarted
2361         before.  If we have restarted, set what-if files to NEW _after_ we
2362         check makefiles.
2363         Fixes Savannah bug #7566:
2365 2005-06-17  Paul D. Smith  <psmith@gnu.org>
2367         * default.c: Change VMS implicit rules to use $$$$ instead of $$
2368         in the prerequisites list.
2370 2005-06-12  Paul D. Smith  <psmith@gnu.org>
2372         Fix Savannah bug # 1328.
2374         * configure.in: Check for atexit().
2375         * misc.c (close_stdout): Test stdout to see if writes to it have
2376         failed.  If so, be sure to exit with a non-0 error code.  Based on
2377         code found in gnulib.
2378         * make.h: Prototype.
2379         * main.c (main): Install close_stdout() with atexit().
2381 2005-06-10  Paul D. Smith  <psmith@gnu.org>
2383         VMS build updates from Hartmut Becker <Hartmut.Becker@hp.com>:
2385         * vmsjobs.c [VMS]: Updates to compile on VMS: add some missing
2386         headers; make vmsWaitForChildren() static; extern vmsify().
2387         * job.c [VMS]: Move vmsWaitForChildren() prototype to be global.
2388         Don't create child_execute_job() here (it's in vmsjobs.c).
2389         * makefile.vms (job.obj) [VMS]: Add vmsjobs.c as a prerequisite.
2391 2005-06-09  Paul D. Smith  <psmith@gnu.org>
2393         * variable.c (push_new_variable_scope): File variables point
2394         directly to the global_setlist variable.  So, inserting a new
2395         scope in front of that has no effect on those variables: they
2396         don't go through current_variable_set_list.  If we're pushing a
2397         scope and the current scope is global, push it "the other way" so
2398         that the new setlist is in the global_setlist variable, and
2399         next points to a new setlist with the global variable set.
2400         (pop_variable_scope): Properly undo a push with the new
2401         semantics.
2402         Fixes Savannah bug #11913.
2404 2005-05-31  Boris Kolpackov  <boris@kolpackov.net>
2406         * job.c (reap_children): Don't die of the command failed but
2407         the dontcare flag is set. Fixes Savannah bug #13216.
2409         * implicit.c (pattern_search): When creating a target from
2410         an implicit rule match, lookup pattern target and set precious
2411         flag in a newly created target. Fixes Savannah bug #13218.
2413 2005-05-13  Paul D. Smith  <psmith@gnu.org>
2415         Implement "if... else if... endif" syntax.
2417         * read.c (eval): Push all checks for conditional words ("ifeq",
2418         "else", etc.) down into the conditional_line() function.
2419         (conditional_line): Rework to allow "else if..." clause.  New
2420         return value -2 for lines which are not conditionals.  The
2421         ignoring flag can now also be 2, which means "already parsed a
2422         true branch".  If that value is seen no other branch of this
2423         conditional can be considered true.  In the else parsing if there
2424         is extra text after the else, invoke conditional_line()
2425         recursively to see if it's another conditional.  If not, it's an
2426         error.  If so, raise the conditional value to this level instead
2427         of creating a new conditional nesting level.  Special check for
2428         "else" and "endif", which aren't allowed on the "else" line.
2429         * doc/make.texi (Conditional Syntax): Document the new syntax.
2431 2005-05-09  Paul D. Smith  <psmith@gnu.org>
2433         * Makefile.am (EXTRA_make_SOURCES): Add vmsjobs.c
2434         (MAYBE_W32): Rework how SUBDIRS are handled so that "make dist"
2435         recurses to the w32 directory, even on non-Windows systems.  Use
2436         the method suggested in the automake manual.
2437         * configure.in: Add w32/Makefile to AC_CONFIG_FILES.
2438         * maintMakefile (gnulib-url): They moved the texinfo.tex files.
2440 2005-05-07  Paul D. Smith  <psmith@gnu.org>
2442         * main.c (die): If we're dying with a fatal error (not that a
2443         command has failed), write back any leftover tokens before we go.
2445         * job.c (set_child_handler_action_flags): If there are jobs
2446         waiting for the load to go down, set an alarm to go off in 1
2447         second.  This allows us to wake up from a potentially long-lasting
2448         read() and start a new job if the load has gone down.  Turn it off
2449         after the read.
2450         (job_noop): Dummy signal handler function.
2451         (new_job): Invoke it with the new semantics.
2453         * docs/make.texi: Document secondary expansion.  Various cleanups
2454         and random work.
2456 2005-05-03  Paul D. Smith  <psmith@gnu.org>
2458         Rename .DEFAULT_TARGET to .DEFAULT_GOAL: in GNU make terminology
2459         the targets which are to ultimately be made are called "goals";
2460         see the GNU make manual.  Also, MAKECMDGOALS, etc.
2462         * filedef.h, read.c, main.c: Change .DEFAULT_TARGET to
2463         .DEFAULT_GOAL, and default_target_name to default_goal_name.
2464         * doc/make.texi (Special Variables): Document .DEFAULT_GOAL.
2466 2005-05-02  Paul D. Smith  <psmith@gnu.org>
2468         * job.c, vmsjobs.c (vmsWaitForChildren, vms_redirect,
2469         vms_handle_apos, vmsHandleChildTerm, reEnableAst, astHandler,
2470         tryToSetupYAst, child_execute_job) [VMS]: Move VMS-specific
2471         functions to vmsjobs.c.  #include it into jobs.c.
2473         Grant Taylor <gtaylor@picante.com> reports that -j# can lose
2474         jobserver tokens.  I found that this happens when an exported
2475         recursive variable contains a $(shell ...) function reference: in
2476         this situation we could "forget" to write back a token.
2478         * job.c, job.h: Add variable jobserver_tokens: counts the tokens
2479         we have.  It's not reliable to depend on the number of children in
2480         our linked list so keep a separate count.
2481         (new_job): Check jobserver_tokens rather than children &&
2482         waiting_jobs.  Increment jobserver_tokens when we get one.
2483         (free_child): If jobserver_tokens is 0, internal error.  If it's
2484         >1, write a token back to the jobserver pipe (we don't write a
2485         token for the "free" job).  Decrement jobserver_tokens.
2487         * main.c: Add variable master_job_slots.
2488         (main): Set it to hold the number of jobs requested if we're the
2489         master process, when using the jobserver.
2490         (die): Sanity checks: first test jobserver_tokens to make sure
2491         this process isn't holding any tokens we didn't write back.
2492         Second, if master_job_slots is set count the tokens left in the
2493         jobserver pipe and ensure it's the same as master_job_slots (- 1).
2495 2005-04-24  Paul D. Smith  <psmith@gnu.org>
2497         Grant Taylor <gtaylor@picante.com> reports that -j# in conjunction
2498         with -l# can lose jobserver tokens, because waiting jobs are not
2499         consulted properly when checking for the "free" token.
2501         * job.c (free_child): Count waiting_jobs as having tokens.
2502         * job.c (new_job): Ditto.  Plus, call start_waiting_jobs() here to
2503         handle jobs waiting for the load to drop.
2505 2005-04-23  Paul D. Smith  <psmith@gnu.org>
2507         * main.c (main): Be careful to not core if a variable setting in
2508         the environment doesn't contain an '='.  This is illegal but can
2509         happen in broken setups.
2510         Reported by Joerg Schilling <schilling@fokus.fraunhofer.de>.
2512 2005-04-12  Paul D. Smith  <psmith@gnu.org>
2514         The second expansion feature causes significant slowdown.  Timing
2515         a complex makefile (GCC 4.1) shows a slowdown from .25s to just
2516         read the makefile before the feature, to 11+s to do the same
2517         operations after the feature.  Additionally, memory usage
2518         increased drastically.  To fix this I added some intelligence that
2519         avoids the overhead of the second expansion unless it's required.
2521         * dep.h: Add a new boolean field, need_2nd_expansion.
2523         * read.c (eval): When creating the struct dep for the target,
2524         check if the name contains a "$"; if so set need_2nd_expansion to 1.
2525         (record_files): If there's a "%" in a static pattern rule, it gets
2526         converted to "$*" so set need_2nd_expansion to 1.
2528         * file.c (expand_deps): Rework to be more efficient.  Only perform
2529         initialize_file_variables(), set_file_variables(), and
2530         variable_expand_for_file() if the need_2nd_expansion is set.
2532         * implicit.c (pattern_search): Default need_2nd_expansion to 0.
2533         (pattern_search): Ditto.
2534         * main.c (handle_non_switch_argument): Ditto.
2535         (main): Ditto.
2536         * read.c (read_all_makefiles): Ditto.
2537         (eval_makefile): Ditto.
2539 2005-04-07  Paul D. Smith  <psmith@gnu.org>
2541         * main.c (main) [WINDOWS32]: Export PATH to sub-shells, not Path.
2542         * variable.c (sync_Path_environment): Ditto.
2543         Patch by Alessandro Vesely.  Fixes Savannah bug #12209.
2545         * main.c (main): Define the .FEATURES variable.
2546         * NEWS: Announce .FEATURES.
2547         * doc/make.texi (Special Variables): Document .FEATURES.
2549         * remake.c (check_dep): If a file is .PHONY, update it even if
2550         it's marked intermediate.  Fixes Savannah bug #12331.
2552 2005-03-15  Boris Kolpackov  <boris@kolpackov.net>
2554         * file.c (expand_deps): Factor out the second expansion and
2555         prerequisite line parsing logic from snap_deps().
2557         * file.c (snap_deps): Use expand_deps(). Expand and parse
2558         prerequisites of the .SUFFIXES special target first. Fixes
2559         Savannah bug #12320.
2561 2005-03-13  Paul D. Smith  <psmith@gnu.org>
2563         * main.c (main) [MSDOS]: Export SHELL in MSDOS.  Requested by Eli
2564         Zaretskii.
2566 2005-03-11  Paul D. Smith  <psmith@gnu.org>
2568         * signame.c (strsignal): HAVE_DECL_SYS_SIGLIST is 0 when not
2569         available, not undefined (from Earnie Boyd).
2571 2005-03-10  Boris Kolpackov  <boris@kolpackov.net>
2573         * implicit.c (pattern_search): Mark an intermediate target as
2574         precious if it happened to be a prerequisite of some (other)
2575         target. Fixes Savannah bug #12267.
2577 2005-03-09  Paul D. Smith  <psmith@gnu.org>
2579         * read.c (eval_makefile): Add alloca(0).
2580         (eval_buffer): Ditto.
2582 2005-03-09  Boris Kolpackov  <boris@kolpackov.net>
2584         * main.c (main): Use o_file instead of o_default when defining
2585         the .DEFAULT_TARGET special variable.
2586         * read.c (eval): Use define_variable_global() instead of
2587         define_variable() when setting new value for the .DEFAULT_TARGET
2588         special variable.  Fixes Savannah bug #12266.
2590 2005-03-04  Boris Kolpackov  <boris@kolpackov.net>
2592         * imlicit.c (pattern_search): Mark files for which an implicit
2593         rule has been found as targets. Fixes Savannah bug #12202.
2595 2005-03-04  Paul D. Smith  <psmith@gnu.org>
2597         * AUTHORS: Update.
2598         * doc/make.texi (Automatic Variables): Document $|.
2600 2005-03-03  Boris Kolpackov  <boris@kolpackov.net>
2602         * read.c (record_files): Instead of substituting % with
2603         actual stem value in dependency list replace it with $*.
2604         This fixes stem triple expansion bug.
2606         * implicit.c (pattern_search): Copy stem to a separate
2607         buffer and make it a properly terminated string. Assign
2608         this buffer instead of STEM (which is not terminated) to
2609         f->stem. Instead of substituting % with actual stem value
2610         in dependency list replace it with $*. This fixes stem
2611         triple expansion bug.
2613 2005-03-01  Paul D. Smith  <psmith@gnu.org>
2615         * commands.c (fatal_error_signal) [WINDOWS32]: Don't call kill()
2616         on Windows, as it takes a handle not a pid.  Just exit.
2617         Fix from patch #3679, provided by Alessandro Vesely.
2619         * configure.in: Update check for sys_siglist[] from autoconf manual.
2620         * signame.c (strsignal): Update to use the new autoconf macro.
2622 2005-03-01  Boris Kolpackov  <boris@kolpackov.net>
2624         * read.c (record_files): Add a check for the list of prerequisites
2625         of a static pattern rule being empty. Fixes Savannah bug #12180.
2627 2005-02-28  Paul D. Smith  <psmith@gnu.org>
2629         * doc/make.texi (Text Functions): Update docs to allow the end
2630         ordinal for $(wordlist ...) to be 0.
2631         * function.c (func_wordlist): Fail if the start ordinal for
2632         $(wordlist ...) is <1.  Matches documentation.
2633         Resolves Savannah support request #103195.
2635         * remake.c (update_goal_chain): Fix logic for stopping in -q:
2636         previously we were stopping when !-q, exactly the opposite.  This
2637         has been wrong since version 1.34, in 1994!
2638         (update_file): If we got an error don't break out to run more
2639         double-colon rules: just return immediately.
2640         Fixes Savannah bug #7144.
2642 2005-02-27  Paul D. Smith  <psmith@gnu.org>
2644         * misc.c (end_of_token): Make argument const.
2645         * make.h: Update prototype.
2647         * function.c (abspath, func_realpath, func_abspath): Use
2648         PATH_VAR() and GET_PATH_MAX instead of PATH_MAX.
2649         * dir.c (downcase): Use PATH_VAR() instead of PATH_MAX.
2650         * read.c (record_files): Ditto.
2651         * variable.c (do_variable_definition): Ditto.
2653         * function.c (func_error): Create a new function $(info ...) that
2654         simply prints the message to stdout with no extras.
2655         (function_table_init): Add new function to the table.
2656         * NEWS: Add $(info ...) reference.
2657         * doc/make.texi (Make Control Functions): Document it.
2659         New feature: if the system supports symbolic links, and the user
2660         provides the -L/--check-symlink-time flag, then use the latest
2661         mtime between the symlink(s) and the target file.
2663         * configure.in (MAKE_SYMLINKS): Check for lstat() and
2664         readlink().  If both are available, define MAKE_SYMLINKS.
2665         * main.c: New variable: check_symlink_flag.
2666         (usage): Add a line for -L/--check-symlink-times to the help string.
2667         (switches): Add -L/--check-symlink-times command line argument.
2668         (main): If MAKE_SYMLINKS is not defined but the user specified -L,
2669         print a warning and disable it again.
2670         * make.h: Declare check_symlink_flag.
2671         * remake.c (name_mtime): If MAKE_SYMLINKS and check_symlink_flag,
2672         if the file is a symlink then check each link in the chain and
2673         choose the NEWEST mtime we find as the mtime for the file.  The
2674         newest mtime might be the file itself!
2675         * NEWS: Add information about this new feature.
2676         * doc/make.texi (Options Summary): Add -L/--check-symlink-times docs.
2678         Avoid core dumps described in Savannah bug # 12124:
2680         * file.c: New variable snapped_deps remember whether we've run
2681         snap_deps().
2682         (snap_deps): Set it.
2683         * filedef.h: Extern it.
2684         * read.c (record_files): Check snapped_deps; if it's set then
2685         we're trying to eval a new target/prerequisite relationship from
2686         within a command script, which we don't support.  Fatal.
2688 2005-02-28  Boris Kolpackov  <boris@kolpackov.net>
2690         Implementation of the .DEFAULT_TARGET special variable.
2692         * read.c (eval): If necessary, update default_target_name when
2693         reading rules.
2694         * read.c (record_files): Update default_target_file if
2695         default_target_name has changed.
2696         * main.c (default_target_name): Define.
2697         * main.c (main): Enter .DEFAULT_TARGET as make variable. If
2698         default_target_name is set use default_target_file as a root
2699         target to make.
2700         * filedef.h (default_target_name): Declare.
2701         * dep.h (free_dep_chain):
2702         * misc.c (free_dep_chain): Change to operate on struct nameseq
2703         and change name to free_ns_chain.
2704         * file.c (snap_deps): Update to use free_ns_chain.
2706 2005-02-27  Boris Kolpackov  <boris@kolpackov.net>
2708         Implementation of the second expansion in explicit rules,
2709         static pattern rules and implicit rules.
2711         * read.c (eval): Refrain from chopping up rule's dependencies.
2712         Store them in a struct dep as a single dependency line. Remove
2713         the code that implements SySV-style automatic variables.
2715         * read.c (record_files): Adjust the code that handles static
2716         pattern rules to expand all percents instead of only the first
2717         one. Reverse the order in which dependencies are stored so that
2718         when the second expansion reverses them again they appear in
2719         the makefile order (with some exceptions, see comments in
2720         the code). Remove the code that implements SySV-style automatic
2721         variables.
2723         * file.c (snap_deps): Implement the second expansion and chopping
2724         of dependency lines for explicit rules.
2726         * implicit.c (struct idep): Define an auxiliary data type to hold
2727         implicit rule's dependencies after stem substitution and
2728         expansion.
2730         * implicit.c (free_idep_chain): Implement.
2732         * implicit.c (get_next_word): Implement helper function for
2733         parsing implicit rule's dependency lines into words taking
2734         into account variable expansion requests. Used in the stem
2735         splitting code.
2737         * implicit.c (pattern_search): Implement the second expansion
2738         for implicit rules. Also fixes bug #12091.
2740         * commands.h (set_file_variables): Declare.
2741         * commands.c (set_file_variables): Remove static specifier.
2743         * dep.h (free_dep_chain): Declare.
2744         * misc.c (free_dep_chain): Implement.
2746         * variable.h (variable_expand_for_file): Declare.
2747         * expand.c (variable_expand_for_file): Remove static specifier.
2749         * make.h (strip_whitespace): Declare.
2750         * function.c (strip_whitespace): Remove static specifier.
2752 2005-02-26  Paul D. Smith  <psmith@gnu.org>
2754         * main.c (main): Check for ferror() when reading makefiles from stdin.
2755         Apparently some shells in Windows don't close pipes properly and
2756         require this check.
2758 2005-02-24  Jonathan Grant  <jg@jguk.org>
2760         * configure.in: Add MinGW configuration options, and extra w32 code
2761         directory.
2762         * Makefile.am: Add MinGW configuration options, and extra w32 code
2763         directory.
2764         * main.c: Determine correct program string (after last \ without .exe).
2765         * subproc/sub_proc.c: `GetExitCodeProcess' from incompatible pointer
2766         type fix x2
2767         * w32/Makefile.am: Import to build win32 lib of sub_proc etc.
2768         * subproc/w32err.c: MSVC thread directive not applied to MinGW builds.
2769         * tests/run_make_tests.pl, tests/test_driver.pl: MSYS testing
2770         environment support.
2772 2004-04-16  Dmitry V. Levin  <ldv@altlinux.org>
2774         * function.c (func_shell): When initializing error_prefix, check
2775         that reading file name is not null.  This fixes long-standing
2776         segfault in cases like "make 'a1=$(shell :)' 'a2:=$(a1)'".
2778 2005-02-09  Paul D. Smith  <psmith@gnu.org>
2780         * maintMakefile: Update the CVS download URL to simplify them.
2781         Also, the ftp://ftp.gnu.org/GNUinfo site was removed so I'm
2782         downloading the .texi files from Savannah now.
2784         Fixed these issues reported by Markus Mauhart <qwe123@chello.at>:
2786         * main.c (handle_non_switch_argument): Only add variables to
2787         command_variables if they're not already there: duplicate settings
2788         waste space and can be confusing to read.
2790         * w32/include/sub_proc.h: Remove WINDOWS32.  It's not needed since
2791         this header is never included by non-WINDOWS32 code, and it
2792         requires <config.h> to define which isn't always included first.
2794         * dir.c (read_dirstream) [MINGW]: Use proper macro names when
2795         testing MINGW32 versions.
2797         * main.c (log_working_directory): flush stdout to be sure the WD
2798         change is printed before any stderr messages show up.
2800 2005-02-01  Paul D. Smith  <psmith@gnu.org>
2802         * maintMakefile (po_repo): Update the GNU translation site URL.
2804 2004-12-01  Paul D. Smith  <psmith@gnu.org>
2806         * main.c (main): Change char* env_shell to struct variable shell_var.
2807         * variable.c (target_environment): Use new shell_var.
2809 2004-11-30  Paul D. Smith  <psmith@gnu.org>
2811         * configure.in: The old way we avoided creating build.sh from
2812         build.sh.in before build.sh.in exists doesn't work anymore; we
2813         have to use raw M4 (thanks to Andreas Schwab <schwab@suse.de> for
2814         the help!).  This also keeps automake from complaining.
2815         * Makefile.am (README): Add a dummy target so automake won't
2816         complain that this file doesn't exist when we checkout from CVS.
2817         * maintMakefile (.dep_segment): Rewrite this rule since newer
2818         versions of automake don't provide DEP_FILES.
2820 2004-11-30  Boris Kolpackov  <boris@kolpackov.net>
2822         Implementation of `realpath' and `abspath' built-in functions.
2824         * configure.in: Check for realpath.
2825         * function.c (abspath): Return an absolute file name that does
2826         not contain any `.' or `..' components, nor repeated `/'.
2827         * function.c (func_abspath): For each name call abspath.
2828         * function.c (func_realpath): For each name call realpath
2829         from libc or delegate to abspath if realpath is not available.
2830         * doc/make.texi (Functions for File Names): Document new functions.
2831         * doc/make.texi (Quick Reference): Ditto.
2833 2004-11-28  Paul D. Smith  <psmith@gnu.org>
2835         * main.c (main) [WINDOWS32]: Remove any trailing slashes from -C
2836         arguments.  Fixes bug #10252.
2838         Fix for bug #1276: Handle SHELL according to POSIX requirements.
2840         * main.c (main): Set SHELL to v_noexport by default.  Remember the
2841         original environment setting of SHELL in the env_shell variable.
2842         * main.h: Export new env_shell variable.
2843         * variable.c (target_environment): If we find a v_noexport
2844         variable for SHELL, add a SHELL variable with the env_shell value.
2845         * doc/make.texi (Quick Reference): Document the POSIX behavior.
2846         * doc/make.texi (Variables/Recursion): Ditto.
2848 2004-11-28  Paul D. Smith  <psmith@gnu.org>
2850         * main.c (find_and_set_default_shell) [WINDOWS32]: check for
2851         equality of "cmd"/"cmd.exe", not inequality.  Fixes bug #11155.
2852         Patch by Alessandro Vesely.
2854 2004-11-12  Paul D. Smith  <psmith@gnu.org>
2856         * job.c (child_execute_job) [VMS]: Don't treat "#" as a comment on
2857         the command line if it's inside a string.
2858         Patch by: Hartmut Becker <Hartmut.Becker@hp.com>
2860 2004-10-21  Boris Kolpackov  <boris@kolpackov.net>
2862         * function.c (func_lastword): New function: return last word
2863         from the list of words.
2864         * doc/make.texi: Document $(lastword ). Fix broken links in
2865         Quick Reference section.
2867 2004-10-06  Paul D. Smith  <psmith@gnu.org>
2869         Apply patch from Alessandro Vesely, provided with bug # 9748.
2870         Fix use of tmpnam() to work with Borland C.
2872         * job.c (construct_command_argv_internal) [WINDOWS32]: Remove
2873         construction of a temporary filename, and call new function
2874         create_batch_filename().
2875         (create_batch_filename) [WINDOWS32]: New function to create a
2876         temporary filename.
2878 2004-10-05  Boris Kolpackov  <boris@kolpackov.net>
2880         * read.c (record_target_var): Expand simple pattern-specific
2881         variable.
2882         * variable.c (initialize_file_variables): Do not expand simple
2883         pattern-specific variable.
2885 2004-09-28  Boris Kolpackov  <boris@kolpackov.net>
2887         * remake.c (update_file_1): When rebuilding makefiles inherit
2888         dontcare flag from a target that triggered update.
2890 2004-09-27  Boris Kolpackov  <boris@kolpackov.net>
2892         * variable.c (initialize_file_variables): Mark pattern-specific
2893         variable as a per-target and copy export status.
2895 2004-09-21  Boris Kolpackov  <boris@kolpackov.net>
2897         * file.c (snap_deps): Mark .PHONY prerequisites as targets.
2899         * implicit.c (pattern_search): When considering an implicit rule's
2900         prerequisite check that it is actually a target rather then
2901         just an entry in the file hashtable.
2903 2004-09-21  Paul D. Smith  <psmith@gnu.org>
2905         * read.c (readstring): Fix some logic errors in backslash handling.
2906         (eval): Remove some unnecessary processing in buffer handling.
2907         (record_target_var): Assert that parse_variable_definition() succeeded.
2908         Reported by: Markus Mauhart <qwe123@chello.at>.
2910         * misc.c: Removed the sindex() function.  All instances of this
2911         function were trivially replaceable by the standard strstr()
2912         function, and that function will always have better (or certainly
2913         no worse) performance than the very simple-minded algorithm
2914         sindex() used.  This can matter with complex makefiles.
2915         * make.h: Remove the prototype for sindex().
2916         * function.c (subst_expand): Convert sindex() call to strstr().
2917         This means we no longer need to track the TLEN value so remove that.
2918         (func_findstring): Convert sindex() to strstr().
2919         * commands.c (chop_commands): Convert sindex() calls to strstr().
2920         Suggested by: Markus Mauhart <qwe123@chello.at>.
2922         * main.c (find_and_set_default_shell) [WINDOWS32]: Implement the
2923         idea behind Savannah Patch #3144 from david.baird@homemail.com.
2924         If SHELL is set to CMD.EXE then assume it's batch-mode and
2925         non-unixy.  I wrote the code differently from the patch, though,
2926         to make it safer.  This also resolves bug #9174.
2928 2004-09-20  Paul D. Smith  <psmith@gnu.org>
2930         * expand.c (variable_expand_string): Modify to invoke
2931         patsubst_expand() instead of subst_expand(); the latter didn't
2932         handle suffix patterns correctly.
2933         * function.c (subst_expand): Remove the SUFFIX_ONLY parameter; it
2934         was used only from variable_expand_string() and is no longer used
2935         there.
2936         (func_subst): Ditto, on call to subst_expand().
2937         (patsubst_expand): Require the percent pointers to point to the
2938         character after the %, not to the % itself.
2939         * read.c (record_files): New call criteria for patsubst_expand().
2940         * variable.h: Remove SUFFIX_ONLY from subst_expand() prototype.
2941         This is to fix a bug reported by Markus Mauhart <qwe123@chello.at>.
2943 2004-09-19  Paul D. Smith  <psmith@gnu.org>
2945         * function.c (subst_expand): Fix a check in by_word: look for a
2946         previous blank if we're beyond the beginning of the string, not
2947         the beginning of the word.
2948         Bugs reported by Markus Mauhart <qwe123@chello.at>.
2950 2004-05-16  Paul D. Smith  <psmith@gnu.org>
2952         * remake.c (update_goal_chain): Change the argument specifying
2953         whether we're rebuilding makefiles to be a global variable,
2954         REBUILDING_MAKEFILES.
2955         (complain): Extract the code that complains about no rules to make
2956         a target into a separate function.
2957         (update_file_1): If we tried to rebuild a file during the makefile
2958         rebuild phase and it was dontcare, then no message was printed.
2959         If we then try to build the same file during the normal build,
2960         print a message this time.
2961         (remake_file): Don't complain about un-remake-able files when
2962         we're rebuilding makefiles.
2964 2004-05-11  Paul D. Smith  <psmith@gnu.org>
2966         * job.c (construct_command_argv_internal): OS/2 patches from
2967         Andreas Buening <andreas.buening@nexgo.de>.
2969 2004-05-10  Paul D. Smith  <psmith@gnu.org>
2971         * remake.c (update_file): Don't walk the double-colon chain unless
2972         this is a double-colon rule.  Fix suggested by Boris Kolpackov
2973         <boris@kolpackov.net>.
2975         * makefile.vms (CFLAGS): Remove glob/globfree (see readme.vms docs)
2976         * readme.vms: New section describing OpenVMS support and issues.
2977         * default.c (default_variables): Add support for IA64.
2978         * job.c (tryToSetupYAst) [VMS]: On VMS running make in batch mode
2979         without some privilege aborts make with the error
2980         %SYSTEM-F-NOPRIV. It happens when setting up a handler for
2981         pressing Ctrl+Y and the input device is no terminal. The change
2982         catches this error and just continues.
2984         Patches by Hartmut Becker <Hartmut.Becker@hp.com>
2986 2004-04-25  Paul D. Smith  <psmith@gnu.org>
2988         * commands.c (set_file_variables): Set $< properly in the face of
2989         order-only prerequisites.
2990         Patch from Boris Kolpackov <boris@kolpackov.net>
2992 2004-04-21  Bob Byrnes  <byrnes@curl.com>
2994         * main.c (main): Notice failures to remake makefiles.
2996 2004-03-28  Paul D. Smith  <psmith@gnu.org>
2998         Patches for Acorn RISC OS by Peter Naulls <peter@chocky.org>
3000         * job.c: No default shell for RISC OS.
3001         (load_too_high): Hard-code the return to 1.
3002         (construct_command_argv_internal): No sh_chars or sh_cmds.
3003         * getloadavg.c: Don't set LOAD_AVE_TYPE on RISC OS.
3005 2004-03-20  Paul D. Smith  <psmith@gnu.org>
3007         * variable.c (do_variable_definition): Don't append from the
3008         global set if a previous non-appending target-specific variable
3009         definition exists.  Reported by Oliver Schmidt <oschmidt@gmx.net>
3010         (with fix).
3012         * expand.c (reference_variable): Don't give up on variables with
3013         no value that have the target-specific append flag set: they might
3014         have a value after all.  Reported by Oliver Schmidt
3015         <oschmidt@gmx.net> (with fix) and also by Maksim A. Nikulin
3016         <nikulin@dx1cmd.inp.nsk.su>.
3018         * rule.c (count_implicit_rule_limits): Don't delete patterns which
3019         refer to absolute pathnames in directories that don't exist: some
3020         portion of the makefile could create those directories before we
3021         match the pattern.  Fixes bugs #775 and #108.
3023         Fixes from Jonathan R. Grant  <jg-make@jguk.org>:
3025         * main.c (main): Free makefile_mtimes if we have any.
3026         * README.W32.template: Update documentation for the current status
3027         of the MS-Windows port.
3028         * NMakefile.template (MAKE): Add "MAKE = nmake".  A conflicting
3029         environment variable is sometimes already defined which causes the
3030         build to fail.
3031         * main.c (debug_signal_handler): Only define this function if
3032         SIGUSR1 is available.
3034         Fixes for OS/2 from Andreas Beuning <andreas.buening@nexgo.de>:
3036         * configure.in [OS/2]: Relocate setting of HAVE_SA_RESTART for OS/2.
3037         * README.OS2.template: Documentation updates.
3038         * build.template: Add LIBINTL into LOADLIBES.  Add $CFLAGS to the
3039         link line for safety.
3040         * maintMakefile (build.sh.in): Remove an extraneous ")".
3041         * job.c (child_execute_job): Close saved FDs.
3042         * job.c (exec_command) [OS/2]: exec_command(): If the command
3043         can't be exec'ed and if the shell is not Unix-sh, then try again
3044         with argv = { "cmd", "/c", ... }. Normally, this code is never
3045         reached for the cmd shell unless the command really doesn't exist.
3046         (construct_command_argv_internal) [OS/2]: The code for cmd
3047         handling now uses new_argv = { "cmd", "/c", "original line", NULL}.
3048         The CMD builtin commands are case insensitive so use strcasecmp().
3050 2004-03-19  Paul D. Smith  <psmith@gnu.org>
3052         * read.c (do_define): Re-order line counter increment so the count
3053         is accurate (we were losing one line per define).  Reported by
3054         Dave Yost <Dave@Yost.com>.
3056 2004-03-06  Paul D. Smith  <psmith@gnu.org>
3058         * configure.in (HAVE_ANSI_COMPILER): Define if we have an ANSI/ISO
3059         compiler.
3060         * make.h: Convert uses of __STDC__ to HAVE_ANSI_COMPILER.
3061         * misc.c (message,error,fatal): Ditto.
3062         * configh.dos.template: Define HAVE_ANSI_COMPILER.
3063         * config.h.W32.template: Ditto.
3064         * config.h-vms.template: Ditto.
3065         * config.ami.template: Ditto.
3067 2004-03-04  Paul D. Smith  <psmith@gnu.org>
3069         * README.template: Add a note about broken /bin/sh on SunOS
3070         4.1.3_U1 & 4.1.4.  Fix up Savannah links.
3072         * misc.c (message, error, fatal): Don't use "..." if we're using
3073         varargs.  ansi2knr should handle this but it doesn't work: it
3074         translates "..." to va_dcl etc. but _AFTER_ the preprocessor is
3075         done.  On many systems (SunOS for example) va_dcl is a #define.
3076         So, force the use of the non-"..." version on pre-ANSI compilers.
3078         * maintMakefile (sign-dist): Create some rules to help automate
3079         the new GNU ftp upload method.
3081 2004-02-24  Paul D. Smith  <psmith@gnu.org>
3083         * config.h.W32.template: Add HAVE_STDARG_H
3084         * config.h-vms.template: Ditto.
3085         * config.ami.template: Ditto.
3087 2004-02-23  Jonathan Grant  <jg-make@jguk.org>
3089         * README.W32.template: Add a notation about -j with BATCH_MODE_ONLY.
3090         * build_w32.bat: Remove extra "+".
3092 2004-02-23  Paul D. Smith  <psmith@gnu.org>
3094         * make.h: Create an UNUSED macro to mark unused parameters.
3095         * (many): Clean up warnings by applying UNUSED, fixing
3096         signed/unsigned incompatibilities, etc.
3098         * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add quoting to silence
3099         autoconf warnings.
3100         * filedef.h: Name the command_state enumeration.
3101         * file.c (set_command_state): Use the enumeration in the function
3102         argument.
3104         * configure.in: Explicitly set SET_MAKE to empty, to disable
3105         MAKE=make even when no make already exists.  Fix bug #3823.
3107 2004-02-22  Paul D. Smith  <psmith@gnu.org>
3109         * maintMakefile: Perl script to clean up all non-CVS files.  Use
3110         it on all the subdirectories for the cvs-clean target.
3112         * main.c (decode_switches): Require non-empty strings for all our
3113         string command-line options.  Fixes Debian bug # 164165.
3115         * configure.in: Check for stdarg.h and varargs.h.
3116         * make.h (USE_VARIADIC): Set this if we can use variadic functions
3117         for printing messages.
3118         * misc.c: Check USE_VARIADIC instead of (obsolete) HAVE_STDVARARGS.
3119         (message): Ditto.
3120         (error): Ditto.
3121         (fatal): Ditto.
3123         A number of patches for OS/2 support from Andreas Buening
3124         <andreas.buening@nexgo.de>:
3126         * job.c (child_handler) [OS/2]: Allow this on OS/2 but we have to
3127         disable the SIGCHLD handler.
3128         (reap_children) [OS/2]: Remove special handling of job_rfd.
3129         (set_child_handler_action_flags) [OS/2]: Use this function in OS/2.
3130         (new_job) [OS/2]: Disable the SIGCHLD handler on OS/2.
3131         * main.c (main) [OS/2]: Special handling for paths in OS/2.
3132         * configure.in [OS/2]: Force SA_RESTART for OS/2.
3133         * Makefile.am (check-regression): Use $(EXEEXT) for Windows-type
3134         systems.
3136 2004-02-21  Paul D. Smith  <psmith@gnu.org>
3138         * w32/subproc/sub_proc.c (process_easy) [W32]: Christoph Schulz
3139         <mail@kristov.de> reports that if process_begin() fails we don't
3140         handle the error condition correctly in all cases.
3141         * w32/subproc/w32err.c (map_windows32_error_to_string): Make sure
3142         to have a newline on the message.
3144         * job.c (construct_command_argv_internal): Add "test" to UNIX
3145         sh_cmds[].  Fixes Savannah bug # 7606.
3147 2004-02-04  Paul D. Smith  <psmith@gnu.org>
3149         * job.c (vms_handle_apos) [VMS]: Fix various string handling
3150         situations in VMS DCL.  Fixes Savannah bug #5533.  Fix provided by
3151         Hartmut Becker <Hartmut.Becker@hp.com>.
3153 2004-01-21  Paul D. Smith  <psmith@gnu.org>
3155         * job.c (load_too_high): Implement an algorithm to control the
3156         "thundering herd" problem when using -l to control job creation
3157         via the load average.  The system only recomputes the load once a
3158         second but we can start many jobs in a second.  To solve this we
3159         keep track of the number of jobs started in the last second and
3160         apply a weight to try to guess what a correct load would be.
3161         The algorithm was provided by Thomas Riedl <thomas.riedl@siemens.com>.
3162         Also fixes bug #4693.
3163         (reap_children): Decrease the job count for this second.
3164         (start_job_command): Increase the job count for this second.
3166         * read.c (conditional_line): Expand the text after ifn?def before
3167         checking to see if it's a single word.  Fixes bug #7257.
3169 2004-01-09  Paul D. Smith  <psmith@gnu.org>
3171         * file.c (print_file): Recurse to print all targets in
3172         double-colon rules.  Fixes bug #4518, reported (with patch) by
3173         Andrew Chatham <chatham@google.com>.
3175 2004-01-07  Paul D. Smith  <psmith@gnu.org>
3177         * acinclude.m4: Remove make_FUNC_SETVBUF_REVERSED.
3178         * configure.in: Change make_FUNC_SETVBUF_REVERSED to
3179         AC_FUNC_SETVBUF_REVERSED.
3181         * doc/make.texi (Target-specific): Fix Savannah bug #1772.
3182         (MAKE Variable): Fix Savannah bug #4898.
3184         * job.c (construct_command_argv_internal): Add "!" to the list of
3185         shell escape chars.  POSIX sh allows it to appear before a
3186         command, to negate the exit code.  Fixes bug #6404.
3188         * implicit.c (pattern_search): When matching an implicit rule,
3189         remember which dependencies have the ignore_mtime flag set.
3190         Original fix provided in Savannah patch #2349, by Benoit
3191         Poulot-Cazajous <Benoit.Poulot-Cazajous@jaluna.com>.
3193 2003-11-22  Paul D. Smith  <psmith@gnu.org>
3195         * README.W32.template (Outputs): Clarification on -j with
3196         BATCH_MODE_ONLY_SEHLL suggested by Jonathan R. Grant
3197         <jg-make@jguk.org>.
3199 2003-11-02  Paul D. Smith  <psmith@gnu.org>
3201         * function.c (func_if): Strip all the trailing whitespace from the
3202         condition, then don't expand it.  Fixed bug # 5798.
3204         * expand.c (recursively_expand_for_file): If we're expanding a
3205         variable with no file context, then use the variable's context.
3206         Fixes bug # 6195.
3208 2003-10-21  Paul D. Smith  <psmith@gnu.org>
3210         * main.c (log_working_directory): Add newlines to printf()s.
3212         * README.cvs: Add a note to ignore warnings during autoreconf.
3214         * maintMakefile (po_repo): Set a new URL for PO file updates.
3215         (get-config/config.guess get-config/config.sub): Get these files
3216         from the Savannah config project instead of ftp.gnu.org.
3218 2003-10-05  Paul Eggert  <eggert@twinsun.com>
3220         * main.c (main): Avoid potential subscript error if environ has
3221         short strings.
3223 2003-08-22  Paul D. Smith  <psmith@gnu.org>
3225         * misc.c (xmalloc, xrealloc): Add one to 0 sizes, to cater to
3226         systems which don't yet implement the C89 standard :-/.
3228 2003-07-18  Paul D. Smith  <psmith@gnu.org>
3230         * dir.c (directory_contents_hash_1, directory_contents_hash_1)
3231         [WINDOWS32]: Initialize hash.
3233 2003-06-19  Earnie Boyd  <earnie@uses.sf.net>
3235         * dir.c (read_dirstream): Provide a workaround for broken versions of
3236         the MinGW dirent structure.
3238 2003-05-30  Earnie Boyd  <earnie@users.sf.net>
3240         * w32/include/dirent.h: Add __MINGW32__ filter.
3242 2003-05-30  Earnie Boyd  <earnie@users.sf.net>
3244         * make.h: Add global declaration of *make_host.
3245         * main.c (print_usage): Remove local declaration of *make_host.
3246         (print_version): Display "This program built for ..." after Copyright
3247         notice.
3249 2003-05-30  Earnie Boyd  <earnie@users.sf.net>
3251         * doc/make.texi: Change "ifinfo" to "ifnottex" as suggested by the
3252         execution of "makeinfo --html make.texi".
3254 2003-04-30  Paul D. Smith  <psmith@gnu.org>
3256         * build.template: Make some changes to maybe allow this script to
3257         work on DOS/Windows/OS2 systems.  Suggested by Andreas Buening.
3259         * README.OS2.template: New file for OS/2 support.  Original
3260         contributed by Andreas Buening.
3261         * configure.in: Invoke new pds_AC_DOS_PATHS macro to test for
3262         DOS-style paths.
3264 2003-04-19  Paul D. Smith  <psmith@gnu.org>
3266         Fix bug #1405: allow a target to match multiple pattern-specific
3267         variables.
3269         * rule.c (create_pattern_var, lookup_pattern_var): Move these to
3270         variable.c, where they've always belonged.
3271         * rule.h: Move the prototypes and struct pattern_var as well.
3272         * variable.c (initialize_file_variables): Invoke
3273         lookup_pattern_var() in a loop, until no more matches are found.
3274         If a match is found, create a new variable set for the target's
3275         pattern variables.  Then merge the contents of each matching
3276         pattern variable set into the target's pattern variable set.
3277         (lookup_pattern_var): Change this function to be usable
3278         in a loop.  It takes a starting position: if NULL, start at the
3279         beginning; if non-NULL, start with the pattern variable after that
3280         position, and return the next matching pattern.
3281         (create_pattern_var): Create a unique instance of
3282         pattern-specific variables for every definition in the makefile.
3283         Don't combine the same pattern together.  This allows us to
3284         process the variable handling properly even when the same pattern
3285         is used multiple times.
3286         (parse_variable_definition): New function: break out the parsing
3287         of a variable definition line from try_variable_definition.
3288         (try_variable_definition): Call parse_variable_definition to
3289         parse.
3290         (print_variable_data_base): Print out pattern-specific variables.
3291         * variable.h (struct variable): Remember when a variable is
3292         conditional.  Also remember its flavor.
3293         (struct pattern_var): Instead of keeping a variable set, we just
3294         keep a single variable for each pattern.
3295         * read.c (record_target_var): Each pattern variable contains only a
3296         single variable, not a set, so create it properly.
3297         * doc/make.texi (Pattern-specific): Document the new behavior.
3299 2003-04-17  Paul D. Smith  <psmith@gnu.org>
3301         * dir.c (file_exists_p) [VMS]: Patch provided with Bug #3018 by
3302         Jean-Pierre Portier <portierjp2@free.fr>.  I don't understand the
3303         file/directory naming rules for VMS so I can't tell whether this
3304         is correct or not.
3306 2003-04-09  Paul D. Smith  <psmith@gnu.org>
3308         * configure.in (HAVE_DOS_PATHS): Define this on systems that need
3309         DOS-style pathnames: backslash separators and drive specifiers.
3311 2003-03-28  Paul D. Smith  <psmith@gnu.org>
3313         * file.c (snap_deps): If .SECONDARY with no targets is given, set
3314         the intermediate flag on all targets.  Fixes bug #2515.
3316 2003-03-24  Paul D. Smith  <psmith@gnu.org>
3318         * configure.in, Makefile.am, glob/Makefile.am, doc/Makefile.am:
3319         Upgrade to autoconf 2.57 and automake 1.7.3.
3321         * job.c: More OS/2 changes from Andreas Buening.
3323         * file.c (print_file): Fix variable initialization.
3324         Fixes bug #2892.
3326         * remake.c (notice_finished_file):
3328         * make.h (ENULLLOOP): Set errno = 0 before invoking the command;
3329         some calls (like readdir()) return NULL in valid situations
3330         without resetting errno.  Fixes bug #2846.
3332 2003-02-25  Paul D. Smith  <psmith@gnu.org>
3334         Port to OS/2 (__EMX__) by Andreas Buening <andreas.buening@nexgo.de>.
3336         * job.c (_is_unixy_shell) [OS/2]: New function.
3337         Set default shell to /bin/sh.
3338         (reap_children): Close the job_rfd pipe here since we don't use a
3339         SIGCHLD handler.
3340         (set_child_handler_action_flags): define this to empty on OS/2.
3341         (start_job_command): Close the jobserver pipe and use
3342         child_execute_job() instead of fork/exec.
3343         (child_execute_job): Rewrite to handle stdin/stdout FDs and spawn
3344         rather than exec'ing, then reconfigure stdin/stdout.
3345         (exec_command): Rewrite to use spawn instead of exec.  Return the
3346         PID of the child.
3348         * main.c (main) [OS/2]: Call initialize_main().  Handle argv[0] as
3349         in DOS.  Handle the TEMP environment variable as in DOS.  Don't
3350         use a SIGCHLD handler on OS/2.  Choose a shell as in DOS.  Don't
3351         use -j in DOS mode.  Use child_execute_job() instead of
3352         exec_command().
3354         * function.c (func_shell) [OS/2]: Can't use fork/exec on OS/2: use
3355         spawn() instead.
3357         * job.h [OS/2]: Move CLOSE_ON_EXEC here from job.c.  Add
3358         prototypes that return values.
3360         * remake.c (f_mtime) [OS/2]: Handle FAT timestamp offsets for OS/2.
3362         * read.c (readline) [OS/2]: Don't handle CRLF specially on OS/2.
3363         * default.c (default_suffixes) [OS/2]: Set proper default suffixes
3364         for OS/2.
3365         * vpath.c (construct_vpath_list) [OS/2]: Handle OS/2 paths like
3366         DOS paths.
3368 2003-02-24  Paul D. Smith  <psmith@gnu.org>
3370         * default.c [VMS]: New default rules for .cxx -> .obj compiles.
3371         * job.c (child_execute_job) [VMS]: New code for handling spawn().
3372         (child_execute_job) [VMS]: Handle error status properly.
3373         Patches provided by Hartmut Becker <Hartmut.Becker@compaq.com>.
3375         * function.c (func_shell): Use EINTRLOOP() while reading from the
3376         subshell pipe (Fixes bug #2502).
3377         * job.c (free_child): Use EINTRLOOP() while writing tokens to the
3378         jobserver pipe.
3379         * main.c (main): Ditto.
3381 2003-01-30  Paul D. Smith  <psmith@gnu.org>
3383         * read.c (eval): eval() was not fully reentrant, because the
3384         collapsed buffer was static.  Change it to be an automatic
3385         variable so that eval() can be invoked recursively.
3386         Fixes bug # 2238.
3387         (eval): Apply patch # 1022: fix memory reference error on long
3388         target-specific variable lines.
3389         Patch provided by Steve Brown <Steve.Brown@macquarie.com>.
3391         * function.c (check_numeric): Combine the is_numeric() function
3392         into this function, since it's only called from one place.
3393         Constify this function.  Have it print the incorrect string in the
3394         error message.  Fixes bug #2407.
3395         (strip_whitespace): Constify.
3396         (func_if): Constify.
3397         * expand.c (expand_argument): Constify.
3399 2003-01-29  Paul D. Smith  <psmith@gnu.org>
3401         Fix bug # 2169, also reported by other people on various systems.
3403         * make.h: Some systems, such as Solaris and PTX, do not fully
3404         implement POSIX-compliant SA_RESTART functionality; important
3405         system calls like stat() and readdir() can still fail with EINTR
3406         even if SA_RESTART has been set on the signal handler.  So,
3407         introduce macros EINTRLOOP() and ENULLLOOP() which can loop on
3408         EINTR for system calls which return -1 or 0 (NULL), respectively,
3409         on error.
3410         Also, remove the old atomic_stat()/atomic_readdir() and
3411         HAVE_BROKEN_RESTART handling.
3413         * configure.in: Remove setting of HAVE_BROKEN_RESTART.
3415         * arscan.c (ar_member_touch): Use EINTRLOOP() to wrap fstat().
3416         * remake.c (touch_file): Ditto.
3418         * commands.c (delete_target): Use EINTRLOOP() to wrap stat().
3419         * read.c (construct_include_path): Ditto.
3420         * remake.c (name_mtime): Ditto.
3421         * vpath.c (selective_vpath_search): Ditto.
3422         * dir.c (find_directory): Ditto.
3423         (local_stat): Ditto.
3424         (find_directory): Use ENULLLOOP() to wrap opendir().
3425         (dir_contents_file_exists_p): Use ENULLLOOP() to wrap readdir().
3427         * misc.c: Remove HAVE_BROKEN_RESTART, atomic_stat(), and
3428         atomic_readdir() handling.
3430 2003-01-22  Paul D. Smith  <psmith@gnu.org>
3432         * function.c (func_call): Fix Bug #1744.  If we're inside a
3433         recursive invocation of $(call ...), mask any of the outer
3434         invocation's arguments that aren't used by this one, so that this
3435         invocation doesn't "inherit" them accidentally.
3437 2002-12-05  Paul D. Smith  <psmith@gnu.org>
3439         * function.c (subst_expand): Valery Khamenia reported a
3440         pathological performance hit when doing substitutions on very
3441         large values with lots of words: turns out we were invoking
3442         strlen() a ridiculous number of times.  Instead of having each
3443         call to sindex() call strlen() again, keep track of how much of
3444         the text we've seen and pass the length to sindex().
3446 2002-11-19  Paul D. Smith  <psmith@gnu.org>
3448         * README.cvs, configure.in: Upgrade to require autoconf 2.56.
3451 2002-11-16  Paul D. Smith  <psmith@gnu.org>
3453         * NMakefile.template (OBJS): Add hash.c object file.
3454         * SMakefile.template (srcs): Ditto.
3455         * Makefile.ami (objs): Ditto.
3456         * build_w32.bat: Ditto.
3458         * Makefile.DOS.template: Remove extra dependencies.
3460 2002-10-25  Paul D. Smith  <psmith@gnu.org>
3462         * expand.c (install_variable_buffer): New function.  Install a new
3463         variable_buffer context and return the previous one.
3464         (restore_variable_buffer): New function.  Free the current
3465         variable_buffer context and put a previously saved one back.
3466         * variable.h: Prototypes for {install,restore}_variable_buffer.
3467         * function.c (func_eval): Push a new variable_buffer context
3468         before we eval, then restore the old one when we're done.
3469         Fixes Bug #1517.
3471         * read.c (install_conditionals): New function.  Install a new
3472         conditional context and return the previous one.
3473         (restore_conditionals): New function.  Free the current
3474         conditional context and put a previously saved one back.
3475         (eval): Use the {install,restore}_conditionals for "include"
3476         handling.
3477         (eval_buffer): Use {install,restore}_conditionals to preserve the
3478         present conditional state before we evaluate the buffer.
3479         Fixes Bug #1516.
3481         * doc/make.texi (Quick Reference): Add references to $(eval ...)
3482         and $(value ...).
3483         (Recursion): Add a variable index entry for CURDIR.
3485         * README.cvs: Update to appropriate versions.
3486         * Makefile.am (nodist_loadavg_SOURCES): automake gurus point out I
3487         don't need to copy loadavg.c: automake is smart enough to create
3488         it for me.  Still have a bug in automake related to ansi2knr tho.
3490 2002-10-14  Paul D. Smith  <psmith@gnu.org>
3492         * remake.c (notice_finished_file): Only touch targets if they have
3493         at least one command (as per POSIX).  Resolve Bug #1418.
3495         * *.c: Convert to using ANSI C-style function definitions.
3496         * Makefile.am: Enable the ansi2knr feature of automake.
3497         * configure.in: ditto.
3499 2002-10-13  Paul D. Smith  <psmith@gnu.org>
3501         * commands.c (set_file_variables): Bug #1379: Don't use alloca()
3502         for automatic variable values like $^, etc.  In the case of very
3503         large lists of prerequisites this causes problems.  Instead reuse
3504         a static buffer (resizeable) for each variable.
3506         * read.c (eval): Fix Bug #1391: allow "export" keyword in
3507         target-specific variable definitions.  Check for it and set an
3508         "exported" flag.
3509         (record_target_var): Set the export field to v_export if the
3510         "exported" flag is set.
3511         * doc/make.texi (Target-specific): Document the ability to use
3512         "export".
3514         * doc/make.texi: Change the name of the section on automatic
3515         variables from "Automatic" to "Automatic Variables".  Added text
3516         clarifying the scope of automatic variables.
3518 2002-10-04  Paul D. Smith  <psmith@gnu.org>
3520         * read.c (eval): Allow SysV $$@ variables to use {} braces as well
3521         as () braces.
3522         (record_files): Ditto.
3524         * expand.c (variable_expand_string): In $(A:x=y) expansion limit
3525         the search for the '=' to only within the enclosing parens.
3527 2002-10-03  Paul D. Smith  <psmith@gnu.org>
3529         Version 3.80 released.
3531         * dir.c: Change hash functions to use K&R function definition style.
3532         * function.c: Ditto.
3533         * read.c: Ditto.
3534         * variable.c: Ditto.
3536         Update to automake 1.7.
3538         * Makefile.am (AUTOMAKE_OPTIONS): Update to require 1.7.
3539         (pdf): Remove this target as automake now provides one.
3541         * configure.in: Change AM_CONFIG_HEADER to AC_CONFIG_HEADERS.
3543 2002-09-30  Martin P.J. Zinser  <zinser@decus.de>
3545         * makefile.com: Updates for GNU make 3.80.
3546         * makefile.vms: Ditto.
3548 2002-09-23  Paul D. Smith  <psmith@gnu.org>
3550         * read.c (enum make_word_type): Remove w_comment.
3551         (get_next_mword): Don't treat comment characters as special; where
3552         this function is used we will never see a comment (it's stripped
3553         before we get here) and treating comments specially means that
3554         targets like "foo\#bar" aren't handled properly.
3556 2002-09-18  Paul D. Smith  <psmith@gnu.org>
3558         * doc/make.texi (Bugs): Update with some info on Savannah, etc.
3560         * read.c (eval): Expansion of arguments to export/unexport was
3561         ignoring all arguments after the first one.  Change the algorithm
3562         to expand the whole line once, then parse the results.
3564 2002-09-17  Paul D. Smith  <psmith@gnu.org>
3566         Fix Bug #940 (plus another bug I found while looking at this):
3568         * read.c (record_target_var): enter_file() will add a new entry if
3569         it's a double-colon target: we don't want to do that in this
3570         situation.  Invoke lookup_file() and only enter_file() if it does
3571         not already exist.  If the file we get back is a double-colon then
3572         add this variable to the "root" double-colon target.
3574         * variable.c (initialize_file_variables): If this file is a
3575         double-colon target but is not the "root" target, then initialize
3576         the root and make the root's variable list the parent of our
3577         variable list.
3579 2002-09-13  Paul D. Smith  <psmith@gnu.org>
3581         * doc/make.texi (MAKE Variable): Add some indexing for "+".
3583         * hash.c (round_up_2): Get rid of a warning.
3585 2002-09-12  Paul D. Smith  <psmith@gnu.org>
3587         * Makefile.am (loadavg_SOURCES, loadavg.c): Tiptoe around automake
3588         so it doesn't complain about getloadavg.c.
3590         * commands.c (set_file_variables): Make sure we always alloca() at
3591         least 1 character for the value of $? (for '\0').
3593 2002-09-11  Paul D. Smith  <psmith@gnu.org>
3595         * hash.h (STRING_COMPARE, ISTRING_COMPARE, STRING_N_COMPARE): Fix
3596         macro to use RESULT instead of the incorrect _RESULT_.
3598         * make.h (HAVE_BROKEN_RESTART): Add prototypes for atomic_stat()
3599         and atomic_readdir().  We need to #include dirent.h to get this to
3600         work.
3601         * misc.c (atomic_readdir): Fix typos.
3603 2002-09-10  Paul D. Smith  <psmith@gnu.org>
3605         * read.c (eval): Expand variable lists given to export and
3606         unexport, so that "export $(LIST_OF_VARIABLES)" (etc.) works.
3607         (conditional_line): Ditto for "ifdef".  Fixes bug #103.
3609         * doc/make.texi (Variables/Recursion): Document this.
3610         (Conditional Syntax): And here.
3612 2002-09-09  Paul D. Smith  <psmith@gnu.org>
3614         * configure.in: Check for memmove().
3616 2002-09-07  Paul D. Smith  <psmith@gnu.org>
3618         * configure.in (HAVE_BROKEN_RESTART): Define this on PTX systems;
3619         Michael Sterrett <msterret@coat.com> reports that while it has
3620         SA_RESTART, it does not work properly.
3622         * misc.c (atomic_stat): If HAVE_BROKEN_RESTART, create a function
3623         that invokes stat() and loops to do it again if it returns EINTR.
3624         (atomic_readdir): Ditto, with readdir().
3626         * make.h (stat, readdir): If HAVE_BROKEN_RESTART, alias stat()
3627         and readdir() to atomic_stat() and atomic_readdir().
3629 2002-09-04  Paul D. Smith  <psmith@gnu.org>
3631         * implicit.c (pattern_search): Daniel <barkalow@reputation.com>
3632         reports that GNU make sometimes doesn't recognize that targets can
3633         be made, when directories can be created as prerequisites.  He
3634         reports that changing the order of predicates in the DEP->changed
3635         flag test so that lookup_file() is always performed, solves this
3636         problem.
3638 2002-08-08  Paul D. Smith  <psmith@gnu.org>
3640         * configure.in: Require a newer version of gettext.
3642         * misc.c (perror_with_name): Translate the format string (for
3643         right-to-left language support).
3644         (pfatal_with_name): Ditto.
3646         * main.c: Create a static array of strings to store the usage
3647         text.  This is done to facilitate translations.
3648         (struct command_switch): Remove argdesc and description fields.
3649         (switches): Remove values for obsolete fields.
3650         (print_usage): Print each element of the usage array.
3652         * hash.c: Change function definitions to be K&R style.
3654 2002-08-02  Paul D. Smith  <psmith@gnu.org>
3656         * NEWS: Remove the mention of .TARGETS; we aren't going to publish
3657         this one because it's too hard to get right.  We'll look at it for
3658         a future release.
3659         * main.c (main): Don't create the .TARGETS variable.
3660         * variable.c (handle_special_var): Don't handle .TARGETS.
3662 2002-08-01  Paul D. Smith  <psmith@gnu.org>
3664         * main.c (switches): Add a new option, -B (--always-make).  If
3665         specified, make will rebuild all targets that it encounters even
3666         if they don't appear to be out of date.
3667         (always_make_flag): New flag.
3668         * make.h: Extern always_make_flag.
3669         * remake.c (update_file_1): Check always_make_flag; if it's set we
3670         will always rebuild any target we can, even if none of its
3671         prerequisites are newer.
3672         * NEWS: Mention it.
3674         * doc/make.texi (Shell Function): Make it clear that make
3675         variables marked as "export" are not passed to instances of the
3676         shell function.
3678         Add new introspection variable .VARIABLES and .TARGETS.
3680         * variable.c (handle_special_var): New function.  If the variable
3681         reference passed in is "special" (.VARIABLES or .TARGETS),
3682         calculate the new value if necessary.  .VARIABLES is handled here:
3683         walk through the hash of defined variables and construct a value
3684         which is a list of the names.  .TARGETS is handled by
3685         build_target_list().
3686         (lookup_variable): Invoke handle_special_var().
3687         * file.c (build_target_list): Walk through the hask of known files
3688         and construct a list of the names of all the ones marked as
3689         targets.
3690         * main.c (main): Initialize them to empty (and as simple variables).
3691         * doc/make.texi (Special Variables): Document them.
3692         * NEWS: Mention them.
3694         * variable.h (struct variable): Add a new flag "exportable" which
3695         is true if the variable name is valid for export.
3696         * variable.c (define_variable_in_set): Set "exportable" when a new
3697         variable is defined.
3698         (target_environment): Use the "exportable" flag instead of
3699         re-checking the name here... an efficiency improvement.
3701 2002-07-31  Paul D. Smith  <psmith@gnu.org>
3703         * config.h-vms.template: Updates to build on VMS.  Thanks to
3704         Brian_Benning@aksteel.com for helping verify the build.
3705         * makefile.com: Build the new hash.c file.
3706         * hash.h: Use strcpmi(), not stricmp(), in the
3707         HAVE_CASE_INSENSITIVE_FS case.
3709 2002-07-30  Paul D. Smith  <psmith@gnu.org>
3711         * hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Add missing
3712         backslashes to the HAVE_CASE_INSENSITIVE_FS case.
3713         Reported by <Brian_Benning@aksteel.com>.
3715 2002-07-10  Paul D. Smith  <psmith@gnu.org>
3717         * variable.c (pop_variable_scope): Remove variable made unused by
3718         new hash infrastructure.
3719         * read.c (dep_hash_cmp): Rewrite this to handle ignore_mtime
3720         comparisons as well as name comparisons.
3721         * variable.h: Add a prototype for new hash_init_function_table().
3722         * file.c (lookup_file): Remove variables made unused by new hash
3723         infrastructure.
3724         * dir.c (directory_contents_hash_2): Missing return of hash value.
3725         (dir_contents_file_exists_p): Remove variables made unused by new
3726         hash infrastructure.
3729         Installed Greg McGary's integration of the hash functions from the
3730         GNU id-utils package:
3732 2002-07-10  Greg McGary  <greg@mcgary.org>
3734         * scripts/functions/filter-out: Add literals to to the
3735         pattern space in order to add complexity, and trigger
3736         use of an internal hash table.  Fix documentation strings.
3737         * scripts/targets/INTERMEDIATE: Reverse order of files
3738         passed to expected `rm' command.
3740 2002-07-10  Greg McGary  <greg@mcgary.org>
3742         * Makefile.am (SRCS): Add hash.c (noinst_HEADERS): Add hash.h
3743         * hash.c: New file, taken from id-utils.
3744         * hash.h: New file, taken from id-utils.
3746         * make.h (HASH, HASHI): Remove macros.
3747         (find_char_unquote): Change arglist in decl.
3748         (hash_init_directories): New function decl.
3749         * variable.h (hash.h): New #include.
3750         (MAKELEVEL_NAME, MAKELEVEL_LENGTH): New constants.
3751         * filedef.h (hash.h): New #include.
3752         (struct file) [next]: Remove member.
3753         (file_hash_enter): Remove function decl.
3754         (init_hash_files): New function decl.
3756         * ar.c (ar_name): Delay call to strlen until needed.
3757         * main.c (initialize_global_hash_tables): New function.
3758         (main): Call it.  Use MAKELEVEL_NAME & MAKELEVEL_LENGTH.
3759         * misc.c (remove_comments): Pass char constants to find_char_unquote.
3760         * remake.c (notice_finished_file): Update last_mtime on `prev' chain.
3762         * dir.c (hash.h): New #include.
3763         (struct directory_contents) [next, files]: Remove members.
3764         [ctime]: Add member for VMS.  [dirfiles]: Add hash-table member.
3765         (directory_contents_hash_1, directory_contents_hash_2,
3766         directory_contents_hash_cmp): New functions.
3767         (directories_contents): Change type to `struct hash_table'.
3768         (struct directory) [next]: Remove member.
3769         (directory_hash_1, directory_hash_2, directory_hash_cmp): New funcs.
3770         (directory): Change type to `struct hash_table'.
3771         (struct dirfile) [next]: Remove member.
3772         [length]: Add member.  [impossible]: widen type to fill alignment gap.
3773         (dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp): New functions.
3774         (find_directory): Use new hash table package.
3775         (dir_contents_file_exists_p): Likewise.
3776         (file_impossible): Likewise.
3777         (file_impossible_p): Likewise.
3778         (print_dir_data_base): Likewise.
3779         (open_dirstream): Likewise.
3780         (read_dirstream): Likewise.
3781         (hash_init_directories): New function.
3783         * file.c (hash.h): New #include.
3784         (file_hash_1, file_hash_2, file_hash_cmp): New functions.
3785         (files): Change type to `struct hash_table'.
3786         (lookup_file): Use new hash table package.
3787         (enter_file): Likewise.
3788         (remove_intermediates): Likewise.
3789         (snap_deps): Likewise.
3790         (print_file_data_base): Likewise.
3792         * function.c
3793         (function_table_entry_hash_1, function_table_entry_hash_2,
3794         function_table_entry_hash_cmp): New functions.
3795         (lookup_function): Remove `table' argument.
3796         Use new hash table package.
3797         (struct a_word) [chain, length]: New members.
3798         (a_word_hash_1, a_word_hash_2, a_word_hash_cmp): New functions.
3799         (struct a_pattern): New struct.
3800         (func_filter_filterout): Pass through patterns noting boundaries
3801         and '%', if present.  Note a_word length.  Use a hash table if
3802         arglists are large enough to justify cost.
3803         (function_table_init): Renamed from function_table.
3804         (function_table): Declare as `struct hash_table'.
3805         (FUNCTION_TABLE_ENTRIES): New constant.
3806         (hash_init_function_table): New function.
3808         * read.c (hash.h): New #include.
3809         (read_makefile): Pass char constants to find_char_unquote.
3810         (dep_hash_1, dep_hash_2, dep_hash_cmp): New functions.
3811         (uniquize_deps): Use hash table to efficiently identify duplicates.
3812         (find_char_unquote): Accept two char-constant stop chars, rather
3813         than a string constant, avoiding zillions of calls to strchr.
3814         Tighten inner search loops to test only for desired delimiters.
3816         * variable.c (variable_hash_1, variable_hash_2,
3817         variable_hash_cmp): New functions.
3818         (variable_table): Declare as `struct hash_table'.
3819         (global_variable_set): Remove initialization.
3820         (init_hash_global_variable_set): New function.
3821         (define_variable_in_set): Use new hash table package.
3822         (lookup_variable): Likewise.
3823         (lookup_variable_in_set): Likewise.
3824         (initialize_file_variables): Likewise.
3825         (pop_variable_scope): Likewise.
3826         (create_new_variable_set): Likewise.
3827         (merge_variable_sets): Likewise.
3828         (define_automatic_variables): Likewise.
3829         (target_environment): Likewise.
3830         (print_variable_set): Likewise.
3832 2002-07-10  Paul D. Smith  <psmith@gnu.org>
3834         Implement the SysV make syntax $$@, $$(@D), and $$(@F) in the
3835         prerequisite list.  A real SysV make will expand the entire
3836         prerequisites list _twice_: we don't do that as it's a big
3837         backward-compatibility problem.  We only replace those specific
3838         variables.
3840         * read.c (record_files): Replace any $@, $(@D), and $(@F) variable
3841         references left in the list of prerequisites.  Check for .POSIX as
3842         we record targets, so we can disable non-POSIX behavior while
3843         reading makefiles as well as running them.
3844         (eval): Check the prerequisite list to see if we have anything
3845         that looks like a SysV prerequisite variable reference.
3847 2002-07-09  Paul D. Smith  <psmith@gnu.org>
3849         * doc/make.texi (Prerequisite Types): Add a new section describing
3850         order-only prerequisites.
3852         * read.c (uniquize_deps): If we have the same file as both a
3853         normal and order-only prereq, get rid of the order-only prereq,
3854         since the normal one supersedes it.
3856 2002-07-08  Paul D. Smith  <psmith@gnu.org>
3858         * AUTHORS: Added Greg McGary to the AUTHORS file.
3859         * NEWS: Blurbed order-only prerequisites.
3860         * file.c (print_file): Show order-only deps properly when printing
3861         the database.
3863         * maintMakefile: Add "update" targets for wget'ing the latest
3864         versions of various external files.  Taken from Makefile.maint in
3865         autoconf, etc.
3867         * dosbuild.bat: Somehow we got _double_ ^M's.  Remove them.
3868         Reported by Eli Zaretskii <eliz@is.elta.co.il>.
3870 2002-07-07  Paul D. Smith  <psmith@gnu.org>
3872         * po/*.po: Remove.  We'll use wget to retrieve them at release
3873         time.
3875         * variable.c (do_variable_definition) [W32]: On W32 using cmd
3876         rather than a shell you get an exception.  Make sure we look up
3877         the variable.  Patch provided by Eli Zaretskii <eliz@is.elta.co.il>.
3879         * remake.c (notice_finished_file): Fix handling of -t flag.
3880         Patch provided by Henning Makholm <henning@makholm.net>.
3882         * implicit.c (pattern_search): Some systems apparently run short
3883         of stack space, and using alloca() in this function caused an
3884         overrun.  I modified it to use xmalloc() on the two variables
3885         which seemed like they might get large.  Fixes Bug #476.
3887         * main.c (print_version): Update copyright notice to conform with
3888         GNU standards.
3889         (print_usage): Update help output.
3891         * function.c (func_eval): Create a new make function, $(eval
3892         ...).  Expand the arguments, put them into a buffer, then invoke
3893         eval_buffer() on the resulting string.
3894         (func_quote): Create a new function, $(quote VARNAME).  Inserts
3895         the value of the variable VARNAME without expanding it any
3896         further.
3898         * read.c (struct ebuffer): Change the linebuffer structure to an
3899         "eval buffer", which can be either a file or a buffer.
3900         (eval_makefile): Move the code in the old read_makefile() which
3901         located a makefile into here: create a struct ebuffer with that
3902         information.  Have it invoke the new function eval() with that
3903         ebuffer.
3904         (eval_buffer): Create a new function that creates a struct ebuffer
3905         that holds a string buffer instead of a file.  Have it invoke
3906         eval() with that ebuffer.
3907         (eval): New function that contains the guts of the old
3908         read_makefile() function: this function parses makefiles.  Obtains
3909         data to parse from the provided ebuffer.  Some modifications to
3910         make the flow of the function cleaner and clearer.  Still could
3911         use some work here...
3912         (do_define): Takes a struct ebuffer instead of a FILE*.  Read the
3913         contents of the define/endef variable from the ebuffer.
3914         (readstring): Read the next line from a string-style ebuffer.
3915         (readline): Read the next line from an ebuffer.  If it's a string
3916         ebuffer, invoke readstring().  If it's a FILE* ebuffer, read it
3917         from the file.
3919         * dep.h (eval_buffer): Prototype eval_buffer();
3921         * variable.c (do_variable_definition): Make sure that all
3922         non-target-specific variables are registered in the global set.
3923         If we're invoked from an $(eval ...) we might be inside a $(call
3924         ...) or other function which has pushed a variable scope; we still
3925         want to define our variables from evaluated makefile code in the
3926         global scope.
3928 2002-07-03  Greg McGary  <greg@mcgary.org>
3930         * dep.h (struct dep) [ignore_mtime]: New member.
3931         [changed]: convert to a bitfield.
3932         * implicit.c (pattern_search): Zero ignore_mtime.
3933         * main.c (main, handle_non_switch_argument): Likewise.
3934         * rule.c (convert_suffix_rule): Likewise.
3935         * read.c (read_all_makefiles, read_makefile, multi_glob): Likewise.
3936         (read_makefile): Parse '|' in prerequisite list.
3937         (uniquize_deps): Consider ignore_mtime when comparing deps.
3938         * remake.c (update_file_1, check_dep): Don't force remake for
3939         dependencies that have d->ignore_mtime.
3940         * commands.c (FILE_LIST_SEPARATOR): New constant.
3941         (set_file_variables): Don't include a
3942         prerequisite in $+, $^ or $? if d->ignore_mtime.
3943         Define $|.
3945 2002-06-18  Paul D. Smith  <psmith@gnu.org>
3947         * make.texinfo: Updates for next revision.  New date/rev/etc.
3948         Recreate all Info menus.  Change license on the manual to the GNU
3949         Free Documentation License.  A number of typos.
3950         (Variables Simplify): Don't use "-" before it's defined.
3951         (Automatic Prerequisites): Rewrite the target example to work
3952         properly if the compile fails.  Remove incorrect comments about
3953         how "set -e" behaves.
3954         (Text Functions): Move the "word", "wordlist", "words", and
3955         "firstword" functions here, from "File Name Functions".
3956         * make-stds.texi: Update from latest GNU version.
3957         * fdl.texi: (created) Import the latest GNU version.
3959 2002-06-06  Paul D. Smith  <psmith@gnu.org>
3961         * variable.c (do_variable_definition): New function: extract the
3962         part of try_variable_definition() that actually sets the value
3963         into a separate function.
3964         (try_variable_definition): Call do_variable_definition() after
3965         parsing the variable definition string.
3966         (define_variable_in_set): Make the name argument const.
3968         * variable.h (enum variable_flavor): Make public.
3969         (do_variable_definition): Create prototype.
3971         * read.c (read_all_makefiles): Create a new built-in variable,
3972         MAKEFILE_LIST.
3973         (read_makefile): Add each makefile read in to this variable value.
3975 2002-05-18  Eli Zaretskii  <eliz@is.elta.co.il>
3977         * Makefile.DOS.template: Tweak according to changes in the
3978         distribution.  Add back the dependencies of *.o files.
3980         * configh.dos.template: Synchronize with config.h.in.
3982 2002-05-09  Paul D. Smith  <psmith@gnu.org>
3984         * file.c (file_timestamp_now): Use K&R function declaration.
3986         * getloadavg.c (getloadavg): Merge setlocale() fix from sh-utils
3987         getloadavg.c.  Autoconf thinks QNX is SVR4-like, but it isn't, so
3988         #undef it.  Remove predefined setup of NLIST_STRUCT.  Decide
3989         whether to include nlist.h based on HAVE_NLIST_H.  Change obsolete
3990         NLIST_NAME_UNION to new HAVE_STRUCT_NLIST_N_UN_N_NAME.
3991         * configure.in (NLIST_STRUCT): Define this if we have nlist.h and
3992         nlist.n_name is a pointer rather than an array.
3994         * acinclude.m4 (make_FUNC_SETVBUF_REVERSED): Grab the latest
3995         version of AC_FUNC_SETVBUF_REVERSED from autoconf CVS.
3996         * configure.in: Use it instead of the old version.
3998         * main.c (main): Prefer setvbuf() to setlinebuf().
4000 2002-05-08  Paul D. Smith  <psmith@gnu.org>
4002         * Makefile.am (make_LDADD): Add GETLOADAVG_LIBS.
4003         (loadavg_LDADD): Ditto.
4005 2002-04-29  Paul D. Smith  <psmith@gnu.org>
4007         * expand.c (recursively_expand_for_file): Rename
4008         recursively_expand() to recursively_expand_for_file() and provide
4009         an extra argument, struct file.  If the argument is provided, set
4010         the variable scope to that of the file before expanding.
4011         * variable.h (recursively_expand): Make this a macro that invokes
4012         recursively_expand_for_file() with a NULL file pointer.
4013         * variable.c (target_environment): Call the renamed function and
4014         provide the current file context.
4015         Fixes Debian bug #144306.
4017 2002-04-28  Paul D. Smith  <psmith@gnu.org>
4019         Allow $(call ...) user-defined variables to be self-referencing
4020         without throwing an error.  Allows implementation of transitive
4021         closures, among other possibly useful things.
4022         Requested by: Philip Guenther <guenther@sendmail.com>
4024         * variable.h (struct variable): Add a new field: exp_count, and
4025         new macros to hold its size and maximum value.
4026         (warn_undefined): Make this a macro.
4027         * variable.c (define_variable_in_set): Initialize it.
4028         * expand.c (recursively_expand): If we detect recursive expansion
4029         of a variable, check the exp_count field.  If it's greater than 0
4030         allow the recursion and decrement the count.
4031         (warn_undefined): Remove this (now a macro in variable.h).
4032         * function.c (func_call): Before we expand the user-defined
4033         function, modify its exp_count field to contain the maximum
4034         number of recursive calls we'll allow.  After the call, reset it
4035         to 0.
4037 2002-04-21  Paul D. Smith  <psmith@gnu.org>
4039         Modified to use latest autoconf (2.53), automake (1.6.1), and
4040         gettext (0.11.1).  We're using gettext's new "external" support,
4041         to avoid including libintl source with GNU make.
4043         * README.cvs: New file.  Explain how to build GNU make from CVS.
4045         * configure.in: Modify checking for the system glob library.
4046         Use AC_EGREP_CPP instead of AC_TRY_CPP.  Remove the setting of
4047         GLOBDIR (we will always put "glob" in SUBDIRS, so automake
4048         etc. will manage it correctly).  Set an automake conditional
4049         USE_LOCAL_GLOB to decide whether to compile the glob library.
4051         * getloadavg.c (main): Include make.h in the "TEST" program to
4052         avoid warnings.
4054         * Makefile.am: Remove special rules for loadavg.  Replace them
4055         with Automake capabilities for building extra programs.
4057         * signame.c: This file does nothing if the system provide
4058         strsignal().  If not, it implements strsignal().  If the system
4059         doesn't define sys_siglist, then we make our own; otherwise we use
4060         the system version.
4061         * signame.h: Removed.
4063         * main.c (main): No need to invoke signame_init().  Update copyright.
4065         * ABOUT-NLS: Removed.
4066         * gettext.c: Removed.
4067         * gettext.h: Get a simplified copy from the gettext package.
4068         * po/*: Created.
4069         * i18n/*.po: Moved to po/.
4070         * i18n/: Removed.
4072         * config/*: Created.  Contains package configuration helper files.
4073         * config.guess, config.sub: Moved to config directory.
4075         * configure.in (AC_CONFIG_FILES): Add po/Makefile.in, config/Makefile.
4076         Rework to use new-style autoconf features.  Use the "external"
4077         mode for gettext.  Make the build.sh config file conditional on
4078         whether build.sh.in exists, to avoid autoconf errors.
4079         * acinclude.m4: Removed almost all macros as being obsolete.
4080         Rewrote remaining macros to use AC_DEFINE.
4081         * acconfig.h: Removed.
4083         * Makefile.am (EXTRA_DIST): Add config/config.rpath.  Use a
4084         conditional to handle customs support.  Remove special handling
4085         for i18n features.
4087 2002-04-20  Paul D. Smith  <psmith@gnu.org>
4089         * function.c (func_call): Don't mark the argument variables $1,
4090         etc. as recursive.  They've already been fully expanded so
4091         there's no need to do it again, and doing so strips escaped $'s.
4092         Reported by Sebastian Glita <glseba@yahoo.com>.
4094         * remake.c (notice_finished_file): Walk through double-colon
4095         entries via the prev field, not the next field!
4096         Reported by Greg McGary <greg@mcgary.org>.
4098         * main.c (main): If the user specifies -q and asks for a specific
4099         target which is a makefile, we got an assert.  In that case it
4100         turns out we should continue normally instead.
4102         * i18n/de.po, i18n/fr.po: Installed an updated translation.
4104         * i18n/he.po: Installed a new translation.
4106 2002-01-07  Paul D. Smith  <psmith@gnu.org>
4108         * i18n/es.po, i18n/ru.po: Installed an updated translation.
4110 2001-12-04  Paul D. Smith  <psmith@gnu.org>
4112         * i18n/ja.po: Installed an updated translation.
4114 2001-09-06  Paul Eggert  <eggert@twinsun.com>
4116         * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
4117         (AC_CHECK_FUNCS): Add getrlimit, setrlimit.
4119         * main.c: Include <sys/resource.h> if it, getrlimit, and setrlimit
4120         are available.
4121         (main): Get rid of any avoidable limit on stack size.
4123 2001-09-04  Paul D. Smith  <psmith@gnu.org>
4125         * i18n/da.po: Installed an updated translation.
4127 2001-08-03  Paul D. Smith  <psmith@gnu.org>
4129         * i18n/fr.po: Installed an updated translation.
4130         Resolves Debian bug #106720.
4132 2001-06-13  Paul D. Smith  <psmith@gnu.org>
4134         * i18n/da.po, configure.in (ALL_LINGUAS): Installed a new
4135         translation.
4137 2001-06-11  Paul D. Smith  <psmith@gnu.org>
4139         * i18n/ko.po: Installed a new translation.
4141 2001-05-06  Paul D. Smith  <psmith@gnu.org>
4143         Modify the EINTR handling.
4145         * job.c (new_job): Reorganize the jobserver algorithm.  Reorder
4146         the way in which we manage the file descriptor/signal handler race
4147         trap to be more efficient.
4149 2001-05-06  Paul Eggert  <eggert@twinsun.com>
4151         Restart almost all system calls that are interrupted, instead
4152         of worrying about EINTR.  The lone exception is the read() for
4153         job tokens.
4155         * configure.in (HAVE_SA_RESTART): New macro.
4156         (MAKE_JOBSERVER): Define to 1 only if HAVE_SA_RESTART.
4157         * main.c (main): Use SA_RESTART instead of the old,
4158         nonstandard SA_INTERRUPT.
4160         * configure.in (AC_CHECK_FUNCS): Add bsd_signal.
4161         * main.c (bsd_signal): New function or macro,
4162         if the implementation doesn't supply it.
4163         (The bsd_signal function will be in POSIX 1003.1-200x.)
4164         (HANDLESIG): Remove.
4165         (main, FATAL_SIG): Use bsd_signal instead of signal or HANDLESIG.
4167         * make.h (EINTR_SET): Remove.
4168         (SA_RESTART): New macro.
4170         * arscan.c (ar_member_touch): Don't worry about EINTR.
4171         * function.c (func_shell): Likewise.
4172         * job.c (reap_children, free_child, new_job): Likewise.
4173         * main.c (main): Likewise.
4174         * remake.c (touch_file, name_mtime): Likewise.
4176         * arscan.c (ar_member_touch): Fix bug uncovered by EINTR removal;
4177         if fstat failed with errno!=EINTR, the error was ignored.
4179         * job.c (set_child_handler_action_flags): New function.
4180         (new_job): Use it to temporarily clear the SIGCHLD action flags
4181         while reading the token.
4183 2001-05-02  Paul D. Smith  <psmith@gnu.org>
4185         * job.c (start_job_command): Don't add define/endef per-line flags
4186         to the top-level flags setting.
4188 2001-04-03  Paul D. Smith  <psmith@gnu.org>
4190         * arscan.c (VMS_get_member_info,ar_scan) [VMS]: VMS sets the low
4191         bit on error, so check for odd return values, not non-0 return
4192         values.
4193         (VMS_get_member_info): Calculate the timezone differences correctly.
4194         Reported by John Fowler <jfowler@nyx.net>.
4197 2001-03-14  Paul D. Smith  <psmith@gnu.org>
4199         * variable.c (lookup_variable) [VMS]: Null-terminate the variable
4200         value before invoking define_variable().
4201         Reported by John Fowler <jfowler@nyx.net>.
4203 2001-02-07  Paul D. Smith  <psmith@gnu.org>
4205         * read.c (record_target_var): If we reset the variable due to a
4206         command-line variable setting overriding it, turn off the "append"
4207         flag.
4209 2001-01-17  Paul D. Smith  <psmith@gnu.org>
4211         * variable.c (lookup_variable) [VMS]: When getting values from the
4212         environment, allocate enough space for the _value_ plus escapes,
4213         not enough space for the name plus escapes :-/.
4214         Reported by John Fowler <jfowler@nyx.net>.
4216         * remake.c (f_mtime): Removed the "***" prefix from the mod time
4217         warnings that make generates, so it doesn't look like an error.
4218         Reported by Karl Berry <karl@gnu.org>.
4221         Fix for PR/2020:  Rework appended target-specific variables.  I'm
4222         fairly confident this algorithm is finally correct.
4224         * expand.c (allocated_variable_append): Rewrite.  Instead of
4225         expanding each appended variable then adding all the expanded
4226         strings together, we append all the unexpanded values going up
4227         through the variable set contexts, then expand the final result.
4228         This behaves just like non-target-specific appended variable
4229         values, while the old way didn't in various corner cases.
4230         (variable_append): New function: recursively append the unexpanded
4231         value of a variable, walking from the outermost variable scope to
4232         the innermost.
4233         * variable.c (lookup_variable): Remove the code that looked up the
4234         variable set list if the found variable was "append".  We don't
4235         need this anymore.
4236         (lookup_variable_in_set): Make this non-static so we can use it
4237         elsewhere.
4238         (try_variable_definition): Use lookup_variable_in_set() rather
4239         than faking out current_variable_set_list by hand (cleanup).
4240         * variable.h: Add a prototype for the now non-static
4241         lookup_variable_in_set().
4243 2000-11-17  Paul D. Smith  <psmith@gnu.org>
4245         * remake.c (f_mtime) [WINDOWS32]: On various advice, I changed the
4246         WINDOWS32 port to assume timestamps can be up to 3 seconds away
4247         before throwing a fit.
4249 2000-11-17  Paul D. Smith  <psmith@gnu.org>
4251         * read.c (readline): CRLF calculations had a hole, if you hit the
4252         buffer grow scenario just right.  Reworked the algorithm to avoid
4253         the need for len or lastlen at all.  Problem description with
4254         sample code chages provided by Chris Faylor <cgf@redhat.com>.
4256 2000-10-24  Paul D. Smith  <psmith@gnu.org>
4258         * gettext.c (SWAP): Declare this with the prototype, otherwise
4259         some systems don't work (non-32-bit?  Reported for Cray T3E).
4260         Reported by Thorstein Thorsteinsson <thor@signe.teokem.lu.se>.
4262 2000-10-05  Paul D. Smith  <psmith@gnu.org>
4264         * acinclude.m4 (AM_LC_MESSAGES): Remove undefined macro
4265         AM_LC_MESSAGES; it doesn't seem to do anything anyway??
4267         * i18n/gl.po, configure.in (ALL_LINGUAS): New Galician translation.
4269 2000-09-22  Paul D. Smith  <psmith@gnu.org>
4271         * gettext.c: Don't #define _GETTEXT_H here; we only include some
4272         parts of the real gettext.h here, and we expect to really include
4273         the real gettext.h later.  If we keep this #define, it's ignored.
4275 2000-09-21  Paul D. Smith  <psmith@gnu.org>
4277         * main.c (log_working_directory): Rework the text to use complete
4278         sentences, to make life simpler for the translators.
4280 2000-08-29  Paul D. Smith  <psmith@gnu.org>
4282         * file.c (remove_intermediates): Print a debug message before we
4283         remove intermediate files, so the user (if she uses -d) knows
4284         what's going on.
4286 2000-08-21  Paul D. Smith  <psmith@gnu.org>
4288         * variable.c (try_variable_definition): Change how we handle
4289         target-specific append variable defns: instead of just setting the
4290         value, expand it as an append _but_ only within the current
4291         target's context.  Otherwise we lose all but the last value if the
4292         variable is appended more than once within the current target
4293         context.  Fixes PR/1831.
4295 2000-08-16  Paul D. Smith  <psmith@gnu.org>
4297         * function.c (func_shell): Nul-terminate the buffer before
4298         printing an exec error message (just in case it's not!).
4299         Fixes PR/1860, reported by Joey Hess <joey@valinux.com>.
4301 2000-07-25  Paul D. Smith  <psmith@gnu.org>
4303         * job.c (construct_command_argv_internal): Add "~" to the list of
4304         sh_chars[] which disallow optimizing out the shell call.
4306 2000-07-23  Paul Eggert  <eggert@twinsun.com>
4308         * NEWS, make.texinfo: Document .LOW_RESOLUTION_TIME, which
4309         supersedes --disable-nsec-timestamps.
4310         * make.texinfo: Consistently use "time stamp" instead of "timestamp".
4311         * README: Remove --disable-nsec-timestamps.
4313         * filedef.h (struct file.low_resolution_time): New member.
4314         * file.c (snap_deps): Add support for .LOW_RESOLUTION_TIME.
4315         * remake.c (update_file_1):
4316         Avoid spurious rebuilds due to low resolution time stamps,
4317         generalizing the earlier code that applied only to archive members.
4318         (f_mtime): Archive members always have low resolution time stamps.
4320         * configure.in: Remove --disable-nsec-timestamps, as this has
4321         been superseded by .LOW_RESOLUTION_TIME.
4323 2000-07-23  Paul Eggert  <eggert@twinsun.com>
4325         * configure.in (enable_nsec_timestamps): Renamed from
4326         make_cv_nsec_timestamps, since enable/disable options
4327         shouldn't be cached.
4329 2000-07-23  Bruno Haible  <haible@clisp.cons.org>
4330        and  Paul Eggert  <eggert@twinsun.com>
4332         * file.c (file_timestamp_now):
4333         Use preprocessor-time check for FILE_TIMESTAMP_HI_RES
4334         so that clock_gettime is not linked unless needed.
4336         * filedef.h (FILE_TIMESTAMP_HI_RES):
4337         Remove definition; "configure" now does this.
4339         * configure.in (jm_AC_TYPE_UINTMAX_T): Move up,
4340         to before high resolution file timestamp check,
4341         since that check now uses uintmax_t.
4342         (FILE_TIMESTAMP_HI_RES): Define to nonzero if the code should use
4343         high resolution file timestamps.
4344         (HAVE_CLOCK_GETTIME): Do not define if !FILE_TIMESTAMP_HI_RES,
4345         so that we don't link in clock_gettime unnecessarily.
4347 2000-07-17  Paul D. Smith  <psmith@gnu.org>
4349         * i18n/ja.po: New version of the translation file.
4351 2000-07-07  Paul D. Smith  <psmith@gnu.org>
4353         * remake.c (f_mtime): If NO_FLOAT is defined, don't bother with
4354         the offset calculation.
4355         (name_mtime): Replace EINTR test with EINTR_SET macro.
4357 2000-07-07  Paul Eggert  <eggert@twinsun.com>
4359         Fix for PR/1811:
4361         * remake.c (update_file_1):
4362         Avoid spurious rebuilds of archive members due to their
4363         timestamp resolution being only one second.
4364         (f_mtime): Avoid spurious warnings of timestamps in the future due to
4365         the clock's resolution being lower than file timestamps'.
4366         When warning about future timestamps, report only the discrepancy,
4367         not the absolute value of the timestamp and the current time.
4369         * file.c (file_timestamp_now): New arg RESOLUTION.
4370         * filedef.h (file_timestamp_now): Likewise.
4371         (FILE_TIMESTAMP_NS): Now returns int.  All uses changed.
4373 2000-07-05  Paul D. Smith  <psmith@gnu.org>
4375         * variable.c (lookup_variable) [VMS]: Remove vestigial references
4376         to listp.  Fixes PR/1793.
4378 2000-06-26  Paul Eggert  <eggert@twinsun.com>
4380         * Makefile.am (MAINTAINERCLEANFILES): New macro, with stamp-pot in it.
4382         * dir.c (vms_hash): Ensure ctype macro args are nonnegative.
4384         * remake.c (f_mtime): Remove unused var memtime.
4386 2000-06-25  Martin Buchholz  <martin@xemacs.org>
4388         * make.texinfo, NEWS, TODO.private: Minor spelling corrections.
4389         Ran spell-check on make.texinfo.
4391 2000-06-23  Paul D. Smith  <psmith@gnu.org>
4393         * main.c (main): Replace EXIT_SUCCESS, EXIT_FAILURE, and
4394         EXIT_TROUBLE with MAKE_SUCCESS, MAKE_FAILURE, and MAKE_TROUBLE.
4395         * make.h: Define these macros.
4397         * Version 3.79.1 released.
4399         * configure.in: Add a new option, --disable-nsec-timestamps, to
4400         avoid using sub-second timestamps on systems that support it.  It
4401         can lead to problems, e.g. if your makefile relies on "cp -p".
4402         * README.template: Document the issue with "cp -p".
4404         * config.guess, config.sub: Updated.
4408 See ChangeLog.2, available in the CVS repository at:
4410         http://savannah.gnu.org/cvs/?group=make
4412 for earlier changes.
4415 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4416 2011, 2012 Free Software Foundation, Inc.
4417 This file is part of GNU Make.
4419 GNU Make is free software; you can redistribute it and/or modify it under the
4420 terms of the GNU General Public License as published by the Free Software
4421 Foundation; either version 3 of the License, or (at your option) any later
4422 version.
4424 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
4425 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
4426 A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
4428 You should have received a copy of the GNU General Public License along with
4429 this program.  If not, see <http://www.gnu.org/licenses/>.