]> git.ipfire.org Git - thirdparty/make.git/log
thirdparty/make.git
5 years ago* configure.ac (guile): Check for Guile 3.0 installations
Paul Smith [Sun, 19 Jan 2020 20:25:33 +0000 (15:25 -0500)] 
* configure.ac (guile): Check for Guile 3.0 installations

5 years ago* src/job.c (sh_cmds): [SV 57625] Update builtin shell command list
Paul Smith [Sat, 18 Jan 2020 15:14:35 +0000 (10:14 -0500)] 
* src/job.c (sh_cmds): [SV 57625] Update builtin shell command list

5 years agoResolve some documentation issues
Paul Smith [Thu, 16 Jan 2020 20:14:53 +0000 (15:14 -0500)] 
Resolve some documentation issues

* doc/make.texi (Interrupts): [SV 46193] Recommend defensive recipes
* doc/make.texi: [SV 49262] Clarify interaction of prerequisites and
non-terminal match-anything rules.

5 years ago[SV 40657] Reinstate old behavior for suffix rules with prereqs
Paul Smith [Thu, 16 Jan 2020 18:49:07 +0000 (13:49 -0500)] 
[SV 40657] Reinstate old behavior for suffix rules with prereqs

POSIX says that suffix rules cannot have prerequisites, but after
making this change we observed a number of makefiles "in the wild"
that were relying on this behavior and failed.

For .POSIX: makefiles, obey POSIX.  Otherwise preserve the old
behavior.  However, generate a warning so users know this is a
problem.  In a future version we will change all behavior to be
POSIX-conforming.

* NEWS: describe the change
* src/rule.c (convert_to_pattern): If posix_pedantic don't make a
pattern rule if prereqs exist.  Otherwise show a warning.
* tests/scripts/features/suffixrules: Add tests for the new behavior
including .POSIX vs. non-.POSIX.

5 years ago* tests/test_driver.pl: Enhance error messages
Dmitry Goncharov [Sun, 5 Jan 2020 15:46:58 +0000 (10:46 -0500)] 
* tests/test_driver.pl: Enhance error messages

5 years ago* doc/make.texi: Change the GFDL to an Appendix
Paul Smith [Sat, 4 Jan 2020 18:11:21 +0000 (13:11 -0500)] 
* doc/make.texi: Change the GFDL to an Appendix

5 years ago* NEWS: Clarify authorship of new features.
Paul Smith [Sat, 4 Jan 2020 18:10:53 +0000 (13:10 -0500)] 
* NEWS: Clarify authorship of new features.

5 years agoEnable compilation with C90 compilers
Paul Smith [Fri, 3 Jan 2020 23:19:33 +0000 (18:19 -0500)] 
Enable compilation with C90 compilers

* configure.ac: Try compiling Guile headers: they don't work with C90.
* maintMakefile: Simplify config checks via target-specific variables.
* src/makeint.h: Use ATTRIBUTE rather than defining __attribute__,
as that causes compile issues with system headers.
(ENUM_BITFIELD): Don't use enum bitfields in ANSI mode.
* src/main.c: Use ATTRIBUTE instead of __attribute__.
* src/job.h: Ditto.
* src/file.c: Don't define variables inside for loops.
* src/rule.c: Ditto.
* src/dep.h (SI): Only use static inline in non-ANSI mode.

5 years ago* bootstrap: Update to the latest gnulib version
Paul Smith [Fri, 3 Jan 2020 20:44:13 +0000 (15:44 -0500)] 
* bootstrap: Update to the latest gnulib version

5 years agoRelease GNU make 4.2.93 4.2.93
Paul Smith [Fri, 3 Jan 2020 06:54:47 +0000 (01:54 -0500)] 
Release GNU make 4.2.93

* NEWS: Update the release and date
* configure.ac: Update the release number

5 years agoUpdate copyright statements for 2020
Paul Smith [Fri, 3 Jan 2020 05:13:02 +0000 (00:13 -0500)] 
Update copyright statements for 2020

5 years agoSupport the .EXTRA_PREREQS special variable
Paul Smith [Thu, 2 Jan 2020 10:08:06 +0000 (05:08 -0500)] 
Support the .EXTRA_PREREQS special variable

Initial implementation by Christof Warlich <cwarlich@gmx.de>

* NEWS: Announce the new feature.
* doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
* src/dep.h (struct dep): New flag to note extra prereq deps.
* src/filedef.h (expand_extra_prereqs): Declare a function to expand
the value of .EXTRA_PREREQS.
* src/file.c (expand_extra_prereqs): Given a struct variable lookup
of .EXTRA_PREREQS, convert it into a list of deps and for each one
make sure it has a struct file and has the new flag set.
(snap_file): A new function invoked by hash_map that will perform
per-file operations: set up second expansion, intermediate, and also
.EXTRA_PREREQS.  Manage circular dependencies by ignoring them.
(snap_deps): Defer per-file operations until the end.  Look up the
global .EXTRA_PREREQS and pass it along to snap_file for each file.
* src/implicit.c (struct patdeps): Remember the extra prereqs flag.
(pattern_search): Transfer extra prereqs flag settings into the
matched pattern rule.
* src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
snap_implicit_rules since we now do more than count.
* src/rule.c (snap_implicit_rules): As we walk through all the pattern
rules, add in any global .EXTRA_PREREQS to the dep list.  Ensure we
take them into account for the max number of prereqs and name length.
* src/main.c (main): Add extra-prereqs to .FEATURES.
Call the renamed snap_implicit_rules.
* tests/scripts/variables/EXTRA_PREREQS: Add tests.

