* Various fixes for problems in the 3.79.0.1 pretest.
authorPaul Smith <psmith@gnu.org>
Mon, 19 Jun 2000 21:22:44 +0000 (21:22 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 19 Jun 2000 21:22:44 +0000 (21:22 +0000)
16 files changed:
ChangeLog
Makefile.DOS.template
README.DOS.template
acinclude.m4
configh.dos.template
configure.in
expand.c
file.c
function.c
implicit.c
job.c
make.h
remake.c
tests/ChangeLog
tests/scripts/functions/addsuffix
tests/scripts/options/general

index f4885bb5613e900ee5d3171dc4bff97bd0250d1a..b88026b442275ba9198504515912a6c3a530627c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2000-06-19  Paul D. Smith  <psmith@gnu.org>
+
+       * function.c (handle_function): If the last argument was empty, we
+       were pretending it didn't exist rather than providing an empty
+       value.  Keep looking until we're past the end, not just at the end.
+
+       * implicit.c (pattern_search): Multi-target implicit rules weren't
+       expanding the "also made" targets correctly if the pattern didn't
+       contain a slash but the target did; in that case the directory
+       part wasn't being added back to the stem on the "also made"
+       targets.  Reported by Seth M LaForge <sethml@newtonlabs.com>, with
+       a patch.
+
+2000-06-17  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * Makefile.DOS.template (DESTDIR, bindir, datadir, libdir)
+       (infodir, mandir, includedir): Support installation under a
+       non-default DESTDIR.
+
+       * remake.c (f_mtime): Fix the spelling of __MSDOS__.
+
+       * configh.DOS.template (HAVE_FDOPEN, HAVE_MKSTEMP): Define.
+
 2000-06-14  Paul D. Smith  <psmith@gnu.org>
 
        * acinclude.m4 (pds_WITH_GETTEXT): rewrite fp_WITH_GETTEXT and
index c445381fdc3df6d1ddc01b8fd147afb67ddff4f1..8819f1bceb02f2fdf2ffdc7dedebd5248830de63 100644 (file)
@@ -15,26 +15,25 @@ VPATH = $(srcdir)
 prefix = /dev/env/DJDIR
 exec_prefix = ${prefix}
 
-bindir = ${exec_prefix}/bin
-datadir = ${prefix}/share
-libdir = ${prefix}/lib
-infodir = ${prefix}/info
-# DJGPP doesn't have separate man tree, use info instead.
-mandir = ${prefix}/info
-includedir = ${prefix}/include
+bindir = /bin
+datadir = /share
+libdir = /lib
+infodir = /info
+mandir = /man
+includedir = /include
 oldincludedir = c:/djgpp/include
 
-DESTDIR =
+DESTDIR = /dev/env/DJDIR
 
 pkgdatadir = $(datadir)/make
 pkglibdir = $(libdir)/make
 pkgincludedir = $(includedir)/make
-localedir = $(prefix)/share/locale
+localedir = $(datadir)/locale
 
-INSTALL = ${bindir}/ginstall -c
-INSTALL_PROGRAM = ${bindir}/ginstall -c
-INSTALL_DATA = ${bindir}/ginstall -c -m 644
-INSTALL_SCRIPT = ${bindir}/ginstall -c
+INSTALL = ${exec_prefix}/bin/ginstall -c
+INSTALL_PROGRAM = ${exec_prefix}/bin/ginstall -c
+INSTALL_DATA = ${exec_prefix}/bin/ginstall -c -m 644
+INSTALL_SCRIPT = ${exec_prefix}/bin/ginstall -c
 transform = s,x,x,
 
 # This will fail even if they don't have a Unix-like shell (stock DOS
@@ -52,7 +51,7 @@ AR = ar
 CC = gcc
 CPP = gcc -E
 LIBOBJS =
-MAKEINFO = ${bindir}/makeinfo
+MAKEINFO = ${exec_prefix}/bin/makeinfo
 PACKAGE = make
 PERL = perl
 RANLIB = ranlib
@@ -78,7 +77,7 @@ 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
-mkinstalldirs = ${bindir}/gmkdir -p
+mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES =  build.sh
 PROGRAMS =  $(bin_PROGRAMS)
index 5218bb49c2c9fb7ef9f4ce91ab916ac5c517213a..ac11d46f7b32afef9b2b9ef4236a0f8bdce0cb8d 100644 (file)
@@ -95,6 +95,15 @@ To build from sources:
       will also need GNU Fileutils and GNU Sed for this (they should
       be available from the DJGPP sites).
 
+      By default, GNU make will install into your DJGPP installation
+      area.  If you wish to use a different directory, override the
+      DESTDIR variable when invoking "make install", like this:
+
+               make install DESTDIR=c:/other/dir
+
+      This causes the make executable to be placed in c:/other/dir/bin,
+      the man pages in c:/other/dir/man, etc.
+
       Without a Unix-style shell, you will have to install programs
       and the docs manually.  Copy make.exe to a directory on your
       PATH, make.i* info files to your Info directory, and update the
index bbee5359a536cf68327c5cfa76209ef4a9991a64..53b77cc96b9390eae9a5f5446632a84a729bb67a 100644 (file)
@@ -534,7 +534,7 @@ not GNU gettext
       AC_DEFINE(HAVE_LIBINTL_H, 1, [Define if you have <libintl.h>.])
     else
       with_included_gettext=yes
-      LIBS="$fp_keep_LIBS"
+      LIBS="$pds_keep_LIBS"
     fi
   fi
 ])
index 36fb953ebf264eeee47dbf4d152d187627816d1a..ba7485b9d2536cd5afd16fac6594047562920257 100644 (file)
@@ -23,6 +23,9 @@
 \r
 #endif\r
 \r
+/* Define if you have the fdopen function.  */\r
+#define HAVE_FDOPEN 1\r
+\r
 /* Define if you have sigsetmask.  */\r
 #define HAVE_SIGSETMASK 1\r
 \r
@@ -32,6 +35,9 @@
 /* Define if you have the memmove function.  */\r
 #define HAVE_MEMMOVE 1\r
 \r
+/* Define if you have the mkstemp function.  */\r
+#define HAVE_MKSTEMP 1\r
+\r
 #define SCCS_GET "get"\r
 \r
 /* Define to `unsigned long' or `unsigned long long'\r
index 97c28740d93f613a1092ebc7f84f891dbeef8d25..23883282911c10fd2a89061fcd4cb0444f40f997 100644 (file)
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
 AC_PREREQ(2.13)dnl             dnl Minimum Autoconf version required.
 AC_INIT(vpath.c)dnl            dnl A distinctive file to look for in srcdir.
 
-AM_INIT_AUTOMAKE(make, 3.79.0.1)
+AM_INIT_AUTOMAKE(make, 3.79.0.2)
 AM_CONFIG_HEADER(config.h)
 
 dnl Regular configure stuff
@@ -66,7 +66,7 @@ AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
 AC_SEARCH_LIBS(clock_gettime, [rt posix4])
-if test $ac_cv_search_clock_gettime != no; then
+if test "$ac_cv_search_clock_gettime" != no; then
   AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
             [Define if you have the clock_gettime function.])
 fi
index b679a90b6c643466ffae9b3cf1c941774a00a1a7..8ada0cdf4797d8cb69f2f817fc5e683cbfb13214 100644 (file)
--- a/expand.c
+++ b/expand.c
@@ -17,9 +17,10 @@ along with GNU Make; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#include "make.h"
+
 #include <assert.h>
 
-#include "make.h"
 #include "filedef.h"
 #include "job.h"
 #include "commands.h"
@@ -426,6 +427,9 @@ expand_argument (str, end)
 {
   char *tmp;
 
+  if (str == end)
+    return xstrdup("");
+
   if (!end || *end == '\0')
     tmp = str;
   else
diff --git a/file.c b/file.c
index d9e4c1bd47a4fa36dd65043b0ed3daa9310b5468..ede6859466dc863f370e2a685b2731f2b0435196 100644 (file)
--- a/file.c
+++ b/file.c
@@ -17,9 +17,10 @@ along with GNU Make; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#include "make.h"
+
 #include <assert.h>
 
-#include "make.h"
 #include "dep.h"
 #include "filedef.h"
 #include "job.h"
index 9b5fc669b530f088fb1ddeddfbafaf515a7b4695..5d15ff682d74f3b0d1d4ea682da29da359575541 100644 (file)
@@ -1778,7 +1778,7 @@ handle_function (op, stringp)
 
   p = beg;
   nargs = 0;
-  for (p=beg, nargs=0; p < end; ++argvp)
+  for (p=beg, nargs=0; p <= end; ++argvp)
     {
       char *next;
 
index c0ca4ed72c614a373d0d6fa4bf1b88e1520a21a3..15c548797449bba3c3731f3811fd294e50a29d82 100644 (file)
@@ -1,5 +1,5 @@
 /* Implicit rule searching for GNU Make.
-Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
+Copyright (C) 1988,89,90,91,92,93,94,97,2000 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
 GNU Make is free software; you can redistribute it and/or modify
@@ -117,6 +117,7 @@ pattern_search (file, archive, depth, recursions)
   /* The start and length of the stem of FILENAME for the current rule.  */
   register char *stem = 0;
   register unsigned int stemlen = 0;
