2003-04-30 Paul D. Smith * build.template: Make some changes to maybe allow this script to work on DOS/Windows/OS2 systems. Suggested by Andreas Buening. * README.OS2.template: New file for OS/2 support. Original contributed by Andreas Buening. * configure.in: Invoke new pds_AC_DOS_PATHS macro to test for DOS-style paths. 2003-04-19 Paul D. Smith Fix bug #1405: allow a target to match multiple pattern-specific variables. * rule.c (create_pattern_var, lookup_pattern_var): Move these to variable.c, where they've always belonged. * rule.h: Move the prototypes and struct pattern_var as well. * variable.c (initialize_file_variables): Invoke lookup_pattern_var() in a loop, until no more matches are found. If a match is found, create a new variable set for the target's pattern variables. Then merge the contents of each matching pattern variable set into the target's pattern variable set. (lookup_pattern_var): Change this function to be usable in a loop. It takes a starting position: if NULL, start at the beginning; if non-NULL, start with the pattern variable after that position, and return the next matching pattern. (create_pattern_var): Create a unique instance of pattern-specific variables for every definition in the makefile. Don't combine the same pattern together. This allows us to process the variable handling properly even when the same pattern is used multiple times. (parse_variable_definition): New function: break out the parsing of a variable definition line from try_variable_definition. (try_variable_definition): Call parse_variable_definition to parse. (print_variable_data_base): Print out pattern-specific variables. * variable.h (struct variable): Remember when a variable is conditional. Also remember its flavor. (struct pattern_var): Instead of keeping a variable set, we just keep a single variable for each pattern. * read.c (record_target_var): Each pattern variable contains only a single variable, not a set, so create it properly. * doc/make.texi (Pattern-specific): Document the new behavior. 2003-04-17 Paul D. Smith * dir.c (file_exists_p) [VMS]: Patch provided with Bug #3018 by Jean-Pierre Portier . I don't understand the file/directory naming rules for VMS so I can't tell whether this is correct or not. 2003-04-09 Paul D. Smith * configure.in (HAVE_DOS_PATHS): Define this on systems that need DOS-style pathnames: backslash separators and drive specifiers. 2003-03-28 Paul D. Smith * file.c (snap_deps): If .SECONDARY with no targets is given, set the intermediate flag on all targets. Fixes bug #2515. 2003-03-24 Paul D. Smith * configure.in, Makefile.am, glob/Makefile.am, doc/Makefile.am: Upgrade to autoconf 2.57 and automake 1.7.3. * job.c: More OS/2 changes from Andreas Buening. * file.c (print_file): Fix variable initialization. Fixes bug #2892. * remake.c (notice_finished_file): * make.h (ENULLLOOP): Set errno = 0 before invoking the command; some calls (like readdir()) return NULL in valid situations without resetting errno. Fixes bug #2846. 2003-02-25 Paul D. Smith Port to OS/2 (__EMX__) by Andreas Buening . * job.c (_is_unixy_shell) [OS/2]: New function. Set default shell to /bin/sh. (reap_children): Close the job_rfd pipe here since we don't use a SIGCHLD handler. (set_child_handler_action_flags): define this to empty on OS/2. (start_job_command): Close the jobserver pipe and use child_execute_job() instead of fork/exec. (child_execute_job): Rewrite to handle stdin/stdout FDs and spawn rather than exec'ing, then reconfigure stdin/stdout. (exec_command): Rewrite to use spawn instead of exec. Return the PID of the child. * main.c (main) [OS/2]: Call initialize_main(). Handle argv[0] as in DOS. Handle the TEMP environment variable as in DOS. Don't use a SIGCHLD handler on OS/2. Choose a shell as in DOS. Don't use -j in DOS mode. Use child_execute_job() instead of exec_command(). * function.c (func_shell) [OS/2]: Can't use fork/exec on OS/2: use spawn() instead. * job.h [OS/2]: Move CLOSE_ON_EXEC here from job.c. Add prototypes that return values. * remake.c (f_mtime) [OS/2]: Handle FAT timestamp offsets for OS/2. * read.c (readline) [OS/2]: Don't handle CRLF specially on OS/2. * default.c (default_suffixes) [OS/2]: Set proper default suffixes for OS/2. * vpath.c (construct_vpath_list) [OS/2]: Handle OS/2 paths like DOS paths. 2003-02-24 Paul D. Smith * default.c [VMS]: New default rules for .cxx -> .obj compiles. * job.c (child_execute_job) [VMS]: New code for handling spawn(). (child_execute_job) [VMS]: Handle error status properly. Patches provided by Hartmut Becker . * function.c (func_shell): Use EINTRLOOP() while reading from the subshell pipe (Fixes bug #2502). * job.c (free_child): Use EINTRLOOP() while writing tokens to the jobserver pipe. * main.c (main): Ditto. 2003-01-30 Paul D. Smith * read.c (eval): eval() was not fully reentrant, because the collapsed buffer was static. Change it to be an automatic variable so that eval() can be invoked recursively. Fixes bug # 2238. (eval): Apply patch # 1022: fix memory reference error on long target-specific variable lines. Patch provided by Steve Brown . * function.c (check_numeric): Combine the is_numeric() function into this function, since it's only called from one place. Constify this function. Have it print the incorrect string in the error message. Fixes bug #2407. (strip_whitespace): Constify. (func_if): Constify. * expand.c (expand_argument): Constify. 2003-01-29 Paul D. Smith Fix bug # 2169, also reported by other people on various systems. * make.h: Some systems, such as Solaris and PTX, do not fully implement POSIX-compliant SA_RESTART functionality; important system calls like stat() and readdir() can still fail with EINTR even if SA_RESTART has been set on the signal handler. So, introduce macros EINTRLOOP() and ENULLLOOP() which can loop on EINTR for system calls which return -1 or 0 (NULL), respectively, on error. Also, remove the old atomic_stat()/atomic_readdir() and HAVE_BROKEN_RESTART handling. * configure.in: Remove setting of HAVE_BROKEN_RESTART. * arscan.c (ar_member_touch): Use EINTRLOOP() to wrap fstat(). * remake.c (touch_file): Ditto. * commands.c (delete_target): Use EINTRLOOP() to wrap stat(). * read.c (construct_include_path): Ditto. * remake.c (name_mtime): Ditto. * vpath.c (selective_vpath_search): Ditto. * dir.c (find_directory): Ditto. (local_stat): Ditto. (find_directory): Use ENULLLOOP() to wrap opendir(). (dir_contents_file_exists_p): Use ENULLLOOP() to wrap readdir(). * misc.c: Remove HAVE_BROKEN_RESTART, atomic_stat(), and atomic_readdir() handling. 2003-01-22 Paul D. Smith * function.c (func_call): Fix Bug #1744. If we're inside a recursive invocation of $(call ...), mask any of the outer invocation's arguments that aren't used by this one, so that this invocation doesn't "inherit" them accidentally. 2002-12-05 Paul D. Smith * function.c (subst_expand): Valery Khamenia reported a pathological performance hit when doing substitutions on very large values with lots of words: turns out we were invoking strlen() a ridiculous number of times. Instead of having each call to sindex() call strlen() again, keep track of how much of the text we've seen and pass the length to sindex(). 2002-11-19 Paul D. Smith * README.cvs, configure.in: Upgrade to require autoconf 2.56. 2002-11-16 Paul D. Smith * NMakefile.template (OBJS): Add hash.c object file. * SMakefile.template (srcs): Ditto. * Makefile.ami (objs): Ditto. * build_w32.bat: Ditto. * Makefile.DOS.template: Remove extra dependencies. 2002-10-25 Paul D. Smith * expand.c (install_variable_buffer): New function. Install a new variable_buffer context and return the previous one. (restore_variable_buffer): New function. Free the current variable_buffer context and put a previously saved one back. * variable.h: Prototypes for {install,restore}_variable_buffer. * function.c (func_eval): Push a new variable_buffer context before we eval, then restore the old one when we're done. Fixes Bug #1517. * read.c (install_conditionals): New function. Install a new conditional context and return the previous one. (restore_conditionals): New function. Free the current conditional context and put a previously saved one back. (eval): Use the {install,restore}_conditionals for "include" handling. (eval_buffer): Use {install,restore}_conditionals to preserve the present conditional state before we evaluate the buffer. Fixes Bug #1516. * doc/make.texi (Quick Reference): Add references to $(eval ...) and $(value ...). (Recursion): Add a variable index entry for CURDIR. * README.cvs: Update to appropriate versions. * Makefile.am (nodist_loadavg_SOURCES): automake gurus point out I don't need to copy loadavg.c: automake is smart enough to create it for me. Still have a bug in automake related to ansi2knr tho. 2002-10-14 Paul D. Smith * remake.c (notice_finished_file): Only touch targets if they have at least one command (as per POSIX). Resolve Bug #1418. * *.c: Convert to using ANSI C-style function definitions. * Makefile.am: Enable the ansi2knr feature of automake. * configure.in: ditto. 2002-10-13 Paul D. Smith * commands.c (set_file_variables): Bug #1379: Don't use alloca() for automatic variable values like $^, etc. In the case of very large lists of prerequisites this causes problems. Instead reuse a static buffer (resizeable) for each variable. * read.c (eval): Fix Bug #1391: allow "export" keyword in target-specific variable definitions. Check for it and set an "exported" flag. (record_target_var): Set the export field to v_export if the "exported" flag is set. * doc/make.texi (Target-specific): Document the ability to use "export". * doc/make.texi: Change the name of the section on automatic variables from "Automatic" to "Automatic Variables". Added text clarifying the scope of automatic variables. 2002-10-04 Paul D. Smith * read.c (eval): Allow SysV $$@ variables to use {} braces as well as () braces. (record_files): Ditto. * expand.c (variable_expand_string): In $(A:x=y) expansion limit the search for the '=' to only within the enclosing parens. 2002-10-03 Paul D. Smith Version 3.80 released. * dir.c: Change hash functions to use K&R function definition style. * function.c: Ditto. * read.c: Ditto. * variable.c: Ditto. Update to automake 1.7. * Makefile.am (AUTOMAKE_OPTIONS): Update to require 1.7. (pdf): Remove this target as automake now provides one. * configure.in: Change AM_CONFIG_HEADER to AC_CONFIG_HEADERS. 2002-09-30 Martin P.J. Zinser * makefile.com: Updates for GNU make 3.80. * makefile.vms: Ditto. 2002-09-23 Paul D. Smith * read.c (enum make_word_type): Remove w_comment. (get_next_mword): Don't treat comment characters as special; where this function is used we will never see a comment (it's stripped before we get here) and treating comments specially means that targets like "foo\#bar" aren't handled properly. 2002-09-18 Paul D. Smith * doc/make.texi (Bugs): Update with some info on Savannah, etc. * read.c (eval): Expansion of arguments to export/unexport was ignoring all arguments after the first one. Change the algorithm to expand the whole line once, then parse the results. 2002-09-17 Paul D. Smith Fix Bug #940 (plus another bug I found while looking at this): * read.c (record_target_var): enter_file() will add a new entry if it's a double-colon target: we don't want to do that in this situation. Invoke lookup_file() and only enter_file() if it does not already exist. If the file we get back is a double-colon then add this variable to the "root" double-colon target. * variable.c (initialize_file_variables): If this file is a double-colon target but is not the "root" target, then initialize the root and make the root's variable list the parent of our variable list. 2002-09-13 Paul D. Smith * doc/make.texi (MAKE Variable): Add some indexing for "+". * hash.c (round_up_2): Get rid of a warning. 2002-09-12 Paul D. Smith * Makefile.am (loadavg_SOURCES, loadavg.c): Tiptoe around automake so it doesn't complain about getloadavg.c. * commands.c (set_file_variables): Make sure we always alloca() at least 1 character for the value of $? (for '\0'). 2002-09-11 Paul D. Smith * hash.h (STRING_COMPARE, ISTRING_COMPARE, STRING_N_COMPARE): Fix macro to use RESULT instead of the incorrect _RESULT_. * make.h (HAVE_BROKEN_RESTART): Add prototypes for atomic_stat() and atomic_readdir(). We need to #include dirent.h to get this to work. * misc.c (atomic_readdir): Fix typos. 2002-09-10 Paul D. Smith * read.c (eval): Expand variable lists given to export and unexport, so that "export $(LIST_OF_VARIABLES)" (etc.) works. (conditional_line): Ditto for "ifdef". Fixes bug #103. * doc/make.texi (Variables/Recursion): Document this. (Conditional Syntax): And here. 2002-09-09 Paul D. Smith * configure.in: Check for memmove(). 2002-09-07 Paul D. Smith * configure.in (HAVE_BROKEN_RESTART): Define this on PTX systems; Michael Sterrett reports that while it has SA_RESTART, it does not work properly. * misc.c (atomic_stat): If HAVE_BROKEN_RESTART, create a function that invokes stat() and loops to do it again if it returns EINTR. (atomic_readdir): Ditto, with readdir(). * make.h (stat, readdir): If HAVE_BROKEN_RESTART, alias stat() and readdir() to atomic_stat() and atomic_readdir(). 2002-09-04 Paul D. Smith * implicit.c (pattern_search): Daniel reports that GNU make sometimes doesn't recognize that targets can be made, when directories can be created as prerequisites. He reports that changing the order of predicates in the DEP->changed flag test so that lookup_file() is always performed, solves this problem. 2002-08-08 Paul D. Smith * configure.in: Require a newer version of gettext. * misc.c (perror_with_name): Translate the format string (for right-to-left language support). (pfatal_with_name): Ditto. * main.c: Create a static array of strings to store the usage text. This is done to facilitate translations. (struct command_switch): Remove argdesc and description fields. (switches): Remove values for obsolete fields. (print_usage): Print each element of the usage array. * hash.c: Change function definitions to be K&R style. 2002-08-02 Paul D. Smith * NEWS: Remove the mention of .TARGETS; we aren't going to publish this one because it's too hard to get right. We'll look at it for a future release. * main.c (main): Don't create the .TARGETS variable. * variable.c (handle_special_var): Don't handle .TARGETS. 2002-08-01 Paul D. Smith * main.c (switches): Add a new option, -B (--always-make). If specified, make will rebuild all targets that it encounters even if they don't appear to be out of date. (always_make_flag): New flag. * make.h: Extern always_make_flag. * remake.c (update_file_1): Check always_make_flag; if it's set we will always rebuild any target we can, even if none of its prerequisites are newer. * NEWS: Mention it. * doc/make.texi (Shell Function): Make it clear that make variables marked as "export" are not passed to instances of the shell function. Add new introspection variable .VARIABLES and .TARGETS. * variable.c (handle_special_var): New function. If the variable reference passed in is "special" (.VARIABLES or .TARGETS), calculate the new value if necessary. .VARIABLES is handled here: walk through the hash of defined variables and construct a value which is a list of the names. .TARGETS is handled by build_target_list(). (lookup_variable): Invoke handle_special_var(). * file.c (build_target_list): Walk through the hask of known files and construct a list of the names of all the ones marked as targets. * main.c (main): Initialize them to empty (and as simple variables). * doc/make.texi (Special Variables): Document them. * NEWS: Mention them. * variable.h (struct variable): Add a new flag "exportable" which is true if the variable name is valid for export. * variable.c (define_variable_in_set): Set "exportable" when a new variable is defined. (target_environment): Use the "exportable" flag instead of re-checking the name here... an efficiency improvement. 2002-07-31 Paul D. Smith * config.h-vms.template: Updates to build on VMS. Thanks to Brian_Benning@aksteel.com for helping verify the build. * makefile.com: Build the new hash.c file. * hash.h: Use strcpmi(), not stricmp(), in the HAVE_CASE_INSENSITIVE_FS case. 2002-07-30 Paul D. Smith * hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Add missing backslashes to the HAVE_CASE_INSENSITIVE_FS case. Reported by . 2002-07-10 Paul D. Smith * variable.c (pop_variable_scope): Remove variable made unused by new hash infrastructure. * read.c (dep_hash_cmp): Rewrite this to handle ignore_mtime comparisons as well as name comparisons. * variable.h: Add a prototype for new hash_init_function_table(). * file.c (lookup_file): Remove variables made unused by new hash infrastructure. * dir.c (directory_contents_hash_2): Missing return of hash value. (dir_contents_file_exists_p): Remove variables made unused by new hash infrastructure. Installed Greg McGary's integration of the hash functions from the GNU id-utils package: 2002-07-10 Greg McGary * scripts/functions/filter-out: Add literals to to the pattern space in order to add complexity, and trigger use of an internal hash table. Fix documentation strings. * scripts/targets/INTERMEDIATE: Reverse order of files passed to expected `rm' command. 2002-07-10 Greg McGary * Makefile.am (SRCS): Add hash.c (noinst_HEADERS): Add hash.h * hash.c: New file, taken from id-utils. * hash.h: New file, taken from id-utils. * make.h (HASH, HASHI): Remove macros. (find_char_unquote): Change arglist in decl. (hash_init_directories): New function decl. * variable.h (hash.h): New #include. (MAKELEVEL_NAME, MAKELEVEL_LENGTH): New constants. * filedef.h (hash.h): New #include. (struct file) [next]: Remove member. (file_hash_enter): Remove function decl. (init_hash_files): New function decl. * ar.c (ar_name): Delay call to strlen until needed. * main.c (initialize_global_hash_tables): New function. (main): Call it. Use MAKELEVEL_NAME & MAKELEVEL_LENGTH. * misc.c (remove_comments): Pass char constants to find_char_unquote. * remake.c (notice_finished_file): Update last_mtime on `prev' chain. * dir.c (hash.h): New #include. (struct directory_contents) [next, files]: Remove members. [ctime]: Add member for VMS. [dirfiles]: Add hash-table member. (directory_contents_hash_1, directory_contents_hash_2, directory_contents_hash_cmp): New functions. (directories_contents): Change type to `struct hash_table'. (struct directory) [next]: Remove member. (directory_hash_1, directory_hash_2, directory_hash_cmp): New funcs. (directory): Change type to `struct hash_table'. (struct dirfile) [next]: Remove member. [length]: Add member. [impossible]: widen type to fill alignment gap. (dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp): New functions. (find_directory): Use new hash table package. (dir_contents_file_exists_p): Likewise. (file_impossible): Likewise. (file_impossible_p): Likewise. (print_dir_data_base): Likewise. (open_dirstream): Likewise. (read_dirstream): Likewise. (hash_init_directories): New function. * file.c (hash.h): New #include. (file_hash_1, file_hash_2, file_hash_cmp): New functions. (files): Change type to `struct hash_table'. (lookup_file): Use new hash table package. (enter_file): Likewise. (remove_intermediates): Likewise. (snap_deps): Likewise. (print_file_data_base): Likewise. * function.c (function_table_entry_hash_1, function_table_entry_hash_2, function_table_entry_hash_cmp): New functions. (lookup_function): Remove `table' argument. Use new hash table package. (struct a_word) [chain, length]: New members. (a_word_hash_1, a_word_hash_2, a_word_hash_cmp): New functions. (struct a_pattern): New struct. (func_filter_filterout): Pass through patterns noting boundaries and '%', if present. Note a_word length. Use a hash table if arglists are large enough to justify cost. (function_table_init): Renamed from function_table. (function_table): Declare as `struct hash_table'. (FUNCTION_TABLE_ENTRIES): New constant. (hash_init_function_table): New function. * read.c (hash.h): New #include. (read_makefile): Pass char constants to find_char_unquote. (dep_hash_1, dep_hash_2, dep_hash_cmp): New functions. (uniquize_deps): Use hash table to efficiently identify duplicates. (find_char_unquote): Accept two char-constant stop chars, rather than a string constant, avoiding zillions of calls to strchr. Tighten inner search loops to test only for desired delimiters. * variable.c (variable_hash_1, variable_hash_2, variable_hash_cmp): New functions. (variable_table): Declare as `struct hash_table'. (global_variable_set): Remove initialization. (init_hash_global_variable_set): New function. (define_variable_in_set): Use new hash table package. (lookup_variable): Likewise. (lookup_variable_in_set): Likewise. (initialize_file_variables): Likewise. (pop_variable_scope): Likewise. (create_new_variable_set): Likewise. (merge_variable_sets): Likewise. (define_automatic_variables): Likewise. (target_environment): Likewise. (print_variable_set): Likewise. 2002-07-10 Paul D. Smith Implement the SysV make syntax $$@, $$(@D), and $$(@F) in the prerequisite list. A real SysV make will expand the entire prerequisites list _twice_: we don't do that as it's a big backward-compatibility problem. We only replace those specific variables. * read.c (record_files): Replace any $@, $(@D), and $(@F) variable references left in the list of prerequisites. Check for .POSIX as we record targets, so we can disable non-POSIX behavior while reading makefiles as well as running them. (eval): Check the prerequisite list to see if we have anything that looks like a SysV prerequisite variable reference. 2002-07-09 Paul D. Smith * doc/make.texi (Prerequisite Types): Add a new section describing order-only prerequisites. * read.c (uniquize_deps): If we have the same file as both a normal and order-only prereq, get rid of the order-only prereq, since the normal one supersedes it. 2002-07-08 Paul D. Smith * AUTHORS: Added Greg McGary to the AUTHORS file. * NEWS: Blurbed order-only prerequisites. * file.c (print_file): Show order-only deps properly when printing the database. * maintMakefile: Add "update" targets for wget'ing the latest versions of various external files. Taken from Makefile.maint in autoconf, etc. * dosbuild.bat: Somehow we got _double_ ^M's. Remove them. Reported by Eli Zaretskii . 2002-07-07 Paul D. Smith * po/*.po: Remove. We'll use wget to retrieve them at release time. * variable.c (do_variable_definition) [W32]: On W32 using cmd rather than a shell you get an exception. Make sure we look up the variable. Patch provided by Eli Zaretskii . * remake.c (notice_finished_file): Fix handling of -t flag. Patch provided by Henning Makholm . * implicit.c (pattern_search): Some systems apparently run short of stack space, and using alloca() in this function caused an overrun. I modified it to use xmalloc() on the two variables which seemed like they might get large. Fixes Bug #476. * main.c (print_version): Update copyright notice to conform with GNU standards. (print_usage): Update help output. * function.c (func_eval): Create a new make function, $(eval ...). Expand the arguments, put them into a buffer, then invoke eval_buffer() on the resulting string. (func_quote): Create a new function, $(quote VARNAME). Inserts the value of the variable VARNAME without expanding it any further. * read.c (struct ebuffer): Change the linebuffer structure to an "eval buffer", which can be either a file or a buffer. (eval_makefile): Move the code in the old read_makefile() which located a makefile into here: create a struct ebuffer with that information. Have it invoke the new function eval() with that ebuffer. (eval_buffer): Create a new function that creates a struct ebuffer that holds a string buffer instead of a file. Have it invoke eval() with that ebuffer. (eval): New function that contains the guts of the old read_makefile() function: this function parses makefiles. Obtains data to parse from the provided ebuffer. Some modifications to make the flow of the function cleaner and clearer. Still could use some work here... (do_define): Takes a struct ebuffer instead of a FILE*. Read the contents of the define/endef variable from the ebuffer. (readstring): Read the next line from a string-style ebuffer. (readline): Read the next line from an ebuffer. If it's a string ebuffer, invoke readstring(). If it's a FILE* ebuffer, read it from the file. * dep.h (eval_buffer): Prototype eval_buffer(); * variable.c (do_variable_definition): Make sure that all non-target-specific variables are registered in the global set. If we're invoked from an $(eval ...) we might be inside a $(call ...) or other function which has pushed a variable scope; we still want to define our variables from evaluated makefile code in the global scope. 2002-07-03 Greg McGary * dep.h (struct dep) [ignore_mtime]: New member. [changed]: convert to a bitfield. * implicit.c (pattern_search): Zero ignore_mtime. * main.c (main, handle_non_switch_argument): Likewise. * rule.c (convert_suffix_rule): Likewise. * read.c (read_all_makefiles, read_makefile, multi_glob): Likewise. (read_makefile): Parse '|' in prerequisite list. (uniquize_deps): Consider ignore_mtime when comparing deps. * remake.c (update_file_1, check_dep): Don't force remake for dependencies that have d->ignore_mtime. * commands.c (FILE_LIST_SEPARATOR): New constant. (set_file_variables): Don't include a prerequisite in $+, $^ or $? if d->ignore_mtime. Define $|. 2002-06-18 Paul D. Smith * make.texinfo: Updates for next revision. New date/rev/etc. Recreate all Info menus. Change license on the manual to the GNU Free Documentation License. A number of typos. (Variables Simplify): Don't use "-" before it's defined. (Automatic Prerequisites): Rewrite the target example to work properly if the compile fails. Remove incorrect comments about how "set -e" behaves. (Text Functions): Move the "word", "wordlist", "words", and "firstword" functions here, from "File Name Functions". * make-stds.texi: Update from latest GNU version. * fdl.texi: (created) Import the latest GNU version. 2002-06-06 Paul D. Smith * variable.c (do_variable_definition): New function: extract the part of try_variable_definition() that actually sets the value into a separate function. (try_variable_definition): Call do_variable_definition() after parsing the variable definition string. (define_variable_in_set): Make the name argument const. * variable.h (enum variable_flavor): Make public. (do_variable_definition): Create prototype. * read.c (read_all_makefiles): Create a new built-in variable, MAKEFILE_LIST. (read_makefile): Add each makefile read in to this variable value. 2002-05-18 Eli Zaretskii * Makefile.DOS.template: Tweak according to changes in the distribution. Add back the dependencies of *.o files. * configh.dos.template: Synchronize with config.h.in. 2002-05-09 Paul D. Smith * file.c (file_timestamp_now): Use K&R function declaration. * getloadavg.c (getloadavg): Merge setlocale() fix from sh-utils getloadavg.c. Autoconf thinks QNX is SVR4-like, but it isn't, so #undef it. Remove predefined setup of NLIST_STRUCT. Decide whether to include nlist.h based on HAVE_NLIST_H. Change obsolete NLIST_NAME_UNION to new HAVE_STRUCT_NLIST_N_UN_N_NAME. * configure.in (NLIST_STRUCT): Define this if we have nlist.h and nlist.n_name is a pointer rather than an array. * acinclude.m4 (make_FUNC_SETVBUF_REVERSED): Grab the latest version of AC_FUNC_SETVBUF_REVERSED from autoconf CVS. * configure.in: Use it instead of the old version. * main.c (main): Prefer setvbuf() to setlinebuf(). 2002-05-08 Paul D. Smith * Makefile.am (make_LDADD): Add GETLOADAVG_LIBS. (loadavg_LDADD): Ditto. 2002-04-29 Paul D. Smith * expand.c (recursively_expand_for_file): Rename recursively_expand() to recursively_expand_for_file() and provide an extra argument, struct file. If the argument is provided, set the variable scope to that of the file before expanding. * variable.h (recursively_expand): Make this a macro that invokes recursively_expand_for_file() with a NULL file pointer. * variable.c (target_environment): Call the renamed function and provide the current file context. Fixes Debian bug #144306. 2002-04-28 Paul D. Smith Allow $(call ...) user-defined variables to be self-referencing without throwing an error. Allows implementation of transitive closures, among other possibly useful things. Requested by: Philip Guenther * variable.h (struct variable): Add a new field: exp_count, and new macros to hold its size and maximum value. (warn_undefined): Make this a macro. * variable.c (define_variable_in_set): Initialize it. * expand.c (recursively_expand): If we detect recursive expansion of a variable, check the exp_count field. If it's greater than 0 allow the recursion and decrement the count. (warn_undefined): Remove this (now a macro in variable.h). * function.c (func_call): Before we expand the user-defined function, modify its exp_count field to contain the maximum number of recursive calls we'll allow. After the call, reset it to 0. 2002-04-21 Paul D. Smith Modified to use latest autoconf (2.53), automake (1.6.1), and gettext (0.11.1). We're using gettext's new "external" support, to avoid including libintl source with GNU make. * README.cvs: New file. Explain how to build GNU make from CVS. * configure.in: Modify checking for the system glob library. Use AC_EGREP_CPP instead of AC_TRY_CPP. Remove the setting of GLOBDIR (we will always put "glob" in SUBDIRS, so automake etc. will manage it correctly). Set an automake conditional USE_LOCAL_GLOB to decide whether to compile the glob library. * getloadavg.c (main): Include make.h in the "TEST" program to avoid warnings. * Makefile.am: Remove special rules for loadavg. Replace them with Automake capabilities for building extra programs. * signame.c: This file does nothing if the system provide strsignal(). If not, it implements strsignal(). If the system doesn't define sys_siglist, then we make our own; otherwise we use the system version. * signame.h: Removed. * main.c (main): No need to invoke signame_init(). Update copyright. * ABOUT-NLS: Removed. * gettext.c: Removed. * gettext.h: Get a simplified copy from the gettext package. * po/*: Created. * i18n/*.po: Moved to po/. * i18n/: Removed. * config/*: Created. Contains package configuration helper files. * config.guess, config.sub: Moved to config directory. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in, config/Makefile. Rework to use new-style autoconf features. Use the "external" mode for gettext. Make the build.sh config file conditional on whether build.sh.in exists, to avoid autoconf errors. * acinclude.m4: Removed almost all macros as being obsolete. Rewrote remaining macros to use AC_DEFINE. * acconfig.h: Removed. * Makefile.am (EXTRA_DIST): Add config/config.rpath. Use a conditional to handle customs support. Remove special handling for i18n features. 2002-04-20 Paul D. Smith * function.c (func_call): Don't mark the argument variables $1, etc. as recursive. They've already been fully expanded so there's no need to do it again, and doing so strips escaped $'s. Reported by Sebastian Glita . * remake.c (notice_finished_file): Walk through double-colon entries via the prev field, not the next field! Reported by Greg McGary . * main.c (main): If the user specifies -q and asks for a specific target which is a makefile, we got an assert. In that case it turns out we should continue normally instead. * i18n/de.po, i18n/fr.po: Installed an updated translation. * i18n/he.po: Installed a new translation. 2002-01-07 Paul D. Smith * i18n/es.po, i18n/ru.po: Installed an updated translation. 2001-12-04 Paul D. Smith * i18n/ja.po: Installed an updated translation. 2001-09-04 Paul D. Smith * i18n/da.po: Installed an updated translation. 2001-08-03 Paul D. Smith * i18n/fr.po: Installed an updated translation. Resolves Debian bug #106720. 2001-06-13 Paul D. Smith * i18n/da.po, configure.in (ALL_LINGUAS): Installed a new translation. 2001-06-11 Paul D. Smith * i18n/ko.po: Installed a new translation. 2001-05-06 Paul D. Smith Modify the EINTR handling. * job.c (new_job): Reorganize the jobserver algorithm. Reorder the way in which we manage the file descriptor/signal handler race trap to be more efficient. 2001-05-06 Paul Eggert Restart almost all system calls that are interrupted, instead of worrying about EINTR. The lone exception is the read() for job tokens. * configure.in (HAVE_SA_RESTART): New macro. (MAKE_JOBSERVER): Define to 1 only if HAVE_SA_RESTART. * main.c (main): Use SA_RESTART instead of the old, nonstandard SA_INTERRUPT. * configure.in (AC_CHECK_FUNCS): Add bsd_signal. * main.c (bsd_signal): New function or macro, if the implementation doesn't supply it. (The bsd_signal function will be in POSIX 1003.1-200x.) (HANDLESIG): Remove. (main, FATAL_SIG): Use bsd_signal instead of signal or HANDLESIG. * make.h (EINTR_SET): Remove. (SA_RESTART): New macro. * arscan.c (ar_member_touch): Don't worry about EINTR. * function.c (func_shell): Likewise. * job.c (reap_children, free_child, new_job): Likewise. * main.c (main): Likewise. * remake.c (touch_file, name_mtime): Likewise. * arscan.c (ar_member_touch): Fix bug uncovered by EINTR removal; if fstat failed with errno!=EINTR, the error was ignored. * job.c (set_child_handler_action_flags): New function. (new_job): Use it to temporarily clear the SIGCHLD action flags while reading the token. 2001-05-02 Paul D. Smith * job.c (start_job_command): Don't add define/endef per-line flags to the top-level flags setting. 2001-04-03 Paul D. Smith * arscan.c (VMS_get_member_info,ar_scan) [VMS]: VMS sets the low bit on error, so check for odd return values, not non-0 return values. (VMS_get_member_info): Calculate the timezone differences correctly. Reported by John Fowler . 2001-03-14 Paul D. Smith * variable.c (lookup_variable) [VMS]: Null-terminate the variable value before invoking define_variable(). Reported by John Fowler . 2001-02-07 Paul D. Smith * read.c (record_target_var): If we reset the variable due to a command-line variable setting overriding it, turn off the "append" flag. 2001-01-17 Paul D. Smith * variable.c (lookup_variable) [VMS]: When getting values from the environment, allocate enough space for the _value_ plus escapes, not enough space for the name plus escapes :-/. Reported by John Fowler . * remake.c (f_mtime): Removed the "***" prefix from the mod time warnings that make generates, so it doesn't look like an error. Reported by Karl Berry . Fix for PR/2020: Rework appended target-specific variables. I'm fairly confident this algorithm is finally correct. * expand.c (allocated_variable_append): Rewrite. Instead of expanding each appended variable then adding all the expanded strings together, we append all the unexpanded values going up through the variable set contexts, then expand the final result. This behaves just like non-target-specific appended variable values, while the old way didn't in various corner cases. (variable_append): New function: recursively append the unexpanded value of a variable, walking from the outermost variable scope to the innermost. * variable.c (lookup_variable): Remove the code that looked up the variable set list if the found variable was "append". We don't need this anymore. (lookup_variable_in_set): Make this non-static so we can use it elsewhere. (try_variable_definition): Use lookup_variable_in_set() rather than faking out current_variable_set_list by hand (cleanup). * variable.h: Add a prototype for the now non-static lookup_variable_in_set(). 2000-11-17 Paul D. Smith * remake.c (f_mtime) [WINDOWS32]: On various advice, I changed the WINDOWS32 port to assume timestamps can be up to 3 seconds away before throwing a fit. 2000-11-17 Paul D. Smith * read.c (readline): CRLF calculations had a hole, if you hit the buffer grow scenario just right. Reworked the algorithm to avoid the need for len or lastlen at all. Problem description with sample code chages provided by Chris Faylor . 2000-10-24 Paul D. Smith * gettext.c (SWAP): Declare this with the prototype, otherwise some systems don't work (non-32-bit? Reported for Cray T3E). Reported by Thorstein Thorsteinsson . 2000-10-05 Paul D. Smith * acinclude.m4 (AM_LC_MESSAGES): Remove undefined macro AM_LC_MESSAGES; it doesn't seem to do anything anyway?? * i18n/gl.po, configure.in (ALL_LINGUAS): New Galician translation. 2000-09-22 Paul D. Smith * gettext.c: Don't #define _GETTEXT_H here; we only include some parts of the real gettext.h here, and we expect to really include the real gettext.h later. If we keep this #define, it's ignored. 2000-09-21 Paul D. Smith * main.c (log_working_directory): Rework the text to use complete sentences, to make life simpler for the translators. 2000-08-29 Paul D. Smith * file.c (remove_intermediates): Print a debug message before we remove intermediate files, so the user (if she uses -d) knows what's going on. 2000-08-21 Paul D. Smith * variable.c (try_variable_definition): Change how we handle target-specific append variable defns: instead of just setting the value, expand it as an append _but_ only within the current target's context. Otherwise we lose all but the last value if the variable is appended more than once within the current target context. Fixes PR/1831. 2000-08-16 Paul D. Smith * function.c (func_shell): Nul-terminate the buffer before printing an exec error message (just in case it's not!). Fixes PR/1860, reported by Joey Hess . 2000-07-25 Paul D. Smith * job.c (construct_command_argv_internal): Add "~" to the list of sh_chars[] which disallow optimizing out the shell call. 2000-07-23 Paul Eggert * NEWS, make.texinfo: Document .LOW_RESOLUTION_TIME, which supersedes --disable-nsec-timestamps. * make.texinfo: Consistently use "time stamp" instead of "timestamp". * README: Remove --disable-nsec-timestamps. * filedef.h (struct file.low_resolution_time): New member. * file.c (snap_deps): Add support for .LOW_RESOLUTION_TIME. * remake.c (update_file_1): Avoid spurious rebuilds due to low resolution time stamps, generalizing the earlier code that applied only to archive members. (f_mtime): Archive members always have low resolution time stamps. * configure.in: Remove --disable-nsec-timestamps, as this has been superseded by .LOW_RESOLUTION_TIME. 2000-07-23 Paul Eggert * configure.in (enable_nsec_timestamps): Renamed from make_cv_nsec_timestamps, since enable/disable options shouldn't be cached. 2000-07-23 Bruno Haible and Paul Eggert * file.c (file_timestamp_now): Use preprocessor-time check for FILE_TIMESTAMP_HI_RES so that clock_gettime is not linked unless needed. * filedef.h (FILE_TIMESTAMP_HI_RES): Remove definition; "configure" now does this. * configure.in (jm_AC_TYPE_UINTMAX_T): Move up, to before high resolution file timestamp check, since that check now uses uintmax_t. (FILE_TIMESTAMP_HI_RES): Define to nonzero if the code should use high resolution file timestamps. (HAVE_CLOCK_GETTIME): Do not define if !FILE_TIMESTAMP_HI_RES, so that we don't link in clock_gettime unnecessarily. 2000-07-17 Paul D. Smith * i18n/ja.po: New version of the translation file. 2000-07-07 Paul D. Smith * remake.c (f_mtime): If NO_FLOAT is defined, don't bother with the offset calculation. (name_mtime): Replace EINTR test with EINTR_SET macro. 2000-07-07 Paul Eggert Fix for PR/1811: * remake.c (update_file_1): Avoid spurious rebuilds of archive members due to their timestamp resolution being only one second. (f_mtime): Avoid spurious warnings of timestamps in the future due to the clock's resolution being lower than file timestamps'. When warning about future timestamps, report only the discrepancy, not the absolute value of the timestamp and the current time. * file.c (file_timestamp_now): New arg RESOLUTION. * filedef.h (file_timestamp_now): Likewise. (FILE_TIMESTAMP_NS): Now returns int. All uses changed. 2000-07-05 Paul D. Smith * variable.c (lookup_variable) [VMS]: Remove vestigial references to listp. Fixes PR/1793. 2000-06-26 Paul Eggert * Makefile.am (MAINTAINERCLEANFILES): New macro, with stamp-pot in it. * dir.c (vms_hash): Ensure ctype macro args are nonnegative. * remake.c (f_mtime): Remove unused var memtime. 2000-06-25 Martin Buchholz * make.texinfo, NEWS, TODO.private: Minor spelling corrections. Ran spell-check on make.texinfo. See ChangeLog.2 for earlier changes.