5 years ago* tests/scripts/features/patternrules: Use Windows-compatible quoting
Paul Smith [Fri, 3 Jan 2020 07:07:38 +0000 (02:07 -0500)] 
* tests/scripts/features/patternrules: Use Windows-compatible quoting

5 years ago* tests/test_driver.pl: Compute full path to Perl interpreter
Paul Smith [Fri, 3 Jan 2020 06:53:47 +0000 (01:53 -0500)] 
* tests/test_driver.pl: Compute full path to Perl interpreter

5 years ago* tests/scripts/features/exec: Don't use $ENV in the description
Paul Smith [Fri, 3 Jan 2020 06:53:18 +0000 (01:53 -0500)] 
* tests/scripts/features/exec: Don't use $ENV in the description

5 years ago* src/makeint.h: Add a declaration for memrchr()
Paul Smith [Fri, 3 Jan 2020 06:52:46 +0000 (01:52 -0500)] 
* src/makeint.h: Add a declaration for memrchr()

5 years ago* NEWS: Remove info about disabled /proc/loadavg usage.
Paul Smith [Fri, 27 Dec 2019 06:42:25 +0000 (01:42 -0500)] 
* NEWS: Remove info about disabled /proc/loadavg usage.

5 years ago[SV 57022] Avoid posix_spawn which fails asynchronously
Paul Smith [Fri, 27 Dec 2019 06:27:09 +0000 (01:27 -0500)] 
[SV 57022] Avoid posix_spawn which fails asynchronously

Avoid using posix_spawn implementations that fail asynchronously when
the spawned program can't be invoked: this means instead of getting
an error such as "No such file or directory" we get just "Exit 127".

Original implementation of the configure.ac macro provided by
Martin Dorey <martin.dorey@hds.com>

Original implementation of the regression tests provided by
Dmitry Goncharov <dgoncharov@users.sf.net>

* configure.ac: Test whether posix_spawn fails asynchronously.  In a
cross-compilation environment, assume that it does not.  If we detect
that it does, fall back to fork/exec.
* tests/scripts/features/exec: Add regression tests for different
shebang invocation methods.

5 years ago[SV 56655] Allow pattern expansion to contain spaces
Paul Smith [Thu, 26 Dec 2019 23:39:56 +0000 (18:39 -0500)] 
[SV 56655] Allow pattern expansion to contain spaces

* src/dep.h: Add a new flag PARSEFS_ONEWORD
* src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the
entire incoming string as a single pattern.
* src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing
patterns for wildcards.
* tests/scripts/features/patternrules: Add a new test.

5 years ago* src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep()
Ben Wijen [Wed, 30 Oct 2019 06:33:39 +0000 (07:33 +0100)] 
* src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep()

5 years ago* bootstrap.bat: Fix typo in batch file name
Ben Wijen [Wed, 30 Oct 2019 06:33:21 +0000 (07:33 +0100)] 
* bootstrap.bat: Fix typo in batch file name

5 years ago* src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type
Paul Smith [Tue, 17 Dec 2019 20:26:06 +0000 (15:26 -0500)] 
* src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type

5 years ago[SV 54161] Fix second expansion of $* for paths
Jouke Witteveen [Sat, 26 Oct 2019 10:24:15 +0000 (12:24 +0200)] 
[SV 54161] Fix second expansion of $* for paths

If the stem matches a path containing a directory not just a
filename, make sure the second expansion of $* in the
prerequisites matches $* in the recipe.  This requires using
$(*F) when replacing % in the first expansion to preserve the
simple filename.

* src/implicit.c (pattern_search): If lastslash is set prepend
the directory onto the stem.  Then use $(*F) when expanding %.
* tests/scripts/features/se_implicit: Add a test case

5 years ago* src/implicit.c (pattern_search): Set lastslash correctly
Jouke Witteveen [Sat, 26 Oct 2019 10:24:29 +0000 (12:24 +0200)] 
* src/implicit.c (pattern_search): Set lastslash correctly

If filename contained multiple slashes lastslash is wrongly set to 0.
* configure.ac: Check for the GNU memrchr() extension function.
* src/misc.c (memrchr): Supply memrchr() if not available.

5 years ago* src/implicit.c (pattern-search): Remove unneeded 'dir' variable
Jouke Witteveen [Sat, 26 Oct 2019 10:24:09 +0000 (12:24 +0200)] 
* src/implicit.c (pattern-search): Remove unneeded 'dir' variable

5 years ago* Makefile.am: Build lzip package instead of bzip2
Paul Smith [Tue, 17 Dec 2019 18:36:26 +0000 (13:36 -0500)] 
* Makefile.am: Build lzip package instead of bzip2

* README.git: Mention changed requirements.

5 years ago* src/job.c (load_too_high): Disable Linux /proc/loadavg for now
Paul Smith [Tue, 17 Dec 2019 17:29:44 +0000 (12:29 -0500)] 
* src/job.c (load_too_high): Disable Linux /proc/loadavg for now

This new feature has a problem: if you provide a load which is
larger than the number of cores then it will always run every job.
Before we can enable it we need to at the least learn how to clamp
this value to the number of cores.  To experiment with it, set
PROC_FD_INIT to -2 in job.c to re-enable the feature.

5 years ago* tests/run_make_tests.pl (set_more_defaults): Fix typo
Paul Smith [Tue, 17 Dec 2019 19:58:53 +0000 (14:58 -0500)] 
* tests/run_make_tests.pl (set_more_defaults): Fix typo

5 years ago* tests/run_make_tests.pl (subst_make_string): Force use of /
Paul Smith [Mon, 16 Dec 2019 21:18:58 +0000 (16:18 -0500)] 
* tests/run_make_tests.pl (subst_make_string): Force use of /

On Windows the path to the helper tool will contain '\': this will
fail if recipes are run with a POSIX shell.  Convert '\' to '/'
on Windows.  While here, escape any spaces in the path as well.

5 years agoRename jhelp.pl to thelp.pl and make it a generic test helper.
Paul Smith [Sat, 12 Oct 2019 20:22:01 +0000 (16:22 -0400)] 
Rename jhelp.pl to thelp.pl and make it a generic test helper.

* tests/thelp.pl: Rename from tests/jhelp.pl.
(op): Use names instead of options for the operations.
(op): Add new operations for sleep, mkdir, and rm.
(op): Enhance wait to time out
* tests/run_make_tests.pl: Add a new #HELPER# replacement
(subst_make_string): Use fully-qualified path to thelp.pl
* tests/scripts/features/parallelism: Update to use thelp.pl
and the new named operations.  Use thelp.pl sleep instead of
system-specific sleep commands.
* tests/scripts/features/output-sync: Update to use thelp.pl
instead of complex shell scripts.
* Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl

5 years agoPort functions/shell test to Solaris 10
Paul Eggert [Tue, 8 Oct 2019 22:28:10 +0000 (15:28 -0700)] 
Port functions/shell test to Solaris 10

* tests/scripts/functions/shell: Port exit-status calculation
to Solaris 10 with Perl 5.8.4.

5 years agoRelease GNU make 4.2.92 4.2.92
Paul Smith [Tue, 8 Oct 2019 12:35:39 +0000 (08:35 -0400)] 
Release GNU make 4.2.92

* NEWS: Update the release and date
* configure.ac: Update the release number

6 years ago* doc/make.text (Reading Makefiles): Rewrite to be more clear.
Paul Smith [Sun, 6 Oct 2019 19:47:47 +0000 (15:47 -0400)] 
* doc/make.text (Reading Makefiles): Rewrite to be more clear.

6 years ago* Makefile.am (check-regression): Use PERLFLAGS when running Perl
Paul Smith [Sat, 5 Oct 2019 19:14:32 +0000 (15:14 -0400)] 
* Makefile.am (check-regression): Use PERLFLAGS when running Perl

* maintMakefile: Set PERLFLAGS to enable warnings.
* tests/run_make_tests.pl: Clean up issues pointed out by perl -w.

6 years ago* tests/scripts/functions/wildcard: Skip slash tests for local glob.
Paul Smith [Sat, 5 Oct 2019 18:45:45 +0000 (14:45 -0400)] 
* tests/scripts/functions/wildcard: Skip slash tests for local glob.

6 years agotests: Convert %CONFIG_FLAGS to get_config()
Paul Smith [Sat, 5 Oct 2019 18:26:52 +0000 (14:26 -0400)] 
tests: Convert %CONFIG_FLAGS to get_config()

* tests/config-flags.pm.W32: Create a predefined Windows file.
* Makefile.am (test_FILES): Add it to the distribution.
* build_w32.bat: Install tests/config-flags.pm if not existing.
* tests/run_make_tests.pl (get_config): Create new function.
* tests/scripts/features/archives: Call get_config() rather than
using %CONFIG_FLAGS directly.
* tests/scripts/features/load: Ditto.
* tests/scripts/features/loadapi: Ditto.
* tests/scripts/functions/wildcard: Ditto.

6 years ago* src/hash.c (jhash_string): Don't read past end of string.
Paul Smith [Sat, 5 Oct 2019 15:23:31 +0000 (11:23 -0400)] 
* src/hash.c (jhash_string): Don't read past end of string.

Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.

6 years ago* tests/run_make_tests.pl (valid_option): Add missing File::Spec
Paul Smith [Sat, 5 Oct 2019 11:43:52 +0000 (07:43 -0400)] 
* tests/run_make_tests.pl (valid_option): Add missing File::Spec