+  register unsigned int fullstemlen = 0;
 
   /* Buffer in which we store all the rules that are possibly applicable.  */
   struct rule **tryrules
@@ -582,18 +583,23 @@ pattern_search (file, archive, depth, recursions)
     }
 
   if (!checked_lastslash[foundrule])
-    /* Always allocate new storage, since STEM might be
-       on the stack for an intermediate file.  */
-    file->stem = savestring (stem, stemlen);
+    {
+      /* Always allocate new storage, since STEM might be
+         on the stack for an intermediate file.  */
+      file->stem = savestring (stem, stemlen);
+      fullstemlen = stemlen;
+    }
   else
     {
+      int dirlen = (lastslash + 1) - filename;
+
       /* We want to prepend the directory from
         the original FILENAME onto the stem.  */
-      file->stem = (char *) xmalloc (((lastslash + 1) - filename)
-                                    + stemlen + 1);
-      bcopy (filename, file->stem, (lastslash + 1) - filename);
-      bcopy (stem, file->stem + ((lastslash + 1) - filename), stemlen);
-      file->stem[((lastslash + 1) - filename) + stemlen] = '\0';
+      fullstemlen = dirlen + stemlen;
+      file->stem = (char *) xmalloc (fullstemlen + 1);
+      bcopy (filename, file->stem, dirlen);
+      bcopy (stem, file->stem + dirlen, stemlen);
+      file->stem[fullstemlen] = '\0';
     }
 
   file->cmds = rule->cmds;
@@ -606,12 +612,12 @@ pattern_search (file, archive, depth, recursions)
       if (i != matches[foundrule])
        {
          struct dep *new = (struct dep *) xmalloc (sizeof (struct dep));
-         new->name = p = (char *) xmalloc (rule->lens[i] + stemlen + 1);
+         new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1);
          bcopy (rule->targets[i], p,
                 rule->suffixes[i] - rule->targets[i] - 1);
          p += rule->suffixes[i] - rule->targets[i] - 1;
-         bcopy (stem, p, stemlen);
-         p += stemlen;
+         bcopy (file->stem, p, fullstemlen);
+         p += fullstemlen;
          bcopy (rule->suffixes[i], p,
                 rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1);
          new->file = enter_file (new->name);
diff --git a/job.c b/job.c
index 3698f6984277b97d9909b37011a563e78f690c26..1c11a38a0071189b360f046ee39b1dc13a53f62f 100644 (file)
--- a/job.c
+++ b/job.c
@@ -17,9 +17,10 @@ along with GNU Make; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#include "make.h"
+
 #include <assert.h>
 
-#include "make.h"
 #include "job.h"
 #include "debug.h"
 #include "filedef.h"
diff --git a/make.h b/make.h
index c7fc4b6a03e09db61a4726f2d29024d53f7c74d0..8ddbb94a015d0ffe664e115309e3e4302a23d0da 100644 (file)
--- a/make.h
+++ b/make.h
@@ -39,6 +39,11 @@ Boston, MA 02111-1307, USA.  */
 # define PARAMS(protos)  ()
 #endif /* C++ or ANSI C.  */
 
+/* Specify we want GNU source code.  This must be defined before any
+   system headers are included.  */
+
+#define _GNU_SOURCE 1
+
 /* Include libintl.h, if it was found: we don't even look for it unless we
    want to use the system's gettext().  If not, use the included gettext.h.  */
 
@@ -77,7 +82,6 @@ Boston, MA 02111-1307, USA.  */
 # define __NO_STRING_INLINES
 #endif
 
-#define _GNU_SOURCE 1
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
index 343a05e4d408f6ebc83542379f5743b0e0718204..d7d7102cd2a306260531e3d96c245b4b51d6abaf 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -1155,7 +1155,7 @@ f_mtime (file, search)
 
        FILE_TIMESTAMP adjusted_mtime = mtime;
 
