diff options
-rw-r--r-- | ChangeLog | 42 | ||||
-rw-r--r-- | README.DOS.template | 17 | ||||
-rw-r--r-- | arscan.c | 20 | ||||
-rw-r--r-- | config.h.W32.template | 15 | ||||
-rw-r--r-- | function.c | 35 | ||||
-rw-r--r-- | main.c | 38 | ||||
-rw-r--r-- | make.texinfo | 14 | ||||
-rw-r--r-- | remake.c | 8 | ||||
-rw-r--r-- | tests/ChangeLog | 15 | ||||
-rw-r--r-- | tests/scripts/features/double_colon | 40 | ||||
-rw-r--r-- | tests/scripts/features/reinvoke | 5 | ||||
-rw-r--r-- | tests/scripts/functions/strip | 8 | ||||
-rw-r--r-- | w32/subproc/sub_proc.c | 10 |
13 files changed, 213 insertions, 54 deletions
@@ -1,3 +1,45 @@ +2000-04-18 Paul D. Smith <psmith@gnu.org> + + * remake.c (f_mtime): If ar_member_date() returns -1 (the member + doesn't exist), then return (FILE_TIMESTAMP)-1 rather than + returning the timestamp calculated from the value -1. Fixes PR/1696. + Reported by Gilles Bourhis <Gilles.Bourhis@univ-rennes1.fr>. + +2000-04-17 Paul D. Smith <psmith@gnu.org> + + * config.h.W32.template: Add LOCALEDIR macro resolving to "". + * w32/subproc/sub_proc.c (process_begin): Remove reference to + debug_flag; change it to a DB() call. Fixes PR/1700. + Reported by Jim Smith <jwksmith@attglobal.net> + +2000-04-17 Bruno Haible <haible@clisp.cons.org> + + * arscan.c [BeOS]: Add replacement for nonexistent <ar.h> from GNU + binutils. + +2000-04-11 Paul D. Smith <psmith@gnu.org> + + * function.c (expand_builtin_function): If no arguments were + provided, just quit early rather than changing each function to + test for this. + (function_table[]): Change the min # of arguments to 0 for all + those functions for which it makes sense (currently everything + that used to take a minimum of 1 argument, except $(call ...)). + Fixes PR/1689. + +2000-04-09 Eli Zaretskii <eliz@is.elta.co.il> + + * README.DOS: Add instructions to install a binary distro. + Mention latest versions of Windows. + +2000-04-07 Eli Zaretskii <eliz@is.elta.co.il> + + * main.c (main): Rename TMP_TEMPLATE into DEFAULT_TMPDIR, and use + it for the directory of the temporary file. If P_tmpdir is + defined, use it in preference to "/tmp/". Try $TMPDIR, $TEMP, and + $TMP in the environment before defaulting to DEFAULT_TMPDIR. + (print_version): Add year 2000 to the Copyright line. + 2000-04-04 Paul D. Smith <psmith@gnu.org> * Version 3.79 released. diff --git a/README.DOS.template b/README.DOS.template index 4d78677..5218bb4 100644 --- a/README.DOS.template +++ b/README.DOS.template @@ -34,11 +34,22 @@ New (since 3.74) DOS-specific features: environment (requires Perl and auxiliary tools; see below). -To build: +To install a binary distribution: + + Simply unzip the makNNNb.zip file (where NNN is the version number) + preserving the directory structure (-d switch if you use PKUNZIP). + If you are installing Make on Windows 9X or Windows 2000, use an + unzip program that supports long filenames in zip files. After + unzipping, make sure the directory with make.exe is on your PATH, + and that's all you need to use Make. + + +To build from sources: 1. Unzip the archive, preserving the directory structure (-d switch - if you use PKUNZIP). If you build Make on Windows 95, use an - unzip program that supports long filenames in zip files. + if you use PKUNZIP). If you build Make on Windows 9X or Windows + 2000, use an unzip program that supports long filenames in zip + files. If you are unpacking an official GNU source distribution, use either DJTAR (which is part of the DJGPP development @@ -232,7 +232,25 @@ ar_scan (archive, function, arg) #endif #ifndef WINDOWS32 -# include <ar.h> +# ifndef __BEOS__ +# include <ar.h> +# else + /* BeOS 5 doesn't have <ar.h> but has archives in the same format + * as many other Unices. This was taken from GNU binutils for BeOS. + */ +# define ARMAG "!<arch>\n" /* String that begins an archive file. */ +# define SARMAG 8 /* Size of that string. */ +# define ARFMAG "`\n" /* String in ar_fmag at end of each header. */ +struct ar_hdr + { + char ar_name[16]; /* Member file name, sometimes / terminated. */ + char ar_date[12]; /* File date, decimal seconds since Epoch. */ + char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */ + char ar_mode[8]; /* File mode, in ASCII octal. */ + char ar_size[10]; /* File size, in ASCII decimal. */ + char ar_fmag[2]; /* Always contains ARFMAG. */ + }; +# endif #else /* These should allow us to read Windows (VC++) libraries (according to Frank * Libbrecht <frankl@abzx.belgium.hp.com>) diff --git a/config.h.W32.template b/config.h.W32.template index 9c1da1a..53c0e07 100644 --- a/config.h.W32.template +++ b/config.h.W32.template @@ -188,6 +188,21 @@ #undef SCCS_GET #define SCCS_GET "echo no sccs get" +/* Define to 1 if NLS is requested. */ +/* #undef ENABLE_NLS */ + +/* Define as 1 if you have dcgettext. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +/* #undef HAVE_GETTEXT */ + +/* Define if your locale.h file contains LC_MESSAGES. */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to the installation directory for locales. */ +#define LOCALEDIR "" + /* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* #undef SCCS_GET_MINUS_G */ @@ -1642,33 +1642,33 @@ static struct function_table_entry function_table[] = /* Name/size */ /* MIN MAX EXP? Function */ { STRING_SIZE_TUPLE("addprefix"), 2, 2, 1, func_addsuffix_addprefix}, { STRING_SIZE_TUPLE("addsuffix"), 2, 2, 1, func_addsuffix_addprefix}, - { STRING_SIZE_TUPLE("basename"), 1, 1, 1, func_basename_dir}, - { STRING_SIZE_TUPLE("dir"), 1, 1, 1, func_basename_dir}, - { STRING_SIZE_TUPLE("notdir"), 1, 1, 1, func_notdir_suffix}, + { STRING_SIZE_TUPLE("basename"), 0, 1, 1, func_basename_dir}, + { STRING_SIZE_TUPLE("dir"), 0, 1, 1, func_basename_dir}, + { STRING_SIZE_TUPLE("notdir"), 0, 1, 1, func_notdir_suffix}, { STRING_SIZE_TUPLE("subst"), 3, 3, 1, func_subst}, - { STRING_SIZE_TUPLE("suffix"), 1, 1, 1, func_notdir_suffix}, + { STRING_SIZE_TUPLE("suffix"), 0, 1, 1, func_notdir_suffix}, { STRING_SIZE_TUPLE("filter"), 2, 2, 1, func_filter_filterout}, { STRING_SIZE_TUPLE("filter-out"), 2, 2, 1, func_filter_filterout}, { STRING_SIZE_TUPLE("findstring"), 2, 2, 1, func_findstring}, - { STRING_SIZE_TUPLE("firstword"), 1, 1, 1, func_firstword}, + { STRING_SIZE_TUPLE("firstword"), 0, 1, 1, func_firstword}, { STRING_SIZE_TUPLE("join"), 2, 2, 1, func_join}, { STRING_SIZE_TUPLE("patsubst"), 3, 3, 1, func_patsubst}, - { STRING_SIZE_TUPLE("shell"), 1, 1, 1, func_shell}, - { STRING_SIZE_TUPLE("sort"), 1, 1, 1, func_sort}, - { STRING_SIZE_TUPLE("strip"), 1, 1, 1, func_strip}, - { STRING_SIZE_TUPLE("wildcard"), 1, 1, 1, func_wildcard}, + { STRING_SIZE_TUPLE("shell"), 0, 1, 1, func_shell}, + { STRING_SIZE_TUPLE("sort"), 0, 1, 1, func_sort}, + { STRING_SIZE_TUPLE("strip"), 0, 1, 1, func_strip}, + { STRING_SIZE_TUPLE("wildcard"), 0, 1, 1, func_wildcard}, { STRING_SIZE_TUPLE("word"), 2, 2, 1, func_word}, { STRING_SIZE_TUPLE("wordlist"), 3, 3, 1, func_wordlist}, - { STRING_SIZE_TUPLE("words"), 1, 1, 1, func_words}, - { STRING_SIZE_TUPLE("origin"), 1, 1, 1, func_origin}, + { STRING_SIZE_TUPLE("words"), 0, 1, 1, func_words}, + { STRING_SIZE_TUPLE("origin"), 0, 1, 1, func_origin}, { STRING_SIZE_TUPLE("foreach"), 3, 3, 0, func_foreach}, { STRING_SIZE_TUPLE("call"), 1, 0, 1, func_call}, - { STRING_SIZE_TUPLE("error"), 1, 1, 1, func_error}, - { STRING_SIZE_TUPLE("warning"), 1, 1, 1, func_error}, + { STRING_SIZE_TUPLE("error"), 0, 1, 1, func_error}, + { STRING_SIZE_TUPLE("warning"), 0, 1, 1, func_error}, { STRING_SIZE_TUPLE("if"), 2, 3, 0, func_if}, #ifdef EXPERIMENTAL { STRING_SIZE_TUPLE("eq"), 2, 2, 1, func_eq}, - { STRING_SIZE_TUPLE("not"), 1, 1, 1, func_not}, + { STRING_SIZE_TUPLE("not"), 0, 1, 1, func_not}, #endif { 0 } }; @@ -1688,6 +1688,13 @@ expand_builtin_function (o, argc, argv, entry_p) _("Insufficient number of arguments (%d) to function `%s'"), argc, entry_p->name); + /* I suppose technically some function could do something with no + arguments, but so far none do, so just test it for all functions here + rather than in each one. We can change it later if necessary. */ + + if (!argc) + return o; + if (!entry_p->func_ptr) fatal (reading_file, _("Unimplemented on this platform: function `%s'"), entry_p->name); @@ -1255,17 +1255,47 @@ int main (int argc, char ** argv) and thus re-read the makefiles, we read standard input into a temporary file and read from that. */ FILE *outfile; + char *template, *tmpdir; if (stdin_nm) fatal (NILF, _("Makefile from standard input specified twice.")); #ifdef VMS -# define TMP_TEMPLATE "sys$scratch:GmXXXXXX" +# define DEFAULT_TMPDIR "sys$scratch:" #else -# define TMP_TEMPLATE "/tmp/GmXXXXXX" +# ifdef P_tmpdir +# define DEFAULT_TMPDIR P_tmpdir +# else +# define DEFAULT_TMPDIR "/tmp" +# endif +#endif +#define DEFAULT_TMPFILE "GmXXXXXX" + + if (((tmpdir = getenv ("TMPDIR")) == NULL || *tmpdir == '\0') +#if defined __MSDOS__ || defined(WINDOWS32) + /* These are also used commonly on these platforms. */ + && ((tmpdir = getenv ("TEMP")) == NULL || *tmpdir == '\0') + && ((tmpdir = getenv ("TMP")) == NULL || *tmpdir == '\0') #endif + ) + tmpdir = DEFAULT_TMPDIR; + + template = (char *) alloca (strlen (tmpdir) + + sizeof (DEFAULT_TMPFILE) + 1); + strcpy (template, tmpdir); + +#if defined __MSDOS__ || defined(WINDOWS32) + if (strchr ("/\\", template[strlen (template) - 1]) == NULL) + strcat (template, "/"); +#else +#ifndef VMS + if (template[strlen (template) - 1] != '/') + strcat (template, "/"); +#endif /* !VMS */ +#endif /* __MSDOS__ || WINDOWS32 */ - outfile = open_tmpfile (&stdin_nm, TMP_TEMPLATE); + strcat (template, DEFAULT_TMPFILE); + outfile = open_tmpfile (&stdin_nm, template); if (outfile == 0) pfatal_with_name (_("fopen (temporary file)")); while (!feof (stdin)) @@ -2658,7 +2688,7 @@ print_version () printf (_(", by Richard Stallman and Roland McGrath.\n\ %sBuilt for %s\n\ -%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99\n\ +%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000\n\ %s\tFree Software Foundation, Inc.\n\ %sThis is free software; see the source for copying conditions.\n\ %sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ diff --git a/make.texinfo b/make.texinfo index 6b16027..7bbd1d2 100644 --- a/make.texinfo +++ b/make.texinfo @@ -6828,27 +6828,27 @@ first character is considered, and values must be comma- or space-separated. @table @code -@item a@var{ll} +@item a (@i{all}) All types of debugging output is enabled. This is equivalent to using @samp{-d}. -@item b@var{asic} +@item b (@i{basic}) Basic debugging prints each target that was found to be out-of-date, and whether the build was successful or not. -@item v@var{erbose} +@item v (@i{verbose}) A level above @samp{basic}; includes messages about which makefiles were parsed, prerequisites that did not need to be rebuilt, etc. This option also enables @samp{basic} messages. -@item i@var{mplicit} +@item i (@i{implicit}) Prints messages describing the implicit rule searches for each target. This option also enables @samp{basic} messages. -@item j@var{obs} +@item j (@i{jobs}) Prints messages giving details on the invocation of specific subcommands. -@item m@var{akefile} +@item m (@i{makefile}) By default, the above messages are not enabled while trying to remake the makefiles. This option enables messages while rebuilding makefiles, too. Note that the @samp{all} option does enable this option. This @@ -6956,6 +6956,8 @@ Some Files}.@refill @cindex @code{-p} @itemx --print-data-base @cindex @code{--print-data-base} +@cindex data base of @code{make} rules +@cindex predefined rules and variables, printing Print the data base (rules and variable values) that results from reading the makefiles; then execute as usual or as otherwise specified. This also prints the version information given by the @samp{-v} switch @@ -1038,6 +1038,7 @@ f_mtime (file, search) char *arname, *memname; struct file *arfile; + time_t memtime; int arname_used = 0; /* Find the archive's name. */ @@ -1097,7 +1098,12 @@ f_mtime (file, search) /* The archive doesn't exist, so it's members don't exist either. */ return (FILE_TIMESTAMP) -1; - mtime = FILE_TIMESTAMP_FROM_S_AND_NS (ar_member_date (file->hname), 0); + memtime = ar_member_date (file->hname); + if (memtime == (time_t) -1) + /* The archive member doesn't exist. */ + return (FILE_TIMESTAMP) -1; + + mtime = FILE_TIMESTAMP_FROM_S_AND_NS (memtime, 0); } else #endif diff --git a/tests/ChangeLog b/tests/ChangeLog index aca7225..5e3d72a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,18 @@ +2000-04-11 Paul D. Smith <psmith@gnu.org> + + * scripts/functions/strip: Test empty value to strip (PR/1689). + +2000-04-08 Eli Zaretskii <eliz@is.elta.co.il> + + * scripts/features/reinvoke: Sleep before updating the target + files in the first test, to ensure its time stamp really gets + newer; otherwise Make might re-exec more than once. + +2000-04-07 Eli Zaretskii <eliz@is.elta.co.il> + + * scripts/features/double_colon: Don't run the parallel tests if + parallel jobs aren't supported. + 2000-04-04 Paul D. Smith <psmith@gnu.org> * scripts/functions/word: wordlist doesn't swap arguments anymore. diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon index e0e53f0..3e140c7 100644 --- a/tests/scripts/features/double_colon +++ b/tests/scripts/features/double_colon @@ -51,9 +51,11 @@ $answer = "aaa\nbbb\n"; # TEST 1: As above, in parallel -&run_make_with_options($makefile, "-j10 all", &get_logfile, 0); -$answer = "aaa\nbbb\n"; -&compare_output($answer, &get_logfile(1)); +if ($parallel_jobs) { + &run_make_with_options($makefile, "-j10 all", &get_logfile, 0); + $answer = "aaa\nbbb\n"; + &compare_output($answer, &get_logfile(1)); +} # TEST 2: A simple double-colon rule that is the goal target @@ -63,9 +65,11 @@ $answer = "aaa\naaa done\nbbb\n"; # TEST 3: As above, in parallel -&run_make_with_options($makefile, "-j10 bar", &get_logfile, 0); -$answer = "aaa\naaa done\nbbb\n"; -&compare_output($answer, &get_logfile(1)); +if ($parallel_jobs) { + &run_make_with_options($makefile, "-j10 bar", &get_logfile, 0); + $answer = "aaa\naaa done\nbbb\n"; + &compare_output($answer, &get_logfile(1)); +} # TEST 4: Each double-colon rule is supposed to be run individually @@ -78,9 +82,11 @@ $answer = "f1.h\nfoo FIRST\n"; # TEST 5: Again, in parallel. -&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0); -$answer = "f1.h\nfoo FIRST\n"; -&compare_output($answer, &get_logfile(1)); +if ($parallel_jobs) { + &run_make_with_options($makefile, "-j10 foo", &get_logfile, 0); + $answer = "f1.h\nfoo FIRST\n"; + &compare_output($answer, &get_logfile(1)); +} # TEST 6: Each double-colon rule is supposed to be run individually @@ -94,9 +100,11 @@ $answer = "f2.h\nfoo SECOND\n"; # TEST 7: Again, in parallel. -&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0); -$answer = "f2.h\nfoo SECOND\n"; -&compare_output($answer, &get_logfile(1)); +if ($parallel_jobs) { + &run_make_with_options($makefile, "-j10 foo", &get_logfile, 0); + $answer = "f2.h\nfoo SECOND\n"; + &compare_output($answer, &get_logfile(1)); +} # TEST 8: Test circular dependency check; PR/1671 @@ -108,9 +116,11 @@ $answer = "ok\n$make_name: Circular d <- d dependency dropped.\noops\n"; # # Hmm... further testing indicates this might be timing-dependent? # -#&run_make_with_options($makefile, "-j10 biz", &get_logfile, 0); -#$answer = "aaa\ntwo\nbbb\n"; -#&compare_output($answer, &get_logfile(1)); +#if ($parallel_jobs) { +# &run_make_with_options($makefile, "-j10 biz", &get_logfile, 0); +# $answer = "aaa\ntwo\nbbb\n"; +# &compare_output($answer, &get_logfile(1)); +#} unlink('foo','f1.h','f2.h'); diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke index dacfd33..3e9ae66 100644 --- a/tests/scripts/features/reinvoke +++ b/tests/scripts/features/reinvoke @@ -18,6 +18,7 @@ all: ; \@echo 'running rules.' $makefile $makefile2: $makefile_orig \@echo 'rebuilding \$\@.' + \@sleep $wtime \@echo >> \$\@ include $makefile2 @@ -30,7 +31,7 @@ close(MAKEFILE); # Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second # granularity of file times. -sleep(2); +sleep($wtime); &touch("$makefile_orig"); @@ -67,7 +68,7 @@ close(MAKEFILE); &touch('b'); &touch('a'); -sleep(2); +sleep($wtime); &touch('c'); # First try with the file that's not updated "once removed" from the diff --git a/tests/scripts/functions/strip b/tests/scripts/functions/strip index 1f487c0..8222433 100644 --- a/tests/scripts/functions/strip +++ b/tests/scripts/functions/strip @@ -34,6 +34,8 @@ all: @echo '$(strip $(TEST2) )' @echo '$(strip $(TEST3) )' +space: ; @echo '$(strip ) $(strip )' + EOMAKE # END of Contents of MAKEFILE @@ -41,13 +43,15 @@ EOMAKE close(MAKEFILE); &run_make_with_options($makefile,"",&get_logfile); - -# Create the answer to what should be produced by this Makefile $answer = "\"Is this TERMINAL fun? What makes you believe is this terminal fun? JAPAN is a WONDERFUL planet -- I wonder if we will ever reach their level of COMPARATIVE SHOPPING...\" try this and this and these test out some blank lines "; +&compare_output($answer,&get_logfile(1)); + +&run_make_with_options($makefile,"space",&get_logfile); +$answer = " \n"; &compare_output($answer,&get_logfile(1)); 1; diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c index 1cf3bea..52f2fa2 100644 --- a/w32/subproc/sub_proc.c +++ b/w32/subproc/sub_proc.c @@ -7,11 +7,10 @@ #include "proc.h" #include "w32err.h" #include "config.h" +#include "debug.h" static char *make_command_line(char *shell_name, char *exec_path, char **argv); -extern int debug_flag; /* from make */ - typedef struct sub_process_t { int sv_stdin[2]; int sv_stdout[2]; @@ -506,10 +505,9 @@ process_begin( if (envblk) free(envblk); return -1; } else { - if (debug_flag) - printf("CreateProcess(%s,%s,...)\n", - exec_path ? exec_path : "NULL", - command_line ? command_line : "NULL"); + DB (DB_JOBS, ("CreateProcess(%s,%s,...)\n", + exec_path ? exec_path : "NULL", + command_line ? command_line : "NULL")); if (CreateProcess( exec_path, command_line, |