6 years ago* src/function.c (func_realpath) [AIX]: Remove trailing slashes.
Paul Smith [Mon, 23 Sep 2019 04:34:12 +0000 (00:34 -0400)] 
* src/function.c (func_realpath) [AIX]: Remove trailing slashes.

6 years ago* tests/scripts/features/vpathplus: Fix output for big-endian systems.
Paul Smith [Sun, 22 Sep 2019 21:35:51 +0000 (17:35 -0400)] 
* tests/scripts/features/vpathplus: Fix output for big-endian systems.

Our hashing algorithm gives different ordering on LE vs BE systems.
Patch from Dmitry Goncharov <dgoncharov@users.sf.net>.

6 years ago* configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.
Florian Weimer [Tue, 10 Sep 2019 11:33:34 +0000 (13:33 +0200)] 
* configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.

Copyright-paperwork-exempt: yes

6 years ago* test/test_driver.el (_run_with_timeout): Show error message.
Paul Smith [Sun, 22 Sep 2019 21:03:05 +0000 (17:03 -0400)] 
* test/test_driver.el (_run_with_timeout): Show error message.

6 years ago* job.c (child_error): Modify error message string.
Paul Smith [Sun, 22 Sep 2019 21:02:57 +0000 (17:02 -0400)] 
* job.c (child_error): Modify error message string.

This reverts commit 6264deece3bb77798240a906ceed79097adbcf48.
Further investigation discovers that the real issue is that
GNU Emacs compile mode doesn't have a matching regex for GNU
make error messages generated when targets fail.  I submitted
a patch to GNU Emacs adding a matcher for compile mode.

6 years ago* tests: Convert from File::Spec::Functions to File::Spec.
Paul Smith [Sat, 21 Sep 2019 20:37:56 +0000 (16:37 -0400)] 
* tests: Convert from File::Spec::Functions to File::Spec.

Users report the Functions version doesn't work correctly for some
older versions of Perl.

6 years ago* tests/scripts/function/guile: Valgrind doesn't work with Guile.
Paul Smith [Sat, 21 Sep 2019 19:38:01 +0000 (15:38 -0400)] 
* tests/scripts/function/guile: Valgrind doesn't work with Guile.

6 years ago* src/job.c (child_execute_job): Allocate space for argv NULL.
Paul Smith [Sat, 21 Sep 2019 19:11:42 +0000 (15:11 -0400)] 
* src/job.c (child_execute_job): Allocate space for argv NULL.

6 years ago[SV 56918] Compute job slots properly on failing command
Paul Smith [Sat, 21 Sep 2019 19:11:21 +0000 (15:11 -0400)] 
[SV 56918] Compute job slots properly on failing command

Ensure we properly reduce job_slots_used if a command fails because
it doesn't exist/can't be started.

* src/job.h (struct child): Add a field jobslot to be set when using
a job slot.
* src/job.c (start_waiting_job): Remember if we are using a job slot.
(reap_children): Reduce number of job slots used by jobslot.

6 years ago* src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode.
Paul Smith [Sat, 21 Sep 2019 18:01:46 +0000 (14:01 -0400)] 
* src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode.

6 years ago* tests/scripts/functions/shell: Detect correct SHELLSTATUS code.
Paul Smith [Sat, 21 Sep 2019 18:01:19 +0000 (14:01 -0400)] 
* tests/scripts/functions/shell: Detect correct SHELLSTATUS code.

6 years ago* tests/run_make_test.pl: Fix support for valgrind.
Paul Smith [Sat, 21 Sep 2019 16:39:51 +0000 (12:39 -0400)] 
* tests/run_make_test.pl: Fix support for valgrind.

Change the variable holding the make command to be a list that can
hold extra commands and options, not just a string.

6 years ago* tests/run_make_tests.pl (find_prog): Fix syntax error.
Paul Smith [Sat, 21 Sep 2019 16:39:07 +0000 (12:39 -0400)] 
* tests/run_make_tests.pl (find_prog): Fix syntax error.

6 years ago* NEWS: Update date and clarify -l change. 4.2.91
Paul Smith [Mon, 16 Sep 2019 12:24:51 +0000 (08:24 -0400)] 
* NEWS: Update date and clarify -l change.

6 years ago* tests/run_make_tests.pl: Create $scriptsuffix for Windows/VMS.
Paul Smith [Sun, 15 Sep 2019 20:39:22 +0000 (16:39 -0400)] 
* tests/run_make_tests.pl: Create $scriptsuffix for Windows/VMS.

* tests/scripts/features/targetvars: Add a suffix to scripts.
* tests/scripts/misc/general4: Ditto.

6 years agoRefresh the test suite framework implementation.
Paul Smith [Sun, 15 Sep 2019 19:30:34 +0000 (15:30 -0400)] 
Refresh the test suite framework implementation.

Go through both run_make_tests.pl and test_driver.pl and slightly
modernize the Perl and clean up indentation etc.  Fix a number of
warnings in the test scripts detected by running with -w.

* tests/test_driver.pl: Move make error string detection out of the
base test driver.
(run_all_tests): Ensure that we always look for tests in the cwd.
* tests/run_make_tests.pl: Use File::Spec for path manipulations.
Correctly use setlocale() when detecting error strings.
Get configuration from the config-flags.pm file not config.status.
* tests/scripts/features/archives: Use new $cwddir variable.
* tests/scripts/features/reinvoke: Add missing semicolon.
* tests/scripts/features/vpath2: Avoid non-existent variable.
* tests/scripts/functions/foreach: Escape variables.
* tests/scripts/misc/bs-nl: Remove non-existing \v escape sequence.
* tests/scripts/misc/general4: Use handy create_file().
* tests/scripts/options/dash-C: Use Cwd/$cwddir.
* tests/scripts/options/dash-I: Use subst_make_string() and #PWD#.
* tests/scripts/options/symlinks: Use File::Spec.
* tests/scripts/targets/DEFAULT: Use create_file and run_make_test.
* tests/scripts/variables/CURDIR: Use run_make_test.
* tests/scripts/variables/automatic: Remove extraneous "\".
* tests/scripts/vms/library: Remove extra "my" and extraneous "\".

6 years ago* tests/config-flags.pm.in: Add USE_SYSTEM_GLOB.
Paul Smith [Sun, 15 Sep 2019 19:29:12 +0000 (15:29 -0400)] 
* tests/config-flags.pm.in: Add USE_SYSTEM_GLOB.

* tests/config_flags_pm.com [VMS]: Ditto.

6 years ago* README.git: [SV 56895] Provide more info about "maintainer mode".
Paul Smith [Sun, 15 Sep 2019 19:26:23 +0000 (15:26 -0400)] 
* README.git: [SV 56895] Provide more info about "maintainer mode".

* src/read.c (get_next_mword) [HAVE_DOS_PATHS]: Don't fall through to
parsing variable references if we find a drivespec in a word!

6 years ago* tests/test_driver.pl: Remember error for "running" a directory.
Paul Smith [Sat, 14 Sep 2019 19:58:57 +0000 (15:58 -0400)] 
* tests/test_driver.pl: Remember error for "running" a directory.

* tests/scripts/features/errors: Check errors "running" a directory.

6 years ago* src/job.c (child_execute_job): Use errno from find_in_given_path().
Paul Smith [Sat, 14 Sep 2019 19:41:58 +0000 (15:41 -0400)] 
* src/job.c (child_execute_job): Use errno from find_in_given_path().

* tests/test_driver.pl: Determine non-executable error message.
* tests/scripts/features/errors: Use the local non-executable error.

6 years ago* src/job.c (child_execute_job): Use newer gnulib findprog version.
Paul Smith [Fri, 13 Sep 2019 23:56:20 +0000 (19:56 -0400)] 
* src/job.c (child_execute_job): Use newer gnulib findprog version.

6 years agoRevert "[SV 56449] (Windows) Use slow path if '%' appears in the command"
Eli Zaretskii [Tue, 10 Sep 2019 16:09:39 +0000 (19:09 +0300)] 
Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command"

This reverts commit 38e96eadea6e2cd42a0f414959bac327de9f468a.
Per discussion on Savannah, the modified behavior matches
the way % is handled in batch files, but not in cmd command
lines.  And since Make mostly tries to emulate the command
line, the new behavior is unexpected and backward-incompatible.

6 years agoRework the creation of build.sh so it's not a template.
Paul Smith [Sun, 8 Sep 2019 19:41:20 +0000 (15:41 -0400)] 
Rework the creation of build.sh so it's not a template.

* build.sh: Rename from build.template.  Get the list of objects
from the Makefile.  Move configure-replaced variables ...
* build.cfg.in: to this new .in file.
* configure.ac: Remove special handling of build.sh.in and add
build.cfg as a generated file.
* Makefile.am (EXTRA_DIST): Remove build.sh.in and add build.sh
and build.cfg.in for build.sh.in.
* maintMakefile: Remove handling for build.template.  Treat
build.sh as a source file, not a generated file.
* .gitignore: Ignore generated build.cfg file.

6 years ago* gl/modules/make-glob: Move local glob configure.ac to here
Paul Smith [Sun, 8 Sep 2019 19:17:06 +0000 (15:17 -0400)] 
* gl/modules/make-glob: Move local glob configure.ac to here

* configure.ac: from here.

6 years ago[SV 56834] Support local PATH search with posix_spawnp
Paul Smith [Sat, 7 Sep 2019 02:24:46 +0000 (22:24 -0400)] 
[SV 56834] Support local PATH search with posix_spawnp

When using exec we install the child's environment before invoking
execlp(), so commands are found on the child's PATH.  posix_spawnp
searches on the parent's PATH, which we don't want.

Import gnulib's findprog-in module and use it to search the child's
PATH, then use posix_spawn() to run it.

Also, posix_spawn() does not fall back to trying sh on ENOEXEC, as
execlp() does, so implement that as well.

* bootstrap.conf: Add the findprog-in gnulib module
* src/job.c: Include findprog.h if we're using posix_spawn.
(start_job_command): Remove the handling of child->cmd_name,
(child_execute_job): and add it here.  Look up the command to be
run in the child's path and invoke it if found.  If it fails with
ENOEXEC then retry it as an argument to the default shell.
* tests/scripts/misc/general4: Test makefile PATH assignments.
* tests/scripts/features/targetvars: Ditto, for target variables.

6 years ago* doc/make.texi (Recipe Execution): Correct example to use $(<[DF])
Paul Smith [Sun, 8 Sep 2019 00:08:43 +0000 (20:08 -0400)] 
* doc/make.texi (Recipe Execution): Correct example to use $(<[DF])

6 years ago* configure.ac: Check whether struct dirent has a d_type field
Paul Smith [Sat, 7 Sep 2019 20:59:46 +0000 (16:59 -0400)] 
* configure.ac: Check whether struct dirent has a d_type field

* src/dir.c (dir_contents_file_exists_p): Use the autoconf macro
HAVE_STRUCT_DIRENT_D_TYPE rather than relying on the GNU libc-
specific _DIRENT_HAVE_D_TYPE.
* lib/glob.c: Set HAVE_D_TYPE if HAVE_STRUCT_DIRENT_D_TYPE.

6 years ago* src/config.h.W32.template [W32]: Add support for dirent.d_type
Paul Smith [Sat, 7 Sep 2019 22:27:50 +0000 (18:27 -0400)] 
* src/config.h.W32.template [W32]: Add support for dirent.d_type

* src/w32/include/dirent.h: Add DT_* values for dirent.d_type
(struct dirent): Add d_type
* src/w32/compat/durent.c (readdir): Set dirent.d_type based on
Windows file attributes.

6 years ago* src/makeint.h: Add typedef for mode_t if !HAVE_UMASK
Paul Smith [Sat, 7 Sep 2019 18:52:38 +0000 (14:52 -0400)] 
* src/makeint.h: Add typedef for mode_t if !HAVE_UMASK

6 years ago* build.template: Rewrite to allow gnulib support.
Paul Smith [Sat, 7 Sep 2019 16:12:41 +0000 (12:12 -0400)] 
* build.template: Rewrite to allow gnulib support.

6 years ago* doc/make.texi: Clarify that the jobserver pipe is "blocking"
Paul Smith [Sat, 7 Sep 2019 01:18:48 +0000 (21:18 -0400)] 
* doc/make.texi: Clarify that the jobserver pipe is "blocking"

6 years agoAlign child_execute_job among different ports
Paul Smith [Sat, 7 Sep 2019 00:56:19 +0000 (20:56 -0400)] 
Align child_execute_job among different ports

Create a struct childbase which is the basics of struct child needed
to invoke child_execute_job(), and can be cast back and forth to a
struct child.  Ensure all implementations of child_execute_job() take
the same arguments.

* src/job.h (CHILDBASE): Create a macro to hold the base parts.
(struct childbase): A structure containing CHILDBASE.
(struct child): Use CHILDBASE as the initial part of child.
[VMS]: Remove declaration of VMS version of child_execute_job.
* src/job.c (start_job_command): Use new child_execute_job() call.
(child_execute_job) [__EMX__]: Implement new calling signature.
(child_execute_job): Implement new calling signature.
* src/main.c (main) [__EMX__]: Use new child_execute_job() call.
* src/function.c (func_shell_base): Use new child_execute_job() call.
* src/vmsjobs.c (vmsHandleChildTerm): Accept struct childbase.
* src/vmsjobs.c (child_execute_job): Implement new calling signature.
Modify the return value to be pid_t, not a boolean, and return the
PID rather than setting it in the child.  This is OK because our only
caller immediately reset PID to -1 anyway if we return 0.

6 years ago* doc/make.tex (Substitution Refs): Clarify patsubst relationship.
Paul Smith [Tue, 3 Sep 2019 20:28:36 +0000 (16:28 -0400)] 
* doc/make.tex (Substitution Refs): Clarify patsubst relationship.

6 years ago* src/job.c (start_job_command) [VMS]: Correct VMS comment.
Paul Smith [Tue, 3 Sep 2019 20:18:49 +0000 (16:18 -0400)] 
* src/job.c (start_job_command) [VMS]: Correct VMS comment.

6 years agoShow useful errors when posix_spawn() doesn't do so
Paul Smith [Tue, 3 Sep 2019 20:17:50 +0000 (16:17 -0400)] 
Show useful errors when posix_spawn() doesn't do so

The posix_spawn() function may not detect that the command to run is
invalid when it's invoked.  Instead, it will run then exit with
error code 127.  If that happens do our best to present the user
with a useful error message.

* src/job.h (struct child): Add cmd_name to hold the command we ran.
* src/job.c (start_job_command): On success, remember the cmd_name.
(reap_children): On exit 127, stat cmd_name and show a useful error.
(free_child): Free cmd_name.

6 years ago* README.git: Describe GCC and GNU make requirements
Paul Smith [Tue, 3 Sep 2019 16:24:54 +0000 (12:24 -0400)] 
* README.git: Describe GCC and GNU make requirements

* maintMakefile: Put custom C flags into a separate variable
so they can be overridden more easily on the command line.

6 years ago* tests/scripts/features/archives: Fix expected long ar name output.
Paul Smith [Tue, 3 Sep 2019 04:26:05 +0000 (00:26 -0400)] 
* tests/scripts/features/archives: Fix expected long ar name output.

6 years ago* tetss/run_make_test.pl: Avoid 'sh -c' for Windows portability.
Paul Smith [Tue, 3 Sep 2019 04:09:51 +0000 (00:09 -0400)] 
* tetss/run_make_test.pl: Avoid 'sh -c' for Windows portability.

6 years agoUpdate to GNU make release candidate 4.2.91
Paul Smith [Tue, 3 Sep 2019 03:27:53 +0000 (23:27 -0400)] 
Update to GNU make release candidate 4.2.91

6 years ago* tests/scripts/functions/wildcard: Skip dangling symlink test.
Paul Smith [Tue, 3 Sep 2019 03:51:10 +0000 (23:51 -0400)] 
* tests/scripts/functions/wildcard: Skip dangling symlink test.

The built-in glob implementation does not correctly handle dangling
symlinks.  This needs to be fixed by switching to the latest glob
implementation from gnulib but that's a big job: for now avoid the
test if we know it will fail.

6 years ago* maintMakefile: Use check-local when testing build.sh.
Paul Smith [Tue, 3 Sep 2019 03:26:38 +0000 (23:26 -0400)] 
* maintMakefile: Use check-local when testing build.sh.

Running 'make check' will rebuild 'make' so we're not testing the
build.sh-generated make binary.

6 years agoDon't reset stack size when using posix_spawn()
Paul Smith [Tue, 3 Sep 2019 03:03:27 +0000 (23:03 -0400)] 
Don't reset stack size when using posix_spawn()

There's no way to run setrlimit() from posix_spawn() so we can't reset
the stack limit in children; thus, don't change it in the parent.

* src/makeint.h (SET_STACK_SIZE): Don't set this when HAVE_POSIX_SPAWN.
* src/job.c (child_execute_job): Remove useless comment.

6 years ago* configure.ac: Remove redundant getloadavg gnulib support
Paul Smith [Tue, 3 Sep 2019 02:21:59 +0000 (22:21 -0400)] 
* configure.ac: Remove redundant getloadavg gnulib support

6 years ago* src/dir.c (dir_setup_glob): Initialize unused gl_offs.
Paul Smith [Mon, 2 Sep 2019 15:10:56 +0000 (11:10 -0400)] 
* src/dir.c (dir_setup_glob): Initialize unused gl_offs.

* tests/scripts/functions/wildcard: Add trailing slash tests.
Initial changes by Dmitry Goncharov <dgoncharov@users.sf.net>

6 years agoPacify Oracle Studio c99
Paul Eggert [Tue, 27 Aug 2019 19:32:07 +0000 (12:32 -0700)] 
Pacify Oracle Studio c99

* src/dep.h (DEP):
* src/function.c (struct function_table_entry):
Use unsigned int, not unsigned short.  Without this patch, c99
complains ‘warning: nonportable bit-field type’.

6 years agoPort grouped_targets test to Solaris 10
Paul Eggert [Tue, 27 Aug 2019 08:08:47 +0000 (01:08 -0700)] 
Port grouped_targets test to Solaris 10

* tests/scripts/features/grouped_targets: Use ‘printf ''’
instead of ‘echo -n’, as POSIX says the latter is not portable.

6 years agoRemove useless code in eval
Paul Eggert [Tue, 27 Aug 2019 07:46:21 +0000 (00:46 -0700)] 
Remove useless code in eval

* src/read.c (eval): Remove useless code.  Without this patch,
Oracle Studio 12.6 complains ‘"src/read.c", line 1405: warning:
loop not entered at top’.

6 years agoPacify Oracle Studio 12.6 in init_switches
Paul Eggert [Tue, 27 Aug 2019 07:40:05 +0000 (00:40 -0700)] 
Pacify Oracle Studio 12.6 in init_switches

* src/main.c (init_switches): Use a cast to convert char const *
to char *.  Without this patch, the compiler complains
‘"src/main.c", line 2643: warning: assignment type mismatch:
pointer to char "=" pointer to const char’.

6 years agoPacify Oracle Studio 12.6
Paul Eggert [Tue, 27 Aug 2019 07:37:08 +0000 (00:37 -0700)] 
Pacify Oracle Studio 12.6

* src/arscan.c [VMS]: Use ‘#if !defined LBR$_HDRTRUNC’ instead
of ‘#ifndef LBR$_HDRTRUNC’ to pacify Oracle Studio 12.6, which
looks inside unused #if branches for preprocessor syntax errors.
Without this patch it complains ‘"src/arscan.c", line 43: warning:
tokens ignored at end of directive line’.