-#if defined WINDOWS32 || defined _MSDOS__
+#if defined(WINDOWS32) || defined(__MSDOS__)
        FILE_TIMESTAMP adjustment;
 #ifdef WINDOWS32
        /* FAT filesystems round time to the nearest even second!
index d621d01e783ee264d5ac079a63400ce3761bf0f2..9c8e7fbdc05d2a22fffd551a47abf41b447db4dc 100644 (file)
@@ -1,3 +1,19 @@
+2000-06-19  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/functions/addsuffix: Test for an empty final argument.
+       Actually this bug might have happened for any function, but this
+       one was handy.
+
+2000-06-17  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * scripts/options/general: If parallel jobs are not supported,
+       expect a warning message from Make.
+
+2000-06-15  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * scripts/options/general: Don't try -jN with N != 1 if parallel
+       jobs are not supported.
+
 2000-05-24  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/options/general: Test general option processing (PR/1716).
index d150f07892fd4a79a64cec50bdeea60b4e4301fc..da4fbb71f5a497be89d809b262e28b7c23fe303f 100644 (file)
@@ -1,44 +1,36 @@
-$description = "The following test creates a makefile to test the addsuffix "
-              ."function.";
+#                                                                    -*-perl-*-
+$description = "Test the addsuffix function.";
 
 $details = "";
 
-# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
-# THE NAME OF THE MAKEFILE.  THIS INSURES CONSISTENCY AND KEEPS TRACK OF
-# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
-# EXAMPLE: $makefile2 = &get_tmpfile;
-
 
 open(MAKEFILE,"> $makefile");
 
 # The Contents of the MAKEFILE ...
 
-print MAKEFILE "string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks) \n"
-              ."all: \n"
-              ."\t\@echo \$(string) \n";
+print MAKEFILE <<EOMAKE;
+string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks)
+one: ; \@echo \$(string)
 
-# END of Contents of MAKEFILE
+two: ; \@echo \$(addsuffix foo,)
+EOMAKE
 
 close(MAKEFILE);
 
-&run_make_with_options($makefile,"",&get_logfile,0);
 
-# Create the answer to what should be produced by this Makefile
+# TEST 0
+
+&run_make_with_options($makefile, "", &get_logfile);
 $answer = "src${pathsep}a.b.z.foo.c hacks.c\n";
+&compare_output($answer,&get_logfile(1));
 
-# COMPARE RESULTS
 
-# In this call to compare output, you should use the call &get_logfile(1)
-# to send the name of the last logfile created.  You may also use
-# the special call &get_logfile(1) which returns the same as &get_logfile(1).
+# TEST 1
 
+&run_make_with_options($makefile, "two", &get_logfile);
+$answer = "\n";
 &compare_output($answer,&get_logfile(1));
 
+
 # This tells the test driver that the perl test script executed properly.
 1;
-
-
-
-
-
-
index ec7149a80d8a0f84b5de67da026f2aeefcb8ad1c..d35bb358dfe80b0ea6d10fc81c99a1935947b36c 100644 (file)
@@ -5,17 +5,21 @@ open(MAKEFILE, "> $makefile");
 
 # The Contents of the MAKEFILE ...
 
-print MAKEFILE "foo 5foo: ; \@echo \$\@\n";
+print MAKEFILE "foo 1foo: ; \@echo \$\@\n";
 
 close(MAKEFILE);
 
 # TEST 0
 
-&run_make_with_options($makefile, "-j 5foo", &get_logfile);
-$answer = "5foo\n";
-&compare_output($answer, &get_logfile(1));
+&run_make_with_options($makefile, "-j 1foo", &get_logfile);
+if (!$parallel_jobs) {
+  $answer = "$make_name: Parallel jobs (-j) are not supported on this platform.\n$make_name: Resetting to single job (-j1) mode.\n1foo\n";
+}
+else {
+  $answer = "1foo\n";
+}
 
-# TEST 0
+# TEST 1
 
 # This test prints the usage string; I don't really know a good way to
 # test it.  I guess I could invoke make with a known-bad option to see
@@ -24,7 +28,7 @@ $answer = "5foo\n";
 # If I were always on UNIX, I could invoke it with 2>/dev/null, then
 # just check the error code.
 
-&run_make_with_options($makefile, "-j5foo 2>/dev/null", &get_logfile, 512);
+&run_make_with_options($makefile, "-j1foo 2>/dev/null", &get_logfile, 512);
 $answer = "";
 &compare_output($answer, &get_logfile(1));