> Date: Wed, 16 Feb 2005 01:45:41 -0500 > From: [EMAIL PROTECTED] > > Today I am announcing the second beta release of GNU make 3.81. It's > available from my web site, here: > > http://make.paulandlesley.org/make-3.81beta2.tar.bz2 > http://make.paulandlesley.org/make-3.81beta2.tar.gz
Thanks. I downloaded that and built the DJGPP (a.k.a. MS-DOS) port of this version of Make, and here are my findings. 1. glob.c needs a patch to not redefine realloc, since (a) the DJGPP version of realloc does handle NULL pointers, and (b) latest versions of GCC whine about incompatible arguments being passed to my_realloc (its arg is char *, but what gets passed to it is some other kind of pointer). 2. hash.c needs a small patch to stop compiler from complaining about too large signed int value. 3. Makefile.DOS needs patching due to file-name changes in the doc subdirectory. 4. Somebody changed job.c so that it tried to include the function child_execute_job in the MS-DOS build: that neither works nor is necessary, since the DOS port doesn't use that function. 5. On variable.c, the function define_automatic_variables used to always export SHELL (there was a line "v->export = v_export;" right after SHELL was assigned the default value), but now it doesn't. There's no ChangeLog entry corresponding to that change, so I couldn't grasp the reasons for it. In any case, the DOS port needs SHELL to be exported, because otherwise the library function `system' doesn't see the value of SHELL modified by the Makefile, and doesn't DTRT for Makefile's whose commands require a Unixy shell. 6. The new functions $(abspath) and $(realpath) are Unix-centric: they used literal '/' for directory separators and don't account for possible drive letters under HAVE_DOS_PATHS. 7. dosbuild.bat needs hash.c compilation commands to be added to it. 8. The following file names cause trouble on 8+3 filesystems because they clash with other file names: tests/scripts/variables/MAKEFILE_LIST config/inttypes_h.m4 config/inttypes-pri.m4 The patches for problems 1 - 7 are attached below. As for the last problem, could the offending file names be modified somehow to avoid the clashes? Also, the modified code for the abspath function replaces any backslashes in the DOS/Windows file names with forward slashes; perhaps this side effect (which I think is a feature) should be mentioned in make.texi. Finally, please make sure dosbuild.bat has DOS line endings after you apply the diffs below. (Otherwise, some DOS/Windows shells will refuse to run it.) TIA ChangeLog entries: 2005-02-19 Eli Zaretskii <[EMAIL PROTECTED]> * job.c (child_execute_job): Don't define on MS-DOS. * variable.c (define_automatic_variables) [__MSDOS__]: Always export SHELL. * function.c (abspath): Use IS_PATHSEP instead of a literal '/'. If HAVE_DOS_PATHS is defined, support d:foo style absolute file names. * Makefile.DOS (INFO_DEPS, DVIS, TEXINFOS, doc/make.info) (doc/make.dvi, .texinfo.info, .texinfo, install-info-am) (uninstall-info): Use doc/*, since docs is now in a subdirectory, but remove the `doc/' part when installing or uninstalling. (.texinfo.info, .texinfo): Rename to .texi.info and .texi. * hash.c (round_up_2): Use 4294967295U to avoid compiler warnings. * dosbuild.bat: Add compilation of hash.c. --- hash.c.orig 2002-10-14 23:54:04.000000000 +0200 +++ hash.c 2005-02-19 15:40:16.000000000 +0200 @@ -324,7 +324,7 @@ n |= (n >> 8); n |= (n >> 16); -#if !defined(HAVE_LIMITS_H) || ULONG_MAX > 4294967295 +#if !defined(HAVE_LIMITS_H) || ULONG_MAX > 4294967295U /* We only need this on systems where unsigned long is >32 bits. */ n |= (n >> 32); #endif --- Makefile.D~0 2005-02-16 07:40:42.000000000 +0200 +++ Makefile.DOS 2005-02-19 15:55:10.000000000 +0200 @@ -71,7 +71,7 @@ libglob_a_SOURCES = glob/fnmatch.c glob/glob.c glob/fnmatch.h glob/glob.h make_LDADD = glob/libglob.a -info_TEXINFOS = make.texinfo +info_TEXINFOS = make.texi man_MANS = make.1 INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" -DLOCALEDIR=\"$(localedir)\" @@ -104,9 +104,9 @@ LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ TEXI2DVI = texi2dvi TEXINFO_TEX = $(srcdir)/config/texinfo.tex -INFO_DEPS = make.info -DVIS = make.dvi -TEXINFOS = make.texinfo +INFO_DEPS = doc/make.info +DVIS = doc/make.dvi +TEXINFOS = doc/make.texi doc/fdl.texi doc/make-stds.texi man1dir = $(mandir)/man1 MANS = $(man_MANS) @@ -174,23 +174,23 @@ @command.com /c if exist make.exe del make.exe $(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS) -make.info: make.texinfo -make.dvi: make.texinfo +doc/make.info: ${TEXINFOS} +doc/make.dvi: ${TEXINFOS} DVIPS = dvips -.texinfo.info: - @command.com /c if exist make.info* del make.info* - @command.com /c if exist make.i* del make.i* - $(MAKEINFO) -I$(srcdir) $< -o ./$@ - -.texinfo: - @command.com /c if exist make.info* del make.info* - @command.com /c if exist make.i* del make.i* - $(MAKEINFO) -I$(srcdir) $< -o ./$@ +.texi.info: + @command.com /c if exist doc\make.info* del doc\make.info* + @command.com /c if exist doc\make.i* del doc\make.i* + $(MAKEINFO) -I$(srcdir)/doc $< -o ./$@ + +.texi: + @command.com /c if exist doc\make.info* del doc\make.info* + @command.com /c if exist doc\make.i* del doc\make.i* + $(MAKEINFO) -I$(srcdir)/doc $< -o ./$@ -.texinfo.dvi: +.texi.dvi: TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< @@ -200,15 +200,15 @@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) - @for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi; done; done + @for file in $(INFO_DEPS) doc/make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/`echo $$ifile | sed -e 's,doc/,,'`"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/`echo $$ifile | sed -e 's,doc/,,'`; else : ; fi; done; done @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :; done; else : ; fi + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/`echo $$file | sed -e 's,doc/,,'`"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/`echo $$file | sed -e 's,doc/,,'` || :; done; else : ; fi uninstall-info: $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove `echo $$file | sed -e 's,doc/,,'`; done $(NORMAL_UNINSTALL) - for file in $(INFO_DEPS) make.i; do (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done + for file in $(INFO_DEPS) doc/make.i; do (cd $(DESTDIR)$(infodir) && rm -f `echo $$file | sed -e 's,doc/,,'` `echo $$file | sed -e 's,doc/,,'`-[0-9] `echo $$file | sed -e 's,doc/,,'`-[0-9][0-9] `echo $$file | sed -e 's,doc/,,'`[0-9] `echo $$file | sed -e 's,doc/,,'`[0-9][0-9]); done dist-info: $(INFO_DEPS) for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done --- job.c~0 2004-11-12 23:30:20.000000000 +0200 +++ job.c 2005-02-19 17:04:34.000000000 +0200 @@ -2467,7 +2467,7 @@ #else /* !VMS */ /* EMX: Start a child process. This function returns the new pid. */ -# if defined __MSDOS__ || defined __EMX__ +# if defined __EMX__ int child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp) { --- variable.c~0 2004-12-05 20:09:30.000000000 +0200 +++ variable.c 2005-02-19 18:03:34.000000000 +0200 @@ -742,6 +742,10 @@ /* 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); +#ifdef __MSDOS__ + v->export = v_export; /* Always export SHELL. */ +#endif + /* 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. --- function.c~0 2004-11-30 21:51:24.000000000 +0200 +++ function.c 2005-02-19 20:07:44.000000000 +0200 @@ -1754,7 +1754,21 @@ apath_limit = apath + PATH_MAX; - if (name[0] != '/') +#ifdef HAVE_DOS_PATHS + if (name[1] == ':') /* DOS-style drive letter? */ + { + strncpy (apath, name, 2); + dest = apath + 2; + name += 2; + if (IS_PATHSEP (*name)) + { + *dest++ = *name++; + } + *dest = '\0'; + } + else +#endif + if (!IS_PATHSEP (name[0])) { /* It is unlikely we would make it until here but just to make sure. */ if (!starting_directory) @@ -1775,11 +1789,11 @@ unsigned long len; /* Skip sequence of multiple path-separators. */ - while (*start == '/') + while (IS_PATHSEP (*start)) ++start; /* Find end of path component. */ - for (end = start; *end != '\0' && *end != '/'; ++end) + for (end = start; *end != '\0' && !IS_PATHSEP (*end); ++end) ; len = end - start; @@ -1791,12 +1805,22 @@ else if (len == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ +#ifdef HAVE_DOS_PATHS + if (dest > apath + 1 + && (apath[1] != ':' || dest > apath + 2 + IS_PATHSEP (apath[2]))) + while (--dest, (!IS_PATHSEP (dest[-1]) && dest[-1] != ':')); +#else if (dest > apath + 1) - while ((--dest)[-1] != '/'); + while (--dest, (!IS_PATHSEP (dest[-1]))); +#endif } else { - if (dest[-1] != '/') + if (!IS_PATHSEP (dest[-1]) +#ifdef HAVE_DOS_PATHS + && (dest[-1] != ':') +#endif + ) *dest++ = '/'; if (dest + len >= apath_limit) @@ -1809,7 +1833,11 @@ } /* Unless it is root strip trailing separator. */ - if (dest > apath + 1 && dest[-1] == '/') + if (dest > apath + 1 && IS_PATHSEP (dest[-1]) +#ifdef HAVE_DOS_PATHS + && (dest < apath + 3 || dest[-2] == ':') +#endif + ) --dest; *dest = '\0'; --- dosbuild.bat~ 2002-07-08 16:05:02.000000000 +0300 +++ dosbuild.bat 2002-10-09 13:12:20.000000000 +0200 @@ -19,6 +19,7 @@ gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o +gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g hash.c -o hash.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o @@ -31,7 +32,7 @@ @echo off cd .. echo commands.o > respf.$$$ -for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$ +for %%f in (job dir file misc main read remake rule implicit default variable hash) do echo %%f.o >> respf.$$$ for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$ echo glob/libglob.a >> respf.$$$ @echo Linking... glob/ChangeLog entry: 2005-02-19 Eli Zaretskii <[EMAIL PROTECTED]> * glob.c (my_realloc): Don't define, and don't redefine realloc to call it, under __MSDOS__, since the DJGPP realloc handles NULL pointers. --- glob/glob.c~0 2000-01-22 07:43:02.000000000 +0200 +++ glob/glob.c 2005-02-19 16:34:28.000000000 +0200 @@ -181,7 +181,7 @@ # define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len) #endif -#ifndef __GNU_LIBRARY__ +#if !defined __GNU_LIBRARY__ && !defined __MSDOS__ # ifdef __GNUC__ __inline # endif @@ -203,7 +203,7 @@ } # define realloc my_realloc # endif /* __SASC */ -#endif /* __GNU_LIBRARY__ */ +#endif /* __GNU_LIBRARY__ || __MSDOS__ */ #if !defined __alloca && !defined __GNU_LIBRARY__ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make