6 years ago* NEWS: Fix incorrect notes.
Paul Smith [Mon, 2 Sep 2019 15:08:15 +0000 (11:08 -0400)] 
* NEWS: Fix incorrect notes.

6 years ago* src/read.c (parse_file_seq): [SV 52076] Don't reverse glob() results.
Paul Smith [Mon, 2 Sep 2019 15:06:40 +0000 (11:06 -0400)] 
* src/read.c (parse_file_seq): [SV 52076] Don't reverse glob() results.

6 years agoFix MS-Windows MinGW build
Eli Zaretskii [Wed, 28 Aug 2019 14:45:49 +0000 (17:45 +0300)] 
Fix MS-Windows MinGW build

* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
Fix format specifier for GetLastError's value.

* src/job.c (reap_children): Define the 'remote_status_lose' label
only for Posix platforms, to avoid compiler warning.

* build_w32.bat (LNKOUT): New variable, using forward slashes.
Use forward slashes in calls to :Compile, so that linking with GNU
ld works.

* src/makeint.h [!HAVE_UMASK]: Prototype for 'umask'.
(UMASK, MODE_T): Don't define.

* src/misc.c (get_tmpfile): Don't call UMASK, call umask, to
avoid compilation warning on !HAVE_UMASK platforms.
* src/output.c (output_tmpfd): Likewise.

* src/misc.c (umask) [!HAVE_UMASK]: New no-op function.

* src/config.h.W32.template (__USE_MINGW_ANSI_STDIO)
[__MINGW32__]: Define to 1, to force Make use ANSI-compatible
stdio functions, which also support the non-standard 'Id' and 'Ix'
specifiers.
(HAVE_UMASK) [__MINGW32__]: Define to 1.

* src/arscan.c (ar_member_touch): Type-cast argument of strlen to
avoid compiler warnings.

6 years ago* NEWS: Update for pre-release 4.2.90
Paul Smith [Mon, 26 Aug 2019 11:31:38 +0000 (07:31 -0400)] 
* NEWS: Update for pre-release

6 years agoUpdate maintainer mode to support debug wait points.
Paul Smith [Sun, 25 Aug 2019 21:11:10 +0000 (17:11 -0400)] 
Update maintainer mode to support debug wait points.

Make a spin() method available when compiled in maintainer mode.
If a file exists in the working directory with a specific name,
make will sleep until the file is deleted.

Ensure that maintainer mode is enabled on Windows, using the same
algorithm we use on POSIX / autoconf systems.

* build_w32.bat: If maintMakefile exists, enable maintainer mode.
* src/main.c (main): Replace Windows-only suspend flag with spin().
* src/makeint.h: A SPIN() macro calls spin() in maintainer mode.
* src/misc.c (spin): If a spin file exists sleep until it's deleted.

6 years ago* tests/scripts/features/archives: [SV 54395] Support non-GNU ar.
Paul Smith [Sun, 25 Aug 2019 17:47:13 +0000 (13:47 -0400)] 
* tests/scripts/features/archives: [SV 54395] Support non-GNU ar.

6 years ago* tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS
Paul Smith [Sun, 25 Aug 2019 04:20:38 +0000 (00:20 -0400)] 
* tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS

6 years ago* src/job.c (construct_command_argv): Remove unused VMS code
Paul Smith [Sat, 24 Aug 2019 21:41:45 +0000 (17:41 -0400)] 
* src/job.c (construct_command_argv): Remove unused VMS code

6 years ago* src/job.c (child_execute_job): Set pid to -1 on posix_spawn failure.
Paul Smith [Sat, 24 Aug 2019 21:40:41 +0000 (17:40 -0400)] 
* src/job.c (child_execute_job): Set pid to -1 on posix_spawn failure.

6 years ago* bootstrap: Update from latest gnulib version
Paul Smith [Sat, 24 Aug 2019 18:56:33 +0000 (14:56 -0400)] 
* bootstrap: Update from latest gnulib version

6 years ago* scripts/copyright-update: Use git ls-files for controlled files
Paul Smith [Sat, 24 Aug 2019 18:41:10 +0000 (14:41 -0400)] 
* scripts/copyright-update: Use git ls-files for controlled files

6 years ago* po/LINGUAS: Add a translation for Bulgarian.
Paul Smith [Sat, 24 Aug 2019 18:13:59 +0000 (14:13 -0400)] 
* po/LINGUAS: Add a translation for Bulgarian.

6 years ago[SV 56449] (Windows) Use slow path if '%' appears in the command
Christian Eggers [Thu, 6 Jun 2019 10:42:38 +0000 (12:42 +0200)] 
[SV 56449] (Windows) Use slow path if '%' appears in the command

* src/job.c (sh_chars_dos): Add '%' as a special character
* src/job.c (construct_command_argv_internal): Check for '%' in quotes

For the windows version of make, a recipe line cannot be executed
diretly by make (without a shell) if a '%' character is present. This
character starts a cmd.exe escape sequence.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Copyright-paperwork-exempt: yes