This file contains diffs from version 3.68 of GNU Make to version 3.69. Changes in files that are generated by etags and TeX have been omitted. diff -ruN make-3.68/ChangeLog make-3.69/ChangeLog --- make-3.68/ChangeLog Wed Jul 28 17:41:31 1993 +++ make-3.69/ChangeLog Sun Nov 7 08:07:45 1993 @@ -1,3 +1,233 @@ +Sun Nov 7 08:07:37 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.69. + +Wed Nov 3 06:54:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.10. + + * implicit.c (try_implicit_rule): Look for a normal rule before an + archive rule. + +Fri Oct 29 16:45:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * function.c (expand_function: `sort'): Double NWORDS when it + overflows, instead of adding five. + + * compatMakefile (clean): Remove loadavg. + +Wed Oct 27 17:58:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.9. + + * file.h (NEW_MTIME): Define new macro. + * main.c (main): Set time of NEW_FILES to NEW_MTIME, not to + current time returned from system. Removed variable NOW. + * remake.c (notice_finished_file): Use NEW_MTIME in place of + current time here too. + +Tue Oct 26 19:45:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.8. + + * remake.c (update_file_1): Don't clear MUST_MAKE when FILE has no + cmds and !DEPS_CHANGED unless also !NOEXIST. + +Mon Oct 25 15:25:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * read.c (parse_file_seq): When converting multi-word archive + refs, ignore a word beginning with a '('. + +Fri Oct 22 02:53:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * configure.in: Check for sys/timeb.h. + * make.h [HAVE_SYS_TIMEB_H]: Test this before including it. + +Thu Oct 21 16:48:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.7. + + * rule.c (convert_suffix_rule): New local TARGPERCENT. Set it to + TARGNAME+1 for "(%.o)", to TARGNAME for "%.?". Use it in place of + TARGNAME to initialize PERCENTS[0]. + +Mon Oct 18 06:49:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * configure.in: Use AC_HAVE_HEADERS(unistd.h) instead of AC_UNISTD_H. + Remove AC_USG; it is no longer used. + + * file.c (print_file): New function, broken out of + print_file_data_base. + (print_file_data_base): Call it. + * rule.c (print_rule): New function, broken out of + print_rule_data_base. + (print_rule_data_base): Call it. + +Thu Oct 14 14:54:03 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * default.c (install_default_suffix_rules): New function, broken + out of install_default_implicit_rules. + (install_default_implicit_rules): Move suffix rule code there. + * make.h: Declare install_default_suffix_rules. + * main.c (main): Call install_default_suffix_rules before reading + makefiles. Move convert_to_pattern call before + install_default_implicit_rules. + + * job.h (struct child): Make `pid' member type `pid_t' instead of + `int'. + + * compatMakefile (RANLIB): New variable, set by configure. + (glob/libglob.a): Pass RANLIB value down to submake. + + Fixes for SCO 3.2 "devsys 4.2" from pss@tfn.com (Peter Salvitti). + * make.h: Include before for SCO lossage. + * job.c [! getdtablesize] [! HAVE_GETDTABLESIZE]: If NOFILE is not + defined but NOFILES_MAX is, define it to be that. + +Mon Oct 11 19:47:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * GNUmakefile (make-$(version).tar): Depend on acconfig.h, so it + is distributed. + +Sun Oct 3 15:15:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * default.c (default_terminal_rules): Add `-G $@' to SCCS get cmds. + +Tue Sep 28 14:18:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * job.c (construct_command_argv_internal): Add ^ to SH_CHARS; it + is another symbol for | in some shells. + * main.c (main): Add it to CMD_DEFS quoting list as well. + +Mon Sep 20 18:05:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * job.c (construct_command_argv_internal): Remove '=' from + SH_CHARS. Only punt on '=' if it is unquoted in a word before the + first word without an unquoted '='. + + * main.c (define_makeflags): Set v_export for MAKEFLAGS. + +Fri Sep 17 00:37:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * remake.c (update_file_1): Use .DEFAULT cmds for phony targets. + + * make.h [_AIX && _POSIX_SOURCE]: Define POSIX. + + * commands.c (delete_child_targets): Don't delete phony files. + + * job.c (start_job_command): Set COMMANDS_RECURSE in FLAGS if we + see a `+' at the beginning of the command line. + +Thu Sep 9 17:57:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.6. + +Wed Sep 8 20:14:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * main.c (define_makeflags): Define MAKEFLAGS with o_file, not o_env. + +Mon Aug 30 12:31:58 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * expand.c (variable_expand): Fatal on an unterminated reference. + +Thu Aug 19 16:27:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.5. + + * variable.c (define_automatic_variables): Define new o_default + variable `MAKE_VERSION' from version_string and remote_description. + + * make.h (version_string, remote_description): Declare these here. + * main.c: Don't declare version_string. + (print_version): Don't declare remote_description. + +Wed Aug 18 15:01:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * read.c (read_makefile): Free space pointed to by CONDITIONALS + before restoring the old pointer. + +Mon Aug 16 17:33:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * compatMakefile ($(objs)): Depend on config.h. + + * GNUmakefile (build.sh.in): Depend on compatMakefile. + + * configure.in: Touch stamp-config after AC_OUTPUT. + +Fri Aug 13 16:04:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.4. + +Thu Aug 12 17:18:57 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * make.h: Include instead of "config.h". + +Wed Aug 11 02:35:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * main.c (main): Make all variables interned from ENVP be v_export. + * variable.c (try_variable_definition): In v_default case, don't + check for an o_file variable that `getenv' finds. + + * job.c (reap_children): New local variable ANY_LOCAL; set it + while setting ANY_REMOTE. If !ANY_LOCAL, don't wait for local kids. + + * main.c (main): Don't call decode_env_switches on MFLAGS. DOC THIS. + + * function.c (expand_function): #if 0 out freeing of ENVP since it + is environ. + +Mon Aug 9 17:37:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.3. + + * remote-stub.c (remote_status): Set errno to ECHILD before return. + * job.c (reap_children): Scan the chain for remote children and + never call remote_status if there are none. + + * function.c (expand_function: `shell'): #if 0 out calling + target_environment; just set ENVP to environ instead. + + * job.c (reap_children): Check for negative return from + remote_status and fatal for it. + When blocking local child wait returns 0, then try a blocking call + to remote_status. + +Tue Aug 3 00:19:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * compatMakefile (clean): Delete make.info* and make.dvi here. + (distclean): Not here. + + * dep.h (RM_*): Use #defines instead of enum to avoid lossage from + compilers that don't like enum values used as ints. + +Mon Aug 2 16:46:34 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * compatMakefile (loadavg): Add $(LOADLIBES). + +Sun Aug 1 16:01:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.2. + + * compatMakefile (loadavg, check-loadavg): New targets. + (check): Depend on check-loadavg. + + * compatMakefile (glob/libglob.a): Depend on config.h. + + * misc.c (log_access): Write to stderr instead of stdout. + +Fri Jul 30 00:07:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Version 3.68.1. + +Thu Jul 29 23:26:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * configure.in (SYS_SIGLIST_DECLARED): In test program include + #ifdef HAVE_UNISTD_H. + + * compatMakefile (.PHONY): Put after `all' et al. + + * configure.in: Add AC_IRIX_SUN. + Wed Jul 28 17:41:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * Version 3.68. diff -ruN make-3.68/INSTALL make-3.69/INSTALL --- make-3.68/INSTALL Fri May 14 19:31:53 1993 +++ make-3.69/INSTALL Wed Sep 15 19:05:10 1993 @@ -1,15 +1,8 @@ -This is a generic INSTALL file for utilities distributions. + This is a generic INSTALL file for utilities distributions. If this package does not come with, e.g., installable documentation or data files, please ignore the references to them below. -To compile this package: - -1. Configure the package for your system. In the directory that this -file is in, type `./configure'. If you're using `csh' on an old -version of System V, you might need to type `sh configure' instead to -prevent `csh' from trying to execute `configure' itself. - -The `configure' shell script attempts to guess correct values for + The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation, and creates the Makefile(s) (one in each subdirectory of the source directory). In some packages it creates a C header file containing @@ -16,79 +9,86 @@ system-dependent definitions. It also creates a file `config.status' that you can run in the future to recreate the current configuration. -Running `configure' takes a minute or two. While it is running, it +To compile this package: + +1. Configure the package for your system. + + Normally, you just `cd' to the directory containing the package's +source code and type `./configure'. If you're using `csh' on an old +version of System V, you might need to type `sh configure' instead to +prevent `csh' from trying to execute `configure' itself. + + Running `configure' takes a minute or two. While it is running, it prints some messages that tell what it is doing. If you don't want to see the messages, run `configure' with its standard output redirected to `/dev/null'; for example, `./configure >/dev/null'. -To compile the package in a different directory from the one + To compile the package in a different directory from the one containing the source code, you must use a version of `make' that -supports the VPATH variable, such as GNU `make'. `cd' to the directory -where you want the object files and executables to go and run -`configure'. `configure' automatically checks for the source code in -the directory that `configure' is in and in `..'. If for some reason -`configure' is not in the source code directory that you are -configuring, then it will report that it can't find the source code. -In that case, run `configure' with the option `--srcdir=DIR', where -DIR is the directory that contains the source code. - -By default, `make install' will install the package's files in -/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify an -installation prefix other than /usr/local by giving `configure' the option -`--prefix=PATH'. Alternately, you can do so by consistently giving a value -for the `prefix' variable when you run `make', e.g., - make prefix=/usr/gnu - make prefix=/usr/gnu install - -You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If -you give `configure' the option `--exec-prefix=PATH' or set the -`make' variable `exec_prefix' to PATH, the package will use PATH as -the prefix for installing programs and libraries. Data files and -documentation will still use the regular prefix. Normally, all files -are installed using the regular prefix. - -Another `configure' option is useful mainly in `Makefile' rules for -updating `config.status' and `Makefile'. The `--no-create' option -figures out the configuration for your system and records it in -`config.status', without actually configuring the package (creating -`Makefile's and perhaps a configuration header file). Later, you can -run `./config.status' to actually configure the package. You can also -give `config.status' the `--recheck' option, which makes it re-run -`configure' with the same arguments you used before. This option is -useful if you change `configure'. - -Some packages pay attention to `--with-PACKAGE' options to `configure', -where PACKAGE is something like `gnu-libc' or `x' (for the X Window System). -The README should mention any --with- options that the package recognizes. - -`configure' ignores any other arguments that you give it. - -If your system requires unusual options for compilation or linking -that `configure' doesn't know about, you can give `configure' initial -values for some variables by setting them in the environment. In -Bourne-compatible shells, you can do that on the command line like -this: - CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure - -The `make' variables that you might want to override with environment -variables when running `configure' are: - -(For these variables, any value given in the environment overrides the -value that `configure' would choose:) -CC C compiler program. - Default is `cc', or `gcc' if `gcc' is in your PATH. -INSTALL Program to use to install files. - Default is `install' if you have it, `cp' otherwise. - -(For these variables, any value given in the environment is added to -the value that `configure' chooses:) -DEFS Configuration options, in the form `-Dfoo -Dbar ...' - Do not use this variable in packages that create a - configuration header file. -LIBS Libraries to link with, in the form `-lfoo -lbar ...' +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. If +for some reason `configure' is not in the source code directory that +you are configuring, then it will report that it can't find the source +code. In that case, run `configure' with the option `--srcdir=DIR', +where DIR is the directory that contains the source code. + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. Alternately, you can do so by consistently +giving a value for the `prefix' variable when you run `make', e.g., + make prefix=/usr/gnu + make prefix=/usr/gnu install + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH' or set the `make' +variable `exec_prefix' to PATH, the package will use PATH as the prefix +for installing programs and libraries. Data files and documentation +will still use the regular prefix. Normally, all files are installed +using the same prefix. + + Some packages pay attention to `--with-PACKAGE' options to +`configure', where PACKAGE is something like `gnu-as' or `x' (for the X +Window System). The README should mention any `--with-' options that +the package recognizes. + + `configure' ignores any other arguments that you give it. + + On systems that require unusual options for compilation or linking +that the package's `configure' script does not know about, you can give +`configure' initial values for variables by setting them in the +environment. In Bourne-compatible shells, you can do that on the +command line like this: + + CC='gcc -traditional' LIBS=-lposix ./configure + + Here are the `make' variables that you might want to override with +environment variables when running `configure'. + + For these variables, any value given in the environment overrides the +value that `configure' would choose: + + - Variable: CC + C compiler program. The default is `cc'. + + - Variable: INSTALL + Program to use to install files. The default is `install' if you + have it, `cp' otherwise. + + For these variables, any value given in the environment is added to +the value that `configure' chooses: + + - Variable: DEFS + Configuration options, in the form `-Dfoo -Dbar...'. Do not use + this variable in packages that create a configuration header file. + + - Variable: LIBS + Libraries to link with, in the form `-lfoo -lbar...'. -If you need to do unusual things to compile the package, we encourage + If you need to do unusual things to compile the package, we encourage you to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the README so we can include them in the next release. @@ -113,6 +113,6 @@ (if the package uses one), and `config.status' (all the files that `configure' created), type `make distclean'. -The file `configure.in' is used as a template to create `configure' by -a program called `autoconf'. You will only need it if you want to -regenerate `configure' using a newer version of `autoconf'. + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need it if you want to regenerate +`configure' using a newer version of `autoconf'. diff -ruN make-3.68/Makefile.in make-3.69/Makefile.in --- make-3.68/Makefile.in Wed Jul 28 17:45:01 1993 +++ make-3.69/Makefile.in Sun Nov 7 08:09:57 1993 @@ -31,6 +31,9 @@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ +# How to invoke ranlib. This is only used by the `glob' subdirectory. +RANLIB = @RANLIB@ + # Define these for your system as follows: # -DNO_ARCHIVES To disable `ar' archive support. # -DNO_FLOAT To avoid using floating-point numbers. @@ -137,11 +140,12 @@ .SUFFIXES: .SUFFIXES: .o .c .h .ps .dvi .info .texinfo -.PHONY: all check info dvi all: make check: # No tests. info: make.info dvi: make.dvi +# Some makes apparently use .PHONY as the default goal is it is before `all'. +.PHONY: all check info dvi make.info: make.texinfo $(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info @@ -165,11 +169,12 @@ SHELL = /bin/sh MAKE = make -glob/libglob.a: force +glob/libglob.a: FORCE config.h cd glob; $(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -I..' \ CPPFLAGS='$(CPPFLAGS) -DHAVE_CONFIG_H' \ + RANLIB='$(RANLIB)' \ libglob.a -force: +FORCE: tagsrcs = $(srcs) $(srcdir)/remote-*.c TAGS: $(tagsrcs) @@ -211,7 +216,9 @@ # Run install-info only if it exists. # Use `if' instead of just prepending `-' to the # line so we notice real errors from install-info. - if install-info --version >/dev/null 2>&1; then \ +# We use `$(SHELL) -c' because some shells do not +# fail gracefully when there is an unknown command. + if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ install-info --infodir=$(infodir) $$d/foo.info; \ else true; fi @@ -218,12 +225,24 @@ $(mandir)/$(instname).$(manext): make.man $(INSTALL_DATA) $(srcdir)/make.man $@ + +loadavg: getloadavg.c config.h + $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \ + $(srcdir)/getloadavg.c $(LOADLIBES) -o $@ +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: check-loadavg + + .PHONY: clean realclean distclean mostlyclean clean: glob-clean - -rm -f make *.o core + -rm -f make loadavg *.o core make.info* make.dvi distclean: clean glob-realclean -rm -f Makefile config.h config.status build.sh stamp-config - -rm -f TAGS tags make.info* make.dvi + -rm -f TAGS tags -rm -f make.?? make.??s make.log make.toc make.*aux realclean: distclean mostlyclean: clean @@ -247,24 +266,27 @@ # This tells versions [3.59,3.63) of GNU make not to export all variables. .NOEXPORT: +# 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 config.h dep.h commands.h file.h variable.h \ - job.h -job.o : job.c make.h config.h commands.h job.h file.h variable.h +commands.o : commands.c make.h dep.h commands.h file.h variable.h job.h +job.o : job.c make.h commands.h job.h file.h variable.h dir.o : dir.c make.h config.h -file.o : file.c make.h config.h commands.h dep.h file.h variable.h -main.o : main.c make.h config.h commands.h dep.h file.h variable.h job.h \ - getopt.h -read.o : read.c make.h config.h commands.h dep.h file.h variable.h glob/glob.h -remake.o : remake.c make.h config.h commands.h job.h dep.h file.h -rule.o : rule.c make.h config.h commands.h dep.h file.h variable.h rule.h -implicit.o : implicit.c make.h config.h rule.h dep.h file.h -default.o : default.c make.h config.h rule.h dep.h file.h commands.h variable.h -variable.o : variable.c make.h config.h commands.h variable.h dep.h file.h -expand.o : expand.c make.h config.h commands.h file.h variable.h -function.o : function.c make.h config.h variable.h dep.h commands.h job.h +file.o : file.c make.h commands.h dep.h file.h variable.h +misc.o : misc.c make.h config.h dep.h +read.o : read.c make.h commands.h dep.h file.h variable.h glob/glob.h +remake.o : remake.c make.h commands.h job.h dep.h file.h +rule.o : rule.c make.h commands.h dep.h file.h variable.h rule.h +implicit.o : implicit.c make.h rule.h dep.h file.h +default.o : default.c make.h rule.h dep.h file.h commands.h variable.h +variable.o : variable.c make.h commands.h variable.h dep.h file.h +expand.o : expand.c make.h commands.h file.h variable.h +function.o : function.c make.h variable.h dep.h commands.h job.h vpath.o : vpath.c make.h config.h file.h variable.h version.o : version.c ar.o : ar.c make.h config.h file.h dep.h diff -ruN make-3.68/NEWS make-3.69/NEWS --- make-3.68/NEWS Wed Jul 14 22:33:13 1993 +++ make-3.69/NEWS Wed Nov 3 07:46:19 1993 @@ -1,4 +1,4 @@ -GNU make NEWS -- history of user-visible changes. 14 July 1993 +GNU make NEWS -- history of user-visible changes. 3 November 1993 Copyright (C) 1992, 1993 Free Software Foundation, Inc. See the end for copying conditions. @@ -5,6 +5,36 @@ Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu. +Version 3.69 + +* Implicit rule search for archive member references is now done in the + opposite order from previous versions: the whole target name `LIB(MEM)' + first, and just the member name and parentheses `(MEM)' second. + +* Make now gives an error for an unterminated variable or function reference. + For example, `$(foo' with no matching `)' or `${bar' with no matching `}'. + +* The new default variable `MAKE_VERSION' gives the version number of + Make, and a string describing the remote job support compiled in (if any). + Thus the value (in this release) is something like `3.69' or `3.69-Customs'. + +* Commands in an invocation of the `shell' function are no longer run with + a modified environment like target commands are. As in versions before + 3.68, they now run with the environment that `make' started with. We + have reversed the change made in version 3.68 because it turned out to + cause a paradoxical situation in cases like: + + export variable = $(shell echo value) + + When Make attempted to put this variable in the environment for a target + command, it would try expand the value by running the shell command + `echo value'. In version 3.68, because it constructed an environment + for that shell command in the same way, Make would begin to go into an + infinite loop and then get a fatal error when it detected the loop. + +* The commands given for `.DEFAULT' are now used for phony targets with no + commands. + Version 3.68 * You can list several archive member names inside parenthesis: @@ -33,7 +63,7 @@ Version 3.66 -* The `make --version' (or `make -v') now exits immediately after printing +* `make --version' (or `make -v') now exits immediately after printing the version number. Version 3.65 diff -ruN make-3.68/README make-3.69/README --- make-3.68/README Wed Jul 28 17:44:30 1993 +++ make-3.69/README Sun Nov 7 08:09:49 1993 @@ -1,4 +1,4 @@ -This directory contains the 3.68 test release of GNU Make. +This directory contains the 3.69 test release of GNU Make. All bugs reported for previous test releases have been fixed. Some bugs surely remain. @@ -13,6 +13,12 @@ It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such that if you compile make with `cc -O' on AIX 3.2, it will not work correctly. It is said that using `cc' without `-O' does work. + +One area that is often a problem in configuration and porting is the code +to check the system's current load average. To make it easier to test and +debug this code, you can do `make check-loadavg' to see if it works +properly on your system. (You must run `configure' beforehand, but you +need not build Make itself to run this test.) See the file NEWS for what has changed since previous releases. diff -ruN make-3.68/acconfig.h make-3.69/acconfig.h --- make-3.68/acconfig.h +++ make-3.69/acconfig.h Thu Apr 15 20:51:27 1993 @@ -0,0 +1,2 @@ +/* Define to the name of the SCCS `get' command. */ +#undef SCCS_GET diff -ruN make-3.68/alloca.c make-3.69/alloca.c --- make-3.68/alloca.c Tue Jul 13 12:37:01 1993 +++ make-3.69/alloca.c Mon Sep 20 16:03:30 1993 @@ -22,10 +22,18 @@ your main control loop, etc. to force garbage collection. */ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +#include +#else #include "config.h" #endif +#endif + +/* If compiling with GCC 2, this file's not needed. */ +#if !defined (__GNUC__) || __GNUC__ < 2 -/* If compiling with GCC, this file's not needed. */ +/* If someone has defined alloca as a macro, + there must be some other way alloca is supposed to work. */ #ifndef alloca #ifdef emacs @@ -72,8 +80,8 @@ #ifndef emacs #define malloc xmalloc -extern pointer xmalloc (); #endif +extern pointer malloc (); /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically @@ -473,3 +481,4 @@ #endif /* CRAY */ #endif /* no alloca */ +#endif /* not GCC version 2 */ diff -ruN make-3.68/commands.c make-3.69/commands.c --- make-3.68/commands.c Thu May 6 17:30:42 1993 +++ make-3.69/commands.c Fri Sep 17 00:46:36 1993 @@ -409,8 +409,8 @@ if (child->deleted) return; - /* Delete the file unless it's precious. */ - if (!child->file->precious + /* Delete the file unless it's precious or not actually a file (phony). */ + if (!child->file->precious && !child->file->phony && stat (child->file->name, &st) == 0 && S_ISREG (st.st_mode) && (time_t) st.st_mtime != child->file->last_mtime) @@ -423,7 +423,7 @@ /* Also remove any non-precious targets listed in the `also_make' member. */ for (d = child->file->also_make; d != 0; d = d->next) - if (!d->file->precious) + if (!d->file->precious && !d->file->phony) if (stat (d->file->name, &st) == 0 && S_ISREG (st.st_mode) && (time_t) st.st_mtime != d->file->last_mtime) diff -ruN make-3.68/config.h.in make-3.69/config.h.in --- make-3.68/config.h.in Wed Jul 28 17:45:26 1993 +++ make-3.69/config.h.in Sun Nov 7 08:10:24 1993 @@ -7,6 +7,9 @@ #undef _ALL_SOURCE #endif +/* Define if using alloca.c. */ +#undef C_ALLOCA + /* Define to empty if the keyword does not work. */ #undef const @@ -33,6 +36,9 @@ /* Define if you have alloca.h and it should be used (not Ultrix). */ #undef HAVE_ALLOCA_H +/* Define if your system has its own `getloadavg' function. */ +#undef HAVE_GETLOADAVG + /* Define if you have the strcoll function and it is properly defined. */ #undef HAVE_STRCOLL @@ -39,9 +45,6 @@ /* Define if `union wait' is the type of the first arg to wait functions. */ #undef HAVE_UNION_WAIT -/* Define if you have unistd.h. */ -#undef HAVE_UNISTD_H - /* Define if you have vfork.h. */ #undef HAVE_VFORK_H @@ -93,6 +96,9 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define on System V Release 4. */ +#undef SVR4 + /* Define if you don't have dirent.h, but have sys/dir.h. */ #undef SYSDIR @@ -112,9 +118,6 @@ instead of . */ #undef UMAX4_3 -/* Define if you do not have strings.h, index, bzero, etc.. */ -#undef USG - /* Define vfork as fork if vfork does not work. */ #undef vfork @@ -124,38 +127,71 @@ /* Define to the name of the SCCS `get' command. */ #undef SCCS_GET -/* Define if you have waitpid. */ -#undef HAVE_WAITPID +/* Define if you have _sys_siglist. */ +#undef HAVE__SYS_SIGLIST + +/* Define if you have dup2. */ +#undef HAVE_DUP2 + +/* Define if you have getcwd. */ +#undef HAVE_GETCWD + +/* Define if you have getdtablesize. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have getgroups. */ +#undef HAVE_GETGROUPS + +/* Define if you have psignal. */ +#undef HAVE_PSIGNAL +/* Define if you have setlinebuf. */ +#undef HAVE_SETLINEBUF + +/* Define if you have setregid. */ +#undef HAVE_SETREGID + +/* Define if you have setreuid. */ +#undef HAVE_SETREUID + +/* Define if you have sigsetmask. */ +#undef HAVE_SIGSETMASK + +/* Define if you have sys_siglist. */ +#undef HAVE_SYS_SIGLIST + /* Define if you have wait3. */ #undef HAVE_WAIT3 +/* Define if you have waitpid. */ +#undef HAVE_WAITPID + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + /* Define if you have the header file. */ #undef HAVE_LIMITS_H -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H +/* Define if you have the header file. */ +#undef HAVE_MACH_MACH_H -/* Define if you have the header file. */ -#undef HAVE_FCNTL_H +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H /* Define if you have the header file. */ #undef HAVE_STRING_H -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H -/* Define if you have the header file. */ -#undef HAVE_MACH_MACH_H +/* Define if you have the header file. */ +#undef HAVE_SYS_TIMEB_H /* Define if you have the header file. */ #undef HAVE_SYS_WAIT_H -/* Define if you have the util library (-lutil). */ -#undef HAVE_UTIL - -/* Define if you have the getloadavg library (-lgetloadavg). */ -#undef HAVE_GETLOADAVG +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H /* Define if you have the dgc library (-ldgc). */ #undef HAVE_DGC @@ -163,5 +199,17 @@ /* Define if you have the elf library (-lelf). */ #undef HAVE_ELF +/* Define if you have the getloadavg library (-lgetloadavg). */ +#undef HAVE_GETLOADAVG + +/* Define if you have the kvm library (-lkvm). */ +#undef HAVE_KVM + /* Define if you have the seq library (-lseq). */ #undef HAVE_SEQ + +/* Define if you have the sun library (-lsun). */ +#undef HAVE_SUN + +/* Define if you have the util library (-lutil). */ +#undef HAVE_UTIL diff -ruN make-3.68/configure make-3.69/configure --- make-3.68/configure Wed Jul 28 17:44:52 1993 +++ make-3.69/configure Sun Nov 7 08:04:01 1993 @@ -17,12 +17,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create] -# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET] -# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and -# --with-PACKAGE unless this script has special code to handle it. +# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] +# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]] +# Ignores all args except --srcdir, --prefix, --exec-prefix, and +# --with-PACKAGE[=VALUE] unless this script has special code to handle it. - for arg do # Handle --exec-prefix with a space before the argument. @@ -35,7 +34,7 @@ elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir= else case $arg in - # For backward compatibility, also recognize exact --exec_prefix. + # For backward compatibility, recognize -exec-prefix and --exec_prefix. -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*) exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e) @@ -49,9 +48,6 @@ -nfp | --nfp | --nf) ;; - -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no) - no_create=1 ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) @@ -63,12 +59,17 @@ next_srcdir=yes ;; -with-* | --with-*) - package=`echo $arg|sed 's/-*with-//'` - # Delete all the valid chars; see if any are left. - if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then + package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that aren't valid shell variable names. + if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then echo "configure: $package: invalid package name" >&2; exit 1 fi - eval "with_`echo $package|sed s/-/_/g`=1" ;; + package=`echo $package| sed 's/-/_/g'` + case "$arg" in + *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;; + *) val=1 ;; + esac + eval "with_$package='$val'" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v) verbose=yes ;; @@ -78,7 +79,8 @@ fi done -trap 'rm -fr conftest* core; exit 1' 1 3 15 +trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15 +trap 'rm -f confdefs*' 0 # NLS nuisances. # These must not be set unconditionally because not all systems understand @@ -86,8 +88,10 @@ if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi -rm -f conftest* -compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1' +rm -f conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h +compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1' # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. @@ -120,6 +124,7 @@ *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute. esac + # Save the original args to write them into config.status later. configure_args="$*" @@ -143,7 +148,7 @@ IFS="$saveifs" fi test -z "$CC" && CC="cc" -test -n "$CC" -a -n "$verbose" && echo " setting CC to $CC" +test -n "$CC" && test -n "$verbose" && echo " setting CC to $CC" # Find out if we are using GNU C, under whatever name. cat > conftest.c < conftest.c < Syntax Error EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then : else + rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* @@ -235,17 +245,20 @@ test ".${verbose}" != "." && echo " setting CPP to $CPP" echo checking for AIX cat > conftest.c < conftest.out 2>&1" +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "yes" conftest.out >/dev/null 2>&1; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining _ALL_SOURCE" +echo "#define" _ALL_SOURCE 1 >> confdefs.h DEFS="$DEFS -D_ALL_SOURCE=1" SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD} \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD} @@ -253,6 +266,7 @@ " } + fi rm -f conftest* @@ -266,6 +280,7 @@ { test -n "$verbose" && \ echo " defining _POSIX_SOURCE" +echo "#define" _POSIX_SOURCE 1 >> confdefs.h DEFS="$DEFS -D_POSIX_SOURCE=1" SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD} \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD} @@ -282,11 +297,14 @@ echo checking for minix/config.h cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* MINIX=1 + fi rm -f conftest* @@ -296,6 +314,7 @@ { test -n "$verbose" && \ echo " defining _POSIX_SOURCE" +echo "#define" _POSIX_SOURCE 1 >> confdefs.h DEFS="$DEFS -D_POSIX_SOURCE=1" SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD} \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD} @@ -306,7 +325,8 @@ { test -n "$verbose" && \ -echo " defining _POSIX_1_SOURCE to be 2" +echo " defining" _POSIX_1_SOURCE to be 2 +echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h DEFS="$DEFS -D_POSIX_1_SOURCE=2" SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD} \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD} @@ -318,6 +338,7 @@ { test -n "$verbose" && \ echo " defining _MINIX" +echo "#define" _MINIX 1 >> confdefs.h DEFS="$DEFS -D_MINIX=1" SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD} \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD} @@ -329,19 +350,24 @@ echo checking for ANSI C header files cat > conftest.c < #include #include #include EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -echo '#include ' > conftest.c -eval "$CPP \$DEFS conftest.c > conftest.out 2>&1" +echo '#include "confdefs.h" +#include ' > conftest.c +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "memchr" conftest.out >/dev/null 2>&1; then + rm -rf conftest* # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.c < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -357,6 +383,7 @@ { test -n "$verbose" && \ echo " defining STDC_HEADERS" +echo "#define" STDC_HEADERS 1 >> confdefs.h DEFS="$DEFS -DSTDC_HEADERS=1" SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD} \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD} @@ -364,30 +391,13 @@ " } -fi -rm -f conftest* + fi -rm -f conftest* +rm -fr conftest* fi rm -f conftest* -echo checking for unistd.h -cat > conftest.c < -EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` -if test -z "$err"; then - -{ -test -n "$verbose" && \ -echo " defining HAVE_UNISTD_H" -DEFS="$DEFS -DHAVE_UNISTD_H=1" -SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD} -\${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD} -\${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD} -" -} fi rm -f conftest* @@ -397,16 +407,19 @@ if test -z "$dirheader"; then echo checking for dirent.h cat > conftest.c < #include int main() { exit(0); } -int t() { DIR *dirp = opendir ("/"); } +int t() { DIR *dirp = 0; } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining DIRENT" +echo "#define" DIRENT 1 >> confdefs.h DEFS="$DEFS -DDIRENT=1" SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD} \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD} @@ -414,6 +427,7 @@ " } dirheader=dirent.h + fi rm -f conftest* fi @@ -420,16 +434,19 @@ if test -z "$dirheader"; then echo checking for sys/ndir.h cat > conftest.c < #include int main() { exit(0); } -int t() { DIR *dirp = opendir ("/"); } +int t() { DIR *dirp = 0; } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining SYSNDIR" +echo "#define" SYSNDIR 1 >> confdefs.h DEFS="$DEFS -DSYSNDIR=1" SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD} \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD} @@ -437,6 +454,7 @@ " } dirheader=sys/ndir.h + fi rm -f conftest* fi @@ -443,16 +461,19 @@ if test -z "$dirheader"; then echo checking for sys/dir.h cat > conftest.c < #include int main() { exit(0); } -int t() { DIR *dirp = opendir ("/"); } +int t() { DIR *dirp = 0; } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining SYSDIR" +echo "#define" SYSDIR 1 >> confdefs.h DEFS="$DEFS -DSYSDIR=1" SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD} \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD} @@ -460,6 +481,7 @@ " } dirheader=sys/dir.h + fi rm -f conftest* fi @@ -466,16 +488,19 @@ if test -z "$dirheader"; then echo checking for ndir.h cat > conftest.c < #include int main() { exit(0); } -int t() { DIR *dirp = opendir ("/"); } +int t() { DIR *dirp = 0; } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining NDIR" +echo "#define" NDIR 1 >> confdefs.h DEFS="$DEFS -DNDIR=1" SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD} \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD} @@ -483,6 +508,7 @@ " } dirheader=ndir.h + fi rm -f conftest* fi @@ -489,6 +515,7 @@ echo checking for closedir return value cat > conftest.c < #include <$dirheader> int closedir(); main() { exit(closedir(opendir(".")) != 0); } @@ -501,6 +528,7 @@ { test -n "$verbose" && \ echo " defining VOID_CLOSEDIR" +echo "#define" VOID_CLOSEDIR 1 >> confdefs.h DEFS="$DEFS -DVOID_CLOSEDIR=1" SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD} \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD} @@ -509,18 +537,21 @@ } fi -rm -f conftest* +rm -fr conftest* echo checking for uid_t in sys/types.h -echo '#include ' > conftest.c -eval "$CPP \$DEFS conftest.c > conftest.out 2>&1" +echo '#include "confdefs.h" +#include ' > conftest.c +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "uid_t" conftest.out >/dev/null 2>&1; then : else + rm -rf conftest* { test -n "$verbose" && \ -echo " defining uid_t to be int" +echo " defining" uid_t to be int +echo "#define" uid_t int >> confdefs.h DEFS="$DEFS -Duid_t=int" SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD} \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD} @@ -530,7 +561,8 @@ { test -n "$verbose" && \ -echo " defining gid_t to be int" +echo " defining" gid_t to be int +echo "#define" gid_t int >> confdefs.h DEFS="$DEFS -Dgid_t=int" SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD} \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD} @@ -562,6 +594,7 @@ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); }' cat > conftest.c <> confdefs.h DEFS="$DEFS -DGETGROUPS_T=gid_t" SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}gid_t\${SEDdD} \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}gid_t\${SEDuD} @@ -577,11 +611,13 @@ " } + else { test -n "$verbose" && \ -echo " defining GETGROUPS_T to be int" +echo " defining" GETGROUPS_T to be int +echo "#define" GETGROUPS_T int >> confdefs.h DEFS="$DEFS -DGETGROUPS_T=int" SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}int\${SEDdD} \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}int\${SEDuD} @@ -590,18 +626,21 @@ } fi -rm -f conftest* +rm -fr conftest* echo checking for pid_t in sys/types.h -echo '#include ' > conftest.c -eval "$CPP \$DEFS conftest.c > conftest.out 2>&1" +echo '#include "confdefs.h" +#include ' > conftest.c +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "pid_t" conftest.out >/dev/null 2>&1; then : else + rm -rf conftest* { test -n "$verbose" && \ -echo " defining pid_t to be int" +echo " defining" pid_t to be int +echo "#define" pid_t int >> confdefs.h DEFS="$DEFS -Dpid_t=int" SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD} \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD} @@ -614,6 +653,7 @@ echo checking for return type of signal handlers cat > conftest.c < #include #ifdef signal @@ -624,10 +664,12 @@ int t() { int i; } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ -echo " defining RETSIGTYPE to be void" +echo " defining" RETSIGTYPE to be void +echo "#define" RETSIGTYPE void >> confdefs.h DEFS="$DEFS -DRETSIGTYPE=void" SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD} \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD} @@ -635,11 +677,14 @@ " } + else + rm -rf conftest* { test -n "$verbose" && \ -echo " defining RETSIGTYPE to be int" +echo " defining" RETSIGTYPE to be int +echo "#define" RETSIGTYPE int >> confdefs.h DEFS="$DEFS -DRETSIGTYPE=int" SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD} \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD} @@ -651,19 +696,23 @@ rm -f conftest* -for hdr in limits.h sys/param.h fcntl.h string.h memory.h +for hdr in unistd.h limits.h sys/param.h fcntl.h string.h memory.h \ + sys/timeb.h do trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` echo checking for ${hdr} cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining ${trhdr}" +echo "#define" ${trhdr} 1 >> confdefs.h DEFS="$DEFS -D${trhdr}=1" SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD} \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD} @@ -671,6 +720,7 @@ " } + fi rm -f conftest* done @@ -695,6 +745,7 @@ { test -n "$verbose" && \ echo " defining NO_MINUS_C_MINUS_O" +echo "#define" NO_MINUS_C_MINUS_O 1 >> confdefs.h DEFS="$DEFS -DNO_MINUS_C_MINUS_O=1" SEDDEFS="${SEDDEFS}\${SEDdA}NO_MINUS_C_MINUS_O\${SEDdB}NO_MINUS_C_MINUS_O\${SEDdC}1\${SEDdD} \${SEDuA}NO_MINUS_C_MINUS_O\${SEDuB}NO_MINUS_C_MINUS_O\${SEDuC}1\${SEDuD} @@ -709,6 +760,7 @@ { test -n "$verbose" && \ echo " defining NO_MINUS_C_MINUS_O" +echo "#define" NO_MINUS_C_MINUS_O 1 >> confdefs.h DEFS="$DEFS -DNO_MINUS_C_MINUS_O=1" SEDDEFS="${SEDDEFS}\${SEDdA}NO_MINUS_C_MINUS_O\${SEDdB}NO_MINUS_C_MINUS_O\${SEDdC}1\${SEDdD} \${SEDuA}NO_MINUS_C_MINUS_O\${SEDuB}NO_MINUS_C_MINUS_O\${SEDuC}1\${SEDuD} @@ -753,9 +805,13 @@ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; }' -echo checking for working const +echo checking for lack of working const cat > conftest.c <> confdefs.h DEFS="$DEFS -Dconst=" SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD} \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD} @@ -776,31 +834,9 @@ fi rm -f conftest* - echo checking for BSD string and memory functions -cat > conftest.c < -int main() { exit(0); } -int t() { rindex(0, 0); bzero(0, 0); } -EOF -if eval $compile; then - : -else - -{ -test -n "$verbose" && \ -echo " defining USG" -DEFS="$DEFS -DUSG=1" -SEDDEFS="${SEDDEFS}\${SEDdA}USG\${SEDdB}USG\${SEDdC}1\${SEDdD} -\${SEDuA}USG\${SEDuB}USG\${SEDuC}1\${SEDuD} -\${SEDeA}USG\${SEDeB}USG\${SEDeC}1\${SEDeD} -" -} - -fi -rm -f conftest* - -echo checking for broken stat file mode macros + echo checking for broken stat file mode macros cat > conftest.c < #include #ifdef S_ISBLK @@ -825,12 +861,14 @@ #endif /* S_ISSOCK */ EOF -eval "$CPP \$DEFS conftest.c > conftest.out 2>&1" +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "You lose" conftest.out >/dev/null 2>&1; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining STAT_MACROS_BROKEN" +echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h DEFS="$DEFS -DSTAT_MACROS_BROKEN=1" SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD} \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD} @@ -838,6 +876,7 @@ " } + fi rm -f conftest* @@ -851,6 +890,7 @@ trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` echo checking for ${func} cat > conftest.c < int main() { exit(0); } int t() { @@ -866,9 +906,11 @@ } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining ${trfunc}" +echo "#define" ${trfunc} 1 >> confdefs.h DEFS="$DEFS -D${trfunc}=1" SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD} \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD} @@ -876,6 +918,7 @@ " } + fi rm -f conftest* done @@ -884,15 +927,18 @@ # for constant arguments. Useless! echo checking for working alloca.h cat > conftest.c < int main() { exit(0); } int t() { char *p = alloca(2 * sizeof(int)); } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining HAVE_ALLOCA_H" +echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h DEFS="$DEFS -DHAVE_ALLOCA_H=1" SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD} \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD} @@ -900,6 +946,7 @@ " } + fi rm -f conftest* @@ -919,6 +966,7 @@ " echo checking for alloca cat > conftest.c < conftest.c < conftest.out 2>&1" +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "winnitude" conftest.out >/dev/null 2>&1; then + rm -rf conftest* echo checking for _getb67 cat > conftest.c < int main() { exit(0); } int t() { @@ -955,9 +1007,11 @@ } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ -echo " defining CRAY_STACKSEG_END to be _getb67" +echo " defining" CRAY_STACKSEG_END to be _getb67 +echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67" SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD} \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD} @@ -965,9 +1019,12 @@ " } + else + rm -rf conftest* echo checking for GETB67 cat > conftest.c < int main() { exit(0); } int t() { @@ -983,9 +1040,11 @@ } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ -echo " defining CRAY_STACKSEG_END to be GETB67" +echo " defining" CRAY_STACKSEG_END to be GETB67 +echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67" SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD} \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD} @@ -993,9 +1052,12 @@ " } + else + rm -rf conftest* echo checking for getb67 cat > conftest.c < int main() { exit(0); } int t() { @@ -1011,9 +1073,11 @@ } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ -echo " defining CRAY_STACKSEG_END to be getb67" +echo " defining" CRAY_STACKSEG_END to be getb67 +echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h DEFS="$DEFS -DCRAY_STACKSEG_END=getb67" SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD} \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD} @@ -1021,6 +1085,7 @@ " } + fi rm -f conftest* @@ -1030,6 +1095,7 @@ fi rm -f conftest* + fi rm -f conftest* @@ -1043,11 +1109,24 @@ # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.o + +{ +test -n "$verbose" && \ +echo " defining C_ALLOCA" +echo "#define" C_ALLOCA 1 >> confdefs.h +DEFS="$DEFS -DC_ALLOCA=1" +SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD} +\${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD} +\${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD} +" +} + echo 'checking stack direction for C alloca' echo checking whether cross-compiling # If we cannot run a trivial program, we must be cross compiling. cat > conftest.c <> confdefs.h DEFS="$DEFS -DSTACK_DIRECTION=0" SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD} \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD} @@ -1073,6 +1153,7 @@ else cat > conftest.c <> confdefs.h DEFS="$DEFS -DSTACK_DIRECTION=1" SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD} \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD} @@ -1103,11 +1185,13 @@ " } + else { test -n "$verbose" && \ -echo " defining STACK_DIRECTION to be -1" +echo " defining" STACK_DIRECTION to be -1 +echo "#define" STACK_DIRECTION -1 >> confdefs.h DEFS="$DEFS -DSTACK_DIRECTION=-1" SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD} \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD} @@ -1117,19 +1201,22 @@ fi fi -rm -f conftest* +rm -fr conftest* fi echo checking for vfork.h cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining HAVE_VFORK_H" +echo "#define" HAVE_VFORK_H 1 >> confdefs.h DEFS="$DEFS -DHAVE_VFORK_H=1" SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VFORK_H\${SEDdB}HAVE_VFORK_H\${SEDdC}1\${SEDdD} \${SEDuA}HAVE_VFORK_H\${SEDuB}HAVE_VFORK_H\${SEDuC}1\${SEDuD} @@ -1137,15 +1224,19 @@ " } + fi rm -f conftest* echo checking for working vfork + cat > conftest.c < #include #include +#include #ifdef HAVE_UNISTD_H #include #endif @@ -1152,9 +1243,15 @@ #ifdef HAVE_VFORK_H #include #endif +static int signalled; +static RETSIGTYPE catch (s) int s; { signalled = 1; } main() { - pid_t parent = getpid(); - pid_t child = vfork(); + pid_t parent = getpid (); + pid_t child; + + signal (SIGINT, catch); + + child = vfork (); if (child == 0) { /* On sparc systems, changes by the child to local and incoming @@ -1179,6 +1276,12 @@ || p != p5 || p != p6 || p != p7) _exit(1); + /* On some systems (e.g. SunOS 5.2), if the parent is catching + a signal, the child ignores the signal before execing, + and the parent later receives that signal, the parent dumps core. + Test for this by ignoring SIGINT in the child. */ + signal (SIGINT, SIG_IGN); + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, @@ -1201,6 +1304,10 @@ /* Did the vfork/compiler bug occur? */ || parent != getpid() + /* Did the signal handling bug occur? */ + || kill(parent, SIGINT) != 0 + || signalled != 1 + /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); @@ -1214,7 +1321,8 @@ { test -n "$verbose" && \ -echo " defining vfork to be fork" +echo " defining" vfork to be fork +echo "#define" vfork fork >> confdefs.h DEFS="$DEFS -Dvfork=fork" SEDDEFS="${SEDDEFS}\${SEDdA}vfork\${SEDdB}vfork\${SEDdC}fork\${SEDdD} \${SEDuA}vfork\${SEDuB}vfork\${SEDuC}fork\${SEDuD} @@ -1223,9 +1331,10 @@ } fi -rm -f conftest* +rm -fr conftest* cat > conftest.c < /* If setvbuf has the reversed format, exit 0. */ main () { @@ -1244,6 +1353,7 @@ { test -n "$verbose" && \ echo " defining SETVBUF_REVERSED" +echo "#define" SETVBUF_REVERSED 1 >> confdefs.h DEFS="$DEFS -DSETVBUF_REVERSED=1" SEDDEFS="${SEDDEFS}\${SEDdA}SETVBUF_REVERSED\${SEDdB}SETVBUF_REVERSED\${SEDdC}1\${SEDdD} \${SEDuA}SETVBUF_REVERSED\${SEDuB}SETVBUF_REVERSED\${SEDuC}1\${SEDuD} @@ -1251,8 +1361,9 @@ " } + fi -rm -f conftest* +rm -fr conftest* rm -f core # Some definitions of getloadavg require that the program be installed setgid. @@ -1265,12 +1376,15 @@ have_lib="" echo checking for -lutil cat > conftest.c < conftest.c < conftest.c < conftest.c < int main() { exit(0); } int t() { @@ -1349,6 +1470,7 @@ if eval $compile; then : else + rm -rf conftest* LIBOBJS="$LIBOBJS ${func}.o" test -n "$verbose" && echo " using ${func}.o instead" fi @@ -1362,14 +1484,17 @@ need_func=true echo checking for sys/dg_sys_info.h cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining DGUX" +echo "#define" DGUX 1 >> confdefs.h DEFS="$DEFS -DDGUX=1" SEDDEFS="${SEDDEFS}\${SEDdA}DGUX\${SEDdB}DGUX\${SEDdC}1\${SEDdD} \${SEDuA}DGUX\${SEDuB}DGUX\${SEDuC}1\${SEDuD} @@ -1383,12 +1508,15 @@ have_lib="" echo checking for -ldgc cat > conftest.c <> confdefs.h DEFS="$DEFS -DHAVE_LIBDGC=1" SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDGC\${SEDdB}HAVE_LIBDGC\${SEDdC}1\${SEDdD} \${SEDuA}HAVE_LIBDGC\${SEDuB}HAVE_LIBDGC\${SEDuC}1\${SEDuD} @@ -1407,6 +1536,7 @@ LIBS="${LIBS} -ldgc" fi + fi rm -f conftest* @@ -1419,12 +1549,15 @@ have_lib="" echo checking for -lelf cat > conftest.c <> confdefs.h DEFS="$DEFS -DSVR4=1" SEDDEFS="${SEDDEFS}\${SEDdA}SVR4\${SEDdB}SVR4\${SEDdC}1\${SEDdD} \${SEDuA}SVR4\${SEDuB}SVR4\${SEDuC}1\${SEDuD} @@ -1445,12 +1579,15 @@ have_lib="" echo checking for -lkvm cat > conftest.c < conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining UMAX4_3" +echo "#define" UMAX4_3 1 >> confdefs.h DEFS="$DEFS -DUMAX4_3=1" SEDDEFS="${SEDDEFS}\${SEDdA}UMAX4_3\${SEDdB}UMAX4_3\${SEDdC}1\${SEDdD} \${SEDuA}UMAX4_3\${SEDuB}UMAX4_3\${SEDuC}1\${SEDuD} @@ -1486,6 +1626,7 @@ { test -n "$verbose" && \ echo " defining UMAX" +echo "#define" UMAX 1 >> confdefs.h DEFS="$DEFS -DUMAX=1" SEDDEFS="${SEDDEFS}\${SEDdA}UMAX\${SEDdB}UMAX\${SEDdC}1\${SEDdD} \${SEDuA}UMAX\${SEDuB}UMAX\${SEDuC}1\${SEDuD} @@ -1494,6 +1635,7 @@ } need_func=false + fi rm -f conftest* @@ -1501,14 +1643,17 @@ if $need_func; then echo checking for sys/cpustats.h cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining UMAX" +echo "#define" UMAX 1 >> confdefs.h DEFS="$DEFS -DUMAX=1" SEDDEFS="${SEDDEFS}\${SEDdA}UMAX\${SEDdB}UMAX\${SEDdC}1\${SEDdD} \${SEDuA}UMAX\${SEDuB}UMAX\${SEDuC}1\${SEDuD} @@ -1516,6 +1661,7 @@ " } need_func=false + fi rm -f conftest* @@ -1526,14 +1672,17 @@ trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` echo checking for ${hdr} cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining ${trhdr}" +echo "#define" ${trhdr} 1 >> confdefs.h DEFS="$DEFS -D${trhdr}=1" SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD} \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD} @@ -1541,6 +1690,7 @@ " } + fi rm -f conftest* done @@ -1549,14 +1699,17 @@ echo checking for nlist.h cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining NLIST_STRUCT" +echo "#define" NLIST_STRUCT 1 >> confdefs.h DEFS="$DEFS -DNLIST_STRUCT=1" SEDDEFS="${SEDDEFS}\${SEDdA}NLIST_STRUCT\${SEDdB}NLIST_STRUCT\${SEDdC}1\${SEDdD} \${SEDuA}NLIST_STRUCT\${SEDuB}NLIST_STRUCT\${SEDuC}1\${SEDuD} @@ -1566,15 +1719,18 @@ echo checking for n_un in struct nlist cat > conftest.c < int main() { exit(0); } int t() { struct nlist n; n.n_un.n_name = 0; } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining NLIST_NAME_UNION" +echo "#define" NLIST_NAME_UNION 1 >> confdefs.h DEFS="$DEFS -DNLIST_NAME_UNION=1" SEDDEFS="${SEDDEFS}\${SEDdA}NLIST_NAME_UNION\${SEDdB}NLIST_NAME_UNION\${SEDdC}1\${SEDdD} \${SEDuA}NLIST_NAME_UNION\${SEDuB}NLIST_NAME_UNION\${SEDuC}1\${SEDuD} @@ -1582,14 +1738,17 @@ " } + fi rm -f conftest* + fi rm -f conftest* # Figure out whether we will need to install setgid. cat > conftest.c < conftest.out 2>&1" +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "Yowza Am I SETGID yet" conftest.out >/dev/null 2>&1; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining GETLOADAVG_PRIVILEGED" +echo "#define" GETLOADAVG_PRIVILEGED 1 >> confdefs.h DEFS="$DEFS -DGETLOADAVG_PRIVILEGED=1" SEDDEFS="${SEDDEFS}\${SEDdA}GETLOADAVG_PRIVILEGED\${SEDdB}GETLOADAVG_PRIVILEGED\${SEDdC}1\${SEDdD} \${SEDuA}GETLOADAVG_PRIVILEGED\${SEDuB}GETLOADAVG_PRIVILEGED\${SEDuC}1\${SEDuD} @@ -1609,9 +1770,23 @@ " } NEED_SETGID=true + fi rm -f conftest* ;; + +*) +{ +test -n "$verbose" && \ +echo " defining HAVE_GETLOADAVG" +echo "#define" HAVE_GETLOADAVG 1 >> confdefs.h +DEFS="$DEFS -DHAVE_GETLOADAVG=1" +SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GETLOADAVG\${SEDdB}HAVE_GETLOADAVG\${SEDdC}1\${SEDdD} +\${SEDuA}HAVE_GETLOADAVG\${SEDuB}HAVE_GETLOADAVG\${SEDuC}1\${SEDuD} +\${SEDeA}HAVE_GETLOADAVG\${SEDeB}HAVE_GETLOADAVG\${SEDeC}1\${SEDeD} +" +} + ;; esac if $NEED_SETGID; then @@ -1629,6 +1804,7 @@ echo checking for strcoll cat > conftest.c < main () { @@ -1643,6 +1819,7 @@ { test -n "$verbose" && \ echo " defining HAVE_STRCOLL" +echo "#define" HAVE_STRCOLL 1 >> confdefs.h DEFS="$DEFS -DHAVE_STRCOLL=1" SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STRCOLL\${SEDdB}HAVE_STRCOLL\${SEDdC}1\${SEDdD} \${SEDuA}HAVE_STRCOLL\${SEDuB}HAVE_STRCOLL\${SEDuC}1\${SEDuD} @@ -1650,8 +1827,9 @@ " } + fi -rm -f conftest* +rm -fr conftest* for hdr in sys/wait.h do @@ -1658,14 +1836,17 @@ trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` echo checking for ${hdr} cat > conftest.c < EOF -err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"` +err=`eval "($CPP conftest.c >/dev/null) 2>&1"` if test -z "$err"; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining ${trhdr}" +echo "#define" ${trhdr} 1 >> confdefs.h DEFS="$DEFS -D${trhdr}=1" SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD} \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD} @@ -1673,6 +1854,7 @@ " } + fi rm -f conftest* done @@ -1681,6 +1863,7 @@ trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` echo checking for ${func} cat > conftest.c < int main() { exit(0); } int t() { @@ -1696,9 +1879,11 @@ } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining ${trfunc}" +echo "#define" ${trfunc} 1 >> confdefs.h DEFS="$DEFS -D${trfunc}=1" SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD} \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD} @@ -1706,6 +1891,7 @@ " } + fi rm -f conftest* done @@ -1712,6 +1898,7 @@ echo checking for union wait cat > conftest.c < #include int main() { exit(0); } @@ -1729,10 +1916,12 @@ } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining HAVE_UNION_WAIT" +echo "#define" HAVE_UNION_WAIT 1 >> confdefs.h DEFS="$DEFS -DHAVE_UNION_WAIT=1" SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNION_WAIT\${SEDdB}HAVE_UNION_WAIT\${SEDdC}1\${SEDdD} \${SEDuA}HAVE_UNION_WAIT\${SEDuB}HAVE_UNION_WAIT\${SEDuC}1\${SEDuD} @@ -1740,21 +1929,29 @@ " } + fi rm -f conftest* -echo checking for sys_siglist declaration in signal.h +echo checking for sys_siglist declaration in signal.h or unistd.h cat > conftest.c < +/* NetBSD declares sys_siglist in . */ +#ifdef HAVE_UNISTD_H +#include +#endif int main() { exit(0); } int t() { char *msg = *(sys_siglist + 1); } EOF if eval $compile; then + rm -rf conftest* { test -n "$verbose" && \ echo " defining SYS_SIGLIST_DECLARED" +echo "#define" SYS_SIGLIST_DECLARED 1 >> confdefs.h DEFS="$DEFS -DSYS_SIGLIST_DECLARED=1" SEDDEFS="${SEDDEFS}\${SEDdA}SYS_SIGLIST_DECLARED\${SEDdB}SYS_SIGLIST_DECLARED\${SEDdC}1\${SEDdD} \${SEDuA}SYS_SIGLIST_DECLARED\${SEDuB}SYS_SIGLIST_DECLARED\${SEDuC}1\${SEDuD} @@ -1762,6 +1959,7 @@ " } + fi rm -f conftest* @@ -1773,12 +1971,15 @@ have_lib="" echo checking for -lseq cat > conftest.c < conftest.c < conftest.out 2>&1" +eval "$CPP conftest.c > conftest.out 2>&1" if egrep "yes" conftest.out >/dev/null 2>&1; then + rm -rf conftest* XENIX=1 + fi rm -f conftest* @@ -1810,10 +2014,35 @@ esac fi +LIBS_save="${LIBS}" +LIBS="${LIBS} -lsun" +have_lib="" +echo checking for -lsun +cat > conftest.c <> confdefs.h DEFS="$DEFS -DSCCS_GET=\"/usr/sccs/get\"" SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET\${SEDdB}SCCS_GET\${SEDdC}\"/usr/sccs/get\"\${SEDdD} \${SEDuA}SCCS_GET\${SEDuB}SCCS_GET\${SEDuC}\"/usr/sccs/get\"\${SEDuD} @@ -1836,7 +2066,8 @@ { test -n "$verbose" && \ -echo " defining SCCS_GET to be \"get\"" +echo " defining" SCCS_GET to be \"get\" +echo "#define" SCCS_GET \"get\" >> confdefs.h DEFS="$DEFS -DSCCS_GET=\"get\"" SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET\${SEDdB}SCCS_GET\${SEDdC}\"get\"\${SEDdD} \${SEDuA}SCCS_GET\${SEDuB}SCCS_GET\${SEDuC}\"get\"\${SEDuD} @@ -1846,6 +2077,7 @@ fi +# Set default prefixes. if test -n "$prefix"; then test -z "$exec_prefix" && exec_prefix='${prefix}' prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" @@ -1854,6 +2086,7 @@ prsub="$prsub s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" fi +# Quote sed substitution magic chars in DEFS. cat >conftest.def <&1; exit 1 ;; esac done @@ -1902,15 +2136,14 @@ prefix='$prefix' exec_prefix='$exec_prefix' prsub='$prsub' +extrasub='$extrasub' EOF cat >> config.status <<\EOF top_srcdir=$srcdir -# Allow make-time overrides of the generated file list. -test -n "$gen_files" || gen_files="Makefile build.sh glob/Makefile" - -for file in .. $gen_files; do if [ "x$file" != "x.." ]; then +CONFIG_FILES=${CONFIG_FILES-"Makefile build.sh glob/Makefile"} +for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then srcdir=$top_srcdir # Remove last slash and all that follows it. Not all systems have dirname. dir=`echo $file|sed 's%/[^/][^/]*$%%'` @@ -1923,6 +2156,7 @@ echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file sed -e " $prsub +$extrasub s%@CFLAGS@%$CFLAGS%g s%@LDFLAGS@%$LDFLAGS%g s%@CC@%$CC%g @@ -1940,8 +2174,11 @@ s%@srcdir@%$srcdir%g s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file fi; done -test -n "$gen_config" || gen_config=config.h -echo creating $gen_config + +CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} +for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then +echo creating $file + # These sed commands are put into SEDDEFS when defining a macro. # They are broken into pieces to make the sed script easier to manage. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME @@ -1971,14 +2208,15 @@ $SEDDEFS EOF -# Maximum number of lines to put in a single here document. -maxshlines=9 - # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit # on the size of here documents. +# Maximum number of lines to put in a single here document. +maxshlines=9 + while : do + # wc gives bogus results for an empty file on some systems. lines=`grep -c . conftest.sh` if test -z "$lines" || test "$lines" -eq 0; then break; fi rm -f conftest.s1 conftest.s2 @@ -2005,7 +2243,7 @@ rm -f conftest.h # Break up the sed commands because old seds have small limits. maxsedlines=20 -cp $top_srcdir/$gen_config.in conftest.h1 +cp $top_srcdir/$file.in conftest.h1 while : do lines=`grep -c . conftest.sed` @@ -2019,21 +2257,27 @@ mv conftest.s2 conftest.sed done rm -f conftest.sed conftest.h -echo "/* $gen_config. Generated automatically by configure. */" > conftest.h +echo "/* $file. Generated automatically by configure. */" > conftest.h cat conftest.h1 >> conftest.h rm -f conftest.h1 -if cmp -s $gen_config conftest.h 2>/dev/null; then +if cmp -s $file conftest.h 2>/dev/null; then # The file exists and we would not be changing it. + echo "$file is unchanged" rm -f conftest.h else - rm -f $gen_config - mv conftest.h $gen_config + rm -f $file + mv conftest.h $file fi +fi; done + exit 0 EOF chmod +x config.status -test -n "$no_create" || ./config.status +${CONFIG_SHELL-/bin/sh} config.status +# Makefile uses this timestamp file to know when to remake Makefile, +# build.sh, and glob/Makefile. +touch stamp-config diff -ruN make-3.68/configure.in make-3.69/configure.in --- make-3.68/configure.in Fri Jul 23 16:04:35 1993 +++ make-3.69/configure.in Fri Oct 22 02:56:46 1993 @@ -14,16 +14,15 @@ AC_ISC_POSIX AC_MINIX AC_STDC_HEADERS -AC_UNISTD_H AC_DIR_HEADER AC_UID_T dnl Also does gid_t. AC_GETGROUPS_T AC_PID_T AC_RETSIGTYPE -AC_HAVE_HEADERS(limits.h sys/param.h fcntl.h string.h memory.h) +AC_HAVE_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \ + sys/timeb.h) AC_MINUS_C_MINUS_O AC_CONST dnl getopt needs this. -AC_USG AC_STAT_MACROS_BROKEN AC_SUBST(LIBOBJS) @@ -55,8 +54,12 @@ ], AC_DEFINE(HAVE_UNION_WAIT)) -AC_COMPILE_CHECK(sys_siglist declaration in signal.h, - [#include ], [char *msg = *(sys_siglist + 1);], +AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h, + [#include +/* NetBSD declares sys_siglist in . */ +#ifdef HAVE_UNISTD_H +#include +#endif], [char *msg = *(sys_siglist + 1);], AC_DEFINE(SYS_SIGLIST_DECLARED)) # The presence of the following is not meant to imply @@ -63,6 +66,7 @@ # that make necessarily works on those systems. AC_DYNIX_SEQ AC_XENIX_DIR +AC_IRIX_SUN AC_SUBST(REMOTE) REMOTE=stub AC_WITH(customs, [REMOTE=cstms @@ -76,6 +80,9 @@ fi AC_OUTPUT(Makefile build.sh glob/Makefile) +# Makefile uses this timestamp file to know when to remake Makefile, +# build.sh, and glob/Makefile. +touch stamp-config dnl Local Variables: dnl comment-start: "dnl " diff -ruN make-3.68/default.c make-3.69/default.c --- make-3.68/default.c Fri Jun 25 14:59:05 1993 +++ make-3.69/default.c Thu Oct 14 18:25:17 1993 @@ -63,9 +63,9 @@ /* SCCS. */ { "%", "s.%", - "$(GET) $(GFLAGS) $<" }, + "$(GET) $(GFLAGS) $< -G $@" }, { "%", "SCCS/s.%", - "$(GET) $(GFLAGS) $<" }, + "$(GET) $(GFLAGS) $< -G $@" }, { 0, 0, 0 } }; @@ -317,25 +317,20 @@ } } -/* Install the default pattern rules and enter - the default suffix rules as file rules. */ +/* Enter the default suffix rules as file rules. This used to be done in + install_default_implicit_rules, but that loses because we want the + suffix rules installed before reading makefiles, and thee pattern rules + installed after. */ void -install_default_implicit_rules () +install_default_suffix_rules () { - register struct pspec *p; register char **s; if (no_builtin_rules_flag) return; - for (p = default_pattern_rules; p->target != 0; ++p) - install_pattern_rule (p, 0); - - for (p = default_terminal_rules; p->target != 0; ++p) - install_pattern_rule (p, 1); - - for (s = default_suffix_rules; *s != 0; s += 2) + for (s = default_suffix_rules; *s != 0; s += 2) { register struct file *f = enter_file (s[0]); /* Don't clobber cmds given in a makefile if there were any. */ @@ -347,6 +342,24 @@ f->cmds->command_lines = 0; } } +} + + +/* Install the default pattern rules. */ + +void +install_default_implicit_rules () +{ + register struct pspec *p; + + if (no_builtin_rules_flag) + return; + + for (p = default_pattern_rules; p->target != 0; ++p) + install_pattern_rule (p, 0); + + for (p = default_terminal_rules; p->target != 0; ++p) + install_pattern_rule (p, 1); } void diff -ruN make-3.68/dep.h make-3.69/dep.h --- make-3.68/dep.h Wed Jul 14 18:56:42 1993 +++ make-3.69/dep.h Tue Aug 3 00:18:56 1993 @@ -58,12 +58,8 @@ /* Flag bits for the second argument to `read_makefile'. These flags are saved in the `changed' field of each `struct dep' in the chain returned by `read_all_makefiles'. */ -enum - { - RM_NO_DEFAULT_GOAL = 1 << 0, /* Do not set default goal. */ - RM_INCLUDED = 1 << 1, /* Search the makefile search path. */ - RM_DONTCARE = 1 << 2, /* No error if it doesn't exist. */ - RM_NO_TILDE = 1 << 3, /* Don't expand ~ in the file name. */ - RM_NOFLAG = 0 - }; - +#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */ +#define RM_INCLUDED (1 << 1) /* Search makefile search path. */ +#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */ +#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */ +#define RM_NOFLAG 0 diff -ruN make-3.68/expand.c make-3.69/expand.c --- make-3.68/expand.c Fri Jun 25 15:20:36 1993 +++ make-3.69/expand.c Mon Aug 30 12:31:47 1993 @@ -341,7 +341,14 @@ /* Look up the value of the variable. */ end = index (beg, closeparen); if (end == 0) - return initialize_variable_output (); + { + /* Unterminated variable reference. */ + if (reading_filename != 0) + makefile_fatal (reading_filename, *reading_lineno_ptr, + "unterminated variable reference"); + else + fatal ("unterminated variable reference"); + } o = reference_variable (o, beg, end - beg); } diff -ruN make-3.68/file.c make-3.69/file.c --- make-3.68/file.c Wed Jun 30 18:11:36 1993 +++ make-3.69/file.c Mon Oct 18 07:01:37 1993 @@ -385,12 +385,97 @@ /* Print the data base of files. */ +static void +print_file (f) + struct file *f; +{ + register struct dep *d; + + putchar ('\n'); + if (!f->is_target) + puts ("# Not a target:"); + printf ("%s:%s", f->name, f->double_colon ? ":" : ""); + + for (d = f->deps; d != 0; d = d->next) + printf (" %s", dep_name (d)); + putchar ('\n'); + + if (f->precious) + puts ("# Precious file (dependency of .PRECIOUS)."); + if (f->phony) + puts ("# Phony target (dependency of .PHONY)."); + if (f->cmd_target) + puts ("# Command-line target."); + if (f->dontcare) + puts ("# A default or MAKEFILES makefile."); + printf ("# Implicit rule search has%s been done.\n", + f->tried_implicit ? "" : " not"); + if (f->stem != 0) + printf ("# Implicit/static pattern stem: `%s'\n", f->stem); + if (f->intermediate) + puts ("# File is an intermediate dependency."); + if (f->also_make != 0) + { + fputs ("# Also makes:", stdout); + for (d = f->also_make; d != 0; d = d->next) + printf (" %s", dep_name (d)); + putchar ('\n'); + } + if (f->last_mtime == (time_t) 0) + puts ("# Modification time never checked."); + else if (f->last_mtime == (time_t) -1) + puts ("# File does not exist."); + else + printf ("# Last modified %.24s (%ld)\n", + ctime (&f->last_mtime), (long int) f->last_mtime); + printf ("# File has%s been updated.\n", + f->updated ? "" : " not"); + switch (f->command_state) + { + case cs_running: + puts ("# Commands currently running (THIS IS A BUG)."); + break; + case cs_deps_running: + puts ("# Dependencies commands running (THIS IS A BUG)."); + break; + case cs_not_started: + case cs_finished: + switch (f->update_status) + { + case -1: + break; + case 0: + puts ("# Successfully updated."); + break; + case 1: + puts ("# Failed to be updated."); + break; + default: + puts ("# Invalid value in `update_status' member!"); + fflush (stdout); + fflush (stderr); + abort (); + } + break; + default: + puts ("# Invalid value in `command_state' member!"); + fflush (stdout); + fflush (stderr); + abort (); + } + + if (f->variables != 0) + print_file_variables (f); + + if (f->cmds != 0) + print_commands (f->cmds); +} + void print_file_data_base () { register unsigned int i, nfiles, per_bucket; register struct file *file; - register struct dep *d; puts ("\n# Files"); @@ -406,86 +491,7 @@ ++this_bucket; for (f = file; f != 0; f = f->prev) - { - putchar ('\n'); - if (!f->is_target) - puts ("# Not a target:"); - printf ("%s:%s", f->name, f->double_colon ? ":" : ""); - - for (d = f->deps; d != 0; d = d->next) - printf (" %s", dep_name (d)); - putchar ('\n'); - - if (f->precious) - puts ("# Precious file (dependency of .PRECIOUS)."); - if (f->phony) - puts ("# Phony target (dependency of .PHONY)."); - if (f->cmd_target) - puts ("# Command-line target."); - if (f->dontcare) - puts ("# A default or MAKEFILES makefile."); - printf ("# Implicit rule search has%s been done.\n", - f->tried_implicit ? "" : " not"); - if (f->stem != 0) - printf ("# Implicit/static pattern stem: `%s'\n", f->stem); - if (f->intermediate) - puts ("# File is an intermediate dependency."); - if (f->also_make != 0) - { - fputs ("# Also makes:", stdout); - for (d = f->also_make; d != 0; d = d->next) - printf (" %s", dep_name (d)); - putchar ('\n'); - } - if (f->last_mtime == (time_t) 0) - puts ("# Modification time never checked."); - else if (f->last_mtime == (time_t) -1) - puts ("# File does not exist."); - else - printf ("# Last modified %.24s (%ld)\n", - ctime (&f->last_mtime), (long int) f->last_mtime); - printf ("# File has%s been updated.\n", - f->updated ? "" : " not"); - switch (f->command_state) - { - case cs_running: - puts ("# Commands currently running (THIS IS A BUG)."); - break; - case cs_deps_running: - puts ("# Dependencies commands running (THIS IS A BUG)."); - break; - case cs_not_started: - case cs_finished: - switch (f->update_status) - { - case -1: - break; - case 0: - puts ("# Successfully updated."); - break; - case 1: - puts ("# Failed to be updated."); - break; - default: - puts ("# Invalid value in `update_status' member!"); - fflush (stdout); - fflush (stderr); - abort (); - } - break; - default: - puts ("# Invalid value in `command_state' member!"); - fflush (stdout); - fflush (stderr); - abort (); - } - - if (f->variables != 0) - print_file_variables (file); - - if (f->cmds != 0) - print_commands (f->cmds); - } + print_file (f); } nfiles += this_bucket; diff -ruN make-3.68/file.h make-3.69/file.h --- make-3.68/file.h Mon Jan 25 17:45:49 1993 +++ make-3.69/file.h Wed Oct 27 18:23:18 1993 @@ -90,6 +90,17 @@ #define file_mtime(f) file_mtime_1 ((f), 1) #define file_mtime_no_search(f) file_mtime_1 ((f), 0) +/* Modtime value to use for `infinitely new'. We used to get the current time + from the system and use that whenever we wanted `new'. But that causes + trouble when the machine running make and the machine holding a file have + different ideas about what time it is; and can also lose for `force' + targets, which need to be considered newer than anything that depends on + them, even if said dependents' modtimes are in the future. + + NOTE: This assumes 32-bit `time_t's, but I cannot think of a portable way + to produce the largest representable integer of a given signed type. */ +#define NEW_MTIME ((time_t) 0x7fffffff) + #define check_renamed(file) \ while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */ diff -ruN make-3.68/function.c make-3.69/function.c --- make-3.68/function.c Wed Jul 14 20:22:55 1993 +++ make-3.69/function.c Fri Oct 29 17:50:48 1993 @@ -337,8 +337,18 @@ if (argv == 0) break; + /* Using a target environment for `shell' loses in cases like: + export var = $(shell echo foobie) + because target_environment hits a loop trying to expand $(var) + to put it in the environment. This is even more confusing when + var was not explicitly exported, but just appeared in the + calling environment. */ +#if 1 + envp = environ; +#else /* Construct the environment. */ envp = target_environment ((struct file *) 0); +#endif /* For error messages. */ if (reading_filename != 0) @@ -372,9 +382,11 @@ /* Free the storage only the child needed. */ free (argv[0]); free ((char *) argv); +#if 0 for (i = 0; envp[i] != 0; ++i) free (envp[i]); free ((char *) envp); +#endif /* Record the PID for reap_children. */ shell_function_pid = pid; @@ -515,7 +527,7 @@ { if (wordi >= nwords - 1) { - nwords += 5; + nwords *= 2; words = (char **) xrealloc ((char *) words, nwords * sizeof (char *)); } diff -ruN make-3.68/getloadavg.c make-3.69/getloadavg.c --- make-3.68/getloadavg.c Mon Jul 26 20:37:13 1993 +++ make-3.69/getloadavg.c Wed Nov 3 08:06:04 1993 @@ -31,7 +31,7 @@ the nlist n_name element is a pointer, not an array. NLIST_NAME_UNION struct nlist has an n_un member, not n_name. - LINUX_LDAV_FILE [LINUX]: Name of file containing load averages. + LINUX_LDAV_FILE [__linux__]: File containing load averages. Specific system predefines this file uses, aside from setting default values if not emacs: @@ -49,8 +49,9 @@ UMAX UMAX4_3 VMS - LINUX Linux: assumes /proc filesystem mounted. + __linux__ Linux: assumes /proc filesystem mounted. Support from Michael K. Johnson. + __NetBSD__ NetBSD: assumes /kern filesystem mounted. In addition, to avoid nesting many #ifdefs, we internally set LDAV_DONE to indicate that the load average has been computed. @@ -69,9 +70,23 @@ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else #include "config.h" #endif +#endif + + +/* Exclude all the code except the test program at the end + if the system has its own `getloadavg' function. */ +#ifndef HAVE_GETLOADAVG + + /* The existing Emacs configuration files define a macro called LOAD_AVE_CVT, which accepts a value of type LOAD_AVE_TYPE, and returns the load average multiplied by 100. What we actually want @@ -190,6 +205,14 @@ #endif /* No LOAD_AVE_TYPE. */ +#ifdef OSF_ALPHA +/* defines an incorrect value for FSCALE on Alpha OSF/1, + according to ghazi@noc.rutgers.edu. */ +#undef FSCALE +#define FSCALE 1024.0 +#endif + + #ifndef FSCALE /* SunOS and some others define FSCALE in sys/param.h. */ @@ -457,7 +480,7 @@ elem = -1; #endif -#if !defined (LDAV_DONE) && defined (LINUX) +#if !defined (LDAV_DONE) && defined (__linux__) #define LDAV_DONE #undef LOAD_AVE_TYPE @@ -487,7 +510,36 @@ return elem; -#endif /* LINUX */ +#endif /* __linux__ */ + +#if !defined (LDAV_DONE) && defined (__NetBSD__) +#define LDAV_DONE +#undef LOAD_AVE_TYPE + +#ifndef NETBSD_LDAV_FILE +#define NETBSD_LDAV_FILE "/kern/loadavg" +#endif + + unsigned long int load_ave[3], scale; + int count; + FILE *fp; + + fp = fopen (NETBSD_LDAV_FILE, "r"); + if (fp == NULL) + return -1; + count = fscanf (fp, "%lu %lu %lu %lu\n", + &load_ave[0], &load_ave[1], &load_ave[2], + &scale); + (void) fclose (fp); + if (count != 4) + return -1; + + for (elem = 0; elem < nelem; elem++) + loadavg[elem] = (double) load_ave[elem] / (double) scale; + + return elem; + +#endif /* __NetBSD__ */ #if !defined (LDAV_DONE) && defined (NeXT) #define LDAV_DONE @@ -798,6 +850,8 @@ return -1; #endif } + +#endif /* ! HAVE_GETLOADAVG */ #ifdef TEST void @@ -810,9 +864,6 @@ if (argc > 1) naptime = atoi (argv[1]); - if (naptime == 0) - naptime = 5; - while (1) { double avg[3]; @@ -833,7 +884,12 @@ printf ("15-minute: %f ", avg[2]); if (loads > 0) putchar ('\n'); + + if (naptime == 0) + break; sleep (naptime); } + + exit (0); } #endif /* TEST */ diff -ruN make-3.68/getopt.c make-3.69/getopt.c --- make-3.68/getopt.c Thu Jul 8 13:20:26 1993 +++ make-3.69/getopt.c Mon Sep 20 16:03:23 1993 @@ -21,7 +21,14 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else #include "config.h" +#endif #endif #ifndef __STDC__ diff -ruN make-3.68/getopt1.c make-3.69/getopt1.c --- make-3.68/getopt1.c Fri May 7 15:29:55 1993 +++ make-3.69/getopt1.c Mon Sep 20 16:03:21 1993 @@ -17,13 +17,24 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else #include "config.h" #endif +#endif #include "getopt.h" -#if !__STDC__ && !defined(const) && IN_GCC +#ifndef __STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const #define const +#endif #endif #include diff -ruN make-3.68/glob/fnmatch.c make-3.69/glob/fnmatch.c --- make-3.68/glob/fnmatch.c Fri Apr 16 12:24:54 1993 +++ make-3.69/glob/fnmatch.c Tue Oct 12 11:18:06 1993 @@ -16,7 +16,14 @@ Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H +#if defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else #include "config.h" +#endif #endif #include diff -ruN make-3.68/glob/glob.c make-3.69/glob/glob.c --- make-3.68/glob/glob.c Wed May 12 18:25:51 1993 +++ make-3.69/glob/glob.c Thu Aug 12 18:15:21 1993 @@ -21,7 +21,7 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif #include diff -ruN make-3.68/implicit.c make-3.69/implicit.c --- make-3.68/implicit.c Wed Jun 30 19:04:21 1993 +++ make-3.69/implicit.c Wed Nov 3 06:56:26 1993 @@ -36,6 +36,14 @@ { DEBUGPR ("Looking for an implicit rule for `%s'.\n"); + /* The order of these searches was previously reversed. My logic now is + that since the non-archive search uses more information in the target + (the archive search omits the archive name), it is more specific and + should come first. */ + + if (pattern_search (file, 0, depth, 0)) + return 1; + #ifndef NO_ARCHIVES /* If this is an archive member reference, use just the archive member name to search for implicit rules. */ @@ -47,7 +55,7 @@ } #endif - return pattern_search (file, 0, depth, 0); + return 0; } #define DEBUGP2(msg, a1, a2) \ diff -ruN make-3.68/job.c make-3.69/job.c --- make-3.68/job.c Fri Jun 25 16:03:56 1993 +++ make-3.69/job.c Thu Oct 14 15:08:36 1993 @@ -116,8 +116,12 @@ #else #include #define getdtablesize() NOFILE +#if !defined (NOFILE) && defined (NOFILES_MAX) +/* SCO 3.2 "devsys 4.2" defines NOFILES_{MIN,MAX} in lieu of NOFILE. */ +#define NOFILE NOFILES_MAX #endif #endif +#endif extern int getloadavg (); extern int start_remote_job_p (); @@ -204,6 +208,7 @@ int exit_code, exit_sig, coredump; register struct child *lastc, *c; int child_failed; + int any_remote, any_local; if (err && dead_children == 0) { @@ -227,24 +232,47 @@ if (dead_children != 0) --dead_children; - if (debug_flag) - for (c = children; c != 0; c = c->next) - printf ("Live child 0x%08lx PID %d%s\n", - (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); + any_remote = 0; + any_local = shell_function_pid != -1; + for (c = children; c != 0; c = c->next) + { + any_remote |= c->remote; + any_local |= ! c->remote; + if (debug_flag) + printf ("Live child 0x%08lx PID %d%s\n", + (unsigned long int) c, + c->pid, c->remote ? " (remote)" : ""); + } /* First, check for remote children. */ - pid = remote_status (&exit_code, &exit_sig, &coredump, 0); - if (pid <= 0) + if (any_remote) + pid = remote_status (&exit_code, &exit_sig, &coredump, 0); + else + pid = 0; + if (pid < 0) { + remote_status_lose: +#ifdef EINTR + if (errno == EINTR) + continue; +#endif + pfatal_with_name ("remote_status"); + } + else if (pid == 0) + { /* No remote children. Check for local children. */ + if (any_local) + { #ifdef WAIT_NOHANG - if (!block) - pid = WAIT_NOHANG (&status); - else + if (!block) + pid = WAIT_NOHANG (&status); + else #endif - pid = wait (&status); + pid = wait (&status); + } + else + pid = 0; if (pid < 0) { @@ -255,8 +283,24 @@ pfatal_with_name ("wait"); } else if (pid == 0) - /* No local children. */ - break; + { + /* No local children. */ + if (block && any_remote) + { + /* Now try a blocking wait for a remote child. */ + pid = remote_status (&exit_code, &exit_sig, &coredump, 1); + if (pid < 0) + goto remote_status_lose; + else if (pid == 0) + /* No remote children either. Finally give up. */ + break; + else + /* We got a remote child. */ + remote = 1; + } + else + break; + } else { /* Chop the status word up. */ @@ -460,6 +504,8 @@ { if (*p == '@') flags |= COMMANDS_SILENT; + else if (*p == '+') + flags |= COMMANDS_RECURSE; else if (*p == '-') child->noerror = 1; else if (!isblank (*p) && *p != '+') @@ -1137,7 +1183,7 @@ char *line, **restp; char *shell, *ifs; { - static char sh_chars[] = "#;\"*?[]&|<>(){}=$`"; + static char sh_chars[] = "#;\"*?[]&|<>(){}$`^"; static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", "wait", "while", "for", "case", "if", ":", ".", "break", "continue", @@ -1147,7 +1193,7 @@ register char *p; register char *ap; char *end; - int instring; + int instring, word_has_equals, seen_nonequals; char **new_argv = 0; if (restp != NULL) @@ -1181,7 +1227,7 @@ /* I is how many complete arguments have been found. */ i = 0; - instring = 0; + instring = word_has_equals = seen_nonequals = 0; for (p = line; *p != '\0'; ++p) { if (ap > end) @@ -1202,6 +1248,17 @@ /* Not a special char. */ switch (*p) { + case '=': + /* Equals is a special character in leading words before the + first word with no equals sign in it. This is not the case + with sh -k, but we never get here when using nonstandard + shell flags. */ + if (! seen_nonequals) + goto slow; + word_has_equals = 1; + *ap++ = '='; + break; + case '\\': /* Backslash-newline combinations are eaten. */ if (p[1] == '\n') @@ -1253,6 +1310,16 @@ Terminate the text of the argument. */ *ap++ = '\0'; new_argv[++i] = ap; + + /* Update SEEN_NONEQUALS, which tells us if every word + heretofore has contained an `='. */ + seen_nonequals |= ! word_has_equals; + if (word_has_equals && ! seen_nonequals) + /* An `=' in a word before the first + word without one is magical. */ + goto slow; + word_has_equals = 0; /* Prepare for the next word. */ + /* If this argument is the command name, see if it is a built-in shell command. If so, have the shell handle it. */ diff -ruN make-3.68/job.h make-3.69/job.h --- make-3.68/job.h Mon Feb 1 16:03:32 1993 +++ make-3.69/job.h Thu Oct 14 17:27:29 1993 @@ -29,7 +29,7 @@ unsigned int command_line; /* Index into above. */ char *command_ptr; /* Ptr into command_lines[command_line]. */ - int pid; /* Child process's ID number. */ + pid_t pid; /* Child process's ID number. */ unsigned int remote:1; /* Nonzero if executing remotely. */ unsigned int noerror:1; /* Nonzero if commands contained a `-'. */ diff -ruN make-3.68/main.c make-3.69/main.c --- make-3.68/main.c Wed Jul 14 18:56:38 1993 +++ make-3.69/main.c Wed Oct 27 18:14:41 1993 @@ -24,8 +24,6 @@ #include "getopt.h" -extern char *version_string; - extern void print_variable_data_base (); extern void print_dir_data_base (); extern void print_rule_data_base (); @@ -391,7 +389,6 @@ register char *cmd_defs; register unsigned int cmd_defs_len, cmd_defs_idx; char **p; - time_t now; struct dep *goals = 0; register struct dep *lastgoal; struct dep *read_makefiles; @@ -498,15 +495,26 @@ for (i = 0; envp[i] != 0; ++i) { register char *ep = envp[i]; - while (*ep++ != '=') - ; - (void) define_variable (envp[i], ep - envp[i] - 1, ep, o_env, 1); + while (*ep != '=') + ++ep; + define_variable (envp[i], 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 + is redefined in a makefile with `override'; it should then still + be exported, because it was originally in the environment. */ + ->export = v_export; } /* Decode the switches. */ decode_env_switches ("MAKEFLAGS", 9); +#if 0 + /* People write things like: + MFLAGS="CC=gcc -pipe" "CFLAGS=-g" + and we set the -p, -i and -e switches. Doesn't seem quite right. */ decode_env_switches ("MFLAGS", 6); +#endif decode_switches (argc, argv, 0); /* Print version information. */ @@ -553,7 +561,7 @@ while (*p != '\0') { - if (index (";'\"*?[]$<>(){}|&~`\\ \t\r\n\f\v", *p) != 0) + if (index ("^;'\"*?[]$<>(){}|&~`\\ \t\r\n\f\v", *p) != 0) cmd_defs[cmd_defs_idx++] = '\\'; cmd_defs[cmd_defs_idx++] = *p++; } @@ -738,6 +746,14 @@ set_default_suffixes (); + /* Define the file rules for the built-in suffix rules. These will later + be converted into pattern rules. We used to do this in + install_default_implicit_rules, but since that happens after reading + makefiles, it results in the built-in pattern rules taking precedence + over makefile-specified suffix rules, which is wrong. */ + + install_default_suffix_rules (); + /* Define some internal and special variables. */ define_automatic_variables (); @@ -759,7 +775,9 @@ /* Decode switches again, in case the variables were set by the makefile. */ decode_env_switches ("MAKEFLAGS", 9); +#if 0 decode_env_switches ("MFLAGS", 6); +#endif /* Set up MAKEFLAGS and MFLAGS again, so they will be right. */ @@ -774,7 +792,14 @@ snap_deps (); - /* Install the default implicit rules. + /* Convert old-style suffix rules to pattern rules. It is important to + do this before installing the built-in pattern rules below, so that + makefile-specified suffix rules take precedence over built-in pattern + rules. */ + + convert_to_pattern (); + + /* Install the default implicit pattern rules. This used to be done before reading the makefiles. But in that case, built-in pattern rules were in the chain before user-defined ones, so they matched first. */ @@ -781,10 +806,6 @@ install_default_implicit_rules (); - /* Convert old-style suffix rules to pattern rules. */ - - convert_to_pattern (); - /* Compute implicit rule limits. */ count_implicit_rule_limits (); @@ -794,8 +815,8 @@ build_vpath_lists (); /* Mark files given with -o flags as very old (00:00:01.00 Jan 1, 1970) - and as having been updated already, and files given with -W flags - as brand new (time-stamp of now). */ + and as having been updated already, and files given with -W flags as + brand new (time-stamp as far as possible into the future). */ if (old_files != 0) for (p = old_files->list; *p != 0; ++p) @@ -809,11 +830,10 @@ if (new_files != 0) { - now = time ((time_t *) 0); for (p = new_files->list; *p != 0; ++p) { f = enter_command_line_file (*p); - f->last_mtime = now; + f->last_mtime = NEW_MTIME; } } @@ -1638,14 +1658,24 @@ *p = '\0'; } - (void) define_variable ("MAKEFLAGS", 9, - /* On Sun, the value of MFLAGS starts with a `-' but - the value of MAKEFLAGS lacks the `-'. - Be compatible with this unless FLAGSTRING starts - with a long option `--foo', since removing the - first dash would result in the bogus `-foo'. */ - flagstring[1] == '-' ? flagstring : &flagstring[1], - o_env, 0); + define_variable ("MAKEFLAGS", 9, + /* On Sun, the value of MFLAGS starts with a `-' but + the value of MAKEFLAGS lacks the `-'. + Be compatible with this unless FLAGSTRING starts + with a long option `--foo', since removing the + first dash would result in the bogus `-foo'. */ + flagstring[1] == '-' ? flagstring : &flagstring[1], + /* This used to use o_env, but that lost when a + makefile defined MAKEFLAGS. Makefiles set + MAKEFLAGS to add switches, but we still want + to redefine its value with the full set of + switches. Of course, an override or command + definition will still take precedence. */ + o_file, 0) + /* Always export MAKEFLAGS. */ + ->export = v_export; + /* Since MFLAGS is not parsed for flags, there is no reason to + override any makefile redefinition. */ (void) define_variable ("MFLAGS", 6, flagstring, o_env, 0); } @@ -1656,7 +1686,6 @@ { static int printed_version = 0; - extern char *remote_description; char *precede = print_data_base_flag ? "# " : ""; if (printed_version) diff -ruN make-3.68/make-stds.texi make-3.69/make-stds.texi --- make-3.68/make-stds.texi Fri Jul 23 18:08:18 1993 +++ make-3.69/make-stds.texi Thu Aug 12 16:35:14 1993 @@ -170,7 +170,10 @@ # Run install-info only if it exists. # Use `if' instead of just prepending `-' to the # line so we notice real errors from install-info. - if install-info --version >/dev/null 2>&1; then \ +# We use `$(SHELL) -c' because some shells do not +# fail gracefully when there is an unknown command. + if $(SHELL) -c 'install-info --version' \ + >/dev/null 2>&1; then \ install-info --infodir=$(infodir) $$d/foo.info; \ else true; fi @end smallexample diff -ruN make-3.68/make.h make-3.69/make.h --- make-3.68/make.h Fri Jul 23 16:04:37 1993 +++ make-3.69/make.h Wed Oct 27 20:09:14 1993 @@ -21,7 +21,10 @@ #pragma alloca #endif -#include "config.h" +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because make.h was found in $srcdir). */ +#include #undef HAVE_CONFIG_H #define HAVE_CONFIG_H @@ -37,6 +40,12 @@ #include #include #include +#ifdef HAVE_SYS_TIMEB_H +/* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in that bombs + unless has been included first. Does every system have a + ? If any does not, configure should check for it. */ +#include +#endif #include #include @@ -62,6 +71,10 @@ #undef POSIX #endif +#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) +#define POSIX +#endif + #if !defined (HAVE_SYS_SIGLIST) && defined (HAVE__SYS_SIGLIST) #define sys_siglist _sys_siglist #define HAVE_SYS_SIGLIST /* Now we have it. */ @@ -257,9 +270,9 @@ extern char *dir_name (); extern void define_default_variables (); -extern void set_default_suffixes (), install_default_implicit_rules (); -extern void convert_to_pattern (), count_implicit_rule_limits (); -extern void create_pattern_rule (); +extern void set_default_suffixes (), install_default_suffix_rules (); +extern void install_default_implicit_rules (), count_implicit_rule_limits (); +extern void convert_to_pattern (), create_pattern_rule (); extern void build_vpath_lists (), construct_vpath_list (); extern int vpath_search (); @@ -315,6 +328,7 @@ extern char *program; extern char *starting_directory; extern unsigned int makelevel; +extern char *version_string, *remote_description; extern unsigned int commands_started; diff -ruN make-3.68/make.texinfo make-3.69/make.texinfo --- make-3.68/make.texinfo Mon Jul 26 15:10:51 1993 +++ make-3.69/make.texinfo Wed Nov 3 07:21:47 1993 @@ -5,12 +5,12 @@ @setchapternewpage odd @c %**end of header -@c For publication, format makebook.texi instead of using this file directly. +@c FSF publishers: format makebook.texi instead of using this file directly. -@set EDITION 0.43 -@set VERSION 3.68 Beta -@set UPDATED 26 July 1993 -@set UPDATE-MONTH July 1993 +@set EDITION 0.44 +@set VERSION 3.69 Beta +@set UPDATED 3 November 1993 +@set UPDATE-MONTH November 1993 @c finalout @@ -1558,10 +1558,11 @@ @samp{.o} file becomes a dependency of @file{foo} and will be recompiled if necessary. -But what if you delete all the @samp{.o} files? Then @samp{*.o} will -expand into @emph{nothing}. The target @file{foo} will have no -dependencies and would be remade by linking no object files. This is not -what you want! +But what if you delete all the @samp{.o} files? When a wildcard matches +no files, it is left as it is, so then @file{foo} will depend on the +oddly-named file @file{*.o}. Since so such file is likely to exist, +@code{make} will give you an error saying it cannot figure out how to +make @file{*.o}. This is not what you want! Actually it is possible to obtain the desired result with wildcard expansion, but you need more sophisticated techniques, including the @@ -1583,12 +1584,17 @@ places, you need to use the @code{wildcard} function, like this: @example -$(wildcard @var{pattern}) +$(wildcard @var{pattern}@dots{}) @end example @noindent -This string, used anywhere in a makefile, is replaced by a space-separated -list of names of existing files that match the pattern @var{pattern}. +This string, used anywhere in a makefile, is replaced by a +space-separated list of names of existing files that match one of the +given file name patterns. If no existing file name matches a pattern, +then that pattern is omitted from the output of the @code{wildcard} +function. Note that this is different from how unmatched wildcards +behave in rules, where they are used verbatim rather than ignored +(@pxref{Wildcard Pitfall}). One use of the @code{wildcard} function is to get a list of all the C source files in a directory, like this: @@ -2571,12 +2577,19 @@ @example @group %.d: %.c - $(CC) -M $(CPPFLAGS) $< | sed 's/$*.o/& $@@/g' > $@@ + $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< | sed '\''s/$*.o/& $@@/g'\'' > $@@' @end group @end example @noindent -@xref{Pattern Rules}, for information on defining pattern rules. +@xref{Pattern Rules}, for information on defining pattern rules. The +@samp{-e} flag to the shell makes it exit immediately if the +@code{$(CC)} command fails (exits with a nonzero status). Normally the +shell exits with the status of the last command in the pipeline +(@code{sed} in this case), so @code{make} would not notice a nonzero +status from the compiler. +@cindex @code{-e} (shell flag) + @cindex @code{sed} (shell command) The purpose of the @code{sed} command is to translate (for example): @@ -3271,12 +3284,11 @@ @cindex @code{--jobs}, and recursion @cindex recursion, and @code{-j} @cindex job slots, and recursion -The @samp{-j} option is a special case -(@pxref{Parallel, ,Parallel Execution}). If you set -it to some numeric value, @samp{-j 1} is always put into +The @samp{-j} option is a special case (@pxref{Parallel, ,Parallel Execution}). +If you set it to some numeric value, @samp{-j 1} is always put into @code{MAKEFLAGS} instead of the value you specified. This is because if -the @w{@samp{-j}} option were passed down to sub-@code{make}s, you would get -many more jobs running in parallel than you asked for. If you give +the @w{@samp{-j}} option were passed down to sub-@code{make}s, you would +get many more jobs running in parallel than you asked for. If you give @samp{-j} with no numeric argument, meaning to run as many jobs as possible in parallel, this is passed down, since multiple infinities are no more than one.@refill @@ -3299,8 +3311,10 @@ @vindex MFLAGS A similar variable @code{MFLAGS} exists also, for historical compatibility. -It has the same value as @code{MAKEFLAGS} except that a hyphen is added at -the beginning if it is not empty. @code{MFLAGS} was traditionally used +It has the same value as @code{MAKEFLAGS} except that it always begins with +a hyphen unless it is empty (@code{MAKEFLAGS} begins with a hyphen only when +it begins with an option that has no single-letter version, such as +@samp{--warn-undefined-variables}). @code{MFLAGS} was traditionally used explicitly in the recursive @code{make} command, like this: @example @@ -3316,12 +3330,19 @@ @cindex setting options in makefiles @cindex options, setting in makefiles The @code{MAKEFLAGS} and @code{MFLAGS} variables can also be useful if you -want to have certain options, such as @samp{-k} -(@pxref{Options Summary, ,Summary of Options}) -set each time you run @code{make}. Just put @samp{MAKEFLAGS=k} or -@w{@samp{MFLAGS=-k}} in your environment. These variables may also be -set in makefiles, so a makefile can specify additional flags that should -also be in effect for that makefile.@refill +want to have certain options, such as @samp{-k} (@pxref{Options Summary, +,Summary of Options}), set each time you run @code{make}. You simply put a +value for @code{MAKEFLAGS} or @code{MFLAGS} in your environment. These +variables may also be set in makefiles, so a makefile can specify additional +flags that should also be in effect for that makefile. + +When @code{make} interprets the value of @code{MAKEFLAGS} or @code{MFLAGS} +(either from the environment or from a makefile), it first prepends a hyphen +if the value does not already begin with one. Then it chops the value into +words separated by blanks, and parses these words as if they were options +given on the command line (except that @samp{-C}, @samp{-f}, @samp{-h}, +@samp{-o}, @samp{-W}, and their long-named versions are ignored; and there +is no error for an invalid option). If you do put @code{MAKEFLAGS} or @code{MFLAGS} in your environment, you should be sure not to include any options that will drastically affect @@ -7049,8 +7070,8 @@ the target name minus the suffix. For example, if the target name is @samp{foo.c}, then @samp{$*} is set to @samp{foo}, since @samp{.c} is a suffix. GNU @code{make} does this bizarre thing only for compatibility -with other implementations of @code{make}. You should generally never use -@samp{$*} except in implicit rules or static pattern rules.@refill +with other implementations of @code{make}. You should generally avoid +using @samp{$*} except in implicit rules or static pattern rules.@refill If the target name in an explicit rule does not end with a recognized suffix, @samp{$*} is set to the empty string for that rule. @@ -7446,9 +7467,10 @@ converted to equivalent pattern rules once the makefiles have been read in. For an archive member target of the form -@samp{@var{archive}(@var{member})}, the following algorithm is run twice, -first using @samp{(@var{member})} as the target @var{t}, and second using -the entire target if the first run found no rule.@refill +@samp{@var{archive}(@var{member})}, the following algorithm is run +twice, first using the entire target name @var{t}, and second using +@samp{(@var{member})} as the target @var{t} if the first run found no +rule.@refill @enumerate @item @@ -7976,6 +7998,10 @@ @item Various new built-in implicit rules. @xref{Catalogue of Rules, ,Catalogue of Implicit Rules}. + +@item +The built-in variable @samp{MAKE_VERSION} gives the version number of +@code{make}. @end itemize @node Missing, Makefile Conventions, Features, Top @@ -8043,6 +8069,14 @@ (@pxref{Directory Search, ,Searching Directories for Dependencies}) have their names changed inside command strings. We feel it is much cleaner to always use automatic variables and thus make this feature obsolete.@refill + +@item +In some Unix @code{make}s, the automatic variable @code{$*} appearing in +the dependencies of a rule has the amazingly strange ``feature'' of +expanding to the full name of the @emph{target of that rule}. We cannot +imagine what went on in the minds of Unix @code{make} developers to do +this; it is utterly inconsistent with the normal definition of @code{$*}. +@vindex * @r{(automatic variable), unsupported bizarre usage} @item In some Unix @code{make}s, implicit rule search diff -ruN make-3.68/misc.c make-3.69/misc.c --- make-3.68/misc.c Thu Apr 15 18:42:20 1993 +++ make-3.69/misc.c Sun Aug 1 16:03:45 1993 @@ -509,9 +509,13 @@ if (! debug_flag) return; - printf ("%s access: user %d (real %d), group %d (real %d)\n", - flavor, geteuid (), getuid (), getegid (), getgid ()); - fflush (stdout); + /* All the other debugging messages go to stdout, + 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 ()); + fflush (stderr); } diff -ruN make-3.68/read.c make-3.69/read.c --- make-3.68/read.c Wed Jul 14 22:25:00 1993 +++ make-3.69/read.c Mon Oct 25 15:25:17 1993 @@ -552,6 +552,12 @@ | (noerror ? RM_DONTCARE : 0))); } + /* Free any space allocated by conditional_line. */ + if (conditionals->ignoring) + free (conditionals->ignoring); + if (conditionals->seen_else) + free (conditionals->seen_else); + /* Restore state. */ conditionals = save; reading_filename = filename; @@ -1531,7 +1537,11 @@ lastn = n; n = n->next; } - if (n != 0) + if (n != 0 + /* Ignore something starting with `(', as that cannot actually + be an archive-member reference (and treating it as such + results in an empty file name, which causes much lossage). */ + && n->name[0] != '(') { /* N is the first element in the archive group. Its name looks like "lib(mem" (with no closing `)'). */ diff -ruN make-3.68/remake.c make-3.69/remake.c --- make-3.68/remake.c Mon Apr 12 16:52:45 1993 +++ make-3.69/remake.c Wed Oct 27 18:14:26 1993 @@ -341,17 +341,15 @@ if (try_implicit_rule (file, depth)) DEBUGPR ("Found an implicit rule for `%s'.\n"); else - { - DEBUGPR ("No implicit rule found for `%s'.\n"); - if (!file->is_target - && default_file != 0 && default_file->cmds != 0) - { - DEBUGPR ("Using default commands for `%s'.\n"); - file->cmds = default_file->cmds; - } - } + DEBUGPR ("No implicit rule found for `%s'.\n"); file->tried_implicit = 1; } + if (file->cmds == 0 && !file->is_target + && default_file != 0 && default_file->cmds != 0) + { + DEBUGPR ("Using default commands for `%s'.\n"); + file->cmds = default_file->cmds; + } /* Update all non-intermediate files we depend on, if necessary, and see whether any of them is more recent than this file. */ @@ -523,7 +521,7 @@ must_make = 1; DEBUGPR ("Target `%s' is double-colon and has no dependencies.\n"); } - else if (file->is_target && !deps_changed && file->cmds == 0) + else if (!noexist && file->is_target && !deps_changed && file->cmds == 0) { must_make = 0; DEBUGPR ("No commands for `%s' and no dependencies actually changed.\n"); @@ -616,7 +614,7 @@ { if (just_print_flag || question_flag || (file->is_target && file->cmds == 0)) - file->last_mtime = time ((time_t *) 0); + file->last_mtime = NEW_MTIME; else file->last_mtime = 0; } diff -ruN make-3.68/remote-stub.c make-3.69/remote-stub.c --- make-3.68/remote-stub.c Tue Mar 10 17:15:46 1992 +++ make-3.69/remote-stub.c Mon Aug 9 18:21:56 1993 @@ -1,9 +1,9 @@ -/* Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1988, 1989, 1992, 1993 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 1, or (at your option) +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, @@ -59,6 +59,7 @@ int *exit_code_ptr, *signal_ptr, *coredump_ptr; int block; { + errno = ECHILD; return -1; } diff -ruN make-3.68/rule.c make-3.69/rule.c --- make-3.68/rule.c Thu Jul 8 21:22:33 1993 +++ make-3.69/rule.c Thu Oct 21 16:48:08 1993 @@ -164,7 +164,7 @@ char *target, *source; struct commands *cmds; { - char *targname, *depname; + char *targname, *targpercent, *depname; char **names, **percents; struct dep *deps; unsigned int len; @@ -172,7 +172,10 @@ if (target == 0) /* Special case: TARGET being nil means we are defining a `.X.a' suffix rule; the target pattern is always `(%.o)'. */ - targname = savestring ("(%.o)", 5); + { + targname = savestring ("(%.o)", 5); + targpercent = targname + 1; + } else { /* Construct the target name. */ @@ -180,11 +183,13 @@ targname = xmalloc (1 + len + 1); targname[0] = '%'; bcopy (target, targname + 1, len + 1); + targpercent = targname; } names = (char **) xmalloc (2 * sizeof (char *)); percents = (char **) alloca (2 * sizeof (char *)); - names[0] = percents[0] = targname; + names[0] = targname; + percents[0] = targpercent; names[1] = percents[1] = 0; if (source == 0) @@ -503,13 +508,37 @@ /* Print the data base of rules. */ +static void /* Useful to call from gdb. */ +print_rule (r) + struct rule *r; +{ + register unsigned int i; + register struct dep *d; + + for (i = 0; r->targets[i] != 0; ++i) + { + fputs (r->targets[i], stdout); + if (r->targets[i + 1] != 0) + putchar (' '); + else + putchar (':'); + } + if (r->terminal) + putchar (':'); + + for (d = r->deps; d != 0; d = d->next) + printf (" %s", dep_name (d)); + putchar ('\n'); + + if (r->cmds != 0) + print_commands (r->cmds); +} + void print_rule_data_base () { register unsigned int rules, terminal; register struct rule *r; - register struct dep *d; - register unsigned int i; puts ("\n# Implicit Rules"); @@ -519,26 +548,10 @@ ++rules; putchar ('\n'); - for (i = 0; r->targets[i] != 0; ++i) - { - fputs (r->targets[i], stdout); - if (r->targets[i + 1] != 0) - putchar (' '); - else - putchar (':'); - } - if (r->terminal) - { - ++terminal; - putchar (':'); - } - - for (d = r->deps; d != 0; d = d->next) - printf (" %s", dep_name (d)); - putchar ('\n'); + print_rule (r); - if (r->cmds != 0) - print_commands (r->cmds); + if (r->terminal) + ++terminal; } if (rules == 0) diff -ruN make-3.68/signame.c make-3.69/signame.c --- make-3.68/signame.c Mon Jul 26 16:20:42 1993 +++ make-3.69/signame.c Mon Sep 20 16:03:20 1993 @@ -19,9 +19,16 @@ #include /* Some systems need this for . */ #include -#ifdef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else #include "config.h" #endif +#endif /* Some systems do not define NSIG in . */ #ifndef NSIG @@ -45,7 +52,14 @@ static const char undoc[] = "unknown signal"; const char *sys_siglist[NSIG]; -#endif /* !HAVE_SYS_SIGLIST */ + +#else /* HAVE_SYS_SIGLIST. */ + +#ifndef SYS_SIGLIST_DECLARED +extern char *sys_siglist[]; +#endif /* Not SYS_SIGLIST_DECLARED. */ + +#endif /* Not HAVE_SYS_SIGLIST. */ /* Table of abbreviations for signals. Note: A given number can appear more than once with different abbreviations. */ diff -ruN make-3.68/texinfo.tex make-3.69/texinfo.tex --- make-3.68/texinfo.tex Tue Jul 27 12:50:36 1993 +++ make-3.69/texinfo.tex Tue Sep 28 16:01:07 1993 @@ -22,7 +22,7 @@ %You are forbidden to forbid anyone else to use, share and improve %what you give them. Help stamp out software-hoarding! -\def\texinfoversion{2.112} +\def\texinfoversion{2.115} \message{Loading texinfo package [Version \texinfoversion]:} % Print the version number if in a .fmt file. @@ -1079,10 +1079,17 @@ % and arrange explicitly to hyphenate an a dash. % -- rms. { -\catcode `\-=\active -\catcode `\_=\active -\global\def\code{\begingroup \catcode `\-=\active \let-\codedash \let_\codeunder \codex} +\catcode`\-=\active +\catcode`\_=\active +\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} +% The following is used by \doprintindex to insure that long function names +% wrap around. It is necessary for - and _ to be active before the index is +% read from the file, as \entry parses the arguments long before \code is +% ever called. -- mycroft +\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} } +\def\realdash{-} +\def\realunder{_} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\normalunderscore\discretionary{}{}{}} \def\codex #1{\tclose{#1}\endgroup} @@ -1858,8 +1865,9 @@ \tex \dobreak \chapheadingskip {10000} \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other - \catcode`\$=\other\catcode`\_=\other + \catcode`\$=\other \catcode`\~=\other + \indexbreaks % % The following don't help, since the chars were translated % when the raw index was written, and their fonts were discarded @@ -1952,10 +1960,14 @@ % % Insert the text of the index entry. TeX will do line-breaking on it. #1% - % If there are no page numbers, don't output a line of dots. - \def\tempa{#2} - \def\tempb{} - \ifx\tempa\tempb\ \else + % The following is kluged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#2}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd\ \else% % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the @@ -2834,7 +2846,7 @@ % Define \obeyedspace to be our active space, whatever it is. This is % for use in \parsearg. -{\sepspaces % +{\sepspaces% \global\let\obeyedspace= } % This space is always present above and below environments. @@ -3501,17 +3513,17 @@ % \setref{foo} defines a cross-reference point named foo. \def\setref#1{% -%\dosetq{#1-title}{Ytitle}% +\dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{Ysectionnumberandtype}} \def\unnumbsetref#1{% -%\dosetq{#1-title}{Ytitle}% +\dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{Ynothing}} \def\appendixsetref#1{% -%\dosetq{#1-title}{Ytitle}% +\dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{Yappendixletterandtype}} @@ -3531,11 +3543,22 @@ \setbox1=\hbox{\printedmanual}% \setbox0=\hbox{\printednodename}% \ifdim \wd0=0pt% +% No printed node name was explicitly given. +\ifx SETxref-automatic-section-title % +% This line should make the actual chapter or section title appear inside +% the square brackets. Use the real section title if we have it. +\ifdim \wd1>0pt% +% It is in another manual, so we don't have it. +\def\printednodename{\ignorespaces #1} \else% +% We know the real title if we have the xref values. +\ifhavexrefs \def\printednodename{\refx{#1-title}}% +% Otherwise just copy the Info node name. +\else \def\printednodename{\ignorespaces #1} \fi% +\fi\def\printednodename{#1-title}% +\else% This line just uses the node name. \def\printednodename{\ignorespaces #1}% -%%% Uncommment the following line to make the actual chapter or section title -%%% appear inside the square brackets. -%\def\printednodename{#1-title}% -\fi% +\fi% ends \ifx SETxref-automatic-section-title +\fi% ends \ifdim \wd0 % % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does @@ -3571,7 +3594,7 @@ \def\Ypagenumber{\folio} -\def\Ytitle{\thischapter} +\def\Ytitle{\thissection} \def\Ynothing{} diff -ruN make-3.68/variable.c make-3.69/variable.c --- make-3.68/variable.c Wed Jul 14 21:59:03 1993 +++ make-3.69/variable.c Thu Aug 19 16:36:05 1993 @@ -347,11 +347,20 @@ { extern char default_shell[]; register struct variable *v; - char buf[100]; + char buf[200]; sprintf (buf, "%u", makelevel); (void) define_variable ("MAKELEVEL", 9, buf, o_env, 0); + sprintf (buf, "%s%s%s", + version_string, + (remote_description == 0 || remote_description[0] == '\0') + ? "" : "-", + (remote_description == 0 || remote_description[0] == '\0') + ? "" : remote_description); + (void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0); + + /* This won't override any definition, but it will provide one if there isn't one there. */ v = define_variable ("SHELL", 5, default_shell, o_default, 0); @@ -446,7 +455,6 @@ register struct variable *v; for (v = set->table[i]; v != 0; v = v->next) { - extern char *getenv (); unsigned int j = i % buckets; register struct variable_bucket *ov; register char *p = v->name; @@ -464,10 +472,9 @@ /* Only export default variables by explicit request. */ continue; - if (!export_all_variables + if (! export_all_variables && v->origin != o_command - && v->origin != o_env && v->origin != o_env_override - && !(v->origin == o_file && getenv (p) != 0)) + && v->origin != o_env && v->origin != o_env_override) continue; if (*p != '_' && (*p < 'A' || *p > 'Z') diff -ruN make-3.68/version.c make-3.69/version.c --- make-3.68/version.c Wed Jul 28 17:41:11 1993 +++ make-3.69/version.c Sun Nov 7 08:07:36 1993 @@ -1,4 +1,4 @@ -char *version_string = "3.68"; +char *version_string = "3.69"; /* Local variables: