From 08f03e71bc70b5d2808d30765f21f8dd5c594014 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 14 Jun 2012 08:34:37 +0200 Subject: [PATCH] make: update to make-3.82 Signed-off-by: Stephan Raue --- packages/toolchain/devel/make/meta | 2 +- .../make-3.81-savannah_bug_18124.patch | 149 ----------- .../make-3.82-011-noclock_gettime.patch | 14 + .../make/patches/make-3.82-012-j8k.patch | 26 ++ .../make/patches/make-3.82-013-getcwd.patch | 14 + .../patches/make-3.82-014-err-reporting.patch | 157 +++++++++++ .../patches/make-3.82-016-weird-shell.patch | 16 ++ .../make/patches/make-3.82-017-newlines.patch | 30 +++ .../patches/make-3.82-018-jobserver.patch | 19 ++ .../make/patches/make-3.82-019-bugfixes.patch | 250 ++++++++++++++++++ .../patches/make-3.82-020-sort-blank.patch | 22 ++ .../make-3.82-021-copy-on-expand.patch | 77 ++++++ .../make-3.82-022-parallel-remake.patch | 30 +++ ...ake-3.82-023-warn_undefined_function.patch | 84 ++++++ .../make/patches/make-3.82-024-trace.patch | 111 ++++++++ .../make-3.82-025-expensive_glob.patch | 116 ++++++++ 16 files changed, 967 insertions(+), 150 deletions(-) delete mode 100644 packages/toolchain/devel/make/patches/make-3.81-savannah_bug_18124.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-011-noclock_gettime.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-012-j8k.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-013-getcwd.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-014-err-reporting.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-016-weird-shell.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-017-newlines.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-018-jobserver.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-019-bugfixes.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-020-sort-blank.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-021-copy-on-expand.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-022-parallel-remake.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-023-warn_undefined_function.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-024-trace.patch create mode 100644 packages/toolchain/devel/make/patches/make-3.82-025-expensive_glob.patch diff --git a/packages/toolchain/devel/make/meta b/packages/toolchain/devel/make/meta index 27672defc8..a89784ea6f 100644 --- a/packages/toolchain/devel/make/meta +++ b/packages/toolchain/devel/make/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="make" -PKG_VERSION="3.81" +PKG_VERSION="3.82" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/toolchain/devel/make/patches/make-3.81-savannah_bug_18124.patch b/packages/toolchain/devel/make/patches/make-3.81-savannah_bug_18124.patch deleted file mode 100644 index 47a86ba392..0000000000 --- a/packages/toolchain/devel/make/patches/make-3.81-savannah_bug_18124.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -Naur make-3.81-old/main.c make-3.81-new/main.c ---- make-3.81-old/main.c 2006-03-19 18:36:37.000000000 -0800 -+++ make-3.81-new/main.c 2010-10-16 08:28:29.000000000 -0700 -@@ -229,6 +229,7 @@ - - int job_fds[2] = { -1, -1 }; - int job_rfd = -1; -+static int jobserver_fds_invalid_flag = 0; - - /* Maximum load average at which multiple jobs will be run. - Negative values mean unlimited, while zero means limit to -@@ -416,6 +417,8 @@ - { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0, "what-if" }, - { CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0, - "warn-undefined-variables" }, -+ { CHAR_MAX+5, flag, (char *) &jobserver_fds_invalid_flag, 1, 1, 0, 0, 0, -+ "jobserver-fds-invalid" }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - -@@ -1648,20 +1651,26 @@ - - if (jobserver_fds) - { -- char *cp; -- unsigned int ui; -- -- for (ui=1; ui < jobserver_fds->idx; ++ui) -- if (!streq (jobserver_fds->list[0], jobserver_fds->list[ui])) -- fatal (NILF, _("internal error: multiple --jobserver-fds options")); -- -- /* Now parse the fds string and make sure it has the proper format. */ -- -- cp = jobserver_fds->list[0]; -+ /* Skip if jobserver-fds isn't valid. */ -+ if (!jobserver_fds_invalid_flag) -+ { -+ char *cp; -+ unsigned int ui; - -- if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2) -- fatal (NILF, -- _("internal error: invalid --jobserver-fds string `%s'"), cp); -+ for (ui=1; ui < jobserver_fds->idx; ++ui) -+ if (!streq (jobserver_fds->list[0], jobserver_fds->list[ui])) -+ fatal (NILF, _("internal error: multiple --jobserver-fds options")); -+ -+ /* Now parse the fds string and make sure it has the proper -+ format. */ -+ -+ cp = jobserver_fds->list[0]; -+ -+ if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2) -+ fatal (NILF, -+ _("internal error: invalid --jobserver-fds string `%s'"), -+ cp); -+ } - - /* The combination of a pipe + !job_slots means we're using the - jobserver. If !job_slots and we don't have a pipe, we can start -@@ -1676,11 +1685,15 @@ - /* Create a duplicate pipe, that will be closed in the SIGCHLD - handler. If this fails with EBADF, the parent has closed the pipe - on us because it didn't think we were a submake. If so, print a -- warning then default to -j1. */ -+ warning then default to -j1. - -- else if ((job_rfd = dup (job_fds[0])) < 0) -+ If jobserver_fds isn't valid, also print a warning then default -+ to -j1. */ -+ -+ else if (jobserver_fds_invalid_flag -+ || (job_rfd = dup (job_fds[0])) < 0) - { -- if (errno != EBADF) -+ if (!jobserver_fds_invalid_flag && errno != EBADF) - pfatal_with_name (_("dup jobserver")); - - error (NILF, -@@ -1690,8 +1703,13 @@ - - if (job_slots > 0) - { -- close (job_fds[0]); -- close (job_fds[1]); -+ /* Don't close job_fds if they aren't valid. Otherwise, we may -+ close the wrong files. */ -+ if (!jobserver_fds_invalid_flag) -+ { -+ close (job_fds[0]); -+ close (job_fds[1]); -+ } - job_fds[0] = job_fds[1] = -1; - free (jobserver_fds->list); - free (jobserver_fds); -@@ -1988,13 +2006,20 @@ - } - } - -- /* Add -o option for the stdin temporary file, if necessary. */ -- if (stdin_nm) -+ /* Add --jobserver-fds-invalid and -o option for the stdin -+ temporary file, if necessary. */ -+ if (stdin_nm || jobserver_fds_invalid_flag) - { -- nargv = (char **) xmalloc ((nargc + 2) * sizeof (char *)); -+ int count = 2; -+ if (stdin_nm && jobserver_fds_invalid_flag) -+ count++; -+ nargv = (char **) xmalloc ((nargc + count) * sizeof (char *)); - bcopy ((char *) argv, (char *) nargv, argc * sizeof (char *)); -- nargv[nargc++] = concat ("-o", stdin_nm, ""); -- nargv[nargc] = 0; -+ if (stdin_nm) -+ nargv[nargc++] = concat ("-o", stdin_nm, ""); -+ if (jobserver_fds_invalid_flag) -+ nargv[nargc++] = "--jobserver-fds-invalid"; -+ nargv[nargc] = 0; - } - - if (directories != 0 && directories->idx > 0) -@@ -2988,7 +3013,7 @@ - have written all our tokens so do that now. If tokens are left - after any other error code, that's bad. */ - -- if (job_fds[0] != -1 && jobserver_tokens) -+ if (job_fds[0] >= 0 && jobserver_tokens) - { - if (status != 2) - error (NILF, -@@ -3008,7 +3033,7 @@ - - /* Sanity: If we're the master, were all the tokens written back? */ - -- if (master_job_slots) -+ if (job_fds[0] >= 0 && master_job_slots) - { - /* We didn't write one for ourself, so start at 1. */ - unsigned int tcnt = 1; -@@ -3025,6 +3050,9 @@ - tcnt, master_job_slots); - - close (job_fds[0]); -+ -+ /* job_fds aren't valid now. */ -+ jobserver_fds_invalid_flag = 1; - } - } - diff --git a/packages/toolchain/devel/make/patches/make-3.82-011-noclock_gettime.patch b/packages/toolchain/devel/make/patches/make-3.82-011-noclock_gettime.patch new file mode 100644 index 0000000000..f63e1fc7cb --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-011-noclock_gettime.patch @@ -0,0 +1,14 @@ +diff -up make-3.82/configure\~ make-3.82/configure +--- make-3.82/configure~ 2010-07-28 07:41:51.000000000 +0200 ++++ make-3.82/configure 2010-08-11 15:07:50.000000000 +0200 +@@ -7215,7 +7215,7 @@ return clock_gettime (); + return 0; + } + _ACEOF +-for ac_lib in '' rt posix4; do ++for ac_lib in '' posix4; do + if test -z "$ac_lib"; then + ac_res="none required" + else + +Diff finished. Wed Aug 11 15:07:59 2010 diff --git a/packages/toolchain/devel/make/patches/make-3.82-012-j8k.patch b/packages/toolchain/devel/make/patches/make-3.82-012-j8k.patch new file mode 100644 index 0000000000..b5fa357777 --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-012-j8k.patch @@ -0,0 +1,26 @@ +diff -up make-3.82/main.c\~ make-3.82/main.c +--- make-3.82/main.c~ 2010-07-19 09:10:53.000000000 +0200 ++++ make-3.82/main.c 2010-08-11 15:12:09.000000000 +0200 +@@ -1765,6 +1765,20 @@ main (int argc, char **argv, char **envp + } + } + ++#ifdef PIPE_BUF ++ if (job_slots > PIPE_BUF) ++#elif defined _POSIX_PIPE_BUF ++ if (job_slots > _POSIX_PIPE_BUF) ++#else ++ if (job_slots > 512) ++#endif ++ { ++ error (NILF, ++ _("More parallel jobs (-jN) than this platform can handle requested.")); ++ error (NILF, _("Resetting to single job (-j1) mode.")); ++ job_slots = 1; ++ } ++ + /* If we have >1 slot but no jobserver-fds, then we're a top-level make. + Set up the pipe and install the fds option for our children. */ + + +Diff finished. Wed Aug 11 15:12:32 2010 diff --git a/packages/toolchain/devel/make/patches/make-3.82-013-getcwd.patch b/packages/toolchain/devel/make/patches/make-3.82-013-getcwd.patch new file mode 100644 index 0000000000..b688732edb --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-013-getcwd.patch @@ -0,0 +1,14 @@ +diff -up make-3.82/make.h\~ make-3.82/make.h +--- make-3.82/make.h~ 2010-07-20 15:12:06.000000000 +0200 ++++ make-3.82/make.h 2010-08-11 15:19:09.000000000 +0200 +@@ -472,7 +472,7 @@ long int lseek (); + #endif /* Not GNU C library or POSIX. */ + + #ifdef HAVE_GETCWD +-# if !defined(VMS) && !defined(__DECC) ++# if !defined(VMS) && !defined(__DECC) && !defined(getcwd) + char *getcwd (); + # endif + #else + +Diff finished. Wed Aug 11 15:19:12 2010 diff --git a/packages/toolchain/devel/make/patches/make-3.82-014-err-reporting.patch b/packages/toolchain/devel/make/patches/make-3.82-014-err-reporting.patch new file mode 100644 index 0000000000..2f5b3c638d --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-014-err-reporting.patch @@ -0,0 +1,157 @@ +diff -urp make-3.82/misc.c make-3.82-pm/misc.c +--- make-3.82/misc.c 2010-07-19 09:10:54.000000000 +0200 ++++ make-3.82-pm/misc.c 2010-08-11 15:26:45.000000000 +0200 +@@ -342,17 +342,31 @@ strerror (int errnum) + /* Print an error message from errno. */ + + void ++perror_with_name_err (const char *str, const char *name, int errnum) ++{ ++ error (NILF, _("%s%s: %s"), str, name, strerror (errnum)); ++} ++ ++void + perror_with_name (const char *str, const char *name) + { +- error (NILF, _("%s%s: %s"), str, name, strerror (errno)); ++ perror_with_name_err (str, name, errno); + } + + /* Print an error message from errno and exit. */ + + void ++pfatal_with_name_err (const char *name, int errnum) ++{ ++ fatal (NILF, _("%s: %s"), name, strerror (errnum)); ++ ++ /* NOTREACHED */ ++} ++ ++void + pfatal_with_name (const char *name) + { +- fatal (NILF, _("%s: %s"), name, strerror (errno)); ++ pfatal_with_name_err (name, errno); + + /* NOTREACHED */ + } +diff -urp make-3.82/main.c make-3.82-pm/main.c +--- make-3.82/main.c 2010-08-11 15:34:12.000000000 +0200 ++++ make-3.82-pm/main.c 2010-08-11 15:30:11.000000000 +0200 +@@ -1536,13 +1536,13 @@ main (int argc, char **argv, char **envp + strcat (template, DEFAULT_TMPFILE); + outfile = open_tmpfile (&stdin_nm, template); + if (outfile == 0) +- pfatal_with_name (_("fopen (temporary file)")); ++ pfatal_with_name_err (_("fopen (temporary file)"), errno); + while (!feof (stdin) && ! ferror (stdin)) + { + char buf[2048]; + unsigned int n = fread (buf, 1, sizeof (buf), stdin); + if (n > 0 && fwrite (buf, 1, n, outfile) != n) +- pfatal_with_name (_("fwrite (temporary file)")); ++ pfatal_with_name_err (_("fwrite (temporary file)"), errno); + } + fclose (outfile); + +@@ -1747,7 +1747,7 @@ main (int argc, char **argv, char **envp + else if ((job_rfd = dup (job_fds[0])) < 0) + { + if (errno != EBADF) +- pfatal_with_name (_("dup jobserver")); ++ pfatal_with_name_err (_("dup jobserver"), errno); + + error (NILF, + _("warning: jobserver unavailable: using -j1. Add `+' to parent make rule.")); +@@ -1788,7 +1788,7 @@ main (int argc, char **argv, char **envp + char c = '+'; + + if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0) +- pfatal_with_name (_("creating jobs pipe")); ++ pfatal_with_name_err (_("creating jobs pipe"), errno); + + /* Every make assumes that it always has one job it can run. For the + submakes it's the token they were given by their parent. For the +@@ -1803,7 +1803,7 @@ main (int argc, char **argv, char **envp + + EINTRLOOP (r, write (job_fds[1], &c, 1)); + if (r != 1) +- pfatal_with_name (_("init jobserver pipe")); ++ pfatal_with_name_err (_("init jobserver pipe"), errno); + } + + /* Fill in the jobserver_fds struct for our children. */ +@@ -2226,7 +2226,7 @@ main (int argc, char **argv, char **envp + /* If there is a temp file from reading a makefile from stdin, get rid of + it now. */ + if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT) +- perror_with_name (_("unlink (temporary file): "), stdin_nm); ++ perror_with_name_err (_("unlink (temporary file): "), stdin_nm, errno); + + /* If there were no command-line goals, use the default. */ + if (goals == 0) +Только в make-3.82-pm: job.c~ +Только в make-3.82-pm: main.c~ +diff -urp make-3.82/make.h make-3.82-pm/make.h +--- make-3.82/make.h 2010-08-11 15:34:12.000000000 +0200 ++++ make-3.82-pm/make.h 2010-08-11 15:31:26.000000000 +0200 +@@ -385,6 +385,8 @@ void die (int) __attribute__ ((noreturn) + void log_working_directory (int); + void pfatal_with_name (const char *) __attribute__ ((noreturn)); + void perror_with_name (const char *, const char *); ++void pfatal_with_name_err (const char *, int errnum) __attribute__ ((noreturn)); ++void perror_with_name_err (const char *, const char *, int errnum); + void *xmalloc (unsigned int); + void *xcalloc (unsigned int); + void *xrealloc (void *, unsigned int); +diff -urp make-3.82/job.c make-3.82-pm/job.c +--- make-3.82/job.c 2010-07-24 10:27:50.000000000 +0200 ++++ make-3.82-pm/job.c 2010-08-11 15:33:54.000000000 +0200 +@@ -917,7 +917,7 @@ free_child (struct child *child) + + EINTRLOOP (r, write (job_fds[1], &token, 1)); + if (r != 1) +- pfatal_with_name (_("write jobserver")); ++ pfatal_with_name_err (_("write jobserver"), errno); + + DB (DB_JOBS, (_("Released token for child %p (%s).\n"), + child, child->file->name)); +@@ -1768,6 +1768,7 @@ new_job (struct file *file) + + /* Set interruptible system calls, and read() for a job token. */ + set_child_handler_action_flags (1, waiting_jobs != NULL); ++ errno = 0; + got_token = read (job_rfd, &token, 1); + saved_errno = errno; + set_child_handler_action_flags (0, waiting_jobs != NULL); +@@ -1782,10 +1783,14 @@ new_job (struct file *file) + + /* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise, + go back and reap_children(), and try again. */ +- errno = saved_errno; +- if (errno != EINTR && errno != EBADF) +- pfatal_with_name (_("read jobs pipe")); +- if (errno == EBADF) ++ if (saved_errno != EINTR && saved_errno != EBADF) ++ { ++ if (got_token == 0) ++ fatal (NILF, _("read jobs pipe EOF")); ++ else ++ pfatal_with_name_err (_("read jobs pipe"), saved_errno); ++ } ++ if (saved_errno == EBADF) + DB (DB_JOBS, ("Read returned EBADF.\n")); + } + #endif +@@ -1909,7 +1914,8 @@ load_too_high (void) + error (NILF, + _("cannot enforce load limits on this operating system")); + else +- perror_with_name (_("cannot enforce load limit: "), "getloadavg"); ++ perror_with_name_err (_("cannot enforce load limit: "), ++ "getloadavg", errno); + } + lossage = errno; + load = 0; +Только в make-3.82-pm: make.h~ +Только в make-3.82-pm: misc.c.orig diff --git a/packages/toolchain/devel/make/patches/make-3.82-016-weird-shell.patch b/packages/toolchain/devel/make/patches/make-3.82-016-weird-shell.patch new file mode 100644 index 0000000000..dfdaf89c9e --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-016-weird-shell.patch @@ -0,0 +1,16 @@ +diff -up make-3.82/job.c\~ make-3.82/job.c +--- make-3.82/job.c~ 2010-08-11 16:13:33.000000000 +0200 ++++ make-3.82/job.c 2010-08-12 14:20:08.000000000 +0200 +@@ -2442,7 +2442,11 @@ construct_command_argv_internal (char *l + + /* See if it is safe to parse commands internally. */ + if (shell == 0) +- shell = default_shell; ++ { ++ shell = default_shell; ++ if (shellflags == 0) ++ shellflags = "-c"; ++ } + #ifdef WINDOWS32 + else if (strcmp (shell, default_shell)) + { diff --git a/packages/toolchain/devel/make/patches/make-3.82-017-newlines.patch b/packages/toolchain/devel/make/patches/make-3.82-017-newlines.patch new file mode 100644 index 0000000000..d86018ab4e --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-017-newlines.patch @@ -0,0 +1,30 @@ +diff -up make-3.82/job.c\~ make-3.82/job.c +--- make-3.82/job.c~ 2010-08-12 14:57:15.000000000 +0200 ++++ make-3.82/job.c 2010-08-12 14:58:23.000000000 +0200 +@@ -2876,7 +2876,7 @@ construct_command_argv_internal (char *l + } + + new_line = alloca (shell_len + 1 + sflags_len + 1 +- + (line_len*2) + 1); ++ + (line_len*4) + 1); + ap = new_line; + memcpy (ap, shell, shell_len); + ap += shell_len; +@@ -2904,13 +2904,14 @@ construct_command_argv_internal (char *l + #endif + if (PRESERVE_BSNL) + { +- *(ap++) = '\\'; ++ *(ap++) = '\''; + /* Only non-batch execution needs another backslash, + because it will be passed through a recursive + invocation of this function. */ + if (!batch_mode_shell) + *(ap++) = '\\'; + *(ap++) = '\n'; ++ *(ap++) = '\''; + } + ++p; + continue; + +Diff finished. Thu Aug 12 14:58:34 2010 diff --git a/packages/toolchain/devel/make/patches/make-3.82-018-jobserver.patch b/packages/toolchain/devel/make/patches/make-3.82-018-jobserver.patch new file mode 100644 index 0000000000..2a855031dd --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-018-jobserver.patch @@ -0,0 +1,19 @@ +diff -up make-3.82/main.c\~ make-3.82/main.c +--- make-3.82/main.c~ 2010-08-12 14:59:20.000000000 +0200 ++++ make-3.82/main.c 2010-08-12 15:00:07.000000000 +0200 +@@ -1756,8 +1756,11 @@ main (int argc, char **argv, char **envp + + if (job_slots > 0) + { +- close (job_fds[0]); +- close (job_fds[1]); ++ if (restarts == 0) ++ { ++ close (job_fds[0]); ++ close (job_fds[1]); ++ } + job_fds[0] = job_fds[1] = -1; + free (jobserver_fds->list); + free (jobserver_fds); + +Diff finished. Thu Aug 12 15:00:22 2010 diff --git a/packages/toolchain/devel/make/patches/make-3.82-019-bugfixes.patch b/packages/toolchain/devel/make/patches/make-3.82-019-bugfixes.patch new file mode 100644 index 0000000000..e89f14e0d5 --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-019-bugfixes.patch @@ -0,0 +1,250 @@ +diff -urpN make/ChangeLog make-new/ChangeLog +--- make/ChangeLog 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/ChangeLog 2010-09-13 13:42:09.000000000 +0200 +@@ -1,3 +1,22 @@ ++2010-08-13 Paul Smith ++ ++ * NEWS: Accidentally forgot to back out the sorted wildcard ++ enhancement in 3.82, so update NEWS. ++ Also add NEWS about the error check for explicit and pattern ++ targets in the same rule, added to 3.82. ++ ++ * main.c (main): Add "oneshell" to $(.FEATURES) (forgot to add ++ this in 3.82!) ++ ++ * read.c (parse_file_seq): Fix various errors parsing archives ++ with multiple objects in the parenthesis, as well as wildcards. ++ Fixes Savannah bug #30612. ++ ++2010-08-10 Paul Smith ++ ++ * main.c (main): Expand MAKEFLAGS before adding it to the ++ environment when re-exec'ing. Fixes Savannah bug #30723. ++ + 2010-07-28 Paul Smith + + Version 3.82 released. +diff -urpN make/main.c make-new/main.c +--- make/main.c 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/main.c 2010-09-13 13:42:12.000000000 +0200 +@@ -1138,7 +1138,7 @@ main (int argc, char **argv, char **envp + a macro and some compilers (MSVC) don't like conditionals in macros. */ + { + const char *features = "target-specific order-only second-expansion" +- " else-if shortest-stem undefine" ++ " else-if shortest-stem undefine oneshell" + #ifndef NO_ARCHIVES + " archives" + #endif +@@ -2093,7 +2093,7 @@ main (int argc, char **argv, char **envp + const char *pv = define_makeflags (1, 1); + char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1); + sprintf (p, "MAKEFLAGS=%s", pv); +- putenv (p); ++ putenv (allocated_variable_expand (p)); + } + + if (ISDB (DB_BASIC)) +diff -urpN make/NEWS make-new/NEWS +--- make/NEWS 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/NEWS 2010-09-13 13:42:11.000000000 +0200 +@@ -18,14 +18,6 @@ http://sv.gnu.org/bugs/index.php?group=m + * Compiling GNU make now requires a conforming ISO C 1989 compiler and + standard runtime library. + +-* WARNING: Future backward-incompatibility! +- Wildcards are not documented as returning sorted values, but up to and +- including this release the results have been sorted and some makefiles are +- apparently depending on that. In the next release of GNU make, for +- performance reasons, we may remove that sorting. If your makefiles +- require sorted results from wildcard expansions, use the $(sort ...) +- function to request it explicitly. +- + * WARNING: Backward-incompatibility! + The POSIX standard for make was changed in the 2008 version in a + fundamentally incompatible way: make is required to invoke the shell as if +@@ -42,6 +34,21 @@ http://sv.gnu.org/bugs/index.php?group=m + existing targets were provided in $?). + + * WARNING: Backward-incompatibility! ++ Wildcards were not documented as returning sorted values, but the results ++ have been sorted up until this release.. If your makefiles require sorted ++ results from wildcard expansions, use the $(sort ...) function to request ++ it explicitly. ++ ++* WARNING: Backward-incompatibility! ++ In previous versions of make it was acceptable to list one or more explicit ++ targets followed by one or more pattern targets in the same rule and it ++ worked "as expected". However, this was not documented as acceptable and if ++ you listed any explicit targets AFTER the pattern targets, the entire rule ++ would be mis-parsed. This release removes this ability completely: make ++ will generate an error message if you mix explicit and pattern targets in ++ the same rule. ++ ++* WARNING: Backward-incompatibility! + As a result of parser enhancements, three backward-compatibility issues + exist: first, a prerequisite containing an "=" cannot be escaped with a + backslash any longer. You must create a variable containing an "=" and +diff -urpN make/read.c make-new/read.c +--- make/read.c 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/read.c 2010-09-13 13:42:11.000000000 +0200 +@@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned + { + /* This looks like the first element in an open archive group. + A valid group MUST have ')' as the last character. */ +- const char *e = p + nlen; ++ const char *e = p; + do + { + e = next_token (e); +@@ -3084,19 +3084,19 @@ parse_file_seq (char **stringp, unsigned + Go to the next item in the string. */ + if (flags & PARSEFS_NOGLOB) + { +- NEWELT (concat (2, prefix, tp)); ++ NEWELT (concat (2, prefix, tmpbuf)); + continue; + } + + /* If we get here we know we're doing glob expansion. + TP is a string in tmpbuf. NLEN is no longer used. + We may need to do more work: after this NAME will be set. */ +- name = tp; ++ name = tmpbuf; + + /* Expand tilde if applicable. */ +- if (tp[0] == '~') ++ if (tmpbuf[0] == '~') + { +- tildep = tilde_expand (tp); ++ tildep = tilde_expand (tmpbuf); + if (tildep != 0) + name = tildep; + } +@@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned + else + { + /* We got a chain of items. Attach them. */ +- (*newp)->next = found; ++ if (*newp) ++ (*newp)->next = found; ++ else ++ *newp = found; + + /* Find and set the new end. Massage names if necessary. */ + while (1) +diff -urpN make/tests/ChangeLog make-new/tests/ChangeLog +--- make/tests/ChangeLog 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/tests/ChangeLog 2010-09-13 13:42:10.000000000 +0200 +@@ -1,3 +1,16 @@ ++2010-08-13 Paul Smith ++ ++ * scripts/features/archives: New regression tests for archive ++ support. Test for fix to Savannah bug #30612. ++ ++ * run_make_tests.pl (set_more_defaults): Set a %FEATURES hash to ++ the features available in $(.FEATURES). ++ ++2010-08-10 Paul Smith ++ ++ * scripts/features/reinvoke: Ensure command line variable settings ++ are preserved across make re-exec. Tests Savannah bug #30723. ++ + 2010-07-28 Paul Smith + + * scripts/targets/POSIX: Compatibility issues with Solaris (and +diff -urpN make/tests/run_make_tests.pl make-new/tests/run_make_tests.pl +--- make/tests/run_make_tests.pl 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/tests/run_make_tests.pl 2010-09-13 13:42:10.000000000 +0200 +@@ -29,6 +29,7 @@ + # You should have received a copy of the GNU General Public License along with + # this program. If not, see . + ++%FEATURES = (); + + $valgrind = 0; # invoke make with valgrind + $valgrind_args = ''; +@@ -367,6 +368,8 @@ sub set_more_defaults + $parallel_jobs = 1; + } + ++ %FEATURES = map { $_ => 1 } split /\s+/, `sh -c "echo '\\\$(info \\\$(.FEATURES))' | $make_path -f- 2>/dev/null"`; ++ + # Set up for valgrind, if requested. + + if ($valgrind) { +diff -urpN make/tests/scripts/features/archives make-new/tests/scripts/features/archives +--- make/tests/scripts/features/archives 1970-01-01 01:00:00.000000000 +0100 ++++ make-new/tests/scripts/features/archives 2010-09-13 13:42:10.000000000 +0200 +@@ -0,0 +1,42 @@ ++# -*-mode: perl-*- ++ ++$description = "Test GNU make's archive management features."; ++ ++$details = "\ ++This only works on systems that support it."; ++ ++# If this instance of make doesn't support archives, skip it ++exists $FEATURES{archives} or return -1; ++ ++# Create some .o files to work with ++utouch(-60, qw(a1.o a2.o a3.o)); ++ ++# Very simple ++run_make_test('all: libxx.a(a1.o)', ++ '', "ar rv libxx.a a1.o\nar: creating libxx.a\na - a1.o\n"); ++ ++# Multiple .o's. Add a new one to the existing library ++run_make_test('all: libxx.a(a1.o a2.o)', ++ '', "ar rv libxx.a a2.o\na - a2.o\n"); ++ ++# Touch one of the .o's so it's rebuilt ++utouch(-40, 'a1.o'); ++run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n"); ++ ++# Use wildcards ++run_make_test('all: libxx.a(*.o)', ++ '', "#MAKE#: Nothing to be done for `all'.\n"); ++ ++# Touch one of the .o's so it's rebuilt ++utouch(-30, 'a1.o'); ++run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n"); ++ ++# Use both wildcards and simple names ++utouch(-50, 'a2.o'); ++run_make_test('all: libxx.a(a3.o *.o)', '', ++ "ar rv libxx.a a3.o\na - a3.o\nar rv libxx.a a2.o\nr - a2.o\n"); ++ ++rmfiles(qw(a1.o a2.o a3.o libxx.a)); ++ ++# This tells the test driver that the perl test script executed properly. ++1; +diff -urpN make/tests/scripts/features/reinvoke make-new/tests/scripts/features/reinvoke +--- make/tests/scripts/features/reinvoke 2010-09-13 13:42:35.000000000 +0200 ++++ make-new/tests/scripts/features/reinvoke 2010-09-13 13:42:10.000000000 +0200 +@@ -57,9 +57,24 @@ include $(F)', + # Now try with the file we're not updating being the actual file we're + # including: this and the previous one test different parts of the code. + +-run_make_test(undef, "F=b", "[ -f b ] || echo >> b\nhello\n") ++run_make_test(undef, 'F=b', "[ -f b ] || echo >> b\nhello\n") + + &rmfiles('a','b','c'); + ++# Ensure command line variables are preserved properly across re-exec ++# Tests for Savannah bug #30723 ++ ++run_make_test(' ++ifdef RECURSE ++-include foo30723 ++endif ++recurse: ; @$(MAKE) -f $(MAKEFILE_LIST) RECURSE=1 test ++test: ; @echo F.O=$(F.O) ++foo30723: ; @touch $@ ++', ++ '--no-print-directory F.O=bar', "F.O=bar\n"); ++ ++unlink('foo30723'); ++ + # This tells the test driver that the perl test script executed properly. + 1; diff --git a/packages/toolchain/devel/make/patches/make-3.82-020-sort-blank.patch b/packages/toolchain/devel/make/patches/make-3.82-020-sort-blank.patch new file mode 100644 index 0000000000..7cfbbc079e --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-020-sort-blank.patch @@ -0,0 +1,22 @@ +diff -urp make-3.82/function.c make-3.82-pm/function.c +--- make-3.82/function.c 2010-07-13 03:20:39.000000000 +0200 ++++ make-3.82-pm/function.c 2010-10-27 01:43:27.000000000 +0200 +@@ -1138,12 +1138,12 @@ func_sort (char *o, char **argv, const c + { + char c = *(t++); + +- if (! isspace ((unsigned char)c)) ++ if (! isblank ((unsigned char)c)) + continue; + + ++wordi; + +- while (isspace ((unsigned char)*t)) ++ while (isblank ((unsigned char)*t)) + ++t; + } + +Только в make-3.82-pm: function.c~ +Двоичные файлы make-3.82/function.o и make-3.82-pm/function.o различаются +Двоичные файлы make-3.82/make и make-3.82-pm/make различаются +Только в make-3.82-pm: misc.c~ diff --git a/packages/toolchain/devel/make/patches/make-3.82-021-copy-on-expand.patch b/packages/toolchain/devel/make/patches/make-3.82-021-copy-on-expand.patch new file mode 100644 index 0000000000..55354ea56a --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-021-copy-on-expand.patch @@ -0,0 +1,77 @@ +From 2f661dc20617ba6fdeb2d7e243dc898653faafea Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Tue, 26 Apr 2011 21:50:26 +0200 +Subject: [PATCH] Always copy the string before expanding it + +It might get freed during expansion, e.g. with eval function. +A simple reproducer: + +TRUE = $(eval TRUE := true) +all: + $(TRUE) +--- + ChangeLog | 5 +++++ + expand.c | 18 +++++++++--------- + 2 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 91878fb..7519164 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2011-04-26 Lubomir Rintel ++ ++ * expand.c (variable_expand_string): Always copy the string ++ to expand. ++ + 2010-08-13 Paul Smith + + * NEWS: Accidentally forgot to back out the sorted wildcard +diff --git a/expand.c b/expand.c +index 2315b06..3e6e346 100644 +--- a/expand.c ++++ b/expand.c +@@ -197,7 +197,7 @@ variable_expand_string (char *line, const char *string, long length) + { + struct variable *v; + const char *p, *p1; +- char *abuf = NULL; ++ char *abuf; + char *o; + unsigned int line_offset; + +@@ -214,14 +214,15 @@ variable_expand_string (char *line, const char *string, long length) + + /* If we want a subset of the string, allocate a temporary buffer for it. + Most of the functions we use here don't work with length limits. */ +- if (length > 0 && string[length] != '\0') ++ if (length == -1) + { +- abuf = xmalloc(length+1); +- memcpy(abuf, string, length); +- abuf[length] = '\0'; +- string = abuf; ++ length = strlen (string); + } +- p = string; ++ ++ abuf = xmalloc(length+1); ++ memcpy(abuf, string, length); ++ abuf[length] = '\0'; ++ p = abuf; + + while (1) + { +@@ -411,8 +412,7 @@ variable_expand_string (char *line, const char *string, long length) + ++p; + } + +- if (abuf) +- free (abuf); ++ free (abuf); + + variable_buffer_output (o, "", 1); + return (variable_buffer + line_offset); +-- +1.7.4.1 + diff --git a/packages/toolchain/devel/make/patches/make-3.82-022-parallel-remake.patch b/packages/toolchain/devel/make/patches/make-3.82-022-parallel-remake.patch new file mode 100644 index 0000000000..ed601fbb5c --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-022-parallel-remake.patch @@ -0,0 +1,30 @@ +Index: main.c +=================================================================== +RCS file: /sources/make/make/main.c,v +retrieving revision 1.247 +retrieving revision 1.246 +diff -u -r1.247 -r1.246 +--- a/main.c 18 Sep 2011 23:39:26 -0000 1.247 ++++ b/main.c 29 Aug 2010 23:05:27 -0000 1.246 +@@ -2089,6 +2089,11 @@ + + ++restarts; + ++ /* If we're re-exec'ing the first make, put back the number of ++ job slots so define_makefiles() will get it right. */ ++ if (master_job_slots) ++ job_slots = master_job_slots; ++ + /* Reset makeflags in case they were changed. */ + { + const char *pv = define_makeflags (1, 1); +@@ -2830,9 +2825,6 @@ + && (*(unsigned int *) cs->value_ptr == + *(unsigned int *) cs->noarg_value)) + ADD_FLAG ("", 0); /* Optional value omitted; see below. */ +- else if (cs->c == 'j') +- /* Special case for `-j'. */ +- ADD_FLAG ("1", 1); + else + { + char *buf = alloca (30); diff --git a/packages/toolchain/devel/make/patches/make-3.82-023-warn_undefined_function.patch b/packages/toolchain/devel/make/patches/make-3.82-023-warn_undefined_function.patch new file mode 100644 index 0000000000..37566ce5ed --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-023-warn_undefined_function.patch @@ -0,0 +1,84 @@ +diff --git a/function.c b/function.c +index e2f6c8c..ff0527f 100644 +--- a/function.c ++++ b/function.c +@@ -2333,8 +2333,10 @@ func_call (char *o, char **argv, const char *funcname UNUSED) + v = lookup_variable (fname, flen); + + if (v == 0) +- warn_undefined (fname, flen); +- ++ { ++ warn_undefined (fname, flen); ++ warn_undefined_function (fname, flen); ++ } + if (v == 0 || *v->value == '\0') + return o; + +diff --git a/main.c b/main.c +index c6989e3..2f545a7 100644 +--- a/main.c ++++ b/main.c +@@ -275,6 +275,11 @@ static int print_usage_flag = 0; + + int warn_undefined_variables_flag; + ++/* If nonzero, we should print a warning message ++ for each attemtp to call an undefined user function. */ ++ ++int warn_undefined_functions_flag; ++ + /* If nonzero, always build all targets, regardless of whether + they appear out of date or not. */ + +@@ -368,6 +373,8 @@ static const char *const usage[] = + Consider FILE to be infinitely new.\n"), + N_("\ + --warn-undefined-variables Warn when an undefined variable is referenced.\n"), ++ N_("\ ++ --warn-undefined-functions Warn when an undefined user function is called.\n"), + NULL + }; + +@@ -424,6 +431,8 @@ static const struct command_switch switches[] = + { CHAR_MAX+5, flag, &warn_undefined_variables_flag, 1, 1, 0, 0, 0, + "warn-undefined-variables" }, + { CHAR_MAX+6, string, &eval_strings, 1, 0, 0, 0, 0, "eval" }, ++ { CHAR_MAX+7, flag, &warn_undefined_functions_flag, 1, 1, 0, 0, 0, ++ "warn-undefined-functions" }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } + }; + +diff --git a/make.h b/make.h +index 60ade4c..f2ebb56 100644 +--- a/make.h ++++ b/make.h +@@ -513,7 +513,7 @@ extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag; + extern int print_version_flag, print_directory_flag, check_symlink_flag; + extern int warn_undefined_variables_flag, posix_pedantic, not_parallel; + extern int second_expansion, clock_skew_detected, rebuilding_makefiles; +-extern int one_shell; ++extern int one_shell, warn_undefined_functions_flag; + + /* can we run commands via 'sh -c xxx' or must we use batch files? */ + extern int batch_mode_shell; +diff --git a/variable.h b/variable.h +index c215867..02713c1 100644 +--- a/variable.h ++++ b/variable.h +@@ -220,6 +220,13 @@ void undefine_variable_in_set (const char *name, unsigned int length, + (int)(l), (n)); \ + }while(0) + ++#define warn_undefined_function(n,l) do{\ ++ if (warn_undefined_functions_flag) \ ++ error (reading_file, \ ++ _("warning: undefined function `%.*s'"), \ ++ (int)(l), (n)); \ ++ }while(0) ++ + char **target_environment (struct file *file); + + struct pattern_var *create_pattern_var (const char *target, +-- +cgit v0.9.0.2-2-gbebe diff --git a/packages/toolchain/devel/make/patches/make-3.82-024-trace.patch b/packages/toolchain/devel/make/patches/make-3.82-024-trace.patch new file mode 100644 index 0000000000..b8cafa97b1 --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-024-trace.patch @@ -0,0 +1,111 @@ + +This patch add the support for --debug=c and --debug=e to make +this option when activated will trace in stdout the activity of $(call and $(eval in the Makefile + +The trace use the format: + ### xxx --> + ### xxx <-- +the number of space before ### is at least 1 and increase with the nesting of eval/call + +usage: make --debug=c,e + +diff -r -u make-3.82/debug.h make-3.82-lo_trace/debug.h +--- make-3.82/debug.h 2010-07-12 20:20:38.000000000 -0500 ++++ make-3.82-lo_trace/debug.h 2011-06-22 12:06:37.000000000 -0500 +@@ -21,6 +21,8 @@ + #define DB_JOBS (0x004) + #define DB_IMPLICIT (0x008) + #define DB_MAKEFILES (0x100) ++#define DB_CALL (0x01000) ++#define DB_EVAL (0x02000) + + #define DB_ALL (0xfff) + +diff -r -u make-3.82/function.c make-3.82-lo_trace/function.c +--- make-3.82/function.c 2011-06-23 01:01:35.000000000 -0500 ++++ make-3.82-lo_trace/function.c 2011-06-23 01:40:05.000000000 -0500 +@@ -28,6 +28,8 @@ + #include "amiga.h" + #endif + ++static int depth = 0; ++ + + struct function_table_entry + { +@@ -1371,7 +1373,12 @@ + + install_variable_buffer (&buf, &len); + ++ depth += 1; ++ DBS( DB_EVAL, ("### eval -->\n")); ++ DB( DB_EVAL, ("%s\n", argv[0])); + eval_buffer (argv[0]); ++ DBS( DB_EVAL, ("### eval <--\n")); ++ depth -= 1; + + restore_variable_buffer (buf, len); + +@@ -2338,6 +2345,7 @@ + if (v == 0 || *v->value == '\0') + return o; + ++ depth += 1; + body = alloca (flen + 4); + body[0] = '$'; + body[1] = '('; +@@ -2345,6 +2353,7 @@ + body[flen+2] = ')'; + body[flen+3] = '\0'; + ++ DBS(DB_CALL, ("### call %s -->\n", body)); + /* Set up arguments $(1) .. $(N). $(0) is the function name. */ + + push_new_variable_scope (); +@@ -2354,6 +2363,7 @@ + char num[11]; + + sprintf (num, "%d", i); ++ DBS(DB_CALL, ("### arg %i for call %s is '%s'\n", i, body, *argv)); + define_variable (num, strlen (num), *argv, o_automatic, 0); + } + +@@ -2367,6 +2377,7 @@ + char num[11]; + + sprintf (num, "%d", i); ++ DBS(DB_CALL, ("### arg %i for call %s is implicit\n", i, body)); + define_variable (num, strlen (num), "", o_automatic, 0); + } + +@@ -2377,7 +2388,14 @@ + + saved_args = max_args; + max_args = i; ++ + o = variable_expand_string (o, body, flen+3); ++ DBS(DB_CALL, ("### call to %s expended into\n", body)); ++ DB(DB_CALL, ("%s\n", o)); ++ DBS(DB_CALL, ("### call %s <--\n", body)); ++ ++ depth -= 1; ++ + max_args = saved_args; + + v->exp_count = 0; +diff -r -u make-3.82/main.c make-3.82-lo_trace/main.c +--- make-3.82/main.c 2010-07-19 02:10:53.000000000 -0500 ++++ make-3.82-lo_trace/main.c 2011-06-22 11:46:39.000000000 -0500 +@@ -634,6 +634,12 @@ + case 'b': + db_level |= DB_BASIC; + break; ++ case 'c': ++ db_level |= DB_CALL; ++ break; ++ case 'e': ++ db_level |= DB_EVAL; ++ break; + case 'i': + db_level |= DB_BASIC | DB_IMPLICIT; + break; diff --git a/packages/toolchain/devel/make/patches/make-3.82-025-expensive_glob.patch b/packages/toolchain/devel/make/patches/make-3.82-025-expensive_glob.patch new file mode 100644 index 0000000000..539b2e1f70 --- /dev/null +++ b/packages/toolchain/devel/make/patches/make-3.82-025-expensive_glob.patch @@ -0,0 +1,116 @@ +Index: read.c +=================================================================== +RCS file: /sources/make/make/read.c,v +retrieving revision 1.198 +retrieving revision 1.200 +diff -u -r1.198 -r1.200 +--- a/read.c 29 Apr 2011 15:27:39 -0000 1.198 ++++ b/read.c 7 May 2011 14:36:12 -0000 1.200 +@@ -2901,6 +2901,7 @@ + const char *name; + const char **nlist = 0; + char *tildep = 0; ++ int globme = 1; + #ifndef NO_ARCHIVES + char *arname = 0; + char *memname = 0; +@@ -3109,32 +3110,40 @@ + } + #endif /* !NO_ARCHIVES */ + +- switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl)) +- { +- case GLOB_NOSPACE: +- fatal (NILF, _("virtual memory exhausted")); +- +- case 0: +- /* Success. */ +- i = gl.gl_pathc; +- nlist = (const char **)gl.gl_pathv; +- break; +- +- case GLOB_NOMATCH: +- /* If we want only existing items, skip this one. */ +- if (flags & PARSEFS_EXISTS) +- { +- i = 0; +- break; +- } +- /* FALLTHROUGH */ +- +- default: +- /* By default keep this name. */ ++ /* glob() is expensive: don't call it unless we need to. */ ++ if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL) ++ { ++ globme = 0; + i = 1; + nlist = &name; +- break; +- } ++ } ++ else ++ switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl)) ++ { ++ case GLOB_NOSPACE: ++ fatal (NILF, _("virtual memory exhausted")); ++ ++ case 0: ++ /* Success. */ ++ i = gl.gl_pathc; ++ nlist = (const char **)gl.gl_pathv; ++ break; ++ ++ case GLOB_NOMATCH: ++ /* If we want only existing items, skip this one. */ ++ if (flags & PARSEFS_EXISTS) ++ { ++ i = 0; ++ break; ++ } ++ /* FALLTHROUGH */ ++ ++ default: ++ /* By default keep this name. */ ++ i = 1; ++ nlist = &name; ++ break; ++ } + + /* For each matched element, add it to the list. */ + while (i-- > 0) +@@ -3174,7 +3183,8 @@ + #endif /* !NO_ARCHIVES */ + NEWELT (concat (2, prefix, nlist[i])); + +- globfree (&gl); ++ if (globme) ++ globfree (&gl); + + #ifndef NO_ARCHIVES + if (arname) +Index: tests/scripts/functions/wildcard +=================================================================== +RCS file: /sources/make/make/tests/scripts/functions/wildcard,v +retrieving revision 1.6 +retrieving revision 1.7 +diff -u -r1.6 -r1.7 +--- a/tests/scripts/functions/wildcard 13 Jun 2009 21:21:49 -0000 1.6 ++++ b/tests/scripts/functions/wildcard 7 May 2011 14:36:11 -0000 1.7 +@@ -88,4 +88,16 @@ + !, + '', "\n"); + ++# TEST #5: wildcard used to verify file existence ++ ++touch('xxx.yyy'); ++ ++run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, ++ '', "file=xxx.yyy\n"); ++ ++unlink('xxx.yyy'); ++ ++run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, ++ '', "file=\n"); ++ + 1;