diff options
54 files changed, 3198 insertions, 1555 deletions
@@ -1,3 +1,146 @@ +Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com> + + * Version 3.75.1 + + * compatMakefile (objs): Define & use theo $(GLOB) variable so + that it's removed correctly from build.sh.in when it's built. + +Fri Apr 4 20:21:18 1997 Eli Zaretskii <eliz@is.elta.co.il> + + * <lots>: Fixes to work in the DJGPP DOS environment. + +Mon Mar 31 02:42:52 1997 Paul D. Smith <psmith@baynetworks.com> + + * function.c (expand_function): Added new function $(wordlist). + + * make.texinfo (Filename Functions): Document $(wordlist) function. + + * vpath.c (build_vpath_lists): Construct the GPATH variable + information in the same manner we used to construct VPATH. + (gpath_search): New function to search GPATH. + + * make.h: Declare the new function. + + * remake.c (update_file_1): Call it, and keep VPATH if it's found. + + * make.texinfo (Search Algorithm): Document GPATH variable. + +Sun Mar 30 20:57:16 1997 Paul D. Smith <psmith@baynetworks.com> + + * main.c (handle_non_switch_argument): Defined the MAKECMDGOALS + variable to contain the user options passed in on the cmd line. + + * make.texinfo (Goals): Document MAKECMDGOALS variable. + + * remake.c (f_mtime): Print a warning if we detect a clock skew + error, rather than failing. + + * main.c (main): If we rebuild any makefiles and need to re-exec, + add "-o<mkfile>" options for each makefile rebuilt to avoid + infinite looping. + +Fri Mar 28 15:26:05 1997 Paul D. Smith <psmith@baynetworks.com> + + * job.c (construct_command_argv_internal): Track whether the last + arg in the cmd string was empty or not (Roland). + (construct_command_argv_internal): If the shell line is empty, + don't do anything (Roland). + + * glob/glob.h,glob/glob.c,glob/fnmatch.c,glob/fnmatch.h: Install + the latest changes from the GLIBC version of glob (Ulrich Drepper). + + * getloadavg.c,make-stds.texi: New version (Roland). + + * (ALL): Changed WIN32 to W32 or WINDOWS32 (RMS). + +Mon Mar 24 15:33:34 1997 Rob Tulloh <rob_tulloh@tivoli.com> + + * README.W32: Describe preliminary FAT support. + + * build_w32.bat: Use a variable for the final exe name. + + * dir.c (find_directory): W32: Find the filesystem type. + (dir_contents_file_exists_p): W32: for FAT filesystems, always + rehash since FAT doesn't change directory mtime on change. + + * main.c (handle_runtime_exceptions): W32: Add an + UnhandledExceptionFilter so that when make bombs due to ^C or a + bug, it won't cause a GUI requestor to pop up unless debug is + turned on. + (main): Call it. + +Mon Mar 24 00:57:34 1997 Paul D. Smith <psmith@baynetworks.com> + + * configure.in, config.h.in, config.ami, config.h-vms, config.h.w32: + Check for memmove() function. + + * make.h (bcopy): If memmove() available, define bcopy() to use it. + Otherwise just use bcopy(). Don't use memcpy(); it's not guaranteed + to handle overlapping moves. + + * read.c (read_makefile): Fix some uninitialized memory reads + (reported by Purify). + + * job.c (construct_command_argv_internal): Use bcopy() not + strcpy(); strcpy() isn't guaranteed to handle overlapping moves. + + * Makefile.in: Change install-info option ``--infodir'' to + ``--info-dir'' for use with new texinfo. + + * function.c (expand_function): $(basename) and $(suffix) should + only search for suffixes as far back as the last directory (e.g., + only the final filename in the path). + +Sun Mar 23 00:13:05 1997 Paul D. Smith <psmith@baynetworks.com> + + * make.texinfo: Add @dircategory/@direntry information. + (Top): Remove previous reference to (dir) (from RMS). + (Static Usage): Add "all:" rule to example. + (Automatic Dependencies): fix .d file creation example. + + * Install VPATH+ patch: + + * filedef.h (struct file): Add in hname field to store the hashed + filename, and a flag to remember if we're using the vpath filename + or not. Renamed a few functions for more clarity. + + * file.c (lookup_file,enter_file,file_hash_enter): Store filenames + in the hash table based on their "hash name". We can change this + while keeping the original target in "name". + (rehash_file): Renamed from "rename_file" to be more accurate. + Changes the hash name, but not the target name. + + * remake.c (update_file_1): Modify -d output for more detailed + VPATH info. If we don't need to rebuild, use the VPATH name. + (f_mtime): Don't search for vpath if we're ignoring it. Call + renamed function rehash_file. Call name_mtime instead of + file_mtime, to avoid infinite recursion since the file wasn't + actually renamed. + + * implicit.c (pattern_search): if we find an implicit file in + VPATH, save the original name not the VPATH name. + + * make.texinfo (Directory Search): Add a section on the new VPATH + functionality. + +Sun Dec 1 18:36:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * dir.c (file_exists_p, file_impossible, file_impossible_p): If + dirname is empty replace it by the name of the root directory. + Note that this doesn't work (yet) for W32, Amiga, or VMS. + +Tue Oct 08 13:57:03 1996 Rob Tulloh <tulloh@tivoli.com> + + * main.c (main): W32 bug fix for PATH vars. + +Tue Sep 17 1996 Paul Eggert <eggert@twinsun.com> + + * filedef.h (NEW_MTIME): Don't assume that time_t is a signed + 32-bit quantity. + + * make.h: (CHAR_BIT, INTEGER_TYPE_SIGNED, INTEGER_TYPE_MAXIMUM, + INTEGER_TYPE_MINIMUM): New macros. + Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com> * Version 3.75 released. @@ -11,17 +154,17 @@ Mon Aug 26 19:55:47 1996 Roland McGrath <roland@baalperazim.frob.com> Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com) - * w32/pathstuff.c: Turned convert_vpath_to_win32() into a + * w32/pathstuff.c: Turned convert_vpath_to_w32() into a real function. This was done so that VPATH could contain white space separated pathnames. Please note that directory paths (in VPATH/vpath context) containing white space are not - supported (just as they are not under Unix). See README.WIN32 + supported (just as they are not under Unix). See README.W32 for suggestions. * w32/include/pathstuff.h: Added prototype for the new - function convert_vpath_to_win32. Deleted macro for same. + function convert_vpath_to_w32. Deleted macro for same. - * README.WIN32: Added some notes about why I chose not to try + * README.W32: Added some notes about why I chose not to try and support pathnames which contain white space and some workaround suggestions. @@ -43,7 +186,7 @@ Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * vmsfunctions.c (vms_stat): `sys$dassgn (DevChan);' added by kkaempf. - * GNUmakefile (win32files): Add NMakefile. + * GNUmakefile (w32files): Add NMakefile. * NMakefile (LDFLAGS_debug): Value fixed by tulloh. @@ -61,7 +204,7 @@ Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * Version 3.74.6. - * GNUmakefile (win32files): New variable. + * GNUmakefile (w32files): New variable. (distfiles): Add it. * w32: Updated by Rob Tulloh. @@ -132,22 +275,22 @@ Wed May 15 17:37:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com> - * dir.c: WIN32 does not support inode. For now, fully qualified + * dir.c: W32 does not support inode. For now, fully qualified pathname along with st_mtime will be keys for files. Fixed problem where vpath can be confused when files are added to a directory after the directory has already been read in. The code now attempts to reread the directory if it discovers that the datestamp on the directory has changed since - it was cached by make. This problem only seems to occur on WIN32 - right now so it is lumped under port #ifdef WIN32. + it was cached by make. This problem only seems to occur on W32 + right now so it is lumped under port #ifdef WINDOWS32. - * function.c: WIN32: call subproc library (CreateProcess()) instead of + * function.c: W32: call subproc library (CreateProcess()) instead of fork/exec. - * job.c: WIN32: Added the code to do fork/exec/waitpid style processing - on WIN32 systems via calls to subproc library. + * job.c: W32: Added the code to do fork/exec/waitpid style processing + on W32 systems via calls to subproc library. - * main.c: WIN32: Several things added here. First, there is code + * main.c: W32: Several things added here. First, there is code for dealing with PATH and SHELL defaults. Make tries to figure out if the user has %PATH% set in the environment and sets it to %Path% if it is not set already. Make also looks to see if sh.exe @@ -160,65 +303,65 @@ Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com> debugging recursive calls to make where problems appear only in the sub-make. - * make.h: WIN32: A few macros and header files for WIN32 support. + * make.h: W32: A few macros and header files for W32 support. - * misc.c: WIN32: Added a function end_of_token_w32() to assist + * misc.c: W32: Added a function end_of_token_w32() to assist in parsing code in read.c. - * read.c: WIN32: Fixes similar to MSDOS which allow colon to + * read.c: W32: Fixes similar to MSDOS which allow colon to appear in filenames. Use of colon in filenames would otherwise confuse make. - * remake.c: WIN32: Added include of io.h to eliminate compiler + * remake.c: W32: Added include of io.h to eliminate compiler warnings. Added some code to default LIBDIR if it is not set - on WIN32. + on W32. - * variable.c: WIN32: Added support for detecting Path/PATH + * variable.c: W32: Added support for detecting Path/PATH and converting them to semicolon separated lists for make's internal use. New function sync_Path_environment() which is called in job.c and function.c before creating a new process. Caller must set Path in environment since we don't have fork() to do this for us. - * vpath.c: WIN32: Added detection for filenames containing + * vpath.c: W32: Added detection for filenames containing forward or backward slashes. - * NMakefile: WIN32: Visual C compatible makefile for use with nmake. + * NMakefile: W32: Visual C compatible makefile for use with nmake. Use this to build GNU make the first time on Windows NT or Windows 95. - * README.WIN32: WIN32: Contains some helpful notes. + * README.W32: W32: Contains some helpful notes. - * build_w32.bat: WIN32: If you don't like nmake, use this the first + * build_w32.bat: W32: If you don't like nmake, use this the first time you build GNU make on Windows NT or Windows 95. - * config.h.WIN32: WIN32 version of config.h + * config.h.W32: W32 version of config.h - * subproc.bat: WIN32: A bat file used to build the + * subproc.bat: W32: A bat file used to build the subproc library from the top-level NMakefile. Needed because WIndows 95 (nmake) doesn't allow you to cd in a make rule. * w32/include/dirent.h - * w32/compat/dirent.c: WIN32: opendir, readdir, closedir, etc. + * w32/compat/dirent.c: W32: opendir, readdir, closedir, etc. - * w32/include/pathstuff.h: WIN32: used by files needed functions + * w32/include/pathstuff.h: W32: used by files needed functions defined in pathstuff.c (prototypes). - * w32/include/sub_proc.h: WIN32: prototypes for subproc.lib functions. + * w32/include/sub_proc.h: W32: prototypes for subproc.lib functions. - * w32/include/w32err.h: WIN32: prototypes for w32err.c. + * w32/include/w32err.h: W32: prototypes for w32err.c. - * w32/pathstuff.c: WIN32: File and Path/Path conversion functions. + * w32/pathstuff.c: W32: File and Path/Path conversion functions. - * w32/subproc/build.bat: WIN32: build script for subproc library + * w32/subproc/build.bat: W32: build script for subproc library if you don't wish to use nmake. - * w32/subproc/NMakefile: WIN32: Visual C compatible makefile for use + * w32/subproc/NMakefile: W32: Visual C compatible makefile for use with nmake. Used to build subproc library. - * w32/subproc/misc.c: WIN32: subproc library support code - * w32/subproc/proc.h: WIN32: subproc library support code - * w32/subproc/sub_proc.c: WIN32: subproc library source code - * w32/subproc/w32err.c: WIN32: subproc library support code + * w32/subproc/misc.c: W32: subproc library support code + * w32/subproc/proc.h: W32: subproc library support code + * w32/subproc/sub_proc.c: W32: subproc library source code + * w32/subproc/w32err.c: W32: subproc library support code Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> diff --git a/GNUmakefile b/GNUmakefile index dc34409..a4d3b36 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -42,7 +42,9 @@ endif # Get most of the information from the Unix-compatible makefile. include compatMakefile -MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES) +MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES) + +CVS = cvs # Remove autoconf magic. prefix = /usr/local @@ -58,10 +60,10 @@ config.h.in: $(AC_MACRODIR)/acconfig.h endif configure: configure.in aclocal.m4 autoconf $(ACFLAGS) - test -d CVS && cvs commit -m'autoconf $(ACFLAGS)' $@ + -test -d CVS && $(CVS) commit -m'autoconf $(ACFLAGS)' $@ config.h.in: configure.in aclocal.m4 autoheader $(ACFLAGS) - test -d CVS && cvs commit -m'autoheader $(ACFLAGS)' $@ + -test -d CVS && $(CVS) commit -m'autoheader $(ACFLAGS)' $@ ifdef customs defines := $(defines) -Ipmake/customs -Ipmake/lib/include @@ -154,7 +156,7 @@ $(globfiles): stamp-glob ; stamp-glob: $(libc-srcdir)/posix/glob.tar -rm -f stamp-glob glob/* tar xvf $< glob - cvs commit -m'Updated from libc' glob + $(CVS) commit -m'Updated from libc' glob touch $@ $(libc-srcdir)/posix/glob.tar: force $(MAKE) -C $(@D) $(@F) no_deps=t @@ -177,7 +179,7 @@ Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep) echo '# Automatically generated dependencies.'; \ sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \ ) > $@ - cvs commit -mRegenerated $@ + $(CVS) commit -mRegenerated $@ .SUFFIXES: .dep # Maintain the automatically-generated dependencies. @@ -202,7 +204,7 @@ build.sh.in: build.template compatMakefile $< > $@.new chmod a+x $@.new mv -f $@.new $@ - cvs commit -mRegenerated $@ + $(CVS) commit -mRegenerated $@ # Make the distribution tar files. @@ -222,21 +224,22 @@ vmsfiles = config.h-vms makefile.com makefile.vms readme.vms \ vmsdir.h vmsfunctions.c vmsify.c amigafiles = README.Amiga config.ami Makefile.ami SCOPTIONS SMakefile \ amiga.c amiga.h make.lnk -win32files = README.WIN32 build_w32.bat config.h.WIN32 subproc.bat NMakefile \ - $(addprefix w32/,pathstuff.c compat/dirent.c include/dirent.h \ - include/pathstuff.h include/sub_proc.h \ - include/w32err.h subproc/NMakefile \ - subproc/build.bat subproc/misc.c \ - subproc/proc.h subproc/sub_proc.c \ - subproc/w32err.c) +dosfiles = README.DOS dosbuild.bat +w32files = README.W32 build_w32.bat config.h.W32 subproc.bat NMakefile \ + $(addprefix w32/,pathstuff.c compat/dirent.c include/dirent.h \ + include/pathstuff.h include/sub_proc.h \ + include/w32err.h subproc/NMakefile \ + subproc/build.bat subproc/misc.c \ + subproc/proc.h subproc/sub_proc.c \ + subproc/w32err.c) distfiles=README INSTALL COPYING ChangeLog NEWS \ configure Makefile.in configure.in build.sh.in mkinstalldirs \ configh.dos configure.bat \ - $(amigafiles) $(vmsfiles) $(win32files) \ + $(amigafiles) $(vmsfiles) $(w32files) $(dosfiles) \ aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \ make.texinfo make-stds.texi \ - make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \ - install-sh \ + $(wildcard make.?? make.??s make.toc make.aux) make.man texinfo.tex \ + TAGS tags install-sh \ make.info make.info* ifndef dist-flavor @@ -244,7 +247,7 @@ dist-flavor = alpha endif .PHONY: cvs-mark cvs-mark: $(distfiles) - cvs tag -F make-$(subst .,-,$(version)) + $(CVS) tag -F make-$(subst .,-,$(version)) dist: local-inst .PHONY: local-inst @@ -268,7 +271,7 @@ $(alpha-dir)/%: % sed 's/VERSION/$(version)/' < $< > $@ # Make sure I don't edit it by accident. chmod a-w $@ - cvs commit -m'Regenerated for $(version)' $@ + $(CVS) commit -m'Regenerated for $(version)' $@ define make-tar @rm -fr make-$(version) diff --git a/Makefile.in b/Makefile.in index ace70fb..12c7654 100644 --- a/Makefile.in +++ b/Makefile.in @@ -206,7 +206,7 @@ $(infodir)/make.info: make.info # fail gracefully when there is an unknown command. if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \ - install-info --infodir=$(infodir) $$dir/make.info; \ + install-info --info-dir=$(infodir) $$dir/make.info; \ else true; fi $(mandir)/$(manprefix)make.$(manext): make.man @@ -271,33 +271,472 @@ $(objs): config.h # Automatically generated dependencies will be put at the end of the file. # Automatically generated dependencies. -commands.o: commands.c make.h dep.h filedef.h variable.h job.h \ - commands.h -job.o: job.c make.h job.h filedef.h commands.h variable.h -dir.o: dir.c make.h -file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h -misc.o: misc.c make.h dep.h -main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \ - getopt.h -read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \ - glob/glob.h -remake.o: remake.c make.h filedef.h job.h commands.h dep.h -rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \ - rule.h -implicit.o: implicit.c make.h rule.h dep.h filedef.h -default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \ - variable.h -variable.o: variable.c make.h dep.h filedef.h job.h commands.h \ - variable.h -expand.o: expand.c make.h filedef.h job.h commands.h variable.h -function.o: function.c make.h filedef.h variable.h dep.h job.h \ - commands.h -vpath.o: vpath.c make.h filedef.h variable.h +commands.o: commands.c +commands.o: ./make.h +commands.o: /usr/include/sys/types.h +commands.o: /usr/include/sys/stdtypes.h +commands.o: /usr/include/sys/sysmacros.h +commands.o: /usr/include/sys/stat.h +commands.o: /usr/include/sys/types.h +commands.o: /usr/include/signal.h +commands.o: /usr/include/sys/signal.h +commands.o: /usr/include/vm/faultcode.h +commands.o: /usr/include/sys/stdtypes.h +commands.o: /usr/include/stdio.h +commands.o: /usr/include/ctype.h +commands.o: /usr/include/time.h +commands.o: /usr/include/sys/stdtypes.h +commands.o: /usr/include/errno.h +commands.o: /usr/include/sys/errno.h +commands.o: ./signame.h +commands.o: /usr/include/strings.h +commands.o: ./dep.h +commands.o: ./filedef.h +commands.o: ./variable.h +commands.o: ./job.h +commands.o: ./commands.h +job.o: job.c +job.o: ./make.h +job.o: /usr/include/sys/types.h +job.o: /usr/include/sys/stdtypes.h +job.o: /usr/include/sys/sysmacros.h +job.o: /usr/include/sys/stat.h +job.o: /usr/include/sys/types.h +job.o: /usr/include/signal.h +job.o: /usr/include/sys/signal.h +job.o: /usr/include/vm/faultcode.h +job.o: /usr/include/sys/stdtypes.h +job.o: /usr/include/stdio.h +job.o: /usr/include/ctype.h +job.o: /usr/include/time.h +job.o: /usr/include/sys/stdtypes.h +job.o: /usr/include/errno.h +job.o: /usr/include/sys/errno.h +job.o: ./signame.h +job.o: /usr/include/strings.h +job.o: ./job.h +job.o: ./filedef.h +job.o: ./commands.h +job.o: ./variable.h +job.o: /usr/include/assert.h +job.o: /usr/include/sys/file.h +job.o: /usr/include/sys/types.h +job.o: /usr/include/sys/fcntlcom.h +job.o: /usr/include/sys/stdtypes.h +job.o: /usr/include/sys/stat.h +dir.o: dir.c +dir.o: ./make.h +dir.o: /usr/include/sys/types.h +dir.o: /usr/include/sys/stdtypes.h +dir.o: /usr/include/sys/sysmacros.h +dir.o: /usr/include/sys/stat.h +dir.o: /usr/include/sys/types.h +dir.o: /usr/include/signal.h +dir.o: /usr/include/sys/signal.h +dir.o: /usr/include/vm/faultcode.h +dir.o: /usr/include/sys/stdtypes.h +dir.o: /usr/include/stdio.h +dir.o: /usr/include/ctype.h +dir.o: /usr/include/time.h +dir.o: /usr/include/sys/stdtypes.h +dir.o: /usr/include/errno.h +dir.o: /usr/include/sys/errno.h +dir.o: ./signame.h +dir.o: /usr/include/strings.h +file.o: file.c +file.o: ./make.h +file.o: /usr/include/sys/types.h +file.o: /usr/include/sys/stdtypes.h +file.o: /usr/include/sys/sysmacros.h +file.o: /usr/include/sys/stat.h +file.o: /usr/include/sys/types.h +file.o: /usr/include/signal.h +file.o: /usr/include/sys/signal.h +file.o: /usr/include/vm/faultcode.h +file.o: /usr/include/sys/stdtypes.h +file.o: /usr/include/stdio.h +file.o: /usr/include/ctype.h +file.o: /usr/include/time.h +file.o: /usr/include/sys/stdtypes.h +file.o: /usr/include/errno.h +file.o: /usr/include/sys/errno.h +file.o: ./signame.h +file.o: /usr/include/strings.h +file.o: ./dep.h +file.o: ./filedef.h +file.o: ./job.h +file.o: ./commands.h +file.o: ./variable.h +file.o: /usr/include/assert.h +misc.o: misc.c +misc.o: ./make.h +misc.o: /usr/include/sys/types.h +misc.o: /usr/include/sys/stdtypes.h +misc.o: /usr/include/sys/sysmacros.h +misc.o: /usr/include/sys/stat.h +misc.o: /usr/include/sys/types.h +misc.o: /usr/include/signal.h +misc.o: /usr/include/sys/signal.h +misc.o: /usr/include/vm/faultcode.h +misc.o: /usr/include/sys/stdtypes.h +misc.o: /usr/include/stdio.h +misc.o: /usr/include/ctype.h +misc.o: /usr/include/time.h +misc.o: /usr/include/sys/stdtypes.h +misc.o: /usr/include/errno.h +misc.o: /usr/include/sys/errno.h +misc.o: ./signame.h +misc.o: /usr/include/strings.h +misc.o: ./dep.h +main.o: main.c +main.o: ./make.h +main.o: /usr/include/sys/types.h +main.o: /usr/include/sys/stdtypes.h +main.o: /usr/include/sys/sysmacros.h +main.o: /usr/include/sys/stat.h +main.o: /usr/include/sys/types.h +main.o: /usr/include/signal.h +main.o: /usr/include/sys/signal.h +main.o: /usr/include/vm/faultcode.h +main.o: /usr/include/sys/stdtypes.h +main.o: /usr/include/stdio.h +main.o: /usr/include/ctype.h +main.o: /usr/include/time.h +main.o: /usr/include/sys/stdtypes.h +main.o: /usr/include/errno.h +main.o: /usr/include/sys/errno.h +main.o: ./signame.h +main.o: /usr/include/strings.h +main.o: ./dep.h +main.o: ./filedef.h +main.o: ./variable.h +main.o: ./job.h +main.o: ./commands.h +main.o: ./getopt.h +main.o: /usr/include/assert.h +read.o: read.c +read.o: ./make.h +read.o: /usr/include/sys/types.h +read.o: /usr/include/sys/stdtypes.h +read.o: /usr/include/sys/sysmacros.h +read.o: /usr/include/sys/stat.h +read.o: /usr/include/sys/types.h +read.o: /usr/include/signal.h +read.o: /usr/include/sys/signal.h +read.o: /usr/include/vm/faultcode.h +read.o: /usr/include/sys/stdtypes.h +read.o: /usr/include/stdio.h +read.o: /usr/include/ctype.h +read.o: /usr/include/time.h +read.o: /usr/include/sys/stdtypes.h +read.o: /usr/include/errno.h +read.o: /usr/include/sys/errno.h +read.o: ./signame.h +read.o: /usr/include/strings.h +read.o: ./dep.h +read.o: ./filedef.h +read.o: ./job.h +read.o: ./commands.h +read.o: ./variable.h +read.o: ./glob/glob.h +read.o: /usr/include/pwd.h +read.o: /usr/include/sys/types.h +remake.o: remake.c +remake.o: ./make.h +remake.o: /usr/include/sys/types.h +remake.o: /usr/include/sys/stdtypes.h +remake.o: /usr/include/sys/sysmacros.h +remake.o: /usr/include/sys/stat.h +remake.o: /usr/include/sys/types.h +remake.o: /usr/include/signal.h +remake.o: /usr/include/sys/signal.h +remake.o: /usr/include/vm/faultcode.h +remake.o: /usr/include/sys/stdtypes.h +remake.o: /usr/include/stdio.h +remake.o: /usr/include/ctype.h +remake.o: /usr/include/time.h +remake.o: /usr/include/sys/stdtypes.h +remake.o: /usr/include/errno.h +remake.o: /usr/include/sys/errno.h +remake.o: ./signame.h +remake.o: /usr/include/strings.h +remake.o: ./filedef.h +remake.o: ./job.h +remake.o: ./commands.h +remake.o: ./dep.h +remake.o: /usr/include/assert.h +remake.o: /usr/include/sys/file.h +remake.o: /usr/include/sys/types.h +remake.o: /usr/include/sys/fcntlcom.h +remake.o: /usr/include/sys/stdtypes.h +remake.o: /usr/include/sys/stat.h +rule.o: rule.c +rule.o: ./make.h +rule.o: /usr/include/sys/types.h +rule.o: /usr/include/sys/stdtypes.h +rule.o: /usr/include/sys/sysmacros.h +rule.o: /usr/include/sys/stat.h +rule.o: /usr/include/sys/types.h +rule.o: /usr/include/signal.h +rule.o: /usr/include/sys/signal.h +rule.o: /usr/include/vm/faultcode.h +rule.o: /usr/include/sys/stdtypes.h +rule.o: /usr/include/stdio.h +rule.o: /usr/include/ctype.h +rule.o: /usr/include/time.h +rule.o: /usr/include/sys/stdtypes.h +rule.o: /usr/include/errno.h +rule.o: /usr/include/sys/errno.h +rule.o: ./signame.h +rule.o: /usr/include/strings.h +rule.o: ./dep.h +rule.o: ./filedef.h +rule.o: ./job.h +rule.o: ./commands.h +rule.o: ./variable.h +rule.o: ./rule.h +implicit.o: implicit.c +implicit.o: ./make.h +implicit.o: /usr/include/sys/types.h +implicit.o: /usr/include/sys/stdtypes.h +implicit.o: /usr/include/sys/sysmacros.h +implicit.o: /usr/include/sys/stat.h +implicit.o: /usr/include/sys/types.h +implicit.o: /usr/include/signal.h +implicit.o: /usr/include/sys/signal.h +implicit.o: /usr/include/vm/faultcode.h +implicit.o: /usr/include/sys/stdtypes.h +implicit.o: /usr/include/stdio.h +implicit.o: /usr/include/ctype.h +implicit.o: /usr/include/time.h +implicit.o: /usr/include/sys/stdtypes.h +implicit.o: /usr/include/errno.h +implicit.o: /usr/include/sys/errno.h +implicit.o: ./signame.h +implicit.o: /usr/include/strings.h +implicit.o: ./rule.h +implicit.o: ./dep.h +implicit.o: ./filedef.h +default.o: default.c +default.o: ./make.h +default.o: /usr/include/sys/types.h +default.o: /usr/include/sys/stdtypes.h +default.o: /usr/include/sys/sysmacros.h +default.o: /usr/include/sys/stat.h +default.o: /usr/include/sys/types.h +default.o: /usr/include/signal.h +default.o: /usr/include/sys/signal.h +default.o: /usr/include/vm/faultcode.h +default.o: /usr/include/sys/stdtypes.h +default.o: /usr/include/stdio.h +default.o: /usr/include/ctype.h +default.o: /usr/include/time.h +default.o: /usr/include/sys/stdtypes.h +default.o: /usr/include/errno.h +default.o: /usr/include/sys/errno.h +default.o: ./signame.h +default.o: /usr/include/strings.h +default.o: ./rule.h +default.o: ./dep.h +default.o: ./filedef.h +default.o: ./job.h +default.o: ./commands.h +default.o: ./variable.h +variable.o: variable.c +variable.o: ./make.h +variable.o: /usr/include/sys/types.h +variable.o: /usr/include/sys/stdtypes.h +variable.o: /usr/include/sys/sysmacros.h +variable.o: /usr/include/sys/stat.h +variable.o: /usr/include/sys/types.h +variable.o: /usr/include/signal.h +variable.o: /usr/include/sys/signal.h +variable.o: /usr/include/vm/faultcode.h +variable.o: /usr/include/sys/stdtypes.h +variable.o: /usr/include/stdio.h +variable.o: /usr/include/ctype.h +variable.o: /usr/include/time.h +variable.o: /usr/include/sys/stdtypes.h +variable.o: /usr/include/errno.h +variable.o: /usr/include/sys/errno.h +variable.o: ./signame.h +variable.o: /usr/include/strings.h +variable.o: ./dep.h +variable.o: ./filedef.h +variable.o: ./job.h +variable.o: ./commands.h +variable.o: ./variable.h +expand.o: expand.c +expand.o: ./make.h +expand.o: /usr/include/sys/types.h +expand.o: /usr/include/sys/stdtypes.h +expand.o: /usr/include/sys/sysmacros.h +expand.o: /usr/include/sys/stat.h +expand.o: /usr/include/sys/types.h +expand.o: /usr/include/signal.h +expand.o: /usr/include/sys/signal.h +expand.o: /usr/include/vm/faultcode.h +expand.o: /usr/include/sys/stdtypes.h +expand.o: /usr/include/stdio.h +expand.o: /usr/include/ctype.h +expand.o: /usr/include/time.h +expand.o: /usr/include/sys/stdtypes.h +expand.o: /usr/include/errno.h +expand.o: /usr/include/sys/errno.h +expand.o: ./signame.h +expand.o: /usr/include/strings.h +expand.o: ./filedef.h +expand.o: ./job.h +expand.o: ./commands.h +expand.o: ./variable.h +function.o: function.c +function.o: ./make.h +function.o: /usr/include/sys/types.h +function.o: /usr/include/sys/stdtypes.h +function.o: /usr/include/sys/sysmacros.h +function.o: /usr/include/sys/stat.h +function.o: /usr/include/sys/types.h +function.o: /usr/include/signal.h +function.o: /usr/include/sys/signal.h +function.o: /usr/include/vm/faultcode.h +function.o: /usr/include/sys/stdtypes.h +function.o: /usr/include/stdio.h +function.o: /usr/include/ctype.h +function.o: /usr/include/time.h +function.o: /usr/include/sys/stdtypes.h +function.o: /usr/include/errno.h +function.o: /usr/include/sys/errno.h +function.o: ./signame.h +function.o: /usr/include/strings.h +function.o: ./filedef.h +function.o: ./variable.h +function.o: ./dep.h +function.o: ./job.h +function.o: ./commands.h +vpath.o: vpath.c +vpath.o: ./make.h +vpath.o: /usr/include/sys/types.h +vpath.o: /usr/include/sys/stdtypes.h +vpath.o: /usr/include/sys/sysmacros.h +vpath.o: /usr/include/sys/stat.h +vpath.o: /usr/include/sys/types.h +vpath.o: /usr/include/signal.h +vpath.o: /usr/include/sys/signal.h +vpath.o: /usr/include/vm/faultcode.h +vpath.o: /usr/include/sys/stdtypes.h +vpath.o: /usr/include/stdio.h +vpath.o: /usr/include/ctype.h +vpath.o: /usr/include/time.h +vpath.o: /usr/include/sys/stdtypes.h +vpath.o: /usr/include/errno.h +vpath.o: /usr/include/sys/errno.h +vpath.o: ./signame.h +vpath.o: /usr/include/strings.h +vpath.o: ./filedef.h +vpath.o: ./variable.h version.o: version.c -ar.o: ar.c make.h filedef.h dep.h -arscan.o: arscan.c make.h -signame.o: signame.c signame.h -remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h +ar.o: ar.c +ar.o: ./make.h +ar.o: /usr/include/sys/types.h +ar.o: /usr/include/sys/stdtypes.h +ar.o: /usr/include/sys/sysmacros.h +ar.o: /usr/include/sys/stat.h +ar.o: /usr/include/sys/types.h +ar.o: /usr/include/signal.h +ar.o: /usr/include/sys/signal.h +ar.o: /usr/include/vm/faultcode.h +ar.o: /usr/include/sys/stdtypes.h +ar.o: /usr/include/stdio.h +ar.o: /usr/include/ctype.h +ar.o: /usr/include/time.h +ar.o: /usr/include/sys/stdtypes.h +ar.o: /usr/include/errno.h +ar.o: /usr/include/sys/errno.h +ar.o: ./signame.h +ar.o: /usr/include/strings.h +ar.o: ./filedef.h +ar.o: ./dep.h +arscan.o: arscan.c +arscan.o: ./make.h +arscan.o: /usr/include/sys/types.h +arscan.o: /usr/include/sys/stdtypes.h +arscan.o: /usr/include/sys/sysmacros.h +arscan.o: /usr/include/sys/stat.h +arscan.o: /usr/include/sys/types.h +arscan.o: /usr/include/signal.h +arscan.o: /usr/include/sys/signal.h +arscan.o: /usr/include/vm/faultcode.h +arscan.o: /usr/include/sys/stdtypes.h +arscan.o: /usr/include/stdio.h +arscan.o: /usr/include/ctype.h +arscan.o: /usr/include/time.h +arscan.o: /usr/include/sys/stdtypes.h +arscan.o: /usr/include/errno.h +arscan.o: /usr/include/sys/errno.h +arscan.o: ./signame.h +arscan.o: /usr/include/strings.h +arscan.o: /usr/include/sys/file.h +arscan.o: /usr/include/sys/types.h +arscan.o: /usr/include/sys/fcntlcom.h +arscan.o: /usr/include/sys/stdtypes.h +arscan.o: /usr/include/sys/stat.h +arscan.o: /usr/include/ar.h +signame.o: signame.c +signame.o: /usr/include/stdio.h +signame.o: /usr/include/sys/types.h +signame.o: /usr/include/sys/stdtypes.h +signame.o: /usr/include/sys/sysmacros.h +signame.o: /usr/include/signal.h +signame.o: /usr/include/sys/signal.h +signame.o: /usr/include/vm/faultcode.h +signame.o: /usr/include/sys/stdtypes.h +signame.o: ./signame.h +remote-stub.o: remote-stub.c +remote-stub.o: ./make.h +remote-stub.o: /usr/include/sys/types.h +remote-stub.o: /usr/include/sys/stdtypes.h +remote-stub.o: /usr/include/sys/sysmacros.h +remote-stub.o: /usr/include/sys/stat.h +remote-stub.o: /usr/include/sys/types.h +remote-stub.o: /usr/include/signal.h +remote-stub.o: /usr/include/sys/signal.h +remote-stub.o: /usr/include/vm/faultcode.h +remote-stub.o: /usr/include/sys/stdtypes.h +remote-stub.o: /usr/include/stdio.h +remote-stub.o: /usr/include/ctype.h +remote-stub.o: /usr/include/time.h +remote-stub.o: /usr/include/sys/stdtypes.h +remote-stub.o: /usr/include/errno.h +remote-stub.o: /usr/include/sys/errno.h +remote-stub.o: ./signame.h +remote-stub.o: /usr/include/strings.h +remote-stub.o: ./filedef.h +remote-stub.o: ./job.h +remote-stub.o: ./commands.h getopt.o: getopt.c -getopt1.o: getopt1.c getopt.h +getopt.o: /usr/include/stdio.h +getopt.o: ./getopt.h +getopt1.o: getopt1.c +getopt1.o: ./getopt.h +getopt1.o: /usr/include/stdio.h getloadavg.o: getloadavg.c +getloadavg.o: /usr/include/sys/types.h +getloadavg.o: /usr/include/sys/stdtypes.h +getloadavg.o: /usr/include/sys/sysmacros.h +getloadavg.o: /usr/include/sys/param.h +getloadavg.o: /usr/include/machine/param.h +getloadavg.o: /usr/include/machine/devaddr.h +getloadavg.o: /usr/include/sys/signal.h +getloadavg.o: /usr/include/vm/faultcode.h +getloadavg.o: /usr/include/sys/stdtypes.h +getloadavg.o: /usr/include/sys/types.h +getloadavg.o: /usr/include/errno.h +getloadavg.o: /usr/include/sys/errno.h +getloadavg.o: /usr/include/stdio.h +getloadavg.o: /usr/include/nlist.h +getloadavg.o: /usr/include/sys/file.h +getloadavg.o: /usr/include/sys/types.h +getloadavg.o: /usr/include/sys/fcntlcom.h +getloadavg.o: /usr/include/sys/stdtypes.h +getloadavg.o: /usr/include/sys/stat.h +getloadavg.o: /usr/include/sys/types.h @@ -1,10 +1,46 @@ -GNU make NEWS -- history of user-visible changes. 9 May 1996 +GNU make NEWS -*-indented-text-*- + History of user-visible changes. + 06 Apr 1996 -Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. See the end for copying conditions. Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu. +Version 3.76 + +* VPATH functionality has been changed to incorporate the VPATH+ patch, + previously maintained by Paul Smith <psmith@baynetworks.com>. See the + manual. + +* Make defines a new variable, `MAKECMDGOALS', to contain the goals that + were specified on the command line, if any. Modifying this variable + has no effect on the operation of make. + +* A new function, `$(wordlist S,E,TEXT)', is available: it returns a + list of words from number S to number E (inclusive) of TEXT. + +* Instead of an error, detection of future modification times gives a + warning and continues. + +* Fix the $(basename) and $(suffix) functions so they only operate on + the last filename, not the entire string: + + Command Old Result New Result + ------- ---------- ---------- + $(basename a.b) a a + $(basename a.b/c) a a.b/c + $(suffix a.b) b b + $(suffix a.b/c) b/c <empty> + +* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32). + +* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS + and MS-Windows, building with the DJGPP v2 port of GNU C/C++ compiler + and utilities. See README.DOS for details, and direct all questions + concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ + Delorie <dj@delorie.com>. + Version 3.75 * The directory messages printed by `-w' and implicitly in sub-makes, @@ -23,7 +59,7 @@ Version 3.75 details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>. * Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95. - See README.WIN32 for details, and direct all Windows-related questions to + See README.W32 for details, and direct all Windows-related questions to <rob_tulloh@tivoli.com>. Version 3.73 diff --git a/NMakefile.template b/NMakefile.template index 3db9e75..49e4fed 100644 --- a/NMakefile.template +++ b/NMakefile.template @@ -29,7 +29,7 @@ OUTDIR=. MAKEFILE=NMakefile
SUBPROC_MAKEFILE=NMakefile
-CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
+CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
@@ -52,7 +52,7 @@ subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
subproc.bat $(SUBPROC_MAKEFILE)
-config.h: config.h.WIN32
+config.h: config.h.W32
copy $? $@
Release:
@@ -1,4 +1,4 @@ -This directory contains the 3.75 test release of GNU Make. +This directory contains the 3.75.1 test release of GNU Make. All bugs reported for previous test releases have been fixed. Some bugs surely remain. @@ -14,7 +14,7 @@ Some systems' Make programs are broken and cannot process the Makefile for GNU Make. If you get errors from your system's Make when building GNU Make, try using `build.sh' instead. -See README.WIN32 for details about GNU Make on Windows NT or 95. +See README.W32 for details about GNU Make on Windows NT or 95. See README.Amiga for details about GNU Make on AmigaDOS. The MSDOS port of GNU Make is available as part of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more information. @@ -1,10 +1,10 @@ -Port of GNU make to Windows NT and Windows 95 +Port of GNU make to Windows NT and Windows 95 Builds natively with MSVC 2.x or MSVC 4.x compilers. To build with nmake on Windows NT or Windows 95: 1. Make sure cl.exe is in your %Path%. Example: - + set Path=%Path%;c:/msdev/bin 2. Make sure %include% is set to msvc include directory. Example: @@ -19,7 +19,7 @@ To build with nmake on Windows NT or Windows 95: There is a bat file (build_w32.bat) for folks who have fear of nmake. - + Outputs: WinDebug/make.exe @@ -34,13 +34,13 @@ GNU make and sh.exe: system. If you don't have sh.exe, port falls back to MSDOS mode for launching programs (via a batch file). The MSDOS mode style execution has not been tested too - carefully though (I use GNU bash as sh.exe). + carefully though (I use GNU bash as sh.exe). There are very few true ports of Bourne shell for NT right now. - There is a version of GNU bash available from Cygnus gnu-win32 - porting effort. Other possibilites are to get the MKS version - of sh.exe or to build your own with a package like - NutCracker (DataFocus) or Portage (Consensys). + There is a version of GNU bash available from Cygnus gnu-win32 + porting effort. Other possibilites are to get the MKS version + of sh.exe or to build your own with a package like + NutCracker (DataFocus) or Portage (Consensys). Tivoli uses a homegrown port of GNU bash which is not (yet) freely available. It may be available someday, but I am not in control @@ -58,12 +58,12 @@ Building GNU make on Windows NT and Windows 95 with Microsoft Visual C I did not provide a Visual C project file with this port as the project file would not be considered freely distributable (or so I think). It is easy enough to create one though if - you know how to use Visual C. + you know how to use Visual C. I build the program statically to avoid problems locating DLL's on machines that may not have MSVC runtime installed. If you prefer, you can change make to build with shared libraries by - changing /MT to /MD in the NMakefile (or build_w32.bat). + changing /MT to /MD in the NMakefile (or build_w32.bat). Program has not been built under non-Intel architectures (yet). @@ -71,7 +71,7 @@ Building GNU make on Windows NT and Windows 95 with Microsoft Visual C Pathnames and white space: - Unlike Unix, WIN32 systems encourage pathnames which + Unlike Unix, Windows 95/NT systems encourage pathnames which contain white space (e.g. C:\Program Files\). These sorts of pathnames are legal under Unix too, but are never encouraged. There is at least one place in make (VPATH/vpath handling) where paths @@ -80,7 +80,7 @@ Pathnames and white space: these sorts of paths could be handled. I offer these suggestions as workarounds: - 1. Use 8.3 notation + 1. Use 8.3 notation 2. Rename the directory so it does not contain white space. If you are unhappy with this choice, this is free software @@ -105,6 +105,13 @@ SAMBA/NTFS/VFAT: under VFAT. VFAT users may wish to be aware that this port of make does respect case sensitivity. + Version 3.76 contains some preliminary support for FAT. + Make now tries to work around some difficulties with stat'ing of + files and caching of filenames and directories internally. + There is still a known problem with filenames sometimes being found + to have modification dates in the future which cause make to + complain about the file and exit (remake.c). + Bug reports: Please submit bugs via the normal bug reporting mechanism diff --git a/README.template b/README.template index 6509a50..0d3bbfc 100644 --- a/README.template +++ b/README.template @@ -14,7 +14,7 @@ Some systems' Make programs are broken and cannot process the Makefile for GNU Make. If you get errors from your system's Make when building GNU Make, try using `build.sh' instead. -See README.WIN32 for details about GNU Make on Windows NT or 95. +See README.W32 for details about GNU Make on Windows NT or 95. See README.Amiga for details about GNU Make on AmigaDOS. The MSDOS port of GNU Make is available as part of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more information. diff --git a/build.sh.in b/build.sh.in index d3a46c4..1667f0e 100644 --- a/build.sh.in +++ b/build.sh.in @@ -45,7 +45,7 @@ includedir=${prefix}/include set -e # These are all the objects we need to link together. -objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/libglob.a glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}" +objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}" # Compile the source files into those objects. for file in `echo ${objs} | sed 's/\.o/.c/g'`; do diff --git a/build_w32.bat b/build_w32.bat index 69cf4b4..f164f64 100644 --- a/build_w32.bat +++ b/build_w32.bat @@ -1,136 +1,137 @@ +set make=gnumake
cd w32\subproc
echo "Creating the subproc library"
%ComSpec% /c build.bat
cd ..\..
del link.dbg link.rel
del config.h
-copy config.h.WIN32 config.h
+copy config.h.W32 config.h
echo off
-echo "Creating GNU make 3.74 for Windows NT"
+echo "Creating GNU make for Windows 95/NT"
echo on
if not exist .\WinDebug\nul mkdir .\WinDebug
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c variable.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
echo WinDebug\variable.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c rule.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
echo WinDebug\rule.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c remote-stub.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
echo WinDebug\remote-stub.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c commands.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
echo WinDebug\commands.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c file.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
echo WinDebug\file.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getloadavg.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
echo WinDebug\getloadavg.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c default.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
echo WinDebug\default.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c signame.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
echo WinDebug\signame.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c expand.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
echo WinDebug\expand.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c dir.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
echo WinDebug\dir.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c main.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
echo WinDebug\main.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getopt1.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
echo WinDebug\getopt1.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c job.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
echo WinDebug\job.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c read.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
echo WinDebug\read.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c version.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
echo WinDebug\version.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getopt.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
echo WinDebug\getopt.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c arscan.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
echo WinDebug\arscan.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c remake.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
echo WinDebug\remake.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c misc.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
echo WinDebug\misc.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c ar.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
echo WinDebug\ar.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c function.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
echo WinDebug\function.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c vpath.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
echo WinDebug\vpath.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c implicit.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
echo WinDebug\implicit.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\w32\compat\dirent.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
echo WinDebug\dirent.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\glob\glob.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
echo WinDebug\glob.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\glob\fnmatch.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
echo WinDebug\fnmatch.obj >>link.dbg
-cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\w32\pathstuff.c
+cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
echo WinDebug\pathstuff.obj >>link.dbg
echo off
-echo "Linking WinDebug/make374.exe"
-rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
+echo "Linking WinDebug/%make%.exe"
+rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
-link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe @link.dbg
-if not exist .\WinDebug/make374.exe echo "WinDebug build failed"
-if exist .\WinDebug/make374.exe echo "WinDebug build succeeded!"
+link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
+if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
+if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
if not exist .\WinRel\nul mkdir .\WinRel
echo on
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c variable.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
echo WinRel\variable.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c rule.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
echo WinRel\rule.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c remote-stub.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
echo WinRel\remote-stub.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c commands.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
echo WinRel\commands.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c file.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
echo WinRel\file.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getloadavg.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
echo WinRel\getloadavg.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c default.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
echo WinRel\default.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c signame.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
echo WinRel\signame.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c expand.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
echo WinRel\expand.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c dir.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
echo WinRel\dir.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c main.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
echo WinRel\main.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getopt1.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
echo WinRel\getopt1.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c job.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
echo WinRel\job.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c read.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
echo WinRel\read.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c version.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
echo WinRel\version.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getopt.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
echo WinRel\getopt.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c arscan.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
echo WinRel\arscan.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c remake.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
echo WinRel\remake.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c misc.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
echo WinRel\misc.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c ar.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
echo WinRel\ar.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c function.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
echo WinRel\function.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c vpath.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
echo WinRel\vpath.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c implicit.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
echo WinRel\implicit.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
echo WinRel\dirent.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\glob\glob.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
echo WinRel\glob.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
echo WinRel\fnmatch.obj >>link.rel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
echo WinRel\pathstuff.obj >>link.rel
echo off
-echo "Linking WinRel/make374.exe"
-rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
+echo "Linking WinRel/%make%.exe"
+rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
-link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe @link.rel
-if not exist .\WinRel/make374.exe echo "WinRel build failed"
-if exist .\WinRel/make374.exe echo "WinRel build succeeded!"
+link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
+if not exist .\WinRel/%make%.exe echo "WinRel build failed"
+if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
echo on
@@ -369,17 +369,25 @@ RETSIGTYPE fatal_error_signal (sig) int sig; { -#if defined(__MSDOS__) || defined(_AMIGA) +#ifdef __MSDOS__ + extern int dos_status, dos_command_running; + + if (dos_command_running) + { + /* That was the child who got the signal, not us. */ + dos_status |= (sig << 8); + return; + } remove_intermediates (1); + exit (1); +#else /* not __MSDOS__ */ #ifdef _AMIGA + remove_intermediates (1); if (sig == SIGINT) fputs ("*** Break.\n", stderr); exit (10); -#else - exit (1); -#endif -#else /* Not MSDOS. */ +#else /* not Amiga */ handling_fatal_signal = 1; /* Set the handling for this signal to the default. @@ -445,7 +453,8 @@ fatal_error_signal (sig) will be unblocked when we return and arrive then to kill us. */ if (kill (getpid (), sig) < 0) pfatal_with_name ("kill"); -#endif /* MSDOS. */ +#endif /* not Amiga */ +#endif /* not __MSDOS__ */ } /* Delete FILE unless it's precious or not actually a file (phony), diff --git a/compatMakefile b/compatMakefile index 0755b0b..3ccfb6a 100644 --- a/compatMakefile +++ b/compatMakefile @@ -107,11 +107,13 @@ TEXI2DVI = texi2dvi ETAGS = etags -w CTAGS = ctags -w +GLOB = glob/libglob.a + objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \ rule.o implicit.o default.o variable.o expand.o function.o \ vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \ - getopt.o getopt1.o glob/libglob.a \ - $(ALLOCA) $(extras) + getopt.o getopt1.o \ + $(GLOB) $(ALLOCA) $(extras) srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \ $(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \ $(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \ @@ -158,7 +160,7 @@ make: $(objs) SHELL = /bin/sh MAKE = make -glob/libglob.a: FORCE config.h +$(GLOB): FORCE config.h cd glob; $(MAKE) libglob.a FORCE: @@ -206,7 +208,7 @@ $(infodir)/make.info: make.info # fail gracefully when there is an unknown command. if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \ - install-info --infodir=$(infodir) $$dir/make.info; \ + install-info --info-dir=$(infodir) $$dir/make.info; \ else true; fi $(mandir)/$(manprefix)make.$(manext): make.man diff --git a/config.ami.template b/config.ami.template index d480b0a..be99846 100644 --- a/config.ami.template +++ b/config.ami.template @@ -32,6 +32,9 @@ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE 1 + /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT diff --git a/config.h-vms.template b/config.h-vms.template index a1a4659..513ea11 100644 --- a/config.h-vms.template +++ b/config.h-vms.template @@ -34,6 +34,9 @@ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* #undef HAVE_ALLOCA_H 1 */ +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE 1 + /* Define if you don't have vprintf but do have _doprnt. */ /* #undef HAVE_DOPRNT */ @@ -287,6 +290,6 @@ #define PARAMS(protos) protos #else /* Not C++ or ANSI C. */ #undef PARAMS -#define PARAMS(protos) () +#define PARAMS(protos) () #endif /* C++ or ANSI C. */ diff --git a/config.h.W32.template b/config.h.W32.template index 5188b1f..9af79e2 100644 --- a/config.h.W32.template +++ b/config.h.W32.template @@ -34,6 +34,10 @@ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE +#define HAVE_MEMMOVE 1 + /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT diff --git a/config.h.in b/config.h.in index cc2f1af..c1fed49 100644 --- a/config.h.in +++ b/config.h.in @@ -35,6 +35,9 @@ /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT +/* Define if your system has a working fnmatch function. */ +#undef HAVE_FNMATCH + /* Define if your system has its own `getloadavg' function. */ #undef HAVE_GETLOADAVG @@ -127,9 +130,9 @@ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION @@ -182,6 +185,9 @@ /* Define if you have the getgroups function. */ #undef HAVE_GETGROUPS +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + /* Define if you have the mktemp function. */ #undef HAVE_MKTEMP diff --git a/configh.dos.template b/configh.dos.template index b74b71d..455c549 100644 --- a/configh.dos.template +++ b/configh.dos.template @@ -21,13 +21,7 @@ #endif
/* Define if `sys_siglist' is declared by <signal.h>. */
-#define SYS_SIGLIST_DECLARED
-
-/* Define if you have getdtablesize. */
-#define HAVE_GETDTABLESIZE
-
-/* Define if you have dup2. */
-#define HAVE_DUP2
+#undef SYS_SIGLIST_DECLARED
/* Define if you have sys_siglist. */
#undef HAVE_SYS_SIGLIST
@@ -38,6 +32,18 @@ /* Define if you have psignal. */
#define HAVE_PSIGNAL
+/* Define if you have strsignal. */
+#undef HAVE_STRSIGNAL
+
+/* Define NSIG. */
+#define NSIG SIGMAX
+
+/* Define if you have getdtablesize. */
+#define HAVE_GETDTABLESIZE
+
+/* Define if you have dup2. */
+#define HAVE_DUP2
+
/* Define if you have getcwd. */
#define HAVE_GETCWD
@@ -62,7 +68,13 @@ /* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H
+/* Define if you have the memmove function. */
+#define HAVE_MEMMOVE
+
/* Define if you have the `strerror' function. */
#define HAVE_STRERROR
+/* Define if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H
+
#define SCCS_GET "get"
@@ -2,7 +2,7 @@ # From configure.in Id: configure.in,v 1.52 1996/07/20 09:30:04 roland Exp # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.10 +# Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -52,6 +52,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -333,7 +335,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.10" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -435,11 +437,14 @@ do done # NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -501,6 +506,7 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -537,7 +543,8 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. subdirs="glob" echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -set dummy ${MAKE-make}; ac_make=$2 +echo "configure:547: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -565,6 +572,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:576: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -593,6 +601,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:605: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -639,7 +648,47 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:653: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext <<EOF +#line 663 "configure" +#include "confdefs.h" +main(){return(0);} +EOF +if { (eval echo configure:667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:692: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -648,7 +697,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -656,29 +705,34 @@ fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:716: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes + ac_cv_prog_cc_g=yes else - ac_cv_prog_gcc_g=no + ac_cv_prog_cc_g=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" fi else GCC= @@ -696,11 +750,12 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:754: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -723,7 +778,7 @@ else ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then @@ -745,6 +800,7 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:804: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -759,33 +815,37 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 763 "configure" +#line 819 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 778 "configure" +#line 836 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -800,8 +860,9 @@ else fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:864: checking for AIX" >&5 cat > conftest.$ac_ext <<EOF -#line 805 "configure" +#line 866 "configure" #include "confdefs.h" #ifdef _AIX yes @@ -823,6 +884,7 @@ rm -f conftest* echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:888: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -842,24 +904,27 @@ else ISC= fi -ac_safe=`echo "minix/config.h" | tr './\055' '___'` +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:910: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 852 "configure" +#line 915 "configure" #include "confdefs.h" #include <minix/config.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -888,38 +953,13 @@ EOF fi -# If we cannot run a trivial program, we must be cross compiling. -echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext <<EOF -#line 901 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -{ (eval echo configure:905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_cross=no -else - ac_cv_c_cross=yes -fi -fi -rm -fr conftest* -fi - -echo "$ac_t""$ac_cv_c_cross" 1>&6 -cross_compiling=$ac_cv_c_cross - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:958: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 923 "configure" +#line 963 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -927,13 +967,15 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi @@ -942,7 +984,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 946 "configure" +#line 988 "configure" #include "confdefs.h" #include <string.h> EOF @@ -960,7 +1002,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 964 "configure" +#line 1006 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -980,8 +1022,8 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else -cat > conftest.$ac_ext <<EOF -#line 985 "configure" + cat > conftest.$ac_ext <<EOF +#line 1027 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -992,15 +1034,19 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -{ (eval echo configure:996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_header_stdc=no fi -fi rm -fr conftest* fi + +fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 @@ -1014,34 +1060,35 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:1066: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1024 "configure" +#line 1071 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> -int main() { return 0; } -int t() { +int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF @@ -1052,30 +1099,32 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for -ldir""... $ac_c" 1>&6 -ac_lib_var=`echo dir'_'opendir | tr './+\055' '__p_'` +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:1104: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 1064 "configure" +#line 1112 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); -int main() { return 0; } -int t() { +int main() { opendir() ; return 0; } EOF -if { (eval echo configure:1076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1091,30 +1140,32 @@ else fi else -echo $ac_n "checking for -lx""... $ac_c" 1>&6 -ac_lib_var=`echo x'_'opendir | tr './+\055' '__p_'` +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:1145: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 1103 "configure" +#line 1153 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); -int main() { return 0; } -int t() { +int main() { opendir() ; return 0; } EOF -if { (eval echo configure:1115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1132,11 +1183,12 @@ fi fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:1187: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1140 "configure" +#line 1192 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -1164,19 +1216,21 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1220: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1172 "configure" +#line 1225 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> +#include <stddef.h> #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pid_t" >/dev/null 2>&1; then + egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else @@ -1195,11 +1249,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1253: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1203 "configure" +#line 1258 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -1212,20 +1267,20 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -int main() { return 0; } -int t() { +int main() { int i; ; return 0; } EOF -if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* - fi echo "$ac_t""$ac_cv_type_signal" 1>&6 @@ -1237,24 +1292,27 @@ EOF for ac_hdr in unistd.h limits.h sys/param.h fcntl.h string.h memory.h \ sys/timeb.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1298: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1247 "configure" +#line 1303 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -1262,7 +1320,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF @@ -1274,8 +1332,10 @@ done if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 +echo "configure:1336: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 +echo "configure:1339: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1287,16 +1347,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1323,15 +1383,15 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1387: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1331 "configure" +#line 1392 "configure" #include "confdefs.h" -int main() { return 0; } -int t() { +int main() { /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; @@ -1377,15 +1437,16 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_c_const" 1>&6 @@ -1396,11 +1457,12 @@ EOF fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 +echo "configure:1461: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1404 "configure" +#line 1466 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -1454,16 +1516,17 @@ fi -for ac_func in psignal mktemp \ +for ac_func in memmove psignal mktemp \ dup2 getcwd sigsetmask getgroups setlinebuf \ seteuid setegid setreuid setregid strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1525: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1467 "configure" +#line 1530 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1473,8 +1536,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1487,16 +1549,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -1510,27 +1574,28 @@ fi done echo $ac_n "checking for sys_siglist""... $ac_c" 1>&6 +echo "configure:1578: checking for sys_siglist" >&5 if eval "test \"`echo '$''{'ac_cv_check_symbol_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1518 "configure" +#line 1583 "configure" #include "confdefs.h" -int main() { return 0; } -int t() { +int main() { extern char *sys_siglist[]; puts(*sys_siglist); ; return 0; } EOF -if { (eval echo configure:1526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_check_symbol_sys_siglist=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_check_symbol_sys_siglist=no fi rm -f conftest* - fi if test "$ac_cv_check_symbol_sys_siglist" = yes; then @@ -1544,27 +1609,28 @@ echo "$ac_t""$ac_cv_check_symbol_sys_siglist" 1>&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +echo "configure:1613: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1552 "configure" +#line 1618 "configure" #include "confdefs.h" #include <alloca.h> -int main() { return 0; } -int t() { +int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_alloca_h=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 @@ -1576,11 +1642,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then +echo "configure:1646: checking for alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1584 "configure" +#line 1651 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -1599,31 +1666,31 @@ char *alloca (); # endif #endif -int main() { return 0; } -int t() { +int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:1608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - ac_cv_func_alloca=yes + ac_cv_func_alloca_works=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_func_alloca=no + ac_cv_func_alloca_works=no fi rm -f conftest* - fi -echo "$ac_t""$ac_cv_func_alloca" 1>&6 -if test $ac_cv_func_alloca = yes; then +echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 +if test $ac_cv_func_alloca_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA 1 EOF fi -if test $ac_cv_func_alloca = no; then +if test $ac_cv_func_alloca_works = no; then # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, @@ -1635,11 +1702,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +echo "configure:1706: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1643 "configure" +#line 1711 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -1664,11 +1732,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1736: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1672 "configure" +#line 1741 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1678,8 +1747,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1692,16 +1760,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<EOF @@ -1717,14 +1787,15 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +echo "configure:1791: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else -cat > conftest.$ac_ext <<EOF -#line 1728 "configure" + cat > conftest.$ac_ext <<EOF +#line 1799 "configure" #include "confdefs.h" find_stack_direction () { @@ -1743,16 +1814,20 @@ main () exit (find_stack_direction() < 0); } EOF -{ (eval echo configure:1747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then ac_cv_c_stack_direction=1 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_c_stack_direction=-1 fi -fi rm -fr conftest* fi +fi + echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 cat >> confdefs.h <<EOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -1760,24 +1835,27 @@ EOF fi -ac_safe=`echo "vfork.h" | tr './\055' '___'` +ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 +echo "configure:1841: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1770 "configure" +#line 1846 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -1794,16 +1872,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then +echo "configure:1876: checking for working vfork" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 +echo "configure:1882: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1807 "configure" +#line 1887 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -1813,8 +1893,7 @@ else builtin and then its argument prototype would still apply. */ char vfork(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1827,16 +1906,18 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_vfork=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -1845,8 +1926,8 @@ else fi else -cat > conftest.$ac_ext <<EOF -#line 1850 "configure" + cat > conftest.$ac_ext <<EOF +#line 1931 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -1874,8 +1955,10 @@ sparc_address_test (arg) int arg; static pid_t child; if (!child) { child = vfork (); - if (child < 0) + if (child < 0) { perror ("vfork"); + _exit(2); + } if (!child) { arg = getpid(); write(-1, "", 0); @@ -1939,18 +2022,22 @@ main() { } } EOF -{ (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_vfork=yes +if { (eval echo configure:2026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_vfork_works=yes else - ac_cv_func_vfork=no -fi + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_vfork_works=no fi rm -fr conftest* fi -echo "$ac_t""$ac_cv_func_vfork" 1>&6 -if test $ac_cv_func_vfork = no; then +fi + +echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 +if test $ac_cv_func_vfork_works = no; then cat >> confdefs.h <<\EOF #define vfork fork EOF @@ -1958,14 +2045,15 @@ EOF fi echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 +echo "configure:2049: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else -cat > conftest.$ac_ext <<EOF -#line 1969 "configure" + cat > conftest.$ac_ext <<EOF +#line 2057 "configure" #include "confdefs.h" #include <stdio.h> /* If setvbuf has the reversed format, exit 0. */ @@ -1979,14 +2067,18 @@ main () { exit(0); /* Non-reversed systems segv here. */ } EOF -{ (eval echo configure:1983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then ac_cv_func_setvbuf_reversed=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_func_setvbuf_reversed=no fi -fi rm -fr conftest* +fi + rm -f core core.* *.core fi @@ -2003,30 +2095,32 @@ ac_have_func=no # yes means we've found a way to get the load average. # Some systems with -lutil have (and need) -lkvm as well, some do not. # On Solaris, -lkvm requires nlist from -lelf, so check that first # to get the right answer into the cache. -echo $ac_n "checking for -lelf""... $ac_c" 1>&6 -ac_lib_var=`echo elf'_'elf_begin | tr './+\055' '__p_'` +echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6 +echo "configure:2100: checking for elf_begin in -lelf" >&5 +ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lelf $LIBS" cat > conftest.$ac_ext <<EOF -#line 2015 "configure" +#line 2108 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char elf_begin(); -int main() { return 0; } -int t() { +int main() { elf_begin() ; return 0; } EOF -if { (eval echo configure:2027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -2041,30 +2135,32 @@ else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for -lkvm""... $ac_c" 1>&6 -ac_lib_var=`echo kvm'_'kvm_open | tr './+\055' '__p_'` +echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6 +echo "configure:2140: checking for kvm_open in -lkvm" >&5 +ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkvm $LIBS" cat > conftest.$ac_ext <<EOF -#line 2053 "configure" +#line 2148 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char kvm_open(); -int main() { return 0; } -int t() { +int main() { kvm_open() ; return 0; } EOF -if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -2080,30 +2176,32 @@ else fi # Check for the 4.4BSD definition of getloadavg. -echo $ac_n "checking for -lutil""... $ac_c" 1>&6 -ac_lib_var=`echo util'_'getloadavg | tr './+\055' '__p_'` +echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6 +echo "configure:2181: checking for getloadavg in -lutil" >&5 +ac_lib_var=`echo util'_'getloadavg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <<EOF -#line 2092 "configure" +#line 2189 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getloadavg(); -int main() { return 0; } -int t() { +int main() { getloadavg() ; return 0; } EOF -if { (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -2122,31 +2220,33 @@ fi if test $ac_have_func = no; then # There is a commonly available library for RS/6000 AIX. # Since it is not a standard part of AIX, it might be installed locally. - ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" - echo $ac_n "checking for -lgetloadavg""... $ac_c" 1>&6 -ac_lib_var=`echo getloadavg'_'getloadavg | tr './+\055' '__p_'` + ac_getloadavg_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" + echo $ac_n "checking for getloadavg in -lgetloadavg""... $ac_c" 1>&6 +echo "configure:2226: checking for getloadavg in -lgetloadavg" >&5 +ac_lib_var=`echo getloadavg'_'getloadavg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lgetloadavg $LIBS" cat > conftest.$ac_ext <<EOF -#line 2135 "configure" +#line 2234 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getloadavg(); -int main() { return 0; } -int t() { +int main() { getloadavg() ; return 0; } EOF -if { (eval echo configure:2147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -2159,7 +2259,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then LIBS="-lgetloadavg $LIBS" else echo "$ac_t""no" 1>&6 -LIBS="$ac_save_LIBS" +LIBS="$ac_getloadavg_LIBS" fi fi @@ -2168,11 +2268,12 @@ fi for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2272: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2176 "configure" +#line 2277 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2182,8 +2283,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2196,27 +2296,33 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + else echo "$ac_t""no" 1>&6 LIBOBJS="$LIBOBJS ${ac_func}.o" fi - done + if test $ac_cv_func_getloadavg = yes; then cat >> confdefs.h <<\EOF #define HAVE_GETLOADAVG 1 @@ -2226,24 +2332,27 @@ EOF else # Figure out what our getloadavg.c needs. ac_have_func=no - ac_safe=`echo "sys/dg_sys_info.h" | tr './\055' '___'` + ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6 +echo "configure:2338: checking for sys/dg_sys_info.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2236 "configure" +#line 2343 "configure" #include "confdefs.h" #include <sys/dg_sys_info.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2255,30 +2364,32 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then #define DGUX 1 EOF - echo $ac_n "checking for -ldgc""... $ac_c" 1>&6 -ac_lib_var=`echo dgc'_'dg_sys_info | tr './+\055' '__p_'` + echo $ac_n "checking for dg_sys_info in -ldgc""... $ac_c" 1>&6 +echo "configure:2369: checking for dg_sys_info in -ldgc" >&5 +ac_lib_var=`echo dgc'_'dg_sys_info | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldgc $LIBS" cat > conftest.$ac_ext <<EOF -#line 2267 "configure" +#line 2377 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dg_sys_info(); -int main() { return 0; } -int t() { +int main() { dg_sys_info() ; return 0; } EOF -if { (eval echo configure:2279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -2288,7 +2399,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo dgc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo dgc | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF @@ -2315,24 +2427,27 @@ EOF fi if test $ac_have_func = no; then - ac_safe=`echo "inq_stats/cpustats.h" | tr './\055' '___'` + ac_safe=`echo "inq_stats/cpustats.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6 +echo "configure:2433: checking for inq_stats/cpustats.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2325 "configure" +#line 2438 "configure" #include "confdefs.h" #include <inq_stats/cpustats.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2355,24 +2470,27 @@ fi fi if test $ac_have_func = no; then - ac_safe=`echo "sys/cpustats.h" | tr './\055' '___'` + ac_safe=`echo "sys/cpustats.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6 +echo "configure:2476: checking for sys/cpustats.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2365 "configure" +#line 2481 "configure" #include "confdefs.h" #include <sys/cpustats.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2393,24 +2511,27 @@ fi if test $ac_have_func = no; then for ac_hdr in mach/mach.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2517: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2403 "configure" +#line 2522 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2418,7 +2539,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF @@ -2430,24 +2551,27 @@ done fi - ac_safe=`echo "nlist.h" | tr './\055' '___'` + ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 +echo "configure:2557: checking for nlist.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2440 "configure" +#line 2562 "configure" #include "confdefs.h" #include <nlist.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2460,27 +2584,28 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then EOF echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6 +echo "configure:2588: checking for n_un in struct nlist" >&5 if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2468 "configure" +#line 2593 "configure" #include "confdefs.h" #include <nlist.h> -int main() { return 0; } -int t() { +int main() { struct nlist n; n.n_un.n_name = 0; ; return 0; } EOF -if { (eval echo configure:2476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_nlist_n_un=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_nlist_n_un=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_struct_nlist_n_un" 1>&6 @@ -2498,11 +2623,12 @@ fi # Do not have getloadavg in system libraries. # Some definitions of getloadavg require that the program be installed setgid. echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6 +echo "configure:2627: checking whether getloadavg requires setgid" >&5 if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2506 "configure" +#line 2632 "configure" #include "confdefs.h" #include "$srcdir/getloadavg.c" #ifdef LDAV_PRIVILEGED @@ -2533,6 +2659,7 @@ fi if test $ac_cv_func_getloadavg_setgid = yes; then echo $ac_n "checking group of /dev/kmem""... $ac_c" 1>&6 +echo "configure:2663: checking group of /dev/kmem" >&5 if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2551,15 +2678,16 @@ echo "$ac_t""$ac_cv_group_kmem" 1>&6 KMEM_GROUP=$ac_cv_group_kmem fi -echo $ac_n "checking for strcoll""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_strcoll'+set}'`\" = set"; then +echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 +echo "configure:2683: checking for working strcoll" >&5 +if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - ac_cv_func_strcoll=no + ac_cv_func_strcoll_works=no else -cat > conftest.$ac_ext <<EOF -#line 2563 "configure" + cat > conftest.$ac_ext <<EOF +#line 2691 "configure" #include "confdefs.h" #include <string.h> main () @@ -2569,18 +2697,22 @@ main () strcoll ("123", "456") >= 0); } EOF -{ (eval echo configure:2573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_strcoll=yes +if { (eval echo configure:2701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_strcoll_works=yes else - ac_cv_func_strcoll=no -fi + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_strcoll_works=no fi rm -fr conftest* fi -echo "$ac_t""$ac_cv_func_strcoll" 1>&6 -if test $ac_cv_func_strcoll = yes; then +fi + +echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6 +if test $ac_cv_func_strcoll_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_STRCOLL 1 EOF @@ -2591,24 +2723,27 @@ fi # Check out the wait reality. for ac_hdr in sys/wait.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2729: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2601 "configure" +#line 2734 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2616,7 +2751,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF @@ -2628,11 +2763,12 @@ done for ac_func in waitpid wait3 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2767: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2636 "configure" +#line 2772 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2642,8 +2778,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2656,16 +2791,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2679,16 +2816,16 @@ fi done echo $ac_n "checking for union wait""... $ac_c" 1>&6 +echo "configure:2820: checking for union wait" >&5 if eval "test \"`echo '$''{'make_cv_union_wait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2687 "configure" +#line 2825 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> -int main() { return 0; } -int t() { +int main() { union wait status; int pid; pid = wait (&status); #ifdef WEXITSTATUS /* Some POSIXoid systems have both the new-style macros and the old @@ -2707,15 +2844,16 @@ pid = waitpid (-1, &status, 0); ; return 0; } EOF -if { (eval echo configure:2711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* make_cv_union_wait=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* make_cv_union_wait=no fi rm -f conftest* - fi if test "$make_cv_union_wait" = yes; then @@ -2727,11 +2865,12 @@ fi echo "$ac_t""$make_cv_union_wait" 1>&6 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 +echo "configure:2869: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2735 "configure" +#line 2874 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2739,20 +2878,20 @@ else #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -int main() { return 0; } -int t() { +int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_decl_sys_siglist=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6 @@ -2766,30 +2905,32 @@ fi # The presence of the following is not meant to imply # that make necessarily works on those systems. -echo $ac_n "checking for -lsun""... $ac_c" 1>&6 -ac_lib_var=`echo sun'_'getpwnam | tr './+\055' '__p_'` +echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 +echo "configure:2910: checking for getpwnam in -lsun" >&5 +ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <<EOF -#line 2778 "configure" +#line 2918 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getpwnam(); -int main() { return 0; } -int t() { +int main() { getpwnam() ; return 0; } EOF -if { (eval echo configure:2790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -2799,7 +2940,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo sun | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo sun | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF @@ -2865,11 +3007,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -2924,7 +3080,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.10" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -2979,20 +3135,56 @@ s%@REMOTE@%$REMOTE%g CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + cat >> $CONFIG_STATUS <<EOF CONFIG_FILES=\${CONFIG_FILES-"Makefile build.sh"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust relative srcdir, etc. for subdirectories. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -3020,6 +3212,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -3028,14 +3221,16 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. @@ -3056,11 +3251,17 @@ ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' -CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <<EOF + CONFIG_HEADERS="config.h" +EOF +cat >> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac @@ -3068,7 +3269,8 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - cp $ac_given_srcdir/$ac_file_in conftest.in + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in EOF @@ -3096,8 +3298,6 @@ EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. -# Maximum number of lines to put in a single here document. -ac_max_here_lines=12 rm -f conftest.tail while : @@ -3139,7 +3339,11 @@ cat >> $CONFIG_STATUS <<\EOF fi fi; done +EOF +cat >> $CONFIG_STATUS <<EOF +EOF +cat >> $CONFIG_STATUS <<\EOF # Makefile uses this timestamp file to know when to remake Makefile, # build.sh, and glob/Makefile. @@ -3198,13 +3402,16 @@ if test "$no_recursion" != yes; then ac_popdir=`pwd` cd $ac_config_dir + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + case "$srcdir" in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; /*) # Absolute path. ac_sub_srcdir=$srcdir/$ac_config_dir ;; *) # Relative path. - ac_sub_srcdir=../$srcdir/$ac_config_dir ;; + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; esac # Check for guested configure; otherwise get Cygnus style configure. @@ -3221,8 +3428,6 @@ if test "$no_recursion" != yes; then if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. - # A "../" for each directory in /$ac_config_dir. - ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` case "$cache_file" in /*) ac_sub_cache_file=$cache_file ;; *) # Relative path. diff --git a/configure.bat b/configure.bat index f6e5262..a376aca 100644 --- a/configure.bat +++ b/configure.bat @@ -1,24 +1,49 @@ @echo off
-echo Configuring MAKE for go32
+echo Configuring MAKE for DJGPP
rem This batch file assumes a unix-type "sed" program
update configh.dos config.h
-echo # Makefile generated by "configure.bat"> Makefile
+rem Do they have Make?
+redir -o junk.$$$ -eo make -n -f NUL
+rem REDIR will return 1 if it cannot run Make.
+rem If it can run Make, it will usually return 2,
+rem but 0 is also OK with us.
+if errorlevel 2 goto MakeOk
+if not errorlevel 1 goto MakeOk
+if exist junk.$$$ del junk.$$$
+echo No Make program found--use DOSBUILD.BAT to build Make.
+goto End
+
+rem They do have Make. Generate Makefiles.
+
+:MakeOk
+del junk.$$$
+echo # Makefile generated for DJGPP by "configure.bat"> Makefile
if exist config.sed del config.sed
echo ": try_sl ">> config.sed
echo "/\\$/ { ">> config.sed
-echo " N ">> config.sed
-echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
-echo " b try_sl ">> config.sed
+echo " N ">> config.sed
+echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
+echo " b try_sl ">> config.sed
echo "} ">> config.sed
echo "s/@srcdir@/./ ">> config.sed
+echo "s/@exec_prefix@/$(DJDIR)/ ">> config.sed
+echo "s/@prefix@/$(DJDIR)/ ">> config.sed
echo "s/@CC@/gcc/ ">> config.sed
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
+if "%1"=="no-float" goto nofloat
+if "%1"=="NO-FLOAT" goto nofloat
+if "%1"=="NO_FLOAT" goto nofloat
+if "%1"=="no_float" goto nofloat
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
+goto floatdone
+:nofloat
+echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -DNO_FLOAT/ ">> config.sed
+:floatdone
echo "s/@LDFLAGS@// ">> config.sed
echo "s/@RANLIB@/ranlib/ ">> config.sed
echo "s/@DEFS@// ">> config.sed
@@ -27,6 +52,10 @@ echo "s/@ALLOCA@// ">> config.sed echo "s/@LIBS@// ">> config.sed
echo "s/@LIBOBJS@// ">> config.sed
echo "s/@SET_MAKE@// ">> config.sed
+echo "s/@NEED_SETGID@/false/ ">> config.sed
+echo "s/@INSTALL_PROGRAM@/install/ ">> config.sed
+echo "s/@INSTALL_DATA@/install -m 644/ ">> config.sed
+echo "s/@INSTALL@/install/ ">> config.sed
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
echo "s/^config.h *:/_config.h:/ ">> config.sed
echo "s/^defines *=.*$/defines =/ ">> config.sed
@@ -34,7 +63,16 @@ echo "/mv -f make.new make/d ">> config.sed echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
-sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
+echo "/^tagsrcs *=/s/\$(srcs)/$(srcs:.h.in=.h)/ ">> config.sed
+
+echo "s/\*.o/*.o *.exe make.new/ ">> config.sed
+echo "s/\.info\*/.i*/g ">> config.sed
+
+sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
+if exist config2.sed goto SedOk
+echo To configure Make you need a Unix-style Sed program!
+goto End
+:SedOk
sed -f config2.sed Makefile.in >> Makefile
del config.sed
del config2.sed
@@ -42,3 +80,4 @@ del config2.sed cd glob
call configure
cd ..
+:End
diff --git a/configure.in b/configure.in index 1858612..9a35c1a 100644 --- a/configure.in +++ b/configure.in @@ -38,7 +38,7 @@ changequote([,])dnl fi AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl -AC_CHECK_FUNCS(psignal mktemp \ +AC_CHECK_FUNCS(memmove psignal mktemp \ dup2 getcwd sigsetmask getgroups setlinebuf \ seteuid setegid setreuid setregid strerror strsignal) AC_CHECK_SYMBOL(sys_siglist) @@ -44,7 +44,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define NAMLEN(d) _D_NAMLEN(d) #endif -#if (defined (POSIX) || defined (WIN32)) && !defined (__GNU_LIBRARY__) +#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__) /* Posix does not require that the d_ino field be present, and some systems do not provide it. */ #define REAL_DIR_ENTRY(dp) 1 @@ -56,9 +56,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef __MSDOS__ #include <ctype.h> -#if (DJGPP > 1) -#include <libc/dosio.h> -int __opendir_flags = 0; +#include <fcntl.h> + +/* If it's MSDOS that doesn't have _USE_LFN, disable LFN support. */ +#ifndef _USE_LFN +#define _USE_LFN 0 #endif static char * @@ -69,14 +71,11 @@ dosify (filename) char *df; int i; -#if (DJGPP > 1) - if (_USE_LFN) - /* Using long file names; do no transformation. */ + if (filename == 0 || _USE_LFN) return filename; -#endif - if (filename == 0) - return 0; + /* FIXME: what about filenames which violate + 8+3 constraints, like "config.h.in", or ".emacs"? */ if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0) return filename; @@ -106,7 +105,7 @@ dosify (filename) } #endif /* __MSDOS__ */ -#ifdef WIN32 +#ifdef WINDOWS32 #include "pathstuff.h" #endif @@ -206,9 +205,9 @@ struct directory_contents struct directory_contents *next; dev_t dev; /* Device and inode numbers of this dir. */ -#ifdef WIN32 +#ifdef WINDOWS32 /* - * Inode means nothing on WIN32. Even file key information is + * Inode means nothing on WINDOWS32. Even file key information is * unreliable because it is random per file open and undefined * for remote filesystems. The most unique attribute I can * come up with is the fully qualified name of the directory. Beware @@ -217,13 +216,17 @@ struct directory_contents */ char *path_key; int mtime; /* controls check for stale directory cache */ + int fs_flags; /* FS_FAT, FS_NTFS, ... */ +#define FS_FAT 0x1 +#define FS_NTFS 0x2 +#define FS_UNKNOWN 0x4 #else #ifdef VMS ino_t ino[3]; #else ino_t ino; #endif -#endif /* WIN32 */ +#endif /* WINDOWS32 */ struct dirfile **files; /* Files in this directory. */ DIR *dirstream; /* Stream reading this directory. */ }; @@ -279,8 +282,13 @@ find_directory (name) register unsigned int hash = 0; register char *p; register struct directory *dir; -#ifdef WIN32 +#ifdef WINDOWS32 char* w32_path; + char fs_label[BUFSIZ]; + char fs_type[BUFSIZ]; + long fs_serno; + long fs_flags; + long fs_len; #endif #ifdef VMS if ((*name == '.') && (*(name+1) == 0)) @@ -327,7 +335,7 @@ find_directory (name) struct directory_contents *dc; -#ifdef WIN32 +#ifdef WINDOWS32 w32_path = w32ify(name, 1); hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime; #else @@ -343,7 +351,7 @@ find_directory (name) hash %= DIRECTORY_BUCKETS; for (dc = directories_contents[hash]; dc != 0; dc = dc->next) -#ifdef WIN32 +#ifdef WINDOWS32 if (!strcmp(dc->path_key, w32_path)) #else if (dc->dev == st.st_dev @@ -354,7 +362,7 @@ find_directory (name) #else && dc->ino == st.st_ino) #endif -#endif /* WIN32 */ +#endif /* WINDOWS32 */ break; if (dc == 0) @@ -366,9 +374,27 @@ find_directory (name) /* Enter it in the contents hash table. */ dc->dev = st.st_dev; -#ifdef WIN32 +#ifdef WINDOWS32 dc->path_key = strdup(w32_path); dc->mtime = st.st_mtime; + + /* + * NTFS is the only WINDOWS32 filesystem that bumps mtime + * on a directory when files are added/deleted from + * a directory. + */ + w32_path[3] = '\0'; + if (GetVolumeInformation(w32_path, + fs_label, sizeof (fs_label), + &fs_serno, &fs_len, + &fs_flags, fs_type, sizeof (fs_type)) == FALSE) + dc->fs_flags = FS_UNKNOWN; + else if (!strcmp(fs_type, "FAT")) + dc->fs_flags = FS_FAT; + else if (!strcmp(fs_type, "NTFS")) + dc->fs_flags = FS_NTFS; + else + dc->fs_flags = FS_UNKNOWN; #else #ifdef VMS dc->ino[0] = st.st_ino[0]; @@ -377,17 +403,10 @@ find_directory (name) #else dc->ino = st.st_ino; #endif -#endif /* WIN32 */ +#endif /* WINDOWS32 */ dc->next = directories_contents[hash]; directories_contents[hash] = dc; -#if defined (__MSDOS__) && (DJGPP > 1) - if (_USE_LFN) - /* We are using long filenames, so tell opendir not - to mess with them. */ - __opendir_flags = __OPENDIR_PRESERVE_CASE; -#endif - dc->dirstream = opendir (name); if (dc->dirstream == 0) { @@ -432,7 +451,7 @@ dir_contents_file_exists_p (dir, filename) register char *p; register struct dirfile *df; register struct dirent *d; -#ifdef WIN32 +#ifdef WINDOWS32 struct stat st; int rehash = 0; #endif @@ -483,11 +502,16 @@ dir_contents_file_exists_p (dir, filename) if (dir->dirstream == 0) { -#ifdef WIN32 - /* Check to see if directory has changed since last read */ +#ifdef WINDOWS32 + /* + * Check to see if directory has changed since last read. FAT + * filesystems force a rehash always as mtime does not change + * on directories (ugh!). + */ if (dir->path_key && - stat(dir->path_key, &st) == 0 && - st.st_mtime > dir->mtime) { + (dir->fs_flags & FS_FAT || + (stat(dir->path_key, &st) == 0 && + st.st_mtime > dir->mtime))) { /* reset date stamp to show most recent re-process */ dir->mtime = st.st_mtime; @@ -519,7 +543,7 @@ dir_contents_file_exists_p (dir, filename) for (i = 0; i < len; ++i) HASHI (newhash, d->d_name[i]); newhash %= DIRFILE_BUCKETS; -#ifdef WIN32 +#ifdef WINDOWS32 /* * If re-reading a directory, check that this file isn't already * in the cache. @@ -543,7 +567,7 @@ dir_contents_file_exists_p (dir, filename) dir->files[newhash] = df; df->name = savestring (d->d_name, len); df->impossible = 0; -#ifdef WIN32 +#ifdef WINDOWS32 } #endif /* Check if the name matches the one we're searching for. */ @@ -599,12 +623,16 @@ file_exists_p (name) return dir_file_exists_p ("[]", name); #else /* !VMS */ dirend = rindex (name, '/'); -#ifdef WIN32 - if (!dirend) - dirend = rindex(name, '\\'); -#endif /* WIN32 */ - if (dirend == 0) - return dir_file_exists_p (".", name); +#if defined (WINDOWS32) || defined (__MSDOS__) + /* Forward and backslashes might be mixed. We need the rightmost one. */ + { + char *bslash = rindex(name, '\\'); + if (!dirend || bslash > dirend) + dirend = bslash; + /* The case of "d:file" is unhandled. But I don't think + such names can happen here. */ + } +#endif /* WINDOWS32 || __MSDOS__ */ if (dirend == 0) #ifndef _AMIGA return dir_file_exists_p (".", name); @@ -613,9 +641,14 @@ file_exists_p (name) #endif /* AMIGA */ #endif /* VMS */ - dirname = (char *) alloca (dirend - name + 1); - bcopy (name, dirname, dirend - name); - dirname[dirend - name] = '\0'; + if (dirend == name) + dirname = "/"; + else + { + dirname = (char *) alloca (dirend - name + 1); + bcopy (name, dirname, dirend - name); + dirname[dirend - name] = '\0'; + } return dir_file_exists_p (dirname, dirend + 1); } @@ -640,6 +673,16 @@ file_impossible (filename) dir = find_directory ("[]"); #else dirend = rindex (p, '/'); +#if defined (WINDOWS32) || defined (__MSDOS__) + /* Forward and backslashes might be mixed. We need the rightmost one. */ + { + char *bslash = rindex(p, '\\'); + if (!dirend || bslash > dirend) + dirend = bslash; + /* The case of "d:file" is unhandled. But I don't think + such names can happen here. */ + } +#endif /* WINDOWS32 or __MSDOS__ */ if (dirend == 0) #ifdef _AMIGA dir = find_directory (""); @@ -649,9 +692,15 @@ file_impossible (filename) #endif /* VMS */ else { - char *dirname = (char *) alloca (dirend - p + 1); - bcopy (p, dirname, dirend - p); - dirname[dirend - p] = '\0'; + char *dirname; + if (dirend == p) + dirname = "/"; + else + { + dirname = (char *) alloca (dirend - p + 1); + bcopy (p, dirname, dirend - p); + dirname[dirend - p] = '\0'; + } dir = find_directory (dirname); filename = p = dirend + 1; } @@ -666,10 +715,10 @@ file_impossible (filename) structure for it, but leave it out of the contents hash table. */ dir->contents = (struct directory_contents *) xmalloc (sizeof (struct directory_contents)); -#ifdef WIN32 +#ifdef WINDOWS32 dir->contents->path_key = NULL; dir->contents->mtime = 0; -#else /* WIN32 */ +#else /* WINDOWS32 */ #ifdef VMS dir->contents->dev = 0; dir->contents->ino[0] = dir->contents->ino[1] = @@ -677,7 +726,7 @@ file_impossible (filename) #else dir->contents->dev = dir->contents->ino = 0; #endif -#endif /* WIN32 */ +#endif /* WINDOWS32 */ dir->contents->files = 0; dir->contents->dirstream = 0; } @@ -718,10 +767,16 @@ file_impossible_p (filename) dir = find_directory ("[]")->contents; #else dirend = rindex (filename, '/'); -#ifdef WIN32 - if (!dirend) - dirend = rindex (filename, '\\'); -#endif /* WIN32 */ +#if defined (WINDOWS32) || defined (__MSDOS__) + /* Forward and backslashes might be mixed. We need the rightmost one. */ + { + char *bslash = rindex(filename, '\\'); + if (!dirend || bslash > dirend) + dirend = bslash; + /* The case of "d:file" is unhandled. But I don't think + such names can happen here. */ + } +#endif /* WINDOWS32 || __MSDOS__ */ if (dirend == 0) #ifdef _AMIGA dir = find_directory ("")->contents; @@ -731,9 +786,15 @@ file_impossible_p (filename) #endif /* VMS */ else { - char *dirname = (char *) alloca (dirend - filename + 1); - bcopy (p, dirname, dirend - p); - dirname[dirend - p] = '\0'; + char *dirname; + if (dirend == filename) + dirname = "/"; + else + { + dirname = (char *) alloca (dirend - filename + 1); + bcopy (p, dirname, dirend - p); + dirname[dirend - p] = '\0'; + } dir = find_directory (dirname)->contents; p = filename = dirend + 1; } @@ -791,10 +852,10 @@ print_dir_data_base () if (dir->contents == 0) printf ("# %s: could not be stat'd.\n", dir->name); else if (dir->contents->files == 0) -#ifdef WIN32 +#ifdef WINDOWS32 printf ("# %s (key %s, mtime %d): could not be opened.\n", dir->name, dir->contents->path_key,dir->contents->mtime); -#else /* WIN32 */ +#else /* WINDOWS32 */ #ifdef VMS printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n", dir->name, dir->contents->dev, @@ -805,7 +866,7 @@ print_dir_data_base () dir->name, (long int) dir->contents->dev, (long int) dir->contents->ino); #endif -#endif /* WIN32 */ +#endif /* WINDOWS32 */ else { register unsigned int f = 0, im = 0; @@ -817,10 +878,10 @@ print_dir_data_base () ++im; else ++f; -#ifdef WIN32 +#ifdef WINDOWS32 printf ("# %s (key %s, mtime %d): ", dir->name, dir->contents->path_key, dir->contents->mtime); -#else /* WIN32 */ +#else /* WINDOWS32 */ #ifdef VMS printf ("# %s (device %d, inode [%d,%d,%d]): ", dir->name, dir->contents->dev, @@ -830,7 +891,7 @@ print_dir_data_base () printf ("# %s (device %d, inode %d): ", dir->name, dir->contents->dev, dir->contents->ino); #endif -#endif /* WIN32 */ +#endif /* WINDOWS32 */ if (f == 0) fputs ("No", stdout); else @@ -87,7 +87,7 @@ lookup_file (name) for (f = files[hashval]; f != 0; f = f->next) { - if (strieq (f->name, name)) + if (strieq (f->hname, name)) { return f; } @@ -128,7 +128,7 @@ enter_file (name) hashval %= FILE_BUCKETS; for (f = files[hashval]; f != 0; f = f->next) - if (strieq (f->name, name)) + if (strieq (f->hname, name)) break; if (f != 0 && !f->double_colon) @@ -141,7 +141,7 @@ enter_file (name) new = (struct file *) xmalloc (sizeof (struct file)); bzero ((char *) new, sizeof (struct file)); - new->name = name; + new->name = new->hname = name; new->update_status = -1; if (f == 0) @@ -162,16 +162,16 @@ enter_file (name) return new; } -/* Rename FILE to NAME. This is not as simple as resetting - the `name' member, since it must be put in a new hash bucket, +/* Rehash FILE to NAME. This is not as simple as resetting + the `hname' member, since it must be put in a new hash bucket, and possibly merged with an existing file called NAME. */ void -rename_file (file, name) +rehash_file (file, name) register struct file *file; char *name; { - char *oldname = file->name; + char *oldname = file->hname; register unsigned int oldhash; register char *n; @@ -208,9 +208,12 @@ file_hash_enter (file, name, oldhash, oldname) /* Look for an existing file under the new name. */ for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next) - if (strieq (oldfile->name, name)) + if (strieq (oldfile->hname, name)) break; + /* If the old file is the same as the new file, something's wrong. */ + assert (oldfile != file); + if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0)) { /* Remove FILE from its hash bucket. */ @@ -228,9 +231,9 @@ file_hash_enter (file, name, oldhash, oldname) /* Give FILE its new name. */ - file->name = name; + file->hname = name; for (f = file->double_colon; f != 0; f = f->prev) - f->name = name; + f->hname = name; if (oldfile == 0) { @@ -319,6 +322,7 @@ in favor of those for `%s'.", MERGE (is_target); MERGE (cmd_target); MERGE (phony); + MERGE (ignore_vpath); #undef MERGE file->renamed = oldfile; @@ -1,5 +1,5 @@ /* Definition of target file data structures for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. +Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 97 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify @@ -24,6 +24,8 @@ struct file { struct file *next; char *name; + char *hname; /* Hashed filename */ + char *vpath; /* VPATH/vpath pathname */ struct dep *deps; struct commands *cmds; /* Commands to execute for this target. */ int command_flags; /* Flags OR'd in for cmds; see commands.h. */ @@ -77,6 +79,7 @@ struct file unsigned int secondary:1; unsigned int dontcare:1; /* Nonzero if no complaint is to be made if this target cannot be remade. */ + unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */ }; /* Number of intermediate files entered. */ @@ -88,7 +91,7 @@ extern struct file *default_goal_file, *suffix_file, *default_file; extern struct file *lookup_file (), *enter_file (); extern void remove_intermediates (), snap_deps (); -extern void rename_file (), file_hash_enter (); +extern void rehash_file (), file_hash_enter (); extern void set_command_state (); @@ -109,11 +112,8 @@ extern time_t f_mtime (); 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) + them, even if said dependents' modtimes are in the future. */ +#define NEW_MTIME INTEGER_TYPE_MAXIMUM (time_t) #define check_renamed(file) \ @@ -23,14 +23,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "job.h" #include "commands.h" -#ifdef __MSDOS__ -#include <process.h> -#include <fcntl.h> -#endif #ifdef _AMIGA #include "amiga.h" #endif -#ifdef WIN32 +#ifdef WINDOWS32 #include <windows.h> #include <io.h> #include "sub_proc.h" @@ -235,6 +231,7 @@ enum function function_firstword, function_word, function_words, + function_wordlist, function_findstring, function_strip, function_join, @@ -271,6 +268,7 @@ static struct { "firstword", 9, function_firstword }, { "word", 4, function_word }, { "words", 5, function_words }, + { "wordlist", 8, function_wordlist }, { "findstring", 10, function_findstring }, { "strip", 5, function_strip }, { "join", 4, function_join }, @@ -336,7 +334,7 @@ expand_function (o, function, text, end) char *end; { char *p, *p2, *p3; - unsigned int i, len; + unsigned int i, j, len; int doneany = 0; int count; char endparen = *end, startparen = *end == ')' ? '(' : '{'; @@ -350,7 +348,7 @@ expand_function (o, function, text, end) #ifndef VMS /* not supported for vms yet */ case function_shell: { -#ifdef WIN32 +#ifdef WINDOWS32 SECURITY_ATTRIBUTES saAttr; HANDLE hIn; HANDLE hErr; @@ -358,6 +356,9 @@ expand_function (o, function, text, end) HANDLE hChildOutWr; HANDLE hProcess; #endif +#ifdef __MSDOS__ + FILE *fpipe; +#endif char **argv; char *error_prefix; #ifndef _AMIGA @@ -369,11 +370,13 @@ expand_function (o, function, text, end) /* Expand the command line. */ text = expand_argument (text, end); +#ifndef __MSDOS__ /* Construct the argument list. */ argv = construct_command_argv (text, (char **) NULL, (struct file *) 0); if (argv == 0) break; +#endif #ifndef _AMIGA /* Using a target environment for `shell' loses in cases like: @@ -400,8 +403,8 @@ expand_function (o, function, text, end) else error_prefix = ""; -#if !defined(__MSDOS__) && !defined(_AMIGA) -# ifdef WIN32 +#ifndef _AMIGA +# ifdef WINDOWS32 saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); saAttr.bInheritHandle = TRUE; saAttr.lpSecurityDescriptor = NULL; @@ -451,30 +454,78 @@ expand_function (o, function, text, end) /* this will be closed almost right away */ pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND); -# else /* WIN32 */ - if (pipe (pipedes) < 0) - { - perror_with_name (error_prefix, "pipe"); - break; - } - +# else /* WINDOWS32 */ +# ifdef __MSDOS__ + { + /* MSDOS can't fork, but it has `popen'. + (Bwt, why isn't `popen' used in all the versions?) */ + struct variable *sh = lookup_variable ("SHELL", 5); + int e; + extern int dos_command_running, dos_status; + + /* Make sure not to bother processing an empty line. */ + while (isblank (*text)) + ++text; + if (*text == '\0') + break; + + if (sh) + { + char buf[PATH_MAX + 7]; + /* This makes sure $SHELL value is used by $(shell), even + though the target environment is not passed to it. */ + sprintf (buf, "SHELL=%s", sh->value); + putenv (buf); + } + + e = errno; + errno = 0; + dos_command_running = 1; + dos_status = 0; + fpipe = popen (text, "rt"); + dos_command_running = 0; + if (!fpipe || dos_status) + { + pipedes[0] = -1; + pid = -1; + if (dos_status) + errno = EINTR; + else if (errno == 0) + errno = ENOMEM; + shell_function_completed = -1; + } + else + { + pipedes[0] = fileno (fpipe); + pid = 42; + errno = e; + shell_function_completed = 1; + } + } + if (pipedes[0] < 0) +# else /* ! __MSDOS__ */ + if (pipe (pipedes) < 0) +# endif /* __MSDOS__ */ + { + perror_with_name (error_prefix, "pipe"); + break; + } + +# ifndef __MSDOS__ pid = vfork (); if (pid < 0) perror_with_name (error_prefix, "fork"); else if (pid == 0) child_execute_job (0, pipedes[1], argv, envp); else -# endif /* WIN32 */ +# endif /* ! __MSDOS__ */ +# endif /* WINDOWS32 */ { /* We are the parent. */ char *buffer; unsigned int maxlen; int cc; - - /* 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]); @@ -483,17 +534,22 @@ expand_function (o, function, text, end) /* Record the PID for reap_children. */ shell_function_pid = pid; +#ifndef __MSDOS__ shell_function_completed = 0; + /* Free the storage only the child needed. */ + free (argv[0]); + free ((char *) argv); + + /* Close the write side of the pipe. */ + (void) close (pipedes[1]); +#endif /* Set up and read from the pipe. */ maxlen = 200; buffer = (char *) xmalloc (maxlen + 1); - /* Close the write side of the pipe. */ - (void) close (pipedes[1]); - /* Read from the pipe until it gets EOF. */ i = 0; do @@ -516,7 +572,12 @@ expand_function (o, function, text, end) #endif /* Close the read side of the pipe. */ +#ifdef __MSDOS__ + if (fpipe) + (void) pclose (fpipe); +#else (void) close (pipedes[0]); +#endif /* Loop until child_handler sets shell_function_completed to the status of our child shell. */ @@ -557,73 +618,16 @@ expand_function (o, function, text, end) free (buffer); } -#else /* MSDOS or Amiga */ -#ifndef _AMIGA - { - /* MS-DOS can't do fork, but it can do spawn. However, this - means that we don't have an opportunity to reopen stdout to - trap it. Thus, we save our own stdout onto a new descriptor - and dup a temp file's descriptor onto our stdout temporarily. - After we spawn the shell program, we dup our own stdout back - to the stdout descriptor. The buffer reading is the same as - above, except that we're now reading from a file. */ - - int save_stdout; - int child_stdout; - char tmp_output[FILENAME_MAX]; - FILE *child_stream; - unsigned int maxlen = 200; - int cc; - char *buffer; - - strcpy (tmp_output, "shXXXXXX"); - mktemp (tmp_output); - child_stdout = open (tmp_output, - O_WRONLY|O_CREAT|O_TRUNC|O_TEXT, 0644); - save_stdout = dup (1); - dup2 (child_stdout, 1); - spawnvp (P_WAIT, argv[0], argv); - dup2 (save_stdout, 1); - close (child_stdout); - close (save_stdout); - - child_stdout = open (tmp_output, O_RDONLY|O_TEXT, 0644); - - buffer = xmalloc (maxlen); - i = 0; - do - { - if (i == maxlen) - { - maxlen += 512; - buffer = (char *) xrealloc (buffer, maxlen + 1); - } - - cc = read (child_stdout, &buffer[i], maxlen - i); - if (cc > 0) - i += cc; - } while (cc > 0); - - close (child_stdout); - unlink (tmp_output); - - if (i > 0) - { - if (buffer[i - 1] == '\n') - buffer[--i] = '\0'; - else - buffer[i] = '\0'; - p = buffer; - while ((p = index (p, '\n')) != 0) - *p++ = ' '; - o = variable_buffer_output (o, buffer, i); - } - free (buffer); - } -#else /* Amiga */ +#else /* Amiga */ { /* Amiga can't fork nor spawn, but I can start a program with - redirection of my choice. The rest is the same as above. */ + redirection of my choice. However, this means that we + don't have an opportunity to reopen stdout to trap it. Thus, + we save our own stdout onto a new descriptor and dup a temp + file's descriptor onto our stdout temporarily. After we + spawn the shell program, we dup our own stdout back to the + stdout descriptor. The buffer reading is the same as above, + except that we're now reading from a file. */ #include <dos/dos.h> #include <proto/dos.h> @@ -696,7 +700,6 @@ expand_function (o, function, text, end) free (buffer); } #endif /* Not Amiga. */ -#endif /* MSDOS or Amiga. */ free (text); break; @@ -1194,6 +1197,91 @@ index argument"); free (text); break; + case function_wordlist: + /* Get two comma-separated arguments and expand each one. */ + count = 0; + for (p = text; p < end; ++p) + { + if (*p == startparen) + ++count; + else if (*p == endparen) + --count; + else if (*p == ',' && count <= 0) + break; + } + if (p == end) + BADARGS ("wordlist"); + text = expand_argument (text, p); + + /* Check the first argument. */ + for (p2 = text; *p2 != '\0'; ++p2) + if (*p2 < '0' || *p2 > '9') + { + if (reading_filename != 0) + makefile_fatal (reading_filename, *reading_lineno_ptr, + "non-numeric first argument to `wordlist' function"); + else + fatal ("non-numeric first argument to `wordlist' function"); + } + i = (unsigned int)atoi(text); + free (text); + + /* Check the next argument */ + for (p2 = p + 1; isblank(*p2); ++p2) + {} + count = 0; + for (p = p2; p < end; ++p) + { + if (*p == startparen) + ++count; + else if (*p == endparen) + --count; + else if (*p == ',' && count <= 0) + break; + } + if (p == end) + BADARGS ("wordlist"); + text = expand_argument (p2, p); + + for (p2 = text; *p2 != '\0'; ++p2) + if (*p2 < '0' || *p2 > '9') + { + if (reading_filename != 0) + makefile_fatal (reading_filename, *reading_lineno_ptr, + "non-numeric second argument to `wordlist' function"); + else + fatal ("non-numeric second argument to `wordlist' function"); + } + j = (unsigned int)atoi(text); + free (text); + + if (j > i) + j -= i; + else + { + unsigned int k; + k = j; + j = i - j; + i = k; + } + ++j; + + /* Extract the requested words */ + text = expand_argument (p + 1, end); + p2 = text; + + while (((p = find_next_token (&p2, &len)) != 0) && --i) + {} + if (p) + { + while (--j && (find_next_token (&p2, &len) != 0)) + {} + o = variable_buffer_output (o, p, p2 - p); + } + + free (text); + break; + case function_findstring: /* Get two comma-separated arguments and expand each one. */ count = 0; @@ -1270,17 +1358,27 @@ index argument"); { p = p2 + len; #ifdef VMS - while (p >= p2 && *p != (function == function_dir ? ']' : '.')) + while (p >= p2 && *p != ']' + && (function != function_basename || *p != '.')) #else - while (p >= p2 && *p != (function == function_dir ? '/' : '.')) +# ifdef __MSDOS__ + while (p >= p2 && *p != '/' && *p != '\\' + && (function != function_basename || *p != '.')) +# else + while (p >= p2 && *p != '/' + && (function != function_basename || *p != '.')) +# endif #endif --p; - if (p >= p2) - { - if (function == function_dir) - ++p; - o = variable_buffer_output (o, p2, p - p2); - } + if (p >= p2 && (function == function_dir)) + o = variable_buffer_output (o, p2, ++p - p2); + else if (p >= p2 && (*p == '.')) + o = variable_buffer_output (o, p2, p - p2); +#if defined(WINDOWS32) || defined(__MSDOS__) + /* Handle the "d:foobar" case */ + else if (p2[0] && p2[1] == ':' && function == function_dir) + o = variable_buffer_output (o, p2, 2); +#endif else if (function == function_dir) #ifdef VMS o = variable_buffer_output (o, "[]", 2); @@ -1315,17 +1413,34 @@ index argument"); { p = p2 + len; #ifdef VMS - while (p >= p2 && *p != (function == function_notdir ? ']' : '.')) + while (p >= p2 && *p != ']' + && (function != function_suffix || *p != '.')) #else - while (p >= p2 && *p != (function == function_notdir ? '/' : '.')) +# ifdef __MSDOS__ + while (p >= p2 && *p != '/' && *p != '\\' + && (function != function_suffix || *p != '.')) +# else + while (p >= p2 && *p != '/' + && (function != function_suffix || *p != '.')) +# endif #endif --p; if (p >= p2) { if (function == function_notdir) - ++p; + ++p; + else if (*p != '.') + continue; o = variable_buffer_output (o, p, len - (p - p2)); } +#if defined(WINDOWS32) || defined(__MSDOS__) + /* Handle the case of "d:foo/bar". */ + else if (function == function_notdir && p2[0] && p2[1] == ':') + { + p = p2 + 2; + o = variable_buffer_output (o, p, len - (p - p2)); + } +#endif else if (function == function_notdir) o = variable_buffer_output (o, p2, len); diff --git a/getloadavg.c b/getloadavg.c index 8461487..be589e7 100644 --- a/getloadavg.c +++ b/getloadavg.c @@ -43,7 +43,7 @@ DGUX eunice UNIX emulator under VMS. hpux - MSDOS No-op for MSDOS. + __MSDOS__ No-op for MSDOS. NeXT sgi sequent Sequent Dynix 3.x.x (BSD) @@ -52,7 +52,7 @@ UMAX UMAX4_3 VMS - WIN32 No-op for Windows95/NT. + WINDOWS32 No-op for Windows95/NT. __linux__ Linux: assumes /proc filesystem mounted. Support from Michael K. Johnson. __NetBSD__ NetBSD: assumes /kern filesystem mounted. @@ -824,7 +824,7 @@ getloadavg (loadavg, nelem) : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); # endif /* OSF_MIPS */ -# if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32)) +# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32)) # define LDAV_DONE /* A faithful emulation is going to have to be saved for a rainy day. */ @@ -832,7 +832,7 @@ getloadavg (loadavg, nelem) { loadavg[elem] = 0.0; } -# endif /* MSDOS */ +# endif /* __MSDOS__ || WINDOWS32 */ # if !defined (LDAV_DONE) && defined (OSF_ALPHA) # define LDAV_DONE diff --git a/glob/COPYING.LIB.old b/glob/COPYING.LIB.old index eb685a5..886fb5d 100755 --- a/glob/COPYING.LIB.old +++ b/glob/COPYING.LIB.old @@ -164,318 +164,4 @@ above, provided that you also meet all of these conditions: the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! + table, the facility still operates, and performs what../make/ diff --git a/glob/configure.bat b/glob/configure.bat index f3a0f5d..b6104e1 100644 --- a/glob/configure.bat +++ b/glob/configure.bat @@ -1,5 +1,5 @@ @echo off
-echo Configuring glob for GO32
+echo Configuring glob for DJGPP
rem This batch file assumes a unix-type "sed" program
echo # Makefile generated by "configure.bat"> Makefile
diff --git a/glob/fnmatch.c b/glob/fnmatch.c index de45941..e143743 100644 --- a/glob/fnmatch.c +++ b/glob/fnmatch.c @@ -1,27 +1,28 @@ -/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> +/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include <config.h> #endif /* Enable GNU extensions in fnmatch.h. */ #ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 +# define _GNU_SOURCE 1 #endif #include <errno.h> @@ -37,12 +38,21 @@ Cambridge, MA 02139, USA. */ program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) +#if defined _LIBC || !defined __GNU_LIBRARY__ + +# if defined STDC_HEADERS || !defined isascii +# define ISASCII(c) 1 +# else +# define ISASCII(c) isascii(c) +# endif -#ifndef errno +# define ISUPPER(c) (ISASCII (c) && isupper (c)) + + +# ifndef errno extern int errno; -#endif +# endif /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ @@ -55,8 +65,8 @@ fnmatch (pattern, string, flags) register const char *p = pattern, *n = string; register char c; -/* Note that this evalutes C many times. */ -#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) +/* Note that this evaluates C many times. */ +# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { @@ -225,6 +235,8 @@ fnmatch (pattern, string, flags) return 0; return FNM_NOMATCH; + +# undef FOLD } #endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/glob/fnmatch.h b/glob/fnmatch.h index 9a0036e..20ed659 100644 --- a/glob/fnmatch.h +++ b/glob/fnmatch.h @@ -1,19 +1,20 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _FNMATCH_H @@ -24,7 +25,7 @@ extern "C" { #endif #if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \ - || defined (WIN32)) + || defined (WINDOWS32)) #undef __P #define __P(protos) protos #else /* Not C++ or ANSI C. */ diff --git a/glob/glob.c b/glob/glob.c index 76060e1..8474766 100644 --- a/glob/glob.c +++ b/glob/glob.c @@ -1,19 +1,19 @@ -/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* AIX requires this to be the first thing in the file. */ #if defined (_AIX) && !defined (__GNUC__) @@ -33,6 +33,10 @@ Cambridge, MA 02139, USA. */ #include <sys/types.h> #include <sys/stat.h> +/* Outcomment the following line for production quality code. */ +/* #define NDEBUG 1 */ +#include <assert.h> + /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C @@ -52,11 +56,11 @@ Cambridge, MA 02139, USA. */ #ifndef ELIDE_CODE -#ifdef STDC_HEADERS +#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) #include <stddef.h> #endif -#ifdef HAVE_UNISTD_H +#if defined HAVE_UNISTD_H || defined _LIBC #include <unistd.h> #ifndef POSIX #ifdef _POSIX_VERSION @@ -65,13 +69,16 @@ Cambridge, MA 02139, USA. */ #endif #endif -#if !defined (_AMIGA) && !defined (VMS) && !defined(WIN32) +#if !defined (_AMIGA) && !defined (VMS) && !defined(WINDOWS32) #include <pwd.h> #endif #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) extern int errno; #endif +#ifndef __set_errno +#define __set_errno(val) errno = (val) +#endif #ifndef NULL #define NULL 0 @@ -106,7 +113,7 @@ extern int errno; #endif -#if (defined (POSIX) || defined (WIN32)) && !defined (__GNU_LIBRARY__) +#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__) /* Posix does not require that the d_ino field be present, and some systems do not provide it. */ #define REAL_DIR_ENTRY(dp) 1 @@ -156,7 +163,7 @@ extern void bcopy (); ((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0))) #endif /* Not ANSI_STRING. */ -#ifndef HAVE_STRCOLL +#if !defined HAVE_STRCOLL && !defined _LIBC #define strcoll strcmp #endif @@ -166,7 +173,7 @@ extern void bcopy (); __inline #endif #ifndef __SASC -#ifdef WIN32 +#ifdef WINDOWS32 static void * #else static char * @@ -196,11 +203,11 @@ my_realloc (p, n) #include <alloca.h> #else /* Not HAVE_ALLOCA_H. */ #ifndef _AIX -#ifdef WIN32 +#ifdef WINDOWS32 #include <malloc.h> #else extern char *alloca (); -#endif /* WIN32 */ +#endif /* WINDOWS32 */ #endif /* Not _AIX. */ #endif /* sparc or HAVE_ALLOCA_H. */ #endif /* GCC. */ @@ -219,7 +226,7 @@ extern char *alloca (); #endif #endif -#ifndef STDC_HEADERS +#if !(defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) #undef size_t #define size_t unsigned int #endif @@ -251,6 +258,51 @@ static int glob_in_dir __P ((const char *pattern, const char *directory, static int prefix_array __P ((const char *prefix, char **array, size_t n)); static int collated_compare __P ((const __ptr_t, const __ptr_t)); + +/* Find the end of the sub-pattern in a brace expression. We define + this as an inline function if the compiler permits. */ +static +#if __GNUC__ - 0 >= 2 +inline +#endif +const char * +next_brace_sub (const char *begin) +{ + unsigned int depth = 0; + const char *cp = begin; + + while (1) + { + if (depth == 0) + { + if (*cp != ',' && *cp != '}' && *cp != '\0') + { + if (*cp == '{') + ++depth; + ++cp; + continue; + } + } + else + { + while (*cp != '\0' && (*cp != '}' || depth > 0)) + { + if (*cp == '}') + ++depth; + ++cp; + } + if (*cp == '\0') + /* An incorrectly terminated brace expression. */ + return NULL; + + continue; + } + break; + } + + return cp; +} + /* Do glob searching for PATTERN, placing results in PGLOB. The bits defined above may be set in FLAGS. If a directory cannot be opened or read and ERRFUNC is not nil, @@ -274,7 +326,7 @@ glob (pattern, flags, errfunc, pglob) if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -283,38 +335,59 @@ glob (pattern, flags, errfunc, pglob) const char *begin = strchr (pattern, '{'); if (begin != NULL) { + /* Allocate working buffer large enough for our work. Note that + we have at least an opening and closing brace. */ int firstc; - size_t restlen; - const char *p, *end, *next; - unsigned int depth = 0; - - /* Find the end of the brace expression, by counting braces. - While we're at it, notice the first comma at top brace level. */ - end = begin + 1; - next = NULL; - while (1) + char *alt_start; + const char *p; + const char *next; + const char *rest; + size_t rest_len; +#ifdef __GNUC__ + char onealt[strlen (pattern) - 1]; +#else + char *onealt = (char *) malloc (strlen (pattern) - 1); + if (onealt == NULL) + { + if (!(flags & GLOB_APPEND)) + globfree (pglob); + return GLOB_NOSPACE; + } +#endif + + /* We know the prefix for all sub-patterns. */ + memcpy (onealt, pattern, begin - pattern); + alt_start = &onealt[begin - pattern]; + + /* Find the first sub-pattern and at the same time find the + rest after the closing brace. */ + next = next_brace_sub (begin + 1); + if (next == NULL) { - switch (*end++) + /* It is an illegal expression. */ +#ifndef __GNUC__ + free (onealt); +#endif + return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob); + } + + /* Now find the end of the whole brace expression. */ + rest = next; + while (*rest != '}') + { + rest = next_brace_sub (rest + 1); + if (rest == NULL) { - case ',': - if (depth == 0 && next == NULL) - next = end; - continue; - case '{': - ++depth; - continue; - case '}': - if (depth-- == 0) - break; - continue; - case '\0': - return glob (pattern, flags &~ GLOB_BRACE, errfunc, pglob); + /* It is an illegal expression. */ +#ifndef __GNUC__ + free (onealt); +#endif + return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob); } - break; } - restlen = strlen (end) + 1; - if (next == NULL) - next = end; + /* Please note that we now can be sure the brace expression + is well-formed. */ + rest_len = strlen (++rest) + 1; /* We have a brace expression. BEGIN points to the opening {, NEXT points past the terminator of the first element, and END @@ -331,72 +404,47 @@ glob (pattern, flags, errfunc, pglob) } firstc = pglob->gl_pathc; - /* In this loop P points to the beginning of the current element - and NEXT points past its terminator. */ p = begin + 1; while (1) { - /* Construct a whole name that is one of the brace - alternatives in a temporary buffer. */ int result; - size_t bufsz = (begin - pattern) + (next - 1 - p) + restlen; -#ifdef __GNUC__ - char onealt[bufsz]; -#else - char *onealt = malloc (bufsz); - if (onealt == NULL) - { - if (!(flags & GLOB_APPEND)) - globfree (pglob); - return GLOB_NOSPACE; - } -#endif - memcpy (onealt, pattern, begin - pattern); - memcpy (&onealt[begin - pattern], p, next - 1 - p); - memcpy (&onealt[(begin - pattern) + (next - 1 - p)], - end, restlen); + + /* Construct the new glob expression. */ + memcpy (alt_start, p, next - p); + memcpy (&alt_start[next - p], rest, rest_len); + result = glob (onealt, - ((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) | - GLOB_APPEND), errfunc, pglob); -#ifndef __GNUC__ - free (onealt); -#endif + ((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) + | GLOB_APPEND), errfunc, pglob); /* If we got an error, return it. */ if (result && result != GLOB_NOMATCH) { +#ifndef __GNUC__ + free (onealt); +#endif if (!(flags & GLOB_APPEND)) globfree (pglob); return result; } - /* Advance past this alternative and process the next. */ - p = next; - depth = 0; - scan: - switch (*p++) - { - case ',': - if (depth == 0) - { - /* Found the next alternative. Loop to glob it. */ - next = p; - continue; - } - goto scan; - case '{': - ++depth; - goto scan; - case '}': - if (depth-- == 0) - /* End of the brace expression. Break out of the loop. */ - break; - goto scan; - } + if (*next == '}') + /* We saw the last entry. */ + break; + + p = next + 1; + next = next_brace_sub (p); + assert (next != NULL); } - if (pglob->gl_pathc == firstc && - !(flags & (GLOB_NOCHECK|GLOB_NOMAGIC))) +#ifndef __GNUC__ + free (onealt); +#endif + + if (pglob->gl_pathc != firstc) + /* We found some entries. */ + return 0; + else if (!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC))) return GLOB_NOMATCH; } } @@ -449,51 +497,123 @@ glob (pattern, flags, errfunc, pglob) #ifndef VMS if ((flags & GLOB_TILDE) && dirname[0] == '~') { - if (dirname[1] == '\0') + if (dirname[1] == '\0' || dirname[1] == '/') { /* Look up home directory. */ - dirname = getenv ("HOME"); + char *home_dir = getenv ("HOME"); #ifdef _AMIGA - if (dirname == NULL || dirname[0] == '\0') - dirname = "SYS:"; + if (home_dir == NULL || home_dir[0] == '\0') + home_dir = "SYS:"; #else -#ifdef WIN32 - if (dirname == NULL || dirname[0] == '\0') - dirname = "c:/users/default"; /* poor default */ +#ifdef WINDOWS32 + if (home_dir == NULL || home_dir[0] == '\0') + home_dir = "c:/users/default"; /* poor default */ #else - if (dirname == NULL || dirname[0] == '\0') + if (home_dir == NULL || home_dir[0] == '\0') { extern char *getlogin __P ((void)); - char *name = getlogin (); - if (name != NULL) + extern int getlogin_r __P ((char *, size_t)); + int success; + +#if defined HAVE_GETLOGIN_R || defined _LIBC + size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1; + char *name; + + if (buflen == 0) + /* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try + a moderate value. */ + buflen = 16; + name = __alloca (buflen); + + success = getlogin_r (name, buflen) >= 0; +#else + char *name; + success = (name = getlogin ()) != NULL; +#endif + if (success) { +#if defined HAVE_GETPWNAM_R || defined _LIBC + size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX); + char *pwtmpbuf; + struct passwd pwbuf, *p; + + pwtmpbuf = __alloca (pwbuflen); + + success = (__getpwnam_r (name, &pwbuf, pwtmpbuf, + pwbuflen, &p) >= 0); +#else struct passwd *p = getpwnam (name); - if (p != NULL) - dirname = p->pw_dir; + success = p != NULL; +#endif + if (success) + home_dir = p->pw_dir; } } - if (dirname == NULL || dirname[0] == '\0') - dirname = (char *) "~"; /* No luck. */ -#endif /* WIN32 */ + if (home_dir == NULL || home_dir[0] == '\0') + home_dir = (char *) "~"; /* No luck. */ +#endif /* WINDOWS32 */ #endif + /* Now construct the full directory. */ + if (dirname[1] == '\0') + dirname = home_dir; + else + { + char *newp; + size_t home_len = strlen (home_dir); + newp = __alloca (home_len + dirlen); + memcpy (newp, home_dir, home_len); + memcpy (&newp[home_len], &dirname[1], dirlen); + dirname = newp; + } } +#if !defined _AMIGA && !defined WINDOWS32 else { -#ifdef _AMIGA - if (dirname == NULL || dirname[0] == '\0') - dirname = "SYS:"; -#else -#ifdef WIN32 - if (dirname == NULL || dirname[0] == '\0') - dirname = "c:/users/default"; /* poor default */ -#else + char *end_name = strchr (dirname, '/'); + char *user_name; + char *home_dir; + + if (end_name == NULL) + user_name = dirname + 1; + else + { + user_name = __alloca (end_name - dirname); + memcpy (user_name, dirname + 1, end_name - dirname); + user_name[end_name - dirname - 1] = '\0'; + } + /* Look up specific user's home directory. */ - struct passwd *p = getpwnam (dirname + 1); - if (p != NULL) - dirname = p->pw_dir; -#endif /* WIN32 */ + { +#if defined HAVE_GETPWNAM_R || defined _LIBC + size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX); + char *pwtmpbuf = __alloca (buflen); + struct passwd pwbuf, *p; + if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0) + home_dir = p->pw_dir; + else + home_dir = NULL; +#else + struct passwd *p = getpwnam (user_name); + if (p != NULL) + home_dir = p->pw_dir; + else + home_dir = NULL; #endif + } + /* If we found a home directory use this. */ + if (home_dir != NULL) + { + char *newp; + size_t home_len = strlen (home_dir); + size_t rest_len = end_name == NULL ? 0 : strlen (end_name); + newp = __alloca (home_len + rest_len + 1); + memcpy (newp, home_dir, home_len); + memcpy (&newp[home_len], end_name, rest_len); + newp[home_len + rest_len] = '\0'; + dirname = newp; + } } +#endif /* Not Amiga && not Windows32. */ } #endif /* Not VMS. */ @@ -880,7 +1000,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) (*pglob->gl_closedir) (stream); else closedir ((DIR *) stream); - errno = save; + __set_errno (save); } return nfound == 0 ? GLOB_NOMATCH : 0; @@ -891,7 +1011,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) (*pglob->gl_closedir) (stream); else closedir ((DIR *) stream); - errno = save; + __set_errno (save); } while (names != NULL) { @@ -903,4 +1023,3 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) } #endif /* Not ELIDE_CODE. */ - diff --git a/glob/glob.h b/glob/glob.h index 571bd5e..d4d7e7b 100644 --- a/glob/glob.h +++ b/glob/glob.h @@ -1,19 +1,22 @@ /* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _GLOB_H @@ -26,7 +29,7 @@ extern "C" #undef __ptr_t #if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \ - || defined (WIN32)) + || defined (WINDOWS32)) #undef __P #define __P(protos) protos #define __ptr_t void * @@ -152,7 +152,7 @@ pattern_search (file, archive, depth, recursions) register struct rule *rule; register struct dep *dep; - char *p; + char *p, *vp; #ifndef NO_ARCHIVES if (archive || ar_name (filename)) @@ -167,6 +167,17 @@ pattern_search (file, archive, depth, recursions) lastslash = rindex (filename, ']'); #else lastslash = rindex (filename, '/'); +#ifdef __MSDOS__ + /* Handle backslashes (possibly mixed with forward slashes) + and the case of "d:file". */ + { + char *bslash = rindex (filename, '\\'); + if (lastslash == 0 || bslash > lastslash) + lastslash = bslash; + if (lastslash == 0 && filename[0] && filename[1] == ':') + lastslash = filename + 1; + } +#endif #endif if (lastslash != 0 && lastslash[1] == '\0') lastslash = 0; @@ -388,10 +399,12 @@ pattern_search (file, archive, depth, recursions) } /* This code, given FILENAME = "lib/foo.o", dependency name "lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */ - if (vpath_search (&p, (time_t *) 0)) + vp = p; + if (vpath_search (&vp, (time_t *) 0)) { - DEBUGP2 ("Found dependency as `%s'.%s\n", p, ""); - found_files[deps_found++] = p; + DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp); + strcpy(vp, p); + found_files[deps_found++] = vp; continue; } @@ -554,7 +567,7 @@ pattern_search (file, archive, depth, recursions) dep->next = file->deps; file->deps = dep; } - + if (!checked_lastslash[foundrule]) /* Always allocate new storage, since STEM might be on the stack for an intermediate file. */ @@ -25,26 +25,33 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <assert.h> /* Default shell to use. */ -#ifdef WIN32 +#ifdef WINDOWS32 char *default_shell = "sh.exe"; int no_default_sh_exe = 1; -#else /* WIN32 */ -#ifndef _AMIGA -char default_shell[] = "/bin/sh"; -#else +#else /* WINDOWS32 */ +#ifdef _AMIGA char default_shell[] = ""; extern int MyExecute (char **); -#endif -#endif /* WIN32 */ +#else +#ifdef __MSDOS__ +/* The default shell is a pointer so we can change it if Makefile + says so. It is without an explicit path so we get a chance + to search the $PATH for it (since MSDOS doesn't have standard + directories we could trust). */ +char *default_shell = "command.com"; +#else /* __MSDOS__ */ +char default_shell[] = "/bin/sh"; +#endif /* __MSDOS__ */ +#endif /* _AMIGA */ +#endif /* WINDOWS32 */ #ifdef __MSDOS__ #include <process.h> +static int execute_by_shell; static int dos_pid = 123; -static int dos_status; -static char *dos_bname; -static char *dos_bename; -static int dos_batch_file; -#endif /* MSDOS. */ +int dos_status; +int dos_command_running; +#endif /* __MSDOS__ */ #ifdef _AMIGA #include <proto/dos.h> @@ -61,7 +68,7 @@ static int amiga_batch_file; #include <lib$routines.h> #endif -#ifdef WIN32 +#ifdef WINDOWS32 #include <windows.h> #include <io.h> #include <process.h> @@ -73,7 +80,7 @@ static int amiga_batch_file; static char *dos_bname; static char *dos_bename; static int dos_batch_file; -#endif /* WIN32 */ +#endif /* WINDOWS32 */ #ifdef HAVE_FCNTL_H #include <fcntl.h> @@ -191,8 +198,12 @@ static int good_stdin_used = 0; /* Chain of children waiting to run until the load average goes down. */ static struct child *waiting_jobs = 0; + +/* Non-zero if we use a *real* shell (always so on Unix). */ + +int unixy_shell = 1; -#ifdef WIN32 +#ifdef WINDOWS32 /* * The macro which references this function is defined in make.h. */ @@ -200,7 +211,7 @@ int w32_kill(int pid, int sig) { return ((process_kill(pid, sig) == TRUE) ? 0 : -1); } -#endif /* WIN32 */ +#endif /* WINDOWS32 */ /* Write an error message describing the exit status given in EXIT_CODE, EXIT_SIG, and COREDUMP, for the target TARGET_NAME. @@ -342,7 +353,7 @@ reap_children (block, err) } else if (pid == 0) { -#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WIN32) +#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32) /* No remote children. Check for local children. */ if (any_local) @@ -396,13 +407,15 @@ reap_children (block, err) exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0; coredump = WCOREDUMP (status); } -#else /* MSDOS, Amiga, WIN32. */ +#else /* __MSDOS__, Amiga, WINDOWS32. */ #ifdef __MSDOS__ /* Life is very different on MSDOS. */ pid = dos_pid - 1; status = dos_status; - exit_code = dos_status; - exit_sig = 0; + exit_code = WEXITSTATUS (status); + if (exit_code == 0xff) + exit_code = -1; + exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0; coredump = 0; #endif /* __MSDOS__ */ #ifdef _AMIGA @@ -413,7 +426,7 @@ reap_children (block, err) exit_sig = 0; coredump = 0; #endif /* _AMIGA */ -#ifdef WIN32 +#ifdef WINDOWS32 { HANDLE hPID; int err; @@ -429,7 +442,7 @@ reap_children (block, err) if (err) fprintf(stderr, "make (e=%d): %s", - exit_code, map_win32_error_to_string(exit_code)); + exit_code, map_windows32_error_to_string(exit_code)); exit_sig = process_signal(hPID); @@ -446,8 +459,8 @@ reap_children (block, err) } pid = (int) hPID; } -#endif /* WIN32 */ -#endif /* Not MSDOS. */ +#endif /* WINDOWS32 */ +#endif /* Not __MSDOS__ */ } else /* We got a remote child. */ @@ -655,13 +668,6 @@ block_sigs () } #ifdef POSIX -#ifdef __MSDOS__ -void -unblock_sigs () -{ - return; -} -#else void unblock_sigs () { @@ -670,7 +676,6 @@ unblock_sigs () sigprocmask (SIG_SETMASK, &empty, (sigset_t *) 0); } #endif -#endif /* Start a job to run the commands specified in CHILD. CHILD is updated to reflect the commands and ID of the child process. @@ -805,9 +810,10 @@ start_job_command (child) fflush (stdout); fflush (stderr); -#ifndef WIN32 -#ifndef _AMIGA #ifndef VMS +#ifndef WINDOWS32 +#ifndef _AMIGA +#ifndef __MSDOS__ /* Set up a bad standard input that reads from a broken pipe. */ @@ -836,7 +842,8 @@ start_job_command (child) } #endif /* !AMIGA */ -#endif /* !WIN32 */ +#endif /* !WINDOWS32 */ +#endif /* !__MSDOS__ */ /* Decide whether to give this child the `good' standard input (one that points to the terminal or whatever), or the `bad' one @@ -856,7 +863,7 @@ start_job_command (child) child->environment = target_environment (child->file); #endif -#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WIN32) +#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32) #ifndef VMS /* start_waiting_job has set CHILD->remote if we can start a remote job. */ @@ -919,21 +926,56 @@ start_job_command (child) #endif /* !VMS */ } -#else /* MSDOS or Amiga. */ +#else /* __MSDOS__ or Amiga or WINDOWS32 */ #ifdef __MSDOS__ - dos_status = spawnvpe (P_WAIT, argv[0], argv, child->environment); - ++dead_children; - child->pid = dos_pid++; - if (dos_batch_file) - { - dos_batch_file = 0; - remove (dos_bname); /* Ignore errors. */ - if (access (dos_bename, 0)) - dos_status = 1; - else - dos_status = 0; - remove (dos_bename); - } + { + int proc_return; + + block_sigs (); + dos_status = 0; + + /* We call `system' to do the job of the SHELL, since stock DOS + shell is too dumb. Our `system' knows how to handle long + command lines even if pipes/redirection is needed; it will only + call COMMAND.COM when its internal commands are used. */ + if (execute_by_shell) + { + char *cmdline = argv[0]; + /* We don't have a way to pass environment to `system', + so we need to save and restore ours, sigh... */ + char **parent_environ = environ; + + environ = child->environment; + + /* If we have a *real* shell, tell `system' to call + it to do everything for us. */ + if (unixy_shell) + { + /* A *real* shell on MSDOS may not support long + command lines the DJGPP way, so we must use `system'. */ + cmdline = argv[2]; /* get past "shell -c" */ + } + + dos_command_running = 1; + proc_return = system (cmdline); + dos_command_running = 0; + environ = parent_environ; + execute_by_shell = 0; /* for the next time */ + } + else + { + dos_command_running = 1; + proc_return = spawnvpe (P_WAIT, argv[0], argv, child->environment); + dos_command_running = 0; + } + + if (proc_return == -1) + dos_status |= 0xff; + else + dos_status |= (proc_return & 0xff); + ++dead_children; + child->pid = dos_pid++; + } #endif /* __MSDOS__ */ #ifdef _AMIGA amiga_status = MyExecute (argv); @@ -945,8 +987,8 @@ start_job_command (child) amiga_batch_file = 0; DeleteFile (amiga_bname); /* Ignore errors. */ } -#endif /* Not Amiga */ -#ifdef WIN32 +#endif /* Amiga */ +#ifdef WINDOWS32 { HANDLE hPID; char* arg0; @@ -976,8 +1018,8 @@ start_job_command (child) fprintf(stderr, "\nCounted %d args in failed launch\n", i); } } -#endif /* WIN32 */ -#endif /* Not MSDOS. */ +#endif /* WINDOWS32 */ +#endif /* __MSDOS__ or Amiga or WINDOWS32 */ /* We are the parent side. Set the state to say the commands are running and return. */ @@ -1101,7 +1143,7 @@ new_job (file) /* IN points to where in the line we are scanning. OUT points to where in the line we are writing. When we collapse a backslash-newline combination, - IN gets ahead out OUT. */ + IN gets ahead of OUT. */ in = out = cmds->command_lines[i]; while ((ref = index (in, '$')) != 0) @@ -1295,7 +1337,7 @@ start_waiting_jobs () return; } -#ifndef WIN32 +#ifndef WINDOWS32 #ifdef VMS #include <descrip.h> #include <clidef.h> @@ -1508,7 +1550,7 @@ child_execute_job (argv, child) #else /* !VMS */ -#ifndef _AMIGA +#if !defined (_AMIGA) && !defined (__MSDOS__) /* UNIX: Replace the current process with one executing the command in ARGV. STDIN_FD and STDOUT_FD are used as the process's stdin and stdout; ENVP is @@ -1531,9 +1573,9 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp) /* Run the command. */ exec_command (argv, envp); } -#endif /* !AMIGA */ +#endif /* !AMIGA && !__MSDOS__ */ #endif /* !VMS */ -#endif /* !WIN32 */ +#endif /* !WINDOWS32 */ #ifndef _AMIGA /* Replace the current process with one running the command in ARGV, @@ -1614,7 +1656,7 @@ void clean_tmp (void) DeleteFile (amiga_bname); } -#endif /* An Amiga */ +#endif /* On Amiga */ #ifndef VMS /* Figure out the argument list necessary to run LINE as a command. Try to @@ -1636,13 +1678,46 @@ construct_command_argv_internal (line, restp, shell, ifs) char *shell, *ifs; { #ifdef __MSDOS__ - static char sh_chars[] = "\"|<>"; - static char *sh_cmds[] = { "break", "call", "cd", "chcp", "chdir", "cls", - "copy", "ctty", "date", "del", "dir", "echo", - "erase", "exit", "for", "goto", "if", "if", "md", - "mkdir", "path", "pause", "prompt", "rem", "ren", - "rename", "set", "shift", "time", "type", - "ver", "verify", "vol", ":", 0 }; + /* MSDOS supports both the stock DOS shell and ports of Unixy shells. + We call `system' for anything that requires ``slow'' processing, + because DOS shells are too dumb. When $SHELL points to a real + (unix-style) shell, `system' just calls it to do everything. When + $SHELL points to a DOS shell, `system' does most of the work + internally, calling the shell only for its internal commands. + However, it looks on the $PATH first, so you can e.g. have an + external command named `mkdir'. + + Since we call `system', certain characters and commands below are + actually not specific to COMMAND.COM, but to the DJGPP implementation + of `system'. In particular: + + The shell wildcard characters are in DOS_CHARS because they will + not be expanded if we call the child via `spawnXX'. + + The `;' is in DOS_CHARS, because our `system' knows how to run + multiple commands on a single line. + + DOS_CHARS also include characters special to 4DOS/NDOS, so we + won't have to tell one from another and have one more set of + commands and special characters. */ + static char sh_chars_dos[] = "*?[];|<>%^&()"; + static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls", + "copy", "ctty", "date", "del", "dir", "echo", + "erase", "exit", "for", "goto", "if", "md", + "mkdir", "path", "pause", "prompt", "rd", + "rmdir", "rem", "ren", "rename", "set", + "shift", "time", "type", "ver", "verify", + "vol", ":", 0 }; + + static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^"; + static char *sh_cmds_sh[] = { "cd", "eval", "exec", "exit", "login", + "logout", "set", "umask", "wait", "while", + "for", "case", "if", ":", ".", "break", + "continue", "export", "read", "readonly", + "shift", "times", "trap", "switch", 0 }; + + char *sh_chars; + char **sh_cmds; #else #ifdef _AMIGA static char sh_chars[] = "#;\"|<>()?*$`"; @@ -1652,7 +1727,7 @@ construct_command_argv_internal (line, restp, shell, ifs) "unset", "unsetenv", "version", 0 }; #else -#ifdef WIN32 +#ifdef WINDOWS32 static char sh_chars_dos[] = "\"|<>"; static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls", "copy", "ctty", "date", "del", "dir", "echo", @@ -1668,23 +1743,23 @@ construct_command_argv_internal (line, restp, shell, ifs) "trap", "switch", "test", 0 }; char* sh_chars; char** sh_cmds; -#else /* WIN32 */ +#else /* WINDOWS32 */ static char sh_chars[] = "#;\"*?[]&|<>(){}$`^"; static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", "wait", "while", "for", "case", "if", ":", ".", "break", "continue", "export", "read", "readonly", "shift", "times", "trap", "switch", 0 }; -#endif /* WIN32 */ +#endif /* WINDOWS32 */ #endif /* Amiga */ -#endif /* MSDOS */ +#endif /* __MSDOS__ */ register int i; register char *p; register char *ap; char *end; int instring, word_has_equals, seen_nonequals, last_argument_was_empty; char **new_argv = 0; -#ifdef WIN32 +#ifdef WINDOWS32 int slow_flag = 0; if (no_default_sh_exe) { @@ -1694,7 +1769,7 @@ construct_command_argv_internal (line, restp, shell, ifs) sh_cmds = sh_cmds_sh; sh_chars = sh_chars_sh; } -#endif +#endif /* WINDOWS32 */ if (restp != NULL) *restp = NULL; @@ -1708,8 +1783,8 @@ construct_command_argv_internal (line, restp, shell, ifs) /* See if it is safe to parse commands internally. */ if (shell == 0) shell = default_shell; +#ifdef WINDOWS32 else if (strcmp (shell, default_shell)) -#ifdef WIN32 { char *s1 = _fullpath(NULL, shell, 0); char *s2 = _fullpath(NULL, default_shell, 0); @@ -1722,8 +1797,32 @@ construct_command_argv_internal (line, restp, shell, ifs) free(s2); } if (slow_flag) -#endif /* WIN32 */ goto slow; +#else /* not WINDOWS32 */ +#ifdef __MSDOS__ + else if (stricmp (shell, default_shell)) + { + extern int _is_unixy_shell (const char *_path); + + message (1, "$SHELL changed (was `%s', now `%s')", default_shell, shell); + unixy_shell = _is_unixy_shell (shell); + default_shell = shell; + } + if (unixy_shell) + { + sh_chars = sh_chars_sh; + sh_cmds = sh_cmds_sh; + } + else + { + sh_chars = sh_chars_dos; + sh_cmds = sh_cmds_dos; + } +#else /* not __MSDOS__ */ + else if (strcmp (shell, default_shell)) + goto slow; +#endif /* not __MSDOS__ */ +#endif /* not WINDOWS32 */ if (ifs != 0) for (ap = ifs; *ap != '\0'; ++ap) @@ -1767,8 +1866,10 @@ construct_command_argv_internal (line, restp, shell, ifs) goto end_of_line; } /* Backslash, $, and ` are special inside double quotes. - If we see any of those, punt. */ - else if (instring == '"' && index ("\\$`", *p) != 0) + If we see any of those, punt. + But on MSDOS, if we use COMMAND.COM, double and single + quotes have the same effect. */ + else if (instring == '"' && index ("\\$`", *p) != 0 && unixy_shell) goto slow; else *ap++ = *p; @@ -1776,6 +1877,11 @@ construct_command_argv_internal (line, restp, shell, ifs) else if (index (sh_chars, *p) != 0) /* Not inside a string, but it's a special char. */ goto slow; +#ifdef __MSDOS__ + else if (*p == '.' && p[1] == '.' && p[2] == '.' && p[3] != '.') + /* `...' is a wildcard in DJGPP. */ + goto slow; +#endif else /* Not a special char. */ switch (*p) @@ -1785,7 +1891,7 @@ construct_command_argv_internal (line, restp, shell, ifs) 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) + if (! seen_nonequals && unixy_shell) goto slow; word_has_equals = 1; *ap++ = '='; @@ -1919,7 +2025,40 @@ construct_command_argv_internal (line, restp, shell, ifs) free (new_argv[0]); free ((void *)new_argv); } -#ifdef WIN32 + +#ifdef __MSDOS__ + execute_by_shell = 1; /* actually, call `system' if shell isn't unixy */ +#endif + +#ifdef _AMIGA + { + char *ptr; + char *buffer; + char *dptr; + + buffer = (char *)xmalloc (strlen (line)+1); + + ptr = line; + for (dptr=buffer; *ptr; ) + { + if (*ptr == '\\' && ptr[1] == '\n') + ptr += 2; + else if (*ptr == '@') /* Kludge: multiline commands */ + { + ptr += 2; + *dptr++ = '\n'; + } + else + *dptr++ = *ptr++; + } + *dptr = 0; + + new_argv = (char **) xmalloc(2 * sizeof(char *)); + new_argv[0] = buffer; + new_argv[1] = 0; + } +#else /* Not Amiga */ +#ifdef WINDOWS32 /* * Not eating this whitespace caused things like * @@ -1935,77 +2074,39 @@ construct_command_argv_internal (line, restp, shell, ifs) ++line; if (*line == '\0') return 0; -#endif -#if defined(__MSDOS__) || defined(WIN32) -#ifdef WIN32 - /* - * only come here if no sh.exe command - */ - if (no_default_sh_exe) -#endif - { - FILE *batch; - dos_batch_file = 1; - if (dos_bname == 0) - { - dos_bname = tempnam (".", "mk"); - for (i = 0; dos_bname[i] != '\0'; ++i) - if (dos_bname[i] == '/') - dos_bname[i] = '\\'; - dos_bename = (char *) xmalloc (strlen (dos_bname) + 5); - strcpy (dos_bename, dos_bname); - strcat (dos_bname, ".bat"); - strcat (dos_bename, ".err"); - } - batch = fopen (dos_bename, "w"); /* Create a file. */ - if (batch != NULL) - fclose (batch); - batch = fopen (dos_bname, "w"); - fputs ("@echo off\n", batch); - fputs (line, batch); - fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename); - fclose (batch); - new_argv = (char **) xmalloc(2 * sizeof(char *)); - new_argv[0] = strdup (dos_bname); - new_argv[1] = 0; - } -#endif /* MSDOS. */ -#ifdef _AMIGA - { - char *ptr; - char *buffer; - char *dptr; - - buffer = (char *)xmalloc (strlen (line)+1); - - ptr = line; - for (dptr=buffer; *ptr; ) - { - if (*ptr == '\\' && ptr[1] == '\n') - ptr += 2; - else if (*ptr == '@') /* Kludge: multiline commands */ - { - ptr += 2; - *dptr++ = '\n'; - } - else - *dptr++ = *ptr++; - } - *dptr = 0; - - new_argv = (char **) xmalloc(2 * sizeof(char *)); - new_argv[0] = buffer; - new_argv[1] = 0; - } -#else /* Not MSDOS or Amiga */ -#ifdef WIN32 /* - * This is technically an else to the above 'if (no_default_sh_exe)', - * but (IMHO) coding if-else across ifdef is dangerous. + * only come here if no sh.exe command */ - if (!no_default_sh_exe) -#endif + if (no_default_sh_exe) + { + FILE *batch; + dos_batch_file = 1; + if (dos_bname == 0) + { + dos_bname = tempnam (".", "mk"); + for (i = 0; dos_bname[i] != '\0'; ++i) + if (dos_bname[i] == '/') + dos_bname[i] = '\\'; + dos_bename = (char *) xmalloc (strlen (dos_bname) + 5); + strcpy (dos_bename, dos_bname); + strcat (dos_bname, ".bat"); + strcat (dos_bename, ".err"); + } + batch = fopen (dos_bename, "w"); /* Create a file. */ + if (batch != NULL) + fclose (batch); + batch = fopen (dos_bname, "w"); + fputs ("@echo off\n", batch); + fputs (line, batch); + fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename); + fclose (batch); + new_argv = (char **) xmalloc(2 * sizeof(char *)); + new_argv[0] = strdup (dos_bname); + new_argv[1] = 0; + } + else +#endif /* WINDOWS32 */ { /* SHELL may be a multi-word command. Construct a command line "SHELL -c LINE", with all special chars in LINE escaped. @@ -2043,19 +2144,31 @@ construct_command_argv_internal (line, restp, shell, ifs) since it was most likely used to line up the continued line with the previous one. */ if (*p == '\t') - strcpy (p, p + 1); + bcopy (p + 1, p, strlen (p)); p = next_token (p); --p; - *ap++ = '\\'; + if (unixy_shell) + *ap++ = '\\'; *ap++ = ' '; continue; } - if (*p == '\\' || *p == '\'' || *p == '"' - || isspace (*p) - || index (sh_chars, *p) != 0) + /* DOS shells don't know about backslash-escaping. */ + if (unixy_shell && + (*p == '\\' || *p == '\'' || *p == '"' + || isspace (*p) + || index (sh_chars, *p) != 0)) *ap++ = '\\'; +#ifdef __MSDOS__ + else if (unixy_shell && strncmp (p, "...", 3) == 0) + { + /* The case of `...' wildcard again. */ + strcpy (ap, "\\.\\.\\"); + ap += 5; + p += 2; + } +#endif *ap++ = *p; } if (ap == new_line + shell_len + sizeof (minus_c) - 1) @@ -2063,10 +2176,25 @@ construct_command_argv_internal (line, restp, shell, ifs) return 0; *ap = '\0'; - new_argv = construct_command_argv_internal (new_line, (char **) NULL, - (char *) 0, (char *) 0); + if (unixy_shell) + new_argv = construct_command_argv_internal (new_line, (char **) NULL, + (char *) 0, (char *) 0); +#ifdef __MSDOS__ + else + { + /* With MSDOS shells, we must construct the command line here + instead of recursively calling ourselves, because we + cannot backslash-escape the special characters (see above). */ + new_argv = (char **) xmalloc (sizeof (char *)); + line_len = strlen (new_line) - shell_len - sizeof (minus_c) + 1; + new_argv[0] = xmalloc (line_len + 1); + strncpy (new_argv[0], + new_line + shell_len + sizeof (minus_c) - 1, line_len); + new_argv[0][line_len] = '\0'; + } +#endif } -#endif /* Not MSDOS nor Amiga. */ +#endif /* ! AMIGA */ return new_argv; } @@ -2098,7 +2226,7 @@ construct_command_argv (line, restp, file) warn_undefined_variables_flag = 0; shell = allocated_variable_expand_for_file ("$(SHELL)", file); -#ifdef WIN32 +#ifdef WINDOWS32 /* * Convert to forward slashes so that construct_command_argv_internal() * is not confused. @@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ # include <dos/dos.h> # include <proto/dos.h> #endif -#ifdef WIN32 +#ifdef WINDOWS32 #include <windows.h> #include "pathstuff.h" #endif @@ -129,7 +129,7 @@ int just_print_flag; int debug_flag = 0; -#ifdef WIN32 +#ifdef WINDOWS32 /* Suspend make in main for a short time to allow debugger to attach */ int suspend_flag = 0; @@ -240,7 +240,7 @@ static const struct command_switch switches[] = { 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0, "debug", 0, "Print lots of debugging information" }, -#ifdef WIN32 +#ifdef WINDOWS32 { 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0, "suspend-for-debug", 0, "Suspend process to allow a debugger to attach" }, @@ -450,6 +450,96 @@ debug_signal_handler (sig) debug_flag = ! debug_flag; } +#ifdef WINDOWS32 +/* + * HANDLE runtime exceptions by avoiding a requestor on the GUI. Capture + * exception and print it to stderr instead. + * + * If debug_flag not set, just print a simple message and exit. + * If debug_flag set, print a more verbose message. + * If compiled for DEBUG, let exception pass through to GUI so that + * debuggers can attach. + */ +LONG WINAPI +handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo ) +{ + PEXCEPTION_RECORD exrec = exinfo->ExceptionRecord; + LPSTR cmdline = GetCommandLine(); + LPSTR prg = strtok(cmdline, " "); + CHAR errmsg[1024]; +#ifdef USE_EVENT_LOG + HANDLE hEventSource; + LPTSTR lpszStrings[1]; +#endif + + if (!debug_flag) + { + sprintf(errmsg, "%s: Interrupt/Exception caught ", prg); + sprintf(&errmsg[strlen(errmsg)], + "(code = 0x%x, addr = 0x%x)\r\n", + exrec->ExceptionCode, exrec->ExceptionAddress); + fprintf(stderr, errmsg); + exit(255); + } + + sprintf(errmsg, + "\r\nUnhandled exception filter called from program %s\r\n", prg); + sprintf(&errmsg[strlen(errmsg)], "ExceptionCode = %x\r\n", + exrec->ExceptionCode); + sprintf(&errmsg[strlen(errmsg)], "ExceptionFlags = %x\r\n", + exrec->ExceptionFlags); + sprintf(&errmsg[strlen(errmsg)], "ExceptionAddress = %x\r\n", + exrec->ExceptionAddress); + + if (exrec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION + && exrec->NumberParameters >= 2) + sprintf(&errmsg[strlen(errmsg)], + "Access violation: %s operation at address %x\r\n", + exrec->ExceptionInformation[0] ? "write": "read", + exrec->ExceptionInformation[1]); + + /* turn this on if we want to put stuff in the event log too */ +#ifdef USE_EVENT_LOG + hEventSource = RegisterEventSource(NULL, "GNU Make"); + lpszStrings[0] = errmsg; + + if (hEventSource != NULL) + { + ReportEvent(hEventSource, /* handle of event source */ + EVENTLOG_ERROR_TYPE, /* event type */ + 0, /* event category */ + 0, /* event ID */ + NULL, /* current user's SID */ + 1, /* strings in lpszStrings */ + 0, /* no bytes of raw data */ + lpszStrings, /* array of error strings */ + NULL); /* no raw data */ + + (VOID) DeregisterEventSource(hEventSource); + } +#endif + + /* Write the error to stderr too */ + fprintf(stderr, errmsg); + +#ifdef DEBUG + return EXCEPTION_CONTINUE_SEARCH; +#else + exit(255); +#endif +} +#endif /* WINDOWS32 */ + +#ifdef __MSDOS__ + +static void +msdos_return_to_initial_directory () +{ + if (directory_before_chdir) + chdir (directory_before_chdir); +} +#endif + #ifndef _AMIGA int main (argc, argv, envp) @@ -465,16 +555,30 @@ int main (int argc, char ** argv) char **p; struct dep *read_makefiles; PATH_VAR (current_directory); -#ifdef WIN32 +#ifdef WINDOWS32 extern int no_default_sh_exe; char *unix_path = NULL; - char *win32_path = NULL; + char *windows32_path = NULL; + + SetUnhandledExceptionFilter(handle_runtime_exceptions); #endif default_goal_file = 0; reading_filename = 0; reading_lineno_ptr = 0; +#if defined (__MSDOS__) && !defined (_POSIX_SOURCE) + /* Request the most powerful version of `system', to + make up for the dumb default shell. */ + __system_flags = (__system_redirect + | __system_use_shell + | __system_allow_multiple_cmds + | __system_allow_long_cmds + | __system_handle_null_commands + | __system_emulate_chdir); + +#endif + #if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST) signame_init (); #endif @@ -547,8 +651,16 @@ int main (int argc, char ** argv) #ifdef __MSDOS__ if (program == 0) program = rindex (argv[0], '\\'); - if (program == 0) - program = rindex (argv[0], ':'); + else + { + /* Some weird environments might pass us argv[0] with + both kinds of slashes; we must find the rightmost. */ + char *p = rindex (argv[0], '\\'); + if (p && p > program) + program = p; + } + if (program == 0 && argv[0][1] == ':') + program = argv[0] + 1; #endif if (program == 0) program = argv[0]; @@ -561,7 +673,7 @@ int main (int argc, char ** argv) /* Figure out where we are. */ -#ifdef WIN32 +#ifdef WINDOWS32 if (getcwd_fs (current_directory, GET_PATH_MAX) == 0) #else if (getcwd (current_directory, GET_PATH_MAX) == 0) @@ -578,10 +690,14 @@ int main (int argc, char ** argv) else directory_before_chdir = savestring (current_directory, strlen (current_directory)); +#ifdef __MSDOS__ + /* Make sure we will return to the initial directory, come what may. */ + atexit (msdos_return_to_initial_directory); +#endif /* Read in variables from the environment. It is important that this be - done before $(MAKE) is are figured out so its definitions will not be - one from the environment. */ + done before $(MAKE) is figured out so its definitions will not be + from the environment. */ #ifndef _AMIGA for (i = 0; envp[i] != 0; ++i) @@ -589,11 +705,11 @@ int main (int argc, char ** argv) register char *ep = envp[i]; while (*ep != '=') ++ep; -#ifdef WIN32 - if (!strncmp(ep, "PATH", 4)) - unix_path = &ep[5]; - if (!strncmp(ep, "Path", 4)) - win32_path = &ep[5]; +#ifdef WINDOWS32 + if (!unix_path && !strncmp(envp[i], "PATH=", 5)) + unix_path = ep+1; + if (!windows32_path && !strncmp(envp[i], "Path=", 5)) + windows32_path = ep+1; #endif /* The result of pointer arithmetic is cast to unsigned int for machines where ptrdiff_t is a different size that doesn't widen @@ -607,12 +723,12 @@ int main (int argc, char ** argv) be exported, because it was originally in the environment. */ ->export = v_export; } -#ifdef WIN32 +#ifdef WINDOWS32 /* * PATH defaults to Path iff PATH not found and Path is found. */ - if (!unix_path && win32_path) - define_variable("PATH", 4, win32_path, o_env, 1)->export = v_export; + if (!unix_path && windows32_path) + define_variable("PATH", 4, windows32_path, o_env, 1)->export = v_export; #endif #else /* For Amiga, read the ENV: device, ignoring all dirs */ { @@ -655,7 +771,7 @@ int main (int argc, char ** argv) decode_env_switches ("MFLAGS", 6); #endif decode_switches (argc, argv, 0); -#ifdef WIN32 +#ifdef WINDOWS32 if (suspend_flag) { fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId()); fprintf(stderr, "%s is suspending for 30 seconds...", argv[0]); @@ -679,7 +795,7 @@ int main (int argc, char ** argv) so the result will run the same program regardless of the current dir. If it is a name with no slash, we can only hope that PATH did not find it in the current directory.) */ -#ifdef WIN32 +#ifdef WINDOWS32 /* * Convert from backslashes to forward slashes for * programs like sh which don't like them. Shouldn't @@ -690,11 +806,11 @@ int main (int argc, char ** argv) strstr(argv[0], "..") || !strncmp(argv[0], "//", 2)) argv[0] = strdup(w32ify(argv[0],1)); -#else /* WIN32 */ +#else /* WINDOWS32 */ if (current_directory[0] != '\0' && argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0) argv[0] = concat (current_directory, "/", argv[0]); -#endif /* WIN32 */ +#endif /* WINDOWS32 */ #endif /* The extra indirection through $(MAKE_COMMAND) is done @@ -767,7 +883,7 @@ int main (int argc, char ** argv) free (dir); } -#ifdef WIN32 +#ifdef WINDOWS32 /* * THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER * TO NOT CONFUSE THE DEPENDENCY CHECKING CODE IN implicit.c. @@ -839,7 +955,7 @@ int main (int argc, char ** argv) } } } -#endif /* WIN32 */ +#endif /* WINDOWS32 */ /* Figure out the level of recursion. */ { struct variable *v = lookup_variable ("MAKELEVEL", 9); @@ -868,7 +984,7 @@ int main (int argc, char ** argv) starting_directory = current_directory; else { -#ifdef WIN32 +#ifdef WINDOWS32 if (getcwd_fs (current_directory, GET_PATH_MAX) == 0) #else if (getcwd (current_directory, GET_PATH_MAX) == 0) @@ -985,7 +1101,7 @@ int main (int argc, char ** argv) define_makeflags (0, 0); -#ifdef WIN32 +#ifdef WINDOWS32 /* * Now that makefiles are parsed, see if a Makefile gave a * value for SHELL and use that for default_shell instead if @@ -1030,7 +1146,7 @@ int main (int argc, char ** argv) error("Resetting make for single job mode."); job_slots = 1; } -#endif /* WIN32 */ +#endif /* WINDOWS32 */ /* Define the default variables. */ define_default_variables (); @@ -1042,6 +1158,28 @@ int main (int argc, char ** argv) read_makefiles = read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list); +#ifdef __MSDOS__ + /* We need to know what kind of shell we will be using. */ + { + extern int _is_unixy_shell (const char *_path); + struct variable *shv = lookup_variable("SHELL", 5); + extern int unixy_shell; + extern char *default_shell; + + if (shv && *shv->value) + { + char *shell_path = recursively_expand(shv); + + if (shell_path && _is_unixy_shell (shell_path)) + unixy_shell = 1; + else + unixy_shell = 0; + if (shell_path) + default_shell = shell_path; + } + } +#endif /* __MSDOS__ */ + /* Decode switches again, in case the variables were set by the makefile. */ decode_env_switches ("MAKEFLAGS", 9); #if 0 @@ -1111,6 +1249,8 @@ int main (int argc, char ** argv) time_t *makefile_mtimes = 0; unsigned int mm_idx = 0; + char **nargv = argv; + char nargc = argc; if (debug_flag) puts ("Updating makefiles...."); @@ -1193,52 +1333,47 @@ int main (int argc, char ** argv) in updating or could not be found at all. */ int any_failed = 0; register unsigned int i; - - for (i = 0; read_makefiles != 0; ++i) - { - struct dep *d = read_makefiles; - read_makefiles = d->next; - if (d->file->updated) - { - /* This makefile was updated. */ - if (d->file->update_status == 0) - { - /* It was successfully updated. */ - any_remade |= (file_mtime_no_search (d->file) - != makefile_mtimes[i]); - } - else if (! (d->changed & RM_DONTCARE)) - { - time_t mtime; - /* The update failed and this makefile was not - from the MAKEFILES variable, so we care. */ - error ("Failed to remake makefile `%s'.", - d->file->name); - mtime = file_mtime_no_search (d->file); - any_remade |= (mtime != (time_t) -1 - && mtime != makefile_mtimes[i]); - } - } - else - /* This makefile was not found at all. */ - if (! (d->changed & RM_DONTCARE)) - { - /* This is a makefile we care about. See how much. */ - if (d->changed & RM_INCLUDED) - /* An included makefile. We don't need - to die, but we do want to complain. */ - error ("Included makefile `%s' was not found.", - dep_name (d)); - else - { - /* A normal makefile. We must die later. */ - error ("Makefile `%s' was not found", dep_name (d)); - any_failed = 1; - } - } - - free ((char *) d); - } + struct dep *d; + + for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next) + if (d->file->updated) + { + /* This makefile was updated. */ + if (d->file->update_status == 0) + { + /* It was successfully updated. */ + any_remade |= (file_mtime_no_search (d->file) + != makefile_mtimes[i]); + } + else if (! (d->changed & RM_DONTCARE)) + { + time_t mtime; + /* The update failed and this makefile was not + from the MAKEFILES variable, so we care. */ + error ("Failed to remake makefile `%s'.", + d->file->name); + mtime = file_mtime_no_search (d->file); + any_remade |= (mtime != (time_t) -1 + && mtime != makefile_mtimes[i]); + } + } + else + /* This makefile was not found at all. */ + if (! (d->changed & RM_DONTCARE)) + { + /* This is a makefile we care about. See how much. */ + if (d->changed & RM_INCLUDED) + /* An included makefile. We don't need + to die, but we do want to complain. */ + error ("Included makefile `%s' was not found.", + dep_name (d)); + else + { + /* A normal makefile. We must die later. */ + error ("Makefile `%s' was not found", dep_name (d)); + any_failed = 1; + } + } if (any_remade) goto re_exec; @@ -1264,7 +1399,7 @@ int main (int argc, char ** argv) /* These names might have changed. */ register unsigned int i, j = 0; for (i = 1; i < argc; ++i) - if (!strcmp (argv[i], "-f")) /* XXX */ + if (!strncmp (argv[i], "-f", 2)) /* XXX */ { char *p = &argv[i][2]; if (*p == '\0') @@ -1275,6 +1410,25 @@ int main (int argc, char ** argv) } } + /* Add -o options for all makefiles that were remade */ + { + register unsigned int i; + struct dep *d; + + for (i = argc+1, d = read_makefiles; d != 0; d = d->next) + i += d->file->updated != 0; + + nargv = (char **)xmalloc(i * sizeof(char *)); + bcopy(argv, nargv, argc * sizeof(char *)); + + for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next) + { + if (d->file->updated) + nargv[nargc++] = concat("-o", dep_name(d), ""); + } + nargv[nargc] = 0; + } + if (directories != 0 && directories->idx > 0) { char bad; @@ -1326,7 +1480,7 @@ int main (int argc, char ** argv) { char **p; fputs ("Re-executing:", stdout); - for (p = argv; *p != 0; ++p) + for (p = nargv; *p != 0; ++p) printf (" %s", *p); puts (""); } @@ -1335,9 +1489,9 @@ int main (int argc, char ** argv) fflush (stderr); #ifndef _AMIGA - exec_command (argv, environ); + exec_command (nargv, environ); #else - exec_command (argv); + exec_command (nargv); exit (0); #endif /* NOTREACHED */ @@ -1514,6 +1668,29 @@ handle_non_switch_argument (arg, env) } lastgoal->name = 0; lastgoal->file = f; + + { + /* Add this target name to the MAKECMDGOALS variable. */ + struct variable *v; + char *value; + + v = lookup_variable("MAKECMDGOALS", 12); + if (v == 0) + value = f->name; + else + { + /* Paste the old and new values together */ + unsigned int oldlen, newlen; + + oldlen = strlen(v->value); + newlen = strlen(f->name); + value = (char *)alloca(oldlen + 1 + newlen + 1); + bcopy(v->value, value, oldlen); + value[oldlen] = ' '; + bcopy(f->name, &value[oldlen + 1], newlen + 1); + } + define_variable("MAKECMDGOALS", 12, value, o_default, 0); + } } } @@ -137,6 +137,19 @@ extern unsigned int get_path_max PARAMS ((void)); #define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX) #endif +#ifndef CHAR_BIT +#define CHAR_BIT 8 +#endif + +/* Nonzero if the integer type T is signed. */ +#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0) + +/* The minimum and maximum values for the integer type T. + Use ~ (t) 0, not -1, for portability to 1's complement hosts. */ +#define INTEGER_TYPE_MINIMUM(t) \ + (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) +#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) + #ifdef STAT_MACROS_BROKEN #ifdef S_ISREG #undef S_ISREG @@ -202,8 +215,8 @@ extern void exit PARAMS ((int)); #ifndef bzero #define bzero(s, n) memset ((s), 0, (n)) #endif -#ifndef bcopy -#define bcopy(s, d, n) memcpy ((d), (s), (n)) +#if defined(HAVE_MEMMOVE) && !defined(bcopy) +#define bcopy(s, d, n) memmove ((d), (s), (n)) #endif #else /* Not ANSI_STRING. */ @@ -277,13 +290,13 @@ extern char *alloca (); #define ENUM_BITFIELD(bits) #endif -#if defined(__MSDOS__) || defined(WIN32) +#if defined(__MSDOS__) || defined(WINDOWS32) #define PATH_SEPARATOR_CHAR ';' #else #define PATH_SEPARATOR_CHAR ':' #endif -#ifdef WIN32 +#ifdef WINDOWS32 #include <fcntl.h> #include <malloc.h> #define pipe(p) _pipe(p, 512, O_BINARY) @@ -346,6 +359,7 @@ extern void create_pattern_rule (); extern void build_vpath_lists (); extern void construct_vpath_list (); extern int vpath_search (); +extern int gpath_search (); extern void construct_include_path (); extern void uniquize_deps (); @@ -364,7 +378,7 @@ extern void child_access (); /* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, because such systems often declare the in header files anyway. */ -#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WIN32) +#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) extern long int atol (); #ifndef VMS diff --git a/make.texinfo b/make.texinfo index 9b43b48..14b38fc 100644 --- a/make.texinfo +++ b/make.texinfo @@ -25,6 +25,11 @@ @syncodeindex pg cp @ifinfo +@dircategory The GNU make utility +@direntry + * GNU make: (make.info). The GNU make utility. +@end direntry + This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. @@ -95,7 +100,7 @@ Cover art by Etienne Suvasa. @page @ifinfo -@node Top, Overview, (dir), (dir) +@node Top, Overview, , (dir) @top Make The GNU @code{make} utility automatically determines which pieces of a @@ -196,6 +201,7 @@ Searching Directories for Dependencies to every dependency. * Selective Search:: Specifying a search path for a specified class of names. +* Search Algorithm:: When and how search paths are applied. * Commands/Search:: How to write shell commands that work together with search paths. * Implicit/Search:: How search paths affect implicit rules. @@ -239,6 +245,8 @@ How to Use Variables * Defining:: An alternate way to set a variable to a verbatim string. * Environment:: Variable values can come from the environment. +* Automatic:: Some special variables have predefined + meanings for use with implicit rules. Advanced Features for Reference to Variables @@ -288,7 +296,7 @@ Using Implicit Rules * Last Resort:: How to defining commands for rules which cannot find any. * Suffix Rules:: The old-fashioned style of implicit rule. -* Search Algorithm:: The precise algorithm for applying +* Implicit Rule Search:: The precise algorithm for applying implicit rules. Defining and Redefining Pattern Rules @@ -307,6 +315,7 @@ Using @code{make} to Update Archive Files * Archive Members:: Archive members as targets. * Archive Update:: The implicit rule for archive member targets. +* Archive Pitfalls:: Dangers to watch out for when using archives. * Archive Suffix Rules:: You can write a special kind of suffix rule for updating archives. @@ -1645,6 +1654,7 @@ just the search paths. to every dependency. * Selective Search:: Specifying a search path for a specified class of names. +* Search Algorithm:: When and how search paths are applied. * Commands/Search:: How to write shell commands that work together with search paths. * Implicit/Search:: How search paths affect implicit rules. @@ -1665,10 +1675,10 @@ rules. Thus, if a file that is listed as a target or dependency does not exist in the current directory, @code{make} searches the directories listed in @code{VPATH} for a file with that name. If a file is found in one of -them, that file becomes the dependency. Rules may then specify the -names of source files in the dependencies as if they all existed in the -current directory. @xref{Commands/Search, ,Writing Shell Commands with -Directory Search}. +them, that file may become the dependency (see below). Rules may then +specify the names of source files in the dependencies as if they all +existed in the current directory. @xref{Commands/Search, ,Writing Shell +Commands with Directory Search}. In the @code{VPATH} variable, directory names are separated by colons or blanks. The order in which directories are listed is the order followed @@ -1701,7 +1711,7 @@ foo.o : src/foo.c assuming the file @file{foo.c} does not exist in the current directory but is found in the directory @file{src}. -@node Selective Search, Commands/Search, General Search, Directory Search +@node Selective Search, Search Algorithm, General Search, Directory Search @subsection The @code{vpath} Directive @findex vpath @@ -1800,7 +1810,71 @@ vpath % blish will look for a file ending in @samp{.c} in @file{foo}, then @file{bar}, then @file{blish}. -@node Commands/Search, Implicit/Search, Selective Search, Directory Search +@node Search Algorithm, Commands/Search, Selective Search, Directory Search +@subsection How Directory Searches are Performed +@cindex algorithm for directory search +@cindex directory search algorithm + +When a dependency is found through directory search, regardless of type +(general or selective), the pathname located may not be the one that +@code{make} actually provides you in the dependency list. Sometimes, +the path discovered through directory search is thrown away. + +The algorithm @code{make} uses to decide whether to keep or abandon a +path found via directory search is as follows: + +@enumerate +@item +If a target file does not exist at the path specified in the makefile, +directory search is performed. + +@item +If the directory search is successful that path is kept, and this file +is tentatively stored as the target. + +@item +All dependencies of this target are examined using this same method. + +@item +After processing the dependencies, the target may or may not need to be +rebuilt: + +@enumerate a +@item +If the target does @emph{not} need to be rebuilt, the path to the file +found during directory search is used for any dependency lists which +contain this target. + +@item +If the target @emph{does} need to be rebuilt (is out-of-date), the +pathname found during directory search is @emph{thrown away}, and the +target is rebuilt using the filename specified in the makefile. +@end enumerate +@end enumerate + +This may seem overly complex, but in fact it is almost always exactly +what you want. + +@cindex traditional directory search +@cindex directory search, traditional +Other versions of @code{make} use a simpler algorithm: if the file does +not exist, and it is found via directory search, then that pathname is +always used whether or not the target needs to be built. Thus, if the +target is rebuilt it is created at the pathname discovered during +directory search. + +@vindex GPATH +If, in fact, this is the behavior you want for some or all of your +directories, you can use the @code{GPATH} variable to indicate this to +@code{make}. + +@code{GPATH} has the same syntax and format as @code{VPATH} (that is, a +space- or colon-delimited list of pathnames). If an out-of-date target +is found by directory search in a directory that also appears in +@code{GPATH}, then that pathname is not thrown away. The target is +rebuilt using the expanded path. + +@node Commands/Search, Implicit/Search, Search Algorithm, Directory Search @subsection Writing Shell Commands with Directory Search @cindex shell command, and directory search @cindex directory search (@code{VPATH}), and shell commands @@ -2112,7 +2186,7 @@ The commands specified for @code{.DEFAULT} are used for any target for which no rules are found (either explicit rules or implicit rules). @xref{Last Resort}. If @code{.DEFAULT} commands are specified, every file mentioned as a dependency, but not as a target in a rule, will have -these commands executed on its behalf. @xref{Search Algorithm, +these commands executed on its behalf. @xref{Implicit Rule Search, ,Implicit Rule Search Algorithm}. @findex .PRECIOUS @@ -2409,6 +2483,8 @@ from the corresponding @file{.c} file: @group objects = foo.o bar.o +all: $(objects) + $(objects): %.o: %.c $(CC) -c $(CFLAGS) $< -o $@@ @end group @@ -2603,7 +2679,8 @@ called @file{@var{name}.d} from a C source file called @file{@var{name}.c}: @group %.d: %.c $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \ - | sed '\''s/\($*\)\.o[ :]*/\1 $@@/g'\'' > $@@' + | sed '\''s/\($*\)\.o[ :]*/\1.o $@@ : /g'\'' > $@@; \ + [ -s $@@ ] || rm -f $@@' @end group @end smallexample @@ -5284,8 +5361,8 @@ was given to those two functions.@refill @item $(word @var{n},@var{text}) @findex word -@cindex words, selecting -@cindex selecting words +@cindex word, selecting a +@cindex selecting a word Returns the @var{n}th word of @var{text}. The legitimate values of @var{n} start from 1. If @var{n} is bigger than the number of words in @var{text}, the value is empty. For example, @@ -5297,6 +5374,25 @@ $(word 2, foo bar baz) @noindent returns @samp{bar}. +@item $(wordlist @var{s},@var{e},@var{text}) +@findex wordlist +@cindex words, selecting lists of +@cindex selecting word lists +Returns the list of words in @var{text} starting with word @var{s} and +ending with word @var{e} (inclusive). The legitimate values of @var{s} +and @var{e} start from 1. If @var{s} is bigger than the number of words +in @var{text}, the value is empty. If @var{e} is bigger than the number +of words in @var{text}, words up to the end of @var{text} are returned. +If @var{s} is greater than @var{e}, @code{make} swaps them for you. For +example, + +@example +$(wordlist 2, 3, foo bar baz) +@end example + +@noindent +returns @samp{bar baz}. + @c Following item phrased to prevent overfull hbox. --RJC 17 Jul 92 @item $(words @var{text}) @findex words @@ -5656,6 +5752,12 @@ You can specify a different goal or goals with arguments to @code{make}. Use the name of the goal as an argument. If you specify several goals, @code{make} processes each of them in turn, in the order you name them. +@cindex @code{MAKECMDGOALS} +@vindex MAKECMDGOALS +@code{Make} will set the special variable @code{MAKECMDGOALS} to the +list of goals you specified on the command line. If no goals were given +on the command line, this variable is empty. + Any target in the makefile may be specified as a goal (unless it starts with @samp{-} or contains an @samp{=}, in which case it will be parsed as a switch or variable definition, respectively). Even @@ -6312,7 +6414,7 @@ retained for compatibility. * Last Resort:: How to defining commands for rules which cannot find any. * Suffix Rules:: The old-fashioned style of implicit rule. -* Search Algorithm:: The precise algorithm for applying +* Implicit Rule Search:: The precise algorithm for applying implicit rules. @end menu @@ -6370,7 +6472,7 @@ result of another implicit rule, we say that @dfn{chaining} is occurring. In general, @code{make} searches for an implicit rule for each target, and for each double-colon rule, that has no commands. A file that is mentioned only as a dependency is considered a target whose rule specifies nothing, -so implicit rule search happens for it. @xref{Search Algorithm, ,Implicit Rule Search Algorithm}, for the +so implicit rule search happens for it. @xref{Implicit Rule Search, ,Implicit Rule Search Algorithm}, for the details of how the search is done. Note that explicit dependencies do not influence implicit rule search. @@ -7508,7 +7610,7 @@ Commands, ,Defining Empty Commands}).@refill You can use a last-resort rule to override part of another makefile. @xref{Overriding Makefiles, , Overriding Part of Another Makefile}. -@node Suffix Rules, Search Algorithm, Last Resort, Implicit Rules +@node Suffix Rules, Implicit Rule Search, Last Resort, Implicit Rules @section Old-Fashioned Suffix Rules @cindex old-fashioned suffix rules @cindex suffix rule @@ -7610,7 +7712,7 @@ before @code{make} reads any makefiles. You can change the list of suffixes with a rule for the special target @code{.SUFFIXES}, but that does not alter this variable. -@node Search Algorithm, , Suffix Rules, Implicit Rules +@node Implicit Rule Search, , Suffix Rules, Implicit Rules @section Implicit Rule Search Algorithm @cindex implicit rule, search algorithm @cindex search algorithm, implicit rule @@ -8160,6 +8262,10 @@ Keep track of the current level of @code{make} recursion using the variable @code{MAKELEVEL}. @xref{Recursion, ,Recursive Use of @code{make}}. @item +Provide any goals given on the command line in the variable +@code{MAKECMDGOALS}. @xref{Goals, ,Arguments to Specify the Goals}. + +@item Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}. @item @@ -397,7 +397,7 @@ end_of_token (s) return s; } -#ifdef WIN32 +#ifdef WINDOWS32 /* * Same as end_of_token, but take into account a stop character */ @@ -30,7 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "glob/glob.h" #endif -#ifndef WIN32 +#ifndef WINDOWS32 #ifndef _AMIGA #ifndef VMS #include <pwd.h> @@ -38,7 +38,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ struct passwd *getpwnam PARAMS ((char *name)); #endif #endif -#endif /* !WIN32 */ +#endif /* !WINDOWS32 */ /* A `struct linebuffer' is a structure which holds a line of text. `readline' reads a line from a stream into a linebuffer @@ -81,7 +81,7 @@ static struct conditionals *conditionals = &toplevel_conditionals; static char *default_include_directories[] = { -#if defined(WIN32) && !defined(INCLUDEDIR) +#if defined(WINDOWS32) && !defined(INCLUDEDIR) /* * This completly up to the user when they install MSVC or other packages. * This is defined as a placeholder. @@ -271,6 +271,7 @@ read_makefile (filename, flags) unsigned int commands_started; register char *p; char *p2; + int len; int ignoring = 0, in_ignored_define = 0; int no_targets = 0; /* Set when reading a rule without targets. */ char *passed_filename = filename; @@ -283,7 +284,7 @@ read_makefile (filename, flags) char *pattern = 0, *pattern_percent; int makefile_errno; -#ifdef WIN32 +#if defined (WINDOWS32) || defined (__MSDOS__) int check_again; #endif @@ -302,8 +303,9 @@ read_makefile (filename, flags) #ifdef lint /* Suppress `used before set' messages. */ two_colon = 0; - pattern_percent = 0; #endif + pattern_percent = 0; + commands_started = lineno; if (debug_flag) { @@ -452,8 +454,7 @@ read_makefile (filename, flags) remove_comments (collapsed); /* strncmp is first to avoid dereferencing out into space. */ -#define word1eq(s, l) (!strncmp (s, p, l) \ - && (p[l] == '\0' || isblank (p[l]))) +#define word1eq(s, l) (len == l && !strncmp (s, p, l)) p = collapsed; while (isspace (*p)) ++p; @@ -461,6 +462,21 @@ read_makefile (filename, flags) /* This line is completely empty. */ continue; + /* Find the end of the first token */ + for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2) + {} + len = p2 - p; + + /* Find the start of the second token. If it's a `:', jump past + preprocessor stuff since it can't be that--this allows targets named + `export', etc. */ + while (isspace (*p2)) + ++p2; + if (*p2 == '\0') + p2 = NULL; + else if (*p2 == ':') + goto check_var; + /* We must first check for conditional and `define' directives before ignoring anything, since they control what we will do with following lines. */ @@ -578,7 +594,29 @@ read_makefile (filename, flags) v->export = v_noexport; } } - else if (word1eq ("include", 7) || word1eq ("-include", 8) + else if (word1eq ("vpath", 5)) + { + char *pattern; + unsigned int len; + p2 = variable_expand (p + 5); + p = find_next_token (&p2, &len); + if (p != 0) + { + pattern = savestring (p, len); + p = find_next_token (&p2, &len); + /* No searchpath means remove all previous + selective VPATH's with the same pattern. */ + } + else + /* No pattern means remove all previous selective VPATH's. */ + pattern = 0; + construct_vpath_list (pattern, p); + if (pattern != 0) + free (pattern); + } + else + check_var: + if (word1eq ("include", 7) || word1eq ("-include", 8) || word1eq ("sinclude", 8)) { /* We have found an `include' line specifying a nested @@ -642,26 +680,6 @@ read_makefile (filename, flags) reading_filename = filename; reading_lineno_ptr = &lineno; } - else if (word1eq ("vpath", 5)) - { - char *pattern; - unsigned int len; - p2 = variable_expand (p + 5); - p = find_next_token (&p2, &len); - if (p != 0) - { - pattern = savestring (p, len); - p = find_next_token (&p2, &len); - /* No searchpath means remove all previous - selective VPATH's with the same pattern. */ - } - else - /* No pattern means remove all previous selective VPATH's. */ - pattern = 0; - construct_vpath_list (pattern, p); - if (pattern != 0) - free (pattern); - } #undef word1eq else if (try_variable_definition (filename, lineno, p, o_file)) /* This line has been dealt with. */ @@ -764,11 +782,6 @@ read_makefile (filename, flags) else break; } -#ifdef __MSDOS__ - /* For MS-DOS, skip a "C:\...". */ - if (p != 0 && p[1] == '\\' && isalpha (p[-1])) - p = 0; -#endif #ifdef _AMIGA /* Here, the situation is quite complicated. Let's have a look at a couple of targets: @@ -785,10 +798,10 @@ read_makefile (filename, flags) if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1]))) p = 0; #endif -#ifdef WIN32 +#if defined (WINDOWS32) || defined (__MSDOS__) do { check_again = 0; - /* For WIN32, skip a "C:\..." or a "C:/..." */ + /* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */ if (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) { p = index(p + 1, ':'); check_again = 1; @@ -1462,7 +1475,11 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started, /* See if this is first target seen whose name does not start with a `.', unless it contains a slash. */ if (default_goal_file == 0 && set_default - && (*name != '.' || index (name, '/') != 0)) + && (*name != '.' || index (name, '/') != 0 +#ifdef __MSDOS__ + || index (name, '\\') != 0 +#endif + )) { int reject = 0; @@ -1622,9 +1639,11 @@ parse_file_seq (stringp, stopchar, size, strip) *p =' '; #endif #ifdef __MSDOS__ - /* For MS-DOS, skip a "C:\...". */ - if (stopchar == ':' && p != 0 && p[1] == '\\' && isalpha (p[-1])) - p = 0; + /* For MS-DOS, skip a "C:\..." or a "C:/..." until we find a + first colon which isn't followed by a slash or a backslash. */ + if (stopchar == ':') + while (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) + p = find_char_unquote (p + 1, stopchars, 1); #endif #ifdef _AMIGA if (stopchar == ':' && p && *p == ':' && @@ -1633,8 +1652,8 @@ parse_file_seq (stringp, stopchar, size, strip) p = find_char_unquote (p+1, stopchars, 1); } #endif -#ifdef WIN32 - /* For WIN32, skip a "C:\..." or "C:/...". */ +#ifdef WINDOWS32 + /* For WINDOWS32, skip a "C:\..." or "C:/...". */ if (stopchar == ':' && p != 0 && (p[1] == '\\' || p[1] == '/') && @@ -1943,6 +1962,10 @@ construct_include_path (arg_dirs) register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *)); register unsigned int idx = 0; +#ifdef __MSDOS__ + defsize++; +#endif + /* First consider any dirs specified with -I switches. Ignore dirs that don't exist. */ @@ -1974,6 +1997,22 @@ construct_include_path (arg_dirs) /* Now add at the end the standard default dirs. */ +#ifdef __MSDOS__ + { + /* The environment variable $DJDIR holds the root of the + DJGPP directory tree; add ${DJDIR}/include. */ + struct variable *djdir = lookup_variable ("DJDIR", 5); + + if (djdir) + { + char *defdir = (char *) xmalloc (strlen (djdir->value) + 8 + 1); + + strcat (strcpy (defdir, djdir->value), "/include"); + dirs[idx++] = defdir; + } + } +#endif + for (i = 0; default_include_directories[i] != 0; ++i) if (stat (default_include_directories[i], &stbuf) == 0 && S_ISDIR (stbuf.st_mode)) @@ -2029,7 +2068,7 @@ tilde_expand (name) free (home_dir); home_dir = getenv ("HOME"); } -#if !defined(_AMIGA) && !defined(WIN32) +#if !defined(_AMIGA) && !defined(WINDOWS32) if (home_dir == 0 || home_dir[0] == '\0') { extern char *getlogin (); @@ -2042,7 +2081,7 @@ tilde_expand (name) home_dir = p->pw_dir; } } -#endif /* !AMIGA && !WIN32 */ +#endif /* !AMIGA && !WINDOWS32 */ if (home_dir != 0) { char *new = concat (home_dir, "", name + 1); @@ -2051,7 +2090,7 @@ tilde_expand (name) return new; } } -#if !defined(_AMIGA) && !defined(WIN32) +#if !defined(_AMIGA) && !defined(WINDOWS32) else { struct passwd *pwent; @@ -2069,7 +2108,7 @@ tilde_expand (name) else if (userend != 0) *userend = '/'; } -#endif /* !AMIGA && !WIN32 */ +#endif /* !AMIGA && !WINDOWS32 */ #endif /* !VMS */ return 0; } @@ -29,10 +29,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/file.h> #endif +#ifdef __MSDOS__ +#include "variable.h" +#endif + #ifdef VMS #include <starlet.h> #endif -#ifdef WIN32 +#ifdef WINDOWS32 #include <io.h> #endif @@ -566,13 +570,63 @@ update_file_1 (file, depth) if (!must_make) { - DEBUGPR ("No need to remake target `%s'.\n"); + if (debug_flag) + { + print_spaces(depth); + printf("No need to remake target `%s'", file->name); + if (!streq(file->name, file->hname)) + printf("; using VPATH name `%s'", file->hname); + printf(".\n"); + fflush(stdout); + } + notice_finished_file (file); + + /* Since we don't need to remake the file, convert it to use the + VPATH filename if we found one. hfile will be either the + local name if no VPATH or the VPATH name if one was found. */ + + while (file) + { + file->name = file->hname; + file = file->prev; + } + return 0; } DEBUGPR ("Must remake target `%s'.\n"); + /* It needs to be remade. If it's VPATH and not GPATH, toss the VPATH */ + if (!streq(file->name, file->hname)) + { + char *name = file->name; + + if (gpath_search (&name, NULL)) + { + register struct file *fp = file; + + /* Since we found the file on GPATH, convert it to use the + VPATH filename. */ + while (fp) + { + fp->name = fp->hname; + fp = fp->prev; + } + DEBUGPR (" Using VPATH `%s' due to GPATH.\n"); + } + else + { + if (debug_flag) + { + print_spaces (depth); + printf(" Ignoring VPATH name `%s'.\n", file->hname); + fflush(stdout); + } + file->ignore_vpath = 1; + } + } + /* Now, take appropriate actions to remake the file. */ remake_file (file); @@ -1003,7 +1057,7 @@ f_mtime (file, search) { mtime = name_mtime (file->name); - if (mtime == (time_t) -1 && search) + if (mtime == (time_t) -1 && search && !file->ignore_vpath) { /* If name_mtime failed, search VPATH. */ char *name = file->name; @@ -1016,9 +1070,9 @@ f_mtime (file, search) /* vpath_search and library_search store zero in MTIME if they didn't need to do a stat call for their work. */ file->last_mtime = mtime; - rename_file (file, name); + rehash_file (file, name); check_renamed (file); - return file_mtime (file); + mtime = name_mtime (name); } } } @@ -1026,10 +1080,9 @@ f_mtime (file, search) { /* Files can have bogus timestamps that nothing newly made will be "newer" than. Updating their dependents could just result in loops. - So notify the user of the anomaly by treating future files as - unrecoverably absent. */ + So notify the user of the anomaly with a warning. */ - static time_t now; + static time_t now = 0; if (mtime != -1 && mtime > now && ! file->updated) { /* This file's time appears to be in the future. @@ -1039,16 +1092,13 @@ f_mtime (file, search) static unsigned long vms_now[2]; /* assumes 32 bit long ! */ sys$gettim (vms_now); now = ((vms_now[0]>>24) & 0xff) + ((vms_now[1]<<8) & 0xffffff00); - if (mtime > now) #else extern time_t time (); - if (mtime > time (&now)) + time (&now); #endif - { - error ("*** File `%s' has modification time in the future", - file->name); - file->update_status = 2; - } + if (mtime > now) + error ("*** Warning: File `%s' has modification time in the future", + file->name); } } @@ -1099,7 +1149,7 @@ library_search (lib, mtime_ptr) "/lib", "/usr/lib", #endif -#if defined(WIN32) && !defined(LIBDIR) +#if defined(WINDOWS32) && !defined(LIBDIR) /* * This is completely up to the user at product install time. Just define * a placeholder. @@ -1145,6 +1195,30 @@ library_search (lib, mtime_ptr) /* Now try the standard set of directories. */ +#ifdef __MSDOS__ + { + /* The default library directory is at ${DJDIR}/lib. */ + struct variable *djdir = lookup_variable ("DJDIR", 5); + + if (djdir) + { + size_t djdir_len = strlen (djdir->value); + + if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2) + buf = (char *) xrealloc (djdir_len + 1); + sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname); + mtime = name_mtime (buf); + if (mtime != (time_t) -1) + { + *lib = buf; + if (mtime_ptr != 0) + *mtime_ptr = mtime; + return 1; + } + } + } +#endif + for (dp = dirs; *dp != 0; ++dp) { #ifndef _AMIGA @@ -231,6 +231,9 @@ signame_init () #if defined (SIGINFO) init_sig (SIGINFO, "INFO", "Information request"); #endif +#if defined (SIGNOFP) + init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available"); +#endif } /* Return the abbreviation for signal NUMBER. */ @@ -22,7 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "job.h" #include "commands.h" #include "variable.h" -#ifdef WIN32 +#ifdef WINDOWS32 #include "pathstuff.h" #endif @@ -354,7 +354,7 @@ merge_variable_set_lists (setlist0, setlist1) void define_automatic_variables () { -#ifdef WIN32 +#ifdef WINDOWS32 extern char* default_shell; #else extern char default_shell[]; @@ -373,12 +373,39 @@ define_automatic_variables () ? "" : remote_description); (void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0); +#ifdef __MSDOS__ + /* Allow to specify a special shell just for Make, + and use $COMSPEC as the default $SHELL when appropriate. */ + { + static char shell_str[] = "SHELL"; + const int shlen = sizeof (shell_str) - 1; + struct variable *mshp = lookup_variable ("MAKESHELL", 9); + struct variable *comp = lookup_variable ("COMSPEC", 7); + + /* Make $MAKESHELL override $SHELL even if -e is in effect. */ + if (mshp) + (void) define_variable (shell_str, shlen, + mshp->value, o_env_override, 0); + else if (comp) + { + /* $COMSPEC shouldn't override $SHELL. */ + struct variable *shp = lookup_variable (shell_str, shlen); + + if (!shp) + (void) define_variable (shell_str, shlen, comp->value, o_env, 0); + } + } +#endif /* 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); v->export = v_export; /* Always export SHELL. */ + /* On MSDOS we do use SHELL from environment, since + it isn't a standard environment variable on MSDOS, + so whoever sets it, does that on purpose. */ +#ifndef __MSDOS__ /* Don't let SHELL come from the environment. */ if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override) { @@ -386,6 +413,7 @@ define_automatic_variables () v->origin = o_file; v->value = savestring (default_shell, strlen (default_shell)); } +#endif /* Make sure MAKEFILES gets exported if it is set. */ v = define_variable ("MAKEFILES", 9, "", o_default, 0); @@ -546,20 +574,20 @@ target_environment (file) && v->origin != o_env && v->origin != o_env_override) { char *value = recursively_expand (v); -#ifdef WIN32 +#ifdef WINDOWS32 if (strcmp(v->name, "Path") == 0 || strcmp(v->name, "PATH") == 0) - convert_Path_to_win32(value, ';'); + convert_Path_to_windows32(value, ';'); #endif result[nvariables++] = concat (v->name, "=", value); free (value); } else -#ifdef WIN32 +#ifdef WINDOWS32 { if (strcmp(v->name, "Path") == 0 || strcmp(v->name, "PATH") == 0) - convert_Path_to_win32(v->value, ';'); + convert_Path_to_windows32(v->value, ';'); result[nvariables++] = concat (v->name, "=", v->value); } #else @@ -734,6 +762,88 @@ try_variable_definition (filename, lineno, line, origin) } } +#ifdef __MSDOS__ + /* Many Unix Makefiles include a line saying "SHELL=/bin/sh", but + non-Unix systems don't conform to this default configuration (in + fact, most of them don't even have `/bin'). On the other hand, + $SHELL in the environment, if set, points to the real pathname of + the shell. + Therefore, we generally won't let lines like "SHELL=/bin/sh" from + the Makefile override $SHELL from the environment. But first, we + look for the basename of the shell in the directory where SHELL= + points, and along the $PATH; if it is found in any of these places, + we define $SHELL to be the actual pathname of the shell. Thus, if + you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on + your $PATH, then SHELL=/usr/local/bin/bash will have the effect of + defining SHELL to be "d:/unix/bash.exe". */ + if (origin == o_file + && strcmp (expanded_name, "SHELL") == 0) + { + char shellpath[PATH_MAX]; + extern char * __dosexec_find_on_path (const char *, char *[], char *); + + /* See if we can find "/bin/sh.exe", "/bin/sh.com", etc. */ + if (__dosexec_find_on_path (value, (char **)0, shellpath)) + { + char *p; + + for (p = shellpath; *p; p++) + { + if (*p == '\\') + *p = '/'; + } + v = define_variable (expanded_name, strlen (expanded_name), + shellpath, origin, flavor == recursive); + } + else + { + char *shellbase, *bslash; + struct variable *pathv = lookup_variable ("PATH", 4); + char *path_string; + char *fake_env[2]; + size_t pathlen = 0; + + shellbase = rindex (value, '/'); + bslash = rindex (value, '\\'); + if (!shellbase || bslash > shellbase) + shellbase = bslash; + if (!shellbase && value[1] == ':') + shellbase = value + 1; + if (shellbase) + shellbase++; + else + shellbase = value; + + /* Search for the basename of the shell (with standard + executable extensions) along the $PATH. */ + if (pathv) + pathlen = strlen (pathv->value); + path_string = (char *)xmalloc (5 + pathlen + 2 + 1); + /* On MSDOS, current directory is considered as part of $PATH. */ + sprintf (path_string, "PATH=.;%s", pathv ? pathv->value : ""); + fake_env[0] = path_string; + fake_env[1] = (char *)0; + if (__dosexec_find_on_path (shellbase, fake_env, shellpath)) + { + char *p; + + for (p = shellpath; *p; p++) + { + if (*p == '\\') + *p = '/'; + } + v = define_variable (expanded_name, strlen (expanded_name), + shellpath, origin, flavor == recursive); + } + else + v = lookup_variable (expanded_name, strlen (expanded_name)); + + free (path_string); + } + } + else +#endif /* __MSDOS__ */ + v = define_variable (expanded_name, strlen (expanded_name), value, origin, flavor == recursive); @@ -884,7 +994,7 @@ print_file_variables (file) print_variable_set (file->variables->set, "# "); } -#ifdef WIN32 +#ifdef WINDOWS32 void sync_Path_environment(void) { @@ -902,9 +1012,9 @@ sync_Path_environment(void) free(environ_path); /* - * Create something WIN32 world can grok + * Create something WINDOWS32 world can grok */ - convert_Path_to_win32(path, ';'); + convert_Path_to_windows32(path, ';'); environ_path = concat("Path", "=", path); putenv(environ_path); free(path); @@ -1,4 +1,4 @@ -char *version_string = "3.75"; +char *version_string = "3.75.1"; /* Local variables: @@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "make.h" #include "filedef.h" #include "variable.h" -#ifdef WIN32 +#ifdef WINDOWS32 #include "pathstuff.h" #endif @@ -43,6 +43,10 @@ static struct vpath *vpaths; /* Structure for the general VPATH given in the variable. */ static struct vpath *general_vpath; + +/* Structure for GPATH given in the variable. */ + +static struct vpath *gpaths; static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr)); @@ -98,6 +102,38 @@ build_vpath_lists () general_vpath = vpaths; vpaths = save_vpaths; } + + /* If there is a GPATH variable with a nonnull value, construct the + GPATH list from it. We use variable_expand rather than just + calling lookup_variable so that it will be recursively expanded. */ + + { + /* Turn off --warn-undefined-variables while we expand SHELL and IFS. */ + int save = warn_undefined_variables_flag; + warn_undefined_variables_flag = 0; + + p = variable_expand ("$(strip $(GPATH))"); + + warn_undefined_variables_flag = save; + } + + if (*p != '\0') + { + /* Save the list of vpaths. */ + struct vpath *save_vpaths = vpaths; + + /* Empty `vpaths' so the new one will have no next, and `vpaths' + will still be nil if P contains no existing directories. */ + vpaths = 0; + + /* Parse P. */ + construct_vpath_list ("%", p); + + /* Store the created path as the GPATH, + and restore the old list of vpaths. */ + gpaths = vpaths; + vpaths = save_vpaths; + } } /* Construct the VPATH listing for the pattern and searchpath given. @@ -173,8 +209,8 @@ construct_vpath_list (pattern, dirpath) return; } -#ifdef WIN32 - convert_vpath_to_win32(dirpath, ';'); +#ifdef WINDOWS32 + convert_vpath_to_windows32(dirpath, ';'); #endif /* Figure out the maximum number of VPATH entries and @@ -209,6 +245,10 @@ construct_vpath_list (pattern, dirpath) len = p - v; /* Make sure there's no trailing slash, but still allow "/" as a directory. */ +#ifdef __MSDOS__ + /* We need also to leave alone a trailing slash in "d:/". */ + if (len > 3 || (len > 1 && v[1] != ':')) +#endif if (len > 1 && p[-1] == '/') --len; @@ -270,6 +310,23 @@ construct_vpath_list (pattern, dirpath) } } +/* Search the GPATH list for a directory where the name pointed to by FILE + exists. If it is found, we set *FILE to the newly malloc'd name of the + existing file, *MTIME_PTR (if MTIME_PTR is not NULL) to its modtime (or + zero if no stat call was done), and return 1. Otherwise we return 0. */ + +int +gpath_search (file, mtime_ptr) + char **file; + time_t *mtime_ptr; +{ + if (gpaths != 0 + && selective_vpath_search (gpaths, file, mtime_ptr)) + return 1; + + return 0; +} + /* Search the VPATH list whose pattern matches *FILE for a directory where the name pointed to by FILE exists. If it is found, we set *FILE to the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is @@ -287,8 +344,8 @@ vpath_search (file, mtime_ptr) there is nothing we can do. */ if (**file == '/' -#ifdef WIN32 - || **file == '\\' +#if defined (WINDOWS32) || defined (__MSDOS__) + || **file == '\\' || (*file)[1] == ':' #endif || (vpaths == 0 && general_vpath == 0)) @@ -343,9 +400,13 @@ selective_vpath_search (path, file, mtime_ptr) pointer to the name-within-directory and FLEN is its length. */ n = rindex (*file, '/'); -#ifdef WIN32 - if (!n) - n = rindex(*file,, '\\'); +#if defined (WINDOWS32) || defined (__MSDOS__) + /* We need the rightmost slash or backslash. */ + { + char *bslash = rindex(*file, '\\'); + if (!n || bslash > n) + n = bslash; + } #endif name_dplen = n != 0 ? n - *file : 0; filename = name_dplen > 0 ? n + 1 : *file; @@ -378,6 +439,11 @@ selective_vpath_search (path, file, mtime_ptr) n += name_dplen; } +#if defined (WINDOWS32) || defined (__MSDOS__) + /* Cause the next if to treat backslash and slash alike. */ + if (n != name && n[-1] == '\\' ) + n[-1] = '/'; +#endif /* Now add the name-within-directory at the end of NAME. */ if (n != name && n[-1] != '/') { diff --git a/w32/compat/dirent.c b/w32/compat/dirent.c index 25a7b74..9416828 100644 --- a/w32/compat/dirent.c +++ b/w32/compat/dirent.c @@ -78,7 +78,7 @@ closedir(DIR *pDir) return;
}
- /* close the WIN32 directory handle */
+ /* close the WINDOWS32 directory handle */
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
FindClose(pDir->dir_hDirHandle);
@@ -90,7 +90,7 @@ closedir(DIR *pDir) struct dirent *
readdir(DIR* pDir)
{
- WIN32_FIND_DATA wfdFindData;
+ WINDOWS32_FIND_DATA wfdFindData;
if (!pDir) {
errno = EINVAL;
@@ -134,7 +134,7 @@ rewinddir(DIR* pDir) return;
}
- /* close the WIN32 directory handle */
+ /* close the WINDOWS32 directory handle */
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
if (!FindClose(pDir->dir_hDirHandle))
errno = EBADF;
diff --git a/w32/include/dirent.h b/w32/include/dirent.h index ccc1800..3437bd0 100644 --- a/w32/include/dirent.h +++ b/w32/include/dirent.h @@ -15,7 +15,7 @@ struct dirent
{
- ino_t d_ino; /* unused - no equivalent on WIN32 */
+ ino_t d_ino; /* unused - no equivalent on WINDOWS32 */
char d_name[NAME_MAX+1];
};
diff --git a/w32/include/pathstuff.h b/w32/include/pathstuff.h index 5916961..a036f7b 100644 --- a/w32/include/pathstuff.h +++ b/w32/include/pathstuff.h @@ -1,8 +1,8 @@ #ifndef _PATHSTUFF_H #define _PATHSTUFF_H -extern char * convert_Path_to_win32(char *Path, char to_delim); -extern char * convert_vpath_to_win32(char *Path, char to_delim); +extern char * convert_Path_to_windows32(char *Path, char to_delim); +extern char * convert_vpath_to_windows32(char *Path, char to_delim); extern char * w32ify(char *file, int resolve); extern char * getcwd_fs(char *buf, int len); diff --git a/w32/include/sub_proc.h b/w32/include/sub_proc.h index 4f1f312..700b945 100644 --- a/w32/include/sub_proc.h +++ b/w32/include/sub_proc.h @@ -20,7 +20,7 @@ /* $Id$ */
-#ifdef WIN32
+#ifdef WINDOWS32
#define EXTERN_DECL(entry, args) extern entry args
#define VOID_DECL void
diff --git a/w32/include/w32err.h b/w32/include/w32err.h index b48dbbe..68a6590 100644 --- a/w32/include/w32err.h +++ b/w32/include/w32err.h @@ -5,6 +5,6 @@ #define EXTERN_DECL(entry, args) entry args
#endif
-EXTERN_DECL(char * map_win32_error_to_string, (DWORD error));
+EXTERN_DECL(char * map_windows32_error_to_string, (DWORD error));
#endif /* !_W32ERR_H */
diff --git a/w32/pathstuff.c b/w32/pathstuff.c index ee4a7f0..01ed52f 100644 --- a/w32/pathstuff.c +++ b/w32/pathstuff.c @@ -4,10 +4,10 @@ #include "pathstuff.h" /* - * Convert delimiter separated vpath to Canonical format. + * Convert delimiter separated vpath to Canonical format. */ char * -convert_vpath_to_win32(char *Path, char to_delim) +convert_vpath_to_windows32(char *Path, char to_delim) { char *etok; /* token separator for old Path */ @@ -19,21 +19,21 @@ convert_vpath_to_win32(char *Path, char to_delim) if (isblank(*etok)) *etok = to_delim; - return (convert_Path_to_win32(Path, to_delim)); + return (convert_Path_to_windows32(Path, to_delim)); } /* - * Convert delimiter separated path to Canonical format. + * Convert delimiter separated path to Canonical format. */ char * -convert_Path_to_win32(char *Path, char to_delim) +convert_Path_to_windows32(char *Path, char to_delim) { char *etok; /* token separator for old Path */ char *p; /* points to element of old Path */ /* is this a multi-element Path ? */ for (p = Path, etok = strpbrk(p, ":;"); - etok; + etok; etok = strpbrk(p, ":;")) if ((etok - p) == 1) { if (*(etok - 1) == ';' || @@ -48,7 +48,7 @@ convert_Path_to_win32(char *Path, char to_delim) p = ++etok; } else /* all finished, force abort */ - p += strlen(p); + p += strlen(p); } else { /* found another one, no drive letter */ *etok = to_delim; @@ -61,7 +61,7 @@ convert_Path_to_win32(char *Path, char to_delim) *p = '\\'; #endif return Path; -} +} /* * Convert to forward slashes. Resolve to full pathname optionally @@ -100,10 +100,10 @@ getcwd_fs(char* buf, int len) #ifdef unused /* * Convert delimiter separated pathnames (e.g. PATH) or single file pathname - * (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that - * _NutPathToNutc() fails to convert, just return the path we were handed - * and assume the caller will know what to do with it (It was probably - * a mistake to try and convert it anyway due to some of the bizarre things + * (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that + * _NutPathToNutc() fails to convert, just return the path we were handed + * and assume the caller will know what to do with it (It was probably + * a mistake to try and convert it anyway due to some of the bizarre things * that might look like pathnames in makefiles). */ char * @@ -119,8 +119,8 @@ convert_path_to_nutc(char *path) char *rval; /* is this a multi-element path ? */ - for (p = path, etok = strpbrk(p, ":;"), count = 0; - etok; + for (p = path, etok = strpbrk(p, ":;"), count = 0; + etok; etok = strpbrk(p, ":;")) if ((etok - p) == 1) { if (*(etok - 1) == ';' || @@ -132,15 +132,15 @@ convert_path_to_nutc(char *path) p = ++etok, count++; else /* all finished, force abort */ - p += strlen(p); - } else + p += strlen(p); + } else /* found another one, no drive letter */ p = ++etok, count++; if (count) { count++; /* x1;x2;x3 <- need to count x3 */ - /* + /* * Hazard a guess on how big the buffer needs to be. * We have to convert things like c:/foo to /c=/foo. */ @@ -154,10 +154,10 @@ convert_path_to_nutc(char *path) * a time. Single file pathnames will fail this and fall * to the logic below loop. */ - for (p = path, etok = strpbrk(p, ":;"); - etok; + for (p = path, etok = strpbrk(p, ":;"); + etok; etok = strpbrk(p, ":;")) { - + /* don't trip up on device specifiers or empty path slots */ if ((etok - p) == 1) if (*(etok - 1) == ';' || @@ -165,14 +165,14 @@ convert_path_to_nutc(char *path) p = ++etok; continue; } else if ((etok = strpbrk(etok+1, ":;")) == NULL) - break; /* thing found was a WIN32 pathname */ + break; /* thing found was a WINDOWS32 pathname */ /* save separator */ sep = *etok; /* terminate the current path element -- temporarily */ *etok = '\0'; - + #ifdef __NUTC__ /* convert to NutC format */ if (_NutPathToNutc(p, pathp, 0) == FALSE) { @@ -187,20 +187,20 @@ convert_path_to_nutc(char *path) *pathp++ = '/'; strcpy(pathp, &p[2]); #endif - + pathp += strlen(pathp); *pathp++ = ':'; /* use Unix style path separtor for new path */ *pathp = '\0'; /* make sure we are null terminaed */ - + /* restore path separator */ *etok = sep; - + /* point p to first char of next path element */ p = ++etok; } } else { - nutc_path_len = strlen(path) + 3; + nutc_path_len = strlen(path) + 3; nutc_path = xmalloc(nutc_path_len); pathp = nutc_path; *pathp = '\0'; @@ -211,7 +211,7 @@ convert_path_to_nutc(char *path) * OK, here we handle the last element in PATH (e.g. c of a;b;c) * or the path was a single filename and will be converted * here. Note, testing p here assures that we don't trip up - * on paths like a;b; which have trailing delimiter followed by + * on paths like a;b; which have trailing delimiter followed by * nothing. */ if (*p != '\0') { @@ -234,6 +234,6 @@ convert_path_to_nutc(char *path) rval = savestring(nutc_path, strlen(nutc_path)); free(nutc_path); return rval; -} +} #endif diff --git a/w32/subproc/NMakefile b/w32/subproc/NMakefile index 0d2ca89..2843a82 100644 --- a/w32/subproc/NMakefile +++ b/w32/subproc/NMakefile @@ -27,7 +27,7 @@ CC = cl OUTDIR=.
MAKEFILE=NMakefile
-CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D _WINDOWS -I. -I../include
+CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WINDOWS32 /D _WINDOWS -I. -I../include
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
diff --git a/w32/subproc/build.bat b/w32/subproc/build.bat index bb35615..3c53a43 100644 --- a/w32/subproc/build.bat +++ b/w32/subproc/build.bat @@ -1,10 +1,10 @@ if not exist .\WinDebug\nul mkdir .\WinDebug
-cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
-cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
-cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
+cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
+cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
+cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
if not exist .\WinRel\nul mkdir .\WinRel
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
-cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
+cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
diff --git a/w32/subproc/misc.c b/w32/subproc/misc.c index 2fd66ab..4e1b0c7 100644 --- a/w32/subproc/misc.c +++ b/w32/subproc/misc.c @@ -7,7 +7,7 @@ /*
* Description: Convert a NULL string terminated UNIX environment block to
- * an environment block suitable for a win32 system call
+ * an environment block suitable for a windows32 system call
*
* Returns: TRUE= success, FALSE=fail
*
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c index 4f1ded9..55aafec 100644 --- a/w32/subproc/sub_proc.c +++ b/w32/subproc/sub_proc.c @@ -395,7 +395,7 @@ process_begin( exec_handle = find_file(exec_path, &file_info);
/*
- * If we couldn't open the file, just assume that Win32 will be able
+ * If we couldn't open the file, just assume that Windows32 will be able
* to find and execute it.
*/
if (exec_handle == (HANDLE)HFILE_ERROR) {
@@ -578,7 +578,7 @@ proc_stdout_thread(sub_process *pproc) for (;;) {
if (ReadFile( (HANDLE)pproc->sv_stdout[0], &c, 1, &nread, NULL)
== FALSE) {
-/* map_win32_error_to_string(GetLastError());*/
+/* map_windows32_error_to_string(GetLastError());*/
_endthreadex(0);
}
if (nread == 0)
@@ -609,7 +609,7 @@ proc_stderr_thread(sub_process *pproc) for (;;) {
if (ReadFile( (HANDLE)pproc->sv_stderr[0], &c, 1, &nread, NULL) == FALSE) {
- map_win32_error_to_string(GetLastError());
+ map_windows32_error_to_string(GetLastError());
_endthreadex(0);
}
if (nread == 0)
@@ -718,7 +718,7 @@ process_pipe_io( one second to collect all remaining output */
if (wait_return == WAIT_FAILED) {
-/* map_win32_error_to_string(GetLastError());*/
+/* map_windows32_error_to_string(GetLastError());*/
pproc->last_err = GetLastError();
pproc->lerrno = E_SCALL;
goto done;
@@ -835,7 +835,7 @@ process_file_io( wait_return = WaitForSingleObject(childhand, INFINITE);
if (wait_return != WAIT_OBJECT_0) {
-/* map_win32_error_to_string(GetLastError());*/
+/* map_windows32_error_to_string(GetLastError());*/
pproc->last_err = GetLastError();
pproc->lerrno = E_SCALL;
goto done2;
@@ -883,7 +883,7 @@ process_cleanup( /*
- * Try to protect against WIN32 argument munging. This function takes
+ * Try to protect against WINDOWS32 argument munging. This function takes
* an argv vector and outputs a 'protected' string as a return
* value. The return code can be safely passed to CreateProcess().
*
diff --git a/w32/subproc/w32err.c b/w32/subproc/w32err.c index 8abd75b..afe7668 100644 --- a/w32/subproc/w32err.c +++ b/w32/subproc/w32err.c @@ -2,7 +2,7 @@ #include "w32err.h"
/*
- * Description: the win32 version of perror()
+ * Description: the windows32 version of perror()
*
* Returns: a pointer to a static error
*
@@ -10,7 +10,7 @@ * comp.os.ms-windows.programmer.win32
*/
char *
-map_win32_error_to_string (DWORD ercode) {
+map_windows32_error_to_string (DWORD ercode) {
/* __declspec (thread) necessary if you will use multiple threads */
__declspec (thread) static char szMessageBuffer[128];
|