diff -uPr make-3.76.1/AUTHORS make-3.77/AUTHORS --- make-3.76.1/AUTHORS Wed Aug 27 16:30:54 1997 +++ make-3.77/AUTHORS Fri Jul 17 09:23:04 1998 @@ -1,28 +1,29 @@ ----------------------------------- GNU make development up to version 3.75 by: - Roland McGrath + Roland McGrath -GNU Make User's Manual written by: - Richard M. Stallman - - User's Manual edited by: - Roland McGrath - Bob Chassell - Melissa Weisshaus +Development starting with GNU make 3.76 by: + Paul D. Smith -Development and maintenance starting with GNU make 3.76 by: - Paul D. Smith +GNU Make User's Manual written by: + Richard M. Stallman + User's Manual edited by: + Roland McGrath + Bob Chassell + Melissa Weisshaus + Paul D. Smith ----------------------------------- -GNU Make porting efforts: +GNU make porting efforts: Port to VMS by: Klaus Kaempf Archive support/Bug fixes by John W. Eaton + Port to Amiga by: Aaron Digulla diff -uPr make-3.76.1/ChangeLog make-3.77/ChangeLog --- make-3.76.1/ChangeLog Fri Sep 19 12:33:53 1997 +++ make-3.77/ChangeLog Tue Jul 28 14:06:46 1998 @@ -1,5 +1,450 @@ +1998-07-28 Paul D. Smith + + * Version 3.77 released. + + * dosbuild.bat: Change to DOS CRLF line terminators. + + * make-stds.texi: Update from latest version. + + * make.texinfo (Options Summary): Clarify that the -r option + affects only rules, not builtin variables. + +1998-07-27 Paul D. Smith + + * make.h: Make __attribute__ resolve to empty for non-GCC _and_ + for GCC pre-2.5.x. + + * misc.c (log_access): Print UID/GID's as unsigned long int for + maximum portability. + + * job.c (reap_children): Print PIDs as long int for maximum + portability. + +1998-07-24 Eli Zaretskii + + * Makefile.DOS (*_INSTALL, *_UNINSTALL): Replace `true' with `:'. + +1998-07-25 Paul D. Smith + + * Version 3.76.94 released. + +1998-07-23 Paul D. Smith + + * config.h.W32.template: Make sure all the #defines of macros here + have a value (e.g., use ``#define HAVE_STRING_H 1'' instead of + just ``#define HAVE_STRING_H''. Keeps the preprocessor happy in + some contexts. + + * make.h: Remove __attribute__((format...)) stuff; using it with + un-prototyped functions causes older GCC's to fail. + + * Version 3.76.93 released. + +1998-07-22 Paul D. Smith + + * file.c (print_file_data_base): Fix average calculation. + +1998-07-20 Paul D. Smith + + * main.c (die): Postpone the chdir() until after + remove_intermediates() so that intermediate targets with relative + pathnames are removed properly. + +1998-07-17 Paul D. Smith + + * filedef.h (struct file): New flag: did we print an error or not? + + * remake.c (no_rule_error): New function to print error messages, + extraced from remake_file(). + + * remake.c (remake_file): Invoke the new error print function. + (update_file_1): Invoke the error print function if we see that we + already tried this target and it failed, but that an error wasn't + printed for it. This can happen if a file is included with + -include or sinclude and couldn't be built, then later is also + the dependency of another target. Without this change, make just + silently stops :-/. + +1998-07-16 Paul D. Smith + + * make.texinfo: Removed "beta" version designator. + Updated ISBN for the next printing. + +1998-07-13 Paul Eggert + + * acinclude.m4: New AC_LFS macro to determine if special compiler + flags are needed to allow access to large files (e.g., Solaris 2.6). + * configure.in: Invoke it. + +1998-07-08 Eli Zaretskii + + * Makefile.DOS: track changes in Makefile.in. + +1998-07-07 Paul D. Smith + + * remote-cstms.c (start_remote_job): Move gethostbyaddr() to the + top so host is initialized early enough. + + * acinclude.m4: New file. Need some special autoconf macros to + check for network libraries (-lsocket, -lnsl, etc.) when + configuring Customs. + + * configure.in (make_try_customs): Invoke new network libs macro. + +1998-07-06 Paul D. Smith + + * Version 3.76.92 released. + + * README.customs: Added to the distribution. + + * configure.in (make_try_customs): Rewrite to require an installed + Customs library, rather than looking at the build directory. + + * Makefile.am (man_MANS): Install make.1. + * make.1: Renamed from make.man. + + * make.texinfo (Bugs): New mailing list address for GNU make bug + reports. + +1998-07-02 Paul D. Smith + + * Version 3.76.91 released. + + * default.c: Added default rule for new-style RCS master file + storage; ``% :: RCS/%''. + Added default rules for DOS-style C++ files with suffix ".cpp". + They use the new LINK.cpp and COMPILE.cpp macros, which are set by + default to be equal to LINK.cc and COMPILE.cc. + +1998-06-19 Eli Zaretskii + + * job.c (start_job_command): Reset execute_by_shell after an empty + command was skipped. + +1998-06-09 Paul D. Smith + + * main.c (main): Keep track of the temporary filename created when + reading a makefile from stdin (-f-) and attempt to remove it + as soon as we know we're not going to re-exec. If we are, add it + to the exec'd make's cmd line with "-o" so the exec'd make doesn't + try to rebuild it. We still have a hole: if make re-execs then + the temporary file will never be removed. To fix this we'd need + a brand new option that meant "really delete this". + * AUTHORS, getopt.c, getopt1.c, getopt.h, main.c (print_version): + Updated mailing addresses. + +1998-06-08 Paul D. Smith + + * main.c (main): Andreas Luik points out that the + check for makefile :: rules with commands but no dependencies + causing a loop terminates incorrectly. + + * maintMakefile: Make a template for README.DOS to update version + numbers. + +1998-05-30 Andreas Schwab + + * remake.c (update_file_1): Don't free the memory for the + dependency structure when dropping a circular dependency. + +1998-05-30 Eli Zaretskii + + * dir.c (file_exists_p, file_impossible_p, file_impossible) + [__MSDOS__, WINDOWS32]: Retain trailing slash in "d:/", and make + dirname of "d:foo" be "d:". + +1998-05-26 Andreas Schwab + + * read.c (read_makefile): Avoid running past EOS when scanning + file name after `include'. + +1998-05-26 Andreas Schwab + + * make.texinfo (Flavors): Correct description of conditional + assignment, which is not equivalent to ifndef. + (Setting): Likewise. + +1998-05-24 Paul D. Smith + + * arscan.c (ar_name_equal): strncmp() might be implemented as a + macro, so don't put preprocessor conditions inside the arguments + list. + +1998-05-23 Eli Zaretskii + + * read.c (read_makefile) [__MSDOS__, WINDOWS32]: Skip colons in + drive specs when parsing targets, target-specific variables and + static pattern rules. A colon can only be part of drive spec if + it is after the first letter in a token. + +1998-05-22 Eli Zaretskii + + * remake.c (f_mtime) [__MSDOS__]: Allow up to 3 sec of skew before + yelling bloody murder. + + * dosbuild.bat: Use -DINCLUDEDIR= and -DLIBDIR= where appropriate. + + * read.c (parse_file_seq): Combine the special file-handling code + for WINDOWS32 and __MSDOS__ into a single snippet. + (get_next_mword) [__MSDOS__, WINDOWS32]: Allow a word to include a + colon as part of a drive spec. + + * job.c (batch_mode_shell) [__MSDOS__]: Declare. + +1998-05-20 Paul D. Smith + + * Version 3.76.90 released. + +1998-05-19 Paul D. Smith + + * make.texinfo (Make Errors): Added a new appendix describing + common errors make might generate and how to resolve them (or at + least more information on what they mean). + + * maintMakefile (NMAKEFILES): Use the new automake 1.3 feature + to create a dependency file to construct Makefile.DOS, SMakefile, + and NMakefile. + (.dep_segment): Generate the dependency fragment file. + +1998-05-14 Paul D. Smith + + * make.man: Minor changes. + +1998-05-13 Paul D. Smith + + * function.c (pattern_matches,expand_function): Change variables + and types named "word" to something else, to avoid compilation + problems on Cray C90 Unicos. + * variable.h: Modify the function prototype. + +1998-05-11 Rob Tulloh + + * job.c (construct_command_argv_internal): [WINDOWS32] Turn off + echo when using a batch file, and make sure the command ends in a + newline. + +1998-05-03 Paul D. Smith + + * configure.in (make_try_customs): Add some customs flags if the + user configures custom support. + + * job.c, remote-cstms.c: Merge in changes for custom library. + + * remote-stub.c: Add option to stub start_remote_job_p(). + +1998-05-01 Paul D. Smith + + * remake.c (f_mtime): Install VPATH+ handling for archives; use + the hname field instead of the name field, and rehash when + appropriate. + +1998-04-30 Paul D. Smith + + * rule.c (print_rule_data_base): Print out any pattern-specific + variable values into the rules database. + + * variable.c (print_variable_set): Make this variable extern, to + be called by print_rule_data_base() for pattern-specific variables. + + * make.texinfo (Pattern-specific): Document pattern-specific + variables. + +1998-04-29 Paul D. Smith + + * expand.c (variable_expand_for_file): Make static; its only + called internally. Look up this target in the list of + pattern-specific variables and insert the variable set into the + queue to be searched. + + * filedef.h (struct file): Add a new field to hold the + previously-found pattern-specific variable reference. Add a new + flag to remember whether we already searched for this file. + + * rule.h (struct pattern_var): New structure for storing + pattern-specific variable values. Define new function prototypes. + + * rule.c: New variables pattern_vars and last_pattern_var for + storage and handling of pattern-specific variable values. + (create_pattern_var): Create a new pattern-specific variable value + structure. + (lookup_pattern_var): Try to match a target to one of the + pattern-specific variable values. + +1998-04-22 Paul D. Smith + + * make.texinfo (Target-specific): Document target-specific + variables. + +1998-04-21 Paul D. Smith + + * variable.c (define_variable_in_set): Made globally visible. + (lookup_variable_in_set): New function: like lookup_variable but + look only in a specific variable set. + (target_environment): Use lookup_variable_in_set() to get the + correct export rules for a target-specific variable. + (create_new_variable_set): Create a new variable set, and just + return it without installing it anywhere. + (push_new_variable_scope): Reimplement in terms of + create_new_variable_set. + + * read.c (record_target_var): Like record_files, but instead of + files create a target-specific variable value for each of the + listed targets. Invoked from read_makefile() when the target line + turns out to be a target-specific variable assignment. + +1998-04-19 Paul D. Smith + + * read.c (read_makefile): Rewrite the entire target parsing + section to implement target-specific variables. In particular, we + cannot expand the entire line as soon as it's read in, since we + may want to evaluate parts of it with different variable contexts + active. Instead, start expanding from the beginning until we find + the `:' (or `::'), then determine what kind of line this is and + continue appropriately. + + * read.c (get_next_mword): New function to parse a makefile line + by "words", considering an entire variable or function as one + word. Return the type read in, along with its starting position + and length. + (enum make_word_type): The types of words that are recognized by + get_next_mword(). + + * variable.h (struct variable): Add a flag to specify a per-target + variable. + + * expand.c: Make variable_buffer global. We need this during the + new parsing of the makefile. + (variable_expand_string): New function. Like variable_expand(), + but start at a specific point in the buffer, not the beginning. + (variable_expand): Rewrite to simply call variable_expand_string(). + +1998-04-13 Paul D. Smith + + * remake.c (update_goal_chain): Allow the rebuilding makefiles + step to use parallel jobs. Not sure why this was disabled: + hopefully we won't find out :-/. + +1998-04-11 Paul D. Smith + + * main.c (main): Set the CURDIR makefile variable. + * make.texinfo (Recursion): Document it. + +1998-03-17 Paul D. Smith + + * misc.c (makefile_fatal): If FILE is nil, invoke plain fatal(). + * variable.c (try_variable_definition): Use new feature. + +1998-03-10 Paul D. Smith + + * main.c (main): Don't pass included, rebuilt makefiles to + re-exec'd makes with -o. Reopens a possible loop, but it caused + too many problems. + +1998-03-02 Paul D. Smith + + * variable.c (try_variable_definition): Implement ?=. + * make.texinfo (Setting): Document it. + +1998-02-28 Eli Zaretskii + + * job.c (start_job_command): Reset execute_by_shell after an empty + command, like ":", has been seen. + +Tue Oct 07 15:00:00 1997 Phil Brooks + + * make.h: [WINDOWS32] make case sensitivity configurable + * dir.c: [WINDOWS32] make case sensitivity configurable + * README.W32: Document case sensitivity + * config.ami: Share case warping code with Windows + +Mon Oct 6 18:48:45 CDT 1997 Rob Tulloh + + * w32/subproc/sub_proc.c: Added support for MKS toolkit shell + (turn on HAVE_MKS_SHELL). + * read.c: [WINDOWS32] Fixed a problem with multiple target rules + reported by Gilbert Catipon (gcatipon@tibco.com). If multiple + path tokens in a rule did not have drive letters, make would + incorrectly concatenate the 2 tokens together. + * main.c/variable.c: [WINDOWS32] changed SHELL detection code to + follow what MSDOS did. In addition to watching for SHELL variable + updates, make's main will attempt to default the value of SHELL + before and after makefiles are parsed. + * job.c/job.h: [WINDOWS32] The latest changes made to enable use + of the GNUWIN32 shell from make could cause make to fail due to a + concurrency condition between parent and child processes. Make + now creates a batch file per job instead of trying to reuse the + same singleton batch file. + * job.c/job.h/function.c/config.h.W32: [WINDOWS32] Renamed macro + from HAVE_CYGNUS_GNUWIN32_TOOLS to BATCH_MODE_ONLY_SHELL. Reworked + logic to reduce complexity. WINDOWS32 now uses the unixy_shell + variable to detect Bourne-shell compatible environments. There is + also a batch_mode_shell variable that determines whether not + command lines should be executed via script files. A WINDOWS32 + system with no sh.exe installed would have unixy_shell set to + FALSE and batch_mode_shell set to TRUE. If you have a unixy shell + that does not behave well when invoking things via 'sh -c xxx', + you may want to turn on BATCH_MODE_ONLY_SHELL and see if things + improve. + * NMakefile: Added /D DEBUG to debug build flags so that unhandled + exceptions could be debugged. + +Mon Oct 6 00:04:25 1997 Rob Tulloh + + * main.c: [WINDOWS32] The function define_variable() does not + handle NULL. Test before calling it to set Path. + * main.c: [WINDOWS32] Search Path again after makefiles have been + parsed to detect sh.exe. + * job.c: [WINDOWS32] Added support for Cygnus GNU WIN32 tools. + To use, turn on HAVE_CYGNUS_GNUWIN32_TOOLS in config.h.W32. + * config.h.W32: Added HAVE_CYGNUS_GNUWIN32_TOOLS macro. + +Sun Oct 5 22:43:59 1997 John W. Eaton + + * glob/glob.c (glob_in_dir): [VMS] Globbing shouldn't be + case-sensitive. + * job.c (child_execute_job): [VMS] Use a VMS .com file if the + command contains a newline (e.g. from a define/enddef block). + * vmsify.c (vmsify): Return relative pathnames wherever possible. + * vmsify.c (vmsify): An input string like "../.." returns "[--]". + +Wed Oct 1 15:45:09 1997 Rob Tulloh + + * NMakefile: Changed nmake to $(MAKE). + * subproc.bat: Take the make command name from the command + line. If no command name was given, default to nmake. + * job.c: [WINDOWS32/MSDOS] Fix memory stomp: temporary file names + are now always created in heap memory. + * w32/subproc/sub_proc.c: New implementation of make_command_line() + which is more compatible with different Bourne shell implementations. + Deleted the now obsolete fix_command_line() function. + * main.c: [WINDOWS32] Any arbitrary spelling of Path can be + detected. Make will ensure that the special spelling `Path' is + inserted into the environment when the path variable is propagated + within itself and to make's children. + * main.c: [WINDOWS32] Detection of sh.exe was occurring too + soon. The 2nd check for the existence of sh.exe must come after + the call to read_all_makefiles(). + +Fri Sep 26 01:14:18 1997 + + * makefile.com: [VMS] Fixed definition of sys. + * readme.vms: Comments on what's changed lately. + +Fri Sep 26 01:14:18 1997 John W. Eaton + + * read.c (read_all_makefiles): Allow make to find files named + "MAKEFILE" with no extension on VMS. + * file.c (lookup_file): Lowercase filenames on VMS. + +1997-09-29 Paul D. Smith + + * read.c (read_makefile): Reworked target detection again; the old + version had an obscure quirk. + Fri Sep 19 09:20:49 1997 Paul D. Smith + * Version 3.76.1 released. + * Makefile.am: Add loadavg files to clean rules. * configure.in (AC_OUTPUT): Remove stamp-config; no longer needed. @@ -37,7 +482,7 @@ from main() to re-exec make, the call to execvp() would incorrectly return control to parent shell before the exec'ed command could run to completion. I believe this is a feature of - the way that execvp() is implemented on top of WIN32 APIs. To + the way that execvp() is implemented on top of WINDOWS32 APIs. To alleviate the problem, use the supplied process launch function in the sub_proc library and suspend the parent process until the child process has run. When the child exits, exit the parent make diff -uPr make-3.76.1/INSTALL make-3.77/INSTALL --- make-3.76.1/INSTALL Sat Nov 9 17:19:34 1996 +++ make-3.77/INSTALL Thu May 14 14:08:18 1998 @@ -1,8 +1,6 @@ Basic Installation ================== - These are generic installation instructions. - The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. @@ -36,7 +34,13 @@ 2. Type `make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with + If you're building GNU make on a system which does not already have + a `make', you can use the build.sh shell script to compile. Run + `sh ./build.sh'. This should compile the program in the current + directory. Then you will have a Make program that you can use for + `make install', or whatever else. + + 3. Optionally, type `./make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and diff -uPr make-3.76.1/Makefile.DOS make-3.77/Makefile.DOS --- make-3.76.1/Makefile.DOS Fri Sep 19 14:40:52 1997 +++ make-3.77/Makefile.DOS Wed Jul 29 22:38:41 1998 @@ -41,12 +41,12 @@ # get "Error -1" instead of "Error 1". EXIT_FAIL = false -NORMAL_INSTALL = true -PRE_INSTALL = true -POST_INSTALL = true -NORMAL_UNINSTALL = true -PRE_UNINSTALL = true -POST_UNINSTALL = true +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : AR = ar CC = gcc CPP = gcc -E @@ -55,7 +55,7 @@ PACKAGE = make RANLIB = ranlib REMOTE = stub -VERSION = 3.76.1 +VERSION = 3.77 AUTOMAKE_OPTIONS = 1.2 @@ -63,16 +63,17 @@ make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c rule.c implicit.c default.c variable.c expand.c function.c vpath.c version.c ar.c arscan.c commands.h dep.h filedef.h job.h make.h rule.h variable.h signame.c signame.h getopt.c getopt1.c getopt.h remote-$(REMOTE).c # This should include the glob/ prefix -libglob_a_SOURCES = glob/fnmatch.c glob/glob.c glob/fnmatch.h glob/glob.h +libglob_a_SOURCES = glob/fnmatch.c glob/glob.c glob/config.h glob/fnmatch.h glob/glob.h make_LDADD = glob/libglob.a info_TEXINFOS = make.texinfo +man_MANS = make.1 INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" BUILT_SOURCES = README build.sh.in -EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c +EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c SUBDIRS = glob mkinstalldirs = ${bindir}/gmkdir -p @@ -99,6 +100,10 @@ INFO_DEPS = make.info DVIS = make.dvi TEXINFOS = make.texinfo +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in configure configure.in getloadavg.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex @@ -116,14 +121,14 @@ .SUFFIXES: .c .dvi .info .o .ps .texi .texinfo distclean-hdr: - rm -f config.h + -rm -f config.h maintainer-clean-hdr: mostlyclean-binPROGRAMS: clean-binPROGRAMS: - test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: @@ -131,7 +136,7 @@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(bindir) + $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done uninstall-binPROGRAMS: @@ -142,15 +147,15 @@ $(COMPILE) -c $< clean-noinstLIBRARIES: - test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) mostlyclean-compile: - rm -f *.o *.exe make.new core + -rm -f *.o *.exe make.new core clean-compile: distclean-compile: - rm -f *.tab.c + -rm -f *.tab.c maintainer-clean-compile: @@ -188,22 +193,22 @@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(infodir) - @for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; else : ; fi; done; done + $(mkinstalldirs) $(DESTDIR)$(infodir) + @for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi; done; done @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(infodir) $(infodir)/$$file"; install-info --info-dir=$(infodir) $(infodir)/$$file || :; done; else : ; fi + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :; done; else : ; fi uninstall-info: $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(infodir) --remove $$file; done + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done $(NORMAL_UNINSTALL) - for file in $(INFO_DEPS) make.i; do (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done + for file in $(INFO_DEPS) make.i; do (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done dist-info: $(INFO_DEPS) for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done mostlyclean-aminfo: - rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv + rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.kys make.ps make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv make.cn clean-aminfo: @@ -212,6 +217,45 @@ maintainer-clean-aminfo: for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) uninstall-man1 + # Assume that the only thing to do in glob is to build libglob.a, # but do a sanity check: if $SUBDIRS will ever have more than # a single directory, yell bloody murder. @@ -266,7 +310,7 @@ clean-tags: distclean-tags: - rm -f TAGS ID + -rm -f TAGS ID maintainer-clean-tags: @@ -299,32 +343,6 @@ @for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -alloca.o alloca.lo: alloca.c config.h -ar.o ar.lo: ar.c make.h config.h filedef.h dep.h glob/fnmatch.h -arscan.o arscan.lo: arscan.c make.h config.h -commands.o commands.lo: commands.c make.h config.h dep.h filedef.h variable.h job.h commands.h -default.o default.lo: default.c make.h config.h rule.h dep.h filedef.h job.h commands.h variable.h -dir.o dir.lo: dir.c make.h config.h glob/glob.h -expand.o expand.lo: expand.c make.h config.h filedef.h job.h commands.h variable.h -file.o file.lo: file.c make.h config.h dep.h filedef.h job.h commands.h variable.h -function.o function.lo: function.c make.h config.h filedef.h variable.h dep.h job.h commands.h -getloadavg.o getloadavg.lo: getloadavg.c config.h -getopt.o getopt.lo: getopt.c config.h getopt.h -getopt1.o getopt1.lo: getopt1.c config.h getopt.h -implicit.o implicit.lo: implicit.c make.h config.h rule.h dep.h filedef.h -job.o job.lo: job.c make.h config.h job.h filedef.h commands.h variable.h -main.o main.lo: main.c make.h config.h dep.h filedef.h variable.h job.h commands.h getopt.h -misc.o misc.lo: misc.c make.h config.h dep.h -read.o read.lo: read.c make.h config.h dep.h filedef.h job.h commands.h variable.h glob/glob.h -remake.o remake.lo: remake.c make.h config.h filedef.h job.h commands.h dep.h -remote-stub.o remote-stub.lo: remote-stub.c make.h config.h filedef.h job.h commands.h -rule.o rule.lo: rule.c make.h config.h dep.h filedef.h job.h commands.h variable.h rule.h -signame.o signame.lo: signame.c config.h signame.h -variable.o variable.lo: variable.c make.h config.h dep.h filedef.h job.h commands.h variable.h -version.o version.lo: version.c config.h -vpath.o vpath.lo: vpath.c make.h config.h filedef.h variable.h -fnmatch.o fnmatch.lo: fnmatch.c fnmatch.h ../config.h -glob.o glob.lo: glob.c fnmatch.h glob.h ../config.h info: $(INFO_DEPS) info-recursive dvi: $(DVIS) dvi-recursive @@ -362,19 +380,19 @@ mostlyclean-generic: - test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: - test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - rm -f Makefile $(DISTCLEANFILES) - rm -f config.cache config.log stamp-h stamp-h[0-9]* - test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: - test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am @@ -481,3 +499,43 @@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: + +# --------------- DEPENDENCIES +# +alloca.o: alloca.c config.h +ar.o: ar.c make.h config.h signame.h filedef.h dep.h glob/fnmatch.h +arscan.o: arscan.c make.h config.h signame.h +commands.o: commands.c make.h config.h signame.h dep.h filedef.h \ + variable.h job.h commands.h +default.o: default.c make.h config.h signame.h rule.h dep.h filedef.h \ + job.h commands.h variable.h +dir.o: dir.c make.h config.h signame.h glob/glob.h +expand.o: expand.c make.h config.h signame.h filedef.h job.h commands.h \ + variable.h rule.h +file.o: file.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +function.o: function.c make.h config.h signame.h filedef.h variable.h \ + dep.h job.h commands.h +getloadavg.o: getloadavg.c config.h +getopt.o: getopt.c config.h getopt.h +getopt1.o: getopt1.c config.h getopt.h +implicit.o: implicit.c make.h config.h signame.h rule.h dep.h filedef.h +job.o: job.c make.h config.h signame.h job.h filedef.h commands.h \ + variable.h +main.o: main.c make.h config.h signame.h dep.h filedef.h variable.h \ + job.h commands.h getopt.h +misc.o: misc.c make.h config.h signame.h dep.h +read.o: read.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h glob/glob.h +remake.o: remake.c make.h config.h signame.h filedef.h job.h commands.h \ + dep.h +remote-stub.o: remote-stub.c make.h config.h signame.h filedef.h job.h \ + commands.h +rule.o: rule.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h +signame.o: signame.c config.h signame.h +variable.o: variable.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +version.o: version.c config.h +vpath.o: vpath.c make.h config.h signame.h filedef.h variable.h + diff -uPr make-3.76.1/Makefile.am make-3.77/Makefile.am --- make-3.76.1/Makefile.am Fri Sep 19 11:14:29 1997 +++ make-3.77/Makefile.am Mon Jul 6 11:34:54 1998 @@ -1,6 +1,6 @@ # -*-Makefile-*-, or close enough -AUTOMAKE_OPTIONS = 1.2 +AUTOMAKE_OPTIONS = 1.3 bin_PROGRAMS = make @@ -13,12 +13,13 @@ make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a info_TEXINFOS = make.texinfo +man_MANS = make.1 INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" BUILT_SOURCES = README build.sh.in -EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c\ +EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c\ make-stds.texi texinfo.tex SCOPTIONS SMakefile\ README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\ README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\ @@ -31,13 +32,43 @@ MOSTLYCLEANFILES = loadavg.c CLEANFILES = loadavg + +# --------------- Local INSTALL Section + +# If necessary, change the gid of the app and turn on the setgid flag. +# + +# Whether or not make needs to be installed setgid. +# The value should be either `true' or `false'. +# On many systems, the getloadavg function (used to implement the `-l' +# switch) will not work unless make is installed setgid kmem. +# +inst_setgid = @NEED_SETGID@ + +# Install make setgid to this group so it can get the load average. +# +inst_group = @KMEM_GROUP@ + +install-exec-local: + @if $(inst_setgid); then \ + app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \ + if chgrp $(inst_group) $$app && chmod g+s $$app; then \ + echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \ + else \ + echo "$$app needs to be owned by group $(inst_group) and setgid;"; \ + echo "otherwise the \`-l' option will probably not work."; \ + echo "You may need special privileges to complete the installation"; \ + echo "of $$app."; \ + fi; \ + else true; fi + # --------------- Local DIST Section # Install the w32 subdirectory # dist-hook: (cd $(srcdir); \ - w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \ + w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \ tar chf - $$w32) \ | (cd $(distdir); tar xfBp -) @@ -52,11 +83,14 @@ loadavg: loadavg.c config.h @rm -f loadavg $(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS) + # We copy getloadavg.c into a different file rather than compiling it # directly because some compilers clobber getloadavg.o in the process. +# loadavg.c: getloadavg.c ln $(srcdir)/getloadavg.c loadavg.c || \ - cp $(srcdir)/getloadavg.c loadavg.c + cp $(srcdir)/getloadavg.c loadavg.c + check-loadavg: loadavg @echo The system uptime program believes the load average to be: -uptime @@ -69,8 +103,10 @@ # specified, or else in the srcdir or the distdir, their parents, and _their_ # parents. # +MAKETESTFLAGS = + check-regression: all - here=`pwd`; testdir=""; \ + @here=`pwd`; testdir=""; \ case "$(MAKE_TEST)" in "") \ for d1 in $$here $(srcdir); do \ for d2 in ../.. .. .; do \ @@ -83,10 +119,10 @@ *) testdir="$(MAKE_TEST)" ;; \ esac; \ case "$$testdir" in \ - "") echo "Couldn't find make-test-* test suite."; exit 0;; \ + "") echo "Couldn't find make-test-* regression test suite."; exit 0;; \ esac; \ - echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \ - cd $$testdir && ./run_make_tests -make_path $$here/make + echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \ + cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS) # --------------- Maintainer's Section diff -uPr make-3.76.1/Makefile.in make-3.77/Makefile.in --- make-3.76.1/Makefile.in Fri Sep 19 14:58:51 1997 +++ make-3.77/Makefile.in Wed Jul 29 22:38:45 1998 @@ -1,8 +1,14 @@ -# Makefile.in generated automatically by automake 1.2 from Makefile.am +# Makefile.in generated automatically by automake 1.3 from Makefile.am -# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. # -*-Makefile-*-, or close enough @@ -28,6 +34,8 @@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -45,12 +53,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ -NORMAL_INSTALL = true -PRE_INSTALL = true -POST_INSTALL = true -NORMAL_UNINSTALL = true -PRE_UNINSTALL = true -POST_UNINSTALL = true +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : CC = @CC@ CPP = @CPP@ LIBOBJS = @LIBOBJS@ @@ -59,7 +67,7 @@ REMOTE = @REMOTE@ VERSION = @VERSION@ -AUTOMAKE_OPTIONS = 1.2 +AUTOMAKE_OPTIONS = 1.3 bin_PROGRAMS = make @@ -72,12 +80,13 @@ make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a info_TEXINFOS = make.texinfo +man_MANS = make.1 INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" BUILT_SOURCES = README build.sh.in -EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c\ +EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c\ make-stds.texi texinfo.tex SCOPTIONS SMakefile\ README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\ README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\ @@ -89,6 +98,30 @@ MOSTLYCLEANFILES = loadavg.c CLEANFILES = loadavg + +# --------------- Local INSTALL Section + +# If necessary, change the gid of the app and turn on the setgid flag. +# + +# Whether or not make needs to be installed setgid. +# The value should be either `true' or `false'. +# On many systems, the getloadavg function (used to implement the `-l' +# switch) will not work unless make is installed setgid kmem. +# +inst_setgid = @NEED_SETGID@ + +# Install make setgid to this group so it can get the load average. +# +inst_group = @KMEM_GROUP@ + +# > check-regression +# +# Look for the make test suite, and run it if found. Look in MAKE_TEST if +# specified, or else in the srcdir or the distdir, their parents, and _their_ +# parents. +# +MAKETESTFLAGS = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h @@ -114,10 +147,14 @@ INFO_DEPS = make.info DVIS = make.dvi TEXINFOS = make.texinfo +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ -Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in \ -configure configure.in getloadavg.c install-sh missing mkinstalldirs \ -stamp-h.in texinfo.tex +Makefile.in NEWS acconfig.h acinclude.m4 aclocal.m4 alloca.c \ +build.sh.in config.h.in configure configure.in getloadavg.c install-sh \ +missing mkinstalldirs stamp-h.in texinfo.tex DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -127,18 +164,18 @@ SOURCES = $(make_SOURCES) OBJECTS = $(make_OBJECTS) -default: all +all: all-recursive-am all-am .SUFFIXES: -.SUFFIXES: .c .dvi .info .o .ps .texi .texinfo -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status -$(ACLOCAL_M4): configure.in +$(ACLOCAL_M4): configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure @@ -147,6 +184,7 @@ cd $(srcdir) && $(AUTOCONF) config.h: stamp-h + @: stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ @@ -162,7 +200,7 @@ clean-hdr: distclean-hdr: - rm -f config.h + -rm -f config.h maintainer-clean-hdr: build.sh: $(top_builddir)/config.status build.sh.in @@ -171,7 +209,7 @@ mostlyclean-binPROGRAMS: clean-binPROGRAMS: - test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: @@ -179,30 +217,36 @@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(bindir) + $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; \ done uninstall-binPROGRAMS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ done .c.o: $(COMPILE) -c $< +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + mostlyclean-compile: - rm -f *.o core + -rm -f *.o core *.core clean-compile: distclean-compile: - rm -f *.tab.c + -rm -f *.tab.c maintainer-clean-compile: @@ -243,26 +287,40 @@ .texinfo.dvi: TEXINPUTS=$(srcdir):$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.txi.dvi: + TEXINPUTS=$(srcdir):$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: $(DVIPS) $< -o $@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(infodir) + $(mkinstalldirs) $(DESTDIR)$(infodir) @for file in $(INFO_DEPS); do \ d=$(srcdir); \ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ for file in $(INFO_DEPS); do \ - echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\ - install-info --info-dir=$(infodir) $(infodir)/$$file || :;\ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ done; \ else : ; fi @@ -272,11 +330,12 @@ ii=yes; \ else ii=; fi; \ for file in $(INFO_DEPS); do \ - test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \ + test -z "$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) for file in $(INFO_DEPS); do \ - (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done dist-info: $(INFO_DEPS) @@ -290,16 +349,60 @@ done mostlyclean-aminfo: - rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky \ - make.log make.pg make.toc make.tp make.tps make.vr make.vrs \ - make.op make.tr make.cv + -rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky \ + make.kys make.ps make.log make.pg make.toc make.tp make.tps \ + make.vr make.vrs make.op make.tr make.cv make.cn clean-aminfo: distclean-aminfo: maintainer-clean-aminfo: - for i in $(INFO_DEPS); do rm -f `eval echo $$i*`; done + for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done + +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) uninstall-man1 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -314,7 +417,7 @@ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ - for subdir in $(SUBDIRS); do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ @@ -324,7 +427,9 @@ mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ - rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + done; \ for subdir in $$rev; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ @@ -338,24 +443,29 @@ tags: TAGS -ID: $(HEADERS) $(SOURCES) - here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS) +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ done; \ - test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: - rm -f TAGS ID + -rm -f TAGS ID maintainer-clean-tags: @@ -366,7 +476,7 @@ # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - rm -rf $(distdir) + -rm -rf $(distdir) GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst @@ -379,20 +489,20 @@ && $(MAKE) install \ && $(MAKE) installcheck \ && $(MAKE) dist - rm -rf $(distdir) + -rm -rf $(distdir) @echo "========================"; \ echo "$(distdir).tar.gz is ready for distribution"; \ echo "========================" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + -rm -rf $(distdir) distdir: $(DISTFILES) - rm -rf $(distdir) + -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ @@ -401,69 +511,68 @@ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done - for subdir in $(SUBDIRS); do \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) \ + for subdir in $(SUBDIRS); do \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ done $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -alloca.o alloca.lo: alloca.c config.h -ar.o ar.lo: ar.c make.h config.h filedef.h dep.h glob/fnmatch.h -arscan.o arscan.lo: arscan.c make.h config.h -commands.o commands.lo: commands.c make.h config.h dep.h filedef.h \ +alloca.o: alloca.c config.h +ar.o: ar.c make.h config.h signame.h filedef.h dep.h glob/fnmatch.h +arscan.o: arscan.c make.h config.h signame.h +commands.o: commands.c make.h config.h signame.h dep.h filedef.h \ variable.h job.h commands.h -default.o default.lo: default.c make.h config.h rule.h dep.h filedef.h \ +default.o: default.c make.h config.h signame.h rule.h dep.h filedef.h \ job.h commands.h variable.h -dir.o dir.lo: dir.c make.h config.h glob/glob.h -expand.o expand.lo: expand.c make.h config.h filedef.h job.h commands.h \ - variable.h -file.o file.lo: file.c make.h config.h dep.h filedef.h job.h commands.h \ - variable.h -function.o function.lo: function.c make.h config.h filedef.h variable.h \ +dir.o: dir.c make.h config.h signame.h glob/glob.h +expand.o: expand.c make.h config.h signame.h filedef.h job.h commands.h \ + variable.h rule.h +file.o: file.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +function.o: function.c make.h config.h signame.h filedef.h variable.h \ dep.h job.h commands.h -getloadavg.o getloadavg.lo: getloadavg.c config.h -getopt.o getopt.lo: getopt.c config.h getopt.h -getopt1.o getopt1.lo: getopt1.c config.h getopt.h -implicit.o implicit.lo: implicit.c make.h config.h rule.h dep.h \ - filedef.h -job.o job.lo: job.c make.h config.h job.h filedef.h commands.h \ +getloadavg.o: getloadavg.c config.h +getopt.o: getopt.c config.h getopt.h +getopt1.o: getopt1.c config.h getopt.h +implicit.o: implicit.c make.h config.h signame.h rule.h dep.h filedef.h +job.o: job.c make.h config.h signame.h job.h filedef.h commands.h \ variable.h -main.o main.lo: main.c make.h config.h dep.h filedef.h variable.h job.h \ - commands.h getopt.h -misc.o misc.lo: misc.c make.h config.h dep.h -read.o read.lo: read.c make.h config.h dep.h filedef.h job.h commands.h \ - variable.h glob/glob.h -remake.o remake.lo: remake.c make.h config.h filedef.h job.h commands.h \ +main.o: main.c make.h config.h signame.h dep.h filedef.h variable.h \ + job.h commands.h getopt.h +misc.o: misc.c make.h config.h signame.h dep.h +read.o: read.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h glob/glob.h +remake.o: remake.c make.h config.h signame.h filedef.h job.h commands.h \ dep.h -remote-stub.o remote-stub.lo: remote-stub.c make.h config.h filedef.h \ - job.h commands.h -rule.o rule.lo: rule.c make.h config.h dep.h filedef.h job.h commands.h \ - variable.h rule.h -signame.o signame.lo: signame.c config.h signame.h -variable.o variable.lo: variable.c make.h config.h dep.h filedef.h job.h \ +remote-stub.o: remote-stub.c make.h config.h signame.h filedef.h job.h \ + commands.h +rule.o: rule.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h +signame.o: signame.c config.h signame.h +variable.o: variable.c make.h config.h signame.h dep.h filedef.h job.h \ commands.h variable.h -version.o version.lo: version.c config.h -vpath.o vpath.lo: vpath.c make.h config.h filedef.h variable.h +version.o: version.c config.h +vpath.o: vpath.c make.h config.h signame.h filedef.h variable.h info: $(INFO_DEPS) info-recursive dvi: $(DVIS) dvi-recursive -check: all +check: all-am $(MAKE) check-recursive check-local installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) all-recursive -all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h +all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h -install-exec-am: install-binPROGRAMS +install-exec-am: install-binPROGRAMS install-exec-local -install-data-am: install-info-am +install-data-am: install-info-am install-man -uninstall-am: uninstall-binPROGRAMS uninstall-info +uninstall-am: uninstall-binPROGRAMS uninstall-info uninstall-man install-exec: install-exec-recursive install-exec-am @$(NORMAL_INSTALL) @@ -476,28 +585,27 @@ uninstall: uninstall-recursive uninstall-am -all: all-recursive-am all-am - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: installdirs-recursive - $(mkinstalldirs) $(bindir) $(infodir) + $(mkinstalldirs) $(DATADIR)$(bindir) $(DESTDIR)$(infodir) \ + $(DESTDIR)$(mandir)/man1 mostlyclean-generic: - test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: - test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - rm -f Makefile $(DISTCLEANFILES) - rm -f config.cache config.log stamp-h stamp-h[0-9]* - test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: - test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ mostlyclean-compile mostlyclean-aminfo mostlyclean-tags \ mostlyclean-generic @@ -519,20 +627,21 @@ clean: clean-recursive clean-am distclean: distclean-recursive distclean-am - rm -f config.status + -rm -f config.status maintainer-clean: maintainer-clean-recursive maintainer-clean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f config.status + -rm -f config.status -.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \ -maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \ -clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \ -install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \ +.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ +mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile install-info-am uninstall-info \ mostlyclean-aminfo distclean-aminfo clean-aminfo \ -maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \ +maintainer-clean-aminfo install-man1 uninstall-man1 install-man \ +uninstall-man install-data-recursive uninstall-data-recursive \ install-exec-recursive uninstall-exec-recursive installdirs-recursive \ uninstalldirs-recursive all-recursive check-recursive \ installcheck-recursive info-recursive dvi-recursive \ @@ -546,13 +655,26 @@ maintainer-clean +install-exec-local: + @if $(inst_setgid); then \ + app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \ + if chgrp $(inst_group) $$app && chmod g+s $$app; then \ + echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \ + else \ + echo "$$app needs to be owned by group $(inst_group) and setgid;"; \ + echo "otherwise the \`-l' option will probably not work."; \ + echo "You may need special privileges to complete the installation"; \ + echo "of $$app."; \ + fi; \ + else true; fi + # --------------- Local DIST Section # Install the w32 subdirectory # dist-hook: (cd $(srcdir); \ - w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \ + w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \ tar chf - $$w32) \ | (cd $(distdir); tar xfBp -) @@ -566,25 +688,22 @@ loadavg: loadavg.c config.h @rm -f loadavg $(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS) + # We copy getloadavg.c into a different file rather than compiling it # directly because some compilers clobber getloadavg.o in the process. +# loadavg.c: getloadavg.c ln $(srcdir)/getloadavg.c loadavg.c || \ - cp $(srcdir)/getloadavg.c loadavg.c + cp $(srcdir)/getloadavg.c loadavg.c + check-loadavg: loadavg @echo The system uptime program believes the load average to be: -uptime @echo The GNU load average checking code believes: -./loadavg -# > check-regression -# -# Look for the make test suite, and run it if found. Look in MAKE_TEST if -# specified, or else in the srcdir or the distdir, their parents, and _their_ -# parents. -# check-regression: all - here=`pwd`; testdir=""; \ + @here=`pwd`; testdir=""; \ case "$(MAKE_TEST)" in "") \ for d1 in $$here $(srcdir); do \ for d2 in ../.. .. .; do \ @@ -597,10 +716,10 @@ *) testdir="$(MAKE_TEST)" ;; \ esac; \ case "$$testdir" in \ - "") echo "Couldn't find make-test-* test suite."; exit 0;; \ + "") echo "Couldn't find make-test-* regression test suite."; exit 0;; \ esac; \ - echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \ - cd $$testdir && ./run_make_tests -make_path $$here/make + echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \ + cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS) # --------------- Maintainer's Section diff -uPr make-3.76.1/NEWS make-3.77/NEWS --- make-3.76.1/NEWS Fri Sep 19 14:58:39 1997 +++ make-3.77/NEWS Sat Jul 25 15:31:45 1998 @@ -1,11 +1,57 @@ GNU make NEWS -*-indented-text-*- History of user-visible changes. - 19 Sep 1997 + 19 May 1998 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +Copyright (C) 1992,1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc. See the end for copying conditions. -Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu. +Please send GNU make bug reports to bug-make@gnu.org. + +Version 3.77 + +* Implement BSD make's "?=" variable assignment operator. The variable + is assigned the specified value only if that variable is not already + defined. + +* Make defines a new variable, "CURDIR", to contain the current working + directory (after the -C option, if any, has been processed). + Modifying this variable has no effect on the operation of make. + +* Make defines a new default RCS rule, for new-style master file + storage: ``% :: RCS/%'' (note no ``,v'' suffix). + + Make defines new default rules for DOS-style C++ file naming + conventions, with ``.cpp'' suffixes. All the same rules as for + ``.cc'' and ``.C'' suffixes are provided, along with LINK.cpp and + COMPILE.cpp macros (which default to the same value as LINK.cc and + COMPILE.cc). Note CPPFLAGS is still C preprocessor flags! You should + use CXXFLAGS to change C++ compiler flags. + +* A new feature, "target-specific variable values", has been added. + This is a large change so please see the appropriate sections of the + manual for full details. Briefly, syntax like this: + + TARGET: VARIABLE = VALUE + + defines VARIABLE as VALUE within the context of TARGET. This is + similar to SunOS make's "TARGET := VARIABLE = VALUE" feature. Note + that the assignment may be of any type, not just recursive, and that + the override keyword is available. + + COMPATIBILITY: This new syntax means that if you have any rules where + the first or second dependency has an equal sign (=) in its name, + you'll have to escape them with a backslash: "foo : bar\=baz". + Further, if you have any dependencies which already contain "\=", + you'll have to escape both of them: "foo : bar\\\=baz". + +* A new appendix listing the most common error and warning messages + generated by GNU make, with some explanation, has been added to the + GNU make User's Manual. + +* Updates to the GNU make Customs library support (see README.customs). + +* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32), + and to the DOS port from Eli Zaretski (see README.DOS). Version 3.76.1 diff -uPr make-3.76.1/NMakefile make-3.77/NMakefile --- make-3.76.1/NMakefile Wed Aug 27 16:31:01 1997 +++ make-3.77/NMakefile Wed Jul 29 22:38:41 1998 @@ -1,141 +1,158 @@ -# NOTE: If you have no `make' program at all to process this makefile, run -# `build_w32.bat' instead. -# -# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc. -# This file is part of GNU Make. -# -# GNU Make is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Make is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Make; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# -# NMakefile for GNU Make -# - -LINK = link -CC = cl - -OUTDIR=. -MAKEFILE=NMakefile -SUBPROC_MAKEFILE=NMakefile - -CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES -CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb -CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/ - -LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\ - /INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \ - /OUT:WinDebug/make.exe /DEBUG -LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\ - /INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe - -all: config.h subproc Release Debug - -# -# Make sure we build the subproc library first. It has it's own -# makefile. To be portable to Windows 95, we put the instructions -# on how to build the library into a batch file. On NT, we could -# simply have done foo && bar && dog, but this doesn't port. -# -subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib - -w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: - subproc.bat $(SUBPROC_MAKEFILE) - -config.h: config.h.W32 - copy $? $@ - -Release: - nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe -Debug: - nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe - -clean: - rmdir /s /q WinDebug WinRel - rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel - erase config.h - -$(OUTDIR): - if not exist .\$@\nul mkdir .\$@ - -LIBS = kernel32.lib user32.lib advapi32.lib - -OBJS = \ - $(OUTDIR)/ar.obj \ - $(OUTDIR)/arscan.obj \ - $(OUTDIR)/commands.obj \ - $(OUTDIR)/default.obj \ - $(OUTDIR)/dir.obj \ - $(OUTDIR)/expand.obj \ - $(OUTDIR)/file.obj \ - $(OUTDIR)/function.obj \ - $(OUTDIR)/getloadavg.obj \ - $(OUTDIR)/getopt.obj \ - $(OUTDIR)/getopt1.obj \ - $(OUTDIR)/implicit.obj \ - $(OUTDIR)/job.obj \ - $(OUTDIR)/main.obj \ - $(OUTDIR)/misc.obj \ - $(OUTDIR)/read.obj \ - $(OUTDIR)/remake.obj \ - $(OUTDIR)/remote-stub.obj \ - $(OUTDIR)/rule.obj \ - $(OUTDIR)/signame.obj \ - $(OUTDIR)/variable.obj \ - $(OUTDIR)/version.obj \ - $(OUTDIR)/vpath.obj \ - $(OUTDIR)/glob.obj \ - $(OUTDIR)/fnmatch.obj \ - $(OUTDIR)/dirent.obj \ - $(OUTDIR)/pathstuff.obj - -$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS) - $(LINK) @<< - $(LDFLAGS) $(LIBS) $(OBJS) -<< - -.c{$(OUTDIR)}.obj: - $(CC) $(CFLAGS) /c $< - -$(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h -$(OUTDIR)/arscan.obj : arscan.c make.h -$(OUTDIR)/commands.obj : commands.c -$(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h -$(OUTDIR)/dir.obj : dir.c make.h -$(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h -$(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h -$(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h -$(OUTDIR)/getloadavg.obj : getloadavg.c -$(OUTDIR)/getopt.obj : getopt.c -$(OUTDIR)/getopt1.obj : getopt1.c getopt.h -$(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h filedef.h -$(OUTDIR)/job.obj : job.c make.h job.h filedef.h commands.h variable.h -$(OUTDIR)/main.obj : main.c make.h dep.h filedef.h variable.h job.h commands.h getopt.h -$(OUTDIR)/misc.obj : misc.c make.h dep.h -$(OUTDIR)/read.obj : read.c make.h dep.h filedef.h job.h commands.h variable.h glob/glob.h -$(OUTDIR)/remake.obj : remake.c make.h filedef.h job.h commands.h dep.h -$(OUTDIR)/remote-stub.obj : remote-stub.c make.h filedef.h job.h commands.h -$(OUTDIR)/rule.obj : rule.c make.h dep.h filedef.h job.h commands.h variable.h rule.h -$(OUTDIR)/signame.obj : signame.c signame.h -$(OUTDIR)/variable.obj : variable.c make.h dep.h filedef.h job.h commands.h variable.h -$(OUTDIR)/version.obj : version.c -$(OUTDIR)/vpath.obj : vpath.c make.h filedef.h variable.h -$(OUTDIR)/glob.obj : glob/glob.c - $(CC) $(CFLAGS) /c $? -$(OUTDIR)/fnmatch.obj : glob/fnmatch.c - $(CC) $(CFLAGS) /c $? -$(OUTDIR)/dirent.obj : w32/compat/dirent.c - $(CC) $(CFLAGS) /c $? -$(OUTDIR)/pathstuff.obj : w32/pathstuff.c - $(CC) $(CFLAGS) /c $? - +# NOTE: If you have no `make' program at all to process this makefile, run +# `build_w32.bat' instead. +# +# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc. +# This file is part of GNU Make. +# +# GNU Make is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Make is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Make; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +# +# NMakefile for GNU Make +# + +LINK = link +CC = cl + +OUTDIR=. +MAKEFILE=NMakefile +SUBPROC_MAKEFILE=NMakefile + +CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES +CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb +CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/ + +LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\ + /INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \ + /OUT:WinDebug/make.exe /DEBUG +LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\ + /INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe + +all: config.h subproc Release Debug + +# +# Make sure we build the subproc library first. It has it's own +# makefile. To be portable to Windows 95, we put the instructions +# on how to build the library into a batch file. On NT, we could +# simply have done foo && bar && dog, but this doesn't port. +# +subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib + +w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: + subproc.bat $(SUBPROC_MAKEFILE) $(MAKE) + +config.h: config.h.W32 + copy $? $@ + +Release: + $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe +Debug: + $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe + +clean: + rmdir /s /q WinDebug WinRel + rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel + erase config.h + erase *.pdb + +$(OUTDIR): + if not exist .\$@\nul mkdir .\$@ + +LIBS = kernel32.lib user32.lib advapi32.lib + +OBJS = \ + $(OUTDIR)/ar.obj \ + $(OUTDIR)/arscan.obj \ + $(OUTDIR)/commands.obj \ + $(OUTDIR)/default.obj \ + $(OUTDIR)/dir.obj \ + $(OUTDIR)/expand.obj \ + $(OUTDIR)/file.obj \ + $(OUTDIR)/function.obj \ + $(OUTDIR)/getloadavg.obj \ + $(OUTDIR)/getopt.obj \ + $(OUTDIR)/getopt1.obj \ + $(OUTDIR)/implicit.obj \ + $(OUTDIR)/job.obj \ + $(OUTDIR)/main.obj \ + $(OUTDIR)/misc.obj \ + $(OUTDIR)/read.obj \ + $(OUTDIR)/remake.obj \ + $(OUTDIR)/remote-stub.obj \ + $(OUTDIR)/rule.obj \ + $(OUTDIR)/signame.obj \ + $(OUTDIR)/variable.obj \ + $(OUTDIR)/version.obj \ + $(OUTDIR)/vpath.obj \ + $(OUTDIR)/glob.obj \ + $(OUTDIR)/fnmatch.obj \ + $(OUTDIR)/dirent.obj \ + $(OUTDIR)/pathstuff.obj + +$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS) + $(LINK) @<< + $(LDFLAGS) $(LIBS) $(OBJS) +<< + +.c{$(OUTDIR)}.obj: + $(CC) $(CFLAGS) /c $< + +$(OUTDIR)/glob.obj : glob/glob.c + $(CC) $(CFLAGS) /c $? +$(OUTDIR)/fnmatch.obj : glob/fnmatch.c + $(CC) $(CFLAGS) /c $? +$(OUTDIR)/dirent.obj : w32/compat/dirent.c + $(CC) $(CFLAGS) /c $? +$(OUTDIR)/pathstuff.obj : w32/pathstuff.c + $(CC) $(CFLAGS) /c $? + +# --------------- DEPENDENCIES +# +$(OUTDIR)/alloca.obj: alloca.c config.h +$(OUTDIR)/ar.obj: ar.c make.h config.h signame.h filedef.h dep.h glob/fnmatch.h +$(OUTDIR)/arscan.obj: arscan.c make.h config.h signame.h +$(OUTDIR)/commands.obj: commands.c make.h config.h signame.h dep.h filedef.h \ + variable.h job.h commands.h +$(OUTDIR)/default.obj: default.c make.h config.h signame.h rule.h dep.h filedef.h \ + job.h commands.h variable.h +$(OUTDIR)/dir.obj: dir.c make.h config.h signame.h glob/glob.h +$(OUTDIR)/expand.obj: expand.c make.h config.h signame.h filedef.h job.h commands.h \ + variable.h rule.h +$(OUTDIR)/file.obj: file.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +$(OUTDIR)/function.obj: function.c make.h config.h signame.h filedef.h variable.h \ + dep.h job.h commands.h +$(OUTDIR)/getloadavg.obj: getloadavg.c config.h +$(OUTDIR)/getopt.obj: getopt.c config.h getopt.h +$(OUTDIR)/getopt1.obj: getopt1.c config.h getopt.h +$(OUTDIR)/implicit.obj: implicit.c make.h config.h signame.h rule.h dep.h filedef.h +$(OUTDIR)/job.obj: job.c make.h config.h signame.h job.h filedef.h commands.h \ + variable.h +$(OUTDIR)/main.obj: main.c make.h config.h signame.h dep.h filedef.h variable.h \ + job.h commands.h getopt.h +$(OUTDIR)/misc.obj: misc.c make.h config.h signame.h dep.h +$(OUTDIR)/read.obj: read.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h glob/glob.h +$(OUTDIR)/remake.obj: remake.c make.h config.h signame.h filedef.h job.h commands.h \ + dep.h +$(OUTDIR)/remote-stub.obj: remote-stub.c make.h config.h signame.h filedef.h job.h \ + commands.h +$(OUTDIR)/rule.obj: rule.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h +$(OUTDIR)/signame.obj: signame.c config.h signame.h +$(OUTDIR)/variable.obj: variable.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +$(OUTDIR)/version.obj: version.c config.h +$(OUTDIR)/vpath.obj: vpath.c make.h config.h signame.h filedef.h variable.h + diff -uPr make-3.76.1/README make-3.77/README --- make-3.76.1/README Fri Sep 19 14:40:48 1997 +++ make-3.77/README Wed Jul 29 22:36:08 1998 @@ -1,4 +1,4 @@ -This directory contains the 3.76.1 release of GNU Make. +This directory contains the 3.77 release of GNU Make. All bugs reported for previous releases have been fixed. Some bugs surely remain. @@ -13,6 +13,9 @@ Some systems' Make programs are broken and cannot process the Makefile for GNU Make. If you get errors from your system's Make when building GNU Make, try using `build.sh' instead. + + - See README.customs for details on integrating GNU make with the + Customs distributed build environment from the Pmake distribution. - See README.W32 for details about GNU Make on Windows NT or 95. diff -uPr make-3.76.1/README.DOS make-3.77/README.DOS --- make-3.76.1/README.DOS Wed Aug 27 16:31:02 1997 +++ make-3.77/README.DOS Wed Jul 29 22:38:40 1998 @@ -37,6 +37,10 @@ if you use PKUNZIP). If you build Make on Windows 95, use an unzip program that supports long filenames in zip files. + If you are unpacking an official GNU source distribution, use + either DJTAR (which is part of the DJGPP development + environment), or the DJGPP port of GNU Tar. + 2. Invoke the `configure.bat' batch file. If you are building Make in-place, i.e. in the same directory @@ -44,7 +48,7 @@ [Enter]. Otherwise, you need to supply the path to the source directory as an argument to the batch file, like this: - configure.bat c:/djgpp/gnu/make-3.76 + configure.bat c:/djgpp/gnu/make-3.77 Note the forward slashes: you MUST use them here. @@ -65,7 +69,7 @@ If you are building from outside of the source directory, you need to tell Make where the sources are, like this: - make srcdir=c:/djgpp/gnu/make-3.76 + make srcdir=c:/djgpp/gnu/make-3.77 (configure.bat will tell you this when it finishes). You MUST use a full, not relative, name of the source directory here, or @@ -73,8 +77,8 @@ 6. After Make finishes, if you have a Unix-style shell installed, you can use the `install' target to install the package. You - will also need GNU Fileutils and GNU Sh-utils for this (they - should be available from the DJGPP sites). + will also need GNU Fileutils and GNU Sed for this (they should + be available from the DJGPP sites). Without a Unix-style shell, you will have to install programs and the docs manually. Copy make.exe to a directory on your @@ -82,7 +86,7 @@ file `dir' in your Info directory by adding the following item to the main menu: - * GNU make: (make.info). The GNU make utility. + * Make: (make.info). The GNU make utility. If you have the `install-info' program (from the GNU Texinfo package), it will do that for you if you invoke it like this: @@ -92,8 +96,8 @@ (If your Info directory is other than C:\DJGPP\INFO, change this command accordingly.) - 7. The `clean' targets also require Unix-style shell and `test' and - `rm' programs (from Fileutils and Sh-utils, accordingly). + 7. The `clean' targets also require Unix-style shell, and GNU Sed + and `rm' programs (the latter from Fileutils). @@ -240,8 +244,7 @@ doesn't include characters illegal on MSDOS FAT filesystems, will be automatically down-cased.) User reports that I have indicate that this default behavior is generally what you'd - expect; however, since support for long filenames in the DJGPP - port of GNU Make is relatively new, your input is most welcome. + expect; however, your input is most welcome. In any case, if you hit a situation where you must force Make to get the 8+3 DOS filenames in upper case, set FNCASE=y in the @@ -283,8 +286,8 @@ reported first on the comp.os.msdos.djgpp news group (if you cannot post to Usenet groups, write to the DJGPP mailing list, , which is an email gateway into the above news - group). For other bugs, please follow the the procedure explained - in the "Bugs" chapter of the Info docs. If you don't have an Info + group). For other bugs, please follow the procedure explained in + the "Bugs" chapter of the Info docs. If you don't have an Info reader, look up that chapter in the `make.i1' file with any text browser/editor. diff -uPr make-3.76.1/README.W32 make-3.77/README.W32 --- make-3.76.1/README.W32 Tue Sep 16 10:17:27 1997 +++ make-3.77/README.W32 Mon Mar 2 03:17:25 1998 @@ -46,6 +46,35 @@ freely available. It may be available someday, but I am not in control of this decision nor do I influence it. Sorry! +GNU make and Cygnus GNU WIN32 tools (BATCH_MODE_ONLY_SHELL) + + GNU make now has support for the Cygnus GNU WIN32 toolset. The + GNU WIN32 version of Bourne shell does not behave well when + invoked as 'sh -c' from CreateProcess(). The main problem is it + seems to have a hard time handling quoted strings correctly. This + problem goes away when invoking the Cygnus shell on a shell script. + + To work around this difficulty, this version of make supports + a new batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile + time, make forces all command lines to be executed via script + files instead of by command line. + + A native WIN32 system with no Bourne shell will also run + in batch mode. All command lines will be put into batch files + and executed via $(COMSPEC) (%COMSPEC%). + + If you wish to use Cygnus' GNUWIN32 shell, be sure you define + BATCH_MODE_ONLY_SHELL in the config.h.W32 prior to building make. + The new feataure was tested with the b18 version of the Cygnus + user tools. + +GNU make and MKS shell + + There is now semi-official support for the MKS shell. To turn this + support on, define HAVE_MKS_SHELL in the config.h.W32 before you + build make. Do not define BATCH_MODE_ONLY_SHELL if you turn + on HAVE_MKS_SHELL. + GNU make handling of drive letters in pathnames (PATH, vpath, VPATH): There is a caveat that should be noted with respect to handling @@ -126,6 +155,38 @@ If you are unhappy with this choice, this is free software and you are free to take a crack at making this work. The code in w32/pathstuff.c and vpath.c would be the places to start. + +Pathnames and Case insensitivity: + + Unlike Unix, Windows 95/NT systems are case insensitive but case + preserving. For example if you tell the file system to create a + file named "Target", it will preserve the case. Subsequent access to + the file with other case permutations will succeed (i.e. opening a + file named "target" or "TARGET" will open the file "Target"). + + By default, GNU make retains its case sensitivity when comparing + target names and existing files or directories. It can be + configured, however, into a case preserving and case insensitive + mode by adding a define for HAVE_CASE_INSENSITIVE_FS to + config.h.W32. + + For example, the following makefile will create a file named + Target in the directory subdir which will subsequently be used + to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET. + Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link + will not be made: + + subdir/Target: + touch $@ + + SUBDIR/DepTarget: SubDir/TARGET + cp $^ $@ + + Reliance on this behavior also eliminates the ability of GNU make + to use case in comparison of matching rules. For example, it is + not possible to set up a C++ rule using %.C that is different + than a C rule using %.c. GNU make will consider these to be the + same rule and will issue a warning. SAMBA/NTFS/VFAT: diff -uPr make-3.76.1/README.customs make-3.77/README.customs --- make-3.76.1/README.customs Wed Dec 31 19:00:00 1969 +++ make-3.77/README.customs Mon Jul 6 12:27:15 1998 @@ -0,0 +1,73 @@ + -*-indented-text-*- + +GNU make can utilize the Customs library, distributed with Pmake, to +provide builds distributed across multiple hosts. + +In order to utilize this capability, you must first download and build +the Customs library. It is contained in the Pmake distribution, which +can be obtained at: + + ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/ + +This integration was tested (superficially) with Pmake 2.1.33. + + +BUILDING CUSTOMS +---------------- + +First, build pmake and Customs. You need to build pmake first, because +Customs require pmake to build. Unfortunately, this is not trivial; +please see the pmake and Customs documentation for details. The best +place to look for instructions is in the pmake-2.1.33/INSTALL file. + +Note that the 2.1.33 Pmake distribution comes with a set of patches to +GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These +patches are based on GNU make 3.75 (there are patches for earlier +versions of GNU make, also). The parts of this patchfile which relate +directly to Customs support have already been incorporated into this +version of GNU make, so you should _NOT_ apply the patch file. + +However, there are a few non-Customs specific (as far as I could tell) +changes here which are not incorporated (for example, the modification +to try expanding -lfoo to libfoo.so). If you rely on these changes +you'll need to re-apply them by hand. + +Install the Customs library and header files according to the +documentation. You should also install the man pages (contrary to +comments in the documentation, they weren't installed automatically for +me; I had to cd to the ``pmake-2.1.33/doc'' directory and run ``pmake +install'' there directly). + + +BUILDING GNU MAKE +----------------- + +Once you've installed Customs, you can build GNU make to use it. When +configuring GNU make, merely use the ``--with-customs=DIR'' option. +Provide the directory containing the ``lib'' and ``include/customs'' +subdirectories as DIR. For example, if you installed the customs +library in /usr/local/lib and the headers in /usr/local/include/customs, +then you'd pass ``--with-customs=/usr/local'' as an option to configure. + +Run make (or use build.sh) normally to build GNU make as described in +the INSTALL file. + +See the documentation for Customs for information on starting and +configuring Customs. + + +PROBLEMS +-------- + +SunOS 4.1.x: + The customs/sprite.h header file #includes the header + files; this conflicts with GNU make's configuration so you'll get a + compile error if you use GCC (or any other ANSI-capable C compiler). + + I commented out the #include in sprite.h:107: + + #if defined(sun) || defined(ultrix) || defined(hpux) || defined(sgi) + /* #include */ + #else + + YMMV. diff -uPr make-3.76.1/SMakefile make-3.77/SMakefile --- make-3.76.1/SMakefile Fri Sep 19 10:19:30 1997 +++ make-3.77/SMakefile Wed Jul 29 22:38:40 1998 @@ -211,66 +211,42 @@ smake $@ < -# The automatically generated dependencies below may omit config.h -# because it is included with ``#include '' rather than -# ``#include "config.h"''. So we add the explicit dependency to make sure. -$(objs): config.h - -# Automatically generated dependencies will be put at the end of the file. - -# Automatically generated dependencies. -commands.o: commands.c make.h dep.h filedef.h variable.h job.h \ - commands.h - -job.o: job.c make.h job.h filedef.h commands.h variable.h - -dir.o: dir.c make.h - -file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h - -misc.o: misc.c make.h dep.h - -main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \ - getopt.h - -read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \ - glob/glob.h - -remake.o: remake.c make.h filedef.h job.h commands.h dep.h - -rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \ - rule.h - -implicit.o: implicit.c make.h rule.h dep.h filedef.h - -default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \ - variable.h - -variable.o: variable.c make.h dep.h filedef.h job.h commands.h \ - variable.h - -expand.o: expand.c make.h filedef.h job.h commands.h variable.h - -function.o: function.c make.h filedef.h variable.h dep.h job.h \ - commands.h amiga.h - -vpath.o: vpath.c make.h filedef.h variable.h - -version.o: version.c - -ar.o: ar.c make.h filedef.h dep.h - -arscan.o: arscan.c make.h - -signame.o: signame.c signame.h - -remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h - -getopt.o: getopt.c - -getopt1.o : getopt1.c getopt.h - -getloadavg.o: getloadavg.c - -amiga.o: amiga.c make.h variable.h amiga.h +# --------------- DEPENDENCIES +# +alloca.o: alloca.c config.h +ar.o: ar.c make.h config.h signame.h filedef.h dep.h glob/fnmatch.h +arscan.o: arscan.c make.h config.h signame.h +commands.o: commands.c make.h config.h signame.h dep.h filedef.h \ + variable.h job.h commands.h +default.o: default.c make.h config.h signame.h rule.h dep.h filedef.h \ + job.h commands.h variable.h +dir.o: dir.c make.h config.h signame.h glob/glob.h +expand.o: expand.c make.h config.h signame.h filedef.h job.h commands.h \ + variable.h rule.h +file.o: file.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +function.o: function.c make.h config.h signame.h filedef.h variable.h \ + dep.h job.h commands.h +getloadavg.o: getloadavg.c config.h +getopt.o: getopt.c config.h getopt.h +getopt1.o: getopt1.c config.h getopt.h +implicit.o: implicit.c make.h config.h signame.h rule.h dep.h filedef.h +job.o: job.c make.h config.h signame.h job.h filedef.h commands.h \ + variable.h +main.o: main.c make.h config.h signame.h dep.h filedef.h variable.h \ + job.h commands.h getopt.h +misc.o: misc.c make.h config.h signame.h dep.h +read.o: read.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h glob/glob.h +remake.o: remake.c make.h config.h signame.h filedef.h job.h commands.h \ + dep.h +remote-stub.o: remote-stub.c make.h config.h signame.h filedef.h job.h \ + commands.h +rule.o: rule.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h rule.h +signame.o: signame.c config.h signame.h +variable.o: variable.c make.h config.h signame.h dep.h filedef.h job.h \ + commands.h variable.h +version.o: version.c config.h +vpath.o: vpath.c make.h config.h signame.h filedef.h variable.h diff -uPr make-3.76.1/acinclude.m4 make-3.77/acinclude.m4 --- make-3.76.1/acinclude.m4 Wed Dec 31 19:00:00 1969 +++ make-3.77/acinclude.m4 Wed Jul 15 13:55:21 1998 @@ -0,0 +1,131 @@ +dnl acinclude.m4 -- Extra macros needed for GNU make. +dnl +dnl Automake will incorporate this into its generated aclocal.m4. + +dnl --------------------------------------------------------------------------- +dnl Got this from the lynx 2.8 distribution. +dnl by T.E.Dickey +dnl and Jim Spath +dnl and Philippe De Muyter +dnl +dnl Created: 1997/1/28 +dnl Updated: 1997/12/23 +dnl --------------------------------------------------------------------------- +dnl After checking for functions in the default $LIBS, make a further check +dnl for the functions that are netlib-related (these aren't always in the +dnl libc, etc., and have to be handled specially because there are conflicting +dnl and broken implementations. +dnl Common library requirements (in order): +dnl -lresolv -lsocket -lnsl +dnl -lnsl -lsocket +dnl -lsocket +dnl -lbsd +AC_DEFUN([CF_NETLIBS],[ +cf_test_netlibs=no +AC_MSG_CHECKING(for network libraries) +AC_CACHE_VAL(cf_cv_netlibs,[ +AC_MSG_RESULT(working...) +cf_cv_netlibs="" +cf_test_netlibs=yes +AC_CHECK_FUNCS(gethostname,,[ + CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[ + CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])]) +# +# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but +# I don't know the entrypoints - 97/7/22 TD +AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs") +# +if test "$ac_cv_func_lsocket" != no ; then +AC_CHECK_FUNCS(socket,,[ + CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[ + CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])]) +fi +# +AC_CHECK_FUNCS(gethostbyname,,[ + CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)]) +# +AC_CHECK_FUNCS(strcasecmp,,[ + CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)]) +]) +LIBS="$LIBS $cf_cv_netlibs" +test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG +])dnl +dnl --------------------------------------------------------------------------- +dnl Re-check on a function to see if we can pick it up by adding a library. +dnl $1 = function to check +dnl $2 = library to check in +dnl $3 = environment to update (e.g., $LIBS) +dnl $4 = what to do if this fails +dnl +dnl This uses 'unset' if the shell happens to support it, but leaves the +dnl configuration variable set to 'unknown' if not. This is a little better +dnl than the normal autoconf test, which gives misleading results if a test +dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is +dnl used (autoconf does not distinguish between a null token and one that is +dnl set to 'no'). +AC_DEFUN([CF_RECHECK_FUNC],[ +AC_CHECK_LIB($2,$1,[ + CF_UPPER(cf_tr_func,$1) + AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func) + ac_cv_func_$1=yes + $3="-l$2 [$]$3"],[ + ac_cv_func_$1=unknown + unset ac_cv_func_$1 2>/dev/null + $4], + [[$]$3]) +])dnl +dnl --------------------------------------------------------------------------- +dnl Make an uppercase version of a variable +dnl $1=uppercase($2) +AC_DEFUN([CF_UPPER], +[ +changequote(,)dnl +$1=`echo $2 | tr '[a-z]' '[A-Z]'` +changequote([,])dnl +])dnl + +dnl --------------------------------------------------------------------------- +dnl Got this from the GNU fileutils 3.16r distribution +dnl by Paul Eggert +dnl --------------------------------------------------------------------------- + +dnl The problem is that the default compilation flags in Solaris 2.6 won't +dnl let programs access large files; you need to tell the compiler that +dnl you actually want your programs to work on large files. For more +dnl details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +AC_DEFUN(AC_LFS, +[dnl + # If available, prefer support for large files unless the user specified + # one of the CPPFLAGS, LDFLAGS, or LIBS variables. + AC_MSG_CHECKING(whether large file support needs explicit enabling) + ac_getconfs='' + ac_result=yes + ac_set='' + ac_shellvars='CPPFLAGS LDFLAGS LIBS' + for ac_shellvar in $ac_shellvars; do + case $ac_shellvar in + CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; + *) ac_lfsvar=LFS_$ac_shellvar ;; + esac + eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar + (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } + ac_getconf=`getconf $ac_lfsvar` + ac_getconfs=$ac_getconfs$ac_getconf + eval ac_test_$ac_shellvar=\$ac_getconf + done + case "$ac_result$ac_getconfs" in + yes) ac_result=no ;; + esac + case "$ac_result$ac_set" in + yes?*) ac_result="yes, but $ac_set is already set, so use its settings" + esac + AC_MSG_RESULT($ac_result) + case $ac_result in + yes) + for ac_shellvar in $ac_shellvars; do + eval $ac_shellvar=\$ac_test_$ac_shellvar + done ;; + esac +]) diff -uPr make-3.76.1/aclocal.m4 make-3.77/aclocal.m4 --- make-3.76.1/aclocal.m4 Fri Sep 19 14:37:03 1997 +++ make-3.77/aclocal.m4 Wed Jul 29 22:32:36 1998 @@ -1,4 +1,146 @@ -dnl aclocal.m4 generated automatically by aclocal 1.2 +dnl aclocal.m4 generated automatically by aclocal 1.3 + +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl acinclude.m4 -- Extra macros needed for GNU make. +dnl +dnl Automake will incorporate this into its generated aclocal.m4. + +dnl --------------------------------------------------------------------------- +dnl Got this from the lynx 2.8 distribution. +dnl by T.E.Dickey +dnl and Jim Spath +dnl and Philippe De Muyter +dnl +dnl Created: 1997/1/28 +dnl Updated: 1997/12/23 +dnl --------------------------------------------------------------------------- +dnl After checking for functions in the default $LIBS, make a further check +dnl for the functions that are netlib-related (these aren't always in the +dnl libc, etc., and have to be handled specially because there are conflicting +dnl and broken implementations. +dnl Common library requirements (in order): +dnl -lresolv -lsocket -lnsl +dnl -lnsl -lsocket +dnl -lsocket +dnl -lbsd +AC_DEFUN([CF_NETLIBS],[ +cf_test_netlibs=no +AC_MSG_CHECKING(for network libraries) +AC_CACHE_VAL(cf_cv_netlibs,[ +AC_MSG_RESULT(working...) +cf_cv_netlibs="" +cf_test_netlibs=yes +AC_CHECK_FUNCS(gethostname,,[ + CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[ + CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])]) +# +# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but +# I don't know the entrypoints - 97/7/22 TD +AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs") +# +if test "$ac_cv_func_lsocket" != no ; then +AC_CHECK_FUNCS(socket,,[ + CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[ + CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])]) +fi +# +AC_CHECK_FUNCS(gethostbyname,,[ + CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)]) +# +AC_CHECK_FUNCS(strcasecmp,,[ + CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)]) +]) +LIBS="$LIBS $cf_cv_netlibs" +test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG +])dnl +dnl --------------------------------------------------------------------------- +dnl Re-check on a function to see if we can pick it up by adding a library. +dnl $1 = function to check +dnl $2 = library to check in +dnl $3 = environment to update (e.g., $LIBS) +dnl $4 = what to do if this fails +dnl +dnl This uses 'unset' if the shell happens to support it, but leaves the +dnl configuration variable set to 'unknown' if not. This is a little better +dnl than the normal autoconf test, which gives misleading results if a test +dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is +dnl used (autoconf does not distinguish between a null token and one that is +dnl set to 'no'). +AC_DEFUN([CF_RECHECK_FUNC],[ +AC_CHECK_LIB($2,$1,[ + CF_UPPER(cf_tr_func,$1) + AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func) + ac_cv_func_$1=yes + $3="-l$2 [$]$3"],[ + ac_cv_func_$1=unknown + unset ac_cv_func_$1 2>/dev/null + $4], + [[$]$3]) +])dnl +dnl --------------------------------------------------------------------------- +dnl Make an uppercase version of a variable +dnl $1=uppercase($2) +AC_DEFUN([CF_UPPER], +[ +changequote(,)dnl +$1=`echo $2 | tr '[a-z]' '[A-Z]'` +changequote([,])dnl +])dnl + +dnl --------------------------------------------------------------------------- +dnl Got this from the GNU fileutils 3.16r distribution +dnl by Paul Eggert +dnl --------------------------------------------------------------------------- + +dnl The problem is that the default compilation flags in Solaris 2.6 won't +dnl let programs access large files; you need to tell the compiler that +dnl you actually want your programs to work on large files. For more +dnl details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +AC_DEFUN(AC_LFS, +[dnl + # If available, prefer support for large files unless the user specified + # one of the CPPFLAGS, LDFLAGS, or LIBS variables. + AC_MSG_CHECKING(whether large file support needs explicit enabling) + ac_getconfs='' + ac_result=yes + ac_set='' + ac_shellvars='CPPFLAGS LDFLAGS LIBS' + for ac_shellvar in $ac_shellvars; do + case $ac_shellvar in + CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; + *) ac_lfsvar=LFS_$ac_shellvar ;; + esac + eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar + (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } + ac_getconf=`getconf $ac_lfsvar` + ac_getconfs=$ac_getconfs$ac_getconf + eval ac_test_$ac_shellvar=\$ac_getconf + done + case "$ac_result$ac_getconfs" in + yes) ac_result=no ;; + esac + case "$ac_result$ac_set" in + yes?*) ac_result="yes, but $ac_set is already set, so use its settings" + esac + AC_MSG_RESULT($ac_result) + case $ac_result in + yes) + for ac_shellvar in $ac_shellvars; do + eval $ac_shellvar=\$ac_test_$ac_shellvar + done ;; + esac +]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. @@ -22,8 +164,8 @@ ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) -AM_SANITY_CHECK -AC_ARG_PROGRAM +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) @@ -31,7 +173,7 @@ AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_PROG_MAKE_SET]) +AC_REQUIRE([AC_PROG_MAKE_SET])]) # serial 1 @@ -58,10 +200,21 @@ # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$@" = "X"; then + if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + test "[$]2" = conftestfile ) then diff -uPr make-3.76.1/arscan.c make-3.77/arscan.c --- make-3.76.1/arscan.c Wed Aug 27 16:31:04 1997 +++ make-3.77/arscan.c Tue Jun 9 01:32:10 1998 @@ -600,15 +600,12 @@ abort (); #else struct ar_hdr hdr; - return !strncmp (name, mem, - sizeof (hdr.ar_name) - #if !defined (__hpux) && !defined (cray) - 1 + return !strncmp (name, mem, sizeof(hdr.ar_name) - 1); #else - 2 + return !strncmp (name, mem, sizeof(hdr.ar_name) - 2); #endif /* !__hpux && !cray */ - ); -#endif +#endif /* !AIAMAG */ } #endif /* !VMS */ diff -uPr make-3.76.1/config.ami make-3.77/config.ami --- make-3.76.1/config.ami Fri Sep 19 14:40:51 1997 +++ make-3.77/config.ami Wed Jul 29 22:38:40 1998 @@ -166,7 +166,7 @@ #define PACKAGE "make" /* Version of this package (needed by automake) */ -#define VERSION "3.76.1" +#define VERSION "3.77" /* Define to the name of the SCCS `get' command. */ #define SCCS_GET "get" @@ -278,3 +278,6 @@ /* Define if you have the sun library (-lsun). */ #undef HAVE_LIBSUN + +/* Define for Case Insensitve behavior */ +#define HAVE_CASE_INSENSITIVE_FS diff -uPr make-3.76.1/config.h-vms make-3.77/config.h-vms --- make-3.76.1/config.h-vms Fri Sep 19 14:40:53 1997 +++ make-3.77/config.h-vms Wed Jul 29 22:38:42 1998 @@ -166,7 +166,7 @@ #define PACKAGE "make" /* Version of this package (needed by automake) */ -#define VERSION "3.76.1" +#define VERSION "3.77" /* Define vfork as fork if vfork does not work. */ /* #undef vfork */ diff -uPr make-3.76.1/config.h.W32 make-3.77/config.h.W32 --- make-3.76.1/config.h.W32 Fri Sep 19 14:40:52 1997 +++ make-3.77/config.h.W32 Wed Jul 29 22:38:41 1998 @@ -29,7 +29,7 @@ /* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA -#define HAVE_ALLOCA +#define HAVE_ALLOCA 1 /* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H @@ -52,7 +52,7 @@ /* Define if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES -#define HAVE_LONG_FILE_NAMES +#define HAVE_LONG_FILE_NAMES 1 /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP @@ -69,15 +69,15 @@ /* Define if you have the strcoll function and it is properly defined. */ #undef HAVE_STRCOLL -#define HAVE_STRCOLL +#define HAVE_STRCOLL 1 /* Define if your struct stat has st_rdev. */ #undef HAVE_ST_RDEV -#define HAVE_ST_RDEV +#define HAVE_ST_RDEV 1 /* Define if you have the strftime function. */ #undef HAVE_STRFTIME -#define HAVE_STRFTIME +#define HAVE_STRFTIME 1 /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H @@ -88,21 +88,21 @@ /* Define if you don't have tm_zone but do have the external array tzname. */ #undef HAVE_TZNAME -#define HAVE_TZNAME +#define HAVE_TZNAME 1 /* Define if you have . */ #undef HAVE_UNISTD_H /* Define if utime(file, NULL) sets file's timestamp to the present. */ #undef HAVE_UTIME_NULL -#define HAVE_UTIME_NULL +#define HAVE_UTIME_NULL 1 /* Define if you have . */ #undef HAVE_VFORK_H /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF -#define HAVE_VPRINTF +#define HAVE_VPRINTF 1 /* Define if you have the wait3 system call. */ #undef HAVE_WAIT3 @@ -129,7 +129,7 @@ /* Define if you need to in order for stat and other things to work. */ #undef _POSIX_SOURCE -#define _POSIX_SOURCE +#define _POSIX_SOURCE 1 /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE @@ -154,7 +154,7 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS -#define STDC_HEADERS +#define STDC_HEADERS 1 /* Define on System V Release 4. */ #undef SVR4 @@ -180,7 +180,7 @@ #define PACKAGE "make" /* Version of this package (needed by automake) */ -#define VERSION "3.76.1" +#define VERSION "3.77" /* Define to the name of the SCCS `get' command. */ #undef SCCS_GET @@ -200,18 +200,18 @@ /* Define if you have the dup2 function. */ #undef HAVE_DUP2 -#define HAVE_DUP2 +#define HAVE_DUP2 1 /* Define if you have the getcwd function. */ #undef HAVE_GETCWD -#define HAVE_GETCWD +#define HAVE_GETCWD 1 /* Define if you have the getgroups function. */ #undef HAVE_GETGROUPS /* Define if you have the mktemp function. */ #undef HAVE_MKTEMP -#define HAVE_MKTEMP +#define HAVE_MKTEMP 1 /* Define if you have the psignal function. */ #undef HAVE_PSIGNAL @@ -236,7 +236,7 @@ /* Define if you have the strerror function. */ #undef HAVE_STRERROR -#define HAVE_STRERROR +#define HAVE_STRERROR 1 /* Define if you have the strsignal function. */ #undef HAVE_STRSIGNAL @@ -249,29 +249,29 @@ /* Define if you have the header file. */ #undef HAVE_DIRENT_H -#define HAVE_DIRENT_H +#define HAVE_DIRENT_H 1 /* Define if you have the header file. */ #undef HAVE_FCNTL_H -#define HAVE_FCNTL_H +#define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #undef HAVE_LIMITS_H -#define HAVE_LIMITS_H +#define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #undef HAVE_MACH_MACH_H /* Define if you have the header file. */ #undef HAVE_MEMORY_H -#define HAVE_MEMORY_H +#define HAVE_MEMORY_H 1 /* Define if you have the header file. */ #undef HAVE_NDIR_H /* Define if you have the header file. */ #undef HAVE_STRING_H -#define HAVE_STRING_H +#define HAVE_STRING_H 1 /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H @@ -284,7 +284,7 @@ /* Define if you have the header file. */ #undef HAVE_SYS_TIMEB_H -#define HAVE_SYS_TIMEB_H +#define HAVE_SYS_TIMEB_H 1 /* Define if you have the header file. */ #undef HAVE_SYS_WAIT_H @@ -297,3 +297,22 @@ /* Define if you have the sun library (-lsun). */ #undef HAVE_LIBSUN + +/* + * Refer to README.W32 for info on the following settings + */ + +/* + Define if you have the Cygnus GNU WIN32 tool set or a shell + that does not grok 'sh -c quoted-command-line' correctly. + */ +#undef BATCH_MODE_ONLY_SHELL + +/* + Define if you have the MKS tool set or shell. Do NOT define + BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL + */ +#undef HAVE_MKS_SHELL + +/* Define if you prefer Case Insensitve behavior */ +#undef HAVE_CASE_INSENSITIVE_FS diff -uPr make-3.76.1/config.h.in make-3.77/config.h.in --- make-3.76.1/config.h.in Fri Sep 19 14:37:09 1997 +++ make-3.77/config.h.in Wed Jul 29 22:32:46 1998 @@ -191,6 +191,12 @@ /* Define if you have the getgroups function. */ #undef HAVE_GETGROUPS +/* Define if you have the gethostbyname function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define if you have the gethostname function. */ +#undef HAVE_GETHOSTNAME + /* Define if you have the getloadavg function. */ #undef HAVE_GETLOADAVG @@ -223,6 +229,12 @@ /* Define if you have the sigsetmask function. */ #undef HAVE_SIGSETMASK + +/* Define if you have the socket function. */ +#undef HAVE_SOCKET + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP /* Define if you have the strerror function. */ #undef HAVE_STRERROR diff -uPr make-3.76.1/configh.dos make-3.77/configh.dos --- make-3.76.1/configh.dos Fri Sep 19 14:40:52 1997 +++ make-3.77/configh.dos Wed Jul 29 22:38:41 1998 @@ -7,7 +7,7 @@ #define PACKAGE "make" /* Version of this package (needed by automake) */ -#define VERSION "3.76.1" +#define VERSION "3.77" /* Define NSIG. */ #define NSIG SIGMAX diff -uPr make-3.76.1/configure make-3.77/configure --- make-3.76.1/configure Fri Sep 19 14:37:14 1997 +++ make-3.77/configure Wed Jul 29 22:32:49 1998 @@ -2,6 +2,14 @@ # From configure.in Id: configure.in,v 1.58 1997/09/16 14:17:28 psmith Exp + + + + + + + + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. @@ -44,7 +52,7 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help -export jobs with the Customs daemon (NOT SUPPORTED)" + --with-customs=DIR Enable remote jobs via Customs--see README.customs" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -582,7 +590,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:586: checking for a BSD compatible install" >&5 +echo "configure:594: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -634,24 +642,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -PACKAGE=make - -VERSION=3.76.1 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:655: checking whether build environment is sane" >&5 +echo "configure:647: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -662,10 +654,21 @@ # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "" = "X"; then + if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + test "$2" = conftestfile ) then @@ -696,9 +699,54 @@ # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:704: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=make + +VERSION=3.77 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 -echo "configure:702: checking for working aclocal" >&5 +echo "configure:750: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -711,7 +759,7 @@ fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:715: checking for working autoconf" >&5 +echo "configure:763: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -724,7 +772,7 @@ fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:728: checking for working automake" >&5 +echo "configure:776: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -737,7 +785,7 @@ fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:741: checking for working autoheader" >&5 +echo "configure:789: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -750,7 +798,7 @@ fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:754: checking for working makeinfo" >&5 +echo "configure:802: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -762,32 +810,6 @@ echo "$ac_t""missing" 1>&6 fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:767: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi @@ -807,7 +829,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:811: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:833: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -836,7 +858,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:840: checking for $ac_word" >&5 +echo "configure:862: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -865,7 +887,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:869: checking for $ac_word" >&5 +echo "configure:891: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -913,7 +935,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:917: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -923,11 +945,11 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -947,12 +969,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:951: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:973: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:956: checking whether we are using GNU C" >&5 +echo "configure:978: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -961,7 +983,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -976,7 +998,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:980: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1002: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1014,7 +1036,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1018: checking for a BSD compatible install" >&5 +echo "configure:1040: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1064,7 +1086,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1068: checking how to run the C preprocessor" >&5 +echo "configure:1090: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1079,13 +1101,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1096,13 +1118,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1123,29 +1145,10 @@ ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 - if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1147: checking for AIX" >&5 + echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1150: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:1171: checking for POSIXized ISC" >&5 +echo "configure:1174: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1189,17 +1192,17 @@ ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 -echo "configure:1193: checking for minix/config.h" >&5 +echo "configure:1196: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1236,13 +1239,48 @@ fi + + # If available, prefer support for large files unless the user specified + # one of the CPPFLAGS, LDFLAGS, or LIBS variables. + echo $ac_n "checking whether large file support needs explicit enabling""... $ac_c" 1>&6 +echo "configure:1247: checking whether large file support needs explicit enabling" >&5 + ac_getconfs='' + ac_result=yes + ac_set='' + ac_shellvars='CPPFLAGS LDFLAGS LIBS' + for ac_shellvar in $ac_shellvars; do + case $ac_shellvar in + CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; + *) ac_lfsvar=LFS_$ac_shellvar ;; + esac + eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar + (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } + ac_getconf=`getconf $ac_lfsvar` + ac_getconfs=$ac_getconfs$ac_getconf + eval ac_test_$ac_shellvar=\$ac_getconf + done + case "$ac_result$ac_getconfs" in + yes) ac_result=no ;; + esac + case "$ac_result$ac_set" in + yes?*) ac_result="yes, but $ac_set is already set, so use its settings" + esac + echo "$ac_t""$ac_result" 1>&6 + case $ac_result in + yes) + for ac_shellvar in $ac_shellvars; do + eval $ac_shellvar=\$ac_test_$ac_shellvar + done ;; + esac + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1241: checking for ANSI C header files" >&5 +echo "configure:1279: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1250,7 +1288,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1267,7 +1305,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1285,7 +1323,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1306,7 +1344,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1317,7 +1355,7 @@ exit (0); } EOF -if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1345,12 +1383,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1349: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1387: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1358,7 +1396,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1383,7 +1421,7 @@ # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1387: checking for opendir in -ldir" >&5 +echo "configure:1425: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1391,7 +1429,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1424,7 +1462,7 @@ else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1428: checking for opendir in -lx" >&5 +echo "configure:1466: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1432,7 +1470,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1466,12 +1504,12 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:1470: checking for uid_t in sys/types.h" >&5 +echo "configure:1508: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1499,12 +1537,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1503: checking for pid_t" >&5 +echo "configure:1541: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1532,12 +1570,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1536: checking return type of signal handlers" >&5 +echo "configure:1574: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1554,7 +1592,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1577,17 +1615,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1581: checking for $ac_hdr" >&5 +echo "configure:1619: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1615,10 +1653,10 @@ if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1619: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1657: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1622: checking whether cc understands -c and -o together" >&5 +echo "configure:1660: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1630,16 +1668,16 @@ # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1666,12 +1704,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1670: checking for working const" >&5 +echo "configure:1708: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1740,12 +1778,12 @@ fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:1744: checking whether stat file-mode macros are broken" >&5 +echo "configure:1782: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1804,12 +1842,12 @@ seteuid setegid setreuid setregid strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1808: checking for $ac_func" >&5 +echo "configure:1846: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1857,19 +1895,19 @@ done echo $ac_n "checking for sys_siglist""... $ac_c" 1>&6 -echo "configure:1861: checking for sys_siglist" >&5 +echo "configure:1899: checking for sys_siglist" >&5 if eval "test \"`echo '$''{'ac_cv_check_symbol_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_check_symbol_sys_siglist=yes else @@ -1892,19 +1930,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1896: checking for working alloca.h" >&5 +echo "configure:1934: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1925,12 +1963,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1929: checking for alloca" >&5 +echo "configure:1967: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1985,12 +2023,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1989: checking whether alloca needs Cray hooks" >&5 +echo "configure:2027: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:2019: checking for $ac_func" >&5 +echo "configure:2057: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2070,7 +2108,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2074: checking stack direction for C alloca" >&5 +echo "configure:2112: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2078,7 +2116,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2120,17 +2158,17 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2124: checking for vfork.h" >&5 +echo "configure:2162: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2155,18 +2193,18 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2159: checking for working vfork" >&5 +echo "configure:2197: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2165: checking for vfork" >&5 +echo "configure:2203: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2210,7 +2248,7 @@ else cat > conftest.$ac_ext < @@ -2305,7 +2343,7 @@ } } EOF -if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2328,7 +2366,7 @@ fi echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -echo "configure:2332: checking whether setvbuf arguments are reversed" >&5 +echo "configure:2370: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2336,7 +2374,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < /* If setvbuf has the reversed format, exit 0. */ @@ -2350,7 +2388,7 @@ exit(0); /* Non-reversed systems segv here. */ } EOF -if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes else @@ -2379,7 +2417,7 @@ # On Solaris, -lkvm requires nlist from -lelf, so check that first # to get the right answer into the cache. echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6 -echo "configure:2383: checking for elf_begin in -lelf" >&5 +echo "configure:2421: checking for elf_begin in -lelf" >&5 ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2387,7 +2425,7 @@ ac_save_LIBS="$LIBS" LIBS="-lelf $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2419,7 +2457,7 @@ fi echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6 -echo "configure:2423: checking for kvm_open in -lkvm" >&5 +echo "configure:2461: checking for kvm_open in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2427,7 +2465,7 @@ ac_save_LIBS="$LIBS" LIBS="-lkvm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2460,7 +2498,7 @@ # Check for the 4.4BSD definition of getloadavg. echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6 -echo "configure:2464: checking for getloadavg in -lutil" >&5 +echo "configure:2502: checking for getloadavg in -lutil" >&5 ac_lib_var=`echo util'_'getloadavg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2468,7 +2506,7 @@ ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2505,7 +2543,7 @@ # Since it is not a standard part of AIX, it might be installed locally. ac_getloadavg_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" echo $ac_n "checking for getloadavg in -lgetloadavg""... $ac_c" 1>&6 -echo "configure:2509: checking for getloadavg in -lgetloadavg" >&5 +echo "configure:2547: checking for getloadavg in -lgetloadavg" >&5 ac_lib_var=`echo getloadavg'_'getloadavg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2513,7 +2551,7 @@ ac_save_LIBS="$LIBS" LIBS="-lgetloadavg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2551,12 +2589,12 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2555: checking for $ac_func" >&5 +echo "configure:2593: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2617,17 +2655,17 @@ ac_have_func=no ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6 -echo "configure:2621: checking for sys/dg_sys_info.h" >&5 +echo "configure:2659: checking for sys/dg_sys_info.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2648,7 +2686,7 @@ EOF echo $ac_n "checking for dg_sys_info in -ldgc""... $ac_c" 1>&6 -echo "configure:2652: checking for dg_sys_info in -ldgc" >&5 +echo "configure:2690: checking for dg_sys_info in -ldgc" >&5 ac_lib_var=`echo dgc'_'dg_sys_info | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2656,7 +2694,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldgc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2712,17 +2750,17 @@ if test $ac_have_func = no; then ac_safe=`echo "inq_stats/cpustats.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6 -echo "configure:2716: checking for inq_stats/cpustats.h" >&5 +echo "configure:2754: checking for inq_stats/cpustats.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2755,17 +2793,17 @@ if test $ac_have_func = no; then ac_safe=`echo "sys/cpustats.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6 -echo "configure:2759: checking for sys/cpustats.h" >&5 +echo "configure:2797: checking for sys/cpustats.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2796,17 +2834,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2800: checking for $ac_hdr" >&5 +echo "configure:2838: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2836,17 +2874,17 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:2840: checking for nlist.h" >&5 +echo "configure:2878: checking for nlist.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2867,19 +2905,19 @@ EOF echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6 -echo "configure:2871: checking for n_un in struct nlist" >&5 +echo "configure:2909: checking for n_un in struct nlist" >&5 if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct nlist n; n.n_un.n_name = 0; ; return 0; } EOF -if { (eval echo configure:2883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_nlist_n_un=yes else @@ -2906,12 +2944,12 @@ # Some definitions of getloadavg require that the program be installed setgid. echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6 -echo "configure:2910: checking whether getloadavg requires setgid" >&5 +echo "configure:2948: checking whether getloadavg requires setgid" >&5 if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:2946: checking group of /dev/kmem" >&5 +echo "configure:2984: checking group of /dev/kmem" >&5 if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2962,7 +3000,7 @@ fi echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:2966: checking for kstat_open in -lkstat" >&5 +echo "configure:3004: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2970,7 +3008,7 @@ ac_save_LIBS="$LIBS" LIBS="-lkstat $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3009,7 +3047,7 @@ fi echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:3013: checking for working strcoll" >&5 +echo "configure:3051: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3017,7 +3055,7 @@ ac_cv_func_strcoll_works=no else cat > conftest.$ac_ext < main () @@ -3027,7 +3065,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes else @@ -3055,17 +3093,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3059: checking for $ac_hdr" >&5 +echo "configure:3097: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3093,12 +3131,12 @@ for ac_func in waitpid wait3 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3097: checking for $ac_func" >&5 +echo "configure:3135: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3146,12 +3184,12 @@ done echo $ac_n "checking for union wait""... $ac_c" 1>&6 -echo "configure:3150: checking for union wait" >&5 +echo "configure:3188: checking for union wait" >&5 if eval "test \"`echo '$''{'make_cv_union_wait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3174,7 +3212,7 @@ ; return 0; } EOF -if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* make_cv_union_wait=yes else @@ -3195,12 +3233,12 @@ echo "$ac_t""$make_cv_union_wait" 1>&6 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3199: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3237: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3212,7 +3250,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3236,7 +3274,7 @@ # The presence of the following is not meant to imply # that make necessarily works on those systems. echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:3240: checking for getpwnam in -lsun" >&5 +echo "configure:3278: checking for getpwnam in -lsun" >&5 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3244,7 +3282,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3284,48 +3322,705 @@ REMOTE=stub +make_try_customs=no # Check whether --with-customs or --without-customs was given. if test "${with_customs+set}" = set; then withval="$with_customs" - REMOTE=cstms LIBS="$LIBS libcustoms.a" + case "$withval" in + n|no) ;; + *) make_cppflags="$CPPFLAGS" + case "$withval" in + y|ye|yes) ;; + *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs" + make_ldflags="$LDFLAGS -L$with_customs/lib" ;; + esac + +cf_test_netlibs=no +echo $ac_n "checking for network libraries""... $ac_c" 1>&6 +echo "configure:3341: checking for network libraries" >&5 +if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +echo "$ac_t""working..." 1>&6 +cf_cv_netlibs="" +cf_test_netlibs=yes +for ac_func in gethostname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3352: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 -echo checking for location of SCCS get command -if test -f /usr/sccs/get; then - SCCS_GET=/usr/sccs/get - cat >> confdefs.h <<\EOF -#define SCCS_GET "/usr/sccs/get" +echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6 +echo "configure:3403: checking for gethostname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $cf_cv_netlibs $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +cf_tr_func=`echo gethostname | tr 'a-z' 'A-Z'` + + cat >> confdefs.h <> confdefs.h <<\EOF -#define SCCS_GET "get" + echo "$ac_t""no" 1>&6 + + ac_cv_func_gethostname=unknown + unset ac_cv_func_gethostname 2>/dev/null + + +echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6 +echo "configure:3455: checking for gethostname in -lsocket" >&5 +ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $cf_cv_netlibs $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" fi -ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. -if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && - test -f s.conftest; then - # We successfully created an SCCS file. - echo checking if SCCS get command understands -G - if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 && - test -f conftoast; then - cat >> confdefs.h <<\EOF -#define SCCS_GET_MINUS_G 1 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +cf_tr_func=`echo gethostname | tr 'a-z' 'A-Z'` + + cat >> confdefs.h <&6 + + ac_cv_func_gethostname=unknown + unset ac_cv_func_gethostname 2>/dev/null + +fi + + +fi + + +fi +done + +# +# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but +# I don't know the entrypoints - 97/7/22 TD +echo $ac_n "checking for main in -linet""... $ac_c" 1>&6 +echo "configure:3518: checking for main in -linet" >&5 +ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-linet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cf_cv_netlibs="-linet $cf_cv_netlibs" +else + echo "$ac_t""no" 1>&6 fi -rm -f s.conftest conftoast -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# +if test "$ac_cv_func_lsocket" != no ; then +for ac_func in socket +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3558: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + +echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +echo "configure:3609: checking for socket in -lsocket" >&5 +ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $cf_cv_netlibs $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +cf_tr_func=`echo socket | tr 'a-z' 'A-Z'` + + cat >> confdefs.h <&6 + + ac_cv_func_socket=unknown + unset ac_cv_func_socket 2>/dev/null + + +echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6 +echo "configure:3661: checking for socket in -lbsd" >&5 +ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lbsd $cf_cv_netlibs $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +cf_tr_func=`echo socket | tr 'a-z' 'A-Z'` + + cat >> confdefs.h <&6 + + ac_cv_func_socket=unknown + unset ac_cv_func_socket 2>/dev/null + +fi + + +fi + + +fi +done + +fi +# +for ac_func in gethostbyname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3725: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + +echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:3776: checking for gethostbyname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $cf_cv_netlibs $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +cf_tr_func=`echo gethostbyname | tr 'a-z' 'A-Z'` + + cat >> confdefs.h <&6 + + ac_cv_func_gethostbyname=unknown + unset ac_cv_func_gethostbyname 2>/dev/null + +fi + + +fi +done + +# +for ac_func in strcasecmp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3836: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + +echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6 +echo "configure:3887: checking for strcasecmp in -lresolv" >&5 +ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lresolv $cf_cv_netlibs $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +cf_tr_func=`echo strcasecmp | tr 'a-z' 'A-Z'` + + cat >> confdefs.h <&6 + + ac_cv_func_strcasecmp=unknown + unset ac_cv_func_strcasecmp 2>/dev/null + +fi + + +fi +done + + +fi + +LIBS="$LIBS $cf_cv_netlibs" +test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6 + + ac_safe=`echo "customs.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for customs.h""... $ac_c" 1>&6 +echo "configure:3951: checking for customs.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + REMOTE=cstms + LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags" +else + echo "$ac_t""no" 1>&6 +with_customs=no + CPPFLAGS="$make_cppflags" make_badcust=yes +fi + + ;; +esac +fi + + +echo checking for location of SCCS get command +if test -f /usr/sccs/get; then + SCCS_GET=/usr/sccs/get + cat >> confdefs.h <<\EOF +#define SCCS_GET "/usr/sccs/get" +EOF + +else + SCCS_GET=get + cat >> confdefs.h <<\EOF +#define SCCS_GET "get" +EOF + +fi +ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. +if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && + test -f s.conftest; then + # We successfully created an SCCS file. + echo checking if SCCS get command understands -G + if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 && + test -f conftoast; then + cat >> confdefs.h <<\EOF +#define SCCS_GET_MINUS_G 1 +EOF + + fi +fi +rm -f s.conftest conftoast + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure @@ -3790,4 +4485,24 @@ done fi + +case "$make_badcust" in + yes) echo + echo "WARNING: --with-customs specified but no customs.h could be found;" + echo " disabling Customs support." + echo ;; +esac + +case "$with_customs" in + ""|n|no|y|ye|yes) ;; + *) if test -f "$with_customs/lib/libcustoms.a"; then + : + else + echo + echo "WARNING: \`$with_customs/lib' does not appear to contain the" + echo " Customs library. You must build and install Customs" + echo " before compiling GNU make." + echo + fi ;; +esac diff -uPr make-3.76.1/configure.in make-3.77/configure.in --- make-3.76.1/configure.in Fri Sep 19 10:28:37 1997 +++ make-3.77/configure.in Mon Jul 27 12:43:23 1998 @@ -3,7 +3,7 @@ AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required. AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir. -AM_INIT_AUTOMAKE(make, 3.76.1) +AM_INIT_AUTOMAKE(make, 3.77) AM_CONFIG_HEADER(config.h) AC_CONFIG_SUBDIRS(glob) @@ -15,10 +15,16 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_CPP dnl Later checks need this. -AC_ARG_PROGRAM +dnl AC_ARG_PROGRAM -- implied by AM_INIT_AUTOMAKE; gives errors if run twice. AC_AIX AC_ISC_POSIX AC_MINIX + +dnl This test must come as early as possible after the compiler configuration +dnl tests, because the choice of the file model can (in principle) affect +dnl whether functions and headers are available, whether they work, etc. +AC_LFS + AC_HEADER_STDC AC_HEADER_DIRENT AC_TYPE_UID_T dnl Also does gid_t. @@ -91,8 +97,25 @@ AC_CHECK_LIB(sun, getpwnam) AC_SUBST(REMOTE) REMOTE=stub -AC_ARG_WITH(customs, [export jobs with the Customs daemon (NOT SUPPORTED)], -[REMOTE=cstms LIBS="$LIBS libcustoms.a"]) +make_try_customs=no +AC_ARG_WITH(customs, +[ --with-customs=DIR Enable remote jobs via Customs--see README.customs], +[case "$withval" in + n|no) ;; + *) make_cppflags="$CPPFLAGS" + case "$withval" in + y|ye|yes) ;; + *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs" + make_ldflags="$LDFLAGS -L$with_customs/lib" ;; + esac + CF_NETLIBS + AC_CHECK_HEADER(customs.h, + REMOTE=cstms + LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags", + with_customs=no + CPPFLAGS="$make_cppflags" make_badcust=yes) + ;; +esac]) echo checking for location of SCCS get command if test -f /usr/sccs/get; then @@ -115,6 +138,26 @@ rm -f s.conftest conftoast AC_OUTPUT(Makefile build.sh) + +case "$make_badcust" in + yes) echo + echo "WARNING: --with-customs specified but no customs.h could be found;" + echo " disabling Customs support." + echo ;; +esac + +case "$with_customs" in + ""|n|no|y|ye|yes) ;; + *) if test -f "$with_customs/lib/libcustoms.a"; then + : + else + echo + echo "WARNING: \`$with_customs/lib' does not appear to contain the" + echo " Customs library. You must build and install Customs" + echo " before compiling GNU make." + echo + fi ;; +esac dnl Local Variables: dnl comment-start: "dnl " diff -uPr make-3.76.1/default.c make-3.77/default.c --- make-3.76.1/default.c Wed Mar 20 09:58:13 1996 +++ make-3.77/default.c Thu Jul 2 17:32:04 1998 @@ -41,7 +41,7 @@ .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \ .w .ch .cweb .web .com .sh .elc .el"; #else - = ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \ + = ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \ .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \ .w .ch .web .sh .elc .el"; #endif @@ -91,6 +91,8 @@ "$(CHECKOUT,v)" }, { "%", "RCS/%,v", "$(CHECKOUT,v)" }, + { "%", "RCS/%", + "$(CHECKOUT,v)" }, /* SCCS. */ { "%", "s.%", @@ -156,6 +158,8 @@ "$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@", ".C", "$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@", + ".cpp", + "$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@", ".f", "$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@", ".p", @@ -183,6 +187,8 @@ "$(COMPILE.cc) $< $(OUTPUT_OPTION)", ".C.o", "$(COMPILE.C) $< $(OUTPUT_OPTION)", + ".cpp.o", + "$(COMPILE.cpp) $< $(OUTPUT_OPTION)", ".f.o", "$(COMPILE.f) $< $(OUTPUT_OPTION)", ".p.o", @@ -386,8 +392,10 @@ "LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", "COMPILE.C", "$(COMPILE.cc)", + "COMPILE.cpp", "$(COMPILE.cc)", "LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", "LINK.C", "$(LINK.cc)", + "LINK.cpp", "$(LINK.cc)", "YACC.y", "$(YACC) $(YFLAGS)", "LEX.l", "$(LEX) $(LFLAGS) -t", "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c", diff -uPr make-3.76.1/dir.c make-3.77/dir.c --- make-3.76.1/dir.c Wed Aug 27 16:31:09 1997 +++ make-3.77/dir.c Fri Jul 10 10:53:12 1998 @@ -111,19 +111,25 @@ #ifdef _AMIGA #include +#endif +#ifdef HAVE_CASE_INSENSITIVE_FS static char * -amigafy (filename) +downcase (filename) char *filename; { - static char amiga_filename[136]; +#ifdef _AMIGA + static char new_filename[136]; +#else + static char new_filename[PATH_MAX]; +#endif char *df; int i; if (filename == 0) return 0; - df = amiga_filename; + df = new_filename; /* First, transform the name part. */ for (i = 0; *filename != '\0'; ++i) @@ -134,9 +140,9 @@ *df = 0; - return amiga_filename; + return new_filename; } -#endif /* _AMIGA */ +#endif /* HAVE_CASE_INSENSITIVE_FS */ #ifdef VMS @@ -355,7 +361,7 @@ for (dc = directories_contents[hash]; dc != 0; dc = dc->next) #ifdef WINDOWS32 - if (!strcmp(dc->path_key, w32_path)) + if (strieq(dc->path_key, w32_path)) #else if (dc->dev == st.st_dev #ifdef VMS @@ -468,8 +474,8 @@ filename = dosify (filename); #endif -#ifdef _AMIGA - filename = amigafy (filename); +#ifdef HAVE_CASE_INSENSITIVE_FS + filename = downcase (filename); #endif #ifdef VMS @@ -613,6 +619,7 @@ { char *dirend; char *dirname; + char *slash; #ifndef NO_ARCHIVES if (ar_name (name)) @@ -632,8 +639,9 @@ char *bslash = rindex(name, '\\'); if (!dirend || bslash > dirend) dirend = bslash; - /* The case of "d:file" is unhandled. But I don't think - such names can happen here. */ + /* The case of "d:file". */ + if (!dirend && name[0] && name[1] == ':') + dirend = name + 1; } #endif /* WINDOWS32 || __MSDOS__ */ if (dirend == 0) @@ -644,15 +652,22 @@ #endif /* AMIGA */ #endif /* VMS */ + slash = dirend; if (dirend == name) dirname = "/"; else { +#if defined (WINDOWS32) || defined (__MSDOS__) + /* d:/ and d: are *very* different... */ + if (dirend < name + 3 && name[1] == ':' && + (*dirend == '/' || *dirend == '\\' || *dirend == ':')) + dirend++; +#endif dirname = (char *) alloca (dirend - name + 1); bcopy (name, dirname, dirend - name); dirname[dirend - name] = '\0'; } - return dir_file_exists_p (dirname, dirend + 1); + return dir_file_exists_p (dirname, slash + 1); } /* Mark FILENAME as `impossible' for `file_impossible_p'. @@ -682,8 +697,9 @@ char *bslash = rindex(p, '\\'); if (!dirend || bslash > dirend) dirend = bslash; - /* The case of "d:file" is unhandled. But I don't think - such names can happen here. */ + /* The case of "d:file". */ + if (!dirend && p[0] && p[1] == ':') + dirend = p + 1; } #endif /* WINDOWS32 or __MSDOS__ */ if (dirend == 0) @@ -696,16 +712,23 @@ else { char *dirname; + char *slash = dirend; if (dirend == p) dirname = "/"; else { +#if defined (WINDOWS32) || defined (__MSDOS__) + /* d:/ and d: are *very* different... */ + if (dirend < p + 3 && p[1] == ':' && + (*dirend == '/' || *dirend == '\\' || *dirend == ':')) + dirend++; +#endif dirname = (char *) alloca (dirend - p + 1); bcopy (p, dirname, dirend - p); dirname[dirend - p] = '\0'; } dir = find_directory (dirname); - filename = p = dirend + 1; + filename = p = slash + 1; } for (hash = 0; *p != '\0'; ++p) @@ -776,8 +799,9 @@ char *bslash = rindex(filename, '\\'); if (!dirend || bslash > dirend) dirend = bslash; - /* The case of "d:file" is unhandled. But I don't think - such names can happen here. */ + /* The case of "d:file". */ + if (!dirend && filename[0] && filename[1] == ':') + dirend = filename + 1; } #endif /* WINDOWS32 || __MSDOS__ */ if (dirend == 0) @@ -790,16 +814,23 @@ else { char *dirname; + char *slash = dirend; if (dirend == filename) dirname = "/"; else { +#if defined (WINDOWS32) || defined (__MSDOS__) + /* d:/ and d: are *very* different... */ + if (dirend < filename + 3 && filename[1] == ':' && + (*dirend == '/' || *dirend == '\\' || *dirend == ':')) + dirend++; +#endif dirname = (char *) alloca (dirend - filename + 1); bcopy (p, dirname, dirend - p); dirname[dirend - p] = '\0'; } dir = find_directory (dirname)->contents; - p = filename = dirend + 1; + p = filename = slash + 1; } if (dir == 0 || dir->files == 0) @@ -809,8 +840,8 @@ #ifdef __MSDOS__ p = filename = dosify (p); #endif -#ifdef _AMIGA - p = filename = amigafy (p); +#ifdef HAVE_CASE_INSENSITIVE_FS + p = filename = downcase (p); #endif #ifdef VMS p = filename = vmsify (p, 1); @@ -891,8 +922,9 @@ dir->contents->ino[0], dir->contents->ino[1], dir->contents->ino[2]); #else - printf ("# %s (device %d, inode %d): ", - dir->name, dir->contents->dev, dir->contents->ino); + printf ("# %s (device %ld, inode %ld): ", + dir->name, + (long)dir->contents->dev, (long)dir->contents->ino); #endif #endif /* WINDOWS32 */ if (f == 0) @@ -1016,6 +1048,14 @@ return 0; } +static void +ansi_free(p) + void *p; +{ + if (p) + free(p); +} + void dir_setup_glob (gl) glob_t *gl; @@ -1025,7 +1065,7 @@ /* Bogus sunos4 compiler complains (!) about & before functions. */ gl->gl_opendir = open_dirstream; gl->gl_readdir = read_dirstream; - gl->gl_closedir = free; + gl->gl_closedir = ansi_free; gl->gl_stat = stat; /* We don't bother setting gl_lstat, since glob never calls it. The slot is only there for compatibility with 4.4 BSD. */ diff -uPr make-3.76.1/dosbuild.bat make-3.77/dosbuild.bat --- make-3.76.1/dosbuild.bat Mon Apr 7 02:54:40 1997 +++ make-3.77/dosbuild.bat Tue Jul 28 10:42:54 1998 @@ -7,8 +7,8 @@ gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o -gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g read.c -o read.o -gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remake.c -o remake.o +gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o +gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o diff -uPr make-3.76.1/expand.c make-3.77/expand.c --- make-3.76.1/expand.c Wed Mar 20 09:57:56 1996 +++ make-3.77/expand.c Fri May 15 09:36:51 1998 @@ -21,15 +21,24 @@ #include "job.h" #include "commands.h" #include "variable.h" +#include "rule.h" /* The next two describe the variable output buffer. This buffer is used to hold the variable-expansion of a line of the makefile. It is made bigger with realloc whenever it is too small. variable_buffer_length is the size currently allocated. - variable_buffer is the address of the buffer. */ + variable_buffer is the address of the buffer. + + For efficiency, it's guaranteed that the buffer will always have + VARIABLE_BUFFER_ZONE extra bytes allocated. This allows you to add a few + extra chars without having to call a function. Note you should never use + these bytes unless you're _sure_ you have room (you know when the buffer + length was last checked. */ + +#define VARIABLE_BUFFER_ZONE 5 static unsigned int variable_buffer_length; -static char *variable_buffer; +char *variable_buffer; /* Subroutine of variable_expand and friends: The text to add is LENGTH chars starting at STRING to the variable_buffer. @@ -45,7 +54,7 @@ { register unsigned int newlen = length + (ptr - variable_buffer); - if (newlen > variable_buffer_length) + if ((newlen + VARIABLE_BUFFER_ZONE) > variable_buffer_length) { unsigned int offset = ptr - variable_buffer; variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length @@ -93,7 +102,7 @@ v->name); else makefile_fatal - (reading_filename, *reading_lineno_ptr, + (reading_filename, *reading_lineno_ptr, "Recursive variable `%s' references itself (eventually)", v->name); } @@ -153,20 +162,38 @@ return o; } -/* Scan LINE for variable references and expansion-function calls. - Build in `variable_buffer' the result of expanding the references and calls. - Return the address of the resulting string, which is null-terminated - and is valid only until the next time this function is called. */ +/* Scan STRING for variable references and expansion-function calls. Only + LENGTH bytes of STRING are actually scanned. If LENGTH is -1, scan until + a null byte is found. + + Write the results to LINE, which must point into `variable_buffer'. If + LINE is NULL, start at the beginning of the buffer. + Return a pointer to LINE, or to the beginning of the buffer if LINE is + NULL. */ char * -variable_expand (line) +variable_expand_string (line, string, length) register char *line; + char *string; + long length; { register struct variable *v; register char *p, *o, *p1; + char save_char = '\0'; + unsigned int line_offset; + + if (!line) + line = initialize_variable_output(); - p = line; - o = initialize_variable_output (); + p = string; + o = line; + line_offset = line - variable_buffer; + + if (length >= 0) + { + save_char = string[length]; + string[length] = '\0'; + } while (1) { @@ -316,7 +343,7 @@ replace_end - replace_beg); replace[replace_end - replace_beg] = '\0'; } - + o = patsubst_expand (o, value, pattern, replace, percent, (char *) 0); } @@ -366,7 +393,7 @@ } break; - } + } if (*p == '\0') break; @@ -374,8 +401,23 @@ ++p; } - (void) variable_buffer_output (o, "", 1); - return initialize_variable_output (); + if (save_char) + string[length] = save_char; + + (void)variable_buffer_output (o, "", 1); + return (variable_buffer + line_offset); +} + +/* Scan LINE for variable references and expansion-function calls. + Build in `variable_buffer' the result of expanding the references and calls. + Return the address of the resulting string, which is null-terminated + and is valid only until the next time this function is called. */ + +char * +variable_expand (line) + char *line; +{ + return variable_expand_string(NULL, line, -1); } /* Expand an argument for an expansion function. @@ -405,13 +447,13 @@ /* Expand LINE for FILE. Error messages refer to the file and line where FILE's commands were found. Expansion uses FILE's variable set list. */ -char * +static char * variable_expand_for_file (line, file) char *line; register struct file *file; { char *result; - struct variable_set_list *save; + struct variable_set_list *save, *fnext; if (file == 0) return variable_expand (line); @@ -420,10 +462,23 @@ current_variable_set_list = file->variables; reading_filename = file->cmds->filename; reading_lineno_ptr = &file->cmds->lineno; + fnext = file->variables->next; + /* See if there's a pattern-specific variable struct for this target. */ + if (!file->pat_searched) + { + file->patvar = lookup_pattern_var(file->name); + file->pat_searched = 1; + } + if (file->patvar != 0) + { + file->patvar->vars->next = fnext; + file->variables->next = file->patvar->vars; + } result = variable_expand (line); current_variable_set_list = save; reading_filename = 0; reading_lineno_ptr = 0; + file->variables->next = fnext; return result; } diff -uPr make-3.76.1/file.c make-3.77/file.c --- make-3.76.1/file.c Wed Aug 27 16:31:10 1997 +++ make-3.77/file.c Wed Jul 22 11:35:46 1998 @@ -49,6 +49,9 @@ register struct file *f; register char *n; register unsigned int hashval; +#ifdef VMS + register char *lname, *ln; +#endif if (*name == '\0') abort (); @@ -57,6 +60,12 @@ for names read from makefiles. It is here for names passed on the command line. */ #ifdef VMS + lname = (char *)malloc(strlen(name) + 1); + for (n=name, ln=lname; *n != '\0'; ++n, ++ln) + *ln = isupper(*n) ? tolower(*n) : *n; + *ln = '\0'; + name = lname; + while (name[0] == '[' && name[1] == ']' && name[2] != '\0') name += 2; #endif @@ -89,9 +98,15 @@ { if (strieq (f->hname, name)) { +#ifdef VMS + free (lname); +#endif return f; } } +#ifdef VMS + free (lname); +#endif return 0; } @@ -374,9 +389,9 @@ if (f->update_status == -1) /* If nothing would have created this file yet, don't print an "rm" command for it. */ - continue; - else if (just_print_flag) - status = 0; + continue; + else if (just_print_flag) + status = 0; else { status = unlink (f->name); @@ -660,8 +675,8 @@ { printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS); #ifndef NO_FLOAT - printf ("# average %.1f files per bucket, max %u files in one bucket.\n", - ((double) nfiles) / ((double) FILE_BUCKETS) * 100.0, per_bucket); + printf ("# average %.3f files per bucket, max %u files in one bucket.\n", + ((double) nfiles) / ((double) FILE_BUCKETS), per_bucket); #endif } } diff -uPr make-3.76.1/filedef.h make-3.77/filedef.h --- make-3.76.1/filedef.h Wed Aug 27 16:31:10 1997 +++ make-3.77/filedef.h Fri Jul 17 11:09:51 1998 @@ -52,6 +52,10 @@ the same file. Otherwise this is null. */ struct file *double_colon; + /* Pattern-specific variable reference for this target, or null if there + isn't one. Also see the pat_searched flag, below. */ + struct pattern_var *patvar; + short int update_status; /* Status of the last attempt to update, or -1 if none has been made. */ @@ -79,7 +83,10 @@ unsigned int secondary:1; unsigned int dontcare:1; /* Nonzero if no complaint is to be made if this target cannot be remade. */ + unsigned int shownerror:1; /* Nonzero if we printed an error */ unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */ + unsigned int pat_searched:1;/* Nonzero if we already searched for + pattern-specific variables */ }; /* Number of intermediate files entered. */ diff -uPr make-3.76.1/function.c make-3.77/function.c --- make-3.76.1/function.c Tue Sep 16 10:17:29 1997 +++ make-3.77/function.c Fri Jul 10 00:05:05 1998 @@ -119,7 +119,7 @@ register char *pattern_percent, *replace_percent; { unsigned int pattern_prepercent_len, pattern_postpercent_len; - unsigned int replace_prepercent_len, replace_postpercent_len; + unsigned int replace_prepercent_len, replace_postpercent_len = 0; char *t; unsigned int len; int doneany = 0; @@ -282,13 +282,13 @@ { 0, 0, function_invalid } }; -/* Return 1 if PATTERN matches WORD, 0 if not. */ +/* Return 1 if PATTERN matches STR, 0 if not. */ int -pattern_matches (pattern, percent, word) - register char *pattern, *percent, *word; +pattern_matches (pattern, percent, str) + register char *pattern, *percent, *str; { - unsigned int sfxlen, wordlen; + unsigned int sfxlen, strlength; if (percent == 0) { @@ -298,17 +298,17 @@ pattern = new; percent = find_percent (pattern); if (percent == 0) - return streq (pattern, word); + return streq (pattern, str); } sfxlen = strlen (percent + 1); - wordlen = strlen (word); + strlength = strlen (str); - if (wordlen < (percent - pattern) + sfxlen - || strncmp (pattern, word, percent - pattern)) + if (strlength < (percent - pattern) + sfxlen + || strncmp (pattern, str, percent - pattern)) return 0; - return !strcmp (percent + 1, word + (wordlen - sfxlen)); + return !strcmp (percent + 1, str + (strlength - sfxlen)); } int shell_function_pid = 0, shell_function_completed; @@ -318,13 +318,13 @@ The output is written into VARIABLE_BUFFER starting at O. */ /* Note this absorbs a semicolon and is safe to use in conditionals. */ -#define BADARGS(func) \ +#define BADARGS(func) do { \ if (reading_filename != 0) \ makefile_fatal (reading_filename, *reading_lineno_ptr, \ "insufficient arguments to function `%s'", \ func); \ else \ - fatal ("insufficient arguments to function `%s'", func) + fatal ("insufficient arguments to function `%s'", func); } while (0) static char * expand_function (o, function, text, end) @@ -348,6 +348,7 @@ #ifndef VMS /* not supported for vms yet */ case function_shell: { + char* batch_filename = NULL; #ifdef WINDOWS32 SECURITY_ATTRIBUTES saAttr; HANDLE hIn; @@ -373,7 +374,7 @@ #ifndef __MSDOS__ /* Construct the argument list. */ argv = construct_command_argv (text, - (char **) NULL, (struct file *) 0); + (char **) NULL, (struct file *) 0, &batch_filename); if (argv == 0) break; #endif @@ -584,6 +585,12 @@ while (shell_function_completed == 0) reap_children (1, 0); + if (batch_filename) { + if (debug_flag) + printf("Cleaning up temporary batch file %s\n", batch_filename); + remove(batch_filename); + free(batch_filename); + } shell_function_pid = 0; /* The child_handler function will set shell_function_completed @@ -852,6 +859,8 @@ push_new_variable_scope (); v = define_variable (var, strlen (var), "", o_automatic, 0); + free (v->value); + v->value = 0; p3 = list; while ((p = find_next_token (&p3, &len)) != 0) { @@ -882,10 +891,10 @@ case function_filter: case function_filter_out: { - struct word + struct a_word { - struct word *next; - char *word; + struct a_word *next; + char *str; int matched; } *words, *wordtail, *wp; @@ -911,7 +920,7 @@ p3 = text; while ((p = find_next_token (&p3, &len)) != 0) { - struct word *w = (struct word *) alloca (sizeof (struct word)); + struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word)); if (words == 0) words = w; else @@ -921,7 +930,7 @@ if (*p3 != '\0') ++p3; p[len] = '\0'; - w->word = p; + w->str = p; w->matched = 0; } @@ -939,8 +948,8 @@ percent = find_percent (p); for (wp = words; wp != 0; wp = wp->next) - wp->matched |= (percent == 0 ? streq (p, wp->word) - : pattern_matches (p, percent, wp->word)); + wp->matched |= (percent == 0 ? streq (p, wp->str) + : pattern_matches (p, percent, wp->str)); p[len] = save; } @@ -949,7 +958,7 @@ for (wp = words; wp != 0; wp = wp->next) if (function == function_filter ? wp->matched : !wp->matched) { - o = variable_buffer_output (o, wp->word, strlen (wp->word)); + o = variable_buffer_output (o, wp->str, strlen (wp->str)); o = variable_buffer_output (o, " ", 1); doneany = 1; } diff -uPr make-3.76.1/getloadavg.c make-3.77/getloadavg.c --- make-3.76.1/getloadavg.c Tue Jul 22 17:35:43 1997 +++ make-3.77/getloadavg.c Thu Jul 23 15:28:57 1998 @@ -35,6 +35,7 @@ LOAD_AVE_TYPE Type of the load average array in the kernel. Must be defined unless one of apollo, DGUX, NeXT, or UMAX is defined; + or we have libkstat; otherwise, no load average is available. NLIST_STRUCT Include nlist.h, not a.out.h, and the nlist n_name element is a pointer, @@ -500,6 +501,7 @@ # include # endif + /* Avoid static vars inside a function since in HPUX they dump as pure. */ # ifdef NeXT @@ -516,7 +518,7 @@ static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */ # endif /* DGUX */ -# ifdef LOAD_AVE_TYPE +#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE) /* File descriptor open to /dev/kmem or VMS load ave driver. */ static int channel; /* Nonzero iff channel is valid. */ @@ -524,15 +526,15 @@ /* Offset in kmem to seek to read load average, or 0 means invalid. */ static long offset; -# if !defined(VMS) && !defined(sgi) && !defined(__linux__) +#if !defined(VMS) && !defined(sgi) && !defined(__linux__) static struct nlist nl[2]; -# endif /* Not VMS or sgi */ +#endif -# ifdef SUNOS_5 +#ifdef SUNOS_5 static kvm_t *kd; -# endif /* SUNOS_5 */ +#endif /* SUNOS_5 */ -# endif /* LOAD_AVE_TYPE */ +# endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */ /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. diff -uPr make-3.76.1/getopt.c make-3.77/getopt.c --- make-3.76.1/getopt.c Fri Sep 5 17:01:56 1997 +++ make-3.77/getopt.c Tue Jun 9 12:54:20 1998 @@ -1,13 +1,13 @@ /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + "Keep this file name-space clean" means, talk to bug-glibc@gnu.org before changing it! - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. +Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff -uPr make-3.76.1/getopt.h make-3.77/getopt.h --- make-3.76.1/getopt.h Tue Sep 16 10:17:30 1997 +++ make-3.77/getopt.h Tue Jun 9 12:54:40 1998 @@ -1,8 +1,8 @@ /* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. + Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. +Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff -uPr make-3.76.1/getopt1.c make-3.77/getopt1.c --- make-3.76.1/getopt1.c Thu Sep 4 17:01:51 1997 +++ make-3.77/getopt1.c Tue Jun 9 12:55:25 1998 @@ -2,7 +2,7 @@ Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. +Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff -uPr make-3.76.1/glob/ChangeLog make-3.77/glob/ChangeLog --- make-3.76.1/glob/ChangeLog Mon Aug 18 14:11:37 1997 +++ make-3.77/glob/ChangeLog Wed Jul 29 16:25:39 1998 @@ -1,3 +1,51 @@ +1998-07-29 Paul D. Smith + + * glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich + Drepper). Fixes a bug reported by Eli Zaretski. Integrates + DOS/Windows32 support. + +1998-07-27 Kaveh R. Ghazi + + * glob.c (glob): Cast away const on assignment of pattern to dirname. + Cast the return type of __alloca() for traditional C compilers. + +1998-07-23 Paul D. Smith + + * glob.c, fnmatch.c: New versions of these files from the GLIBC + folks (Ulrich Drepper). Had to re-integrate some DOS/Windows + code. + +1998-07-10 Paul D. Smith + + * glob.c (glob_in_dir): If no meta chars exist in PATTERN and + GLOB_NOCHECK is present, don't look for the file--whether it's + found or not, we'll always return it, so why bother searching? + + Also, if we are searching and there are no meta chars, don't + bother trying fnmatch() if the strcmp() fails. + +1998-05-30 Eli Zaretskii + + * glob.c (glob) [__MSDOS__, WINDOWS32]: Compute the directory and + filename parts of the pattern correctly when it includes a drive + spec. Disallow wildcards in the drive spec. Prevent recursion + when dirname is of the form "d:/" or "d:". + (prefix_array) [__MSDOS__, WINDOWS32]: Don't append a slash to + "d:/" and "d:". + +1998-05-13 Paul D. Smith + + * SMakefile, Makefile.ami, glob.c, glob.h, fnmatch.c: Updated from + the latest glibc version. + +1998-04-17 Paul D. Smith + + * configure.in: Create a config.h file instead of setting things + on the compile line. This is because when build.sh runs it merely + passes -DHAVE_CONFIG_H to the glob files, just as it does to the + make files. + * config.h.in: Created by autoheader. + Tue Aug 12 10:52:34 1997 Paul D. Smith * configure.in: Require autoconf 2.12. diff -uPr make-3.76.1/glob/Makefile.am make-3.77/glob/Makefile.am --- make-3.76.1/glob/Makefile.am Mon Aug 18 14:11:38 1997 +++ make-3.77/glob/Makefile.am Tue Apr 14 00:17:21 1998 @@ -1,6 +1,6 @@ # -*-Makefile-*-, or close enough -AUTOMAKE_OPTIONS = 1.2 foreign +AUTOMAKE_OPTIONS = 1.3 foreign noinst_LIBRARIES = libglob.a diff -uPr make-3.76.1/glob/Makefile.ami make-3.77/glob/Makefile.ami --- make-3.76.1/glob/Makefile.ami Thu May 9 14:29:30 1996 +++ make-3.77/glob/Makefile.ami Wed May 13 16:37:40 1998 @@ -1,6 +1,6 @@ # Makefile for standalone distribution of libglob.a (fnmatch, glob). -# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc. # This file is part of the GNU C Library. # This library is free software; you can redistribute it and/or @@ -15,8 +15,8 @@ # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. +# not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Ultrix 2.2 make doesn't expand the value of VPATH. VPATH = /glob/ diff -uPr make-3.76.1/glob/Makefile.in make-3.77/glob/Makefile.in --- make-3.76.1/glob/Makefile.in Fri Sep 19 14:58:57 1997 +++ make-3.77/glob/Makefile.in Wed Jul 29 22:38:50 1998 @@ -1,8 +1,14 @@ -# Makefile.in generated automatically by automake 1.2 from Makefile.am +# Makefile.in generated automatically by automake 1.3 from Makefile.am -# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. # -*-Makefile-*-, or close enough @@ -28,6 +34,8 @@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -45,12 +53,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ -NORMAL_INSTALL = true -PRE_INSTALL = true -POST_INSTALL = true -NORMAL_UNINSTALL = true -PRE_UNINSTALL = true -POST_UNINSTALL = true +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : AR = @AR@ CC = @CC@ CPP = @CPP@ @@ -59,7 +67,7 @@ RANLIB = @RANLIB@ VERSION = @VERSION@ -AUTOMAKE_OPTIONS = 1.2 foreign +AUTOMAKE_OPTIONS = 1.3 foreign noinst_LIBRARIES = libglob.a @@ -69,11 +77,12 @@ configure.bat ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) -DEFS = @DEFS@ -I. -I$(srcdir) +DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -83,7 +92,7 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = COPYING.LIB ChangeLog Makefile.am Makefile.in aclocal.m4 \ -configure configure.in +config.h.in configure configure.in stamp-h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -93,14 +102,14 @@ SOURCES = $(libglob_a_SOURCES) OBJECTS = $(libglob_a_OBJECTS) -default: all +all: Makefile $(LIBRARIES) config.h .SUFFIXES: -.SUFFIXES: .c .o -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -112,10 +121,31 @@ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) +config.h: stamp-h + @: +stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h +$(srcdir)/config.h.in: $(srcdir)/stamp-h.in +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + @echo timestamp > $(srcdir)/stamp-h.in + +mostlyclean-hdr: + +clean-hdr: + +distclean-hdr: + -rm -f config.h + +maintainer-clean-hdr: + mostlyclean-noinstLIBRARIES: clean-noinstLIBRARIES: - test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) distclean-noinstLIBRARIES: @@ -124,38 +154,49 @@ .c.o: $(COMPILE) -c $< +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + mostlyclean-compile: - rm -f *.o core + -rm -f *.o core *.core clean-compile: distclean-compile: - rm -f *.tab.c + -rm -f *.tab.c maintainer-clean-compile: libglob.a: $(libglob_a_OBJECTS) $(libglob_a_DEPENDENCIES) - rm -f libglob.a + -rm -f libglob.a $(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD) $(RANLIB) libglob.a tags: TAGS -ID: $(HEADERS) $(SOURCES) - here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS) +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ - test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: - rm -f TAGS ID + -rm -f TAGS ID maintainer-clean-tags: @@ -166,7 +207,7 @@ # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - rm -rf $(distdir) + -rm -rf $(distdir) GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst @@ -179,20 +220,20 @@ && $(MAKE) install \ && $(MAKE) installcheck \ && $(MAKE) dist - rm -rf $(distdir) + -rm -rf $(distdir) @echo "========================"; \ echo "$(distdir).tar.gz is ready for distribution"; \ echo "========================" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + -rm -rf $(distdir) distdir: $(DISTFILES) - rm -rf $(distdir) + -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ @@ -201,8 +242,8 @@ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done -fnmatch.o fnmatch.lo: fnmatch.c fnmatch.h -glob.o glob.lo: glob.c fnmatch.h glob.h +fnmatch.o: fnmatch.c config.h fnmatch.h +glob.o: glob.c config.h fnmatch.h glob.h info: dvi: @@ -220,45 +261,45 @@ uninstall: -all: Makefile $(LIBRARIES) - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: mostlyclean-generic: - test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: - test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - rm -f Makefile $(DISTCLEANFILES) - rm -f config.cache config.log stamp-h stamp-h[0-9]* - test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: - test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic - -clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ - mostlyclean - -distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ - distclean-generic clean - rm -f config.status + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-hdr mostlyclean-noinstLIBRARIES \ + mostlyclean-compile mostlyclean-tags \ + mostlyclean-generic + +clean: clean-hdr clean-noinstLIBRARIES clean-compile clean-tags \ + clean-generic mostlyclean + +distclean: distclean-hdr distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean + -rm -f config.status -maintainer-clean: maintainer-clean-noinstLIBRARIES \ +maintainer-clean: maintainer-clean-hdr maintainer-clean-noinstLIBRARIES \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f config.status + -rm -f config.status -.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ +mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ diff -uPr make-3.76.1/glob/SMakefile make-3.77/glob/SMakefile --- make-3.76.1/glob/SMakefile Thu May 9 14:29:33 1996 +++ make-3.77/glob/SMakefile Wed May 13 16:40:30 1998 @@ -1,6 +1,6 @@ # Makefile for standalone distribution of libglob.a (fnmatch, glob). -# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc. # This file is part of the GNU C Library. # This library is free software; you can redistribute it and/or @@ -15,8 +15,8 @@ # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. +# not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Ultrix 2.2 make doesn't expand the value of VPATH. VPATH = /glob/ diff -uPr make-3.76.1/glob/aclocal.m4 make-3.77/glob/aclocal.m4 --- make-3.76.1/glob/aclocal.m4 Tue Sep 16 11:00:32 1997 +++ make-3.77/glob/aclocal.m4 Wed Jul 29 22:32:57 1998 @@ -1,4 +1,14 @@ -dnl aclocal.m4 generated automatically by aclocal 1.2 +dnl aclocal.m4 generated automatically by aclocal 1.3 + +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. @@ -22,8 +32,8 @@ ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) -AM_SANITY_CHECK -AC_ARG_PROGRAM +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) @@ -31,7 +41,7 @@ AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_PROG_MAKE_SET]) +AC_REQUIRE([AC_PROG_MAKE_SET])]) # serial 1 @@ -58,10 +68,21 @@ # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$@" = "X"; then + if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + test "[$]2" = conftestfile ) then @@ -89,4 +110,27 @@ AC_MSG_RESULT(missing) fi AC_SUBST($1)]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +AC_DEFUN(AM_CONFIG_HEADER, +[AC_PREREQ([2.12]) +AC_CONFIG_HEADER([$1]) +dnl When config.status generates a header, we must update the stamp-h file. +dnl This file resides in the same directory as the config header +dnl that is generated. We must strip everything past the first ":", +dnl and everything past the last "/". +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, +<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` +done<<>>dnl>>) +changequote([,]))]) diff -uPr make-3.76.1/glob/config.h.in make-3.77/glob/config.h.in --- make-3.76.1/glob/config.h.in Wed Dec 31 19:00:00 1969 +++ make-3.77/glob/config.h.in Wed Jul 29 22:33:00 1998 @@ -0,0 +1,73 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define if the closedir function returns void instead of int. */ +#undef CLOSEDIR_VOID + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have the strcoll function and it is properly defined. */ +#undef HAVE_STRCOLL + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H diff -uPr make-3.76.1/glob/configure make-3.77/glob/configure --- make-3.76.1/glob/configure Tue Sep 16 11:00:37 1997 +++ make-3.77/glob/configure Wed Jul 29 22:33:02 1998 @@ -600,17 +600,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -PACKAGE=glob - -VERSION=0.0 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi - echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:614: checking whether build environment is sane" >&5 +echo "configure:605: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -621,10 +612,21 @@ # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "" = "X"; then + if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + test "$2" = conftestfile ) then @@ -655,9 +657,47 @@ # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:662: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=glob + +VERSION=0.0 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi + + + missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:661: checking for working aclocal" >&5 +echo "configure:701: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -670,7 +710,7 @@ fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:674: checking for working autoconf" >&5 +echo "configure:714: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -683,7 +723,7 @@ fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:687: checking for working automake" >&5 +echo "configure:727: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -696,7 +736,7 @@ fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:700: checking for working autoheader" >&5 +echo "configure:740: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -709,7 +749,7 @@ fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:713: checking for working makeinfo" >&5 +echo "configure:753: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -721,38 +761,15 @@ echo "$ac_t""missing" 1>&6 fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:726: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi + + + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:756: checking for $ac_word" >&5 +echo "configure:773: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -781,7 +798,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:785: checking for $ac_word" >&5 +echo "configure:802: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -829,7 +846,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:833: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -839,11 +856,11 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -863,12 +880,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:867: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:884: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:872: checking whether we are using GNU C" >&5 +echo "configure:889: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -877,7 +894,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -892,7 +909,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:896: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:913: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -922,7 +939,7 @@ # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:926: checking for $ac_word" >&5 +echo "configure:943: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -951,7 +968,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:955: checking for $ac_word" >&5 +echo "configure:972: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -978,7 +995,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:982: checking how to run the C preprocessor" >&5 +echo "configure:999: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -993,13 +1010,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1010,13 +1027,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1038,9 +1055,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1042: checking for AIX" >&5 +echo "configure:1059: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:1067: checking for minix/config.h" >&5 +echo "configure:1084: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1111,7 +1128,7 @@ fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1115: checking for POSIXized ISC" >&5 +echo "configure:1132: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1132,12 +1149,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1136: checking for working const" >&5 +echo "configure:1153: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1207,12 +1224,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1211: checking for ANSI C header files" >&5 +echo "configure:1228: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1220,7 +1237,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1237,7 +1254,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1255,7 +1272,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1276,7 +1293,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1287,7 +1304,7 @@ exit (0); } EOF -if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1314,17 +1331,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1318: checking for $ac_hdr" >&5 +echo "configure:1335: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1355,12 +1372,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1359: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1376: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1368,7 +1385,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1393,7 +1410,7 @@ # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1397: checking for opendir in -ldir" >&5 +echo "configure:1414: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1401,7 +1418,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1434,7 +1451,7 @@ else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1438: checking for opendir in -lx" >&5 +echo "configure:1455: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1442,7 +1459,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1476,7 +1493,7 @@ fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:1480: checking whether closedir returns void" >&5 +echo "configure:1497: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1484,13 +1501,13 @@ ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF -if { (eval echo configure:1494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else @@ -1515,19 +1532,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1519: checking for working alloca.h" >&5 +echo "configure:1536: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1548,12 +1565,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1552: checking for alloca" >&5 +echo "configure:1569: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1608,12 +1625,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1612: checking whether alloca needs Cray hooks" >&5 +echo "configure:1629: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:1642: checking for $ac_func" >&5 +echo "configure:1659: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1693,7 +1710,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1697: checking stack direction for C alloca" >&5 +echo "configure:1714: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1701,7 +1718,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1742,7 +1759,7 @@ fi echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:1746: checking for working strcoll" >&5 +echo "configure:1763: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1750,7 +1767,7 @@ ac_cv_func_strcoll_works=no else cat > conftest.$ac_ext < main () @@ -1760,7 +1777,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes else @@ -1845,19 +1862,7 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - +DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} @@ -1895,7 +1900,7 @@ ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h exit 0 EOF diff -uPr make-3.76.1/glob/configure.in make-3.77/glob/configure.in --- make-3.76.1/glob/configure.in Mon Aug 18 14:11:38 1997 +++ make-3.77/glob/configure.in Wed Jul 29 16:17:55 1998 @@ -3,6 +3,7 @@ AC_PREREQ(2.12) dnl Minimum Autoconf version required. AM_INIT_AUTOMAKE(glob, 0.0, nodefs) +AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_CHECK_PROG(AR, ar, ar, ar) diff -uPr make-3.76.1/glob/fnmatch.c make-3.77/glob/fnmatch.c --- make-3.76.1/glob/fnmatch.c Mon Apr 7 03:24:16 1997 +++ make-3.77/glob/fnmatch.c Tue Jul 28 12:32:34 1998 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc. This file is part of the GNU C Library. This library is free software; you can redistribute it and/or @@ -29,6 +29,23 @@ #include #include +#if HAVE_STRING_H +# include +#else +# include +#endif + +#if defined STDC_HEADERS || defined _LIBC +# include +#endif + +/* For platform which support the ISO C amendement 1 functionality we + support user defined character classes. */ +#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) +/* Solaris 2.5 has a bug: must be included before . */ +# include +# include +#endif /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C @@ -47,8 +64,64 @@ # define ISASCII(c) isascii(c) # endif -# define ISUPPER(c) (ISASCII (c) && isupper (c)) +#ifdef isblank +# define ISBLANK(c) (ISASCII (c) && isblank (c)) +#else +# define ISBLANK(c) ((c) == ' ' || (c) == '\t') +#endif +#ifdef isgraph +# define ISGRAPH(c) (ISASCII (c) && isgraph (c)) +#else +# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) +#endif + +#define ISPRINT(c) (ISASCII (c) && isprint (c)) +#define ISDIGIT(c) (ISASCII (c) && isdigit (c)) +#define ISALNUM(c) (ISASCII (c) && isalnum (c)) +#define ISALPHA(c) (ISASCII (c) && isalpha (c)) +#define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) +#define ISLOWER(c) (ISASCII (c) && islower (c)) +#define ISPUNCT(c) (ISASCII (c) && ispunct (c)) +#define ISSPACE(c) (ISASCII (c) && isspace (c)) +#define ISUPPER(c) (ISASCII (c) && isupper (c)) +#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) + +# define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) + +# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) +/* The GNU C library provides support for user-defined character classes + and the functions from ISO C amendement 1. */ +# ifdef CHARCLASS_NAME_MAX +# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX +# else +/* This shouldn't happen but some implementation might still have this + problem. Use a reasonable default value. */ +# define CHAR_CLASS_MAX_LENGTH 256 +# endif + +# ifdef _LIBC +# define IS_CHAR_CLASS(string) __wctype (string) +# else +# define IS_CHAR_CLASS(string) wctype (string) +# endif +# else +# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ + +# define IS_CHAR_CLASS(string) \ + (STREQ (string, "alpha") || STREQ (string, "upper") \ + || STREQ (string, "lower") || STREQ (string, "digit") \ + || STREQ (string, "alnum") || STREQ (string, "xdigit") \ + || STREQ (string, "space") || STREQ (string, "print") \ + || STREQ (string, "punct") || STREQ (string, "graph") \ + || STREQ (string, "cntrl") || STREQ (string, "blank")) +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ +# if !defined _LIBC && !defined getenv +extern char *getenv (); +# endif # ifndef errno extern int errno; @@ -66,7 +139,11 @@ register char c; /* Note that this evaluates C many times. */ -# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) +# ifdef _LIBC +# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) +# else +# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) +# endif while ((c = *p++) != '\0') { @@ -137,67 +214,124 @@ case '[': { /* Nonzero if the sense of the character class is inverted. */ + static int posixly_correct; register int not; + char cold; + + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; if (*n == '\0') return FNM_NOMATCH; - if ((flags & FNM_PERIOD) && *n == '.' && + if (*n == '.' && (flags & FNM_PERIOD) && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; - not = (*p == '!' || *p == '^'); + if (*n == '/' && (flags & FNM_FILE_NAME)) + /* `/' cannot be matched. */ + return FNM_NOMATCH; + + not = (*p == '!' || (posixly_correct < 0 && *p == '^')); if (not) ++p; c = *p++; for (;;) { - register char cstart = c, cend = c; + int fn = FOLD (*n); if (!(flags & FNM_NOESCAPE) && c == '\\') { if (*p == '\0') return FNM_NOMATCH; - cstart = cend = *p++; + c = FOLD (*p++); + + if (c == fn) + goto matched; } + else if (c == '[' && *p == ':') + { + /* Leave room for the null. */ + char str[CHAR_CLASS_MAX_LENGTH + 1]; + size_t c1 = 0; +# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) + wctype_t wt; +# endif - cstart = cend = FOLD (cstart); + for (;;) + { + if (c1 == CHAR_CLASS_MAX_LENGTH) + /* The name is too long and therefore the pattern + is ill-formed. */ + return FNM_NOMATCH; + + c = *++p; + if (c == ':' && p[1] == ']') + { + p += 2; + break; + } + str[c1++] = 'c'; + } + str[c1] = '\0'; + +# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) + wt = IS_CHAR_CLASS (str); + if (wt == 0) + /* Invalid character class name. */ + return FNM_NOMATCH; - if (c == '\0') + if (__iswctype (__btowc (*n), wt)) + goto matched; +# else + if ((STREQ (str, "alnum") && ISALNUM (*n)) + || (STREQ (str, "alpha") && ISALPHA (*n)) + || (STREQ (str, "blank") && ISBLANK (*n)) + || (STREQ (str, "cntrl") && ISCNTRL (*n)) + || (STREQ (str, "digit") && ISDIGIT (*n)) + || (STREQ (str, "graph") && ISGRAPH (*n)) + || (STREQ (str, "lower") && ISLOWER (*n)) + || (STREQ (str, "print") && ISPRINT (*n)) + || (STREQ (str, "punct") && ISPUNCT (*n)) + || (STREQ (str, "space") && ISSPACE (*n)) + || (STREQ (str, "upper") && ISUPPER (*n)) + || (STREQ (str, "xdigit") && ISXDIGIT (*n))) + goto matched; +# endif + } + else if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; + else if (FOLD (c) == fn) + goto matched; + cold = c; c = *p++; - c = FOLD (c); - - if ((flags & FNM_FILE_NAME) && c == '/') - /* [/] can never match. */ - return FNM_NOMATCH; if (c == '-' && *p != ']') { - cend = *p++; + /* It is a range. */ + char cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == '\\') cend = *p++; if (cend == '\0') return FNM_NOMATCH; - cend = FOLD (cend); + + if (cold <= fn && fn <= FOLD (cend)) + goto matched; c = *p++; } - - if (FOLD (*n) >= cstart && FOLD (*n) <= cend) - goto matched; - if (c == ']') break; } + if (!not) return FNM_NOMATCH; break; - matched:; + matched: /* Skip the rest of the [...] that already matched. */ while (c != ']') { @@ -212,6 +346,15 @@ return FNM_NOMATCH; /* XXX 1003.2d11 is unclear if this is right. */ ++p; + } + else if (c == '[' && *p == ':') + { + do + if (*++p == '\0') + return FNM_NOMATCH; + while (*p != ':' || p[1] == ']'); + p += 2; + c = *p; } } if (not) diff -uPr make-3.76.1/glob/fnmatch.h make-3.77/glob/fnmatch.h --- make-3.76.1/glob/fnmatch.h Mon Aug 18 14:11:39 1997 +++ make-3.77/glob/fnmatch.h Mon Dec 22 16:59:06 1997 @@ -23,18 +23,24 @@ extern "C" { #endif -#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \ - || defined (WINDOWS32)) -#undef __P -#define __P(protos) protos +#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 +# undef __P +# define __P(protos) protos #else /* Not C++ or ANSI C. */ -#undef __P -#define __P(protos) () +# undef __P +# define __P(protos) () /* We can get away without defining `const' here only because in this file it is used only inside the prototype for `fnmatch', which is elided in non-ANSI C where `const' is problematical. */ #endif /* C++ or ANSI C. */ +#ifndef const +# if (defined __STDC__ && __STDC__) || defined __cplusplus +# define __const const +# else +# define __const +# endif +#endif /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ @@ -47,18 +53,26 @@ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) -#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ -#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ -#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE +# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 +/* This value is returned if the implementation does not support + `fnmatch'. Since this is not the case here it will never be + returned but the conformance test suites still require the symbol + to be defined. */ +#if (_XOPEN_SOURCE - 0) == 500 +# define FNM_NOSYS (-1) +#endif + /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch __P ((const char *__pattern, const char *__string, +extern int fnmatch __P ((__const char *__pattern, __const char *__string, int __flags)); #ifdef __cplusplus diff -uPr make-3.76.1/glob/glob.c make-3.77/glob/glob.c --- make-3.76.1/glob/glob.c Mon Aug 18 14:11:40 1997 +++ make-3.77/glob/glob.c Wed Jul 29 16:22:45 1998 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -16,17 +16,17 @@ Boston, MA 02111-1307, USA. */ /* AIX requires this to be the first thing in the file. */ -#if defined (_AIX) && !defined (__GNUC__) +#if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H -#include +# include #endif /* Enable GNU extensions in glob.h. */ #ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 +# define _GNU_SOURCE 1 #endif #include @@ -49,45 +49,45 @@ it is simpler to just do this in the source for each such file. */ #define GLOB_INTERFACE_VERSION 1 -#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 -#include -#if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION -#define ELIDE_CODE -#endif +#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 +# include +# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION +# define ELIDE_CODE +# endif #endif #ifndef ELIDE_CODE -#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) -#include +#if defined STDC_HEADERS || defined __GNU_LIBRARY__ +# include #endif #if defined HAVE_UNISTD_H || defined _LIBC -#include -#ifndef POSIX -#ifdef _POSIX_VERSION -#define POSIX -#endif -#endif +# include +# ifndef POSIX +# ifdef _POSIX_VERSION +# define POSIX +# endif +# endif #endif -#if !defined (_AMIGA) && !defined (VMS) && !defined(WINDOWS32) -#include +#if !defined _AMIGA && !defined VMS && !defined WINDOWS32 +# include #endif -#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) +#if !defined __GNU_LIBRARY__ && !defined STDC_HEADERS extern int errno; #endif #ifndef __set_errno -#define __set_errno(val) errno = (val) +# define __set_errno(val) errno = (val) #endif #ifndef NULL -#define NULL 0 +# define NULL 0 #endif -#if defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__) +#if defined HAVE_DIRENT_H || defined __GNU_LIBRARY__ # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else @@ -110,36 +110,42 @@ /* In GNU systems, defines this macro for us. */ #ifdef _D_NAMLEN -#undef NAMLEN -#define NAMLEN(d) _D_NAMLEN(d) +# undef NAMLEN +# define NAMLEN(d) _D_NAMLEN(d) +#endif + +/* When used in the GNU libc the symbol _DIRENT_HAVE_D_TYPE is available + if the `d_type' member for `struct dirent' is available. */ +#ifdef _DIRENT_HAVE_D_TYPE +# define HAVE_D_TYPE 1 #endif -#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__) +#if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__ /* Posix does not require that the d_ino field be present, and some systems do not provide it. */ -#define REAL_DIR_ENTRY(dp) 1 +# define REAL_DIR_ENTRY(dp) 1 #else -#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) +# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) #endif /* POSIX */ -#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) -#include -#include -#define ANSI_STRING +#if defined STDC_HEADERS || defined __GNU_LIBRARY__ +# include +# include +# define ANSI_STRING #else /* No standard headers. */ extern char *getenv (); -#ifdef HAVE_STRING_H -#include -#define ANSI_STRING -#else -#include -#endif -#ifdef HAVE_MEMORY_H -#include -#endif +# ifdef HAVE_STRING_H +# include +# define ANSI_STRING +# else +# include +# endif +# ifdef HAVE_MEMORY_H +# include +# endif extern char *malloc (), *realloc (); extern void free (); @@ -151,35 +157,40 @@ #ifndef ANSI_STRING -#ifndef bzero +# ifndef bzero extern void bzero (); -#endif -#ifndef bcopy +# endif +# ifndef bcopy extern void bcopy (); -#endif +# endif -#define memcpy(d, s, n) bcopy ((s), (d), (n)) -#define strrchr rindex +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define strrchr rindex /* memset is only used for zero here, but let's be paranoid. */ -#define memset(s, better_be_zero, n) \ +# define memset(s, better_be_zero, n) \ ((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0))) #endif /* Not ANSI_STRING. */ #if !defined HAVE_STRCOLL && !defined _LIBC -#define strcoll strcmp +# define strcoll strcmp +#endif + +#if !defined HAVE_MEMPCPY && __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1 +# define HAVE_MEMPCPY 1 +# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len) #endif #ifndef __GNU_LIBRARY__ -#ifdef __GNUC__ +# ifdef __GNUC__ __inline -#endif -#ifndef __SASC -#ifdef WINDOWS32 +# endif +# ifndef __SASC +# ifdef WINDOWS32 static void * -#else +# else static char * -#endif +# endif my_realloc (p, n) char *p; unsigned int n; @@ -190,68 +201,85 @@ return (char *) malloc (n); return (char *) realloc (p, n); } -#define realloc my_realloc -#endif /* __SASC */ +# define realloc my_realloc +# endif /* __SASC */ #endif /* __GNU_LIBRARY__ */ -#if !defined(__alloca) && !defined(__GNU_LIBRARY__) +#if !defined __alloca && !defined __GNU_LIBRARY__ -#ifdef __GNUC__ -#undef alloca -#define alloca(n) __builtin_alloca (n) -#else /* Not GCC. */ -#ifdef HAVE_ALLOCA_H -#include -#else /* Not HAVE_ALLOCA_H. */ -#ifndef _AIX -#ifdef WINDOWS32 -#include -#else +# ifdef __GNUC__ +# undef alloca +# define alloca(n) __builtin_alloca (n) +# else /* Not GCC. */ +# ifdef HAVE_ALLOCA_H +# include +# else /* Not HAVE_ALLOCA_H. */ +# ifndef _AIX +# ifdef WINDOWS32 +# include +# else extern char *alloca (); -#endif /* WINDOWS32 */ -#endif /* Not _AIX. */ -#endif /* sparc or HAVE_ALLOCA_H. */ -#endif /* GCC. */ +# endif /* WINDOWS32 */ +# endif /* Not _AIX. */ +# endif /* sparc or HAVE_ALLOCA_H. */ +# endif /* GCC. */ -#define __alloca alloca +# define __alloca alloca #endif #ifndef __GNU_LIBRARY__ -#define __stat stat -#ifdef STAT_MACROS_BROKEN -#undef S_ISDIR -#endif -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +# define __stat stat +# ifdef STAT_MACROS_BROKEN +# undef S_ISDIR +# endif +# ifndef S_ISDIR +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +# endif #endif + +#ifdef _LIBC +# define strdup(str) __strdup (str) +# define sysconf(id) __sysconf (id) +# define closedir(dir) __closedir (dir) +# define opendir(name) __opendir (name) +# define readdir(str) __readdir (str) #endif -#if !(defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) -#undef size_t -#define size_t unsigned int +#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__) +# undef size_t +# define size_t unsigned int #endif /* Some system header files erroneously define these. We want our own definitions from to take precedence. */ -#undef FNM_PATHNAME -#undef FNM_NOESCAPE -#undef FNM_PERIOD +#ifndef __GNU_LIBRARY__ +# undef FNM_PATHNAME +# undef FNM_NOESCAPE +# undef FNM_PERIOD +#endif #include /* Some system header files erroneously define these. We want our own definitions from to take precedence. */ -#undef GLOB_ERR -#undef GLOB_MARK -#undef GLOB_NOSORT -#undef GLOB_DOOFFS -#undef GLOB_NOCHECK -#undef GLOB_APPEND -#undef GLOB_NOESCAPE -#undef GLOB_PERIOD +#ifndef __GNU_LIBRARY__ +# undef GLOB_ERR +# undef GLOB_MARK +# undef GLOB_NOSORT +# undef GLOB_DOOFFS +# undef GLOB_NOCHECK +# undef GLOB_APPEND +# undef GLOB_NOESCAPE +# undef GLOB_PERIOD +#endif #include +static +#if __GNUC__ - 0 >= 2 +inline +#endif +const char *next_brace_sub __P ((const char *begin)); static int glob_in_dir __P ((const char *pattern, const char *directory, int flags, int (*errfunc) __P ((const char *, int)), @@ -358,8 +386,12 @@ #endif /* We know the prefix for all sub-patterns. */ +#ifdef HAVE_MEMPCPY + alt_start = mempcpy (onealt, pattern, begin - pattern); +#else memcpy (onealt, pattern, begin - pattern); alt_start = &onealt[begin - pattern]; +#endif /* Find the first sub-pattern and at the same time find the rest after the closing brace. */ @@ -412,8 +444,12 @@ int result; /* Construct the new glob expression. */ +#ifdef HAVE_MEMPCPY + mempcpy (mempcpy (alt_start, p, next - p), rest, rest_len); +#else memcpy (alt_start, p, next - p); memcpy (&alt_start[next - p], rest, rest_len); +#endif result = glob (onealt, ((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) @@ -453,15 +489,38 @@ /* Find the filename. */ filename = strrchr (pattern, '/'); +#if defined __MSDOS__ || defined WINDOWS32 + /* The case of "d:pattern". Since `:' is not allowed in + file names, we can safely assume that wherever it + happens in pattern, it signals the filename part. This + is so we could some day support patterns like "[a-z]:foo". */ + if (filename == NULL) + filename = strchr (pattern, ':'); +#endif /* __MSDOS__ || WINDOWS32 */ if (filename == NULL) { - filename = pattern; + /* This can mean two things: a simple name or "~name". The later + case is nothing but a notation for a directory. */ + if ((flags & GLOB_TILDE) && pattern[0] == '~') + { + dirname = (char *) pattern; + dirlen = strlen (pattern); + + /* Set FILENAME to NULL as a special flag. This is ugly but + other solutions would require much more code. We test for + this special case below. */ + filename = NULL; + } + else + { + filename = pattern; #ifdef _AMIGA - dirname = (char *) ""; + dirname = (char *) ""; #else - dirname = (char *) "."; + dirname = (char *) "."; #endif - dirlen = 0; + dirlen = 0; + } } else if (filename == pattern) { @@ -473,19 +532,53 @@ else { dirlen = filename - pattern; +#if defined __MSDOS__ || defined WINDOWS32 + if ((*filename == ':') + || (filename > pattern + 1 && filename[-1] == ':')) + { + char *drive_spec; + + ++dirlen; + drive_spec = (char *) __alloca (dirlen + 1); +#ifdef HAVE_MEMPCPY + *((char *) mempcpy (drive_spec, pattern, dirlen)) = '\0'; +#else + memcpy (drive_spec, pattern, dirlen); + drive_spec[dirlen] = '\0'; +#endif + /* For now, disallow wildcards in the drive spec, to + prevent infinite recursion in glob. */ + if (__glob_pattern_p (drive_spec, !(flags & GLOB_NOESCAPE))) + return GLOB_NOMATCH; + /* If this is "d:pattern", we need to copy `:' to DIRNAME + as well. If it's "d:/pattern", don't remove the slash + from "d:/", since "d:" and "d:/" are not the same.*/ + } +#endif dirname = (char *) __alloca (dirlen + 1); +#ifdef HAVE_MEMPCPY + *((char *) mempcpy (dirname, pattern, dirlen)) = '\0'; +#else memcpy (dirname, pattern, dirlen); dirname[dirlen] = '\0'; +#endif ++filename; - } - if (filename[0] == '\0' && dirlen > 1) - /* "pattern/". Expand "pattern", appending slashes. */ - { - int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob); - if (val == 0) - pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK); - return val; + if (filename[0] == '\0' +#if defined __MSDOS__ || defined WINDOWS32 + && dirname[dirlen-1] != ':' + && (dirlen < 3 || dirname[dirlen-2] != ':' + || dirname[dirlen-1] != '/') +#endif + && dirlen > 1) + /* "pattern/". Expand "pattern", appending slashes. */ + { + int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob); + if (val == 0) + pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK) + | (flags & GLOB_MARK)); + return val; + } } if (!(flags & GLOB_APPEND)) @@ -503,18 +596,18 @@ { /* Look up home directory. */ char *home_dir = getenv ("HOME"); -#ifdef _AMIGA +# ifdef _AMIGA if (home_dir == NULL || home_dir[0] == '\0') home_dir = "SYS:"; -#else -#ifdef WINDOWS32 +# else +# ifdef WINDOWS32 if (home_dir == NULL || home_dir[0] == '\0') home_dir = "c:/users/default"; /* poor default */ -#else +# else if (home_dir == NULL || home_dir[0] == '\0') { int success; -#if defined HAVE_GETLOGIN_R || defined _LIBC +# if defined HAVE_GETLOGIN_R || defined _LIBC extern int getlogin_r __P ((char *, size_t)); size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1; char *name; @@ -526,15 +619,15 @@ name = (char *) __alloca (buflen); success = getlogin_r (name, buflen) >= 0; -#else +# else extern char *getlogin __P ((void)); char *name; success = (name = getlogin ()) != NULL; -#endif +# endif if (success) { -#if defined HAVE_GETPWNAM_R || defined _LIBC +# if defined HAVE_GETPWNAM_R || defined _LIBC size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX); char *pwtmpbuf; struct passwd pwbuf, *p; @@ -543,18 +636,18 @@ success = (__getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p) >= 0); -#else +# else struct passwd *p = getpwnam (name); success = p != NULL; -#endif +# endif if (success) home_dir = p->pw_dir; } } if (home_dir == NULL || home_dir[0] == '\0') home_dir = (char *) "~"; /* No luck. */ -#endif /* WINDOWS32 */ -#endif +# endif /* WINDOWS32 */ +# endif /* Now construct the full directory. */ if (dirname[1] == '\0') dirname = home_dir; @@ -563,12 +656,17 @@ char *newp; size_t home_len = strlen (home_dir); newp = (char *) __alloca (home_len + dirlen); +# ifdef HAVE_MEMPCPY + mempcpy (mempcpy (newp, home_dir, home_len), + &dirname[1], dirlen); +# else memcpy (newp, home_dir, home_len); memcpy (&newp[home_len], &dirname[1], dirlen); +# endif dirname = newp; } } -#if !defined _AMIGA && !defined WINDOWS32 +# if !defined _AMIGA && !defined WINDOWS32 else { char *end_name = strchr (dirname, '/'); @@ -580,13 +678,18 @@ else { user_name = (char *) __alloca (end_name - dirname); +# ifdef HAVE_MEMPCPY + *((char *) mempcpy (user_name, dirname + 1, end_name - dirname)) + = '\0'; +# else memcpy (user_name, dirname + 1, end_name - dirname); user_name[end_name - dirname - 1] = '\0'; +# endif } /* Look up specific user's home directory. */ { -#if defined HAVE_GETPWNAM_R || defined _LIBC +# if defined HAVE_GETPWNAM_R || defined _LIBC size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX); char *pwtmpbuf = (char *) __alloca (buflen); struct passwd pwbuf, *p; @@ -594,13 +697,13 @@ home_dir = p->pw_dir; else home_dir = NULL; -#else +# else struct passwd *p = getpwnam (user_name); if (p != NULL) home_dir = p->pw_dir; else home_dir = NULL; -#endif +# endif } /* If we found a home directory use this. */ if (home_dir != NULL) @@ -609,16 +712,74 @@ size_t home_len = strlen (home_dir); size_t rest_len = end_name == NULL ? 0 : strlen (end_name); newp = (char *) __alloca (home_len + rest_len + 1); +# ifdef HAVE_MEMPCPY + *((char *) mempcpy (mempcpy (newp, home_dir, home_len), + end_name, rest_len)) = '\0'; +# else memcpy (newp, home_dir, home_len); memcpy (&newp[home_len], end_name, rest_len); newp[home_len + rest_len] = '\0'; +# endif dirname = newp; } } -#endif /* Not Amiga && not WINDOWS32. */ +# endif /* Not Amiga && not WINDOWS32. */ } #endif /* Not VMS. */ + /* Now test whether we looked for "~" or "~NAME". In this case we + can give the answer now. */ + if (filename == NULL) + { + struct stat st; + + /* Return the directory if we don't check for error or if it exists. */ + if ((flags & GLOB_NOCHECK) + || (((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_stat) (dirname, &st) + : __stat (dirname, &st)) == 0 + && S_ISDIR (st.st_mode))) + { + pglob->gl_pathv + = (char **) realloc (pglob->gl_pathv, + (pglob->gl_pathc + + ((flags & GLOB_DOOFFS) ? + pglob->gl_offs : 0) + + 1 + 1) * + sizeof (char *)); + if (pglob->gl_pathv == NULL) + return GLOB_NOSPACE; + + if (flags & GLOB_DOOFFS) + while (pglob->gl_pathc < pglob->gl_offs) + pglob->gl_pathv[pglob->gl_pathc++] = NULL; + +#if defined HAVE_STRDUP || defined _LIBC + pglob->gl_pathv[pglob->gl_pathc] = strdup (dirname); +#else + { + size_t len = strlen (dirname) + 1; + char *dircopy = malloc (len); + if (dircopy != NULL) + pglob->gl_pathv[pglob->gl_pathc] = memcpy (dircopy, dirname, + len); + } +#endif + if (pglob->gl_pathv[pglob->gl_pathc] == NULL) + { + free (pglob->gl_pathv); + return GLOB_NOSPACE; + } + pglob->gl_pathv[++pglob->gl_pathc] = NULL; + pglob->gl_flags = flags; + + return 0; + } + + /* Not found. */ + return GLOB_NOMATCH; + } + if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) { /* The directory name contains metacharacters, so we @@ -628,8 +789,8 @@ register int i; status = glob (dirname, - ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) | - GLOB_NOSORT), + ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) + | GLOB_NOSORT | GLOB_ONLYDIR), errfunc, &dirs); if (status != 0) return status; @@ -639,7 +800,7 @@ appending the results to PGLOB. */ for (i = 0; i < dirs.gl_pathc; ++i) { - int oldcount; + int old_pathc; #ifdef SHELL { @@ -655,9 +816,10 @@ } #endif /* SHELL. */ - oldcount = pglob->gl_pathc; + old_pathc = pglob->gl_pathc; status = glob_in_dir (filename, dirs.gl_pathv[i], - (flags | GLOB_APPEND) & ~GLOB_NOCHECK, + ((flags | GLOB_APPEND) + & ~(GLOB_NOCHECK | GLOB_ERR)), errfunc, pglob); if (status == GLOB_NOMATCH) /* No matches in this directory. Try the next. */ @@ -672,8 +834,8 @@ /* Stick the directory on the front of each name. */ if (prefix_array (dirs.gl_pathv[i], - &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount)) + &pglob->gl_pathv[old_pathc], + pglob->gl_pathc - old_pathc)) { globfree (&dirs); globfree (pglob); @@ -683,26 +845,29 @@ flags |= GLOB_MAGCHAR; + /* We have ignored the GLOB_NOCHECK flag in the `glob_in_dir' calls. + But if we have not found any matching entry and thie GLOB_NOCHECK + flag was set we must return the list consisting of the disrectory + names followed by the filename. */ if (pglob->gl_pathc == oldcount) /* No matches. */ if (flags & GLOB_NOCHECK) { - size_t len = strlen (pattern) + 1; - char *patcopy = (char *) malloc (len); - if (patcopy == NULL) - return GLOB_NOSPACE; - memcpy (patcopy, pattern, len); + size_t filename_len = strlen (filename) + 1; + char **new_pathv; + struct stat st; + /* This is an pessimistic guess about the size. */ pglob->gl_pathv = (char **) realloc (pglob->gl_pathv, (pglob->gl_pathc + ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) + - 1 + 1) * + dirs.gl_pathc + 1) * sizeof (char *)); if (pglob->gl_pathv == NULL) { - free (patcopy); + globfree (&dirs); return GLOB_NOSPACE; } @@ -710,12 +875,55 @@ while (pglob->gl_pathc < pglob->gl_offs) pglob->gl_pathv[pglob->gl_pathc++] = NULL; - pglob->gl_pathv[pglob->gl_pathc++] = patcopy; + for (i = 0; i < dirs.gl_pathc; ++i) + { + const char *dir = dirs.gl_pathv[i]; + size_t dir_len = strlen (dir); + + /* First check whether this really is a directory. */ + if (((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0 + || !S_ISDIR (st.st_mode)) + /* No directory, ignore this entry. */ + continue; + + pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1 + + filename_len); + if (pglob->gl_pathv[pglob->gl_pathc] == NULL) + { + globfree (&dirs); + globfree (pglob); + return GLOB_NOSPACE; + } + +#ifdef HAVE_MEMPCPY + mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc], + dir, dir_len), + "/", 1), + filename, filename_len); +#else + memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len); + pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/'; + memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1], + filename, filename_len); +#endif + ++pglob->gl_pathc; + } + pglob->gl_pathv[pglob->gl_pathc] = NULL; pglob->gl_flags = flags; + + /* Now we know how large the gl_pathv vector must be. */ + new_pathv = (char **) realloc (pglob->gl_pathv, + ((pglob->gl_pathc + 1) + * sizeof (char *))); + if (new_pathv != NULL) + pglob->gl_pathv = new_pathv; } else return GLOB_NOMATCH; + + globfree (&dirs); } else { @@ -726,9 +934,14 @@ if (dirlen > 0) { /* Stick the directory on the front of each name. */ + int ignore = oldcount; + + if ((flags & GLOB_DOOFFS) && ignore < pglob->gl_offs) + ignore = pglob->gl_offs; + if (prefix_array (dirname, - &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount)) + &pglob->gl_pathv[ignore], + pglob->gl_pathc - ignore)) { globfree (pglob); return GLOB_NOSPACE; @@ -742,10 +955,10 @@ int i; struct stat st; for (i = oldcount; i < pglob->gl_pathc; ++i) - if (((flags & GLOB_ALTDIRFUNC) ? - (*pglob->gl_stat) (pglob->gl_pathv[i], &st) : - __stat (pglob->gl_pathv[i], &st)) == 0 && - S_ISDIR (st.st_mode)) + if (((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_stat) (pglob->gl_pathv[i], &st) + : __stat (pglob->gl_pathv[i], &st)) == 0 + && S_ISDIR (st.st_mode)) { size_t len = strlen (pglob->gl_pathv[i]) + 2; char *new = realloc (pglob->gl_pathv[i], len); @@ -760,10 +973,17 @@ } if (!(flags & GLOB_NOSORT)) - /* Sort the vector. */ - qsort ((__ptr_t) &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount, - sizeof (char *), collated_compare); + { + /* Sort the vector. */ + int non_sort = oldcount; + + if ((flags & GLOB_DOOFFS) && pglob->gl_offs > oldcount) + non_sort = pglob->gl_offs; + + qsort ((__ptr_t) &pglob->gl_pathv[non_sort], + pglob->gl_pathc - non_sort, + sizeof (char *), collated_compare); + } return 0; } @@ -816,11 +1036,31 @@ { register size_t i; size_t dirlen = strlen (dirname); +#if defined __MSDOS__ || defined WINDOWS32 + int sep_char = '/'; +# define DIRSEP_CHAR sep_char +#else +# define DIRSEP_CHAR '/' +#endif if (dirlen == 1 && dirname[0] == '/') /* DIRNAME is just "/", so normal prepending would get us "//foo". We want "/foo" instead, so don't prepend any chars from DIRNAME. */ dirlen = 0; +#if defined __MSDOS__ || defined WINDOWS32 + else if (dirlen > 1) + { + if (dirname[dirlen - 1] == '/') + /* DIRNAME is "d:/". Don't prepend the slash from DIRNAME. */ + --dirlen; + else if (dirname[dirlen - 1] == ':') + { + /* DIRNAME is "d:". Use `:' instead of `/'. */ + --dirlen; + sep_char = ':'; + } + } +#endif for (i = 0; i < n; ++i) { @@ -833,9 +1073,17 @@ return 1; } +#ifdef HAVE_MEMPCPY + { + char *endp = (char *) mempcpy (new, dirname, dirlen); + *endp++ = DIRSEP_CHAR; + mempcpy (endp, array[i], eltlen); + } +#else memcpy (new, dirname, dirlen); - new[dirlen] = '/'; + new[dirlen] = DIRSEP_CHAR; memcpy (&new[dirlen + 1], array[i], eltlen); +#endif free ((__ptr_t) array[i]); array[i] = new; } @@ -895,7 +1143,7 @@ int (*errfunc) __P ((const char *, int)); glob_t *pglob; { - __ptr_t stream; + __ptr_t stream = NULL; struct globlink { @@ -903,69 +1151,131 @@ char *name; }; struct globlink *names = NULL; - size_t nfound = 0; + size_t nfound; + int meta; + int save; - if (!__glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) + meta = __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)); + if (meta == 0) { - stream = NULL; - flags |= GLOB_NOCHECK; + if (flags & (GLOB_NOCHECK|GLOB_NOMAGIC)) + /* We need not do any tests. The PATTERN contains no meta + characters and we must not return an error therefore the + result will always contain exactly one name. */ + flags |= GLOB_NOCHECK; + else + { + /* Since we use the normal file functions we can also use stat() + to verify the file is there. */ + struct stat st; + size_t patlen = strlen (pattern); + size_t dirlen = strlen (directory); + char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1); + +# ifdef HAVE_MEMPCPY + mempcpy (mempcpy (mempcpy (fullname, directory, dirlen), + "/", 1), + pattern, patlen + 1); +# else + memcpy (fullname, directory, dirlen); + fullname[dirlen] = '/'; + memcpy (&fullname[dirlen + 1], pattern, patlen + 1); +# endif + if (((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_stat) (fullname, &st) + : __stat (fullname, &st)) == 0) + /* We found this file to be existing. Now tell the rest + of the function to copy this name into the result. */ + flags |= GLOB_NOCHECK; + } + + nfound = 0; } else { - flags |= GLOB_MAGCHAR; - - stream = ((flags & GLOB_ALTDIRFUNC) ? - (*pglob->gl_opendir) (directory) : - (__ptr_t) opendir (directory)); - if (stream == NULL) - { - if ((errfunc != NULL && (*errfunc) (directory, errno)) || - (flags & GLOB_ERR)) - return GLOB_ABORTED; + if (pattern[0] == '\0') + { + /* This is a special case for matching directories like in + "*a/". */ + names = (struct globlink *) __alloca (sizeof (struct globlink)); + names->name = (char *) malloc (1); + if (names->name == NULL) + goto memory_error; + names->name[0] = '\0'; + names->next = NULL; + nfound = 1; + meta = 0; } else - while (1) - { - const char *name; - size_t len; - struct dirent *d = ((flags & GLOB_ALTDIRFUNC) ? - (*pglob->gl_readdir) (stream) : - readdir ((DIR *) stream)); - if (d == NULL) - break; - if (! REAL_DIR_ENTRY (d)) - continue; - - name = d->d_name; + { + stream = ((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_opendir) (directory) + : (__ptr_t) opendir (directory)); + if (stream == NULL) + { + if ((errfunc != NULL && (*errfunc) (directory, errno)) + || (flags & GLOB_ERR)) + return GLOB_ABORTED; + nfound = 0; + meta = 0; + } + else + { + int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) + | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0) +#if defined _AMIGA || defined VMS + | FNM_CASEFOLD +#endif + ); + nfound = 0; + flags |= GLOB_MAGCHAR; - if (fnmatch (pattern, name, - (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) | - ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0) -#ifdef _AMIGA - | FNM_CASEFOLD + while (1) + { + const char *name; + size_t len; + struct dirent *d = ((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_readdir) (stream) + : readdir ((DIR *) stream)); + if (d == NULL) + break; + if (! REAL_DIR_ENTRY (d)) + continue; + +#ifdef HAVE_D_TYPE + /* If we shall match only directories use the information + provided by the dirent call if possible. */ + if ((flags & GLOB_ONLYDIR) + && d->d_type != DT_UNKNOWN && d->d_type != DT_DIR) + continue; +#endif + + name = d->d_name; + + if (fnmatch (pattern, name, fnm_flags) == 0) + { + struct globlink *new = (struct globlink *) + __alloca (sizeof (struct globlink)); + len = NAMLEN (d); + new->name = (char *) malloc (len + 1); + if (new->name == NULL) + goto memory_error; +#ifdef HAVE_MEMPCPY + *((char *) mempcpy ((__ptr_t) new->name, name, len)) + = '\0'; +#else + memcpy ((__ptr_t) new->name, name, len); + new->name[len] = '\0'; #endif - ) == 0) - { - struct globlink *new - = (struct globlink *) __alloca (sizeof (struct globlink)); - len = NAMLEN (d); - new->name - = (char *) malloc (len + 1); - if (new->name == NULL) - goto memory_error; - memcpy ((__ptr_t) new->name, name, len); - new->name[len] = '\0'; - new->next = names; - names = new; - ++nfound; - } - } + new->next = names; + names = new; + ++nfound; + } + } + } + } } - if (nfound == 0 && (flags & GLOB_NOMAGIC) && - ! __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) - flags |= GLOB_NOCHECK; - if (nfound == 0 && (flags & GLOB_NOCHECK)) { size_t len = strlen (pattern); @@ -975,38 +1285,44 @@ names->name = (char *) malloc (len + 1); if (names->name == NULL) goto memory_error; +#ifdef HAVE_MEMPCPY + *((char *) mempcpy (names->name, pattern, len)) = '\0'; +#else memcpy (names->name, pattern, len); names->name[len] = '\0'; +#endif } - pglob->gl_pathv - = (char **) realloc (pglob->gl_pathv, - (pglob->gl_pathc + - ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) + - nfound + 1) * - sizeof (char *)); - if (pglob->gl_pathv == NULL) - goto memory_error; - - if (flags & GLOB_DOOFFS) - while (pglob->gl_pathc < pglob->gl_offs) - pglob->gl_pathv[pglob->gl_pathc++] = NULL; - - for (; names != NULL; names = names->next) - pglob->gl_pathv[pglob->gl_pathc++] = names->name; - pglob->gl_pathv[pglob->gl_pathc] = NULL; + if (nfound != 0) + { + pglob->gl_pathv + = (char **) realloc (pglob->gl_pathv, + (pglob->gl_pathc + + ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) + + nfound + 1) * + sizeof (char *)); + if (pglob->gl_pathv == NULL) + goto memory_error; - pglob->gl_flags = flags; + if (flags & GLOB_DOOFFS) + while (pglob->gl_pathc < pglob->gl_offs) + pglob->gl_pathv[pglob->gl_pathc++] = NULL; + + for (; names != NULL; names = names->next) + pglob->gl_pathv[pglob->gl_pathc++] = names->name; + pglob->gl_pathv[pglob->gl_pathc] = NULL; - if (stream != NULL) - { - int save = errno; - if (flags & GLOB_ALTDIRFUNC) - (*pglob->gl_closedir) (stream); - else - closedir ((DIR *) stream); - __set_errno (save); + pglob->gl_flags = flags; } + + save = errno; + if (stream != NULL) + if (flags & GLOB_ALTDIRFUNC) + (*pglob->gl_closedir) (stream); + else + closedir ((DIR *) stream); + __set_errno (save); + return nfound == 0 ? GLOB_NOMATCH : 0; memory_error: diff -uPr make-3.76.1/glob/glob.h make-3.77/glob/glob.h --- make-3.76.1/glob/glob.h Wed Aug 27 16:43:43 1997 +++ make-3.77/glob/glob.h Mon Dec 22 16:59:07 1997 @@ -19,13 +19,11 @@ #define _GLOB_H 1 #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif #undef __ptr_t -#if (defined __cplusplus || (defined __STDC__ && __STDC__) \ - || defined WINDOWS32) +#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 # undef __P # define __P(protos) protos # define __ptr_t void * @@ -57,11 +55,12 @@ # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */ # define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */ # define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */ -# define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */ +# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */ +# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */ # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \ - GLOB_NOMAGIC|GLOB_TILDE) + GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR) #else # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ @@ -77,6 +76,14 @@ /* Previous versions of this file defined GLOB_ABEND instead of GLOB_ABORTED. Provide a compatibility definition here. */ # define GLOB_ABEND GLOB_ABORTED +#endif + +/* This value is returned if the implementation does not support + `glob'. Since this is not the case here it will never be + returned but the conformance test suites still require the symbol + to be defined. */ +#if (_XOPEN_SOURCE - 0) == 500 +# define GLOB_NOSYS (-1) #endif /* Structure describing a globbing run. */ diff -uPr make-3.76.1/glob/stamp-h.in make-3.77/glob/stamp-h.in --- make-3.76.1/glob/stamp-h.in Wed Dec 31 19:00:00 1969 +++ make-3.77/glob/stamp-h.in Wed Jul 29 22:33:00 1998 @@ -0,0 +1 @@ +timestamp diff -uPr make-3.76.1/implicit.c make-3.77/implicit.c --- make-3.76.1/implicit.c Wed Aug 27 16:31:12 1997 +++ make-3.77/implicit.c Fri Jul 10 00:06:40 1998 @@ -111,14 +111,14 @@ /* This buffer records all the dependencies actually found for a rule. */ char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *)); /* Number of dep names now in FOUND_FILES. */ - unsigned int deps_found; + unsigned int deps_found = 0; /* Names of possible dependencies are constructed in this buffer. */ register char *depname = (char *) alloca (namelen + max_pattern_dep_length); /* The start and length of the stem of FILENAME for the current rule. */ - register char *stem; - register unsigned int stemlen; + register char *stem = 0; + register unsigned int stemlen = 0; /* Buffer in which we store all the rules that are possibly applicable. */ struct rule **tryrules diff -uPr make-3.76.1/job.c make-3.77/job.c --- make-3.76.1/job.c Fri Sep 5 17:01:57 1997 +++ make-3.77/job.c Mon Jul 27 09:53:31 1998 @@ -27,11 +27,12 @@ #ifdef WINDOWS32 char *default_shell = "sh.exe"; int no_default_sh_exe = 1; +int batch_mode_shell = 1; #else /* WINDOWS32 */ #ifdef _AMIGA char default_shell[] = ""; extern int MyExecute (char **); -#else +#else /* _AMIGA */ #ifdef __MSDOS__ /* The default shell is a pointer so we can change it if Makefile says so. It is without an explicit path so we get a chance @@ -41,6 +42,7 @@ #else /* __MSDOS__ */ char default_shell[] = "/bin/sh"; #endif /* __MSDOS__ */ +int batch_mode_shell = 0; #endif /* _AMIGA */ #endif /* WINDOWS32 */ @@ -74,11 +76,6 @@ #include "sub_proc.h" #include "w32err.h" #include "pathstuff.h" - -/* this stuff used if no sh.exe is around */ -static char *dos_bname; -static char *dos_bename; -static int dos_batch_file; #endif /* WINDOWS32 */ #ifdef HAVE_FCNTL_H @@ -168,7 +165,7 @@ extern int getloadavg PARAMS ((double loadavg[], int nelem)); extern int start_remote_job PARAMS ((char **argv, char **envp, int stdin_fd, int *is_remote, int *id_ptr, int *used_stdin)); -extern int start_remote_job_p PARAMS ((void)); +extern int start_remote_job_p PARAMS ((int)); extern int remote_status PARAMS ((int *exit_code_ptr, int *signal_ptr, int *coredump_ptr, int block)); @@ -327,9 +324,9 @@ any_remote |= c->remote; any_local |= ! c->remote; if (debug_flag) - printf ("Live child 0x%08lx PID %d%s\n", + printf ("Live child 0x%08lx PID %ld%s\n", (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); + (long) c->pid, c->remote ? " (remote)" : ""); #ifdef VMS break; #endif @@ -426,38 +423,33 @@ coredump = 0; #endif /* _AMIGA */ #ifdef WINDOWS32 - { - HANDLE hPID; - int err; - - /* wait for anything to finish */ - if (hPID = process_wait_for_any()) { - - /* was an error found on this process? */ - err = process_last_err(hPID); - - /* get exit data */ - exit_code = process_exit_code(hPID); - - if (err) - fprintf(stderr, "make (e=%d): %s", - exit_code, map_windows32_error_to_string(exit_code)); - - exit_sig = process_signal(hPID); - - /* cleanup process */ - process_cleanup(hPID); - - if (dos_batch_file) { - remove (dos_bname); - remove (dos_bename); - dos_batch_file = 0; - } - - coredump = 0; - } - pid = (int) hPID; - } + { + HANDLE hPID; + int err; + + /* wait for anything to finish */ + if (hPID = process_wait_for_any()) { + + /* was an error found on this process? */ + err = process_last_err(hPID); + + /* get exit data */ + exit_code = process_exit_code(hPID); + + if (err) + fprintf(stderr, "make (e=%d): %s", + exit_code, map_windows32_error_to_string(exit_code)); + + /* signal */ + exit_sig = process_signal(hPID); + + /* cleanup process */ + process_cleanup(hPID); + + coredump = 0; + } + pid = (int) hPID; + } #endif /* WINDOWS32 */ #endif /* Not __MSDOS__ */ } @@ -498,10 +490,22 @@ else { if (debug_flag) - printf ("Reaping %s child 0x%08lx PID %d%s\n", + printf ("Reaping %s child 0x%08lx PID %ld%s\n", child_failed ? "losing" : "winning", (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); + (long) c->pid, c->remote ? " (remote)" : ""); + + if (c->sh_batch_file) { + if (debug_flag) + printf("Cleaning up temporary batch file %s\n", c->sh_batch_file); + + /* just try and remove, don't care if this fails */ + remove(c->sh_batch_file); + + /* all done with memory */ + free(c->sh_batch_file); + c->sh_batch_file = NULL; + } /* If this child had the good stdin, say it is now free. */ if (c->good_stdin) @@ -549,7 +553,7 @@ Whether or not we want to changes over time. Also, start_remote_job may need state set up by start_remote_job_p. */ - c->remote = start_remote_job_p (); + c->remote = start_remote_job_p (0); start_job_command (c); /* Fatal signals are left blocked in case we were about to put that child on the chain. But it is @@ -586,9 +590,9 @@ notice_finished_file (c->file); if (debug_flag) - printf ("Removing child 0x%08lx PID %d%s from chain.\n", + printf ("Removing child 0x%08lx PID %ld%s from chain.\n", (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); + (long) c->pid, c->remote ? " (remote)" : ""); /* Block fatal signals while frobnicating the list, so that children and job_slots_used are always consistent. Otherwise @@ -740,7 +744,7 @@ #ifdef VMS argv = p; #else - argv = construct_command_argv (p, &end, child->file); + argv = construct_command_argv (p, &end, child->file, &child->sh_batch_file); #endif if (end == NULL) child->command_ptr = NULL; @@ -765,6 +769,9 @@ if (argv == 0) { next_command: +#ifdef __MSDOS__ + execute_by_shell = 0; /* in case construct_command_argv sets it */ +#endif /* This line has no commands. Go to the next. */ if (job_next_command (child)) start_job_command (child); @@ -887,7 +894,9 @@ if (start_remote_job (argv, child->environment, child->good_stdin ? 0 : bad_stdin, &is_remote, &id, &used_stdin)) - goto error; + /* Don't give up; remote execution may fail for various reasons. If + so, simply run the job locally. */ + goto run_local; else { if (child->good_stdin && !used_stdin) @@ -906,6 +915,7 @@ char **parent_environ; + run_local: block_sigs (); child->remote = 0; @@ -1066,7 +1076,7 @@ the local load average. We record that the job should be started remotely in C->remote for start_job_command to test. */ - c->remote = start_remote_job_p (); + c->remote = start_remote_job_p (1); /* If this job is to be started locally, and we are already running some jobs, make this one wait if the load average is too high. */ @@ -1251,6 +1261,7 @@ c->command_line = 0; c->command_ptr = 0; c->environment = 0; + c->sh_batch_file = NULL; /* Fetch the first command line to be run. */ job_next_command (c); @@ -1479,11 +1490,12 @@ } *c = *p; - /* check for maximum dcl length and create *.com file if neccesary */ + /* Check for maximum DCL length and create *.com file if neccesary. + Also create a .com file if the command is more than one line long. */ comname[0] = '\0'; - if (strlen (cmd) > MAXCMDLEN) + if (strlen (cmd) > MAXCMDLEN || strchr (cmd, '\n')) { FILE *outfile; char tmp; @@ -1743,9 +1755,10 @@ IFS is the value of $IFS, or nil (meaning the default). */ static char ** -construct_command_argv_internal (line, restp, shell, ifs) +construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr) char *line, **restp; char *shell, *ifs; + char **batch_filename_ptr; { #ifdef __MSDOS__ /* MSDOS supports both the stock DOS shell and ports of Unixy shells. @@ -1810,7 +1823,11 @@ "logout", "set", "umask", "wait", "while", "for", "case", "if", ":", ".", "break", "continue", "export", "read", "readonly", "shift", "times", - "trap", "switch", "test", 0 }; + "trap", "switch", "test", +#ifdef BATCH_MODE_ONLY_SHELL + "echo", +#endif + 0 }; char* sh_chars; char** sh_cmds; #else /* WINDOWS32 */ @@ -2144,38 +2161,6 @@ ++line; if (*line == '\0') return 0; - - /* - * only come here if no sh.exe command - */ - if (no_default_sh_exe) - { - FILE *batch; - dos_batch_file = 1; - if (dos_bname == 0) - { - dos_bname = tempnam (".", "mk"); - for (i = 0; dos_bname[i] != '\0'; ++i) - if (dos_bname[i] == '/') - dos_bname[i] = '\\'; - dos_bename = (char *) xmalloc (strlen (dos_bname) + 5); - strcpy (dos_bename, dos_bname); - strcat (dos_bname, ".bat"); - strcat (dos_bename, ".err"); - } - batch = fopen (dos_bename, "w"); /* Create a file. */ - if (batch != NULL) - fclose (batch); - batch = fopen (dos_bname, "w"); - fputs ("@echo off\n", batch); - fputs (line, batch); - fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename); - fclose (batch); - new_argv = (char **) xmalloc(2 * sizeof(char *)); - new_argv[0] = strdup (dos_bname); - new_argv[1] = 0; - } - else #endif /* WINDOWS32 */ { /* SHELL may be a multi-word command. Construct a command line @@ -2189,12 +2174,14 @@ char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1) + (line_len * 2) + 1); + char* command_ptr = NULL; /* used for batch_mode_shell mode */ ap = new_line; bcopy (shell, ap, shell_len); ap += shell_len; bcopy (minus_c, ap, sizeof (minus_c) - 1); ap += sizeof (minus_c) - 1; + command_ptr = ap; for (p = line; *p != '\0'; ++p) { if (restp != NULL && *p == '\n') @@ -2218,14 +2205,14 @@ p = next_token (p); --p; - if (unixy_shell) - *ap++ = '\\'; + if (unixy_shell && !batch_mode_shell) + *ap++ = '\\'; *ap++ = ' '; continue; } /* DOS shells don't know about backslash-escaping. */ - if (unixy_shell && + if (unixy_shell && !batch_mode_shell && (*p == '\\' || *p == '\'' || *p == '"' || isspace (*p) || index (sh_chars, *p) != 0)) @@ -2246,9 +2233,63 @@ return 0; *ap = '\0'; +#ifdef WINDOWS32 + /* + * Some shells do not work well when invoked as 'sh -c xxx' to run + * a command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems). + * In these cases, run commands via a script file. + */ + if ((no_default_sh_exe || batch_mode_shell) && batch_filename_ptr) { + FILE* batch = NULL; + int id = GetCurrentProcessId(); + PATH_VAR(fbuf); + char* fname = NULL; + + /* create a file name */ + sprintf(fbuf, "make%d", id); + fname = tempnam(".", fbuf); + + /* create batch file name */ + *batch_filename_ptr = xmalloc(strlen(fname) + 5); + strcpy(*batch_filename_ptr, fname); + + /* make sure path name is in DOS backslash format */ + if (!unixy_shell) { + fname = *batch_filename_ptr; + for (i = 0; fname[i] != '\0'; ++i) + if (fname[i] == '/') + fname[i] = '\\'; + strcat(*batch_filename_ptr, ".bat"); + } else { + strcat(*batch_filename_ptr, ".sh"); + } + + if (debug_flag) + printf("Creating temporary batch file %s\n", *batch_filename_ptr); + + /* create batch file to execute command */ + batch = fopen (*batch_filename_ptr, "w"); + fputs ("@echo off\n", batch); + fputs (command_ptr, batch); + fputc ('\n', batch); + fclose (batch); + + /* create argv */ + new_argv = (char **) xmalloc(3 * sizeof(char *)); + if (unixy_shell) { + new_argv[0] = strdup (shell); + new_argv[1] = *batch_filename_ptr; /* only argv[0] gets freed later */ + } else { + new_argv[0] = strdup (*batch_filename_ptr); + new_argv[1] = NULL; + } + new_argv[2] = NULL; + } else +#endif /* WINDOWS32 */ if (unixy_shell) new_argv = construct_command_argv_internal (new_line, (char **) NULL, - (char *) 0, (char *) 0); + (char *) 0, (char *) 0, + (char *) 0); #ifdef __MSDOS__ else { @@ -2262,6 +2303,10 @@ new_line + shell_len + sizeof (minus_c) - 1, line_len); new_argv[0][line_len] = '\0'; } +#else + else + fatal("%s (line %d) Invalid shell context (!unixy && !batch_mode_shell)\n", + __FILE__, __LINE__); #endif } #endif /* ! AMIGA */ @@ -2283,9 +2328,10 @@ variable expansion for $(SHELL) and $(IFS). */ char ** -construct_command_argv (line, restp, file) +construct_command_argv (line, restp, file, batch_filename_ptr) char *line, **restp; struct file *file; + char** batch_filename_ptr; { char *shell, *ifs; char **argv; @@ -2311,7 +2357,7 @@ warn_undefined_variables_flag = save; } - argv = construct_command_argv_internal (line, restp, shell, ifs); + argv = construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr); free (shell); free (ifs); diff -uPr make-3.76.1/job.h make-3.77/job.h --- make-3.76.1/job.h Sat Jun 22 17:42:15 1996 +++ make-3.77/job.h Mon Mar 2 03:36:44 1998 @@ -44,6 +44,7 @@ unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */ unsigned int deleted:1; /* Nonzero if targets have been deleted. */ + char* sh_batch_file; /* used to execute shell commands via scripts */ }; extern struct child *children; @@ -52,7 +53,7 @@ extern void reap_children PARAMS ((int block, int err)); extern void start_waiting_jobs PARAMS ((void)); -extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file)); +extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file)); #ifdef VMS extern int child_execute_job PARAMS ((char *argv, struct child *child)); #else diff -uPr make-3.76.1/main.c make-3.77/main.c --- make-3.76.1/main.c Fri Sep 19 09:20:44 1997 +++ make-3.77/main.c Mon Jul 20 17:06:35 1998 @@ -1,5 +1,5 @@ /* Argument parsing and main program of GNU Make. -Copyright (C) 1988,89,90,91,94,95,96,97 Free Software Foundation, Inc. +Copyright (C) 1988,89,90,91,94,95,96,97,98 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify @@ -180,7 +180,6 @@ static struct stringlist *makefiles = 0; - /* Number of job slots (commands that can be run at once). */ unsigned int job_slots = 1; @@ -532,7 +531,98 @@ return EXCEPTION_CONTINUE_SEARCH; #else exit(255); + return (255); /* not reached */ +#endif +} + +/* + * On WIN32 systems we don't have the luxury of a /bin directory that + * is mapped globally to every drive mounted to the system. Since make could + * be invoked from any drive, and we don't want to propogate /bin/sh + * to every single drive. Allow ourselves a chance to search for + * a value for default shell here (if the default path does not exist). + */ + +int +find_and_set_default_shell(char *token) +{ + int sh_found = 0; + char* search_token; + PATH_VAR(sh_path); + extern char *default_shell; + + if (!token) + search_token = default_shell; + else + search_token = token; + + if (!no_default_sh_exe && + (token == NULL || !strcmp(search_token, default_shell))) { + /* no new information, path already set or known */ + sh_found = 1; + } else if (file_exists_p(search_token)) { + /* search token path was found */ + sprintf(sh_path, "%s", search_token); + default_shell = strdup(w32ify(sh_path,0)); + if (debug_flag) + printf("find_and_set_shell setting default_shell = %s\n", default_shell); + sh_found = 1; + } else { + char *p; + struct variable *v = lookup_variable ("Path", 4); + + /* + * Search Path for shell + */ + if (v && v->value) { + char *ep; + + p = v->value; + ep = strchr(p, PATH_SEPARATOR_CHAR); + + while (ep && *ep) { + *ep = '\0'; + + if (dir_file_exists_p(p, search_token)) { + sprintf(sh_path, "%s/%s", p, search_token); + default_shell = strdup(w32ify(sh_path,0)); + sh_found = 1; + *ep = PATH_SEPARATOR_CHAR; + + /* terminate loop */ + p += strlen(p); + } else { + *ep = PATH_SEPARATOR_CHAR; + p = ++ep; + } + + ep = strchr(p, PATH_SEPARATOR_CHAR); + } + + /* be sure to check last element of Path */ + if (p && *p && dir_file_exists_p(p, search_token)) { + sprintf(sh_path, "%s/%s", p, search_token); + default_shell = strdup(w32ify(sh_path,0)); + sh_found = 1; + } + + if (debug_flag && sh_found) + printf("find_and_set_shell path search set default_shell = %s\n", default_shell); + } + } + + /* naive test */ + if (!unixy_shell && sh_found && + (strstr(default_shell, "sh") || strstr(default_shell, "SH"))) { + unixy_shell = 1; + batch_mode_shell = 0; + } + +#ifdef BATCH_MODE_ONLY_SHELL + batch_mode_shell = 1; #endif + + return (sh_found); } #endif /* WINDOWS32 */ @@ -556,17 +646,21 @@ int main (int argc, char ** argv) #endif { + static char *stdin_nm = 0; register struct file *f; register unsigned int i; char **p; struct dep *read_makefiles; PATH_VAR (current_directory); #ifdef WINDOWS32 - extern int no_default_sh_exe; char *unix_path = NULL; char *windows32_path = NULL; SetUnhandledExceptionFilter(handle_runtime_exceptions); + + /* start off assuming we have no shell */ + unixy_shell = 0; + no_default_sh_exe = 1; #endif default_goal_file = 0; @@ -708,20 +802,28 @@ #ifndef _AMIGA for (i = 0; envp[i] != 0; ++i) { + int do_not_define; register char *ep = envp[i]; + + /* by default, everything gets defined and exported */ + do_not_define = 0; + while (*ep != '=') - ++ep; + ++ep; #ifdef WINDOWS32 if (!unix_path && !strncmp(envp[i], "PATH=", 5)) unix_path = ep+1; - if (!windows32_path && !strncmp(envp[i], "Path=", 5)) + else if (!windows32_path && !strnicmp(envp[i], "Path=", 5)) { + do_not_define = 1; /* it gets defined after loop exits */ windows32_path = ep+1; + } #endif /* The result of pointer arithmetic is cast to unsigned int for machines where ptrdiff_t is a different size that doesn't widen the same. */ - define_variable (envp[i], (unsigned int) (ep - envp[i]), - ep + 1, o_env, 1) + if (!do_not_define) + define_variable (envp[i], (unsigned int) (ep - envp[i]), + ep + 1, o_env, 1) /* Force exportation of every variable culled from the environment. We used to rely on target_environment's v_default code to do this. But that does not work for the case where an environment variable @@ -731,6 +833,16 @@ } #ifdef WINDOWS32 /* + * Make sure that this particular spelling of 'Path' is available + */ + if (windows32_path) + define_variable("Path", 4, windows32_path, o_env, 1)->export = v_export; + else if (unix_path) + define_variable("Path", 4, unix_path, o_env, 1)->export = v_export; + else + define_variable("Path", 4, "", o_env, 1)->export = v_export; + + /* * PATH defaults to Path iff PATH not found and Path is found. */ if (!unix_path && windows32_path) @@ -840,7 +952,7 @@ if (! v->recursive) ++len; ++len; - len += 2 * strlen (v->value); + len += 3 * strlen (v->value); } /* Now allocate a buffer big enough and fill it. */ @@ -899,68 +1011,8 @@ * lookups to fail because the current directory (.) was pointing * at the wrong place when it was first evaluated. */ + no_default_sh_exe = !find_and_set_default_shell(NULL); - /* - * On Windows/NT, we don't have the luxury of a /bin directory that - * is mapped globally to every drive mounted to the system. Since make could - * be invoked from any drive, and we don't want to propogate /bin/sh - * to every single drive. Allow ourselves a chance to search for - * a value for default shell here (if the default path does not exist). - * - * The value of default_shell is set here, but it could get reset after - * the Makefiles are read in. See logic below where SHELL is checked - * after the call to read_all_makefiles() completes. - * - * The reason SHELL is set here is so that macros can be safely evaluated - * as makefiles are read in (some macros require $SHELL). - */ - - { - extern char *default_shell; - - if (!file_exists_p(default_shell)) { - char *p; - struct variable *v = lookup_variable ("Path", 4); - - /* - * Try and make sure we have a full path to default_shell before - * we parse makefiles. - */ - if (v && v->value) { - PATH_VAR(sh_path); - char *ep; - - p = v->value; - ep = strchr(p, PATH_SEPARATOR_CHAR); - - while (ep && *ep) { - *ep = '\0'; - - if (dir_file_exists_p(p, default_shell)) { - sprintf(sh_path, "%s/%s", p, default_shell); - default_shell = strdup(w32ify(sh_path,0)); - no_default_sh_exe = 0; - *ep = PATH_SEPARATOR_CHAR; - - /* terminate loop */ - p += strlen(p); - } else { - *ep = PATH_SEPARATOR_CHAR; - p = ++ep; - } - - ep = strchr(p, PATH_SEPARATOR_CHAR); - } - - /* be sure to check last element of Path */ - if (p && *p && dir_file_exists_p(p, default_shell)) { - sprintf(sh_path, "%s/%s", p, default_shell); - default_shell = strdup(w32ify(sh_path,0)); - no_default_sh_exe = 0; - } - } - } - } #endif /* WINDOWS32 */ /* Figure out the level of recursion. */ { @@ -1007,6 +1059,8 @@ starting_directory = current_directory; } + (void) define_variable ("CURDIR", 6, current_directory, o_default, 0); + /* Read any stdin makefiles into temporary files. */ if (makefiles != 0) @@ -1034,6 +1088,9 @@ (void) tmpnam (name); #endif + if (stdin_nm) + fatal("Makefile from standard input specified twice."); + outfile = fopen (name, "w"); if (outfile == 0) pfatal_with_name ("fopen (temporary file)"); @@ -1044,9 +1101,6 @@ if (n > 0 && fwrite (buf, 1, n, outfile) != n) pfatal_with_name ("fwrite (temporary file)"); } - /* Try to make sure we won't remake the temporary - file when we are re-exec'd. Kludge-o-matic! */ - fprintf (outfile, "%s:;\n", name); (void) fclose (outfile); /* Replace the name that read_all_makefiles will @@ -1060,14 +1114,15 @@ } /* Make sure the temporary file will not be remade. */ - f = enter_file (savestring (name, sizeof name - 1)); + stdin_nm = savestring (name, sizeof(name) -1); + f = enter_file (stdin_nm); f->updated = 1; f->update_status = 0; f->command_state = cs_finished; - /* Let it be removed when we're done. */ - f->intermediate = 1; - /* But don't mention it. */ - f->dontcare = 1; + /* Can't be intermediate, or it'll be removed too early for + make re-exec. */ + f->intermediate = 0; + f->dontcare = 0; } } @@ -1107,46 +1162,21 @@ define_makeflags (0, 0); -#ifdef WINDOWS32 - /* - * Now that makefiles are parsed, see if a Makefile gave a - * value for SHELL and use that for default_shell instead if - * that filename exists. This should speed up the - * construct_argv_internal() function by avoiding unnecessary - * recursion. - */ - { - struct variable *v = lookup_variable("SHELL", 5); - extern char* default_shell; + /* Define the default variables. */ + define_default_variables (); - /* - * to change value: - * - * SHELL must be found, SHELL must be set, value of SHELL - * must be different from current value, and the - * specified file must exist. Whew! - */ - if (v != 0 && *v->value != '\0') { - char *fn = recursively_expand(v); + /* Read all the makefiles. */ - if (fn && strcmp(fn, default_shell) && file_exists_p(fn)) { - char *p; + default_file = enter_file (".DEFAULT"); - default_shell = fn; + read_makefiles + = read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list); + +#ifdef WINDOWS32 + /* look one last time after reading all Makefiles */ + if (no_default_sh_exe) + no_default_sh_exe = !find_and_set_default_shell(NULL); - /* if Makefile says SHELL is sh.exe, believe it */ - if (strstr(default_shell, "sh.exe")) - no_default_sh_exe = 0; - - /* - * Convert from backslashes to forward slashes so - * create_command_line_argv_internal() is not confused. - */ - for (p = strchr(default_shell, '\\'); p; p = strchr(default_shell, '\\')) - *p = '/'; - } - } - } if (no_default_sh_exe && job_slots != 1) { error("Do not specify -j or --jobs if sh.exe is not available."); error("Resetting make for single job mode."); @@ -1154,16 +1184,6 @@ } #endif /* WINDOWS32 */ - /* Define the default variables. */ - define_default_variables (); - - /* Read all the makefiles. */ - - default_file = enter_file (".DEFAULT"); - - read_makefiles - = read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list); - #ifdef __MSDOS__ /* We need to know what kind of shell we will be using. */ { @@ -1295,7 +1315,7 @@ /* Free the storage. */ free ((char *) d); - d = last == 0 ? 0 : last->next; + d = last == 0 ? read_makefiles : last->next; break; } @@ -1416,24 +1436,14 @@ } } - /* Add -o options for all makefiles that were remade */ - { - register unsigned int i; - struct dep *d; - - for (i = argc+1, d = read_makefiles; d != 0; d = d->next) - i += d->file->updated != 0; - - nargv = (char **)xmalloc(i * sizeof(char *)); - bcopy(argv, nargv, argc * sizeof(char *)); - - for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next) - { - if (d->file->updated) - nargv[nargc++] = concat("-o", dep_name(d), ""); - } - nargv[nargc] = 0; - } + /* Add -o option for the stdin temporary file, if necessary. */ + if (stdin_nm) + { + nargv = (char **)xmalloc((nargc + 2) * sizeof(char *)); + bcopy(argv, nargv, argc * sizeof(char *)); + nargv[nargc++] = concat("-o", stdin_nm, ""); + nargv[nargc] = 0; + } if (directories != 0 && directories->idx > 0) { @@ -1507,6 +1517,11 @@ /* Set up `MAKEFLAGS' again for the normal targets. */ define_makeflags (1, 0); + /* If there is a temp file from reading a makefile from stdin, get rid of + it now. */ + if (stdin_nm && unlink(stdin_nm) < 0 && errno != ENOENT) + perror_with_name("unlink (temporary file): ", stdin_nm); + { int status; @@ -2324,12 +2339,12 @@ printf ("-%s", remote_description); printf (", by Richard Stallman and Roland McGrath.\n\ -%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97\n\ +%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98\n\ %s\tFree Software Foundation, Inc.\n\ %sThis is free software; see the source for copying conditions.\n\ %sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ %sPARTICULAR PURPOSE.\n\n\ -%sReport bugs to .\n\n", +%sReport bugs to .\n\n", precede, precede, precede, precede, precede, precede); printed_version = 1; @@ -2373,13 +2388,6 @@ dying = 1; - /* Try to move back to the original directory. This is essential on - MS-DOS (where there is really only one process), and on Unix it - puts core files in the original directory instead of the -C - directory. */ - if (directory_before_chdir != 0) - chdir (directory_before_chdir); - if (print_version_flag) print_version (); @@ -2396,6 +2404,14 @@ if (print_data_base_flag) print_data_base (); + /* Try to move back to the original directory. This is essential on + MS-DOS (where there is really only one process), and on Unix it + puts core files in the original directory instead of the -C + directory. Must wait until after remove_intermediates(), or unlinks + of relative pathnames fail. */ + if (directory_before_chdir != 0) + chdir (directory_before_chdir); + log_working_directory (0); } @@ -2410,7 +2426,7 @@ int entering; { static int entered = 0; - char *message = entering ? "Entering" : "Leaving"; + char *msg = entering ? "Entering" : "Leaving"; /* Print nothing without the flag. Don't print the entering message again if we already have. Don't print the leaving message if we @@ -2424,9 +2440,9 @@ fputs ("# ", stdout); if (makelevel == 0) - printf ("%s: %s ", program, message); + printf ("%s: %s ", program, msg); else - printf ("%s[%u]: %s ", program, makelevel, message); + printf ("%s[%u]: %s ", program, makelevel, msg); if (starting_directory == 0) puts ("an unknown directory"); diff -uPr make-3.76.1/make-stds.texi make-3.77/make-stds.texi --- make-3.76.1/make-stds.texi Fri Jul 4 00:42:36 1997 +++ make-3.77/make-stds.texi Tue Jul 28 00:56:15 1998 @@ -209,11 +209,12 @@ Each program-name variable should come with an options variable that is used to supply options to the program. Append @samp{FLAGS} to the program-name variable name to get the options variable name---for -example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to -this rule, but we keep it because it is standard.) Use @code{CPPFLAGS} -in any compilation command that runs the preprocessor, and use -@code{LDFLAGS} in any compilation command that does linking as well as -in any direct use of @code{ld}. +example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C +compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are +exceptions to this rule, but we keep them because they are standard.) +Use @code{CPPFLAGS} in any compilation command that runs the +preprocessor, and use @code{LDFLAGS} in any compilation command that +does linking as well as in any direct use of @code{ld}. If there are C compiler options that @emph{must} be used for proper compilation of certain files, do not include them in @code{CFLAGS}. diff -uPr make-3.76.1/make.1 make-3.77/make.1 --- make-3.76.1/make.1 Wed Dec 31 19:00:00 1969 +++ make-3.77/make.1 Thu May 14 12:35:00 1998 @@ -0,0 +1,296 @@ +.TH MAKE 1L "22 August 1989" "GNU" "LOCAL USER COMMANDS" +.SH NAME +make \- GNU make utility to maintain groups of programs +.SH SYNOPSIS +.B "make " +[ +.B \-f +.I makefile +] [ option ] ... +target ... +.SH WARNING +This man page is an extract of the documentation of +.I GNU make . +It is updated only occasionally, because the GNU project does not use nroff. +For complete, current documentation, refer to the Info file +.B make.info +which is made from the Texinfo source file +.BR make.texinfo . +.SH DESCRIPTION +.LP +The purpose of the +.I make +utility is to determine automatically which +pieces of a large program need to be recompiled, and issue the commands to +recompile them. +The manual describes the GNU implementation of +.IR make , +which was written by Richard Stallman and Roland McGrath. +Our examples show C programs, since they are most common, but you can use +.I make +with any programming language whose compiler can be run with a +shell command. +In fact, +.I make +is not limited to programs. +You can use it to describe any task where some files must be +updated automatically from others whenever the others change. +.LP +To prepare to use +.IR make , +you must write a file called the +.I makefile +that describes the relationships among files in your program, and the +states the commands for updating each file. +In a program, typically the executable file is updated from object +files, which are in turn made by compiling source files. +.LP +Once a suitable makefile exists, each time you change some source files, +this simple shell command: +.sp 1 +.RS +.B make +.RE +.sp 1 +suffices to perform all necessary recompilations. +The +.I make +program uses the makefile data base and the last-modification times +of the files to decide which of the files need to be updated. +For each of those files, it issues the commands recorded in the data base. +.LP +.I make +executes commands in the +.I makefile +to update +one or more target +.IR names , +where +.I name +is typically a program. +If no +.B \-f +option is present, +.I make +will look for the makefiles +.IR GNUmakefile , +.IR makefile , +and +.IR Makefile , +in that order. +.LP +Normally you should call your makefile either +.I makefile +or +.IR Makefile . +(We recommend +.I Makefile +because it appears prominently near the beginning of a directory +listing, right near other important files such as +.IR README .) +The first name checked, +.IR GNUmakefile , +is not recommended for most makefiles. +You should use this name if you have a makefile that is specific to GNU +.IR make , +and will not be understood by other versions of +.IR make . +If +.I makefile +is `\-', the standard input is read. +.LP +.I make +updates a target if it depends on prerequisite files +that have been modified since the target was last modified, +or if the target does not exist. +.SH OPTIONS +.sp 1 +.TP 0.5i +.B \-b +.TP 0.5i +.B \-m +These options are ignored for compatibility with other versions of +.IR make . +.TP 0.5i +.BI "\-C " dir +Change to directory +.I dir +before reading the makefiles or doing anything else. +If multiple +.B \-C +options are specified, each is interpreted relative to the +previous one: +.BR "\-C " / +.BR "\-C " etc +is equivalent to +.BR "\-C " /etc. +This is typically used with recursive invocations of +.IR make . +.TP 0.5i +.B \-d +Print debugging information in addition to normal processing. +The debugging information says which files are being considered for +remaking, which file-times are being compared and with what results, +which files actually need to be remade, which implicit rules are +considered and which are applied---everything interesting about how +.I make +decides what to do. +.TP 0.5i +.B \-e +Give variables taken from the environment precedence +over variables from makefiles. +.TP 0.5i +.BI "\-f " file +Use +.I file +as a makefile. +.TP 0.5i +.B \-i +Ignore all errors in commands executed to remake files. +.TP 0.5i +.BI "\-I " dir +Specifies a directory +.I dir +to search for included makefiles. +If several +.B \-I +options are used to specify several directories, the directories are +searched in the order specified. +Unlike the arguments to other flags of +.IR make , +directories given with +.B \-I +flags may come directly after the flag: +.BI \-I dir +is allowed, as well as +.BI "\-I " dir. +This syntax is allowed for compatibility with the C +preprocessor's +.B \-I +flag. +.TP 0.5i +.BI "\-j " jobs +Specifies the number of jobs (commands) to run simultaneously. +If there is more than one +.B \-j +option, the last one is effective. +If the +.B \-j +option is given without an argument, +.IR make +will not limit the number of jobs that can run simultaneously. +.TP 0.5i +.B \-k +Continue as much as possible after an error. +While the target that failed, and those that depend on it, cannot +be remade, the other dependencies of these targets can be processed +all the same. +.TP 0.5i +.B \-l +.TP 0.5i +.BI "\-l " load +Specifies that no new jobs (commands) should be started if there are +others jobs running and the load average is at least +.I load +(a floating-point number). +With no argument, removes a previous load limit. +.TP 0.5i +.B \-n +Print the commands that would be executed, but do not execute them. +.TP 0.5i +.BI "\-o " file +Do not remake the file +.I file +even if it is older than its dependencies, and do not remake anything +on account of changes in +.IR file . +Essentially the file is treated as very old and its rules are ignored. +.TP 0.5i +.B \-p +Print the data base (rules and variable values) that results from +reading the makefiles; then execute as usual or as otherwise +specified. +This also prints the version information given by the +.B \-v +switch (see below). +To print the data base without trying to remake any files, use +.B make +.B \-p +.BI \-f /dev/null. +.TP 0.5i +.B \-q +``Question mode''. +Do not run any commands, or print anything; just return an exit status +that is zero if the specified targets are already up to date, nonzero +otherwise. +.TP 0.5i +.B \-r +Eliminate use of the built-in implicit rules. +Also clear out the default list of suffixes for suffix rules. +.TP 0.5i +.B \-s +Silent operation; do not print the commands as they are executed. +.TP 0.5i +.B \-S +Cancel the effect of the +.B \-k +option. +This is never necessary except in a recursive +.I make +where +.B \-k +might be inherited from the top-level +.I make +via MAKEFLAGS or if you set +.B \-k +in MAKEFLAGS in your environment. +.TP 0.5i +.B \-t +Touch files (mark them up to date without really changing them) +instead of running their commands. +This is used to pretend that the commands were done, in order to fool +future invocations of +.IR make . +.TP 0.5i +.B \-v +Print the version of the +.I make +program plus a copyright, a list of authors and a notice that there +is no warranty. +After this information is printed, processing continues normally. +To get this information without doing anything else, use +.B make +.B \-v +.BI \-f /dev/null. +.TP 0.5i +.B \-w +Print a message containing the working directory +before and after other processing. +This may be useful for tracking down errors from complicated nests of +recursive +.I make +commands. +.TP 0.5i +.BI "\-W " file +Pretend that the target +.I file +has just been modified. +When used with the +.B \-n +flag, this shows you what would happen if you were to modify that file. +Without +.BR \-n , +it is almost the same as running a +.I touch +command on the given file before running +.IR make , +except that the modification time is changed only in the imagination of +.IR make . +.SH "SEE ALSO" +.I "The GNU Make Manual" +.SH BUGS +See the chapter `Problems and Bugs' in +.I "The GNU Make Manual" . +.SH AUTHOR +This manual page contributed by Dennis Morse of Stanford University. +It has been reworked by Roland McGrath. diff -uPr make-3.76.1/make.h make-3.77/make.h --- make-3.76.1/make.h Wed Aug 27 16:31:16 1997 +++ make-3.77/make.h Mon Jul 27 10:26:53 1998 @@ -86,11 +86,11 @@ #define POSIX #endif -#ifdef HAVE_SYS_SIGLIST -#ifndef SYS_SIGLIST_DECLARED +#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED) extern char *sys_siglist[]; #endif -#else + +#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL) #include "signame.h" #endif @@ -241,6 +241,11 @@ extern char *strerror PARAMS ((int errnum)); #endif +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(x) +# endif +#endif #ifdef __GNUC__ #undef alloca @@ -259,7 +264,7 @@ #define streq(a, b) \ ((a) == (b) || \ (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) -#ifdef _AMIGA +#ifdef HAVE_CASE_INSENSITIVE_FS #define strieq(a, b) \ ((a) == (b) || \ (tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) @@ -277,7 +282,7 @@ /* Add to VAR the hashing value of C, one character in a name. */ #define HASH(var, c) \ ((var += (c)), (var = ((var) << 7) + ((var) >> 20))) -#ifdef _AMIGA /* Fold filenames on #amiga */ +#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */ #define HASHI(var, c) \ ((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20))) #else @@ -310,16 +315,23 @@ extern int kill(int pid, int sig); extern int safe_stat(char *file, struct stat *sb); extern char *end_of_token_w32(); -#endif +extern int find_and_set_default_shell(char *token); + +/* indicates whether or not we have Bourne shell */ +extern int no_default_sh_exe; + +/* is default_shell unixy? */ +extern int unixy_shell; +#endif /* WINDOWS32 */ -extern void die (); +extern void die () __attribute__ ((noreturn)); extern void message (); -extern void fatal (); +extern void fatal () __attribute__ ((noreturn)); extern void error (); extern void log_working_directory (); extern void makefile_error (); -extern void makefile_fatal (); -extern void pfatal_with_name (); +extern void makefile_fatal () __attribute__ ((noreturn)); +extern void pfatal_with_name () __attribute__ ((noreturn)); extern void perror_with_name (); extern char *savestring (); extern char *concat (); @@ -412,6 +424,9 @@ extern int print_directory_flag, warn_undefined_variables_flag; extern int posix_pedantic; extern int clock_skew_detected; + +/* can we run commands via 'sh -c xxx' or must we use batch files? */ +extern int batch_mode_shell; extern unsigned int job_slots; #ifndef NO_FLOAT diff -uPr make-3.76.1/make.info make-3.77/make.info --- make-3.76.1/make.info Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -32,140 +32,144 @@  Indirect: -make.info-1: 1292 -make.info-2: 50669 -make.info-3: 99466 -make.info-4: 149261 -make.info-5: 195872 -make.info-6: 245502 -make.info-7: 293511 -make.info-8: 338789 -make.info-9: 379969 +make.info-1: 1291 +make.info-2: 50599 +make.info-3: 99396 +make.info-4: 144891 +make.info-5: 193506 +make.info-6: 240611 +make.info-7: 288459 +make.info-8: 335654 +make.info-9: 349707 +make.info-10: 391321  Tag Table: (Indirect) -Node: Top1292 -Node: Overview12440 -Node: Preparing13377 -Node: Reading14332 -Node: Bugs15254 -Node: Introduction16691 -Node: Rule Introduction18278 -Node: Simple Makefile19987 -Node: How Make Works23600 -Node: Variables Simplify26088 -Node: make Deduces28294 -Node: Combine By Dependency30041 -Node: Cleanup31069 -Node: Makefiles32479 -Node: Makefile Contents33176 -Node: Makefile Names35436 -Node: Include37038 -Node: MAKEFILES Variable40726 -Node: Remaking Makefiles42228 -Node: Overriding Makefiles46046 -Node: Rules48069 -Node: Rule Example50669 -Node: Rule Syntax51504 -Node: Wildcards53713 -Node: Wildcard Examples55393 -Node: Wildcard Pitfall56628 -Node: Wildcard Function58411 -Node: Directory Search60192 -Node: General Search61323 -Node: Selective Search63023 -Node: Search Algorithm65990 -Node: Commands/Search68492 -Node: Implicit/Search69832 -Node: Libraries/Search70767 -Node: Phony Targets71955 -Node: Force Targets75300 -Node: Empty Targets76337 -Node: Special Targets77597 -Node: Multiple Targets82103 -Node: Multiple Rules83970 -Node: Static Pattern86053 -Node: Static Usage86693 -Node: Static versus Implicit90374 -Node: Double-Colon92105 -Node: Automatic Dependencies93635 -Node: Commands97774 -Node: Echoing99466 -Node: Execution100724 -Node: Parallel105300 -Node: Errors108713 -Node: Interrupts112349 -Node: Recursion113930 -Node: MAKE Variable115218 -Node: Variables/Recursion117182 -Node: Options/Recursion122145 -Node: -w Option126752 -Node: Sequences127738 -Node: Empty Commands130733 -Node: Using Variables131901 -Node: Reference134885 -Node: Flavors136430 -Node: Advanced141747 -Node: Substitution Refs142247 -Node: Computed Names143774 -Node: Values148344 -Node: Setting149261 -Node: Appending150970 -Node: Override Directive154888 -Node: Defining156267 -Node: Environment158265 -Node: Conditionals160516 -Node: Conditional Example161225 -Node: Conditional Syntax163791 -Node: Testing Flags168537 -Node: Functions169634 -Node: Syntax of Functions170632 -Node: Text Functions172769 -Node: File Name Functions179524 -Node: Foreach Function185235 -Node: Origin Function188442 -Node: Shell Function191667 -Node: Running193189 -Node: Makefile Arguments195177 -Node: Goals195872 -Node: Instead of Execution200426 -Node: Avoiding Compilation203707 -Node: Overriding205608 -Node: Testing207896 -Node: Options Summary209773 -Node: Implicit Rules216633 -Node: Using Implicit218779 -Node: Catalogue of Rules222270 -Node: Implicit Variables231251 -Node: Chained Rules235377 -Node: Pattern Rules239370 -Node: Pattern Intro240898 -Node: Pattern Examples243709 -Node: Automatic245502 -Node: Pattern Match251791 -Node: Match-Anything Rules253395 -Node: Canceling Rules257254 -Node: Last Resort257957 -Node: Suffix Rules259794 -Node: Implicit Rule Search263505 -Node: Archives267005 -Node: Archive Members267700 -Node: Archive Update269279 -Node: Archive Symbols271195 -Node: Archive Pitfalls272394 -Node: Archive Suffix Rules273110 -Node: Features274650 -Node: Missing283225 -Node: Makefile Conventions287554 -Node: Makefile Basics288216 -Node: Utilities in Makefiles291380 -Node: Command Variables293511 -Node: Directory Variables296469 -Node: Standard Targets307046 -Node: Install Command Categories317553 -Node: Quick Reference322121 -Node: Complex Makefile330122 -Node: Concept Index338789 -Node: Name Index379969 +Node: Top1291 +Node: Overview12514 +Node: Preparing13451 +Node: Reading14406 +Node: Bugs15328 +Node: Introduction16621 +Node: Rule Introduction18208 +Node: Simple Makefile19917 +Node: How Make Works23530 +Node: Variables Simplify26018 +Node: make Deduces28224 +Node: Combine By Dependency29971 +Node: Cleanup30999 +Node: Makefiles32409 +Node: Makefile Contents33106 +Node: Makefile Names35366 +Node: Include36968 +Node: MAKEFILES Variable40656 +Node: Remaking Makefiles42158 +Node: Overriding Makefiles45976 +Node: Rules47999 +Node: Rule Example50599 +Node: Rule Syntax51434 +Node: Wildcards53643 +Node: Wildcard Examples55323 +Node: Wildcard Pitfall56558 +Node: Wildcard Function58341 +Node: Directory Search60122 +Node: General Search61253 +Node: Selective Search62953 +Node: Search Algorithm65920 +Node: Commands/Search68422 +Node: Implicit/Search69762 +Node: Libraries/Search70697 +Node: Phony Targets71885 +Node: Force Targets75230 +Node: Empty Targets76267 +Node: Special Targets77527 +Node: Multiple Targets82033 +Node: Multiple Rules83900 +Node: Static Pattern85983 +Node: Static Usage86623 +Node: Static versus Implicit90304 +Node: Double-Colon92035 +Node: Automatic Dependencies93565 +Node: Commands97704 +Node: Echoing99396 +Node: Execution100654 +Node: Parallel105230 +Node: Errors108643 +Node: Interrupts112279 +Node: Recursion113860 +Node: MAKE Variable115589 +Node: Variables/Recursion117553 +Node: Options/Recursion122516 +Node: -w Option127123 +Node: Sequences128109 +Node: Empty Commands131104 +Node: Using Variables132272 +Node: Reference135533 +Node: Flavors137078 +Node: Advanced142864 +Node: Substitution Refs143364 +Node: Computed Names144891 +Node: Values149461 +Node: Setting150378 +Node: Appending152419 +Node: Override Directive156337 +Node: Defining157716 +Node: Environment159714 +Node: Target-specific161989 +Node: Pattern-specific164385 +Node: Conditionals165580 +Node: Conditional Example166289 +Node: Conditional Syntax168855 +Node: Testing Flags173601 +Node: Functions174698 +Node: Syntax of Functions175696 +Node: Text Functions177833 +Node: File Name Functions184588 +Node: Foreach Function190299 +Node: Origin Function193506 +Node: Shell Function196731 +Node: Running198253 +Node: Makefile Arguments200241 +Node: Goals200936 +Node: Instead of Execution205490 +Node: Avoiding Compilation208771 +Node: Overriding210672 +Node: Testing212960 +Node: Options Summary214837 +Node: Implicit Rules221867 +Node: Using Implicit224013 +Node: Catalogue of Rules227504 +Node: Implicit Variables236485 +Node: Chained Rules240611 +Node: Pattern Rules244604 +Node: Pattern Intro246132 +Node: Pattern Examples248943 +Node: Automatic250736 +Node: Pattern Match257025 +Node: Match-Anything Rules258629 +Node: Canceling Rules262488 +Node: Last Resort263191 +Node: Suffix Rules265028 +Node: Implicit Rule Search268739 +Node: Archives272239 +Node: Archive Members272934 +Node: Archive Update274513 +Node: Archive Symbols276429 +Node: Archive Pitfalls277628 +Node: Archive Suffix Rules278344 +Node: Features279884 +Node: Missing288459 +Node: Makefile Conventions292788 +Node: Makefile Basics293450 +Node: Utilities in Makefiles296614 +Node: Command Variables298745 +Node: Directory Variables301768 +Node: Standard Targets312345 +Node: Install Command Categories322852 +Node: Quick Reference327420 +Node: Make Errors335654 +Node: Complex Makefile341044 +Node: Concept Index349707 +Node: Name Index391321  End Tag Table diff -uPr make-3.76.1/make.info-1 make-3.77/make.info-1 --- make-3.76.1/make.info-1 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-1 Wed Jul 29 22:36:20 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -40,8 +40,8 @@ large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51 of the `GNU Make Manual', last updated 26 Aug -1997 for `make' Version 3.76 Beta. + This edition of the `GNU Make Manual', last updated 20 May 1998, +documents GNU `make' Version 3.77. This manual describes `make' and contains the following chapters: @@ -64,6 +64,7 @@ * Missing:: What GNU `make' lacks from other `make's. * Makefile Conventions:: Conventions for makefiles in GNU programs. * Quick Reference:: A quick reference for experienced users. +* Make Errors:: A list of common errors generated by `make'. * Complex Makefile:: A real example of a straightforward, but nontrivial, makefile. * Concept Index:: Index of Concepts @@ -347,14 +348,9 @@ what you expected to occur; this will help us decide whether the problem was really in the documentation. - Once you've got a precise problem, please send electronic mail either -through the Internet or via UUCP: + Once you've got a precise problem, please send electronic mail to: - Internet address: - bug-gnu-utils@prep.ai.mit.edu - - UUCP path: - mit-eddie!prep.ai.mit.edu!bug-gnu-utils + bug-make@gnu.org Please include the version number of `make' you are using. You can get this information with the command `make --version'. Be sure also to diff -uPr make-3.76.1/make.info-10 make-3.77/make.info-10 --- make-3.76.1/make.info-10 Wed Dec 31 19:00:00 1969 +++ make-3.77/make.info-10 Wed Jul 29 22:36:21 1998 @@ -0,0 +1,197 @@ +This is Info file make.info, produced by Makeinfo version 1.67 from the +input file make.texinfo. + +INFO-DIR-SECTION The GNU make utility +START-INFO-DIR-ENTRY +* Make: (make.info). The GNU make utility. +END-INFO-DIR-ENTRY + + This file documents the GNU Make utility, which determines +automatically which pieces of a large program need to be recompiled, +and issues the commands to recompile them. + + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. + + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Free Software Foundation. + + +File: make.info, Node: Name Index, Prev: Concept Index, Up: Top + +Index of Functions, Variables, & Directives +******************************************* + +* Menu: + +* $%: Automatic. +* $(%D): Automatic. +* $(%F): Automatic. +* $(*D): Automatic. +* $(*F): Automatic. +* $(: Last Resort. +* .DEFAULT: Special Targets. +* .DEFAULT, and empty commands: Empty Commands. +* .DELETE_ON_ERROR: Errors. +* .EXPORT_ALL_VARIABLES <1>: Variables/Recursion. +* .EXPORT_ALL_VARIABLES: Special Targets. +* .IGNORE <1>: Errors. +* .IGNORE: Special Targets. +* .INTERMEDIATE: Special Targets. +* .PHONY <1>: Phony Targets. +* .PHONY: Special Targets. +* .POSIX: Options/Recursion. +* .PRECIOUS <1>: Interrupts. +* .PRECIOUS: Special Targets. +* .SECONDARY: Special Targets. +* .SILENT <1>: Echoing. +* .SILENT: Special Targets. +* .SUFFIXES <1>: Special Targets. +* .SUFFIXES: Suffix Rules. +* /usr/gnu/include: Include. +* /usr/include: Include. +* /usr/local/include: Include. +* < (automatic variable): Automatic. +* : MAKE Variable. +* MAKE: Flavors. +* MAKECMDGOALS: Goals. +* Makefile: Makefile Names. +* makefile: Makefile Names. +* MAKEFILES <1>: Variables/Recursion. +* MAKEFILES: MAKEFILES Variable. +* MAKEFLAGS: Options/Recursion. +* MAKEINFO: Implicit Variables. +* MAKELEVEL <1>: Flavors. +* MAKELEVEL: Variables/Recursion. +* MAKEOVERRIDES: Options/Recursion. +* MFLAGS: Options/Recursion. +* notdir: File Name Functions. +* origin: Origin Function. +* OUTPUT_OPTION: Catalogue of Rules. +* override: Override Directive. +* patsubst <1>: Text Functions. +* patsubst: Substitution Refs. +* PC: Implicit Variables. +* PFLAGS: Implicit Variables. +* RFLAGS: Implicit Variables. +* RM: Implicit Variables. +* SHELL: Execution. +* shell: Shell Function. +* SHELL (command execution): Execution. +* sort: Text Functions. +* strip: Text Functions. +* subst <1>: Text Functions. +* subst: Multiple Targets. +* suffix: File Name Functions. +* SUFFIXES: Suffix Rules. +* TANGLE: Implicit Variables. +* TEX: Implicit Variables. +* TEXI2DVI: Implicit Variables. +* unexport: Variables/Recursion. +* vpath: Selective Search. +* VPATH: General Search. +* vpath: Directory Search. +* VPATH: Directory Search. +* WEAVE: Implicit Variables. +* wildcard <1>: File Name Functions. +* wildcard: Wildcard Function. +* word: File Name Functions. +* wordlist: File Name Functions. +* words: File Name Functions. +* YACC: Implicit Variables. +* YACCR: Implicit Variables. +* YFLAGS: Implicit Variables. + + diff -uPr make-3.76.1/make.info-2 make-3.77/make.info-2 --- make-3.76.1/make.info-2 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-2 Wed Jul 29 22:36:20 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are diff -uPr make-3.76.1/make.info-3 make-3.77/make.info-3 --- make-3.76.1/make.info-3 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-3 Wed Jul 29 22:36:20 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -363,6 +363,14 @@ but there are many things to know about how they work and why, and about how the sub-`make' relates to the top-level `make'. + For your convenience, GNU `make' sets the variable `CURDIR' to the +pathname of the current working directory for you. If `-C' is in +effect, it will contain the path of the new directory, not the +original. The value has the same precedence it would have if it were +set in the makefile (by default, an environment variable `CURDIR' will +not override this value). Note that setting this variable has no +effect on the operation of `make' + * Menu: * MAKE Variable:: The special effects of using `$(MAKE)'. @@ -822,6 +830,10 @@ * Defining:: An alternate way to set a variable to a verbatim string. * Environment:: Variable values can come from the environment. +* Target-specific:: Variable values can be defined on a per-target + basis. +* Pattern-specific:: Target-specific variable values can be applied + to a group of targets that match a pattern. * Automatic:: Some special variables have predefined meanings for use with implicit rules. @@ -995,6 +1007,22 @@ trailing spaces), which was probably not the intention. (Imagine something like `$(dir)/file' with this definition!) + There is another assignment operator for variables, `?='. This is +called a conditional variable assignment operator, because it only has +an effect if the variable is not yet defined. This statement: + + FOO ?= bar + +is exactly equivalent to this (*note The `origin' Function: Origin +Function.): + + ifeq ($(origin FOO), undefined) + FOO = bar + endif + + Note that a variable set to an empty value is still defined, so `?=' +will not set that variable. +  File: make.info, Node: Advanced, Next: Values, Prev: Flavors, Up: Using Variables @@ -1051,172 +1079,4 @@ bar := $(foo:%.o=%.c) sets `bar' to `a.c b.c c.c'. - - -File: make.info, Node: Computed Names, Prev: Substitution Refs, Up: Advanced - -Computed Variable Names ------------------------ - - Computed variable names are a complicated concept needed only for -sophisticated makefile programming. For most purposes you need not -consider them, except to know that making a variable with a dollar sign -in its name might have strange results. However, if you are the type -that wants to understand everything, or you are actually interested in -what they do, read on. - - Variables may be referenced inside the name of a variable. This is -called a "computed variable name" or a "nested variable reference". -For example, - - x = y - y = z - a := $($(x)) - -defines `a' as `z': the `$(x)' inside `$($(x))' expands to `y', so -`$($(x))' expands to `$(y)' which in turn expands to `z'. Here the -name of the variable to reference is not stated explicitly; it is -computed by expansion of `$(x)'. The reference `$(x)' here is nested -within the outer variable reference. - - The previous example shows two levels of nesting, but any number of -levels is possible. For example, here are three levels: - - x = y - y = z - z = u - a := $($($(x))) - -Here the innermost `$(x)' expands to `y', so `$($(x))' expands to -`$(y)' which in turn expands to `z'; now we have `$(z)', which becomes -`u'. - - References to recursively-expanded variables within a variable name -are reexpanded in the usual fashion. For example: - - x = $(y) - y = z - z = Hello - a := $($(x)) - -defines `a' as `Hello': `$($(x))' becomes `$($(y))' which becomes -`$(z)' which becomes `Hello'. - - Nested variable references can also contain modified references and -function invocations (*note Functions for Transforming Text: -Functions.), just like any other reference. For example, using the -`subst' function (*note Functions for String Substitution and Analysis: -Text Functions.): - - x = variable1 - variable2 := Hello - y = $(subst 1,2,$(x)) - z = y - a := $($($(z))) - -eventually defines `a' as `Hello'. It is doubtful that anyone would -ever want to write a nested reference as convoluted as this one, but it -works: `$($($(z)))' expands to `$($(y))' which becomes `$($(subst -1,2,$(x)))'. This gets the value `variable1' from `x' and changes it -by substitution to `variable2', so that the entire string becomes -`$(variable2)', a simple variable reference whose value is `Hello'. - - A computed variable name need not consist entirely of a single -variable reference. It can contain several variable references, as -well as some invariant text. For example, - - a_dirs := dira dirb - 1_dirs := dir1 dir2 - - a_files := filea fileb - 1_files := file1 file2 - - ifeq "$(use_a)" "yes" - a1 := a - else - a1 := 1 - endif - - ifeq "$(use_dirs)" "yes" - df := dirs - else - df := files - endif - - dirs := $($(a1)_$(df)) - -will give `dirs' the same value as `a_dirs', `1_dirs', `a_files' or -`1_files' depending on the settings of `use_a' and `use_dirs'. - - Computed variable names can also be used in substitution references: - - a_objects := a.o b.o c.o - 1_objects := 1.o 2.o 3.o - - sources := $($(a1)_objects:.o=.c) - -defines `sources' as either `a.c b.c c.c' or `1.c 2.c 3.c', depending -on the value of `a1'. - - The only restriction on this sort of use of nested variable -references is that they cannot specify part of the name of a function -to be called. This is because the test for a recognized function name -is done before the expansion of nested references. For example, - - ifdef do_sort - func := sort - else - func := strip - endif - - bar := a d b g q c - - foo := $($(func) $(bar)) - -attempts to give `foo' the value of the variable `sort a d b g q c' or -`strip a d b g q c', rather than giving `a d b g q c' as the argument -to either the `sort' or the `strip' function. This restriction could -be removed in the future if that change is shown to be a good idea. - - You can also use computed variable names in the left-hand side of a -variable assignment, or in a `define' directive, as in: - - dir = foo - $(dir)_sources := $(wildcard $(dir)/*.c) - define $(dir)_print - lpr $($(dir)_sources) - endef - -This example defines the variables `dir', `foo_sources', and -`foo_print'. - - Note that "nested variable references" are quite different from -"recursively expanded variables" (*note The Two Flavors of Variables: -Flavors.), though both are used together in complex ways when doing -makefile programming. - - -File: make.info, Node: Values, Next: Setting, Prev: Advanced, Up: Using Variables - -How Variables Get Their Values -============================== - - Variables can get values in several different ways: - - * You can specify an overriding value when you run `make'. *Note - Overriding Variables: Overriding. - - * You can specify a value in the makefile, either with an assignment - (*note Setting Variables: Setting.) or with a verbatim definition - (*note Defining Variables Verbatim: Defining.). - - * Variables in the environment become `make' variables. *Note - Variables from the Environment: Environment. - - * Several "automatic" variables are given new values for each rule. - Each of these has a single conventional use. *Note Automatic - Variables: Automatic. - - * Several variables have constant initial values. *Note Variables - Used by Implicit Rules: Implicit Variables. diff -uPr make-3.76.1/make.info-4 make-3.77/make.info-4 --- make-3.76.1/make.info-4 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-4 Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -31,6 +31,174 @@ translation approved by the Free Software Foundation.  +File: make.info, Node: Computed Names, Prev: Substitution Refs, Up: Advanced + +Computed Variable Names +----------------------- + + Computed variable names are a complicated concept needed only for +sophisticated makefile programming. For most purposes you need not +consider them, except to know that making a variable with a dollar sign +in its name might have strange results. However, if you are the type +that wants to understand everything, or you are actually interested in +what they do, read on. + + Variables may be referenced inside the name of a variable. This is +called a "computed variable name" or a "nested variable reference". +For example, + + x = y + y = z + a := $($(x)) + +defines `a' as `z': the `$(x)' inside `$($(x))' expands to `y', so +`$($(x))' expands to `$(y)' which in turn expands to `z'. Here the +name of the variable to reference is not stated explicitly; it is +computed by expansion of `$(x)'. The reference `$(x)' here is nested +within the outer variable reference. + + The previous example shows two levels of nesting, but any number of +levels is possible. For example, here are three levels: + + x = y + y = z + z = u + a := $($($(x))) + +Here the innermost `$(x)' expands to `y', so `$($(x))' expands to +`$(y)' which in turn expands to `z'; now we have `$(z)', which becomes +`u'. + + References to recursively-expanded variables within a variable name +are reexpanded in the usual fashion. For example: + + x = $(y) + y = z + z = Hello + a := $($(x)) + +defines `a' as `Hello': `$($(x))' becomes `$($(y))' which becomes +`$(z)' which becomes `Hello'. + + Nested variable references can also contain modified references and +function invocations (*note Functions for Transforming Text: +Functions.), just like any other reference. For example, using the +`subst' function (*note Functions for String Substitution and Analysis: +Text Functions.): + + x = variable1 + variable2 := Hello + y = $(subst 1,2,$(x)) + z = y + a := $($($(z))) + +eventually defines `a' as `Hello'. It is doubtful that anyone would +ever want to write a nested reference as convoluted as this one, but it +works: `$($($(z)))' expands to `$($(y))' which becomes `$($(subst +1,2,$(x)))'. This gets the value `variable1' from `x' and changes it +by substitution to `variable2', so that the entire string becomes +`$(variable2)', a simple variable reference whose value is `Hello'. + + A computed variable name need not consist entirely of a single +variable reference. It can contain several variable references, as +well as some invariant text. For example, + + a_dirs := dira dirb + 1_dirs := dir1 dir2 + + a_files := filea fileb + 1_files := file1 file2 + + ifeq "$(use_a)" "yes" + a1 := a + else + a1 := 1 + endif + + ifeq "$(use_dirs)" "yes" + df := dirs + else + df := files + endif + + dirs := $($(a1)_$(df)) + +will give `dirs' the same value as `a_dirs', `1_dirs', `a_files' or +`1_files' depending on the settings of `use_a' and `use_dirs'. + + Computed variable names can also be used in substitution references: + + a_objects := a.o b.o c.o + 1_objects := 1.o 2.o 3.o + + sources := $($(a1)_objects:.o=.c) + +defines `sources' as either `a.c b.c c.c' or `1.c 2.c 3.c', depending +on the value of `a1'. + + The only restriction on this sort of use of nested variable +references is that they cannot specify part of the name of a function +to be called. This is because the test for a recognized function name +is done before the expansion of nested references. For example, + + ifdef do_sort + func := sort + else + func := strip + endif + + bar := a d b g q c + + foo := $($(func) $(bar)) + +attempts to give `foo' the value of the variable `sort a d b g q c' or +`strip a d b g q c', rather than giving `a d b g q c' as the argument +to either the `sort' or the `strip' function. This restriction could +be removed in the future if that change is shown to be a good idea. + + You can also use computed variable names in the left-hand side of a +variable assignment, or in a `define' directive, as in: + + dir = foo + $(dir)_sources := $(wildcard $(dir)/*.c) + define $(dir)_print + lpr $($(dir)_sources) + endef + +This example defines the variables `dir', `foo_sources', and +`foo_print'. + + Note that "nested variable references" are quite different from +"recursively expanded variables" (*note The Two Flavors of Variables: +Flavors.), though both are used together in complex ways when doing +makefile programming. + + +File: make.info, Node: Values, Next: Setting, Prev: Advanced, Up: Using Variables + +How Variables Get Their Values +============================== + + Variables can get values in several different ways: + + * You can specify an overriding value when you run `make'. *Note + Overriding Variables: Overriding. + + * You can specify a value in the makefile, either with an assignment + (*note Setting Variables: Setting.) or with a verbatim definition + (*note Defining Variables Verbatim: Defining.). + + * Variables in the environment become `make' variables. *Note + Variables from the Environment: Environment. + + * Several "automatic" variables are given new values for each rule. + Each of these has a single conventional use. *Note Automatic + Variables: Automatic. + + * Several variables have constant initial values. *Note Variables + Used by Implicit Rules: Implicit Variables. + + File: make.info, Node: Setting, Next: Appending, Prev: Values, Up: Using Variables Setting Variables @@ -70,6 +238,19 @@ rule; these are called the "automatic" variables (*note Automatic Variables: Automatic.). + If you'd like a variable to be set to a value only if it's not +already set, then you can use the shorthand operator `?=' instead of +`='. These two settings of the variable `FOO' are identical (*note The +`origin' Function: Origin Function.): + + FOO ?= bar + +and + + ifeq ($(origin FOO), undefined) + FOO = bar + endif +  File: make.info, Node: Appending, Next: Override Directive, Prev: Setting, Up: Using Variables @@ -263,7 +444,7 @@ *Note The `override' Directive: Override Directive.  -File: make.info, Node: Environment, Prev: Defining, Up: Using Variables +File: make.info, Node: Environment, Next: Target-specific, Prev: Defining, Up: Using Variables Variables from the Environment ============================== @@ -307,6 +488,98 @@ set. *Note Special handling of SHELL on MS-DOS: Execution.)  +File: make.info, Node: Target-specific, Next: Pattern-specific, Prev: Environment, Up: Using Variables + +Target-specific Variable Values +=============================== + + Variable values in `make' are usually global; that is, they are the +same regardless of where they are evaluated (unless they're reset, of +course). One exception to that is automatic variables (*note Automatic +Variables: Automatic.). + + The other exception is "target-specific variable values". This +feature allows you to define different values for the same variable, +based on the target that `make' is currently building. As with +automatic variables, these values are only available within the context +of a target's command script (and in other target-specific assignments). + + Set a target-specific variable value like this: + + TARGET ... : VARIABLE-ASSIGNMENT + +or like this: + + TARGET ... : override VARIABLE-ASSIGNMENT + + Multiple TARGET values create a target-specific variable value for +each member of the target list individually. + + The VARIABLE-ASSIGNMENT can be any valid form of assignment; +recursive (`='), static (`:='), appending (`+='), or conditional +(`?='). All variables that appear within the VARIABLE-ASSIGNMENT are +evaluated within the context of the target: thus, any +previously-defined target-specific variable values will be in effect. +Note that this variable is actually distinct from any "global" value: +the two variables do not have to have the same flavor (recursive vs. +static). + + Target-specific variables have the same priority as any other +makefile variable. Variables provided on the command-line (and in the +environment if the `-e' option is in force) will take precedence. +Specifying the `override' directive will allow the target-specific +variable value to be preferred. + + There is one more special feature of target-specific variables: when +you define a target-specific variable, that variable value is also in +effect for all dependencies of this target (unless those dependencies +override it with their own target-specific variable value). So, for +example, a statement like this: + + prog : CFLAGS = -g + prog : prog.o foo.o bar.o + +will set `CFLAGS' to `-g' in the command script for `prog', but it will +also set `CFLAGS' to `-g' in the command scripts that create `prog.o', +`foo.o', and `bar.o', and any command scripts which create their +dependencies. + + +File: make.info, Node: Pattern-specific, Prev: Target-specific, Up: Using Variables + +Pattern-specific Variable Values +================================ + + In addition to target-specific variable values (*note +Target-specific Variable Values: Target-specific.), GNU `make' supports +pattern-specific variable values. In this form, a variable is defined +for any target that matches the pattern specified. Variables defined in +this way are searched after any target-specific variables defined +explicitly for that target, and before target-specific variables defined +for the parent target. + + Set a pattern-specific variable value like this: + + PATTERN ... : VARIABLE-ASSIGNMENT + +or like this: + + PATTERN ... : override VARIABLE-ASSIGNMENT + +where PATTERN is a %-pattern. As with target-specific variable values, +multiple PATTERN values create a pattern-specific variable value for +each pattern individually. The VARIABLE-ASSIGNMENT can be any valid +form of assignment. Any command-line variable setting will take +precedence, unless `override' is specified. + + For example: + + %.o : CFLAGS = -O + +will assign `CFLAGS' the value of `-O' for all targets matching the +pattern `%.o'. + + File: make.info, Node: Conditionals, Next: Functions, Prev: Using Variables, Up: Top Conditional Parts of Makefiles @@ -1043,192 +1316,4 @@ might be useful if the value of `find_files' references the variable whose name is `Esta escrito en espanol!' (es un nombre bastante largo, no?), but it is more likely to be a mistake. - - -File: make.info, Node: Origin Function, Next: Shell Function, Prev: Foreach Function, Up: Functions - -The `origin' Function -===================== - - The `origin' function is unlike most other functions in that it does -not operate on the values of variables; it tells you something *about* -a variable. Specifically, it tells you where it came from. - - The syntax of the `origin' function is: - - $(origin VARIABLE) - - Note that VARIABLE is the *name* of a variable to inquire about; not -a *reference* to that variable. Therefore you would not normally use a -`$' or parentheses when writing it. (You can, however, use a variable -reference in the name if you want the name not to be a constant.) - - The result of this function is a string telling you how the variable -VARIABLE was defined: - -`undefined' - if VARIABLE was never defined. - -`default' - if VARIABLE has a default definition, as is usual with `CC' and so - on. *Note Variables Used by Implicit Rules: Implicit Variables. - Note that if you have redefined a default variable, the `origin' - function will return the origin of the later definition. - -`environment' - if VARIABLE was defined as an environment variable and the `-e' - option is *not* turned on (*note Summary of Options: Options - Summary.). - -`environment override' - if VARIABLE was defined as an environment variable and the `-e' - option *is* turned on (*note Summary of Options: Options Summary.). - -`file' - if VARIABLE was defined in a makefile. - -`command line' - if VARIABLE was defined on the command line. - -`override' - if VARIABLE was defined with an `override' directive in a makefile - (*note The `override' Directive: Override Directive.). - -`automatic' - if VARIABLE is an automatic variable defined for the execution of - the commands for each rule (*note Automatic Variables: Automatic.). - - This information is primarily useful (other than for your curiosity) -to determine if you want to believe the value of a variable. For -example, suppose you have a makefile `foo' that includes another -makefile `bar'. You want a variable `bletch' to be defined in `bar' if -you run the command `make -f bar', even if the environment contains a -definition of `bletch'. However, if `foo' defined `bletch' before -including `bar', you do not want to override that definition. This -could be done by using an `override' directive in `foo', giving that -definition precedence over the later definition in `bar'; -unfortunately, the `override' directive would also override any command -line definitions. So, `bar' could include: - - ifdef bletch - ifeq "$(origin bletch)" "environment" - bletch = barf, gag, etc. - endif - endif - -If `bletch' has been defined from the environment, this will redefine -it. - - If you want to override a previous definition of `bletch' if it came -from the environment, even under `-e', you could instead write: - - ifneq "$(findstring environment,$(origin bletch))" "" - bletch = barf, gag, etc. - endif - - Here the redefinition takes place if `$(origin bletch)' returns -either `environment' or `environment override'. *Note Functions for -String Substitution and Analysis: Text Functions. - - -File: make.info, Node: Shell Function, Prev: Origin Function, Up: Functions - -The `shell' Function -==================== - - The `shell' function is unlike any other function except the -`wildcard' function (*note The Function `wildcard': Wildcard Function.) -in that it communicates with the world outside of `make'. - - The `shell' function performs the same function that backquotes -(``') perform in most shells: it does "command expansion". This means -that it takes an argument that is a shell command and returns the -output of the command. The only processing `make' does on the result, -before substituting it into the surrounding text, is to convert each -newline or carriage-return / newline pair to a single space. It also -removes the trailing (carriage-return and) newline, if it's the last -thing in the result. - - The commands run by calls to the `shell' function are run when the -function calls are expanded. In most cases, this is when the makefile -is read in. The exception is that function calls in the commands of -the rules are expanded when the commands are run, and this applies to -`shell' function calls like all others. - - Here are some examples of the use of the `shell' function: - - contents := $(shell cat foo) - -sets `contents' to the contents of the file `foo', with a space (rather -than a newline) separating each line. - - files := $(shell echo *.c) - -sets `files' to the expansion of `*.c'. Unless `make' is using a very -strange shell, this has the same result as `$(wildcard *.c)'. - - -File: make.info, Node: Running, Next: Implicit Rules, Prev: Functions, Up: Top - -How to Run `make' -***************** - - A makefile that says how to recompile a program can be used in more -than one way. The simplest use is to recompile every file that is out -of date. Usually, makefiles are written so that if you run `make' with -no arguments, it does just that. - - But you might want to update only some of the files; you might want -to use a different compiler or different compiler options; you might -want just to find out which files are out of date without changing them. - - By giving arguments when you run `make', you can do any of these -things and many others. - - The exit status of `make' is always one of three values: -`0' - The exit status is zero if `make' is successful. - -`2' - The exit status is two if `make' encounters any errors. It will - print messages describing the particular errors. - -`1' - The exit status is one if you use the `-q' flag and `make' - determines that some target is not already up to date. *Note - Instead of Executing the Commands: Instead of Execution. - -* Menu: - -* Makefile Arguments:: How to specify which makefile to use. -* Goals:: How to use goal arguments to specify which - parts of the makefile to use. -* Instead of Execution:: How to use mode flags to specify what - kind of thing to do with the commands - in the makefile other than simply - execute them. -* Avoiding Compilation:: How to avoid recompiling certain files. -* Overriding:: How to override a variable to specify - an alternate compiler and other things. -* Testing:: How to proceed past some errors, to - test compilation. -* Options Summary:: Summary of Options - - -File: make.info, Node: Makefile Arguments, Next: Goals, Up: Running - -Arguments to Specify the Makefile -================================= - - The way to specify the name of the makefile is with the `-f' or -`--file' option (`--makefile' also works). For example, `-f altmake' -says to use the file `altmake' as the makefile. - - If you use the `-f' flag several times and follow each `-f' with an -argument, all the specified files are used jointly as makefiles. - - If you do not use the `-f' or `--file' flag, the default is to try -`GNUmakefile', `makefile', and `Makefile', in that order, and use the -first of these three which exists or can be made (*note Writing -Makefiles: Makefiles.). diff -uPr make-3.76.1/make.info-5 make-3.77/make.info-5 --- make-3.76.1/make.info-5 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-5 Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -31,6 +31,194 @@ translation approved by the Free Software Foundation.  +File: make.info, Node: Origin Function, Next: Shell Function, Prev: Foreach Function, Up: Functions + +The `origin' Function +===================== + + The `origin' function is unlike most other functions in that it does +not operate on the values of variables; it tells you something *about* +a variable. Specifically, it tells you where it came from. + + The syntax of the `origin' function is: + + $(origin VARIABLE) + + Note that VARIABLE is the *name* of a variable to inquire about; not +a *reference* to that variable. Therefore you would not normally use a +`$' or parentheses when writing it. (You can, however, use a variable +reference in the name if you want the name not to be a constant.) + + The result of this function is a string telling you how the variable +VARIABLE was defined: + +`undefined' + if VARIABLE was never defined. + +`default' + if VARIABLE has a default definition, as is usual with `CC' and so + on. *Note Variables Used by Implicit Rules: Implicit Variables. + Note that if you have redefined a default variable, the `origin' + function will return the origin of the later definition. + +`environment' + if VARIABLE was defined as an environment variable and the `-e' + option is *not* turned on (*note Summary of Options: Options + Summary.). + +`environment override' + if VARIABLE was defined as an environment variable and the `-e' + option *is* turned on (*note Summary of Options: Options Summary.). + +`file' + if VARIABLE was defined in a makefile. + +`command line' + if VARIABLE was defined on the command line. + +`override' + if VARIABLE was defined with an `override' directive in a makefile + (*note The `override' Directive: Override Directive.). + +`automatic' + if VARIABLE is an automatic variable defined for the execution of + the commands for each rule (*note Automatic Variables: Automatic.). + + This information is primarily useful (other than for your curiosity) +to determine if you want to believe the value of a variable. For +example, suppose you have a makefile `foo' that includes another +makefile `bar'. You want a variable `bletch' to be defined in `bar' if +you run the command `make -f bar', even if the environment contains a +definition of `bletch'. However, if `foo' defined `bletch' before +including `bar', you do not want to override that definition. This +could be done by using an `override' directive in `foo', giving that +definition precedence over the later definition in `bar'; +unfortunately, the `override' directive would also override any command +line definitions. So, `bar' could include: + + ifdef bletch + ifeq "$(origin bletch)" "environment" + bletch = barf, gag, etc. + endif + endif + +If `bletch' has been defined from the environment, this will redefine +it. + + If you want to override a previous definition of `bletch' if it came +from the environment, even under `-e', you could instead write: + + ifneq "$(findstring environment,$(origin bletch))" "" + bletch = barf, gag, etc. + endif + + Here the redefinition takes place if `$(origin bletch)' returns +either `environment' or `environment override'. *Note Functions for +String Substitution and Analysis: Text Functions. + + +File: make.info, Node: Shell Function, Prev: Origin Function, Up: Functions + +The `shell' Function +==================== + + The `shell' function is unlike any other function except the +`wildcard' function (*note The Function `wildcard': Wildcard Function.) +in that it communicates with the world outside of `make'. + + The `shell' function performs the same function that backquotes +(``') perform in most shells: it does "command expansion". This means +that it takes an argument that is a shell command and returns the +output of the command. The only processing `make' does on the result, +before substituting it into the surrounding text, is to convert each +newline or carriage-return / newline pair to a single space. It also +removes the trailing (carriage-return and) newline, if it's the last +thing in the result. + + The commands run by calls to the `shell' function are run when the +function calls are expanded. In most cases, this is when the makefile +is read in. The exception is that function calls in the commands of +the rules are expanded when the commands are run, and this applies to +`shell' function calls like all others. + + Here are some examples of the use of the `shell' function: + + contents := $(shell cat foo) + +sets `contents' to the contents of the file `foo', with a space (rather +than a newline) separating each line. + + files := $(shell echo *.c) + +sets `files' to the expansion of `*.c'. Unless `make' is using a very +strange shell, this has the same result as `$(wildcard *.c)'. + + +File: make.info, Node: Running, Next: Implicit Rules, Prev: Functions, Up: Top + +How to Run `make' +***************** + + A makefile that says how to recompile a program can be used in more +than one way. The simplest use is to recompile every file that is out +of date. Usually, makefiles are written so that if you run `make' with +no arguments, it does just that. + + But you might want to update only some of the files; you might want +to use a different compiler or different compiler options; you might +want just to find out which files are out of date without changing them. + + By giving arguments when you run `make', you can do any of these +things and many others. + + The exit status of `make' is always one of three values: +`0' + The exit status is zero if `make' is successful. + +`2' + The exit status is two if `make' encounters any errors. It will + print messages describing the particular errors. + +`1' + The exit status is one if you use the `-q' flag and `make' + determines that some target is not already up to date. *Note + Instead of Executing the Commands: Instead of Execution. + +* Menu: + +* Makefile Arguments:: How to specify which makefile to use. +* Goals:: How to use goal arguments to specify which + parts of the makefile to use. +* Instead of Execution:: How to use mode flags to specify what + kind of thing to do with the commands + in the makefile other than simply + execute them. +* Avoiding Compilation:: How to avoid recompiling certain files. +* Overriding:: How to override a variable to specify + an alternate compiler and other things. +* Testing:: How to proceed past some errors, to + test compilation. +* Options Summary:: Summary of Options + + +File: make.info, Node: Makefile Arguments, Next: Goals, Up: Running + +Arguments to Specify the Makefile +================================= + + The way to specify the name of the makefile is with the `-f' or +`--file' option (`--makefile' also works). For example, `-f altmake' +says to use the file `altmake' as the makefile. + + If you use the `-f' flag several times and follow each `-f' with an +argument, all the specified files are used jointly as makefiles. + + If you do not use the `-f' or `--file' flag, the default is to try +`GNUmakefile', `makefile', and `Makefile', in that order, and use the +first of these three which exists or can be made (*note Writing +Makefiles: Makefiles.). + + File: make.info, Node: Goals, Next: Instead of Execution, Prev: Makefile Arguments, Up: Running Arguments to Specify the Goals @@ -475,7 +663,10 @@ Pattern Rules.). The `-r' option also clears out the default list of suffixes for suffix rules (*note Old-Fashioned Suffix Rules: Suffix Rules.). But you can still define your own suffixes with a - rule for `.SUFFIXES', and then define your own suffix rules. + rule for `.SUFFIXES', and then define your own suffix rules. Note + that only *rules* are affected by the `-r' option; default + variables remain in effect (*note Variables Used by Implicit + Rules: Implicit Variables.). `-s' `--silent' @@ -1005,218 +1196,4 @@ `YFLAGS' Extra flags to give to Yacc. - - -File: make.info, Node: Chained Rules, Next: Pattern Rules, Prev: Implicit Variables, Up: Implicit Rules - -Chains of Implicit Rules -======================== - - Sometimes a file can be made by a sequence of implicit rules. For -example, a file `N.o' could be made from `N.y' by running first Yacc -and then `cc'. Such a sequence is called a "chain". - - If the file `N.c' exists, or is mentioned in the makefile, no -special searching is required: `make' finds that the object file can be -made by C compilation from `N.c'; later on, when considering how to -make `N.c', the rule for running Yacc is used. Ultimately both `N.c' -and `N.o' are updated. - - However, even if `N.c' does not exist and is not mentioned, `make' -knows how to envision it as the missing link between `N.o' and `N.y'! -In this case, `N.c' is called an "intermediate file". Once `make' has -decided to use the intermediate file, it is entered in the data base as -if it had been mentioned in the makefile, along with the implicit rule -that says how to create it. - - Intermediate files are remade using their rules just like all other -files. But intermediate files are treated differently in two ways. - - The first difference is what happens if the intermediate file does -not exist. If an ordinary file B does not exist, and `make' considers -a target that depends on B, it invariably creates B and then updates -the target from B. But if B is an intermediate file, then `make' can -leave well enough alone. It won't bother updating B, or the ultimate -target, unless some dependency of B is newer than that target or there -is some other reason to update that target. - - The second difference is that if `make' *does* create B in order to -update something else, it deletes B later on after it is no longer -needed. Therefore, an intermediate file which did not exist before -`make' also does not exist after `make'. `make' reports the deletion -to you by printing a `rm -f' command showing which file it is deleting. - - Ordinarily, a file cannot be intermediate if it is mentioned in the -makefile as a target or dependency. However, you can explicitly mark a -file as intermediate by listing it as a dependency of the special target -`.INTERMEDIATE'. This takes effect even if the file is mentioned -explicitly in some other way. - - You can prevent automatic deletion of an intermediate file by -marking it as a "secondary" file. To do this, list it as a dependency -of the special target `.SECONDARY'. When a file is secondary, `make' -will not create the file merely because it does not already exist, but -`make' does not automatically delete the file. Marking a file as -secondary also marks it as intermediate. - - You can list the target pattern of an implicit rule (such as `%.o') -as a dependency of the special target `.PRECIOUS' to preserve -intermediate files made by implicit rules whose target patterns match -that file's name; see *Note Interrupts::. - - A chain can involve more than two implicit rules. For example, it is -possible to make a file `foo' from `RCS/foo.y,v' by running RCS, Yacc -and `cc'. Then both `foo.y' and `foo.c' are intermediate files that -are deleted at the end. - - No single implicit rule can appear more than once in a chain. This -means that `make' will not even consider such a ridiculous thing as -making `foo' from `foo.o.o' by running the linker twice. This -constraint has the added benefit of preventing any infinite loop in the -search for an implicit rule chain. - - There are some special implicit rules to optimize certain cases that -would otherwise be handled by rule chains. For example, making `foo' -from `foo.c' could be handled by compiling and linking with separate -chained rules, using `foo.o' as an intermediate file. But what -actually happens is that a special rule for this case does the -compilation and linking with a single `cc' command. The optimized rule -is used in preference to the step-by-step chain because it comes -earlier in the ordering of rules. - - -File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules - -Defining and Redefining Pattern Rules -===================================== - - You define an implicit rule by writing a "pattern rule". A pattern -rule looks like an ordinary rule, except that its target contains the -character `%' (exactly one of them). The target is considered a -pattern for matching file names; the `%' can match any nonempty -substring, while other characters match only themselves. The -dependencies likewise use `%' to show how their names relate to the -target name. - - Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o' -from another file `STEM.c'. - - Note that expansion using `%' in pattern rules occurs *after* any -variable or function expansions, which take place when the makefile is -read. *Note How to Use Variables: Using Variables, and *Note Functions -for Transforming Text: Functions. - -* Menu: - -* Pattern Intro:: An introduction to pattern rules. -* Pattern Examples:: Examples of pattern rules. -* Automatic:: How to use automatic variables in the - commands of implicit rules. -* Pattern Match:: How patterns match. -* Match-Anything Rules:: Precautions you should take prior to - defining rules that can match any - target file whatever. -* Canceling Rules:: How to override or cancel built-in rules. - - -File: make.info, Node: Pattern Intro, Next: Pattern Examples, Up: Pattern Rules - -Introduction to Pattern Rules ------------------------------ - - A pattern rule contains the character `%' (exactly one of them) in -the target; otherwise, it looks exactly like an ordinary rule. The -target is a pattern for matching file names; the `%' matches any -nonempty substring, while other characters match only themselves. - - For example, `%.c' as a pattern matches any file name that ends in -`.c'. `s.%.c' as a pattern matches any file name that starts with -`s.', ends in `.c' and is at least five characters long. (There must -be at least one character to match the `%'.) The substring that the -`%' matches is called the "stem". - - `%' in a dependency of a pattern rule stands for the same stem that -was matched by the `%' in the target. In order for the pattern rule to -apply, its target pattern must match the file name under consideration, -and its dependency patterns must name files that exist or can be made. -These files become dependencies of the target. - - Thus, a rule of the form - - %.o : %.c ; COMMAND... - -specifies how to make a file `N.o', with another file `N.c' as its -dependency, provided that `N.c' exists or can be made. - - There may also be dependencies that do not use `%'; such a dependency -attaches to every file made by this pattern rule. These unvarying -dependencies are useful occasionally. - - A pattern rule need not have any dependencies that contain `%', or -in fact any dependencies at all. Such a rule is effectively a general -wildcard. It provides a way to make any file that matches the target -pattern. *Note Last Resort::. - - Pattern rules may have more than one target. Unlike normal rules, -this does not act as many different rules with the same dependencies and -commands. If a pattern rule has multiple targets, `make' knows that -the rule's commands are responsible for making all of the targets. The -commands are executed only once to make all the targets. When searching -for a pattern rule to match a target, the target patterns of a rule -other than the one that matches the target in need of a rule are -incidental: `make' worries only about giving commands and dependencies -to the file presently in question. However, when this file's commands -are run, the other targets are marked as having been updated themselves. - - The order in which pattern rules appear in the makefile is important -since this is the order in which they are considered. Of equally -applicable rules, only the first one found is used. The rules you -write take precedence over those that are built in. Note however, that -a rule whose dependencies actually exist or are mentioned always takes -priority over a rule with dependencies that must be made by chaining -other implicit rules. - - -File: make.info, Node: Pattern Examples, Next: Automatic, Prev: Pattern Intro, Up: Pattern Rules - -Pattern Rule Examples ---------------------- - - Here are some examples of pattern rules actually predefined in -`make'. First, the rule that compiles `.c' files into `.o' files: - - %.o : %.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - -defines a rule that can make any file `X.o' from `X.c'. The command -uses the automatic variables `$@' and `$<' to substitute the names of -the target file and the source file in each case where the rule applies -(*note Automatic Variables: Automatic.). - - Here is a second built-in rule: - - % :: RCS/%,v - $(CO) $(COFLAGS) $< - -defines a rule that can make any file `X' whatsoever from a -corresponding file `X,v' in the subdirectory `RCS'. Since the target -is `%', this rule will apply to any file whatever, provided the -appropriate dependency file exists. The double colon makes the rule -"terminal", which means that its dependency may not be an intermediate -file (*note Match-Anything Pattern Rules: Match-Anything Rules.). - - This pattern rule has two targets: - - %.tab.c %.tab.h: %.y - bison -d $< - -This tells `make' that the command `bison -d X.y' will make both -`X.tab.c' and `X.tab.h'. If the file `foo' depends on the files -`parse.tab.o' and `scan.o' and the file `scan.o' depends on the file -`parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y' -will be executed only once, and the dependencies of both `parse.tab.o' -and `scan.o' will be satisfied. (Presumably the file `parse.tab.o' -will be recompiled from `parse.tab.c' and the file `scan.o' from -`scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its -other dependencies, and it will execute happily ever after.) diff -uPr make-3.76.1/make.info-6 make-3.77/make.info-6 --- make-3.76.1/make.info-6 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-6 Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -31,6 +31,220 @@ translation approved by the Free Software Foundation.  +File: make.info, Node: Chained Rules, Next: Pattern Rules, Prev: Implicit Variables, Up: Implicit Rules + +Chains of Implicit Rules +======================== + + Sometimes a file can be made by a sequence of implicit rules. For +example, a file `N.o' could be made from `N.y' by running first Yacc +and then `cc'. Such a sequence is called a "chain". + + If the file `N.c' exists, or is mentioned in the makefile, no +special searching is required: `make' finds that the object file can be +made by C compilation from `N.c'; later on, when considering how to +make `N.c', the rule for running Yacc is used. Ultimately both `N.c' +and `N.o' are updated. + + However, even if `N.c' does not exist and is not mentioned, `make' +knows how to envision it as the missing link between `N.o' and `N.y'! +In this case, `N.c' is called an "intermediate file". Once `make' has +decided to use the intermediate file, it is entered in the data base as +if it had been mentioned in the makefile, along with the implicit rule +that says how to create it. + + Intermediate files are remade using their rules just like all other +files. But intermediate files are treated differently in two ways. + + The first difference is what happens if the intermediate file does +not exist. If an ordinary file B does not exist, and `make' considers +a target that depends on B, it invariably creates B and then updates +the target from B. But if B is an intermediate file, then `make' can +leave well enough alone. It won't bother updating B, or the ultimate +target, unless some dependency of B is newer than that target or there +is some other reason to update that target. + + The second difference is that if `make' *does* create B in order to +update something else, it deletes B later on after it is no longer +needed. Therefore, an intermediate file which did not exist before +`make' also does not exist after `make'. `make' reports the deletion +to you by printing a `rm -f' command showing which file it is deleting. + + Ordinarily, a file cannot be intermediate if it is mentioned in the +makefile as a target or dependency. However, you can explicitly mark a +file as intermediate by listing it as a dependency of the special target +`.INTERMEDIATE'. This takes effect even if the file is mentioned +explicitly in some other way. + + You can prevent automatic deletion of an intermediate file by +marking it as a "secondary" file. To do this, list it as a dependency +of the special target `.SECONDARY'. When a file is secondary, `make' +will not create the file merely because it does not already exist, but +`make' does not automatically delete the file. Marking a file as +secondary also marks it as intermediate. + + You can list the target pattern of an implicit rule (such as `%.o') +as a dependency of the special target `.PRECIOUS' to preserve +intermediate files made by implicit rules whose target patterns match +that file's name; see *Note Interrupts::. + + A chain can involve more than two implicit rules. For example, it is +possible to make a file `foo' from `RCS/foo.y,v' by running RCS, Yacc +and `cc'. Then both `foo.y' and `foo.c' are intermediate files that +are deleted at the end. + + No single implicit rule can appear more than once in a chain. This +means that `make' will not even consider such a ridiculous thing as +making `foo' from `foo.o.o' by running the linker twice. This +constraint has the added benefit of preventing any infinite loop in the +search for an implicit rule chain. + + There are some special implicit rules to optimize certain cases that +would otherwise be handled by rule chains. For example, making `foo' +from `foo.c' could be handled by compiling and linking with separate +chained rules, using `foo.o' as an intermediate file. But what +actually happens is that a special rule for this case does the +compilation and linking with a single `cc' command. The optimized rule +is used in preference to the step-by-step chain because it comes +earlier in the ordering of rules. + + +File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules + +Defining and Redefining Pattern Rules +===================================== + + You define an implicit rule by writing a "pattern rule". A pattern +rule looks like an ordinary rule, except that its target contains the +character `%' (exactly one of them). The target is considered a +pattern for matching file names; the `%' can match any nonempty +substring, while other characters match only themselves. The +dependencies likewise use `%' to show how their names relate to the +target name. + + Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o' +from another file `STEM.c'. + + Note that expansion using `%' in pattern rules occurs *after* any +variable or function expansions, which take place when the makefile is +read. *Note How to Use Variables: Using Variables, and *Note Functions +for Transforming Text: Functions. + +* Menu: + +* Pattern Intro:: An introduction to pattern rules. +* Pattern Examples:: Examples of pattern rules. +* Automatic:: How to use automatic variables in the + commands of implicit rules. +* Pattern Match:: How patterns match. +* Match-Anything Rules:: Precautions you should take prior to + defining rules that can match any + target file whatever. +* Canceling Rules:: How to override or cancel built-in rules. + + +File: make.info, Node: Pattern Intro, Next: Pattern Examples, Up: Pattern Rules + +Introduction to Pattern Rules +----------------------------- + + A pattern rule contains the character `%' (exactly one of them) in +the target; otherwise, it looks exactly like an ordinary rule. The +target is a pattern for matching file names; the `%' matches any +nonempty substring, while other characters match only themselves. + + For example, `%.c' as a pattern matches any file name that ends in +`.c'. `s.%.c' as a pattern matches any file name that starts with +`s.', ends in `.c' and is at least five characters long. (There must +be at least one character to match the `%'.) The substring that the +`%' matches is called the "stem". + + `%' in a dependency of a pattern rule stands for the same stem that +was matched by the `%' in the target. In order for the pattern rule to +apply, its target pattern must match the file name under consideration, +and its dependency patterns must name files that exist or can be made. +These files become dependencies of the target. + + Thus, a rule of the form + + %.o : %.c ; COMMAND... + +specifies how to make a file `N.o', with another file `N.c' as its +dependency, provided that `N.c' exists or can be made. + + There may also be dependencies that do not use `%'; such a dependency +attaches to every file made by this pattern rule. These unvarying +dependencies are useful occasionally. + + A pattern rule need not have any dependencies that contain `%', or +in fact any dependencies at all. Such a rule is effectively a general +wildcard. It provides a way to make any file that matches the target +pattern. *Note Last Resort::. + + Pattern rules may have more than one target. Unlike normal rules, +this does not act as many different rules with the same dependencies and +commands. If a pattern rule has multiple targets, `make' knows that +the rule's commands are responsible for making all of the targets. The +commands are executed only once to make all the targets. When searching +for a pattern rule to match a target, the target patterns of a rule +other than the one that matches the target in need of a rule are +incidental: `make' worries only about giving commands and dependencies +to the file presently in question. However, when this file's commands +are run, the other targets are marked as having been updated themselves. + + The order in which pattern rules appear in the makefile is important +since this is the order in which they are considered. Of equally +applicable rules, only the first one found is used. The rules you +write take precedence over those that are built in. Note however, that +a rule whose dependencies actually exist or are mentioned always takes +priority over a rule with dependencies that must be made by chaining +other implicit rules. + + +File: make.info, Node: Pattern Examples, Next: Automatic, Prev: Pattern Intro, Up: Pattern Rules + +Pattern Rule Examples +--------------------- + + Here are some examples of pattern rules actually predefined in +`make'. First, the rule that compiles `.c' files into `.o' files: + + %.o : %.c + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ + +defines a rule that can make any file `X.o' from `X.c'. The command +uses the automatic variables `$@' and `$<' to substitute the names of +the target file and the source file in each case where the rule applies +(*note Automatic Variables: Automatic.). + + Here is a second built-in rule: + + % :: RCS/%,v + $(CO) $(COFLAGS) $< + +defines a rule that can make any file `X' whatsoever from a +corresponding file `X,v' in the subdirectory `RCS'. Since the target +is `%', this rule will apply to any file whatever, provided the +appropriate dependency file exists. The double colon makes the rule +"terminal", which means that its dependency may not be an intermediate +file (*note Match-Anything Pattern Rules: Match-Anything Rules.). + + This pattern rule has two targets: + + %.tab.c %.tab.h: %.y + bison -d $< + +This tells `make' that the command `bison -d X.y' will make both +`X.tab.c' and `X.tab.h'. If the file `foo' depends on the files +`parse.tab.o' and `scan.o' and the file `scan.o' depends on the file +`parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y' +will be executed only once, and the dependencies of both `parse.tab.o' +and `scan.o' will be satisfied. (Presumably the file `parse.tab.o' +will be recompiled from `parse.tab.c' and the file `scan.o' from +`scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its +other dependencies, and it will execute happily ever after.) + + File: make.info, Node: Automatic, Next: Pattern Match, Prev: Pattern Examples, Up: Pattern Rules Automatic Variables @@ -910,260 +1124,4 @@ * The built-in variable `MAKE_VERSION' gives the version number of `make'. - - -File: make.info, Node: Missing, Next: Makefile Conventions, Prev: Features, Up: Top - -Incompatibilities and Missing Features -************************************** - - The `make' programs in various other systems support a few features -that are not implemented in GNU `make'. The POSIX.2 standard (`IEEE -Standard 1003.2-1992') which specifies `make' does not require any of -these features. - - * A target of the form `FILE((ENTRY))' stands for a member of - archive file FILE. The member is chosen, not by name, but by - being an object file which defines the linker symbol ENTRY. - - This feature was not put into GNU `make' because of the - nonmodularity of putting knowledge into `make' of the internal - format of archive file symbol tables. *Note Updating Archive - Symbol Directories: Archive Symbols. - - * Suffixes (used in suffix rules) that end with the character `~' - have a special meaning to System V `make'; they refer to the SCCS - file that corresponds to the file one would get without the `~'. - For example, the suffix rule `.c~.o' would make the file `N.o' from - the SCCS file `s.N.c'. For complete coverage, a whole series of - such suffix rules is required. *Note Old-Fashioned Suffix Rules: - Suffix Rules. - - In GNU `make', this entire series of cases is handled by two - pattern rules for extraction from SCCS, in combination with the - general feature of rule chaining. *Note Chains of Implicit Rules: - Chained Rules. - - * In System V `make', the string `$$@' has the strange meaning that, - in the dependencies of a rule with multiple targets, it stands for - the particular target that is being processed. - - This is not defined in GNU `make' because `$$' should always stand - for an ordinary `$'. - - It is possible to get this functionality through the use of static - pattern rules (*note Static Pattern Rules: Static Pattern.). The - System V `make' rule: - - $(targets): $$@.o lib.a - - can be replaced with the GNU `make' static pattern rule: - - $(targets): %: %.o lib.a - - * In System V and 4.3 BSD `make', files found by `VPATH' search - (*note Searching Directories for Dependencies: Directory Search.) - have their names changed inside command strings. We feel it is - much cleaner to always use automatic variables and thus make this - feature obsolete. - - * In some Unix `make's, the automatic variable `$*' appearing in the - dependencies of a rule has the amazingly strange "feature" of - expanding to the full name of the *target of that rule*. We cannot - imagine what went on in the minds of Unix `make' developers to do - this; it is utterly inconsistent with the normal definition of - `$*'. - - * In some Unix `make's, implicit rule search (*note Using Implicit - Rules: Implicit Rules.) is apparently done for *all* targets, not - just those without commands. This means you can do: - - foo.o: - cc -c foo.c - - and Unix `make' will intuit that `foo.o' depends on `foo.c'. - - We feel that such usage is broken. The dependency properties of - `make' are well-defined (for GNU `make', at least), and doing such - a thing simply does not fit the model. - - * GNU `make' does not include any built-in implicit rules for - compiling or preprocessing EFL programs. If we hear of anyone who - is using EFL, we will gladly add them. - - * It appears that in SVR4 `make', a suffix rule can be specified with - no commands, and it is treated as if it had empty commands (*note - Empty Commands::.). For example: - - .c.a: - - will override the built-in `.c.a' suffix rule. - - We feel that it is cleaner for a rule without commands to always - simply add to the dependency list for the target. The above - example can be easily rewritten to get the desired behavior in GNU - `make': - - .c.a: ; - - * Some versions of `make' invoke the shell with the `-e' flag, - except under `-k' (*note Testing the Compilation of a Program: - Testing.). The `-e' flag tells the shell to exit as soon as any - program it runs returns a nonzero status. We feel it is cleaner to - write each shell command line to stand on its own and not require - this special treatment. - - -File: make.info, Node: Makefile Conventions, Next: Quick Reference, Prev: Missing, Up: Top - -Makefile Conventions -******************** - - This node describes conventions for writing the Makefiles for GNU -programs. - -* Menu: - -* Makefile Basics:: General Conventions for Makefiles -* Utilities in Makefiles:: Utilities in Makefiles -* Command Variables:: Variables for Specifying Commands -* Directory Variables:: Variables for Installation Directories -* Standard Targets:: Standard Targets for Users -* Install Command Categories:: Three categories of commands in the `install' - rule: normal, pre-install and post-install. - - -File: make.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions - -General Conventions for Makefiles -================================= - - Every Makefile should contain this line: - - SHELL = /bin/sh - -to avoid trouble on systems where the `SHELL' variable might be -inherited from the environment. (This is never a problem with GNU -`make'.) - - Different `make' programs have incompatible suffix lists and -implicit rules, and this sometimes creates confusion or misbehavior. So -it is a good idea to set the suffix list explicitly using only the -suffixes you need in the particular Makefile, like this: - - .SUFFIXES: - .SUFFIXES: .c .o - -The first line clears out the suffix list, the second introduces all -suffixes which may be subject to implicit rules in this Makefile. - - Don't assume that `.' is in the path for command execution. When -you need to run programs that are a part of your package during the -make, please make sure that it uses `./' if the program is built as -part of the make or `$(srcdir)/' if the file is an unchanging part of -the source code. Without one of these prefixes, the current search -path is used. - - The distinction between `./' (the "build directory") and -`$(srcdir)/' (the "source directory") is important because users can -build in a separate directory using the `--srcdir' option to -`configure'. A rule of the form: - - foo.1 : foo.man sedscript - sed -e sedscript foo.man > foo.1 - -will fail when the build directory is not the source directory, because -`foo.man' and `sedscript' are in the the source directory. - - When using GNU `make', relying on `VPATH' to find the source file -will work in the case where there is a single dependency file, since -the `make' automatic variable `$<' will represent the source file -wherever it is. (Many versions of `make' set `$<' only in implicit -rules.) A Makefile target like - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o - -should instead be written as - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ - -in order to allow `VPATH' to work correctly. When the target has -multiple dependencies, using an explicit `$(srcdir)' is the easiest way -to make the rule work well. For example, the target above for `foo.1' -is best written as: - - foo.1 : foo.man sedscript - sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ - - GNU distributions usually contain some files which are not source -files--for example, Info files, and the output from Autoconf, Automake, -Bison or Flex. Since these files normally appear in the source -directory, they should always appear in the source directory, not in the -build directory. So Makefile rules to update them should put the -updated files in the source directory. - - However, if a file does not appear in the distribution, then the -Makefile should not put it in the source directory, because building a -program in ordinary circumstances should not modify the source directory -in any way. - - Try to make the build and installation targets, at least (and all -their subtargets) work correctly with a parallel `make'. - - -File: make.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions - -Utilities in Makefiles -====================== - - Write the Makefile commands (and any shell scripts, such as -`configure') to run in `sh', not in `csh'. Don't use any special -features of `ksh' or `bash'. - - The `configure' script and the Makefile rules for building and -installation should not use any utilities directly except these: - - cat cmp cp diff echo egrep expr false grep install-info - ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true - - The compression program `gzip' can be used in the `dist' rule. - - Stick to the generally supported options for these programs. For -example, don't use `mkdir -p', convenient as it may be, because most -systems don't support it. - - It is a good idea to avoid creating symbolic links in makefiles, -since a few systems don't support them. - - The Makefile rules for building and installation can also use -compilers and related programs, but should do so via `make' variables -so that the user can substitute alternatives. Here are some of the -programs we mean: - - ar bison cc flex install ld ldconfig lex - make makeinfo ranlib texi2dvi yacc - - Use the following `make' variables to run those programs: - - $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) - $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) - - When you use `ranlib' or `ldconfig', you should make sure nothing -bad happens if the system does not have the program in question. -Arrange to ignore an error from that command, and print a message before -the command to tell the user that failure of this command does not mean -a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.) - - If you use symbolic links, you should implement a fallback for -systems that don't have symbolic links. - - Additional utilities that can be used via Make variables are: - - chgrp chmod chown mknod - - It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities -exist. diff -uPr make-3.76.1/make.info-7 make-3.77/make.info-7 --- make-3.76.1/make.info-7 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-7 Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -31,6 +31,262 @@ translation approved by the Free Software Foundation.  +File: make.info, Node: Missing, Next: Makefile Conventions, Prev: Features, Up: Top + +Incompatibilities and Missing Features +************************************** + + The `make' programs in various other systems support a few features +that are not implemented in GNU `make'. The POSIX.2 standard (`IEEE +Standard 1003.2-1992') which specifies `make' does not require any of +these features. + + * A target of the form `FILE((ENTRY))' stands for a member of + archive file FILE. The member is chosen, not by name, but by + being an object file which defines the linker symbol ENTRY. + + This feature was not put into GNU `make' because of the + nonmodularity of putting knowledge into `make' of the internal + format of archive file symbol tables. *Note Updating Archive + Symbol Directories: Archive Symbols. + + * Suffixes (used in suffix rules) that end with the character `~' + have a special meaning to System V `make'; they refer to the SCCS + file that corresponds to the file one would get without the `~'. + For example, the suffix rule `.c~.o' would make the file `N.o' from + the SCCS file `s.N.c'. For complete coverage, a whole series of + such suffix rules is required. *Note Old-Fashioned Suffix Rules: + Suffix Rules. + + In GNU `make', this entire series of cases is handled by two + pattern rules for extraction from SCCS, in combination with the + general feature of rule chaining. *Note Chains of Implicit Rules: + Chained Rules. + + * In System V `make', the string `$$@' has the strange meaning that, + in the dependencies of a rule with multiple targets, it stands for + the particular target that is being processed. + + This is not defined in GNU `make' because `$$' should always stand + for an ordinary `$'. + + It is possible to get this functionality through the use of static + pattern rules (*note Static Pattern Rules: Static Pattern.). The + System V `make' rule: + + $(targets): $$@.o lib.a + + can be replaced with the GNU `make' static pattern rule: + + $(targets): %: %.o lib.a + + * In System V and 4.3 BSD `make', files found by `VPATH' search + (*note Searching Directories for Dependencies: Directory Search.) + have their names changed inside command strings. We feel it is + much cleaner to always use automatic variables and thus make this + feature obsolete. + + * In some Unix `make's, the automatic variable `$*' appearing in the + dependencies of a rule has the amazingly strange "feature" of + expanding to the full name of the *target of that rule*. We cannot + imagine what went on in the minds of Unix `make' developers to do + this; it is utterly inconsistent with the normal definition of + `$*'. + + * In some Unix `make's, implicit rule search (*note Using Implicit + Rules: Implicit Rules.) is apparently done for *all* targets, not + just those without commands. This means you can do: + + foo.o: + cc -c foo.c + + and Unix `make' will intuit that `foo.o' depends on `foo.c'. + + We feel that such usage is broken. The dependency properties of + `make' are well-defined (for GNU `make', at least), and doing such + a thing simply does not fit the model. + + * GNU `make' does not include any built-in implicit rules for + compiling or preprocessing EFL programs. If we hear of anyone who + is using EFL, we will gladly add them. + + * It appears that in SVR4 `make', a suffix rule can be specified with + no commands, and it is treated as if it had empty commands (*note + Empty Commands::.). For example: + + .c.a: + + will override the built-in `.c.a' suffix rule. + + We feel that it is cleaner for a rule without commands to always + simply add to the dependency list for the target. The above + example can be easily rewritten to get the desired behavior in GNU + `make': + + .c.a: ; + + * Some versions of `make' invoke the shell with the `-e' flag, + except under `-k' (*note Testing the Compilation of a Program: + Testing.). The `-e' flag tells the shell to exit as soon as any + program it runs returns a nonzero status. We feel it is cleaner to + write each shell command line to stand on its own and not require + this special treatment. + + +File: make.info, Node: Makefile Conventions, Next: Quick Reference, Prev: Missing, Up: Top + +Makefile Conventions +******************** + + This node describes conventions for writing the Makefiles for GNU +programs. + +* Menu: + +* Makefile Basics:: General Conventions for Makefiles +* Utilities in Makefiles:: Utilities in Makefiles +* Command Variables:: Variables for Specifying Commands +* Directory Variables:: Variables for Installation Directories +* Standard Targets:: Standard Targets for Users +* Install Command Categories:: Three categories of commands in the `install' + rule: normal, pre-install and post-install. + + +File: make.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions + +General Conventions for Makefiles +================================= + + Every Makefile should contain this line: + + SHELL = /bin/sh + +to avoid trouble on systems where the `SHELL' variable might be +inherited from the environment. (This is never a problem with GNU +`make'.) + + Different `make' programs have incompatible suffix lists and +implicit rules, and this sometimes creates confusion or misbehavior. So +it is a good idea to set the suffix list explicitly using only the +suffixes you need in the particular Makefile, like this: + + .SUFFIXES: + .SUFFIXES: .c .o + +The first line clears out the suffix list, the second introduces all +suffixes which may be subject to implicit rules in this Makefile. + + Don't assume that `.' is in the path for command execution. When +you need to run programs that are a part of your package during the +make, please make sure that it uses `./' if the program is built as +part of the make or `$(srcdir)/' if the file is an unchanging part of +the source code. Without one of these prefixes, the current search +path is used. + + The distinction between `./' (the "build directory") and +`$(srcdir)/' (the "source directory") is important because users can +build in a separate directory using the `--srcdir' option to +`configure'. A rule of the form: + + foo.1 : foo.man sedscript + sed -e sedscript foo.man > foo.1 + +will fail when the build directory is not the source directory, because +`foo.man' and `sedscript' are in the the source directory. + + When using GNU `make', relying on `VPATH' to find the source file +will work in the case where there is a single dependency file, since +the `make' automatic variable `$<' will represent the source file +wherever it is. (Many versions of `make' set `$<' only in implicit +rules.) A Makefile target like + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o + +should instead be written as + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ + +in order to allow `VPATH' to work correctly. When the target has +multiple dependencies, using an explicit `$(srcdir)' is the easiest way +to make the rule work well. For example, the target above for `foo.1' +is best written as: + + foo.1 : foo.man sedscript + sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ + + GNU distributions usually contain some files which are not source +files--for example, Info files, and the output from Autoconf, Automake, +Bison or Flex. Since these files normally appear in the source +directory, they should always appear in the source directory, not in the +build directory. So Makefile rules to update them should put the +updated files in the source directory. + + However, if a file does not appear in the distribution, then the +Makefile should not put it in the source directory, because building a +program in ordinary circumstances should not modify the source directory +in any way. + + Try to make the build and installation targets, at least (and all +their subtargets) work correctly with a parallel `make'. + + +File: make.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions + +Utilities in Makefiles +====================== + + Write the Makefile commands (and any shell scripts, such as +`configure') to run in `sh', not in `csh'. Don't use any special +features of `ksh' or `bash'. + + The `configure' script and the Makefile rules for building and +installation should not use any utilities directly except these: + + cat cmp cp diff echo egrep expr false grep install-info + ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true + + The compression program `gzip' can be used in the `dist' rule. + + Stick to the generally supported options for these programs. For +example, don't use `mkdir -p', convenient as it may be, because most +systems don't support it. + + It is a good idea to avoid creating symbolic links in makefiles, +since a few systems don't support them. + + The Makefile rules for building and installation can also use +compilers and related programs, but should do so via `make' variables +so that the user can substitute alternatives. Here are some of the +programs we mean: + + ar bison cc flex install ld ldconfig lex + make makeinfo ranlib texi2dvi yacc + + Use the following `make' variables to run those programs: + + $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) + $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) + + When you use `ranlib' or `ldconfig', you should make sure nothing +bad happens if the system does not have the program in question. +Arrange to ignore an error from that command, and print a message before +the command to tell the user that failure of this command does not mean +a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.) + + If you use symbolic links, you should implement a fallback for +systems that don't have symbolic links. + + Additional utilities that can be used via Make variables are: + + chgrp chmod chown mknod + + It is ok to use other utilities in Makefile portions (or scripts) +intended only for particular systems where you know those utilities +exist. + + File: make.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions Variables for Specifying Commands @@ -51,8 +307,9 @@ Each program-name variable should come with an options variable that is used to supply options to the program. Append `FLAGS' to the program-name variable name to get the options variable name--for -example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this -rule, but we keep it because it is standard.) Use `CPPFLAGS' in any +example, `BISONFLAGS'. (The names `CFLAGS' for the C compiler, +`YFLAGS' for yacc, and `LFLAGS' for lex, are exceptions to this rule, +but we keep them because they are standard.) Use `CPPFLAGS' in any compilation command that runs the preprocessor, and use `LDFLAGS' in any compilation command that does linking as well as in any direct use of `ld'. @@ -686,7 +943,7 @@ shell script as part of installing the binary package.  -File: make.info, Node: Quick Reference, Next: Complex Makefile, Prev: Makefile Conventions, Up: Top +File: make.info, Node: Quick Reference, Next: Make Errors, Prev: Makefile Conventions, Up: Top Quick Reference *************** @@ -946,235 +1203,12 @@ variable has no effect on the operation of `make'. *Note Arguments to Specify the Goals: Goals. +`CURDIR' + Set to the pathname of the current working directory (after all + `-C' options are processed, if any). Setting this variable has no + effect on the operation of `make'. + *Note Recursive Use of `make': Recursion. + `SUFFIXES' The default list of suffixes before `make' reads any makefiles. - - -File: make.info, Node: Complex Makefile, Next: Concept Index, Prev: Quick Reference, Up: Top - -Complex Makefile Example -************************ - - Here is the makefile for the GNU `tar' program. This is a -moderately complex makefile. - - Because it is the first target, the default goal is `all'. An -interesting feature of this makefile is that `testpad.h' is a source -file automatically created by the `testpad' program, itself compiled -from `testpad.c'. - - If you type `make' or `make all', then `make' creates the `tar' -executable, the `rmt' daemon that provides remote tape access, and the -`tar.info' Info file. - - If you type `make install', then `make' not only creates `tar', -`rmt', and `tar.info', but also installs them. - - If you type `make clean', then `make' removes the `.o' files, and -the `tar', `rmt', `testpad', `testpad.h', and `core' files. - - If you type `make distclean', then `make' not only removes the same -files as does `make clean' but also the `TAGS', `Makefile', and -`config.status' files. (Although it is not evident, this makefile (and -`config.status') is generated by the user with the `configure' program, -which is provided in the `tar' distribution, but is not shown here.) - - If you type `make realclean', then `make' removes the same files as -does `make distclean' and also removes the Info files generated from -`tar.texinfo'. - - In addition, there are targets `shar' and `dist' that create -distribution kits. - - # Generated automatically from Makefile.in by configure. - # Un*x Makefile for GNU tar program. - # Copyright (C) 1991 Free Software Foundation, Inc. - - # This program is free software; you can redistribute - # it and/or modify it under the terms of the GNU - # General Public License ... - ... - ... - - SHELL = /bin/sh - - #### Start of system configuration section. #### - - srcdir = . - - # If you use gcc, you should either run the - # fixincludes script that comes with it or else use - # gcc with the -traditional option. Otherwise ioctl - # calls will be compiled incorrectly on some systems. - CC = gcc -O - YACC = bison -y - INSTALL = /usr/local/bin/install -c - INSTALLDATA = /usr/local/bin/install -c -m 644 - - # Things you might add to DEFS: - # -DSTDC_HEADERS If you have ANSI C headers and - # libraries. - # -DPOSIX If you have POSIX.1 headers and - # libraries. - # -DBSD42 If you have sys/dir.h (unless - # you use -DPOSIX), sys/file.h, - # and st_blocks in `struct stat'. - # -DUSG If you have System V/ANSI C - # string and memory functions - # and headers, sys/sysmacros.h, - # fcntl.h, getcwd, no valloc, - # and ndir.h (unless - # you use -DDIRENT). - # -DNO_MEMORY_H If USG or STDC_HEADERS but do not - # include memory.h. - # -DDIRENT If USG and you have dirent.h - # instead of ndir.h. - # -DSIGTYPE=int If your signal handlers - # return int, not void. - # -DNO_MTIO If you lack sys/mtio.h - # (magtape ioctls). - # -DNO_REMOTE If you do not have a remote shell - # or rexec. - # -DUSE_REXEC To use rexec for remote tape - # operations instead of - # forking rsh or remsh. - # -DVPRINTF_MISSING If you lack vprintf function - # (but have _doprnt). - # -DDOPRNT_MISSING If you lack _doprnt function. - # Also need to define - # -DVPRINTF_MISSING. - # -DFTIME_MISSING If you lack ftime system call. - # -DSTRSTR_MISSING If you lack strstr function. - # -DVALLOC_MISSING If you lack valloc function. - # -DMKDIR_MISSING If you lack mkdir and - # rmdir system calls. - # -DRENAME_MISSING If you lack rename system call. - # -DFTRUNCATE_MISSING If you lack ftruncate - # system call. - # -DV7 On Version 7 Unix (not - # tested in a long time). - # -DEMUL_OPEN3 If you lack a 3-argument version - # of open, and want to emulate it - # with system calls you do have. - # -DNO_OPEN3 If you lack the 3-argument open - # and want to disable the tar -k - # option instead of emulating open. - # -DXENIX If you have sys/inode.h - # and need it 94 to be included. - - DEFS = -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \ - -DVPRINTF_MISSING -DBSD42 - # Set this to rtapelib.o unless you defined NO_REMOTE, - # in which case make it empty. - RTAPELIB = rtapelib.o - LIBS = - DEF_AR_FILE = /dev/rmt8 - DEFBLOCKING = 20 - - CDEBUG = -g - CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \ - -DDEF_AR_FILE=\"$(DEF_AR_FILE)\" \ - -DDEFBLOCKING=$(DEFBLOCKING) - LDFLAGS = -g - - prefix = /usr/local - # Prefix for each installed program, - # normally empty or `g'. - binprefix = - - # The directory to install tar in. - bindir = $(prefix)/bin - - # The directory to install the info files in. - infodir = $(prefix)/info - - #### End of system configuration section. #### - - SRC1 = tar.c create.c extract.c buffer.c \ - getoldopt.c update.c gnu.c mangle.c - SRC2 = version.c list.c names.c diffarch.c \ - port.c wildmat.c getopt.c - SRC3 = getopt1.c regex.c getdate.y - SRCS = $(SRC1) $(SRC2) $(SRC3) - OBJ1 = tar.o create.o extract.o buffer.o \ - getoldopt.o update.o gnu.o mangle.o - OBJ2 = version.o list.o names.o diffarch.o \ - port.o wildmat.o getopt.o - OBJ3 = getopt1.o regex.o getdate.o $(RTAPELIB) - OBJS = $(OBJ1) $(OBJ2) $(OBJ3) - AUX = README COPYING ChangeLog Makefile.in \ - makefile.pc configure configure.in \ - tar.texinfo tar.info* texinfo.tex \ - tar.h port.h open3.h getopt.h regex.h \ - rmt.h rmt.c rtapelib.c alloca.c \ - msd_dir.h msd_dir.c tcexparg.c \ - level-0 level-1 backup-specs testpad.c - - all: tar rmt tar.info - - tar: $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - - rmt: rmt.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c - - tar.info: tar.texinfo - makeinfo tar.texinfo - - install: all - $(INSTALL) tar $(bindir)/$(binprefix)tar - -test ! -f rmt || $(INSTALL) rmt /etc/rmt - $(INSTALLDATA) $(srcdir)/tar.info* $(infodir) - - $(OBJS): tar.h port.h testpad.h - regex.o buffer.o tar.o: regex.h - # getdate.y has 8 shift/reduce conflicts. - - testpad.h: testpad - ./testpad - - testpad: testpad.o - $(CC) -o $@ testpad.o - - TAGS: $(SRCS) - etags $(SRCS) - - clean: - rm -f *.o tar rmt testpad testpad.h core - - distclean: clean - rm -f TAGS Makefile config.status - - realclean: distclean - rm -f tar.info* - - shar: $(SRCS) $(AUX) - shar $(SRCS) $(AUX) | compress \ - > tar-`sed -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ - -e q - version.c`.shar.Z - - dist: $(SRCS) $(AUX) - echo tar-`sed \ - -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ - -e q - version.c` > .fname - -rm -rf `cat .fname` - mkdir `cat .fname` - ln $(SRCS) $(AUX) `cat .fname` - -rm -rf `cat .fname` .fname - tar chZf `cat .fname`.tar.Z `cat .fname` - - tar.zoo: $(SRCS) $(AUX) - -rm -rf tmp.dir - -mkdir tmp.dir - -rm tar.zoo - for X in $(SRCS) $(AUX) ; do \ - echo $$X ; \ - sed 's/$$/^M/' $$X \ - > tmp.dir/$$X ; done - cd tmp.dir ; zoo aM ../tar.zoo * - -rm -rf tmp.dir diff -uPr make-3.76.1/make.info-8 make-3.77/make.info-8 --- make-3.76.1/make.info-8 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-8 Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -31,730 +31,347 @@ translation approved by the Free Software Foundation.  -File: make.info, Node: Concept Index, Next: Name Index, Prev: Complex Makefile, Up: Top +File: make.info, Node: Make Errors, Next: Complex Makefile, Prev: Quick Reference, Up: Top -Index of Concepts -***************** +Errors Generated by Make +************************ -* Menu: + Here is a list of the most common errors you might see generated by +`make', and some information about what they mean and how to fix them. -* # (comments), in commands: Commands. -* # (comments), in makefile: Makefile Contents. -* #include: Automatic Dependencies. -* $, in function call: Syntax of Functions. -* $, in rules: Rule Syntax. -* $, in variable name: Computed Names. -* $, in variable reference: Reference. -* %, in pattern rules: Pattern Intro. -* %, quoting in patsubst: Text Functions. -* %, quoting in static pattern: Static Usage. -* %, quoting in vpath: Selective Search. -* %, quoting with \ (backslash) <1>: Text Functions. -* %, quoting with \ (backslash) <2>: Selective Search. -* %, quoting with \ (backslash): Static Usage. -* * (wildcard character): Wildcards. -* +, and define: Sequences. -* +=: Appending. -* ,v (RCS file extension): Catalogue of Rules. -* - (in commands): Errors. -* -, and define: Sequences. -* --assume-new <1>: Options Summary. -* --assume-new: Instead of Execution. -* --assume-new, and recursion: Options/Recursion. -* --assume-old <1>: Options Summary. -* --assume-old: Avoiding Compilation. -* --assume-old, and recursion: Options/Recursion. -* --debug: Options Summary. -* --directory <1>: Recursion. -* --directory: Options Summary. -* --directory, and --print-directory: -w Option. -* --directory, and recursion: Options/Recursion. -* --dry-run <1>: Echoing. -* --dry-run <2>: Instead of Execution. -* --dry-run: Options Summary. -* --environment-overrides: Options Summary. -* --file <1>: Makefile Arguments. -* --file <2>: Makefile Names. -* --file: Options Summary. -* --file, and recursion: Options/Recursion. -* --help: Options Summary. -* --ignore-errors <1>: Errors. -* --ignore-errors: Options Summary. -* --include-dir <1>: Options Summary. -* --include-dir: Include. -* --jobs <1>: Options Summary. -* --jobs: Parallel. -* --jobs, and recursion: Options/Recursion. -* --just-print <1>: Options Summary. -* --just-print <2>: Echoing. -* --just-print: Instead of Execution. -* --keep-going <1>: Errors. -* --keep-going <2>: Options Summary. -* --keep-going: Testing. -* --load-average <1>: Parallel. -* --load-average: Options Summary. -* --makefile <1>: Makefile Names. -* --makefile <2>: Options Summary. -* --makefile: Makefile Arguments. -* --max-load <1>: Options Summary. -* --max-load: Parallel. -* --new-file <1>: Instead of Execution. -* --new-file: Options Summary. -* --new-file, and recursion: Options/Recursion. -* --no-builtin-rules: Options Summary. -* --no-keep-going: Options Summary. -* --no-print-directory <1>: -w Option. -* --no-print-directory: Options Summary. -* --old-file <1>: Avoiding Compilation. -* --old-file: Options Summary. -* --old-file, and recursion: Options/Recursion. -* --print-data-base: Options Summary. -* --print-directory: Options Summary. -* --print-directory, and --directory: -w Option. -* --print-directory, and recursion: -w Option. -* --print-directory, disabling: -w Option. -* --question <1>: Instead of Execution. -* --question: Options Summary. -* --quiet <1>: Echoing. -* --quiet: Options Summary. -* --recon <1>: Options Summary. -* --recon <2>: Echoing. -* --recon: Instead of Execution. -* --silent <1>: Options Summary. -* --silent: Echoing. -* --stop: Options Summary. -* --touch <1>: Options Summary. -* --touch: Instead of Execution. -* --touch, and recursion: MAKE Variable. -* --version: Options Summary. -* --warn-undefined-variables: Options Summary. -* --what-if <1>: Options Summary. -* --what-if: Instead of Execution. -* -b: Options Summary. -* -C <1>: Recursion. -* -C: Options Summary. -* -C, and -w: -w Option. -* -C, and recursion: Options/Recursion. -* -d: Options Summary. -* -e: Options Summary. -* -e (shell flag): Automatic Dependencies. -* -f <1>: Options Summary. -* -f <2>: Makefile Arguments. -* -f: Makefile Names. -* -f, and recursion: Options/Recursion. -* -h: Options Summary. -* -i: Errors. -* -I: Options Summary. -* -i: Options Summary. -* -I: Include. -* -j <1>: Parallel. -* -j: Options Summary. -* -j, and archive update: Archive Pitfalls. -* -j, and recursion: Options/Recursion. -* -k <1>: Testing. -* -k <2>: Options Summary. -* -k: Errors. -* -l: Options Summary. -* -l (library search): Libraries/Search. -* -l (load average): Parallel. -* -m: Options Summary. -* -M (to compiler): Automatic Dependencies. -* -MM (to GNU compiler): Automatic Dependencies. -* -n <1>: Instead of Execution. -* -n <2>: Options Summary. -* -n: Echoing. -* -o <1>: Options Summary. -* -o: Avoiding Compilation. -* -o, and recursion: Options/Recursion. -* -p: Options Summary. -* -q <1>: Instead of Execution. -* -q: Options Summary. -* -r: Options Summary. -* -S: Options Summary. -* -s <1>: Options Summary. -* -s: Echoing. -* -t <1>: Instead of Execution. -* -t: Options Summary. -* -t, and recursion: MAKE Variable. -* -v: Options Summary. -* -W: Options Summary. -* -w: Options Summary. -* -W: Instead of Execution. -* -w, and -C: -w Option. -* -w, and recursion: -w Option. -* -W, and recursion: Options/Recursion. -* -w, disabling: -w Option. -* .a (archives): Archive Suffix Rules. -* .c: Catalogue of Rules. -* .C: Catalogue of Rules. -* .cc: Catalogue of Rules. -* .ch: Catalogue of Rules. -* .d: Automatic Dependencies. -* .def: Catalogue of Rules. -* .dvi: Catalogue of Rules. -* .f: Catalogue of Rules. -* .F: Catalogue of Rules. -* .info: Catalogue of Rules. -* .l: Catalogue of Rules. -* .ln: Catalogue of Rules. -* .mod: Catalogue of Rules. -* .o: Catalogue of Rules. -* .p: Catalogue of Rules. -* .PRECIOUS intermediate files: Chained Rules. -* .r: Catalogue of Rules. -* .s: Catalogue of Rules. -* .S: Catalogue of Rules. -* .sh: Catalogue of Rules. -* .sym: Catalogue of Rules. -* .tex: Catalogue of Rules. -* .texi: Catalogue of Rules. -* .texinfo: Catalogue of Rules. -* .txinfo: Catalogue of Rules. -* .w: Catalogue of Rules. -* .web: Catalogue of Rules. -* .y: Catalogue of Rules. -* :: rules (double-colon): Double-Colon. -* := <1>: Flavors. -* :=: Setting. -* = <1>: Flavors. -* =: Setting. -* ? (wildcard character): Wildcards. -* @ (in commands): Echoing. -* @, and define: Sequences. -* [...] (wildcard characters): Wildcards. -* \ (backslash), for continuation lines: Simple Makefile. -* \ (backslash), in commands: Execution. -* \ (backslash), to quote % <1>: Selective Search. -* \ (backslash), to quote % <2>: Static Usage. -* \ (backslash), to quote %: Text Functions. -* __.SYMDEF: Archive Symbols. -* algorithm for directory search: Search Algorithm. -* all (standard target): Goals. -* appending to variables: Appending. -* ar: Implicit Variables. -* archive: Archives. -* archive member targets: Archive Members. -* archive symbol directory updating: Archive Symbols. -* archive, and -j: Archive Pitfalls. -* archive, and parallel execution: Archive Pitfalls. -* archive, suffix rule for: Archive Suffix Rules. -* Arg list too long: Options/Recursion. -* arguments of functions: Syntax of Functions. -* as <1>: Implicit Variables. -* as: Catalogue of Rules. -* assembly, rule to compile: Catalogue of Rules. -* automatic generation of dependencies <1>: Automatic Dependencies. -* automatic generation of dependencies: Include. -* automatic variables: Automatic. -* backquotes: Shell Function. -* backslash (\), for continuation lines: Simple Makefile. -* backslash (\), in commands: Execution. -* backslash (\), to quote % <1>: Selective Search. -* backslash (\), to quote % <2>: Text Functions. -* backslash (\), to quote %: Static Usage. -* backslashes in pathnames and wildcard expansion: Wildcard Pitfall. -* basename: File Name Functions. -* binary packages: Install Command Categories. -* broken pipe: Parallel. -* bugs, reporting: Bugs. -* built-in special targets: Special Targets. -* C++, rule to compile: Catalogue of Rules. -* C, rule to compile: Catalogue of Rules. -* cc <1>: Implicit Variables. -* cc: Catalogue of Rules. -* cd (shell command) <1>: Execution. -* cd (shell command): MAKE Variable. -* chains of rules: Chained Rules. -* check (standard target): Goals. -* clean (standard target): Goals. -* clean target <1>: Simple Makefile. -* clean target: Cleanup. -* cleaning up: Cleanup. -* clobber (standard target): Goals. -* co <1>: Catalogue of Rules. -* co: Implicit Variables. -* combining rules by dependency: Combine By Dependency. -* command line variable definitions, and recursion: Options/Recursion. -* command line variables: Overriding. -* commands: Rule Syntax. -* commands, backslash (\) in: Execution. -* commands, comments in: Commands. -* commands, echoing: Echoing. -* commands, empty: Empty Commands. -* commands, errors in: Errors. -* commands, execution: Execution. -* commands, execution in parallel: Parallel. -* commands, expansion: Shell Function. -* commands, how to write: Commands. -* commands, instead of executing: Instead of Execution. -* commands, introduction to: Rule Introduction. -* commands, quoting newlines in: Execution. -* commands, sequences of: Sequences. -* comments, in commands: Commands. -* comments, in makefile: Makefile Contents. -* compatibility: Features. -* compatibility in exporting: Variables/Recursion. -* compilation, testing: Testing. -* computed variable name: Computed Names. -* conditionals: Conditionals. -* continuation lines: Simple Makefile. -* conventions for makefiles: Makefile Conventions. -* ctangle <1>: Implicit Variables. -* ctangle: Catalogue of Rules. -* cweave <1>: Implicit Variables. -* cweave: Catalogue of Rules. -* deducing commands (implicit rules): make Deduces. -* default directries for included makefiles: Include. -* default goal <1>: How Make Works. -* default goal: Rules. -* default makefile name: Makefile Names. -* default rules, last-resort: Last Resort. -* defining variables verbatim: Defining. -* deletion of target files <1>: Interrupts. -* deletion of target files: Errors. -* dependencies: Rule Syntax. -* dependencies, automatic generation <1>: Include. -* dependencies, automatic generation: Automatic Dependencies. -* dependencies, introduction to: Rule Introduction. -* dependencies, list of all: Automatic. -* dependencies, list of changed: Automatic. -* dependencies, varying (static pattern): Static Pattern. -* dependency: Rules. -* dependency pattern, implicit: Pattern Intro. -* dependency pattern, static (not implicit): Static Usage. -* directive: Makefile Contents. -* directories, printing them: -w Option. -* directories, updating archive symbol: Archive Symbols. -* directory part: File Name Functions. -* directory search (VPATH): Directory Search. -* directory search (VPATH), and implicit rules: Implicit/Search. -* directory search (VPATH), and link libraries: Libraries/Search. -* directory search (VPATH), and shell commands: Commands/Search. -* directory search algorithm: Search Algorithm. -* directory search, traditional: Search Algorithm. -* dist (standard target): Goals. -* distclean (standard target): Goals. -* dollar sign ($), in function call: Syntax of Functions. -* dollar sign ($), in rules: Rule Syntax. -* dollar sign ($), in variable name: Computed Names. -* dollar sign ($), in variable reference: Reference. -* double-colon rules: Double-Colon. -* duplicate words, removing: Text Functions. -* E2BIG: Options/Recursion. -* echoing of commands: Echoing. -* editor: Introduction. -* Emacs (M-x compile): Errors. -* empty commands: Empty Commands. -* empty targets: Empty Targets. -* environment: Environment. -* environment, and recursion: Variables/Recursion. -* environment, SHELL in: Execution. -* errors (in commands): Errors. -* errors with wildcards: Wildcard Pitfall. -* execution, in parallel: Parallel. -* execution, instead of: Instead of Execution. -* execution, of commands: Execution. -* exit status (errors): Errors. -* explicit rule, definition of: Makefile Contents. -* exporting variables: Variables/Recursion. -* f77 <1>: Implicit Variables. -* f77: Catalogue of Rules. -* features of GNU make: Features. -* features, missing: Missing. -* file name functions: File Name Functions. -* file name of makefile: Makefile Names. -* file name of makefile, how to specify: Makefile Names. -* file name prefix, adding: File Name Functions. -* file name suffix: File Name Functions. -* file name suffix, adding: File Name Functions. -* file name with wildcards: Wildcards. -* file name, basename of: File Name Functions. -* file name, directory part: File Name Functions. -* file name, nondirectory part: File Name Functions. -* files, assuming new: Instead of Execution. -* files, assuming old: Avoiding Compilation. -* files, avoiding recompilation of: Avoiding Compilation. -* files, intermediate: Chained Rules. -* filtering out words: Text Functions. -* filtering words: Text Functions. -* finding strings: Text Functions. -* flags: Options Summary. -* flags for compilers: Implicit Variables. -* flavors of variables: Flavors. -* FORCE: Force Targets. -* force targets: Force Targets. -* Fortran, rule to compile: Catalogue of Rules. -* functions: Functions. -* functions, for file names: File Name Functions. -* functions, for text: Text Functions. -* functions, syntax of: Syntax of Functions. -* g++ <1>: Implicit Variables. -* g++: Catalogue of Rules. -* gcc: Catalogue of Rules. -* generating dependencies automatically <1>: Automatic Dependencies. -* generating dependencies automatically: Include. -* get <1>: Implicit Variables. -* get: Catalogue of Rules. -* globbing (wildcards): Wildcards. -* goal: How Make Works. -* goal, default <1>: Rules. -* goal, default: How Make Works. -* goal, how to specify: Goals. -* home directory: Wildcards. -* IEEE Standard 1003.2: Overview. -* implicit rule: Implicit Rules. -* implicit rule, and directory search: Implicit/Search. -* implicit rule, and VPATH: Implicit/Search. -* implicit rule, definition of: Makefile Contents. -* implicit rule, how to use: Using Implicit. -* implicit rule, introduction to: make Deduces. -* implicit rule, predefined: Catalogue of Rules. -* implicit rule, search algorithm: Implicit Rule Search. -* included makefiles, default directries: Include. -* including (MAKEFILES variable): MAKEFILES Variable. -* including other makefiles: Include. -* incompatibilities: Missing. -* Info, rule to format: Catalogue of Rules. -* install (standard target): Goals. -* intermediate files: Chained Rules. -* intermediate files, preserving: Chained Rules. -* intermediate targets, explicit: Special Targets. -* interrupt: Interrupts. -* job slots: Parallel. -* job slots, and recursion: Options/Recursion. -* jobs, limiting based on load: Parallel. -* joining lists of words: File Name Functions. -* killing (interruption): Interrupts. -* last-resort default rules: Last Resort. -* ld: Catalogue of Rules. -* lex <1>: Implicit Variables. -* lex: Catalogue of Rules. -* Lex, rule to run: Catalogue of Rules. -* libraries for linking, directory search: Libraries/Search. -* library archive, suffix rule for: Archive Suffix Rules. -* limiting jobs based on load: Parallel. -* link libraries, and directory search: Libraries/Search. -* linking, predefined rule for: Catalogue of Rules. -* lint: Catalogue of Rules. -* lint, rule to run: Catalogue of Rules. -* list of all dependencies: Automatic. -* list of changed dependencies: Automatic. -* load average: Parallel. -* loops in variable expansion: Flavors. -* lpr (shell command) <1>: Wildcard Examples. -* lpr (shell command): Empty Targets. -* m2c: Catalogue of Rules. -* macro: Using Variables. -* make depend: Automatic Dependencies. -* MAKECMDGOALS: Goals. -* makefile: Introduction. -* makefile name: Makefile Names. -* makefile name, how to specify: Makefile Names. -* makefile rule parts: Rule Introduction. -* makefile, and MAKEFILES variable: MAKEFILES Variable. -* makefile, conventions for: Makefile Conventions. -* makefile, how make processes: How Make Works. -* makefile, how to write: Makefiles. -* makefile, including: Include. -* makefile, overriding: Overriding Makefiles. -* makefile, remaking of: Remaking Makefiles. -* makefile, simple: Simple Makefile. -* makeinfo <1>: Implicit Variables. -* makeinfo: Catalogue of Rules. -* match-anything rule: Match-Anything Rules. -* match-anything rule, used to override: Overriding Makefiles. -* missing features: Missing. -* mistakes with wildcards: Wildcard Pitfall. -* modified variable reference: Substitution Refs. -* Modula-2, rule to compile: Catalogue of Rules. -* mostlyclean (standard target): Goals. -* multiple rules for one target: Multiple Rules. -* multiple rules for one target (::): Double-Colon. -* multiple targets: Multiple Targets. -* multiple targets, in pattern rule: Pattern Intro. -* name of makefile: Makefile Names. -* name of makefile, how to specify: Makefile Names. -* nested variable reference: Computed Names. -* newline, quoting, in commands: Execution. -* newline, quoting, in makefile: Simple Makefile. -* nondirectory part: File Name Functions. -* obj: Variables Simplify. -* OBJ: Variables Simplify. -* OBJECTS: Variables Simplify. -* objects: Variables Simplify. -* objs: Variables Simplify. -* OBJS: Variables Simplify. -* old-fashioned suffix rules: Suffix Rules. -* options: Options Summary. -* options, and recursion: Options/Recursion. -* options, setting from environment: Options/Recursion. -* options, setting in makefiles: Options/Recursion. -* order of pattern rules: Pattern Intro. -* origin of variable: Origin Function. -* overriding makefiles: Overriding Makefiles. -* overriding variables with arguments: Overriding. -* overriding with override: Override Directive. -* parallel execution: Parallel. -* parallel execution, and archive update: Archive Pitfalls. -* parts of makefile rule: Rule Introduction. -* Pascal, rule to compile: Catalogue of Rules. -* pattern rule: Pattern Intro. -* pattern rules, order of: Pattern Intro. -* pattern rules, static (not implicit): Static Pattern. -* pattern rules, static, syntax of: Static Usage. -* pc <1>: Implicit Variables. -* pc: Catalogue of Rules. -* phony targets: Phony Targets. -* pitfalls of wildcards: Wildcard Pitfall. -* portability: Features. -* POSIX: Overview. -* POSIX.2: Options/Recursion. -* post-installation commands: Install Command Categories. -* pre-installation commands: Install Command Categories. -* precious targets: Special Targets. -* prefix, adding: File Name Functions. -* preserving intermediate files: Chained Rules. -* preserving with .PRECIOUS <1>: Chained Rules. -* preserving with .PRECIOUS: Special Targets. -* preserving with .SECONDARY: Special Targets. -* print (standard target): Goals. -* print target <1>: Empty Targets. -* print target: Wildcard Examples. -* printing directories: -w Option. -* printing of commands: Echoing. -* problems and bugs, reporting: Bugs. -* problems with wildcards: Wildcard Pitfall. -* processing a makefile: How Make Works. -* question mode: Instead of Execution. -* quoting %, in patsubst: Text Functions. -* quoting %, in static pattern: Static Usage. -* quoting %, in vpath: Selective Search. -* quoting newline, in commands: Execution. -* quoting newline, in makefile: Simple Makefile. -* Ratfor, rule to compile: Catalogue of Rules. -* RCS, rule to extract from: Catalogue of Rules. -* README: Makefile Names. -* realclean (standard target): Goals. -* recompilation: Introduction. -* recompilation, avoiding: Avoiding Compilation. -* recording events with empty targets: Empty Targets. -* recursion: Recursion. -* recursion, and -C: Options/Recursion. -* recursion, and -f: Options/Recursion. -* recursion, and -j: Options/Recursion. -* recursion, and -o: Options/Recursion. -* recursion, and -t: MAKE Variable. -* recursion, and -W: Options/Recursion. -* recursion, and -w: -w Option. -* recursion, and command line variable definitions: Options/Recursion. -* recursion, and environment: Variables/Recursion. -* recursion, and MAKE variable: MAKE Variable. -* recursion, and MAKEFILES variable: MAKEFILES Variable. -* recursion, and options: Options/Recursion. -* recursion, and printing directories: -w Option. -* recursion, and variables: Variables/Recursion. -* recursion, level of: Variables/Recursion. -* recursive variable expansion <1>: Flavors. -* recursive variable expansion: Using Variables. -* recursively expanded variables: Flavors. -* reference to variables <1>: Reference. -* reference to variables: Advanced. -* relinking: How Make Works. -* remaking makefiles: Remaking Makefiles. -* removal of target files <1>: Errors. -* removal of target files: Interrupts. -* removing duplicate words: Text Functions. -* removing, to clean up: Cleanup. -* reporting bugs: Bugs. -* rm: Implicit Variables. -* rm (shell command) <1>: Wildcard Examples. -* rm (shell command) <2>: Errors. -* rm (shell command) <3>: Phony Targets. -* rm (shell command): Simple Makefile. -* rule commands: Commands. -* rule dependencies: Rule Syntax. -* rule syntax: Rule Syntax. -* rule targets: Rule Syntax. -* rule, and $: Rule Syntax. -* rule, double-colon (::): Double-Colon. -* rule, explicit, definition of: Makefile Contents. -* rule, how to write: Rules. -* rule, implicit: Implicit Rules. -* rule, implicit, and directory search: Implicit/Search. -* rule, implicit, and VPATH: Implicit/Search. -* rule, implicit, chains of: Chained Rules. -* rule, implicit, definition of: Makefile Contents. -* rule, implicit, how to use: Using Implicit. -* rule, implicit, introduction to: make Deduces. -* rule, implicit, predefined: Catalogue of Rules. -* rule, introduction to: Rule Introduction. -* rule, multiple for one target: Multiple Rules. -* rule, no commands or dependencies: Force Targets. -* rule, pattern: Pattern Intro. -* rule, static pattern: Static Pattern. -* rule, static pattern versus implicit: Static versus Implicit. -* rule, with multiple targets: Multiple Targets. -* s. (SCCS file prefix): Catalogue of Rules. -* SCCS, rule to extract from: Catalogue of Rules. -* search algorithm, implicit rule: Implicit Rule Search. -* search path for dependencies (VPATH): Directory Search. -* search path for dependencies (VPATH), and implicit rules: Implicit/Search. -* search path for dependencies (VPATH), and link libraries: Libraries/Search. -* searching for strings: Text Functions. -* secondary files: Chained Rules. -* secondary targets: Special Targets. -* sed (shell command): Automatic Dependencies. -* selecting a word: File Name Functions. -* selecting word lists: File Name Functions. -* sequences of commands: Sequences. -* setting options from environment: Options/Recursion. -* setting options in makefiles: Options/Recursion. -* setting variables: Setting. -* several rules for one target: Multiple Rules. -* several targets in a rule: Multiple Targets. -* shar (standard target): Goals. -* shell command: Simple Makefile. -* shell command, and directory search: Commands/Search. -* shell command, execution: Execution. -* shell command, function for: Shell Function. -* shell file name pattern (in include): Include. -* shell wildcards (in include): Include. -* SHELL, MS-DOS specifics: Execution. -* signal: Interrupts. -* silent operation: Echoing. -* simple makefile: Simple Makefile. -* simple variable expansion: Using Variables. -* simplifying with variables: Variables Simplify. -* simply expanded variables: Flavors. -* sorting words: Text Functions. -* spaces, in variable values: Flavors. -* spaces, stripping: Text Functions. -* special targets: Special Targets. -* specifying makefile name: Makefile Names. -* standard input: Parallel. -* standards conformance: Overview. -* standards for makefiles: Makefile Conventions. -* static pattern rule: Static Pattern. -* static pattern rule, syntax of: Static Usage. -* static pattern rule, versus implicit: Static versus Implicit. -* stem <1>: Pattern Match. -* stem: Static Usage. -* stem, variable for: Automatic. -* strings, searching for: Text Functions. -* stripping whitespace: Text Functions. -* sub-make: Variables/Recursion. -* subdirectories, recursion for: Recursion. -* substitution variable reference: Substitution Refs. -* suffix rule: Suffix Rules. -* suffix rule, for archive: Archive Suffix Rules. -* suffix, adding: File Name Functions. -* suffix, function to find: File Name Functions. -* suffix, substituting in variables: Substitution Refs. -* switches: Options Summary. -* symbol directories, updating archive: Archive Symbols. -* syntax of rules: Rule Syntax. -* tab character (in commands): Rule Syntax. -* tabs in rules: Rule Introduction. -* TAGS (standard target): Goals. -* tangle <1>: Implicit Variables. -* tangle: Catalogue of Rules. -* tar (standard target): Goals. -* target: Rules. -* target pattern, implicit: Pattern Intro. -* target pattern, static (not implicit): Static Usage. -* target, deleting on error: Errors. -* target, deleting on interrupt: Interrupts. -* target, multiple in pattern rule: Pattern Intro. -* target, multiple rules for one: Multiple Rules. -* target, touching: Instead of Execution. -* targets: Rule Syntax. -* targets without a file: Phony Targets. -* targets, built-in special: Special Targets. -* targets, empty: Empty Targets. -* targets, force: Force Targets. -* targets, introduction to: Rule Introduction. -* targets, multiple: Multiple Targets. -* targets, phony: Phony Targets. -* terminal rule: Match-Anything Rules. -* test (standard target): Goals. -* testing compilation: Testing. -* tex <1>: Catalogue of Rules. -* tex: Implicit Variables. -* TeX, rule to run: Catalogue of Rules. -* texi2dvi <1>: Implicit Variables. -* texi2dvi: Catalogue of Rules. -* Texinfo, rule to format: Catalogue of Rules. -* tilde (~): Wildcards. -* touch (shell command) <1>: Wildcard Examples. -* touch (shell command): Empty Targets. -* touching files: Instead of Execution. -* traditional directory search: Search Algorithm. -* undefined variables, warning message: Options Summary. -* updating archive symbol directories: Archive Symbols. -* updating makefiles: Remaking Makefiles. -* value: Using Variables. -* value, how a variable gets it: Values. -* variable: Using Variables. -* variable definition: Makefile Contents. -* variables: Variables Simplify. -* variables, $ in name: Computed Names. -* variables, and implicit rule: Automatic. -* variables, appending to: Appending. -* variables, automatic: Automatic. -* variables, command line: Overriding. -* variables, command line, and recursion: Options/Recursion. -* variables, computed names: Computed Names. -* variables, defining verbatim: Defining. -* variables, environment <1>: Variables/Recursion. -* variables, environment: Environment. -* variables, exporting: Variables/Recursion. -* variables, flavors: Flavors. -* variables, how they get their values: Values. -* variables, how to reference: Reference. -* variables, loops in expansion: Flavors. -* variables, modified reference: Substitution Refs. -* variables, nested references: Computed Names. -* variables, origin of: Origin Function. -* variables, overriding: Override Directive. -* variables, overriding with arguments: Overriding. -* variables, recursively expanded: Flavors. -* variables, setting: Setting. -* variables, simply expanded: Flavors. -* variables, spaces in values: Flavors. -* variables, substituting suffix in: Substitution Refs. -* variables, substitution reference: Substitution Refs. -* variables, warning for undefined: Options Summary. -* varying dependencies: Static Pattern. -* verbatim variable definition: Defining. -* vpath: Directory Search. -* VPATH, and implicit rules: Implicit/Search. -* VPATH, and link libraries: Libraries/Search. -* weave <1>: Catalogue of Rules. -* weave: Implicit Variables. -* Web, rule to run: Catalogue of Rules. -* what if: Instead of Execution. -* whitespace, in variable values: Flavors. -* whitespace, stripping: Text Functions. -* wildcard: Wildcards. -* wildcard pitfalls: Wildcard Pitfall. -* wildcard, function: File Name Functions. -* wildcard, in archive member: Archive Members. -* wildcard, in include: Include. -* wildcards and MS-DOS/MS-Windows backslashes: Wildcard Pitfall. -* word, selecting a: File Name Functions. -* words, extracting first: File Name Functions. -* words, filtering: Text Functions. -* words, filtering out: Text Functions. -* words, finding number: File Name Functions. -* words, iterating over: Foreach Function. -* words, joining lists: File Name Functions. -* words, removing duplicates: Text Functions. -* words, selecting lists of: File Name Functions. -* writing rule commands: Commands. -* writing rules: Rules. -* yacc <1>: Sequences. -* yacc <2>: Implicit Variables. -* yacc: Catalogue of Rules. -* Yacc, rule to run: Catalogue of Rules. -* ~ (tilde): Wildcards. + Sometimes `make' errors are not fatal, especially in the presence of +a `-' prefix on a command script line, or the `-k' command line option. +Errors that are fatal are prefixed with the string `***'. + + Error messages are all either prefixed with the name of the program +(usually `make'), or, if the error is found in a makefile, the name of +the file and linenumber containing the problem. + + In the table below, these common prefixes are left off. + +`[FOO] Error NN' +`[FOO] SIGNAL DESCRIPTION' + These errors are not really `make' errors at all. They mean that a + program that `make' invoked as part of a command script returned a + non-0 error code (`Error NN'), which `make' interprets as failure, + or it exited in some other abnormal fashion (with a signal of some + type). + + If no `***' is attached to the message, then the subprocess failed + but the rule in the makefile was prefixed with the `-' special + character, so `make' ignored the error. + +`missing separator. Stop.' + This is `make''s generic "Huh?" error message. It means that + `make' was completely unsuccessful at parsing this line of your + makefile. It basically means "syntax error". + + One of the most common reasons for this message is that you (or + perhaps your oh-so-helpful editor, as is the case with many + MS-Windows editors) have attempted to indent your command scripts + with spaces instead of a TAB character. Remember that every line + in the command script must begin with a TAB character. Eight + spaces do not count. + +`commands commence before first target. Stop.' +`missing rule before commands. Stop.' + This means the first thing in the makefile seems to be part of a + command script: it begins with a TAB character and doesn't appear + to be a legal `make' command (such as a variable assignment). + Command scripts must always be associated with a target. + + The second form is generated if the line has a semicolon as the + first non-whitespace character; `make' interprets this to mean you + left out the "target: dependency" section of a rule. + +`No rule to make target `XXX'.' +`No rule to make target `XXX', needed by `YYY'.' + This means that `make' decided it needed to build a target, but + then couldn't find any instructions in the makefile on how to do + that, either explicit or implicit (including in the default rules + database). + + If you want that file to be built, you will need to add a rule to + your makefile describing how that target can be built. Other + possible sources of this problem are typos in the makefile (if + that filename is wrong) or a corrupted source tree (if that file + is not supposed to be built, but rather only a dependency). + +`No targets specified and no makefile found. Stop.' +`No targets. Stop.' + The former means that you didn't provide any targets to be built + on the command line, and `make' couldn't find any makefiles to + read in. The latter means that some makefile was found, but it + didn't contain any default target and none was given on the + command line. GNU `make' has nothing to do in these situations. + +`Makefile `XXX' was not found.' +`Included makefile `XXX' was not found.' + A makefile specified on the command line (first form) or included + (second form) was not found. + +`warning: overriding commands for target `XXX'' +`warning: ignoring old commands for target `XXX'' + GNU `make' allows commands to be specified only once per target + (except for double-colon rules). If you give commands for a target + which already has been defined to have commands, this warning is + issued and the second set of commands will overwrite the first set. + +`Circular XXX <- YYY dependency dropped.' + This means that `make' detected a loop in the dependency graph: + after tracing the dependency YYY of target XXX, and its + dependencies, etc., one of them depended on XXX again. + +`Recursive variable `XXX' references itself (eventually). Stop.' + This means you've defined a normal (recursive) `make' variable XXX + that, when its expanded, will refer to itself (XXX). This is not + allowed; either use simply-expanded variables (`:=') or use the + append operator (`+='). + +`Unterminated variable reference. Stop.' + This means you forgot to provide the proper closing parenthesis or + brace in your variable or function reference. + +`insufficient arguments to function `XXX'. Stop.' + This means you haven't provided the requisite number of arguments + for this function. See the documentation of the function for a + description of its arguments. + +`missing target pattern. Stop.' +`multiple target patterns. Stop.' +`target pattern contains no `%'. Stop.' + These are generated for malformed static pattern rules. The first + means there's no pattern in the target section of the rule, the + second means there are multiple patterns in the target section, + and the third means the target doesn't contain a pattern character + (`%'). + + +File: make.info, Node: Complex Makefile, Next: Concept Index, Prev: Make Errors, Up: Top + +Complex Makefile Example +************************ + + Here is the makefile for the GNU `tar' program. This is a +moderately complex makefile. + + Because it is the first target, the default goal is `all'. An +interesting feature of this makefile is that `testpad.h' is a source +file automatically created by the `testpad' program, itself compiled +from `testpad.c'. + + If you type `make' or `make all', then `make' creates the `tar' +executable, the `rmt' daemon that provides remote tape access, and the +`tar.info' Info file. + + If you type `make install', then `make' not only creates `tar', +`rmt', and `tar.info', but also installs them. + + If you type `make clean', then `make' removes the `.o' files, and +the `tar', `rmt', `testpad', `testpad.h', and `core' files. + + If you type `make distclean', then `make' not only removes the same +files as does `make clean' but also the `TAGS', `Makefile', and +`config.status' files. (Although it is not evident, this makefile (and +`config.status') is generated by the user with the `configure' program, +which is provided in the `tar' distribution, but is not shown here.) + + If you type `make realclean', then `make' removes the same files as +does `make distclean' and also removes the Info files generated from +`tar.texinfo'. + + In addition, there are targets `shar' and `dist' that create +distribution kits. + + # Generated automatically from Makefile.in by configure. + # Un*x Makefile for GNU tar program. + # Copyright (C) 1991 Free Software Foundation, Inc. + + # This program is free software; you can redistribute + # it and/or modify it under the terms of the GNU + # General Public License ... + ... + ... + + SHELL = /bin/sh + + #### Start of system configuration section. #### + + srcdir = . + + # If you use gcc, you should either run the + # fixincludes script that comes with it or else use + # gcc with the -traditional option. Otherwise ioctl + # calls will be compiled incorrectly on some systems. + CC = gcc -O + YACC = bison -y + INSTALL = /usr/local/bin/install -c + INSTALLDATA = /usr/local/bin/install -c -m 644 + + # Things you might add to DEFS: + # -DSTDC_HEADERS If you have ANSI C headers and + # libraries. + # -DPOSIX If you have POSIX.1 headers and + # libraries. + # -DBSD42 If you have sys/dir.h (unless + # you use -DPOSIX), sys/file.h, + # and st_blocks in `struct stat'. + # -DUSG If you have System V/ANSI C + # string and memory functions + # and headers, sys/sysmacros.h, + # fcntl.h, getcwd, no valloc, + # and ndir.h (unless + # you use -DDIRENT). + # -DNO_MEMORY_H If USG or STDC_HEADERS but do not + # include memory.h. + # -DDIRENT If USG and you have dirent.h + # instead of ndir.h. + # -DSIGTYPE=int If your signal handlers + # return int, not void. + # -DNO_MTIO If you lack sys/mtio.h + # (magtape ioctls). + # -DNO_REMOTE If you do not have a remote shell + # or rexec. + # -DUSE_REXEC To use rexec for remote tape + # operations instead of + # forking rsh or remsh. + # -DVPRINTF_MISSING If you lack vprintf function + # (but have _doprnt). + # -DDOPRNT_MISSING If you lack _doprnt function. + # Also need to define + # -DVPRINTF_MISSING. + # -DFTIME_MISSING If you lack ftime system call. + # -DSTRSTR_MISSING If you lack strstr function. + # -DVALLOC_MISSING If you lack valloc function. + # -DMKDIR_MISSING If you lack mkdir and + # rmdir system calls. + # -DRENAME_MISSING If you lack rename system call. + # -DFTRUNCATE_MISSING If you lack ftruncate + # system call. + # -DV7 On Version 7 Unix (not + # tested in a long time). + # -DEMUL_OPEN3 If you lack a 3-argument version + # of open, and want to emulate it + # with system calls you do have. + # -DNO_OPEN3 If you lack the 3-argument open + # and want to disable the tar -k + # option instead of emulating open. + # -DXENIX If you have sys/inode.h + # and need it 94 to be included. + + DEFS = -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \ + -DVPRINTF_MISSING -DBSD42 + # Set this to rtapelib.o unless you defined NO_REMOTE, + # in which case make it empty. + RTAPELIB = rtapelib.o + LIBS = + DEF_AR_FILE = /dev/rmt8 + DEFBLOCKING = 20 + + CDEBUG = -g + CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \ + -DDEF_AR_FILE=\"$(DEF_AR_FILE)\" \ + -DDEFBLOCKING=$(DEFBLOCKING) + LDFLAGS = -g + + prefix = /usr/local + # Prefix for each installed program, + # normally empty or `g'. + binprefix = + + # The directory to install tar in. + bindir = $(prefix)/bin + + # The directory to install the info files in. + infodir = $(prefix)/info + + #### End of system configuration section. #### + + SRC1 = tar.c create.c extract.c buffer.c \ + getoldopt.c update.c gnu.c mangle.c + SRC2 = version.c list.c names.c diffarch.c \ + port.c wildmat.c getopt.c + SRC3 = getopt1.c regex.c getdate.y + SRCS = $(SRC1) $(SRC2) $(SRC3) + OBJ1 = tar.o create.o extract.o buffer.o \ + getoldopt.o update.o gnu.o mangle.o + OBJ2 = version.o list.o names.o diffarch.o \ + port.o wildmat.o getopt.o + OBJ3 = getopt1.o regex.o getdate.o $(RTAPELIB) + OBJS = $(OBJ1) $(OBJ2) $(OBJ3) + AUX = README COPYING ChangeLog Makefile.in \ + makefile.pc configure configure.in \ + tar.texinfo tar.info* texinfo.tex \ + tar.h port.h open3.h getopt.h regex.h \ + rmt.h rmt.c rtapelib.c alloca.c \ + msd_dir.h msd_dir.c tcexparg.c \ + level-0 level-1 backup-specs testpad.c + + all: tar rmt tar.info + + tar: $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + + rmt: rmt.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c + + tar.info: tar.texinfo + makeinfo tar.texinfo + + install: all + $(INSTALL) tar $(bindir)/$(binprefix)tar + -test ! -f rmt || $(INSTALL) rmt /etc/rmt + $(INSTALLDATA) $(srcdir)/tar.info* $(infodir) + + $(OBJS): tar.h port.h testpad.h + regex.o buffer.o tar.o: regex.h + # getdate.y has 8 shift/reduce conflicts. + + testpad.h: testpad + ./testpad + + testpad: testpad.o + $(CC) -o $@ testpad.o + + TAGS: $(SRCS) + etags $(SRCS) + + clean: + rm -f *.o tar rmt testpad testpad.h core + + distclean: clean + rm -f TAGS Makefile config.status + + realclean: distclean + rm -f tar.info* + + shar: $(SRCS) $(AUX) + shar $(SRCS) $(AUX) | compress \ + > tar-`sed -e '/version_string/!d' \ + -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ + -e q + version.c`.shar.Z + + dist: $(SRCS) $(AUX) + echo tar-`sed \ + -e '/version_string/!d' \ + -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ + -e q + version.c` > .fname + -rm -rf `cat .fname` + mkdir `cat .fname` + ln $(SRCS) $(AUX) `cat .fname` + -rm -rf `cat .fname` .fname + tar chZf `cat .fname`.tar.Z `cat .fname` + + tar.zoo: $(SRCS) $(AUX) + -rm -rf tmp.dir + -mkdir tmp.dir + -rm tar.zoo + for X in $(SRCS) $(AUX) ; do \ + echo $$X ; \ + sed 's/$$/^M/' $$X \ + > tmp.dir/$$X ; done + cd tmp.dir ; zoo aM ../tar.zoo * + -rm -rf tmp.dir diff -uPr make-3.76.1/make.info-9 make-3.77/make.info-9 --- make-3.76.1/make.info-9 Fri Sep 19 14:41:07 1997 +++ make-3.77/make.info-9 Wed Jul 29 22:36:21 1998 @@ -3,18 +3,18 @@ INFO-DIR-SECTION The GNU make utility START-INFO-DIR-ENTRY -* GNU make: (make.info). The GNU make utility. +* Make: (make.info). The GNU make utility. END-INFO-DIR-ENTRY This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. - This is Edition 0.51, last updated 26 Aug 1997, of `The GNU Make -Manual', for `make', Version 3.76 Beta. + This is Edition 0.52, last updated 20 May 1998, of `The GNU Make +Manual', for `make', Version 3.77. - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free -Software Foundation, Inc. + Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 +Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -31,167 +31,738 @@ translation approved by the Free Software Foundation.  -File: make.info, Node: Name Index, Prev: Concept Index, Up: Top +File: make.info, Node: Concept Index, Next: Name Index, Prev: Complex Makefile, Up: Top -Index of Functions, Variables, & Directives -******************************************* +Index of Concepts +***************** * Menu: -* $%: Automatic. -* $(%D): Automatic. -* $(%F): Automatic. -* $(*D): Automatic. -* $(*F): Automatic. -* $(: Last Resort. -* .DEFAULT: Special Targets. -* .DEFAULT, and empty commands: Empty Commands. -* .DELETE_ON_ERROR: Errors. -* .EXPORT_ALL_VARIABLES <1>: Variables/Recursion. -* .EXPORT_ALL_VARIABLES: Special Targets. -* .IGNORE <1>: Errors. -* .IGNORE: Special Targets. -* .INTERMEDIATE: Special Targets. -* .PHONY <1>: Phony Targets. -* .PHONY: Special Targets. -* .POSIX: Options/Recursion. -* .PRECIOUS <1>: Interrupts. -* .PRECIOUS: Special Targets. -* .SECONDARY: Special Targets. -* .SILENT <1>: Echoing. -* .SILENT: Special Targets. -* .SUFFIXES <1>: Special Targets. -* .SUFFIXES: Suffix Rules. -* /usr/gnu/include: Include. -* /usr/include: Include. -* /usr/local/include: Include. -* < (automatic variable): Automatic. -* : Static Usage. +* %, quoting with \ (backslash) <2>: Selective Search. +* %, quoting with \ (backslash): Text Functions. +* * (wildcard character): Wildcards. +* +, and define: Sequences. +* +=: Appending. +* ,v (RCS file extension): Catalogue of Rules. +* - (in commands): Errors. +* -, and define: Sequences. +* --assume-new <1>: Instead of Execution. +* --assume-new: Options Summary. +* --assume-new, and recursion: Options/Recursion. +* --assume-old <1>: Avoiding Compilation. +* --assume-old: Options Summary. +* --assume-old, and recursion: Options/Recursion. +* --debug: Options Summary. +* --directory <1>: Options Summary. +* --directory: Recursion. +* --directory, and --print-directory: -w Option. +* --directory, and recursion: Options/Recursion. +* --dry-run <1>: Options Summary. +* --dry-run <2>: Instead of Execution. +* --dry-run: Echoing. +* --environment-overrides: Options Summary. +* --file <1>: Options Summary. +* --file <2>: Makefile Names. +* --file: Makefile Arguments. +* --file, and recursion: Options/Recursion. +* --help: Options Summary. +* --ignore-errors <1>: Options Summary. +* --ignore-errors: Errors. +* --include-dir <1>: Options Summary. +* --include-dir: Include. +* --jobs <1>: Options Summary. +* --jobs: Parallel. +* --jobs, and recursion: Options/Recursion. +* --just-print <1>: Options Summary. +* --just-print <2>: Echoing. +* --just-print: Instead of Execution. +* --keep-going <1>: Errors. +* --keep-going <2>: Testing. +* --keep-going: Options Summary. +* --load-average <1>: Options Summary. +* --load-average: Parallel. +* --makefile <1>: Makefile Arguments. +* --makefile <2>: Options Summary. +* --makefile: Makefile Names. +* --max-load <1>: Options Summary. +* --max-load: Parallel. +* --new-file <1>: Instead of Execution. +* --new-file: Options Summary. +* --new-file, and recursion: Options/Recursion. +* --no-builtin-rules: Options Summary. +* --no-keep-going: Options Summary. +* --no-print-directory <1>: Options Summary. +* --no-print-directory: -w Option. +* --old-file <1>: Avoiding Compilation. +* --old-file: Options Summary. +* --old-file, and recursion: Options/Recursion. +* --print-data-base: Options Summary. +* --print-directory: Options Summary. +* --print-directory, and --directory: -w Option. +* --print-directory, and recursion: -w Option. +* --print-directory, disabling: -w Option. +* --question <1>: Instead of Execution. +* --question: Options Summary. +* --quiet <1>: Echoing. +* --quiet: Options Summary. +* --recon <1>: Options Summary. +* --recon <2>: Echoing. +* --recon: Instead of Execution. +* --silent <1>: Echoing. +* --silent: Options Summary. +* --stop: Options Summary. +* --touch <1>: Options Summary. +* --touch: Instead of Execution. +* --touch, and recursion: MAKE Variable. +* --version: Options Summary. +* --warn-undefined-variables: Options Summary. +* --what-if <1>: Options Summary. +* --what-if: Instead of Execution. +* -b: Options Summary. +* -C <1>: Recursion. +* -C: Options Summary. +* -C, and -w: -w Option. +* -C, and recursion: Options/Recursion. +* -d: Options Summary. +* -e: Options Summary. +* -e (shell flag): Automatic Dependencies. +* -f <1>: Makefile Names. +* -f <2>: Makefile Arguments. +* -f: Options Summary. +* -f, and recursion: Options/Recursion. +* -h: Options Summary. +* -I: Include. +* -i <1>: Options Summary. +* -i: Errors. +* -I: Options Summary. +* -j <1>: Parallel. +* -j: Options Summary. +* -j, and archive update: Archive Pitfalls. +* -j, and recursion: Options/Recursion. +* -k <1>: Options Summary. +* -k <2>: Testing. +* -k: Errors. +* -l: Options Summary. +* -l (library search): Libraries/Search. +* -l (load average): Parallel. +* -m: Options Summary. +* -M (to compiler): Automatic Dependencies. +* -MM (to GNU compiler): Automatic Dependencies. +* -n <1>: Options Summary. +* -n <2>: Instead of Execution. +* -n: Echoing. +* -o <1>: Avoiding Compilation. +* -o: Options Summary. +* -o, and recursion: Options/Recursion. +* -p: Options Summary. +* -q <1>: Instead of Execution. +* -q: Options Summary. +* -r: Options Summary. +* -S: Options Summary. +* -s <1>: Options Summary. +* -s: Echoing. +* -t <1>: Options Summary. +* -t: Instead of Execution. +* -t, and recursion: MAKE Variable. +* -v: Options Summary. +* -W: Options Summary. +* -w: Options Summary. +* -W: Instead of Execution. +* -w, and -C: -w Option. +* -W, and recursion: Options/Recursion. +* -w, and recursion: -w Option. +* -w, disabling: -w Option. +* .a (archives): Archive Suffix Rules. +* .C: Catalogue of Rules. +* .c: Catalogue of Rules. +* .cc: Catalogue of Rules. +* .ch: Catalogue of Rules. +* .d: Automatic Dependencies. +* .def: Catalogue of Rules. +* .dvi: Catalogue of Rules. +* .f: Catalogue of Rules. +* .F: Catalogue of Rules. +* .info: Catalogue of Rules. +* .l: Catalogue of Rules. +* .ln: Catalogue of Rules. +* .mod: Catalogue of Rules. +* .o: Catalogue of Rules. +* .p: Catalogue of Rules. +* .PRECIOUS intermediate files: Chained Rules. +* .r: Catalogue of Rules. +* .s: Catalogue of Rules. +* .S: Catalogue of Rules. +* .sh: Catalogue of Rules. +* .sym: Catalogue of Rules. +* .tex: Catalogue of Rules. +* .texi: Catalogue of Rules. +* .texinfo: Catalogue of Rules. +* .txinfo: Catalogue of Rules. +* .w: Catalogue of Rules. +* .web: Catalogue of Rules. +* .y: Catalogue of Rules. +* :: rules (double-colon): Double-Colon. +* := <1>: Setting. +* :=: Flavors. +* = <1>: Setting. +* =: Flavors. +* ? (wildcard character): Wildcards. +* ?= <1>: Setting. +* ?=: Flavors. +* @ (in commands): Echoing. +* @, and define: Sequences. +* [...] (wildcard characters): Wildcards. +* \ (backslash), for continuation lines: Simple Makefile. +* \ (backslash), in commands: Execution. +* \ (backslash), to quote % <1>: Selective Search. +* \ (backslash), to quote % <2>: Text Functions. +* \ (backslash), to quote %: Static Usage. +* __.SYMDEF: Archive Symbols. +* algorithm for directory search: Search Algorithm. +* all (standard target): Goals. +* appending to variables: Appending. +* ar: Implicit Variables. +* archive: Archives. +* archive member targets: Archive Members. +* archive symbol directory updating: Archive Symbols. +* archive, and -j: Archive Pitfalls. +* archive, and parallel execution: Archive Pitfalls. +* archive, suffix rule for: Archive Suffix Rules. +* Arg list too long: Options/Recursion. +* arguments of functions: Syntax of Functions. +* as <1>: Catalogue of Rules. +* as: Implicit Variables. +* assembly, rule to compile: Catalogue of Rules. +* automatic generation of dependencies <1>: Automatic Dependencies. +* automatic generation of dependencies: Include. +* automatic variables: Automatic. +* backquotes: Shell Function. +* backslash (\), for continuation lines: Simple Makefile. +* backslash (\), in commands: Execution. +* backslash (\), to quote % <1>: Static Usage. +* backslash (\), to quote % <2>: Selective Search. +* backslash (\), to quote %: Text Functions. +* backslashes in pathnames and wildcard expansion: Wildcard Pitfall. * basename: File Name Functions. -* CC: Implicit Variables. -* CFLAGS: Implicit Variables. -* CO: Implicit Variables. -* COFLAGS: Implicit Variables. -* COMSPEC: Execution. -* CPP: Implicit Variables. -* CPPFLAGS: Implicit Variables. -* CTANGLE: Implicit Variables. -* CWEAVE: Implicit Variables. -* CXX: Implicit Variables. -* CXXFLAGS: Implicit Variables. -* define: Defining. -* dir: File Name Functions. -* else: Conditional Syntax. -* endef: Defining. -* endif: Conditional Syntax. -* export: Variables/Recursion. -* FC: Implicit Variables. -* FFLAGS: Implicit Variables. -* filter: Text Functions. -* filter-out: Text Functions. -* findstring: Text Functions. -* firstword: File Name Functions. -* foreach: Foreach Function. -* GET: Implicit Variables. -* GFLAGS: Implicit Variables. -* GNUmakefile: Makefile Names. -* GPATH: Search Algorithm. -* ifdef: Conditional Syntax. -* ifeq: Conditional Syntax. -* ifndef: Conditional Syntax. -* ifneq: Conditional Syntax. -* include: Include. -* join: File Name Functions. -* LDFLAGS: Implicit Variables. -* LEX: Implicit Variables. -* LFLAGS: Implicit Variables. -* MAKE <1>: MAKE Variable. -* MAKE: Flavors. +* binary packages: Install Command Categories. +* broken pipe: Parallel. +* bugs, reporting: Bugs. +* built-in special targets: Special Targets. +* C++, rule to compile: Catalogue of Rules. +* C, rule to compile: Catalogue of Rules. +* cc <1>: Catalogue of Rules. +* cc: Implicit Variables. +* cd (shell command) <1>: MAKE Variable. +* cd (shell command): Execution. +* chains of rules: Chained Rules. +* check (standard target): Goals. +* clean (standard target): Goals. +* clean target <1>: Cleanup. +* clean target: Simple Makefile. +* cleaning up: Cleanup. +* clobber (standard target): Goals. +* co <1>: Catalogue of Rules. +* co: Implicit Variables. +* combining rules by dependency: Combine By Dependency. +* command line variable definitions, and recursion: Options/Recursion. +* command line variables: Overriding. +* commands: Rule Syntax. +* commands, backslash (\) in: Execution. +* commands, comments in: Commands. +* commands, echoing: Echoing. +* commands, empty: Empty Commands. +* commands, errors in: Errors. +* commands, execution: Execution. +* commands, execution in parallel: Parallel. +* commands, expansion: Shell Function. +* commands, how to write: Commands. +* commands, instead of executing: Instead of Execution. +* commands, introduction to: Rule Introduction. +* commands, quoting newlines in: Execution. +* commands, sequences of: Sequences. +* comments, in commands: Commands. +* comments, in makefile: Makefile Contents. +* compatibility: Features. +* compatibility in exporting: Variables/Recursion. +* compilation, testing: Testing. +* computed variable name: Computed Names. +* conditional variable assignment: Flavors. +* conditionals: Conditionals. +* continuation lines: Simple Makefile. +* conventions for makefiles: Makefile Conventions. +* ctangle <1>: Implicit Variables. +* ctangle: Catalogue of Rules. +* cweave <1>: Catalogue of Rules. +* cweave: Implicit Variables. +* deducing commands (implicit rules): make Deduces. +* default directries for included makefiles: Include. +* default goal <1>: How Make Works. +* default goal: Rules. +* default makefile name: Makefile Names. +* default rules, last-resort: Last Resort. +* defining variables verbatim: Defining. +* deletion of target files <1>: Errors. +* deletion of target files: Interrupts. +* dependencies: Rule Syntax. +* dependencies, automatic generation <1>: Include. +* dependencies, automatic generation: Automatic Dependencies. +* dependencies, introduction to: Rule Introduction. +* dependencies, list of all: Automatic. +* dependencies, list of changed: Automatic. +* dependencies, varying (static pattern): Static Pattern. +* dependency: Rules. +* dependency pattern, implicit: Pattern Intro. +* dependency pattern, static (not implicit): Static Usage. +* directive: Makefile Contents. +* directories, printing them: -w Option. +* directories, updating archive symbol: Archive Symbols. +* directory part: File Name Functions. +* directory search (VPATH): Directory Search. +* directory search (VPATH), and implicit rules: Implicit/Search. +* directory search (VPATH), and link libraries: Libraries/Search. +* directory search (VPATH), and shell commands: Commands/Search. +* directory search algorithm: Search Algorithm. +* directory search, traditional: Search Algorithm. +* dist (standard target): Goals. +* distclean (standard target): Goals. +* dollar sign ($), in function call: Syntax of Functions. +* dollar sign ($), in rules: Rule Syntax. +* dollar sign ($), in variable name: Computed Names. +* dollar sign ($), in variable reference: Reference. +* double-colon rules: Double-Colon. +* duplicate words, removing: Text Functions. +* E2BIG: Options/Recursion. +* echoing of commands: Echoing. +* editor: Introduction. +* Emacs (M-x compile): Errors. +* empty commands: Empty Commands. +* empty targets: Empty Targets. +* environment: Environment. +* environment, and recursion: Variables/Recursion. +* environment, SHELL in: Execution. +* errors (in commands): Errors. +* errors with wildcards: Wildcard Pitfall. +* execution, in parallel: Parallel. +* execution, instead of: Instead of Execution. +* execution, of commands: Execution. +* exit status (errors): Errors. +* explicit rule, definition of: Makefile Contents. +* exporting variables: Variables/Recursion. +* f77 <1>: Catalogue of Rules. +* f77: Implicit Variables. +* features of GNU make: Features. +* features, missing: Missing. +* file name functions: File Name Functions. +* file name of makefile: Makefile Names. +* file name of makefile, how to specify: Makefile Names. +* file name prefix, adding: File Name Functions. +* file name suffix: File Name Functions. +* file name suffix, adding: File Name Functions. +* file name with wildcards: Wildcards. +* file name, basename of: File Name Functions. +* file name, directory part: File Name Functions. +* file name, nondirectory part: File Name Functions. +* files, assuming new: Instead of Execution. +* files, assuming old: Avoiding Compilation. +* files, avoiding recompilation of: Avoiding Compilation. +* files, intermediate: Chained Rules. +* filtering out words: Text Functions. +* filtering words: Text Functions. +* finding strings: Text Functions. +* flags: Options Summary. +* flags for compilers: Implicit Variables. +* flavors of variables: Flavors. +* FORCE: Force Targets. +* force targets: Force Targets. +* Fortran, rule to compile: Catalogue of Rules. +* functions: Functions. +* functions, for file names: File Name Functions. +* functions, for text: Text Functions. +* functions, syntax of: Syntax of Functions. +* g++ <1>: Implicit Variables. +* g++: Catalogue of Rules. +* gcc: Catalogue of Rules. +* generating dependencies automatically <1>: Automatic Dependencies. +* generating dependencies automatically: Include. +* get <1>: Implicit Variables. +* get: Catalogue of Rules. +* globbing (wildcards): Wildcards. +* goal: How Make Works. +* goal, default <1>: How Make Works. +* goal, default: Rules. +* goal, how to specify: Goals. +* home directory: Wildcards. +* IEEE Standard 1003.2: Overview. +* implicit rule: Implicit Rules. +* implicit rule, and directory search: Implicit/Search. +* implicit rule, and VPATH: Implicit/Search. +* implicit rule, definition of: Makefile Contents. +* implicit rule, how to use: Using Implicit. +* implicit rule, introduction to: make Deduces. +* implicit rule, predefined: Catalogue of Rules. +* implicit rule, search algorithm: Implicit Rule Search. +* included makefiles, default directries: Include. +* including (MAKEFILES variable): MAKEFILES Variable. +* including other makefiles: Include. +* incompatibilities: Missing. +* Info, rule to format: Catalogue of Rules. +* install (standard target): Goals. +* intermediate files: Chained Rules. +* intermediate files, preserving: Chained Rules. +* intermediate targets, explicit: Special Targets. +* interrupt: Interrupts. +* job slots: Parallel. +* job slots, and recursion: Options/Recursion. +* jobs, limiting based on load: Parallel. +* joining lists of words: File Name Functions. +* killing (interruption): Interrupts. +* last-resort default rules: Last Resort. +* ld: Catalogue of Rules. +* lex <1>: Catalogue of Rules. +* lex: Implicit Variables. +* Lex, rule to run: Catalogue of Rules. +* libraries for linking, directory search: Libraries/Search. +* library archive, suffix rule for: Archive Suffix Rules. +* limiting jobs based on load: Parallel. +* link libraries, and directory search: Libraries/Search. +* linking, predefined rule for: Catalogue of Rules. +* lint: Catalogue of Rules. +* lint, rule to run: Catalogue of Rules. +* list of all dependencies: Automatic. +* list of changed dependencies: Automatic. +* load average: Parallel. +* loops in variable expansion: Flavors. +* lpr (shell command) <1>: Empty Targets. +* lpr (shell command): Wildcard Examples. +* m2c: Catalogue of Rules. +* macro: Using Variables. +* make depend: Automatic Dependencies. * MAKECMDGOALS: Goals. -* Makefile: Makefile Names. -* makefile: Makefile Names. -* MAKEFILES <1>: Variables/Recursion. -* MAKEFILES: MAKEFILES Variable. -* MAKEFLAGS: Options/Recursion. -* MAKEINFO: Implicit Variables. -* MAKELEVEL <1>: Flavors. -* MAKELEVEL: Variables/Recursion. -* MAKEOVERRIDES: Options/Recursion. -* MFLAGS: Options/Recursion. -* notdir: File Name Functions. -* origin: Origin Function. -* OUTPUT_OPTION: Catalogue of Rules. -* override: Override Directive. -* patsubst <1>: Text Functions. -* patsubst: Substitution Refs. -* PC: Implicit Variables. -* PFLAGS: Implicit Variables. -* RFLAGS: Implicit Variables. -* RM: Implicit Variables. -* SHELL: Execution. -* shell: Shell Function. -* SHELL (command execution): Execution. -* sort: Text Functions. -* strip: Text Functions. -* subst <1>: Text Functions. -* subst: Multiple Targets. -* suffix: File Name Functions. -* SUFFIXES: Suffix Rules. -* TANGLE: Implicit Variables. -* TEX: Implicit Variables. -* TEXI2DVI: Implicit Variables. -* unexport: Variables/Recursion. -* vpath: Selective Search. -* VPATH: General Search. +* makefile: Introduction. +* makefile name: Makefile Names. +* makefile name, how to specify: Makefile Names. +* makefile rule parts: Rule Introduction. +* makefile, and MAKEFILES variable: MAKEFILES Variable. +* makefile, conventions for: Makefile Conventions. +* makefile, how make processes: How Make Works. +* makefile, how to write: Makefiles. +* makefile, including: Include. +* makefile, overriding: Overriding Makefiles. +* makefile, remaking of: Remaking Makefiles. +* makefile, simple: Simple Makefile. +* makeinfo <1>: Implicit Variables. +* makeinfo: Catalogue of Rules. +* match-anything rule: Match-Anything Rules. +* match-anything rule, used to override: Overriding Makefiles. +* missing features: Missing. +* mistakes with wildcards: Wildcard Pitfall. +* modified variable reference: Substitution Refs. +* Modula-2, rule to compile: Catalogue of Rules. +* mostlyclean (standard target): Goals. +* multiple rules for one target: Multiple Rules. +* multiple rules for one target (::): Double-Colon. +* multiple targets: Multiple Targets. +* multiple targets, in pattern rule: Pattern Intro. +* name of makefile: Makefile Names. +* name of makefile, how to specify: Makefile Names. +* nested variable reference: Computed Names. +* newline, quoting, in commands: Execution. +* newline, quoting, in makefile: Simple Makefile. +* nondirectory part: File Name Functions. +* OBJ: Variables Simplify. +* obj: Variables Simplify. +* objects: Variables Simplify. +* OBJECTS: Variables Simplify. +* OBJS: Variables Simplify. +* objs: Variables Simplify. +* old-fashioned suffix rules: Suffix Rules. +* options: Options Summary. +* options, and recursion: Options/Recursion. +* options, setting from environment: Options/Recursion. +* options, setting in makefiles: Options/Recursion. +* order of pattern rules: Pattern Intro. +* origin of variable: Origin Function. +* overriding makefiles: Overriding Makefiles. +* overriding variables with arguments: Overriding. +* overriding with override: Override Directive. +* parallel execution: Parallel. +* parallel execution, and archive update: Archive Pitfalls. +* parts of makefile rule: Rule Introduction. +* Pascal, rule to compile: Catalogue of Rules. +* pattern rule: Pattern Intro. +* pattern rules, order of: Pattern Intro. +* pattern rules, static (not implicit): Static Pattern. +* pattern rules, static, syntax of: Static Usage. +* pattern-specific variables: Pattern-specific. +* pc <1>: Implicit Variables. +* pc: Catalogue of Rules. +* phony targets: Phony Targets. +* pitfalls of wildcards: Wildcard Pitfall. +* portability: Features. +* POSIX: Overview. +* POSIX.2: Options/Recursion. +* post-installation commands: Install Command Categories. +* pre-installation commands: Install Command Categories. +* precious targets: Special Targets. +* prefix, adding: File Name Functions. +* preserving intermediate files: Chained Rules. +* preserving with .PRECIOUS <1>: Special Targets. +* preserving with .PRECIOUS: Chained Rules. +* preserving with .SECONDARY: Special Targets. +* print (standard target): Goals. +* print target <1>: Empty Targets. +* print target: Wildcard Examples. +* printing directories: -w Option. +* printing of commands: Echoing. +* problems and bugs, reporting: Bugs. +* problems with wildcards: Wildcard Pitfall. +* processing a makefile: How Make Works. +* question mode: Instead of Execution. +* quoting %, in patsubst: Text Functions. +* quoting %, in static pattern: Static Usage. +* quoting %, in vpath: Selective Search. +* quoting newline, in commands: Execution. +* quoting newline, in makefile: Simple Makefile. +* Ratfor, rule to compile: Catalogue of Rules. +* RCS, rule to extract from: Catalogue of Rules. +* README: Makefile Names. +* realclean (standard target): Goals. +* recompilation: Introduction. +* recompilation, avoiding: Avoiding Compilation. +* recording events with empty targets: Empty Targets. +* recursion: Recursion. +* recursion, and -C: Options/Recursion. +* recursion, and -f: Options/Recursion. +* recursion, and -j: Options/Recursion. +* recursion, and -o: Options/Recursion. +* recursion, and -t: MAKE Variable. +* recursion, and -W: Options/Recursion. +* recursion, and -w: -w Option. +* recursion, and command line variable definitions: Options/Recursion. +* recursion, and environment: Variables/Recursion. +* recursion, and MAKE variable: MAKE Variable. +* recursion, and MAKEFILES variable: MAKEFILES Variable. +* recursion, and options: Options/Recursion. +* recursion, and printing directories: -w Option. +* recursion, and variables: Variables/Recursion. +* recursion, level of: Variables/Recursion. +* recursive variable expansion <1>: Using Variables. +* recursive variable expansion: Flavors. +* recursively expanded variables: Flavors. +* reference to variables <1>: Reference. +* reference to variables: Advanced. +* relinking: How Make Works. +* remaking makefiles: Remaking Makefiles. +* removal of target files <1>: Interrupts. +* removal of target files: Errors. +* removing duplicate words: Text Functions. +* removing, to clean up: Cleanup. +* reporting bugs: Bugs. +* rm: Implicit Variables. +* rm (shell command) <1>: Errors. +* rm (shell command) <2>: Simple Makefile. +* rm (shell command) <3>: Wildcard Examples. +* rm (shell command): Phony Targets. +* rule commands: Commands. +* rule dependencies: Rule Syntax. +* rule syntax: Rule Syntax. +* rule targets: Rule Syntax. +* rule, and $: Rule Syntax. +* rule, double-colon (::): Double-Colon. +* rule, explicit, definition of: Makefile Contents. +* rule, how to write: Rules. +* rule, implicit: Implicit Rules. +* rule, implicit, and directory search: Implicit/Search. +* rule, implicit, and VPATH: Implicit/Search. +* rule, implicit, chains of: Chained Rules. +* rule, implicit, definition of: Makefile Contents. +* rule, implicit, how to use: Using Implicit. +* rule, implicit, introduction to: make Deduces. +* rule, implicit, predefined: Catalogue of Rules. +* rule, introduction to: Rule Introduction. +* rule, multiple for one target: Multiple Rules. +* rule, no commands or dependencies: Force Targets. +* rule, pattern: Pattern Intro. +* rule, static pattern: Static Pattern. +* rule, static pattern versus implicit: Static versus Implicit. +* rule, with multiple targets: Multiple Targets. +* s. (SCCS file prefix): Catalogue of Rules. +* SCCS, rule to extract from: Catalogue of Rules. +* search algorithm, implicit rule: Implicit Rule Search. +* search path for dependencies (VPATH): Directory Search. +* search path for dependencies (VPATH), and implicit rules: Implicit/Search. +* search path for dependencies (VPATH), and link libraries: Libraries/Search. +* searching for strings: Text Functions. +* secondary files: Chained Rules. +* secondary targets: Special Targets. +* sed (shell command): Automatic Dependencies. +* selecting a word: File Name Functions. +* selecting word lists: File Name Functions. +* sequences of commands: Sequences. +* setting options from environment: Options/Recursion. +* setting options in makefiles: Options/Recursion. +* setting variables: Setting. +* several rules for one target: Multiple Rules. +* several targets in a rule: Multiple Targets. +* shar (standard target): Goals. +* shell command: Simple Makefile. +* shell command, and directory search: Commands/Search. +* shell command, execution: Execution. +* shell command, function for: Shell Function. +* shell file name pattern (in include): Include. +* shell wildcards (in include): Include. +* SHELL, MS-DOS specifics: Execution. +* signal: Interrupts. +* silent operation: Echoing. +* simple makefile: Simple Makefile. +* simple variable expansion: Using Variables. +* simplifying with variables: Variables Simplify. +* simply expanded variables: Flavors. +* sorting words: Text Functions. +* spaces, in variable values: Flavors. +* spaces, stripping: Text Functions. +* special targets: Special Targets. +* specifying makefile name: Makefile Names. +* standard input: Parallel. +* standards conformance: Overview. +* standards for makefiles: Makefile Conventions. +* static pattern rule: Static Pattern. +* static pattern rule, syntax of: Static Usage. +* static pattern rule, versus implicit: Static versus Implicit. +* stem <1>: Static Usage. +* stem: Pattern Match. +* stem, variable for: Automatic. +* strings, searching for: Text Functions. +* stripping whitespace: Text Functions. +* sub-make: Variables/Recursion. +* subdirectories, recursion for: Recursion. +* substitution variable reference: Substitution Refs. +* suffix rule: Suffix Rules. +* suffix rule, for archive: Archive Suffix Rules. +* suffix, adding: File Name Functions. +* suffix, function to find: File Name Functions. +* suffix, substituting in variables: Substitution Refs. +* switches: Options Summary. +* symbol directories, updating archive: Archive Symbols. +* syntax of rules: Rule Syntax. +* tab character (in commands): Rule Syntax. +* tabs in rules: Rule Introduction. +* TAGS (standard target): Goals. +* tangle <1>: Catalogue of Rules. +* tangle: Implicit Variables. +* tar (standard target): Goals. +* target: Rules. +* target pattern, implicit: Pattern Intro. +* target pattern, static (not implicit): Static Usage. +* target, deleting on error: Errors. +* target, deleting on interrupt: Interrupts. +* target, multiple in pattern rule: Pattern Intro. +* target, multiple rules for one: Multiple Rules. +* target, touching: Instead of Execution. +* target-specific variables: Target-specific. +* targets: Rule Syntax. +* targets without a file: Phony Targets. +* targets, built-in special: Special Targets. +* targets, empty: Empty Targets. +* targets, force: Force Targets. +* targets, introduction to: Rule Introduction. +* targets, multiple: Multiple Targets. +* targets, phony: Phony Targets. +* terminal rule: Match-Anything Rules. +* test (standard target): Goals. +* testing compilation: Testing. +* tex <1>: Implicit Variables. +* tex: Catalogue of Rules. +* TeX, rule to run: Catalogue of Rules. +* texi2dvi <1>: Catalogue of Rules. +* texi2dvi: Implicit Variables. +* Texinfo, rule to format: Catalogue of Rules. +* tilde (~): Wildcards. +* touch (shell command) <1>: Wildcard Examples. +* touch (shell command): Empty Targets. +* touching files: Instead of Execution. +* traditional directory search: Search Algorithm. +* undefined variables, warning message: Options Summary. +* updating archive symbol directories: Archive Symbols. +* updating makefiles: Remaking Makefiles. +* value: Using Variables. +* value, how a variable gets it: Values. +* variable: Using Variables. +* variable definition: Makefile Contents. +* variables: Variables Simplify. +* variables, $ in name: Computed Names. +* variables, and implicit rule: Automatic. +* variables, appending to: Appending. +* variables, automatic: Automatic. +* variables, command line: Overriding. +* variables, command line, and recursion: Options/Recursion. +* variables, computed names: Computed Names. +* variables, conditional assignment: Flavors. +* variables, defining verbatim: Defining. +* variables, environment <1>: Variables/Recursion. +* variables, environment: Environment. +* variables, exporting: Variables/Recursion. +* variables, flavors: Flavors. +* variables, how they get their values: Values. +* variables, how to reference: Reference. +* variables, loops in expansion: Flavors. +* variables, modified reference: Substitution Refs. +* variables, nested references: Computed Names. +* variables, origin of: Origin Function. +* variables, overriding: Override Directive. +* variables, overriding with arguments: Overriding. +* variables, pattern-specific: Pattern-specific. +* variables, recursively expanded: Flavors. +* variables, setting: Setting. +* variables, simply expanded: Flavors. +* variables, spaces in values: Flavors. +* variables, substituting suffix in: Substitution Refs. +* variables, substitution reference: Substitution Refs. +* variables, target-specific: Target-specific. +* variables, warning for undefined: Options Summary. +* varying dependencies: Static Pattern. +* verbatim variable definition: Defining. * vpath: Directory Search. -* VPATH: Directory Search. -* WEAVE: Implicit Variables. -* wildcard <1>: File Name Functions. -* wildcard: Wildcard Function. -* word: File Name Functions. -* wordlist: File Name Functions. -* words: File Name Functions. -* YACC: Implicit Variables. -* YACCR: Implicit Variables. -* YFLAGS: Implicit Variables. - +* VPATH, and implicit rules: Implicit/Search. +* VPATH, and link libraries: Libraries/Search. +* weave <1>: Implicit Variables. +* weave: Catalogue of Rules. +* Web, rule to run: Catalogue of Rules. +* what if: Instead of Execution. +* whitespace, in variable values: Flavors. +* whitespace, stripping: Text Functions. +* wildcard: Wildcards. +* wildcard pitfalls: Wildcard Pitfall. +* wildcard, function: File Name Functions. +* wildcard, in archive member: Archive Members. +* wildcard, in include: Include. +* wildcards and MS-DOS/MS-Windows backslashes: Wildcard Pitfall. +* word, selecting a: File Name Functions. +* words, extracting first: File Name Functions. +* words, filtering: Text Functions. +* words, filtering out: Text Functions. +* words, finding number: File Name Functions. +* words, iterating over: Foreach Function. +* words, joining lists: File Name Functions. +* words, removing duplicates: Text Functions. +* words, selecting lists of: File Name Functions. +* writing rule commands: Commands. +* writing rules: Rules. +* yacc <1>: Catalogue of Rules. +* yacc <2>: Implicit Variables. +* yacc: Sequences. +* Yacc, rule to run: Catalogue of Rules. +* ~ (tilde): Wildcards. Only in make-3.76.1: make.man diff -uPr make-3.76.1/make.texinfo make-3.77/make.texinfo --- make-3.76.1/make.texinfo Tue Sep 16 10:17:33 1997 +++ make-3.77/make.texinfo Tue Jul 28 00:15:17 1998 @@ -8,12 +8,12 @@ @c FSF publishers: format makebook.texi instead of using this file directly. @set RCSID $Id: make.texinfo,v 2.165 1997/09/16 14:17:33 psmith Exp $ -@set EDITION 0.51 -@set VERSION 3.76 Beta -@set UPDATED 26 Aug 1997 -@set UPDATE-MONTH Aug 1997 +@set EDITION 0.52 +@set VERSION 3.77 +@set UPDATED 20 May 1998 +@set UPDATE-MONTH May 1998 @comment The ISBN number might need to change on next publication. -@set ISBN 1-882114-78-7 @c CHANGE THIS BEFORE PRINTING AGAIN! --roland 9may96 +@set ISBN 1-882114-80-9 @c CHANGE THIS BEFORE PRINTING AGAIN! --psmith 16jul98 @c finalout @@ -27,7 +27,7 @@ @ifinfo @dircategory The GNU make utility @direntry - * GNU make: (make.info). The GNU make utility. + * Make: (make.info). The GNU make utility. @end direntry This file documents the GNU Make utility, which determines @@ -37,7 +37,7 @@ This is Edition @value{EDITION}, last updated @value{UPDATED}, of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}. -Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 +Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of @@ -68,7 +68,7 @@ @titlepage @title GNU Make @subtitle A Program for Directing Recompilation -@subtitle Edition @value{EDITION}, for @code{make} Version @value{VERSION}. +@subtitle GNU @code{make} Version @value{VERSION}. @subtitle @value{UPDATE-MONTH} @author Richard M. Stallman and Roland McGrath @page @@ -107,9 +107,9 @@ large program need to be recompiled, and issues the commands to recompile them.@refill -This is Edition @value{EDITION} of the @cite{GNU Make Manual}, -last updated @value{UPDATED} -for @code{make} Version @value{VERSION}.@refill +This edition of the @cite{GNU Make Manual}, +last updated @value{UPDATED}, +documents GNU @code{make} Version @value{VERSION}.@refill This manual describes @code{make} and contains the following chapters:@refill @end ifinfo @@ -132,6 +132,7 @@ * Missing:: What GNU @code{make} lacks from other @code{make}s. * Makefile Conventions:: Conventions for makefiles in GNU programs. * Quick Reference:: A quick reference for experienced users. +* Make Errors:: A list of common errors generated by @code{make}. * Complex Makefile:: A real example of a straightforward, but nontrivial, makefile. * Concept Index:: Index of Concepts @@ -425,17 +426,10 @@ say what you expected to occur; this will help us decide whether the problem was really in the documentation. -Once you've got a precise problem, please send electronic mail either -through the Internet or via UUCP: +Once you've got a precise problem, please send electronic mail to: @example -@group -@r{Internet address:} - bug-gnu-utils@@prep.ai.mit.edu - -@r{UUCP path:} - mit-eddie!prep.ai.mit.edu!bug-gnu-utils -@end group + bug-make@@gnu.org @end example @noindent @@ -3228,6 +3222,14 @@ but there are many things to know about how they work and why, and about how the sub-@code{make} relates to the top-level @code{make}. +For your convenience, GNU @code{make} sets the variable @code{CURDIR} to +the pathname of the current working directory for you. If @code{-C} is +in effect, it will contain the path of the new directory, not the +original. The value has the same precedence it would have if it were +set in the makefile (by default, an environment variable @code{CURDIR} +will not override this value). Note that setting this variable has no +effect on the operation of @code{make} + @menu * MAKE Variable:: The special effects of using @samp{$(MAKE)}. * Variables/Recursion:: How to communicate variables to a sub-@code{make}. @@ -3828,6 +3830,10 @@ * Defining:: An alternate way to set a variable to a verbatim string. * Environment:: Variable values can come from the environment. +* Target-specific:: Variable values can be defined on a per-target + basis. +* Pattern-specific:: Target-specific variable values can be applied + to a group of targets that match a pattern. * Automatic:: Some special variables have predefined meanings for use with implicit rules. @end menu @@ -4056,6 +4062,30 @@ (with four trailing spaces), which was probably not the intention. (Imagine something like @w{@samp{$(dir)/file}} with this definition!) +@cindex conditional variable assignment +@cindex variables, conditional assignment +@cindex ?= +There is another assignment operator for variables, @samp{?=}. This +is called a conditional variable assignment operator, because it only +has an effect if the variable is not yet defined. This statement: + +@example +FOO ?= bar +@end example + +@noindent +is exactly equivalent to this +(@pxref{Origin Function, ,The @code{origin} Function}): + +@example +ifeq ($(origin FOO), undefined) + FOO = bar +endif +@end example + +Note that a variable set to an empty value is still defined, so +@samp{?=} will not set that variable. + @node Advanced, Values, Flavors, Using Variables @section Advanced Features for Reference to Variables @cindex reference to variables @@ -4353,6 +4383,7 @@ @cindex variables, setting @cindex = @cindex := +@cindex ?= To set a variable from the makefile, write a line starting with the variable name followed by @samp{=} or @samp{:=}. Whatever follows the @@ -4389,6 +4420,24 @@ automatically to a new value for each rule; these are called the @dfn{automatic} variables (@pxref{Automatic, ,Automatic Variables}). +If you'd like a variable to be set to a value only if it's not already +set, then you can use the shorthand operator @samp{?=} instead of +@samp{=}. These two settings of the variable @samp{FOO} are identical +(@pxref{Origin Function, ,The @code{origin} Function}): + +@example +FOO ?= bar +@end example + +@noindent +and + +@example +ifeq ($(origin FOO), undefined) +FOO = bar +endif +@end example + @node Appending, Override Directive, Setting, Using Variables @section Appending More Text to Variables @cindex += @@ -4646,7 +4695,7 @@ @noindent @xref{Override Directive, ,The @code{override} Directive}. -@node Environment, , Defining, Using Variables +@node Environment, Target-specific, Defining, Using Variables @section Variables from the Environment @cindex variables, environment @@ -4690,6 +4739,113 @@ usually not set. @xref{Execution, ,Special handling of SHELL on MS-DOS}.)@refill +@node Target-specific, Pattern-specific, Environment, Using Variables +@section Target-specific Variable Values +@cindex target-specific variables +@cindex variables, target-specific + +Variable values in @code{make} are usually global; that is, they are the +same regardless of where they are evaluated (unless they're reset, of +course). One exception to that is automatic variables +(@pxref{Automatic, ,Automatic Variables}). + +The other exception is @dfn{target-specific variable values}. This +feature allows you to define different values for the same variable, +based on the target that @code{make} is currently building. As with +automatic variables, these values are only available within the context +of a target's command script (and in other target-specific assignments). + +Set a target-specific variable value like this: + +@example +@var{target} @dots{} : @var{variable-assignment} +@end example + +@noindent +or like this: + +@example +@var{target} @dots{} : override @var{variable-assignment} +@end example + +Multiple @var{target} values create a target-specific variable value for +each member of the target list individually. + +The @var{variable-assignment} can be any valid form of assignment; +recursive (@samp{=}), static (@samp{:=}), appending (@samp{+=}), or +conditional (@samp{?=}). All variables that appear within the +@var{variable-assignment} are evaluated within the context of the +target: thus, any previously-defined target-specific variable values +will be in effect. Note that this variable is actually distinct from +any ``global'' value: the two variables do not have to have the same +flavor (recursive vs. static). + +Target-specific variables have the same priority as any other makefile +variable. Variables provided on the command-line (and in the +environment if the @samp{-e} option is in force) will take precedence. +Specifying the @code{override} directive will allow the target-specific +variable value to be preferred. + +There is one more special feature of target-specific variables: when you +define a target-specific variable, that variable value is also in effect +for all dependencies of this target (unless those dependencies override +it with their own target-specific variable value). So, for example, a +statement like this: + +@example +prog : CFLAGS = -g +prog : prog.o foo.o bar.o +@end example + +@noindent +will set @code{CFLAGS} to @samp{-g} in the command script for +@file{prog}, but it will also set @code{CFLAGS} to @samp{-g} in the +command scripts that create @file{prog.o}, @file{foo.o}, and +@file{bar.o}, and any command scripts which create their dependencies. + +@node Pattern-specific, , Target-specific, Using Variables +@section Pattern-specific Variable Values +@cindex pattern-specific variables +@cindex variables, pattern-specific + +In addition to target-specific variable values (@pxref{Target-specific, +,Target-specific Variable Values}), GNU @code{make} supports +pattern-specific variable values. In this form, a variable is defined +for any target that matches the pattern specified. Variables defined in +this way are searched after any target-specific variables defined +explicitly for that target, and before target-specific variables defined +for the parent target. + +Set a pattern-specific variable value like this: + +@example +@var{pattern} @dots{} : @var{variable-assignment} +@end example + +@noindent +or like this: + +@example +@var{pattern} @dots{} : override @var{variable-assignment} +@end example + +@noindent +where @var{pattern} is a %-pattern. As with target-specific variable +values, multiple @var{pattern} values create a pattern-specific variable +value for each pattern individually. The @var{variable-assignment} can +be any valid form of assignment. Any command-line variable setting will +take precedence, unless @code{override} is specified. + +For example: + +@example +%.o : CFLAGS = -O +@end example + +@noindent +will assign @code{CFLAGS} the value of @samp{-O} for all targets +matching the pattern @code{%.o}. + @node Conditionals, Functions, Using Variables, Top @chapter Conditional Parts of Makefiles @@ -6396,7 +6552,10 @@ Rules}). The @samp{-r} option also clears out the default list of suffixes for suffix rules (@pxref{Suffix Rules, ,Old-Fashioned Suffix Rules}). But you can still define your own suffixes with a rule for -@code{.SUFFIXES}, and then define your own suffix rules. +@code{.SUFFIXES}, and then define your own suffix rules. Note that only +@emph{rules} are affected by the @code{-r} option; default variables +remain in effect (@pxref{Implicit Variables, ,Variables Used by Implicit +Rules}). @item -s @cindex @code{-s} @@ -8546,7 +8705,7 @@ @comment included by standards.texi. @include make-stds.texi -@node Quick Reference, Complex Makefile, Makefile Conventions, Top +@node Quick Reference, Make Errors, Makefile Conventions, Top @appendix Quick Reference This appendix summarizes the directives, text manipulation functions, @@ -8821,12 +8980,136 @@ variable has no effect on the operation of @code{make}.@* @xref{Goals, ,Arguments to Specify the Goals}. +@item CURDIR + +Set to the pathname of the current working directory (after all +@code{-C} options are processed, if any). Setting this variable has no +effect on the operation of @code{make}.@* +@xref{Recursion, ,Recursive Use of @code{make}}. + @item SUFFIXES The default list of suffixes before @code{make} reads any makefiles. @end table -@node Complex Makefile, Concept Index, Quick Reference, Top +@node Make Errors, Complex Makefile, Quick Reference, Top +@comment node-name, next, previous, up +@appendix Errors Generated by Make + +Here is a list of the most common errors you might see generated by +@code{make}, and some information about what they mean and how to fix +them. + +Sometimes @code{make} errors are not fatal, especially in the presence +of a @code{-} prefix on a command script line, or the @code{-k} command +line option. Errors that are fatal are prefixed with the string +@code{***}. + +Error messages are all either prefixed with the name of the program +(usually @samp{make}), or, if the error is found in a makefile, the name +of the file and linenumber containing the problem. + +In the table below, these common prefixes are left off. + +@table @samp + +@item [@var{foo}] Error @var{NN} +@itemx [@var{foo}] @var{signal description} +These errors are not really @code{make} errors at all. They mean that a +program that @code{make} invoked as part of a command script returned a +non-0 error code (@samp{Error @var{NN}}), which @code{make} interprets +as failure, or it exited in some other abnormal fashion (with a +signal of some type). + +If no @code{***} is attached to the message, then the subprocess failed +but the rule in the makefile was prefixed with the @code{-} special +character, so @code{make} ignored the error. + +@item missing separator. Stop. +This is @code{make}'s generic ``Huh?'' error message. It means that +@code{make} was completely unsuccessful at parsing this line of your +makefile. It basically means ``syntax error''. + +One of the most common reasons for this message is that you (or perhaps +your oh-so-helpful editor, as is the case with many MS-Windows editors) +have attempted to indent your command scripts with spaces instead of a +TAB character. Remember that every line in the command script must +begin with a TAB character. Eight spaces do not count. + +@item commands commence before first target. Stop. +@itemx missing rule before commands. Stop. +This means the first thing in the makefile seems to be part of a command +script: it begins with a TAB character and doesn't appear to be a legal +@code{make} command (such as a variable assignment). Command scripts +must always be associated with a target. + +The second form is generated if the line has a semicolon as the first +non-whitespace character; @code{make} interprets this to mean you left +out the "target: dependency" section of a rule. + +@item No rule to make target `@var{xxx}'. +@itemx No rule to make target `@var{xxx}', needed by `@var{yyy}'. +This means that @code{make} decided it needed to build a target, but +then couldn't find any instructions in the makefile on how to do that, +either explicit or implicit (including in the default rules database). + +If you want that file to be built, you will need to add a rule to your +makefile describing how that target can be built. Other possible +sources of this problem are typos in the makefile (if that filename is +wrong) or a corrupted source tree (if that file is not supposed to be +built, but rather only a dependency). + +@item No targets specified and no makefile found. Stop. +@itemx No targets. Stop. +The former means that you didn't provide any targets to be built on the +command line, and @code{make} couldn't find any makefiles to read in. +The latter means that some makefile was found, but it didn't contain any +default target and none was given on the command line. GNU @code{make} +has nothing to do in these situations. + +@item Makefile `@var{xxx}' was not found. +@itemx Included makefile `@var{xxx}' was not found. +A makefile specified on the command line (first form) or included +(second form) was not found. + +@item warning: overriding commands for target `@var{xxx}' +@itemx warning: ignoring old commands for target `@var{xxx}' +GNU @code{make} allows commands to be specified only once per target +(except for double-colon rules). If you give commands for a target +which already has been defined to have commands, this warning is issued +and the second set of commands will overwrite the first set. + +@item Circular @var{xxx} <- @var{yyy} dependency dropped. +This means that @code{make} detected a loop in the dependency graph: +after tracing the dependency @var{yyy} of target @var{xxx}, and its +dependencies, etc., one of them depended on @var{xxx} again. + +@item Recursive variable `@var{xxx}' references itself (eventually). Stop. +This means you've defined a normal (recursive) @code{make} variable +@var{xxx} that, when its expanded, will refer to itself (@var{xxx}). +This is not allowed; either use simply-expanded variables (@code{:=}) or +use the append operator (@code{+=}). + +@item Unterminated variable reference. Stop. +This means you forgot to provide the proper closing parenthesis +or brace in your variable or function reference. + +@item insufficient arguments to function `@var{xxx}'. Stop. +This means you haven't provided the requisite number of arguments for +this function. See the documentation of the function for a description +of its arguments. + +@item missing target pattern. Stop. +@itemx multiple target patterns. Stop. +@itemx target pattern contains no `%'. Stop. +These are generated for malformed static pattern rules. The first means +there's no pattern in the target section of the rule, the second means +there are multiple patterns in the target section, and the third means +the target doesn't contain a pattern character (@code{%}). + +@end table + +@node Complex Makefile, Concept Index, Make Errors, Top @appendix Complex Makefile Example Here is the makefile for the GNU @code{tar} program. This is a diff -uPr make-3.76.1/makefile.com make-3.77/makefile.com --- make-3.76.1/makefile.com Wed Aug 27 16:31:21 1997 +++ make-3.77/makefile.com Mon Mar 2 01:27:50 1998 @@ -4,10 +4,37 @@ $! P1 is non-empty if you want to link with the VAXCRTL library instead $! of the shareable executable $! -$ def/nolog sys sys$library: -$ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt getopt1" +$! In case of problems with the install you might contact me at +$! zinser@decus.decus.de (preferred) or eurmpz@eur.sas.com +$! +$! Look for the compiler used +$! +$ lval = "" +$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" +$ then +$ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library: +$ ccopt = "" +$ else +$ ccopt = "/decc/prefix=all" +$ if f$trnlnm("SYS").eqs."" +$ then +$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes."" +$ then +$ define sys decc$library_include: +$ else +$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" - + then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]," +$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" - + then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]," +$ lval=lval+"SYS$LIBRARY:" +$ define sys 'lval +$ endif +$ endif +$ endif +$ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt1 getopt" $ copy config.h-vms config.h $ n=0 +$ open/write optf make.opt $ loop: $ cfile = f$elem(n," ",filelist) $ if cfile .eqs. " " then goto linkit @@ -16,19 +43,18 @@ $ n = n + 1 $ goto loop $ linkit: +$ close optf $ if p1 .nes. "" then goto link_using_library -$ link/exe=make alloca,ar,arscan,commands,default,dir,expand,file,function,- - implicit,job,main,misc,read,remake,remote-stub,rule,- - signame,variable,version,vmsfunctions,vmsify,vpath,- - glob,fnmatch,getopt,getopt1 +$ link/exe=make make.opt/opt $ exit $ link_using_library: -$ link/exe=make alloca,ar,arscan,commands,default,dir,expand,file,function,- - implicit,job,main,misc,read,remake,remote-stub,rule,- - signame,variable,version,vmsfunctions,vmsify,vpath,- - glob,fnmatch,getopt,getopt1,sys$library:vaxcrtl/lib +$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib $! $ compileit : subroutine -$ cc/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1' +$ ploc = f$locate("]",p1) +$ filnam = p1 +$ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1) +$ write optf "''filnam'" +$ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1' $ exit $ endsubroutine : compileit diff -uPr make-3.76.1/misc.c make-3.77/misc.c --- make-3.76.1/misc.c Wed Aug 27 16:31:23 1997 +++ make-3.77/misc.c Mon Jul 27 16:34:08 1998 @@ -253,6 +253,9 @@ unsigned int lineno; char *s1, *s2, *s3, *s4, *s5, *s6; { + if (!file) + fatal(s1, s2, s3, s4, s5, s6); + log_working_directory (1); fprintf (stderr, "%s:%u: *** ", file, lineno); @@ -470,7 +473,7 @@ { register struct dep *c; struct dep *firstnew = 0; - struct dep *lastnew; + struct dep *lastnew = 0; while (d != 0) { @@ -564,8 +567,9 @@ but we write this one to stderr because it might be run in a child fork whose stdout is piped. */ - fprintf (stderr, "%s access: user %d (real %d), group %d (real %d)\n", - flavor, geteuid (), getuid (), getegid (), getgid ()); + fprintf (stderr, "%s access: user %lu (real %lu), group %lu (real %lu)\n", + flavor, (unsigned long) geteuid (), (unsigned long) getuid (), + (unsigned long) getegid (), (unsigned long) getgid ()); fflush (stderr); } diff -uPr make-3.76.1/missing make-3.77/missing --- make-3.76.1/missing Wed Aug 13 02:55:38 1997 +++ make-3.77/missing Wed May 13 15:50:20 1998 @@ -41,9 +41,11 @@ autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files - bison touch file \`y.tab.c' + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - yacc touch file \`y.tab.c'" + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) @@ -80,7 +82,15 @@ you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - touch config.h.in + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` + if test -z "$files"; then + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` + test -z "$files" || files="$files.in" + else + files=`echo "$files" | sed -e 's/:/ /g'` + fi + test -z "$files" && files="config.h.in" + touch $files ;; automake) @@ -100,7 +110,51 @@ you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." - touch y.tab.c + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi ;; makeinfo) diff -uPr make-3.76.1/read.c make-3.77/read.c --- make-3.76.1/read.c Wed Aug 27 16:31:24 1997 +++ make-3.77/read.c Fri Jul 10 11:47:00 1998 @@ -16,12 +16,15 @@ along with GNU Make; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + #include "make.h" #include "dep.h" #include "filedef.h" #include "job.h" #include "commands.h" #include "variable.h" +#include "rule.h" /* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */ #ifdef HAVE_GLOB_H @@ -57,6 +60,14 @@ #define freebuffer(lb) free ((lb)->buffer) +/* Types of "words" that can be read in a makefile. */ +enum make_word_type + { + w_bogus, w_eol, w_static, w_variable, w_colon, w_dcolon, w_semicolon, + w_comment, w_varassign + }; + + /* A `struct conditionals' contains the information describing all the active conditionals in a makefile. @@ -122,9 +133,14 @@ unsigned int lineno, FILE *infile, char *filename)); static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno)); static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent, - struct dep *deps, unsigned int commands_started, char *commands, + struct dep *deps, unsigned int cmds_started, char *commands, unsigned int commands_idx, int two_colon, char *filename, unsigned int lineno, int set_default)); +static void record_target_var PARAMS ((struct nameseq *filenames, char *defn, + int two_colon, enum variable_origin origin, + char *filename, unsigned int lineno)); +static enum make_word_type get_next_mword PARAMS ((char *buffer, char *delim, + char **startp, unsigned int *length)); /* Read in all the makefiles and return the chain of their names. */ @@ -200,7 +216,7 @@ static char *default_makefiles[] = #ifdef VMS /* all lower case since readdir() (the vms version) 'lowercasifies' */ - { "makefile.vms", "gnumakefile", "makefile", 0 }; + { "makefile.vms", "gnumakefile.", "makefile.", 0 }; #else #ifdef _AMIGA { "GNUmakefile", "Makefile", "SMakefile", 0 }; @@ -268,10 +284,10 @@ unsigned int commands_len = 200; char *commands = (char *) xmalloc (200); unsigned int commands_idx = 0; - unsigned int commands_started; - register char *p; + unsigned int cmds_started; + char *p; char *p2; - int len; + int len, reading_target; int ignoring = 0, in_ignored_define = 0; int no_targets = 0; /* Set when reading a rule without targets. */ char *passed_filename = filename; @@ -280,7 +296,7 @@ struct dep *deps; unsigned int lineno = 1; unsigned int nlines = 0; - int two_colon; + int two_colon = 0; char *pattern = 0, *pattern_percent; int makefile_errno; @@ -293,19 +309,16 @@ { \ if (filenames != 0) \ record_files (filenames, pattern, pattern_percent, deps, \ - commands_started, commands, commands_idx, \ + cmds_started, commands, commands_idx, \ two_colon, filename, lineno, \ !(flags & RM_NO_DEFAULT_GOAL)); \ filenames = 0; \ commands_idx = 0; \ - pattern = 0; \ + if (pattern) { free(pattern); pattern = 0; } \ } while (0) -#ifdef lint /* Suppress `used before set' messages. */ - two_colon = 0; -#endif pattern_percent = 0; - commands_started = lineno; + cmds_started = lineno; if (debug_flag) { @@ -424,7 +437,7 @@ /* Append this command line to the line being accumulated. */ p = lb.buffer; if (commands_idx == 0) - commands_started = lineno; + cmds_started = lineno; len = strlen (p); if (len + 1 + commands_idx > commands_len) { @@ -453,7 +466,7 @@ collapse_continuations (collapsed); remove_comments (collapsed); - /* strncmp is first to avoid dereferencing out into space. */ + /* Compare a word, both length and contents. */ #define word1eq(s, l) (len == l && !strncmp (s, p, l)) p = collapsed; while (isspace (*p)) @@ -462,20 +475,27 @@ /* This line is completely empty. */ continue; - /* Find the end of the first token */ + /* Find the end of the first token. Note we don't need to worry about + * ":" here since we compare tokens by length (so "export" will never + * be equal to "export:"). + */ for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2) {} len = p2 - p; - /* Find the start of the second token. If it's a `:', jump past - preprocessor stuff since it can't be that--this allows targets named - `export', etc. */ + /* Find the start of the second token. If it's a `:' remember it, + since it can't be a preprocessor token--this allows targets named + `ifdef', `export', etc. */ + reading_target = 0; while (isspace (*p2)) ++p2; if (*p2 == '\0') p2 = NULL; else if (p2[0] == ':' && p2[1] == '\0') - goto check_var; + { + reading_target = 1; + goto skip_conditionals; + } /* We must first check for conditional and `define' directives before ignoring anything, since they control what we will do with @@ -494,7 +514,8 @@ "invalid syntax in conditional"); continue; } - else if (word1eq ("endef", 5)) + + if (word1eq ("endef", 5)) { if (in_ignored_define) in_ignored_define = 0; @@ -502,7 +523,8 @@ makefile_fatal (filename, lineno, "extraneous `endef'"); continue; } - else if (word1eq ("define", 6)) + + if (word1eq ("define", 6)) { if (ignoring) in_ignored_define = 1; @@ -521,8 +543,9 @@ } continue; } - else if (word1eq ("override", 8)) - { + + if (word1eq ("override", 8)) + { p2 = next_token (p + 8); if (p2 == 0) makefile_error (filename, lineno, "empty `override' directive"); @@ -551,12 +574,14 @@ continue; } + skip_conditionals: if (ignoring) /* Ignore the line. We continue here so conditionals can appear in the middle of a rule. */ continue; - else if (word1eq ("export", 6)) + + if (!reading_target && word1eq ("export", 6)) { struct variable *v; p2 = next_token (p + 6); @@ -578,7 +603,7 @@ } } } - else if (word1eq ("unexport", 8)) + else if (!reading_target && word1eq ("unexport", 8)) { unsigned int len; struct variable *v; @@ -614,9 +639,7 @@ if (pattern != 0) free (pattern); } - else - check_var: - if (word1eq ("include", 7) || word1eq ("-include", 8) + else if (word1eq ("include", 7) || word1eq ("-include", 8) || word1eq ("sinclude", 8)) { /* We have found an `include' line specifying a nested @@ -627,7 +650,7 @@ exist. "sinclude" is an alias for this from SGI. */ int noerror = p[0] != 'i'; - p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8))); + p = allocated_variable_expand (next_token (p + (noerror ? 8 : 7))); if (*p == '\0') { makefile_error (filename, lineno, @@ -667,6 +690,7 @@ && ! noerror) makefile_error (filename, lineno, "%s: %s", name, strerror (errno)); + free(name); } /* Free any space allocated by conditional_line. */ @@ -701,9 +725,20 @@ } else { - /* This line describes some target files. */ - - char *cmdleft; + /* This line describes some target files. This is complicated by + the existence of target-specific variables, because we can't + expand the entire line until we know if we have one or not. So + we expand the line word by word until we find the first `:', + then check to see if it's a target-specific variable. + + In this algorithm, `lb_next' will point to the beginning of the + unexpanded parts of the input buffer, while `p2' points to the + parts of the expanded buffer we haven't searched yet. */ + + enum make_word_type wtype; + enum variable_origin v_origin; + char *cmdleft, *lb_next; + unsigned int len, plen = 0; /* Record the previous rule. */ @@ -720,55 +755,176 @@ } else if (cmdleft != 0) /* Found one. Cut the line short there before expanding it. */ - *cmdleft = '\0'; + *(cmdleft++) = '\0'; collapse_continuations (lb.buffer); - /* Expand variable and function references before doing anything - else so that special characters can be inside variables. */ - p = variable_expand (lb.buffer); - - if (cmdleft == 0) - /* Look for a semicolon in the expanded line. */ - cmdleft = find_char_unquote (p, ";", 0); + /* We can't expand the entire line, since if it's a per-target + variable we don't want to expand it. So, walk from the + beginning, expanding as we go, and looking for "interesting" + chars. The first word is always expandable. */ + wtype = get_next_mword(lb.buffer, NULL, &lb_next, &len); + switch (wtype) + { + case w_eol: + if (cmdleft != 0) + makefile_fatal (filename, lineno, + "missing rule before commands"); + else + /* This line contained a variable reference that + expanded to nothing but whitespace. */ + continue; + + case w_colon: + case w_dcolon: + /* We accept and ignore rules without targets for + compatibility with SunOS 4 make. */ + no_targets = 1; + continue; - if (cmdleft != 0) - /* Cut the line short at the semicolon. */ - *cmdleft = '\0'; + default: + break; + } - p2 = next_token (p); - if (*p2 == '\0') - { - if (cmdleft != 0) - makefile_fatal (filename, lineno, - "missing rule before commands"); - else - /* This line contained a variable reference that - expanded to nothing but whitespace. */ - continue; - } - else if (*p2 == ':') - { - /* We accept and ignore rules without targets for - compatibility with SunOS 4 make. */ - no_targets = 1; - continue; - } + p2 = variable_expand_string(NULL, lb_next, len); + while (1) + { + char *colonp; + + lb_next += len; + if (cmdleft == 0) + { + /* Look for a semicolon in the expanded line. */ + cmdleft = find_char_unquote (p2, ";", 0); + + if (cmdleft != 0) + { + unsigned long p2_off = p2 - variable_buffer; + unsigned long cmd_off = cmdleft - variable_buffer; + char *pend = p2 + strlen(p2); + + /* Append any remnants of lb, then cut the line short + at the semicolon. */ + *cmdleft = '\0'; + + /* One school of thought says that you shouldn't expand + here, but merely copy, since now you're beyond a ";" + and into a command script. However, the old parser + expanded the whole line, so we continue that for + backwards-compatiblity. Also, it wouldn't be + entirely consistent, since we do an unconditional + expand below once we know we don't have a + target-specific variable. */ + (void)variable_expand_string(pend, lb_next, -1); + lb_next += strlen(lb_next); + p2 = variable_buffer + p2_off; + cmdleft = variable_buffer + cmd_off + 1; + } + } + + colonp = find_char_unquote(p2, ":", 0); +#if defined(__MSDOS__) || defined(WINDOWS32) + /* The drive spec brain-damage strikes again... */ + /* FIXME: is whitespace the only possible separator of words + in this context? If not, the `isspace' test below will + need to be changed into a call to `index'. */ + while (colonp && (colonp[1] == '/' || colonp[1] == '\\') && + colonp > p2 && isalpha(colonp[-1]) && + (colonp == p2 + 1 || isspace(colonp[-2]))) + colonp = find_char_unquote(colonp + 1, ":", 0); +#endif + if (colonp != 0) + break; + + wtype = get_next_mword(lb_next, NULL, &lb_next, &len); + if (wtype == w_eol) + makefile_fatal (filename, lineno, "missing separator"); + + p2 += strlen(p2); + *(p2++) = ' '; + p2 = variable_expand_string(p2, lb_next, len); + /* We don't need to worry about cmdleft here, because if it was + found in the variable_buffer the entire buffer has already + been expanded... we'll never get here. */ + } + + p2 = next_token (variable_buffer); filenames = multi_glob (parse_file_seq (&p2, ':', sizeof (struct nameseq), 1), sizeof (struct nameseq)); - if (*p2++ == '\0') - makefile_fatal (filename, lineno, "missing separator"); + + if (!filenames) + { + /* We accept and ignore rules without targets for + compatibility with SunOS 4 make. */ + no_targets = 1; + continue; + } + /* This should never be possible; we handled it above. */ + assert(*p2 != '\0'); + ++p2; + /* Is this a one-colon or two-colon entry? */ two_colon = *p2 == ':'; if (two_colon) p2++; + /* Test to see if it's a target-specific variable. Copy the rest + of the buffer over, possibly temporarily (we'll expand it later + if it's not a target-specific variable). PLEN saves the length + of the unparsed section of p2, for later. */ + if (*lb_next != '\0') + { + unsigned int l = p2 - variable_buffer; + plen = strlen(p2); + (void)variable_buffer_output(p2+plen, + lb_next, strlen(lb_next)+1); + p2 = variable_buffer + l; + } + wtype = get_next_mword(p2, NULL, &p, &len); + v_origin = o_file; + if (wtype == w_static && (len == (sizeof("override")-1) + && !strncmp(p, "override", len))) + { + v_origin = o_override; + (void)get_next_mword(p+len, NULL, &p, &len); + } + else if (wtype != w_eol) + wtype = get_next_mword(p+len, NULL, NULL, NULL); + + if (wtype == w_varassign || v_origin == o_override) + { + record_target_var(filenames, p, two_colon, v_origin, + filename, lineno); + filenames = 0; + continue; + } + + /* This is a normal target, _not_ a target-specific variable. + Unquote any = in the dependency list. */ + find_char_unquote (lb_next, "=", 0); + /* We have some targets, so don't ignore the following commands. */ no_targets = 0; + /* Expand the dependencies, etc. */ + if (*lb_next != '\0') + { + unsigned int l = p2 - variable_buffer; + (void)variable_expand_string(p2 + plen, lb_next, -1); + p2 = variable_buffer + l; + + /* Look for a semicolon in the expanded line. */ + if (cmdleft == 0) + { + cmdleft = find_char_unquote (p2, ";", 0); + if (cmdleft != 0) + *(cmdleft++) = '\0'; + } + } + /* Is this a static pattern rule: `target: %targ: %dep; ...'? */ p = index (p2, ':'); while (p != 0 && p[-1] == '\\') @@ -802,7 +958,8 @@ do { check_again = 0; /* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */ - if (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) { + if (p != 0 && (p[1] == '\\' || p[1] == '/') && + isalpha(p[-1]) && (p == p2 + 1 || index(" \t:", p[-2]) != 0)) { p = index(p + 1, ':'); check_again = 1; } @@ -822,6 +979,7 @@ if (pattern_percent == 0) makefile_fatal (filename, lineno, "target pattern contains no `%%'"); + free((char *)target); } else pattern = 0; @@ -835,9 +993,9 @@ if (cmdleft != 0) { /* Semicolon means rest of line is a command. */ - unsigned int len = strlen (cmdleft + 1); + unsigned int len = strlen (cmdleft); - commands_started = lineno; + cmds_started = lineno; /* Add this command line to the buffer. */ if (len + 2 > commands_len) @@ -845,7 +1003,7 @@ commands_len = (len + 2) * 2; commands = (char *) xrealloc (commands, commands_len); } - bcopy (cmdleft + 1, commands, len); + bcopy (cmdleft, commands, len); commands_idx += len; commands[commands_idx++] = '\n'; } @@ -1216,6 +1374,93 @@ } } +/* Record target-specific variable values for files FILENAMES. + TWO_COLON is nonzero if a double colon was used. + + The links of FILENAMES are freed, and so are any names in it + that are not incorporated into other data structures. + + If the target is a pattern, add the variable to the pattern-specific + variable value list. */ + +static void +record_target_var (filenames, defn, two_colon, origin, filename, lineno) + struct nameseq *filenames; + char *defn; + int two_colon; + enum variable_origin origin; + char *filename; + unsigned int lineno; +{ + struct nameseq *nextf; + struct variable_set_list *global; + + global = current_variable_set_list; + + for (; filenames != 0; filenames = nextf) + { + struct variable *v; + register char *name = filenames->name; + struct variable_set_list *vlist; + char *fname; + char *percent; + + nextf = filenames->next; + free ((char *) filenames); + + /* If it's a pattern target, then add it to the pattern-specific + variable list. */ + percent = find_percent (name); + if (percent) + { + struct pattern_var *p; + + /* Get a reference for this pattern-specific variable struct. */ + p = create_pattern_var(name, percent); + vlist = p->vars; + fname = p->target; + } + else + { + struct file *f; + + /* Get a file reference for this file, and initialize it. */ + f = enter_file (name); + initialize_file_variables (f); + vlist = f->variables; + fname = f->name; + } + + /* Make the new variable context current and define the variable. */ + current_variable_set_list = vlist; + v = try_variable_definition(filename, lineno, defn, origin); + if (!v) + makefile_error(filename, lineno, + "Malformed per-target variable definition"); + v->per_target = 1; + + /* If it's not an override, check to see if there was a command-line + setting. If so, reset the value. */ + if (origin != o_override) + { + struct variable *gv; + int len = strlen(v->name); + + current_variable_set_list = global; + gv = lookup_variable(v->name, len); + if (gv && (gv->origin == o_env_override || gv->origin == o_command)) + define_variable_in_set(v->name, len, gv->value, gv->origin, + gv->recursive, vlist->set); + } + + /* Free name if not needed further. */ + if (name != fname && (name < fname || name > fname + strlen (fname))) + free (name); + } + + current_variable_set_list = global; +} + /* Record a description line for files FILENAMES, with dependencies DEPS, commands to execute described by COMMANDS and COMMANDS_IDX, coming from FILENAME:COMMANDS_STARTED. @@ -1228,12 +1473,12 @@ that are not incorporated into other data structures. */ static void -record_files (filenames, pattern, pattern_percent, deps, commands_started, +record_files (filenames, pattern, pattern_percent, deps, cmds_started, commands, commands_idx, two_colon, filename, lineno, set_default) struct nameseq *filenames; char *pattern, *pattern_percent; struct dep *deps; - unsigned int commands_started; + unsigned int cmds_started; char *commands; unsigned int commands_idx; int two_colon; @@ -1243,7 +1488,7 @@ { struct nameseq *nextf; int implicit = 0; - unsigned int max_targets, target_idx; + unsigned int max_targets = 0, target_idx = 0; char **targets = 0, **target_percents = 0; struct commands *cmds; @@ -1251,7 +1496,7 @@ { cmds = (struct commands *) xmalloc (sizeof (struct commands)); cmds->filename = filename; - cmds->lineno = commands_started; + cmds->lineno = cmds_started; cmds->commands = savestring (commands, commands_idx); cmds->command_lines = 0; } @@ -1260,6 +1505,7 @@ for (; filenames != 0; filenames = nextf) { + register char *name = filenames->name; register struct file *f; register struct dep *d; @@ -1641,13 +1887,6 @@ if (p && *p == ',') *p =' '; #endif -#ifdef __MSDOS__ - /* For MS-DOS, skip a "C:\..." or a "C:/..." until we find a - first colon which isn't followed by a slash or a backslash. */ - if (stopchar == ':') - while (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) - p = find_char_unquote (p + 1, stopchars, 1); -#endif #ifdef _AMIGA if (stopchar == ':' && p && *p == ':' && !(isspace(p[1]) || !p[1] || isspace(p[-1]))) @@ -1655,16 +1894,15 @@ p = find_char_unquote (p+1, stopchars, 1); } #endif -#ifdef WINDOWS32 - /* For WINDOWS32, skip a "C:\..." or "C:/...". */ - if (stopchar == ':' && - p != 0 && - (p[1] == '\\' || p[1] == '/') && - isalpha (p[-1])) { - p = end_of_token_w32(++p, ':'); - if (*p == '\0' && p[-1] == ':') - p--; - } +#if defined(WINDOWS32) || defined(__MSDOS__) + /* For WINDOWS32, skip a "C:\..." or a "C:/..." until we find the + first colon which isn't followed by a slash or a backslash. + Note that tokens separated by spaces should be treated as separate + tokens since make doesn't allow path names with spaces */ + if (stopchar == ':') + while (p != 0 && !isspace(*p) && + (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) + p = find_char_unquote (p + 1, stopchars, 1); #endif if (p == 0) p = q + strlen (q); @@ -1751,7 +1989,7 @@ Look back for an elt with an opening `(' but no closing `)'. */ struct nameseq *n = new1->next, *lastn = new1; - char *paren; + char *paren = 0; while (n != 0 && (paren = index (n->name, '(')) == 0) { lastn = n; @@ -1944,6 +2182,190 @@ return nlines; } +/* Parse the next "makefile word" from the input buffer, and return info + about it. + + A "makefile word" is one of: + + w_bogus Should never happen + w_eol End of input + w_static A static word; cannot be expanded + w_variable A word containing one or more variables/functions + w_colon A colon + w_dcolon A double-colon + w_semicolon A semicolon + w_comment A comment character + w_varassign A variable assignment operator (=, :=, +=, or ?=) + + Note that this function is only used when reading certain parts of the + makefile. Don't use it where special rules hold sway (RHS of a variable, + in a command list, etc.) */ + +static enum make_word_type +get_next_mword (buffer, delim, startp, length) + char *buffer; + char *delim; + char **startp; + unsigned int *length; +{ + enum make_word_type wtype = w_bogus; + char *p = buffer, *beg; + char c; + + /* Skip any leading whitespace. */ + while (isblank(*p)) + ++p; + + beg = p; + c = *(p++); + switch (c) + { + case '\0': + wtype = w_eol; + break; + + case '#': + wtype = w_comment; + break; + + case ';': + wtype = w_semicolon; + break; + + case '=': + wtype = w_varassign; + break; + + case ':': + wtype = w_colon; + switch (*p) + { + case ':': + ++p; + wtype = w_dcolon; + break; + + case '=': + ++p; + wtype = w_varassign; + break; + } + break; + + case '+': + case '?': + if (*p == '=') + { + ++p; + wtype = w_varassign; + break; + } + + default: + if (delim && index(delim, c)) + wtype = w_static; + break; + } + + /* Did we find something? If so, return now. */ + if (wtype != w_bogus) + goto done; + + /* This is some non-operator word. A word consists of the longest + string of characters that doesn't contain whitespace, one of [:=#], + or [?+]=, or one of the chars in the DELIM string. */ + + /* We start out assuming a static word; if we see a variable we'll + adjust our assumptions then. */ + wtype = w_static; + + /* We already found the first value of "c", above. */ + while (1) + { + char closeparen; + int count; + + switch (c) + { + case '\0': + case ' ': + case '\t': + case '=': + case '#': + goto done_word; + + case ':': +#if defined(__MSDOS__) || defined(WINDOWS32) + /* A word CAN include a colon in its drive spec. */ + if (!(p - beg == 2 && (*p == '/' || *p == '\\') && isalpha (*beg))) +#endif + goto done_word; + + case '$': + c = *(p++); + if (c == '$') + break; + + /* This is a variable reference, so note that it's expandable. + Then read it to the matching close paren. */ + wtype = w_variable; + + if (c == '(') + closeparen = ')'; + else if (c == '{') + closeparen = '}'; + else + /* This is a single-letter variable reference. */ + break; + + for (count=0; *p != '\0'; ++p) + { + if (*p == c) + ++count; + else if (*p == closeparen && --count < 0) + { + ++p; + break; + } + } + break; + + case '?': + case '+': + if (*p == '=') + goto done_word; + break; + + case '\\': + switch (*p) + { + case ';': + case '=': + case '\\': + ++p; + break; + } + break; + + default: + if (delim && index(delim, c)) + goto done_word; + break; + } + + c = *(p++); + } + done_word: + --p; + + done: + if (startp) + *startp = beg; + if (length) + *length = p - beg; + return wtype; +} + /* Construct the list of include directories from the arguments and the default list. */ @@ -2075,11 +2497,11 @@ if (home_dir == 0 || home_dir[0] == '\0') { extern char *getlogin (); - char *name = getlogin (); + char *logname = getlogin (); home_dir = 0; - if (name != 0) + if (logname != 0) { - struct passwd *p = getpwnam (name); + struct passwd *p = getpwnam (logname); if (p != 0) home_dir = p->pw_dir; } diff -uPr make-3.76.1/readme.vms make-3.77/readme.vms --- make-3.76.1/readme.vms Tue Sep 16 10:17:36 1997 +++ make-3.77/readme.vms Mon Mar 2 01:27:50 1998 @@ -47,8 +47,15 @@ command files. You can run a command file by using \@. -VMS changes made for 3.74.3 +Change history: +3.76.x +====== +Added VMS help version (make.hlp) of the Unix man page. To integrate +that with an existing Help library use a command like the following + $lib/ins/help sys$help:helplib.hlb make.hlp +3.74.3 +====== Lots of default settings are adapted for VMS. See default.c. Long command lines are now converted to command files. diff -uPr make-3.76.1/remake.c make-3.77/remake.c --- make-3.76.1/remake.c Wed Aug 27 16:31:25 1997 +++ make-3.77/remake.c Fri Jul 17 14:05:27 1998 @@ -91,9 +91,14 @@ g->changed = 0; } +#if 0 + /* Only run one job at a time when building makefiles. + No one seems to know why this was done, and no one can think of a good + reason to do it. Hopefully an obvious one won't appear as soon as we + release the next version :-/. */ if (makefiles) - /* Only run one job at a time. */ job_slots = 1; +#endif /* Update all the goals until they are all finished. */ @@ -115,7 +120,7 @@ { /* Iterate over all double-colon entries for this file. */ struct file *file = g->file; - int stop, any_not_updated = 0; + int stop = 0, any_not_updated = 0; for (file = g->file->double_colon ? g->file->double_colon : g->file; file != NULL; @@ -248,6 +253,38 @@ return status; } +/* Generate an error/fatal message if no rules are available for the target. + */ +static void +no_rule_error(file) + struct file *file; +{ + static const char msg_noparent[] + = "%sNo rule to make target `%s'%s"; + static const char msg_parent[] + = "%sNo rule to make target `%s', needed by `%s'%s"; + if (keep_going_flag || file->dontcare) + { + if (!file->dontcare) + { + if (file->parent == 0) + error (msg_noparent, "*** ", file->name, "."); + else + error (msg_parent, "*** ", + file->name, file->parent->name, "."); + file->shownerror = 1; + } + file->update_status = 2; + } + else + { + if (file->parent == 0) + fatal (msg_noparent, "", file->name, ""); + else + fatal (msg_parent, "", file->name, file->parent->name, ""); + } +} + /* If FILE is not up to date, execute the commands for it. Return 0 if successful, 1 if unsuccessful; but with some flag settings, just call `exit' if unsuccessful. @@ -317,6 +354,13 @@ if (file->update_status > 0) { DEBUGPR ("Recently tried and failed to update file `%s'.\n"); + if (!file->shownerror) + { + int dontcare = file->dontcare; + file->dontcare = 0; + no_rule_error(file); + file->dontcare = dontcare; + } return file->update_status; } @@ -394,18 +438,14 @@ { error ("Circular %s <- %s dependency dropped.", file->name, d->file->name); + /* We cannot free D here because our the caller will still have + a reference to it when we were called recursively via + check_dep below. */ if (lastd == 0) - { - file->deps = d->next; - free ((char *) d); - d = file->deps; - } + file->deps = d->next; else - { - lastd->next = d->next; - free ((char *) d); - d = lastd->next; - } + lastd->next = d->next; + d = d->next; continue; } @@ -594,7 +634,7 @@ DEBUGPR ("Must remake target `%s'.\n"); /* It needs to be remade. If it's VPATH and not reset via GPATH, toss the - VPATH */ + VPATH. */ if (!streq(file->name, file->hname)) { if (debug_flag) @@ -910,32 +950,7 @@ Pretend it was successfully remade. */ file->update_status = 0; else - { - /* This is a dependency file we cannot remake. Fail. */ - static const char msg_noparent[] - = "%sNo rule to make target `%s'%s"; - static const char msg_parent[] - = "%sNo rule to make target `%s', needed by `%s'%s"; - if (keep_going_flag || file->dontcare) - { - if (!file->dontcare) - { - if (file->parent == 0) - error (msg_noparent, "*** ", file->name, "."); - else - error (msg_parent, "*** ", - file->name, file->parent->name, "."); - } - file->update_status = 2; - } - else - { - if (file->parent == 0) - fatal (msg_noparent, "", file->name, ""); - else - fatal (msg_parent, "", file->name, file->parent->name, ""); - } - } + no_rule_error(file); } else { @@ -994,11 +1009,12 @@ } mtime = f_mtime (arfile, search); check_renamed (arfile); - if (search && strcmp (arfile->name, arname)) + if (search && strcmp (arfile->hname, arname)) { /* The archive's name has changed. Change the archive-member reference accordingly. */ + char *name; unsigned int arlen, memlen; if (!arname_used) @@ -1007,18 +1023,26 @@ arname_used = 1; } - arname = arfile->name; + arname = arfile->hname; arlen = strlen (arname); memlen = strlen (memname); - free (file->name); + /* free (file->name); */ - file->name = (char *) xmalloc (arlen + 1 + memlen + 2); - bcopy (arname, file->name, arlen); - file->name[arlen] = '('; - bcopy (memname, file->name + arlen + 1, memlen); - file->name[arlen + 1 + memlen] = ')'; - file->name[arlen + 1 + memlen + 1] = '\0'; + name = (char *) xmalloc (arlen + 1 + memlen + 2); + bcopy (arname, name, arlen); + name[arlen] = '('; + bcopy (memname, name + arlen + 1, memlen); + name[arlen + 1 + memlen] = ')'; + name[arlen + 1 + memlen + 1] = '\0'; + + /* If the archive was found with GPATH, make the change permanent; + otherwise defer it until later. */ + if (arfile->name == arfile->hname) + rename_file (file, name); + else + rehash_file (file, name); + check_renamed (file); } if (!arname_used) @@ -1029,7 +1053,7 @@ /* The archive doesn't exist, so it's members don't exist either. */ return (time_t) -1; - mtime = ar_member_date (file->name); + mtime = ar_member_date (file->hname); } else #endif @@ -1090,17 +1114,20 @@ * FAT filesystems round time to nearest even second(!). Just * allow for any file (NTFS or FAT) to perhaps suffer from this * braindamage. - * - * Apparently, this doesn't happen with the MS-DOS/DJGPP port, - * although MS-DOS and MS-Windows 3.X/9X also use FAT filesystems. */ if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now))) #else +#ifdef __MSDOS__ + /* Scrupulous testing indicates that some Windows + filesystems can set file times up to 3 sec into the future! */ + if (mtime > now + 3) +#else if (mtime > now) #endif +#endif { - error("*** Warning: File `%s' has modification time in the future", - file->name); + error("*** Warning: File `%s' has modification time in the future (%ld > %ld)", + file->name, mtime, now); clock_skew_detected = 1; } } diff -uPr make-3.76.1/remote-cstms.c make-3.77/remote-cstms.c --- make-3.76.1/remote-cstms.c Wed Mar 23 09:14:17 1994 +++ make-3.77/remote-cstms.c Tue Jul 7 09:56:26 1998 @@ -21,15 +21,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "make.h" +#include "job.h" +#include "filedef.h" #include "commands.h" #include "job.h" #include #include -#define __STRICT_BSD__ /* Don't make conflicting declarations. */ #include "customs.h" - char *remote_description = "Customs"; /* File name of the Customs `export' client command. @@ -42,25 +42,47 @@ /* Normalized path name of the current directory. */ static char *normalized_cwd; +/* Call once at startup even if no commands are run. */ + +void +remote_setup () +{ +} + +/* Called before exit. */ + +void +remote_cleanup () +{ +} + /* Return nonzero if the next job should be done remotely. */ int -start_remote_job_p () +start_remote_job_p (first_p) + int first_p; { static int inited = 0; int status; - - /* Allow the user to turn off job exportation - (useful while he is debugging Customs, for example). */ - if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0) - return 0; + int njobs; if (!inited) { + /* Allow the user to turn off job exportation (useful while he is + debugging Customs, for example). */ + if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0) + { + inited = -1; + return 0; + } + /* For secure Customs, make is installed setuid root and Customs requires a privileged source port be used. */ make_access (); + if (debug_flag) + Rpc_Debug(1); + /* Ping the daemon once to see if it is there. */ inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1; @@ -87,6 +109,15 @@ if (inited < 0) return 0; + njobs = job_slots_used; + if (!first_p) + njobs -= 1; /* correction for being called from reap_children() */ + + /* the first job should run locally, or, if the -l flag is given, we use + that as clue as to how many local jobs should be scheduled locally */ + if (max_load_average < 0 && njobs == 0 || njobs < max_load_average) + return 0; + status = Customs_Host (EXPORT_SAME, &permit); if (status != RPC_SUCCESS) { @@ -113,8 +144,8 @@ int *id_ptr; int *used_stdin; { - extern int vfork (), execve (); char waybill[MAX_DATA_SIZE], msg[128]; + struct hostent *host; struct timeval timeout; struct sockaddr_in sin; int len; @@ -150,8 +181,8 @@ /* Modify the waybill as if the remote child had done `child_access ()'. */ { WayBill *wb = (WayBill *) waybill; - wb->euid = wb->ruid; - wb->rgid = wb->rgid; + wb->ruid = wb->euid; + wb->rgid = wb->egid; } /* Send the request to the server, timing out in 20 seconds. */ @@ -164,26 +195,31 @@ len, (Rpc_Opaque) waybill, sizeof(msg), (Rpc_Opaque) msg, 1, &timeout); + + host = gethostbyaddr((char *)&permit.addr, sizeof(permit.addr), AF_INET); + if (status != RPC_SUCCESS) { (void) close (retsock); (void) close (sock); - error ("exporting: %s", Rpc_ErrorMessage (status)); + error ("exporting to %s: %s", + host ? host->h_name : inet_ntoa (permit.addr), + Rpc_ErrorMessage (status)); return 1; } else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0') { (void) close (retsock); (void) close (sock); - error ("CUSTOMS_IMPORT: %s", msg); + error ("exporting to %s: %s", + host ? host->h_name : inet_ntoa (permit.addr), + msg); return 1; } - else if (debug_flag) + else { - struct hostent *host = gethostbyaddr (&permit.addr, sizeof (permit.addr), - AF_INET); - printf ("Job exported to %s ID %u\n", - host == 0 ? inet_ntoa (permit.addr) : host->h_name, + error ("*** exported to %s (id %u)", + host ? host->h_name : inet_ntoa (permit.addr), permit.id); } @@ -225,6 +261,7 @@ (void) close (sock); *is_remote = 0; *id_ptr = pid; + *used_stdin = 1; return 0; } diff -uPr make-3.76.1/remote-stub.c make-3.77/remote-stub.c --- make-3.76.1/remote-stub.c Sat Jun 22 15:31:06 1996 +++ make-3.77/remote-stub.c Tue Mar 31 02:31:45 1998 @@ -41,7 +41,8 @@ /* Return nonzero if the next job should be done remotely. */ int -start_remote_job_p () +start_remote_job_p (first_p) + int first_p; { return 0; } diff -uPr make-3.76.1/rule.c make-3.77/rule.c --- make-3.76.1/rule.c Thu May 9 14:02:43 1996 +++ make-3.77/rule.c Fri May 15 10:34:03 1998 @@ -50,6 +50,14 @@ unsigned int max_pattern_dep_length; +/* Chain of all pattern-specific variables. */ + +static struct pattern_var *pattern_vars; + +/* Pointer to last struct in the chain, so we can add onto the end. */ + +static struct pattern_var *last_pattern_var; + /* Pointer to structure for the file .SUFFIXES whose dependencies are the suffixes to be searched. */ @@ -86,7 +94,7 @@ unsigned int ntargets; ++num_pattern_rules; - + ntargets = 0; while (rule->targets[ntargets] != 0) ++ntargets; @@ -157,7 +165,7 @@ end_main_loop: rule = next; } - + if (name != 0) free (name); } @@ -336,7 +344,7 @@ else last_pattern_rule->next = rule; last_pattern_rule = rule; - + /* We got one. Stop looking. */ goto matched; } @@ -519,6 +527,78 @@ r->terminal = terminal; } +/* Create a new pattern-specific variable struct. */ + +struct pattern_var * +create_pattern_var (target, suffix) + char *target, *suffix; +{ + register struct pattern_var *p = 0; + unsigned int len = strlen(target); + + /* Look to see if this pattern already exists in the list. */ + for (p = pattern_vars; p != NULL; p = p->next) + if (p->len == len && !strcmp(p->target, target)) + break; + + if (p == 0) + { + p = (struct pattern_var *) xmalloc (sizeof (struct pattern_var)); + if (last_pattern_var != 0) + last_pattern_var->next = p; + else + pattern_vars = p; + last_pattern_var = p; + p->next = 0; + p->target = target; + p->len = len; + p->suffix = suffix + 1; + p->vars = create_new_variable_set(); + } + + return p; +} + +/* Look up a target in the pattern-specific variable list. */ + +struct pattern_var * +lookup_pattern_var (target) + char *target; +{ + struct pattern_var *p; + unsigned int targlen = strlen(target); + + for (p = pattern_vars; p != 0; p = p->next) + { + char *stem; + unsigned int stemlen; + + if (p->len > targlen) + /* It can't possibly match. */ + continue; + + /* From the lengths of the filename and the pattern parts, + find the stem: the part of the filename that matches the %. */ + stem = target + (p->suffix - p->target - 1); + stemlen = targlen - p->len + 1; + + /* Compare the text in the pattern before the stem, if any. */ + if (stem > target && strncmp (p->target, target, stem - target)) + continue; + + /* Compare the text in the pattern after the stem, if any. + We could test simply use streq, but this way we compare the + first two characters immediately. This saves time in the very + common case where the first character matches because it is a + period. */ + if (*p->suffix == stem[stemlen] + && (*p->suffix == '\0'|| streq (&p->suffix[1], &stem[stemlen+1]))) + break; + } + + return p; +} + /* Print the data base of rules. */ static void /* Useful to call from gdb. */ @@ -586,4 +666,26 @@ if (num_pattern_rules != rules) fatal ("BUG: num_pattern_rules wrong! %u != %u", num_pattern_rules, rules); + + puts ("\n# Pattern-specific variable values"); + + { + struct pattern_var *p; + + rules = 0; + for (p = pattern_vars; p != 0; p = p->next) + { + ++rules; + + printf ("\n%s :\n", p->target); + print_variable_set (p->vars->set, "# "); + } + + if (rules == 0) + puts ("\n# No pattern-specific variable values."); + else + { + printf ("\n# %u pattern-specific variable values", rules); + } + } } diff -uPr make-3.76.1/rule.h make-3.77/rule.h --- make-3.76.1/rule.h Wed Mar 20 09:58:14 1996 +++ make-3.77/rule.h Fri May 15 11:00:08 1998 @@ -30,6 +30,15 @@ char in_use; /* If in use by a parent pattern_search. */ }; +struct pattern_var + { + struct pattern_var *next; + char *target; + unsigned int len; + char *suffix; + struct variable_set_list *vars; + }; + /* For calling install_pattern_rule. */ struct pspec { @@ -51,3 +60,5 @@ extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal)); extern int new_pattern_rule PARAMS ((struct rule *rule, int override)); +extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix)); +extern struct pattern_var *lookup_pattern_var PARAMS ((char *target)); diff -uPr make-3.76.1/subproc.bat make-3.77/subproc.bat --- make-3.76.1/subproc.bat Fri Jul 19 17:43:52 1996 +++ make-3.77/subproc.bat Mon Mar 2 02:00:52 1998 @@ -1,3 +1,6 @@ cd w32\subproc -nmake /f %1 +set MAKE=%2 +set MAKEFILE=%1 +if x%2 == x set MAKE=nmake +%MAKE% /f %MAKEFILE% cd ..\.. diff -uPr make-3.76.1/variable.c make-3.77/variable.c --- make-3.76.1/variable.c Wed Aug 27 16:31:26 1997 +++ make-3.77/variable.c Fri May 15 13:59:56 1998 @@ -44,10 +44,8 @@ = { 0, &global_variable_set }; struct variable_set_list *current_variable_set_list = &global_setlist; -static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length, - char *value, enum variable_origin origin, - int recursive, struct variable_set *set)); - +static struct variable *lookup_variable_in_set PARAMS ((char *name, + unsigned int length, struct variable_set *set)); /* Implement variables. */ @@ -58,7 +56,7 @@ If RECURSIVE is nonzero a flag is set in the variable saying that it should be recursively re-expanded. */ -static struct variable * +struct variable * define_variable_in_set (name, length, value, origin, recursive, set) char *name; unsigned int length; @@ -114,6 +112,7 @@ v->origin = origin; v->recursive = recursive; v->expanding = 0; + v->per_target = 0; v->export = v_default; v->next = set->table[hashval]; set->table[hashval] = v; @@ -184,6 +183,34 @@ return 0; } +/* Lookup a variable whose name is a string starting at NAME + and with LENGTH chars in set SET. NAME need not be null-terminated. + Returns address of the `struct variable' containing all info + on the variable, or nil if no such variable is defined. */ + +static struct variable * +lookup_variable_in_set (name, length, set) + char *name; + unsigned int length; + struct variable_set *set; +{ + register unsigned int i; + register unsigned int hash = 0; + register struct variable *v; + + for (i = 0; i < length; ++i) + HASH (hash, name[i]); + hash %= set->buckets; + + for (v = set->table[hash]; v != 0; v = v->next) + if (*v->name == *name + && !strncmp (v->name + 1, name + 1, length - 1) + && v->name[length] == 0) + return v; + + return 0; +} + /* Initialize FILE's variable set list. If FILE already has a variable set list, the topmost variable set is left intact, but the the rest of the chain is replaced with FILE->parent's setlist. */ @@ -245,10 +272,8 @@ free ((char *) set); } -/* Create a new variable set and push it on the current setlist. */ - -void -push_new_variable_scope () +struct variable_set_list * +create_new_variable_set () { register struct variable_set_list *setlist; register struct variable_set *set; @@ -263,7 +288,16 @@ xmalloc (sizeof (struct variable_set_list)); setlist->set = set; setlist->next = current_variable_set_list; - current_variable_set_list = setlist; + + return setlist; +} + +/* Create a new variable set and push it on the current setlist. */ + +struct variable_set_list * +push_new_variable_scope () +{ + return (current_variable_set_list = create_new_variable_set()); } /* Merge SET1 into SET0, freeing unused storage in SET1. */ @@ -506,6 +540,19 @@ added specially at the end. */ continue; + /* If this is a per-target variable and it hasn't been touched + already then look up the global version and take its export + value. */ + if (v->per_target && v->export == v_default) + { + struct variable *gv; + + gv = lookup_variable_in_set(v->name, strlen(v->name), + &global_variable_set); + if (gv) + v->export = gv->export; + } + switch (v->export) { case v_default: @@ -524,15 +571,16 @@ for (++p; *p != '\0'; ++p) if (*p != '_' && (*p < 'a' || *p > 'z') && (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9')) - break; + continue; if (*p != '\0') continue; - - case v_export: break; - case v_noexport: - continue; + case v_export: + break; + + case v_noexport: + continue; case v_ifset: if (v->origin == o_default) @@ -540,9 +588,22 @@ break; } + /* If this was from a different-sized hash table, then + recalculate the bucket it goes in. */ + if (set->buckets != buckets) + { + register char *np; + + j = 0; + for (np = v->name; *np != '\0'; ++np) + HASH (j, *np); + j %= buckets; + } + for (ov = table[j]; ov != 0; ov = ov->next) if (streq (v->name, ov->variable->name)) break; + if (ov == 0) { register struct variable_bucket *entry; @@ -565,6 +626,7 @@ for (b = table[i]; b != 0; b = b->next) { register struct variable *v = b->variable; + /* If V is recursively expanded and didn't come from the environment, expand its value. If it came from the environment, it should go back into the environment unchanged. */ @@ -607,14 +669,11 @@ from a makefile, an override directive, the environment with or without the -e switch, or the command line. - A variable definition has the form "name = value" or "name := value". - Any whitespace around the "=" or ":=" is removed. The first form - defines a variable that is recursively re-evaluated. The second form - defines a variable whose value is variable-expanded at the time of - definition and then is evaluated only once at the time of expansion. + See the comments for parse_variable_definition(). - If a variable was defined, a pointer to its `struct variable' is returned. - If not, NULL is returned. */ + If LINE was recognized as a variable definition, a pointer to its `struct + variable' is returned. If LINE is not a variable definition, NULL is + returned. */ struct variable * try_variable_definition (filename, lineno, line, origin) @@ -627,7 +686,8 @@ register char *p = line; register char *beg; register char *end; - enum { bogus, simple, recursive, append } flavor = bogus; + enum { f_bogus, + f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus; char *name, *expanded_name, *value; struct variable *v; @@ -639,14 +699,14 @@ if (c == '=') { end = p - 1; - flavor = recursive; + flavor = f_recursive; break; } else if (c == ':') if (*p == '=') { end = p++ - 1; - flavor = simple; + flavor = f_simple; break; } else @@ -655,9 +715,15 @@ else if (c == '+' && *p == '=') { end = p++ - 1; - flavor = append; + flavor = f_append; break; } + else if (c == '?' && *p == '=') + { + end = p++ - 1; + flavor = f_conditional; + break; + } else if (c == '$') { /* This might begin a variable expansion reference. Make sure we @@ -700,31 +766,35 @@ expanded_name = allocated_variable_expand (name); if (expanded_name[0] == '\0') - { - if (filename == 0) - fatal ("empty variable name"); - else - makefile_fatal (filename, lineno, "empty variable name"); - } + makefile_fatal (filename, lineno, "empty variable name"); /* Calculate the variable's new value in VALUE. */ switch (flavor) { - case bogus: + case f_bogus: /* Should not be possible. */ abort (); - return 0; - case simple: + case f_simple: /* A simple variable definition "var := value". Expand the value. */ value = variable_expand (p); break; - case recursive: + case f_conditional: + /* A conditional variable definition "var ?= value". + The value is set IFF the variable is not defined yet. */ + v = lookup_variable(expanded_name, strlen(expanded_name)); + if (v) + { + free(expanded_name); + return v; + } + /* FALLTHROUGH */ + case f_recursive: /* A recursive variable definition "var = value". The value is used verbatim. */ value = p; break; - case append: + case f_append: /* An appending variable definition "var += value". Extract the old value and append the new one. */ v = lookup_variable (expanded_name, strlen (expanded_name)); @@ -733,7 +803,7 @@ /* There was no old value. This becomes a normal recursive definition. */ value = p; - flavor = recursive; + flavor = f_recursive; } else { @@ -744,7 +814,7 @@ if (v->recursive) /* The previous definition of the variable was recursive. The new value comes from the unexpanded old and new values. */ - flavor = recursive; + flavor = f_recursive; else /* The previous definition of the variable was simple. The new value comes from the old value, which was expanded @@ -791,7 +861,7 @@ *p = '/'; } v = define_variable (expanded_name, strlen (expanded_name), - shellpath, origin, flavor == recursive); + shellpath, origin, flavor == f_recursive); } else { @@ -831,7 +901,7 @@ *p = '/'; } v = define_variable (expanded_name, strlen (expanded_name), - shellpath, origin, flavor == recursive); + shellpath, origin, flavor == f_recursive); } else v = lookup_variable (expanded_name, strlen (expanded_name)); @@ -841,9 +911,26 @@ } else #endif /* __MSDOS__ */ +#ifdef WINDOWS32 + if (origin == o_file + && strcmp (expanded_name, "SHELL") == 0) { + extern char* default_shell; + + /* + * Call shell locator function. If it returns TRUE, then + * set no_default_sh_exe to indicate sh was found and + * set new value for SHELL variable. + */ + if (find_and_set_default_shell(value)) { + v = define_variable (expanded_name, strlen (expanded_name), + default_shell, origin, flavor == f_recursive); + no_default_sh_exe = 0; + } + } else +#endif v = define_variable (expanded_name, strlen (expanded_name), - value, origin, flavor == recursive); + value, origin, flavor == f_recursive); free (expanded_name); @@ -923,7 +1010,7 @@ /* Print all the variables in SET. PREFIX is printed before the actual variable definitions (everything else is comments). */ -static void +void print_variable_set (set, prefix) register struct variable_set *set; char *prefix; diff -uPr make-3.76.1/variable.h make-3.77/variable.h --- make-3.76.1/variable.h Wed Mar 20 09:57:44 1996 +++ make-3.77/variable.h Fri May 15 14:07:41 1998 @@ -43,7 +43,8 @@ origin ENUM_BITFIELD (3); /* Variable origin. */ unsigned int recursive:1; /* Gets recursively re-evaluated. */ unsigned int expanding:1; /* Nonzero if currently being expanded. */ - enum + unsigned int per_target:1; /* Nonzero if a target-specific variable. */ + enum variable_export { v_export, /* Export this variable. */ v_noexport, /* Don't export this variable. */ @@ -68,20 +69,22 @@ struct variable_set *set; /* Variable set. */ }; +extern char *variable_buffer; extern struct variable_set_list *current_variable_set_list; /* expand.c */ extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length)); extern char *variable_expand PARAMS ((char *line)); -extern char *variable_expand_for_file PARAMS ((char *line, struct file *file)); extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file)); #define allocated_variable_expand(line) \ allocated_variable_expand_for_file (line, (struct file *) 0) extern char *expand_argument PARAMS ((char *str, char *end)); +extern char *variable_expand_string PARAMS ((char *line, char *string, + long length)); /* function.c */ extern int handle_function PARAMS ((char **op, char **stringp)); -extern int pattern_matches PARAMS ((char *pattern, char *percent, char *word)); +extern int pattern_matches PARAMS ((char *pattern, char *percent, char *str)); extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace, unsigned int slen, unsigned int rlen, int by_word, int suffix_only)); extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace, @@ -91,17 +94,21 @@ extern char *recursively_expand PARAMS ((struct variable *v)); /* variable.c */ -extern void push_new_variable_scope PARAMS ((void)); +extern struct variable_set_list *create_new_variable_set PARAMS ((void)); +extern struct variable_set_list *push_new_variable_scope PARAMS ((void)); extern void pop_variable_scope PARAMS ((void)); extern void define_automatic_variables PARAMS ((void)); extern void initialize_file_variables PARAMS ((struct file *file)); extern void print_file_variables PARAMS ((struct file *file)); +extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix)); extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1)); extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin)); extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length)); extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value, enum variable_origin origin, int recursive)); +extern struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length, + char *value, enum variable_origin origin, int recursive, struct variable_set *set)); extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length, char *value, enum variable_origin origin, int recursive, struct file *file)); extern char **target_environment PARAMS ((struct file *file)); diff -uPr make-3.76.1/vmsfunctions.c make-3.77/vmsfunctions.c --- make-3.76.1/vmsfunctions.c Thu Jul 25 20:05:34 1996 +++ make-3.77/vmsfunctions.c Mon Mar 2 01:27:20 1998 @@ -1,7 +1,9 @@ -#define KDEBUG 0 /* vmsfunctions.c */ +#define KDEBUG 0 + #include +#include #include "make.h" #ifdef __DECC #include @@ -13,114 +15,147 @@ #include #include "vmsdir.h" -DIR *opendir(char *dspec) +#if __VMS_VER < 70000000 + +DIR * +opendir (dspec) + char *dspec; { static struct FAB *dfab; struct NAM *dnam; char *searchspec; - if ((dfab = (struct FAB *)xmalloc(sizeof (struct FAB))) == NULL) { - printf("Error mallocing for FAB\n"); - return(NULL); - } - if ((dnam = (struct NAM *)xmalloc(sizeof (struct NAM))) == NULL) { - printf("Error mallocing for NAM\n"); - free(dfab); - return(NULL); - } - if ((searchspec = (char *)xmalloc(MAXNAMLEN+1)) == NULL) { - printf("Error mallocing for searchspec\n"); - free(dfab); - free(dnam); - return(NULL); - } + dfab = (struct FAB *) xmalloc (sizeof (struct FAB)); + if (! dfab) + { + printf ("Error mallocing for FAB\n"); + return (NULL); + } - sprintf(searchspec,"%s*.*;",dspec); + dnam = (struct NAM *) xmalloc (sizeof (struct NAM)); + if (! dnam) + { + printf ("Error mallocing for NAM\n"); + free (dfab); + return (NULL); + } + + searchspec = (char *) xmalloc (MAXNAMLEN + 1); + if (! searchspec) + { + printf ("Error mallocing for searchspec\n"); + free (dfab); + free (dnam); + return (NULL); + } + + sprintf (searchspec, "%s*.*;", dspec); *dfab = cc$rms_fab; dfab->fab$l_fna = searchspec; - dfab->fab$b_fns = strlen(searchspec); + dfab->fab$b_fns = strlen (searchspec); dfab->fab$l_nam = dnam; *dnam = cc$rms_nam; dnam->nam$l_esa = searchspec; dnam->nam$b_ess = MAXNAMLEN; - if (!(sys$parse(dfab) & 1)) { - free(dfab); - free(dnam); - free(searchspec); - return(NULL); - } + if (! (sys$parse (dfab) & 1)) + { + free (dfab); + free (dnam); + free (searchspec); + return (NULL); + } - return(dfab); + return (dfab); } -#include -#define uppercasify(str) { char *tmp; for(tmp = (str); *tmp != '\0'; tmp++) if(islower(*tmp)) *tmp = toupper(*tmp); } - -struct direct *readdir(DIR *dfd) +#define uppercasify(str) \ + do \ + { \ + char *tmp; \ + for (tmp = (str); *tmp != '\0'; tmp++) \ + if (islower (*tmp)) \ + *tmp = toupper (*tmp); \ + } \ + while (0) + +struct direct * +readdir (dfd) + DIR * dfd; { static struct direct *dentry; - static char resultspec[MAXNAMLEN+1]; + static char resultspec[MAXNAMLEN + 1]; int i; - if ((dentry = (struct direct *)xmalloc(sizeof (struct direct))) == NULL) { - printf("Error mallocing for direct\n"); - return(NULL); - } + dentry = (struct direct *) xmalloc (sizeof (struct direct)); + if (! dentry) + { + printf ("Error mallocing for direct\n"); + return (NULL); + } dfd->fab$l_nam->nam$l_rsa = resultspec; dfd->fab$l_nam->nam$b_rss = MAXNAMLEN; if (debug_flag) - printf("."); + printf ("."); - if (!((i = sys$search(dfd)) & 1)) { - if (debug_flag) - printf("sys$search failed with %d\n", i); - free(dentry); - return(NULL); - } + if (!((i = sys$search (dfd)) & 1)) + { + if (debug_flag) + printf ("sys$search failed with %d\n", i); + free (dentry); + return (NULL); + } dentry->d_off = 0; if (dfd->fab$l_nam->nam$w_fid == 0) dentry->d_fileno = 1; - else dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0] - +dfd->fab$l_nam->nam$w_fid[1]<<16; + else + dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0] + + dfd->fab$l_nam->nam$w_fid[1] << 16; dentry->d_reclen = sizeof (struct direct); -/* - if (!strcmp(dfd->fab$l_nam->nam$l_type,".DIR")) +#if 0 + if (!strcmp(dfd->fab$l_nam->nam$l_type, ".DIR")) dentry->d_namlen = dfd->fab$l_nam->nam$b_name; else -*/ - dentry->d_namlen = dfd->fab$l_nam->nam$b_name+dfd->fab$l_nam->nam$b_type; - strncpy(dentry->d_name,dfd->fab$l_nam->nam$l_name,dentry->d_namlen); +#endif + dentry->d_namlen = dfd->fab$l_nam->nam$b_name + dfd->fab$l_nam->nam$b_type; + strncpy (dentry->d_name, dfd->fab$l_nam->nam$l_name, dentry->d_namlen); dentry->d_name[dentry->d_namlen] = '\0'; - uppercasify(dentry->d_name); -/* uvUnFixRCSSeparator(dentry->d_name);*/ + uppercasify (dentry->d_name); +#if 0 + uvUnFixRCSSeparator(dentry->d_name); +#endif - return(dentry); + return (dentry); } -closedir(DIR *dfd) +closedir (dfd) + DIR *dfd; { - if (dfd != NULL) { - if (dfd->fab$l_nam != NULL) - free(dfd->fab$l_nam->nam$l_esa); - free(dfd->fab$l_nam); - free(dfd); - } + if (dfd) + { + if (dfd->fab$l_nam) + free (dfd->fab$l_nam->nam$l_esa); + free (dfd->fab$l_nam); + free (dfd); + } } +#endif /* compiled for OpenVMS prior to V7.x */ -char *getwd(char *cwd) +char * +getwd (cwd) + char *cwd; { static char buf[512]; - if (cwd) - return(getcwd(cwd,512)); - else - return(getcwd(buf,512)); + if (cwd) + return (getcwd (cwd, 512)); + else + return (getcwd (buf, 512)); } int @@ -133,23 +168,33 @@ static struct FAB Fab; static struct NAM Nam; - static struct fibdef Fib; /* short fib */ + static struct fibdef Fib; /* short fib */ static struct dsc$descriptor FibDesc = - {sizeof(Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *)&Fib}; + { sizeof (Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *) &Fib }; static struct dsc$descriptor_s DevDesc = - {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1]}; + { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1] }; static char EName[NAM$C_MAXRSS]; static char RName[NAM$C_MAXRSS]; static struct dsc$descriptor_s FileName = - {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0}; + { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 }; static struct dsc$descriptor_s string = - {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0}; + { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 }; static unsigned long Rdate[2]; static unsigned long Cdate[2]; - static struct atrdef Atr[] = { - {sizeof(Rdate),ATR$C_REVDATE,&Rdate[0]}, /* Revision date */ - {sizeof(Cdate),ATR$C_CREDATE,&Cdate[0]}, /* Creation date */ - {0,0,0} + static struct atrdef Atr[] = + { +#if defined(VAX) + /* Revision date */ + { sizeof (Rdate), ATR$C_REVDATE, (unsigned int) &Rdate[0] }, + /* Creation date */ + { sizeof (Cdate), ATR$C_CREDATE, (unsigned int) &Cdate[0] }, +#else + /* Revision date */ + { sizeof (Rdate), ATR$C_REVDATE, &Rdate[0] }, + /* Creation date */ + { sizeof (Cdate), ATR$C_CREDATE, &Cdate[0]}, +#endif + { 0, 0, 0 } }; static short int DevChan; static short int iosb[4]; @@ -158,43 +203,43 @@ /* initialize RMS structures, we need a NAM to retrieve the FID */ Fab = cc$rms_fab; - Fab.fab$l_fna = name ; /* name of file */ - Fab.fab$b_fns = strlen(name); - Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */ - + Fab.fab$l_fna = name; /* name of file */ + Fab.fab$b_fns = strlen (name); + Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */ + Nam = cc$rms_nam; - Nam.nam$l_esa = EName; /* expanded filename */ - Nam.nam$b_ess = sizeof(EName); - Nam.nam$l_rsa = RName; /* resultant filename */ - Nam.nam$b_rss = sizeof(RName); + Nam.nam$l_esa = EName; /* expanded filename */ + Nam.nam$b_ess = sizeof (EName); + Nam.nam$l_rsa = RName; /* resultant filename */ + Nam.nam$b_rss = sizeof (RName); /* do $PARSE and $SEARCH here */ - status = sys$parse(&Fab); + status = sys$parse (&Fab); if (!(status & 1)) return -1; DevDesc.dsc$w_length = Nam.nam$t_dvi[0]; - status = sys$assign(&DevDesc,&DevChan,0,0); + status = sys$assign (&DevDesc, &DevChan, 0, 0); if (!(status & 1)) return -1; FileName.dsc$a_pointer = Nam.nam$l_name; - FileName.dsc$w_length = Nam.nam$b_name+Nam.nam$b_type+Nam.nam$b_ver; - + FileName.dsc$w_length = Nam.nam$b_name + Nam.nam$b_type + Nam.nam$b_ver; + /* Initialize the FIB */ - for (i=0;i<3;i++) + for (i = 0; i < 3; i++) { #if __DECC - Fib.fib$w_fid[i]=Nam.nam$w_fid[i]; - Fib.fib$w_did[i]=Nam.nam$w_did[i]; + Fib.fib$w_fid[i] = Nam.nam$w_fid[i]; + Fib.fib$w_did[i] = Nam.nam$w_did[i]; #else - Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i]; - Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i]; + Fib.fib$r_fid_overlay.fib$w_fid[i] = Nam.nam$w_fid[i]; + Fib.fib$r_did_overlay.fib$w_did[i] = Nam.nam$w_did[i]; #endif } - status = sys$qiow(0,DevChan,IO$_ACCESS,&iosb,0,0, - &FibDesc,&FileName,0,0,&Atr,0); + status = sys$qiow (0, DevChan, IO$_ACCESS, &iosb, 0, 0, + &FibDesc, &FileName, 0, 0, &Atr, 0); sys$dassgn (DevChan); if (!(status & 1)) return -1; @@ -206,30 +251,29 @@ if (status) return -1; - buf->st_mtime = ((Rdate[0]>>24) & 0xff) + ((Rdate[1]<<8) & 0xffffff00); - buf->st_ctime = ((Cdate[0]>>24) & 0xff) + ((Cdate[1]<<8) & 0xffffff00); + buf->st_mtime = ((Rdate[0] >> 24) & 0xff) + ((Rdate[1] << 8) & 0xffffff00); + buf->st_ctime = ((Cdate[0] >> 24) & 0xff) + ((Cdate[1] << 8) & 0xffffff00); + return 0; } char * -cvt_time(tval) - unsigned long tval; +cvt_time (tval) + unsigned long tval; { static long int date[2]; static char str[27]; static struct dsc$descriptor date_str = - {26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str}; + { 26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str }; date[0] = (tval & 0xff) << 24; - date[1] = ((tval>>8) & 0xffffff); + date[1] = ((tval >> 8) & 0xffffff); + + if ((date[0] == 0) && (date[1] == 0)) + return ("never"); - if ((date[0]==0) && (date[1]==0)) - return("never"); - - sys$asctim(0,&date_str,date,0); - str[26]='\0'; + sys$asctim (0, &date_str, date, 0); + str[26] = '\0'; - return(str); + return (str); } - -/* EOF */ diff -uPr make-3.76.1/vmsify.c make-3.77/vmsify.c --- make-3.76.1/vmsify.c Wed Aug 27 16:31:28 1997 +++ make-3.77/vmsify.c Mon Mar 2 01:39:49 1998 @@ -727,48 +727,21 @@ while (*fptr == '/'); } { /* got '..' or '../' */ - char cwdbuf[MAXPATHLEN+1]; + nstate = N_OPEN; + *vptr++ = '['; + while (count--) + *vptr++ = '-'; - s1 = getcwd(cwdbuf, MAXPATHLEN); - if (s1 == 0) + if (*fptr == 0) /* had '..' or '../' */ { - return ""; /* FIXME, err getcwd */ + *vptr++ = ']'; + state = -1; } - strcpy (vptr, s1); - s = strchr (vptr, ']'); - if (s != 0) + else /* had '../xxx' */ { - nstate = N_OPEN; - while (s > vptr) - { - s--; - if (*s == '[') - { - s++; - strcpy (s, "000000]"); - state = -1; - break; - } - else if (*s == '.') - { - if (--count == 0) - { - if (*fptr == 0) /* had '..' or '../' */ - { - *s++ = ']'; - state = -1; - } - else /* had '../xxx' */ - { - state = 9; - } - *s = 0; - break; - } - } - } + state = 9; } - vptr += strlen (vptr); + *vptr = 0; } break; @@ -782,34 +755,86 @@ fptr++; } - { - char cwdbuf[MAXPATHLEN+1]; + if (*fptr) + { + state = 9; - s1 = getcwd(cwdbuf, MAXPATHLEN); - if (s1 == 0) - { - return ""; /*FIXME, err getcwd */ - } - strcpy (vptr, s1); - if (*fptr == 0) - { - state = -1; - break; - } - else - { - s = strchr (vptr, ']'); - if (s == 0) - { - state = -1; - break; - } - *s = 0; - nstate = N_OPEN; - vptr += strlen (vptr); - state = 9; - } - } + switch (type) + { + case 0: + nstate = N_CLOSED; + *vptr++ = '['; + *vptr++ = ']'; + break; + + case 1: + nstate = N_OPEN; + *vptr++ = '['; + break; + + case 2: + nstate = N_CLOSED; + break; + } + } + else + { + if (type == 1) + { + *vptr++ = '['; + *vptr++ = ']'; + state = -1; + } + else + { + char cwdbuf[MAXPATHLEN+1]; + + s1 = getcwd(cwdbuf, MAXPATHLEN); + if (s1 == 0) + { + return "foo"; /*FIXME, err getcwd */ + } + strcpy (vptr, s1); + vptr += strlen (vptr); + + if (type == 2) + { + s = vptr; + while (s > vmsname) + { + if (*s == '.') + { + *s = ']'; + vptr--; + break; + } + + if (*s == '[') + { + int i; + char *t = vptr - 2; + while (t > s) + { + *(t+7) = *t; + t--; + } + s++; + for (i = 0; i < 6; i++) + *s++ = '0'; + *s = ']'; + vptr += 6; + break; + } + s--; + } + + strcpy (vptr, ".dir"); + vptr += 4; + } + + state = -1; + } + } break; } diff -uPr make-3.76.1/vpath.c make-3.77/vpath.c --- make-3.76.1/vpath.c Wed Aug 27 16:31:29 1997 +++ make-3.77/vpath.c Fri Jul 10 00:06:40 1998 @@ -164,7 +164,7 @@ register char **vpath; register unsigned int maxvpath; unsigned int maxelem; - char *percent; + char *percent = NULL; if (pattern != 0) { diff -uPr make-3.76.1/w32/subproc/NMakefile make-3.77/w32/subproc/NMakefile --- make-3.76.1/w32/subproc/NMakefile Wed Aug 27 16:34:30 1997 +++ make-3.77/w32/subproc/NMakefile Mon Mar 2 03:38:07 1998 @@ -27,7 +27,7 @@ OUTDIR=. MAKEFILE=NMakefile -CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include +CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../.. CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/ CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/ @@ -40,6 +40,7 @@ clean: rmdir /s /q WinRel WinDebug + erase *.pdb $(OUTDIR): if not exist .\$@\nul mkdir .\$@ diff -uPr make-3.76.1/w32/subproc/build.bat make-3.77/w32/subproc/build.bat --- make-3.76.1/w32/subproc/build.bat Wed Aug 27 16:34:30 1997 +++ make-3.77/w32/subproc/build.bat Mon Mar 2 03:25:46 1998 @@ -1,10 +1,10 @@ if not exist .\WinDebug\nul mkdir .\WinDebug cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c -cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c +cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj if not exist .\WinRel\nul mkdir .\WinRel cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c -cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c +cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj diff -uPr make-3.76.1/w32/subproc/sub_proc.c make-3.77/w32/subproc/sub_proc.c --- make-3.76.1/w32/subproc/sub_proc.c Wed Aug 27 16:34:31 1997 +++ make-3.77/w32/subproc/sub_proc.c Mon Mar 2 03:43:51 1998 @@ -6,6 +6,7 @@ #include "sub_proc.h" #include "proc.h" #include "w32err.h" +#include "config.h" static char *make_command_line( char *shell_name, char *exec_path, char **argv); @@ -889,170 +890,224 @@ /* - * Try to protect against WINDOWS32 argument munging. This function takes - * an argv vector and outputs a 'protected' string as a return - * value. The return code can be safely passed to CreateProcess(). + * Description: + * Create a command line buffer to pass to CreateProcess + * + * Returns: the buffer or NULL for failure + * Shell case: sh_name a:/full/path/to/script argv[1] argv[2] ... + * Otherwise: argv[0] argv[1] argv[2] ... * - * The caller should free the return value. + * Notes/Dependencies: + * CreateProcess does not take an argv, so this command creates a + * command line for the executable. */ -#define TRACE(x) -static char *fix_command_line(char *args[]) +static char * +make_command_line( char *shell_name, char *full_exec_path, char **argv) { - int i; - char *narg; - char *nargp; - char *p; - char *q; - int alloc_len = 0; - - for (i = 0; args[i]; i++) - alloc_len += ((strlen(args[i]) * 2) + 1); - /* account for possible enclosing quotes and null termination */ - alloc_len += 3; - - nargp = narg = malloc(alloc_len); - - for (i = 0; args[i]; i++) { - p = args[i]; - TRACE(("original arg: %s\n", p)); - - if (*p == '\0') { - *nargp++ = '"'; - *nargp++ = '"'; - *nargp = '\0'; - TRACE(("empty string arg: %s\n", nargp-2)); - } else if (strpbrk(p, "\" \t")) { - /* point to end of copy buffer */ - q = narg; - q += (alloc_len-1); - *q-- = '\0'; /* ensure null terminated string */ - *q-- = '"'; /* terminating quote of argument */ - - /* point to end of the input string */ - p = args[i]; - p += strlen(args[i]); - p--; - - /* - * Because arg is quoted, escape any backslashes - * that might occur at the end of the string which - * proceed the closing quote. - * Example: - * foo c:\ - * Becomes: - * "foo c:\\" - */ - while (*p == '\\') - *q-- = *p--, *q-- = '\\'; + int argc = 0; + char** argvi; + int* enclose_in_quotes = NULL; + int* enclose_in_quotes_i; + unsigned int bytes_required = 0; + char* command_line; + char* command_line_i; + + if (shell_name && full_exec_path) { + bytes_required + = strlen(shell_name) + 1 + strlen(full_exec_path); + /* + * Skip argv[0] if any, when shell_name is given. + */ + if (*argv) argv++; + /* + * Add one for the intervening space. + */ + if (*argv) bytes_required++; + } + + argvi = argv; + while (*(argvi++)) argc++; + + if (argc) { + enclose_in_quotes = (int*) calloc(1, argc * sizeof(int)); + + if (!enclose_in_quotes) { + return NULL; + } + } - /* copy the string in reverse */ - while (p >= args[i]) { - /* copy the character */ - *q-- = *p--; - - /* - * Escape any double quote found. Also escape - * each backslash preceding the double quote. + /* We have to make one pass through each argv[i] to see if we need + * to enclose it in ", so we might as well figure out how much + * memory we'll need on the same pass. + */ + + argvi = argv; + enclose_in_quotes_i = enclose_in_quotes; + while(*argvi) { + char* p = *argvi; + unsigned int backslash_count = 0; + + /* + * We have to enclose empty arguments in ". + */ + if (!(*p)) *enclose_in_quotes_i = 1; + + while(*p) { + switch (*p) { + case '\"': + /* + * We have to insert a backslash for each " + * and each \ that precedes the ". */ - if (*(p+1) == '"') { - *q-- = '\\'; - if (p >= args[i] && *p == '\\') - while (p >= args[i] && *p == '\\') - *q-- = *p--, *q-- = '\\'; - } + bytes_required += (backslash_count + 1); + backslash_count = 0; + break; + + case '\\': + backslash_count++; + break; + /* + * At one time we set *enclose_in_quotes_i for '*' or '?' to suppress + * wildcard expansion in programs linked with MSVC's SETARGV.OBJ so + * that argv in always equals argv out. This was removed. Say you have + * such a program named glob.exe. You enter + * glob '*' + * at the sh command prompt. Obviously the intent is to make glob do the + * wildcarding instead of sh. If we set *enclose_in_quotes_i for '*' or '?', + * then the command line that glob would see would be + * glob "*" + * and the _setargv in SETARGV.OBJ would _not_ expand the *. + */ + case ' ': + case '\t': + *enclose_in_quotes_i = 1; + /* fall through */ + + default: + backslash_count = 0; + break; } + + /* + * Add one for each character in argv[i]. + */ + bytes_required++; - /* finish quoting arg, q now points to complete arg */ - *q = '"'; + p++; + } - /* rejustify */ - memmove(nargp, q, strlen(q) + 1); - TRACE(("arg with white space or doublequotes: %s\n", nargp)); - nargp += strlen(nargp); - } else { - /* just copy the argument, no protection needed */ - strcpy(nargp, args[i]); - TRACE(("plain arg: %s\n", nargp)); - nargp += strlen(nargp); + if (*enclose_in_quotes_i) { + /* + * Add one for each enclosing ", + * and one for each \ that precedes the + * closing ". + */ + bytes_required += (backslash_count + 2); } + + /* + * Add one for the intervening space. + */ + if (*(++argvi)) bytes_required++; + enclose_in_quotes_i++; + } - /* separate arguments with spaces (if more args to gather) */ - if (args[i+1]) - *nargp++ = ' '; - *nargp = '\0'; - } /* end for */ + /* + * Add one for the terminating NULL. + */ + bytes_required++; - /* NULL terminate the arg list */ - *nargp = '\0'; + command_line = (char*) malloc(bytes_required); - return (narg); -} -#undef TRACE + if (!command_line) { + if (enclose_in_quotes) free(enclose_in_quotes); + return NULL; + } -/* - * Description: - * Create a command line buffer to pass to CreateProcess - * - * Returns: the buffer or NULL for failure - * Shell case: sh_name a:/full/path/to/script argv[1] argv[2] ... - * Otherwise: argv[0] argv[1] argv[2] ... - * - * Notes/Dependencies: - * CreateProcess does not take an argv, so this command creates a - * command line for the executable. - */ + command_line_i = command_line; -static char * -make_command_line( char *shell_name, char *exec_path, char **argv) -{ - char** nargv; - char* buf; - int i; - char** shargv = NULL; - char* p = NULL; - char* q = NULL; - int j = 0; - - if (shell_name) { - /* handle things like: #!/bin/sh -x */ + if (shell_name && full_exec_path) { + while(*shell_name) { + *(command_line_i++) = *(shell_name++); + } - /* count tokens */ - q = strdup(shell_name); - for (j = 0, p = q; (p = strtok(p, " \t")) != NULL; p = NULL, j++); - free(q); - - /* copy tokens */ - q = strdup(shell_name); - shargv = (char **) malloc((j+1) * sizeof (char *)); - for (j = 0, p = q; (p = strtok(p, " \t")) != NULL; p = NULL, j++) - shargv[j] = strdup(p); - shargv[j] = NULL; - free(q); - - /* create argv */ - for (i = 0; argv[i]; i++); - i += (j+1); - nargv = (char **) malloc(i * sizeof (char *)); - for (i = 0; shargv[i] != NULL; i++) - nargv[i] = shargv[i]; - for (j = 0; argv[j]; j++, i++) - nargv[i] = argv[j]; - nargv[i] = NULL; - } else - nargv = argv; + *(command_line_i++) = ' '; - /* create string suitable for CreateProcess() */ - buf = fix_command_line(nargv); + while(*full_exec_path) { + *(command_line_i++) = *(full_exec_path++); + } - if (shell_name) { - for (j = 0; shargv[j]; j++) - free(shargv[j]); - free(shargv); - free(nargv); + if (*argv) { + *(command_line_i++) = ' '; + } } - - return buf; + + argvi = argv; + enclose_in_quotes_i = enclose_in_quotes; + + while(*argvi) { + char* p = *argvi; + unsigned int backslash_count = 0; + + if (*enclose_in_quotes_i) { + *(command_line_i++) = '\"'; + } + + while(*p) { + if (*p == '\"') { + /* + * We have to insert a backslash for the " + * and each \ that precedes the ". + */ + backslash_count++; + + while(backslash_count) { + *(command_line_i++) = '\\'; + backslash_count--; + }; + + } else if (*p == '\\') { + backslash_count++; + } else { + backslash_count = 0; + } + + /* + * Copy the character. + */ + *(command_line_i++) = *(p++); + } + + if (*enclose_in_quotes_i) { + /* + * Add one \ for each \ that precedes the + * closing ". + */ + while(backslash_count--) { + *(command_line_i++) = '\\'; + }; + + *(command_line_i++) = '\"'; + } + + /* + * Append an intervening space. + */ + if (*(++argvi)) { + *(command_line_i++) = ' '; + } + + enclose_in_quotes_i++; + } + + /* + * Append the terminating NULL. + */ + *command_line_i = '\0'; + + if (enclose_in_quotes) free(enclose_in_quotes); + return command_line; } /*