A couple of months ago I presented a patch to implement DJGPP/MSDOS support in make again. Now that the legal paperwork has been signed and submitted I resent an improved patch again. The patch is based on today's CVS head. Because the mayor part of the changes are DOS specific and not DJGPP specific, especially the treating of absolute and relative paths, the suggested changes may be usefull for other DOS/WINDOWS compilers too. The presented patch has been tested on my Linux and my DOS/WINDOWS box using DJGPP. Please note that I am not able to test for other Win32 compilers.
To have a working DJGPP/DOS support the patch will treat three issues: - the make code itself - the testsuite - the supplementary DOS specific build files 1) The make code. The most escential change is in function abspath() in function.c. This function is completely unix centric and that is the reason why the test case functions/abspath fails for the DJGPP port of make. The patch will change this function in such a way that it will be able to handle the DOS/WINDOWS specific cases with paths that may have backslashes instead of slashes as dir separators or may have mixed backslashes and slashes as dir separators or may have a drive letter prepended to the path. To handle all these issues macros like IS_DRIVE_SPECIFIER, IS_DIR_SEPARATOR and IS_ABSOLUTE are used. The definition of all OS specific macros to handle path issues have been moved to a canonical place that is make.h. Here I follow the same policy than in GNU texinfo and GNU bison and some other programs that support not unix-like OSs. In make.h there are already lines like: /* Handle other OSs. */ #ifndef PATH_SEPARATOR_CHAR # if defined(HAVE_DOS_PATHS) # define PATH_SEPARATOR_CHAR ';' # elif defined(VMS) # define PATH_SEPARATOR_CHAR ',' # else # define PATH_SEPARATOR_CHAR ':' # endif #endif those have been replaced by: /* Handle other OSs. */ #if defined(HAVE_DOS_PATHS) # define PATH_SEPARATOR_CHAR ';' # define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') # define IS_DRIVE_SPECIFIER(n) ((n)[0] && (n)[1] == ':') # define IS_ABSOLUTE(n) ((IS_DRIVE_SPECIFIER(n) && IS_DIR_SEPARATOR(n[2])) || IS_DIR_SEPARATOR(n[0])) #elif defined(VMS) # define PATH_SEPARATOR_CHAR ',' # define IS_DIR_SEPARATOR(c) ((c) == ']') # define IS_DRIVE_SPECIFIER(n) (0) # define IS_ABSOLUTE(n) IS_DIR_SEPARATOR(n[0]) #else # define PATH_SEPARATOR_CHAR ':' # define IS_DIR_SEPARATOR(c) ((c) == '/') # define IS_DRIVE_SPECIFIER(n) (0) # define IS_ABSOLUTE(n) IS_DIR_SEPARATOR(n[0]) #endif having all OS specific issues in one place and removing those or similar definitions from their original places. With those changes supplied by the patch the DJGPP port of make is again able to handle paths that follows the DOS syntax. From configure.in and thus from config.h.in, the definition of PATH_SEPARATOR_CHAR has been removed. From the code lines above it can be seen that always a sane default for all OSs will be defined. Other changes are DJGPP specific or to pacify the compiler. 2) The testsuite. Here two kind of modifications are required: first does to inhibit those test cases that make no sense with this particular port and second those to adjust the test cases in such a way that they work with this port. The test case variables/shell will probably never work with this port so I have disabled it with the following code snippet: if ($port_type eq "DOS") { if (exists $ENV{DJDIR}) { return -1; } } May be some day I may have enough time look more carefully to this test case and I will figure out how some of the test may be got to execute on DOS/DJGPP but actualy it is not possible. The second test case that does not work correctly with DOS/DJGPP is targets/SECONDARY. The tests #9 and #10 are related to Savannah bug #15919 and require the paralelism of make. Paralllelism will never by available for the DJGPP port of make so I have added the following lines after test #8 to inhibit the execution of the rest of the tests: if (!$parallel_jobs) { return 1; } This should be good for all ports that do not offer parallelism. For functions/abspath new DOS specific tests have been added. Of course they will only be executed if $port_type is "DOS" and DJDIR is set in the environment identifying the DJGPP port of make. For almost every unix type of test up to three similar DOS tests have been added to test the supported different DOS style variants of paths. These are: \foo\bar \foo/bar and both with a drive letter prepended. All other changes are required to get different tests working. E.G.: certain tests will produce output like this: #MAKEFILE#:4: foo.x: No such file or directory but the DJGPP port will produce output like this: #MAKEFILE#:4: foo.x: No such file or directory (ENOENT) Although the test was successful, diff will note the difference in the output strings and will report that the test has failed. To avoid this kind of failure the following lines have been added where they were required: if ($port_type eq "DOS") { if (exists $ENV{DJDIR}) { $error_message = '(ENOENT)'; } } else { $error_message = ''; } This concerns the tests options/dash-B, options/dash-k, options/dash-W and variables/MAKE_RESTARTS. 3) The supplementary DOS specific build files The most important change is that $(prefix) is used to define the variables LIBDIR, INCLUDEDIR and LOCALEDIR instead of hard coded ones. Also the way the docs are generated have been modified so that the results and intermediary files are generated in doc/ instead of the $(srcdir). For further details, please inspect the patch. As usual suggestions, objections, comments are welcome. Regards, Juan M. Guerrero 2008-06-30 Juan Manuel Guerrero <[EMAIL PROTECTED]> * implicit.c: Add const qualifier to *lastslash so it matches the declaration of *filename. * dir.c (file_exists_p) [HAVE_DOS_PATHS]: Use IS_DRIVE_SPECIFIER. (file_impossible) [HAVE_DOS_PATHS]: Use IS_DRIVE_SPECIFIER. (file_impossible_p) [HAVE_DOS_PATHS]: Use IS_DRIVE_SPECIFIER. * function.c [HAVE_DOS_PATHS, VMS]: Remove IS_PATHSEP definition. Now it is defined in its canonical place in make.h. (abspath) [HAVE_DOS_PATHS]: Use IS_DIR_SEPARATOR instead of a literal '/' and '\\'. Support d:foo style absolute file names. Add logic for the case that backslash are path separators too. Include colon as separator char in the IS_DIR_SEPARATOR definition and use it to check for root char. (func_notdir_suffix, func_basename_dir, abspath): Use IS_DRIVE_SPECIFIER and IS_DIR_SEPARATOR. * glob/glob.c (my_realloc): Don't define, and don't redefine realloc to call it since the DJGPP realloc handles NULL pointers. * hash.c (round_up_2): Use 4294967295U to avoid compiler warnings. * implicit.c (pattern_search) [HAVE_DOS_PATHS]: Use IS_DRIVE_SPECIFIER. * make.h: All OS specific macros to handle path syntax peculiarities are defined here. [HAVE_DOS_PATHS]: New macro IS_DRIVE_SPECIFIER to check for drive specifier strings like 'a:'. For all other supported OSs this macro is empty and optimzed out. [HAVE_DOS_PATHS, VMS]: Define macro IS_DIR_SEPARATOR. Previous definition of IS_PATHSEP in function.c removed accordingly. * vpath.c (construct_vpath_list) [HAVE_DOS_PATHS, PATH_SEPARATOR_CHAR]: Use IS_DIR_SEPARATOR instead of a literal '/' and '\\'. (vpath_search) [HAVE_DOS_PATHS]: Use IS_ABSOLUTE. * configure.in (PATH_SEPARATOR_CHAR): Definition of PATH_SEPARATOR_CHAR removed. Now PATH_SEPARATOR_CHAR is always defined in make.h in a OS dependent way. * configh.dos.template: Remove unconditional definition of SYS_SIGLIST_DECLARED. Include <sys/version.h> because ports of GCC 4.3.0 and later no longer include it, so macros like __DJGPP_MINOR__ are no longer defined automatically. * Makefile.DOS.template (INCLUDES): Use $(prefix) and the corresponding variables to define LIBDIR, INCLUDEDIR and LOCALEDIR instead of using the hardcoded ones. (SUBDIRS): doc subdir added. (INFO_DEPS, DVIS): Values changed to 'make.info' and 'make.dvi'. (TEXI2HTML, TEXI2HTML_FLAGS): Removed. Use makeinfo --html to create html formated docs. texi2html may not be ported to DOS. (make.info, make.dvi, make.ps, make.html): Make targets depend on 'make.texi'. (.texi.info, .texi, .texi.dvi): Now recursively invocate. Change -I switch to look in ./ instead of ./doc. (html): Target depend on html-recursive instead of make_1.html. (make_1.html): Removed. (mostlyclean-aminfo): Use $(srcdir)/doc instead of ./ as prefix. (all-recursive): Allow for more than one subdir in the build process. (mostlyclean-recursive, clean-recursive, distclean-recursive, maintainer-clean-recursive, check-recursive): Enter in doc/ too. (tags-recursive): Allow for more than one subdir in the build process. (info-recursive, dvi-recursive, ps-recursive, html-recursive): New targets. Enter into doc/ to produce the targets. (all-am): $(INFO_DEPS) replaced by info. * dosbuild.bat: Add -DLOCALEDIR to compiler command line to compile main.c. Remove make.new if build successfull. Use /dev/env/DJDIR instead of c:/djgpp for -DINCLUDEDIR and -DLOCALEDIR. * tests/scripts/functions/abspath: Added new MSDOS specific tests. They reproduce the complete test cases adding up to three new test cases but using backslash instead of slash as dir separator and prepending a DOS typical drive letter. They are only started if the OS is some DOS flouver and DJGPP is used as compiler. * tests/scripts/options/dash-B: Define $error_message to allow for an error message that may be specific to a particular libc implementation. * tests/scripts/options/dash-k: Define $error_message to allow for an error message that may be specific to a particular libc implementation. * tests/scripts/options/dash-W: Define $error_message to allow for an error message that may be specific to a particular libc implementation. * tests/scripts/targets/SECONDARY: If the port does not support parallelism inhibit test cases #9 and #10 (Savannah bug #15919). * tests/scripts/variables/MAKE_RESTARTS: Define $error_message to allow error message that may be specific to a particular libc implementation. * tests/scripts/variables/SHELL: If compiled with DJGPP, do not run this test at all. Index: Makefile.DOS.template =================================================================== RCS file: /sources/make/make/Makefile.DOS.template,v retrieving revision 2.16 diff -p -U 5 -r2.16 Makefile.DOS.template --- Makefile.DOS.template 22 Dec 2007 12:07:36 -0000 2.16 +++ Makefile.DOS.template 29 Jun 2008 23:58:40 -0000 @@ -1,10 +1,10 @@ # -*-Makefile-*- template for DJGPP # Makefile.in generated automatically by automake 1.2 from Makefile.am # # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is part of GNU Make. # # GNU Make is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (at your option) any later @@ -83,17 +83,17 @@ make_SOURCES = %SOURCES% libglob_a_SOURCES = %GLOB_SOURCES% make_LDADD = glob/libglob.a man_MANS = make.1 -INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" -DLOCALEDIR=\"$(localedir)\" +INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(prefix)$(includedir)\" -DLOCALEDIR=\"$(prefix)$(localedir)\" BUILT_SOURCES = README build.sh-in EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c -SUBDIRS = glob +SUBDIRS = glob doc mkinstalldirs = ${exec_prefix}/bin/gmkdir -p CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = build.sh PROGRAMS = $(bin_PROGRAMS) @@ -113,20 +113,17 @@ noinst_LIBRARIES = glob/libglob.a CFLAGS = -O2 -g COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ TEXI2DVI = texi2dvi TEXINFO_TEX = $(srcdir)/config/texinfo.tex -INFO_DEPS = make.info -DVIS = make.dvi +INFO_DEPS = doc/make.info +DVIS = doc/make.dvi TEXINFOS = doc/make.texi noinst_TEXINFOS = doc/fdl.texi doc/make-stds.texi man1dir = $(mandir)/man1 MANS = $(man_MANS) -TEXI2HTML = texi2html -TEXI2HTML_FLAGS = -split_chapter - NROFF = nroff DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.in getloadavg.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -189,45 +186,48 @@ make$(EXEEXT): $(make_OBJECTS) $(make_DE @command.com /c if exist make.exe del make.exe $(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS) # Documentation -make.info: doc/make.texi -make.dvi: doc/make.texi +make.info: make.texi +make.dvi: make.texi +make.ps: make.dvi make.texi +make.html: make.texi DVIPS = dvips .texi.info: @command.com /c if exist make.info* del make.info* @command.com /c if exist make.i* del make.i* - $(MAKEINFO) -I$(srcdir)/doc --no-split $< -o ./$@ + $(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@ .texi: @command.com /c if exist make.info* del make.info* @command.com /c if exist make.i* del make.i* - $(MAKEINFO) -I$(srcdir)/doc --no-split $< -o ./$@ + $(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@ .texi.dvi: - TEXINPUTS="$(srcdir)/doc;$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)/doc' $(TEXI2DVI) $< + TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .dvi.ps: $(DVIPS) $< -o $@ # Other documentation formats -html: make_1.html +html: html-recursive -make_1.html: $(TEXINFOS) $(noinst_TEXINFOS) - $(TEXI2HTML) $(TEXI2HTML_FLAGS) $(srcdir)/doc/make.texi +.texi.html: + @command.com /c if exist make.html* del make.html* + $(MAKEINFO) --html -I$(srcdir) --no-split $< -o ./$@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) - @for file in $(INFO_DEPS); do d=$(srcdir); for ifile in `cd $$d && echo $$file`; 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); do iifile=`echo $$file | sed "s|doc/||"`; d=$(srcdir); for ifile in `cd $$d && echo $$file`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile; 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 iifile=`echo $$file | sed "s|doc/||"`; echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile || :; 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 $(NORMAL_UNINSTALL) @@ -235,13 +235,16 @@ uninstall-info: dist-info: $(INFO_DEPS) for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done mostlyclean-aminfo: - -rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky \ - make.kys make.ps make.log make.pg make.toc make.tp make.tps \ - make.vr make.vrs make.op make.tr make.cv make.cn + -rm -f $(srcdir)/doc/make.aux $(srcdir)/doc/make.cp $(srcdir)/doc/make.cps $(srcdir)/doc/make.dvi \ + $(srcdir)/doc/make.fn $(srcdir)/doc/make.fns $(srcdir)/doc/make.ky $(srcdir)/doc/make.kys \ + $(srcdir)/doc/make.ps $(srcdir)/doc/make.log $(srcdir)/doc/make.pg $(srcdir)/doc/make.toc \ + $(srcdir)/doc/make.tp $(srcdir)/doc/make.tps $(srcdir)/doc/make.vr $(srcdir)/doc/make.vrs \ + $(srcdir)/doc/make.op $(srcdir)/doc/make.tr $(srcdir)/doc/make.cv $(srcdir)/doc/make.cn \ + $(srcdir)/doc/make.html clean-aminfo: distclean-aminfo: @@ -289,17 +292,14 @@ uninstall-man: # Assume that the only thing to do in glob is to build libglob.a, # but do a sanity check: if $SUBDIRS will ever have more than # a single directory, yell bloody murder. all-recursive: -ifeq ($(words $(SUBDIRS)), 1) +ifeq ($(findstring glob, $(SUBDIRS)), glob) @command.com /c if not exist glob\\nul md glob - @echo Making all in $(SUBDIRS) - $(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a -else - @echo FATAL: There is more than one directory in "($(SUBDIRS))" - @$(EXIT_FAIL) + @echo Making all in glob + $(MAKE) -C glob -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a endif $(SUBDIRS): command.com /c md $@ @@ -308,26 +308,28 @@ libglob.a: $(libglob_a_OBJECTS) $(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD) $(RANLIB) libglob.a mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive check-recursive: -ifeq ($(words $(SUBDIRS)), 1) - @echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS) - $(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am +ifeq ($(words $(SUBDIRS)), 2) + @echo Making $(shell echo $@ | sed s/-recursive//) in glob + $(MAKE) -C glob -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am + @echo Making $(shell echo $@ | sed s/-recursive//) in doc + $(MAKE) -C doc -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am else - @echo FATAL: There is more than one directory in "($(SUBDIRS))" + @echo FATAL: There is more than two directory in "($(SUBDIRS))" @$(EXIT_FAIL) endif tags-in-glob: $(libglob_a_SOURCES) etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS tags-recursive: -ifeq ($(words $(SUBDIRS)), 1) +ifeq ($(words $(SUBDIRS)), 2) $(MAKE) tags-in-glob else - @echo FATAL: There is more than one directory in "($(SUBDIRS))" + @echo FATAL: There is more than two directory in "($(SUBDIRS))" @$(EXIT_FAIL) endif tags: TAGS @@ -374,19 +376,48 @@ distdir: $(DISTFILES) -chmod 777 $(distdir) @for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -info: $(INFO_DEPS) info-recursive -dvi: $(DVIS) dvi-recursive +info: info-recursive +info-recursive: +ifeq ($(findstring doc, $(SUBDIRS)), doc) + @command.com /c if not exist doc\\nul md doc + @echo Making all in doc + $(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.info +endif + +dvi: dvi-recursive +dvi-recursive: +ifeq ($(findstring doc, $(SUBDIRS)), doc) + @command.com /c if not exist doc\\nul md doc + @echo Making all in doc + $(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.dvi +endif + +ps: ps-recursive +ps-recursive: +ifeq ($(findstring doc, $(SUBDIRS)), doc) + @command.com /c if not exist doc\\nul md doc + @echo Making all in doc + $(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.ps +endif + +html-recursive: +ifeq ($(findstring doc, $(SUBDIRS)), doc) + @command.com /c if not exist doc\\nul md doc + @echo Making all in doc + $(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.html +endif + check: all-am check-recursive check-local @: installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) all-recursive -all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h +all-am: Makefile $(PROGRAMS) config.h info install-exec-am: install-binPROGRAMS install-data-am: install-info-am Index: configh.dos.template =================================================================== RCS file: /sources/make/make/configh.dos.template,v retrieving revision 1.19 diff -p -U 5 -r1.19 configh.dos.template --- configh.dos.template 22 Dec 2007 11:27:02 -0000 1.19 +++ configh.dos.template 29 Jun 2008 23:58:40 -0000 @@ -14,17 +14,21 @@ WARRANTY; without even the implied warra A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports + of GCC 4.3.0 and later no longer do it automatically. */ +#include <sys/version.h> + /* Many things are defined already by a system header. */ #include <sys/config.h> #if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1 -/* Define to 1 if `sys_siglist' is declared by <signal.h>. */ -# define SYS_SIGLIST_DECLARED 1 +/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */ +# define SYS_SIGLIST_DECLARED 1 /* Define to 1 if the C library defines the variable `_sys_siglist'. */ # define HAVE_DECL_SYS_SIGLIST 1 #else @@ -105,13 +109,10 @@ this program. If not, see <http://www.g #define PACKAGE_VERSION "%VERSION%" /* Define to 1 if the C compiler supports function prototypes. */ #define PROTOTYPES 1 -/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */ -#define SYS_SIGLIST_DECLARED 1 - /* Version number of package */ #define VERSION "%VERSION%" /* Build host information. */ #define MAKE_HOST "i386-pc-msdosdjgpp" Index: configure.in =================================================================== RCS file: /sources/make/make/configure.in,v retrieving revision 1.148 diff -p -U 5 -r1.148 configure.in --- configure.in 4 Jul 2007 19:35:17 -0000 1.148 +++ configure.in 29 Jun 2008 23:58:41 -0000 @@ -386,12 +386,10 @@ case "$host" in AC_DEFINE([WINDOWS32], [1], [Use platform specific coding]) AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding]) ;; esac -AC_DEFINE_UNQUOTED(PATH_SEPARATOR_CHAR,'$PATH_SEPARATOR',[Define to the character that separates directories in PATH.]) - # Include the Maintainer's Makefile section, if it's here. MAINT_MAKEFILE=/dev/null if test -r "$srcdir/maintMakefile"; then MAINT_MAKEFILE="$srcdir/maintMakefile" Index: dir.c =================================================================== RCS file: /sources/make/make/dir.c,v retrieving revision 1.67 diff -p -U 5 -r1.67 dir.c --- dir.c 10 Oct 2007 04:32:16 -0000 1.67 +++ dir.c 29 Jun 2008 23:58:43 -0000 @@ -765,11 +765,11 @@ file_exists_p (const char *name) { const char *bslash = strrchr(name, '\\'); if (!dirend || bslash > dirend) dirend = bslash; /* The case of "d:file". */ - if (!dirend && name[0] && name[1] == ':') + if (!dirend && IS_DRIVE_SPECIFIER (name)) dirend = name + 1; } #endif /* HAVE_DOS_PATHS */ if (dirend == 0) #ifndef _AMIGA @@ -825,11 +825,11 @@ file_impossible (const char *filename) { const char *bslash = strrchr(p, '\\'); if (!dirend || bslash > dirend) dirend = bslash; /* The case of "d:file". */ - if (!dirend && p[0] && p[1] == ':') + if (!dirend && IS_DRIVE_SPECIFIER (p)) dirend = p + 1; } # endif /* HAVE_DOS_PATHS */ if (dirend == 0) # ifdef _AMIGA @@ -907,11 +907,11 @@ file_impossible_p (const char *filename) { const char *bslash = strrchr(filename, '\\'); if (!dirend || bslash > dirend) dirend = bslash; /* The case of "d:file". */ - if (!dirend && filename[0] && filename[1] == ':') + if (!dirend && IS_DRIVE_SPECIFIER (filename)) dirend = filename + 1; } #endif /* HAVE_DOS_PATHS */ if (dirend == 0) #ifdef _AMIGA Index: function.c =================================================================== RCS file: /sources/make/make/function.c,v retrieving revision 1.104 diff -p -U 5 -r1.104 function.c --- function.c 10 Oct 2007 13:22:21 -0000 1.104 +++ function.c 29 Jun 2008 23:58:46 -0000 @@ -509,20 +509,10 @@ func_flavor (char *o, char **argv, const o = variable_buffer_output (o, "simple", 6); return o; } -#ifdef VMS -# define IS_PATHSEP(c) ((c) == ']') -#else -# ifdef HAVE_DOS_PATHS -# define IS_PATHSEP(c) ((c) == '/' || (c) == '\\') -# else -# define IS_PATHSEP(c) ((c) == '/') -# endif -#endif - static char * func_notdir_suffix (char *o, char **argv, const char *funcname) { /* Expand the argument. */ @@ -538,11 +528,11 @@ func_notdir_suffix (char *o, char **argv const char *p = p2 + len; while (p >= p2 && (!is_suffix || *p != '.')) { - if (IS_PATHSEP (*p)) + if (IS_DIR_SEPARATOR (*p)) break; --p; } if (p >= p2) @@ -553,11 +543,11 @@ func_notdir_suffix (char *o, char **argv continue; o = variable_buffer_output (o, p, len - (p - p2)); } #ifdef HAVE_DOS_PATHS /* Handle the case of "d:foo/bar". */ - else if (streq (funcname, "notdir") && p2[0] && p2[1] == ':') + else if (streq (funcname, "notdir") && IS_DRIVE_SPECIFIER (p2)) { p = p2 + 2; o = variable_buffer_output (o, p, len - (p - p2)); } #endif @@ -594,22 +584,22 @@ func_basename_dir (char *o, char **argv, while ((p2 = find_next_token (&p3, &len)) != 0) { const char *p = p2 + len; while (p >= p2 && (!is_basename || *p != '.')) { - if (IS_PATHSEP (*p)) + if (IS_DIR_SEPARATOR (*p)) break; --p; } if (p >= p2 && (is_dir)) o = variable_buffer_output (o, p2, ++p - p2); else if (p >= p2 && (*p == '.')) o = variable_buffer_output (o, p2, p - p2); #ifdef HAVE_DOS_PATHS /* Handle the "d:foobar" case */ - else if (p2[0] && p2[1] == ':' && is_dir) + else if (IS_DRIVE_SPECIFIER (p2) && is_dir) o = variable_buffer_output (o, p2, 2); #endif else if (is_dir) #ifdef VMS o = variable_buffer_output (o, "[]", 2); @@ -1882,19 +1872,39 @@ func_not (char *o, char **argv, char *fu `..' components nor any repeated path separators ('/'). */ static char * abspath (const char *name, char *apath) { +#ifdef HAVE_DOS_PATHS +# undef IS_DIR_SEPARATOR +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\' || (c) == ':') +#endif + char *dest; const char *start, *end, *apath_limit; if (name[0] == '\0' || apath == NULL) return NULL; apath_limit = apath + GET_PATH_MAX; - if (name[0] != '/') +#ifdef HAVE_DOS_PATHS + if (IS_DRIVE_SPECIFIER (name)) /* DOS-style drive letter? */ + { + strncpy (apath, name, 2); + dest = apath + 2; + name += 2; + if (IS_DIR_SEPARATOR (*name)) + { + name++; + *dest++ = '/'; + } + *dest = '\0'; + } + else +#endif + if (!IS_DIR_SEPARATOR (name[0])) { /* It is unlikely we would make it until here but just to make sure. */ if (!starting_directory) return NULL; @@ -1911,15 +1921,15 @@ abspath (const char *name, char *apath) for (start = end = name; *start != '\0'; start = end) { unsigned long len; /* Skip sequence of multiple path-separators. */ - while (*start == '/') + while (IS_DIR_SEPARATOR (*start)) ++start; /* Find end of path component. */ - for (end = start; *end != '\0' && *end != '/'; ++end) + for (end = start; *end != '\0' && !IS_DIR_SEPARATOR (*end); ++end) ; len = end - start; if (len == 0) @@ -1927,16 +1937,20 @@ abspath (const char *name, char *apath) else if (len == 1 && start[0] == '.') /* nothing */; else if (len == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ - if (dest > apath + 1) - while ((--dest)[-1] != '/'); + if (dest > apath + 1 +#ifdef HAVE_DOS_PATHS + && (apath[1] != ':' || dest > apath + 2 + IS_DIR_SEPARATOR (apath[2])) +#endif + ) + while (--dest, (!IS_DIR_SEPARATOR (dest[-1]))); } else { - if (dest[-1] != '/') + if (!IS_DIR_SEPARATOR (dest[-1])) *dest++ = '/'; if (dest + len >= apath_limit) return NULL; @@ -1945,16 +1959,24 @@ abspath (const char *name, char *apath) *dest = '\0'; } } /* Unless it is root strip trailing separator. */ - if (dest > apath + 1 && dest[-1] == '/') + if (dest > apath + 1 && IS_DIR_SEPARATOR (dest[-1]) +#ifdef HAVE_DOS_PATHS + && (dest > apath + 3 || dest[-3] == ':') +#endif + ) --dest; *dest = '\0'; return apath; +#ifdef HAVE_DOS_PATHS +# undef IS_DIR_SEPARATOR +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') +#endif } static char * func_realpath (char *o, char **argv, const char *funcname UNUSED) Index: hash.c =================================================================== RCS file: /sources/make/make/hash.c,v retrieving revision 2.7 diff -p -U 5 -r2.7 hash.c --- hash.c 4 Jul 2007 19:35:18 -0000 2.7 +++ hash.c 29 Jun 2008 23:58:47 -0000 @@ -319,11 +319,11 @@ round_up_2 (unsigned long n) n |= (n >> 2); n |= (n >> 4); 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 return n + 1; Index: implicit.c =================================================================== RCS file: /sources/make/make/implicit.c,v retrieving revision 1.66 diff -p -U 5 -r1.66 implicit.c --- implicit.c 4 Jul 2007 19:35:19 -0000 1.66 +++ implicit.c 29 Jun 2008 23:58:49 -0000 @@ -192,11 +192,11 @@ pattern_search (struct file *file, int a /* Length of FILENAME. */ unsigned int namelen = strlen (filename); /* The last slash in FILENAME (or nil if there is none). */ - char *lastslash; + const char *lastslash; /* This is a file-object used as an argument in recursive calls. It never contains any data except during a recursive call. */ struct file *intermediate_file = 0; @@ -272,11 +272,11 @@ pattern_search (struct file *file, int a and the case of "d:file". */ { char *bslash = strrchr (filename, '\\'); if (lastslash == 0 || bslash > lastslash) lastslash = bslash; - if (lastslash == 0 && filename[0] && filename[1] == ':') + if (lastslash == 0 && IS_DRIVE_SPECIFIER (filename)) lastslash = filename + 1; } #endif #endif if (lastslash != 0 && lastslash[1] == '\0') @@ -339,11 +339,11 @@ pattern_search (struct file *file, int a #ifdef HAVE_DOS_PATHS /* Didn't find it yet: check for DOS-type directories. */ if (check_lastslash) { char *b = strchr (target, '\\'); - check_lastslash = !(b || (target[0] && target[1] == ':')); + check_lastslash = !(b || IS_DRIVE_SPECIFIER (target)); } #endif #endif } if (check_lastslash) Index: make.h =================================================================== RCS file: /sources/make/make/make.h,v retrieving revision 1.131 diff -p -U 5 -r1.131 make.h --- make.h 4 Nov 2007 21:54:01 -0000 1.131 +++ make.h 29 Jun 2008 23:58:50 -0000 @@ -305,18 +305,25 @@ char *strsignal (int signum); #define _(msgid) gettext (msgid) #define N_(msgid) gettext_noop (msgid) #define S_(msg1,msg2,num) ngettext (msg1,msg2,num) /* Handle other OSs. */ -#ifndef PATH_SEPARATOR_CHAR -# if defined(HAVE_DOS_PATHS) -# define PATH_SEPARATOR_CHAR ';' -# elif defined(VMS) -# define PATH_SEPARATOR_CHAR ',' -# else -# define PATH_SEPARATOR_CHAR ':' -# endif +#if defined(HAVE_DOS_PATHS) +# define PATH_SEPARATOR_CHAR ';' +# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') +# define IS_DRIVE_SPECIFIER(n) ((n)[0] && (n)[1] == ':') +# define IS_ABSOLUTE(n) ((IS_DRIVE_SPECIFIER(n) && IS_DIR_SEPARATOR(n[2])) || IS_DIR_SEPARATOR(n[0])) +#elif defined(VMS) +# define PATH_SEPARATOR_CHAR ',' +# define IS_DIR_SEPARATOR(c) ((c) == ']') +# define IS_DRIVE_SPECIFIER(n) (0) +# define IS_ABSOLUTE(n) IS_DIR_SEPARATOR(n[0]) +#else +# define PATH_SEPARATOR_CHAR ':' +# define IS_DIR_SEPARATOR(c) ((c) == '/') +# define IS_DRIVE_SPECIFIER(n) (0) +# define IS_ABSOLUTE(n) IS_DIR_SEPARATOR(n[0]) #endif /* This is needed for getcwd() and chdir(), on some W32 systems. */ #if defined(HAVE_DIRECT_H) # include <direct.h> Index: vpath.c =================================================================== RCS file: /sources/make/make/vpath.c,v retrieving revision 1.48 diff -p -U 5 -r1.48 vpath.c --- vpath.c 22 Dec 2007 10:55:30 -0000 1.48 +++ vpath.c 29 Jun 2008 23:58:51 -0000 @@ -239,11 +239,11 @@ construct_vpath_list (char *pattern, cha /* Platforms whose PATH_SEPARATOR_CHAR is ':' and which also define HAVE_DOS_PATHS would like us to recognize colons after the drive letter in the likes of "D:/foo/bar:C:/xyzzy". */ && (*p != PATH_SEPARATOR_CHAR - || (p == v + 1 && (p[1] == '/' || p[1] == '\\'))) + || (p == v + 1 && IS_DIR_SEPARATOR(p[1]))) #else && *p != PATH_SEPARATOR_CHAR #endif && !isblank ((unsigned char)*p)) ++p; @@ -523,15 +523,11 @@ vpath_search (const char *file, FILE_TIM struct vpath *v; /* If there are no VPATH entries or FILENAME starts at the root, there is nothing we can do. */ - if (file[0] == '/' -#ifdef HAVE_DOS_PATHS - || file[0] == '\\' || file[1] == ':' -#endif - || (vpaths == 0 && general_vpath == 0)) + if (IS_ABSOLUTE(file) || (vpaths == 0 && general_vpath == 0)) return 0; for (v = vpaths; v != 0; v = v->next) if (pattern_matches (v->pattern, v->percent, file)) { Index: glob/glob.c =================================================================== RCS file: /sources/make/make/glob/glob.c,v retrieving revision 1.28 diff -p -U 5 -r1.28 glob.c --- glob/glob.c 22 Dec 2007 11:28:49 -0000 1.28 +++ glob/glob.c 29 Jun 2008 23:58:53 -0000 @@ -180,21 +180,18 @@ extern void bcopy (); # define HAVE_MEMPCPY 1 # undef mempcpy # define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len) #endif -#ifndef __GNU_LIBRARY__ +#if !defined __GNU_LIBRARY__ && !defined __DJGPP__ # ifdef __GNUC__ __inline # endif # ifndef __SASC # ifdef WINDOWS32 static void * my_realloc (void *p, unsigned int n) -# elif defined(__DJGPP__) -static void * -my_realloc (void *p, size_t n) # else static char * my_realloc (p, n) char *p; unsigned int n; @@ -206,11 +203,11 @@ my_realloc (p, n) return (char *) malloc (n); return (char *) realloc (p, n); } # define realloc my_realloc # endif /* __SASC */ -#endif /* __GNU_LIBRARY__ */ +#endif /* __GNU_LIBRARY__ || __DJGPP__ */ #if !defined __alloca && !defined __GNU_LIBRARY__ # ifdef __GNUC__ Index: tests/scripts/functions/abspath =================================================================== RCS file: /sources/make/make/tests/scripts/functions/abspath,v retrieving revision 1.2 diff -p -U 5 -r1.2 abspath --- tests/scripts/functions/abspath 29 Aug 2005 14:11:01 -0000 1.2 +++ tests/scripts/functions/abspath 29 Jun 2008 23:58:53 -0000 @@ -75,7 +75,119 @@ all: ; @: ', '', ''); +if ($port_type eq "DOS") { + if (exists $ENV{DJDIR}) { + # + # Some DOS specific tests that are supported + # only by the DJGPP port of make. + # + # For every unix-style test case up to three more are + # added to test for paths with backslash instead slash + # as directory separator; to test for paths with mixed + # backslash and slash as dir separator and to test for + # paths with a drive letter prepended. + # + +$description = "Test the abspath functions with DOS path syntax."; + +$details = ""; + +run_make_test(' +ifneq ($(realpath $(abspath .\)),$(CURDIR)) + $(warning .\: abs="$(abspath .\)" real="$(realpath $(abspath .\))" curdir="$(CURDIR)") +endif + +ifneq ($(realpath $(abspath .\\\)),$(CURDIR)) + $(warning .\\\: abs="$(abspath .\\\)" real="$(realpath $(abspath .\\\))" curdir="$(CURDIR)") +endif + +ifneq ($(abspath \),/) + $(warning \: abspath="$(abspath \)") +endif + +ifneq ($(abspath \\\\\\),/) + $(warning \\\\\\: abspath="$(abspath \\\\\\)") +endif + +ifneq ($(abspath \\.),/) + $(warning \\.: abspath="$(abspath \\.)") +endif + +ifneq ($(abspath ///.),/) + $(warning ///.: abspath="$(abspath ///.)") +endif + +ifneq ($(abspath \\./),/) + $(warning \\./: abspath="$(abspath \\./)") +endif + +ifneq ($(abspath \\.///),/) + $(warning \\.///: abspath="$(abspath \\.///)") +endif + +ifneq ($(abspath \\..),/) + $(warning \\..: abspath="$(abspath \\..)") +endif + +ifneq ($(abspath //\\..),/) + $(warning //\\..: abspath="$(abspath //\\..)") +endif + +ifneq ($(abspath \\../),/) + $(warning \\../: abspath="$(abspath \\../)") +endif + +ifneq ($(abspath \\..///),/) + $(warning \\..///: abspath="$(abspath \\..///)") +endif + + +ifneq ($(abspath \\foo\\bar\\..),/foo) + $(warning \\foo\\bar\\..: abspath="$(abspath \\foo\\bar\\..)") +endif + +ifneq ($(abspath a:\\foo\\bar\\..),a:/foo) + $(warning a:\\foo\\bar\\..: abspath="$(abspath a:\\foo\\bar\\..)") +endif + +ifneq ($(abspath a:foo\\bar\\..),a:foo) + $(warning a:foo\\bar\\..: abspath="$(abspath a:foo\\bar\\..)") +endif + +ifneq ($(abspath \\foo\\bar\\..\\..\\..\\baz),/baz) + $(warning \\foo\\bar\\..\\..\\..\\baz: abspath="$(abspath \\foo\\bar\\..\\..\\..\\baz)") +endif + +ifneq ($(abspath a:\\foo\\bar\\..\\..\\..\\baz),a:/baz) + $(warning a:\\foo\\bar\\..\\..\\..\\baz: abspath="$(abspath a:\\foo\\bar\\..\\..\\..\\baz)") +endif + +ifneq ($(abspath a:foo\\bar\\..\\..\\..\\baz),a:baz) + $(warning a:foo\\bar\\..\\..\\..\\baz: abspath="$(abspath a:foo\\bar\\..\\..\\..\\baz)") +endif + +ifneq ($(abspath \\foo\\bar\\..\\ \\..),/foo /) + $(warning \\foo\\bar\\..\\ \\..: abspath="$(abspath \\foo\\bar\\..\\ \\..)") +endif + +ifneq ($(abspath a:\\foo\\bar\\..\\ a:\\..),a:/foo a:/) + $(warning a:\\foo\\bar\\..\\ a:\\..: abspath="$(abspath a:\\foo\\bar\\..\\ a:\\..)") +endif + +ifneq ($(abspath a:foo\\bar\\..\\ a:..),a:foo a:) + $(warning a:foo\\bar\\..\\ a:..: abspath="$(abspath a:foo\\bar\\..\\ a:..)") +endif + +.PHONY: all +all: ; @: +', +'', +''); + + } +} + # This tells the test driver that the perl test script executed properly. 1; Index: tests/scripts/options/dash-B =================================================================== RCS file: /sources/make/make/tests/scripts/options/dash-B,v retrieving revision 1.4 diff -p -U 5 -r1.4 dash-B --- tests/scripts/options/dash-B 25 Jun 2005 18:57:28 -0000 1.4 +++ tests/scripts/options/dash-B 29 Jun 2008 23:58:54 -0000 @@ -36,19 +36,31 @@ run_make_test(undef, '-B', 'cp bar.x foo rmfiles('bar.x', 'foo'); # Test -B with the re-exec feature: we don't want to re-exec forever # Savannah bug # 7566 +if ($port_type eq "DOS") { + if (exists $ENV{DJDIR}) { + # + # If compiled with DJGPP an error message (ENOENT) is issued. + # + $error_message = ' (ENOENT)'; + } +} +else { + $error_message = ''; +} + run_make_test(' all: ; @: $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) include foo.x foo.x: ; @touch $@ ', - '-B', 'MAKE_RESTARTS= -#MAKEFILE#:4: foo.x: No such file or directory -MAKE_RESTARTS=1'); + '-B', "MAKE_RESTARTS= +#MAKEFILE#:4: foo.x: No such file or directory$error_message +MAKE_RESTARTS=1"); rmfiles('foo.x'); # Test -B with the re-exec feature: we DO want -B in the "normal" part of the # makefile. @@ -60,14 +72,14 @@ all: blah.x ; @echo $@ $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) include foo.x foo.x: ; @touch $@ blah.x: ; @echo $@ ', - '-B', 'MAKE_RESTARTS= -#MAKEFILE#:4: foo.x: No such file or directory + '-B', "MAKE_RESTARTS= +#MAKEFILE#:4: foo.x: No such file or directory$error_message MAKE_RESTARTS=1 blah.x -all'); +all"); rmfiles('foo.x', 'blah.x'); 1; Index: tests/scripts/options/dash-W =================================================================== RCS file: /sources/make/make/tests/scripts/options/dash-W,v retrieving revision 1.5 diff -p -U 5 -r1.5 dash-W --- tests/scripts/options/dash-W 8 Mar 2006 20:15:09 -0000 1.5 +++ tests/scripts/options/dash-W 29 Jun 2008 23:58:54 -0000 @@ -31,24 +31,36 @@ rmfiles('a.x', 'b.x'); # Test -W with the re-exec feature: we don't want to re-exec forever # Savannah bug # 7566 # First set it up with a normal build +if ($port_type eq "DOS") { + if (exists $ENV{DJDIR}) { + # + # If compiled with DJGPP an error message (ENOENT) is issued. + # + $error_message = ' (ENOENT)'; + } +} +else { + $error_message = ''; +} + run_make_test(' all: baz.x ; @: include foo.x foo.x: bar.x @echo "\$$(info restarts=\$$(MAKE_RESTARTS))" > $@ @echo "touch $@" bar.x: ; echo >> $@ baz.x: bar.x ; @echo "touch $@" ', - '', '#MAKEFILE#:3: foo.x: No such file or directory + '', "#MAKEFILE#:3: foo.x: No such file or directory$error_message echo >> bar.x touch foo.x restarts=1 -touch baz.x'); +touch baz.x"); # Now run with -W bar.x # Tweak foo.x's timestamp so the update will change it. &utouch(1000, 'foo.x'); Index: tests/scripts/options/dash-k =================================================================== RCS file: /sources/make/make/tests/scripts/options/dash-k,v retrieving revision 1.3 diff -p -U 5 -r1.3 dash-k --- tests/scripts/options/dash-k 16 May 2004 19:16:56 -0000 1.3 +++ tests/scripts/options/dash-k 29 Jun 2008 23:58:54 -0000 @@ -98,16 +98,28 @@ $make_name: Target `all' not remade beca &compare_output($answer, &get_logfile(1)); # TEST -- make sure we keep the error code if we can't create an included # makefile. +if ($port_type eq "DOS") { + if (exists $ENV{DJDIR}) { + # + # If compiled with DJGPP an error message (ENOENT) is issued. + # + $error_message = ' (ENOENT)'; + } +} +else { + $error_message = ''; +} + run_make_test('all: ; @echo hi include ifile ifile: no-such-file; @false ', '-k', - "#MAKEFILE#:2: ifile: No such file or directory + "#MAKEFILE#:2: ifile: No such file or directory$error_message #MAKE#: *** No rule to make target `no-such-file', needed by `ifile'. #MAKE#: Failed to remake makefile `ifile'. hi\n", 512); Index: tests/scripts/targets/SECONDARY =================================================================== RCS file: /sources/make/make/tests/scripts/targets/SECONDARY,v retrieving revision 1.6 diff -p -U 5 -r1.6 SECONDARY --- tests/scripts/targets/SECONDARY 15 Aug 2007 13:53:54 -0000 1.6 +++ tests/scripts/targets/SECONDARY 29 Jun 2008 23:58:54 -0000 @@ -119,10 +119,14 @@ version2: version ; @echo GOOD all: version2', 'all', 'GOOD'); unlink('version2'); +if (!$parallel_jobs) { + return 1; +} + # TEST #9 -- Savannah bug #15919 # The original fix for this bug caused a new bug, shown here. touch(qw(1.a 2.a)); Index: tests/scripts/variables/MAKE_RESTARTS =================================================================== RCS file: /sources/make/make/tests/scripts/variables/MAKE_RESTARTS,v retrieving revision 1.1 diff -p -U 5 -r1.1 MAKE_RESTARTS --- tests/scripts/variables/MAKE_RESTARTS 25 Jun 2005 18:57:28 -0000 1.1 +++ tests/scripts/variables/MAKE_RESTARTS 29 Jun 2008 23:58:54 -0000 @@ -2,19 +2,31 @@ $description = "Test the MAKE_RESTARTS variable."; # Test basic capability +if ($port_type eq "DOS") { + if (exists $ENV{DJDIR}) { + # + # If compiled with DJGPP an error message (ENOENT) is issued. + # + $error_message = ' (ENOENT)'; + } +} +else { + $error_message = ''; +} + run_make_test(' all: ; @: $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) include foo.x foo.x: ; @touch $@ ', - '', 'MAKE_RESTARTS= -#MAKEFILE#:4: foo.x: No such file or directory -MAKE_RESTARTS=1'); + '', "MAKE_RESTARTS= +#MAKEFILE#:4: foo.x: No such file or directory$error_message +MAKE_RESTARTS=1"); rmfiles('foo.x'); # Test multiple restarts @@ -23,15 +35,15 @@ all: ; @: $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) include foo.x foo.x: ; @echo "include bar.x" > $@ bar.x: ; @touch $@ ', - '', 'MAKE_RESTARTS= -#MAKEFILE#:4: foo.x: No such file or directory + '', "MAKE_RESTARTS= +#MAKEFILE#:4: foo.x: No such file or directory$error_message MAKE_RESTARTS=1 -foo.x:1: bar.x: No such file or directory -MAKE_RESTARTS=2'); +foo.x:1: bar.x: No such file or directory$error_message +MAKE_RESTARTS=2"); rmfiles('foo.x', 'bar.x'); # Test multiple restarts and make sure the variable is cleaned up @@ -45,13 +57,13 @@ $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) include foo.x foo.x: ; @echo "include bar.x" > $@ bar.x: ; @touch $@ ', '', "MAKE_RESTARTS= -#MAKEFILE#:8: foo.x: No such file or directory +#MAKEFILE#:8: foo.x: No such file or directory$error_message MAKE_RESTARTS=1 -foo.x:1: bar.x: No such file or directory +foo.x:1: bar.x: No such file or directory$error_message MAKE_RESTARTS=2 recurse MAKE_RESTARTS= MAKE_RESTARTS= #MAKE#[1]: Entering directory `#PWD#' all MAKE_RESTARTS= Index: tests/scripts/variables/SHELL =================================================================== RCS file: /sources/make/make/tests/scripts/variables/SHELL,v retrieving revision 1.4 diff -p -U 5 -r1.4 SHELL --- tests/scripts/variables/SHELL 25 Aug 2005 04:40:11 -0000 1.4 +++ tests/scripts/variables/SHELL 29 Jun 2008 23:58:54 -0000 @@ -1,9 +1,15 @@ # -*-perl-*- $description = "Test proper handling of SHELL."; +if ($port_type eq "DOS") { + if (exists $ENV{DJDIR}) { + return -1; + } +} + # Find the default value when SHELL is not set. On UNIX it will be /bin/sh, # but on other platforms who knows? resetENV(); delete $ENV{SHELL}; $mshell = `echo 'all:;[EMAIL PROTECTED] \$(SHELL)' | $make_path -f-`; _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make