Compare commits

...

10 Commits
4.2.93 ... 4.3

Author SHA1 Message Date
Paul Smith
f430a65ccb GNU Make release 4.3
* NEWS: Update for the release
* configure.ac: New release number
* doc/make.texi: New edition number
2020-01-19 17:04:52 -05:00
Paul Smith
c30da63fd2 * configure.ac (guile): Check for Guile 3.0 installations 2020-01-19 17:04:52 -05:00
Paul Smith
3fb7312e9f * src/job.c (sh_cmds): [SV 57625] Update builtin shell command list 2020-01-19 17:04:52 -05:00
Paul Smith
dd6adfa454 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.
2020-01-19 17:04:52 -05:00
Paul Smith
3b5e47b2e2 [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.
2020-01-19 17:04:52 -05:00
Dmitry Goncharov
4e277f6fbd * tests/test_driver.pl: Enhance error messages 2020-01-05 10:46:58 -05:00
Paul Smith
ec946d7e21 * doc/make.texi: Change the GFDL to an Appendix 2020-01-04 13:24:39 -05:00
Paul Smith
16d06006a4 * NEWS: Clarify authorship of new features. 2020-01-04 13:24:39 -05:00
Paul Smith
b774aebffa 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.
2020-01-04 13:23:23 -05:00
Paul Smith
06de697268 * bootstrap: Update to the latest gnulib version 2020-01-03 15:44:13 -05:00
15 changed files with 213 additions and 106 deletions

1
.gitignore vendored
View File

@@ -30,6 +30,7 @@ configure
/mk/Posix.mk /mk/Posix.mk
stamp-h1 stamp-h1
.dirstamp .dirstamp
gnulib
# Build artifacts # Build artifacts
.deps/ .deps/

43
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*- GNU make NEWS -*-indented-text-*-
History of user-visible changes. History of user-visible changes.
3 January 2020 19 January 2020
See the end of this file for copyrights and conditions. See the end of this file for copyrights and conditions.
@@ -9,11 +9,11 @@ which is contained in this distribution as the file doc/make.texi.
See the README file and the GNU make manual for instructions for See the README file and the GNU make manual for instructions for
reporting bugs. reporting bugs.
Version 4.2.93 (03 Jan 2020) Version 4.3 (19 Jan 2020)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set=custom
* WARNING: Backward-incompatibility! * WARNING: Backward-incompatibility!
Number signs (#) appearing inside a macro reference or function invocation Number signs (#) appearing inside a macro reference or function invocation
@@ -35,10 +35,18 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
already contains some value. Similarly, appending an empty string does not already contains some value. Similarly, appending an empty string does not
add a trailing space. add a trailing space.
* WARNING: Backward-incompatibility! * NOTE: Deprecated behavior.
Contrary to the documentation, suffix rules with prerequisites were being Contrary to the documentation, suffix rules with prerequisites are being
treated BOTH as simple targets AND as pattern rules. Behavior now matches treated BOTH as simple targets AND as pattern rules. Further, the
the documentation, and pattern rules are no longer created in this case. prerequisites are ignored by the pattern rules. POSIX specifies that in
order to be a suffix rule there can be no prerequisites defined. In this
release if POSIX mode is enabled then rules with prerequisites cannot be
suffix rules. If POSIX mode is not enabled then the previous behavior is
preserved (a pattern rule with no extra prerequisites is created) AND a
warning about this behavior is generated:
warning: ignoring prerequisites on suffix rule definition
The POSIX behavior will be adopted as the only behavior in a future release
of GNU make so please resolve any warnings.
* New feature: Grouped explicit targets * New feature: Grouped explicit targets
Pattern rules have always had the ability to generate multiple targets with Pattern rules have always had the ability to generate multiple targets with
@@ -54,14 +62,15 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
recipe. This variable can either be global (applies to all targets) or recipe. This variable can either be global (applies to all targets) or
a target-specific variable. To detect this feature search for 'extra-prereqs' a target-specific variable. To detect this feature search for 'extra-prereqs'
in the .FEATURES special variable. in the .FEATURES special variable.
Implementation contributed by Christof Warlich <cwarlich@gmx.de>
* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and * Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
this will cause make to enable that parallelism mode. this will cause make to enable that parallelism mode.
* GNU make will now use posix_spawn() on systems where it is available. * GNU make will now use posix_spawn() on systems where it is available.
If you prefer to use fork/exec even on systems where posix_spawn() is If you prefer to use fork/exec even on systems where posix_spawn() is
present, you can use the --disable-posix-spawn option to configure. Aron present, you can use the --disable-posix-spawn option to configure.
Barath <baratharon@caesar.elte.hu> provided the basic implementation. Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>
* Error messages printed when invoking non-existent commands have been cleaned * Error messages printed when invoking non-existent commands have been cleaned
up and made consistent. up and made consistent.
@@ -99,7 +108,7 @@ Version 4.2.1 (10 Jun 2016)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom
This release is a bug-fix release. This release is a bug-fix release.
@@ -108,7 +117,7 @@ Version 4.2 (22 May 2016)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set=custom
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or * New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
$(shell ...) function invoked in this instance of make. This will be "0" if $(shell ...) function invoked in this instance of make. This will be "0" if
@@ -147,7 +156,7 @@ Version 4.1 (05 Oct 2014)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty * New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
values if stdout or stderr, respectively, are believed to be writing to a values if stdout or stderr, respectively, are believed to be writing to a
@@ -195,7 +204,7 @@ Version 4.0 (09 Oct 2013)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
* WARNING: Backward-incompatibility! * WARNING: Backward-incompatibility!
If .POSIX is specified, then make adheres to the POSIX backslash/newline If .POSIX is specified, then make adheres to the POSIX backslash/newline
@@ -299,7 +308,7 @@ Version 3.82 (28 Jul 2010)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
* Compiling GNU make now requires a conforming ISO C 1989 compiler and * Compiling GNU make now requires a conforming ISO C 1989 compiler and
standard runtime library. standard runtime library.
@@ -464,7 +473,7 @@ Version 3.81 (01 Apr 2006)
might have caused the target to rebuild. Starting with the _next_ might have caused the target to rebuild. Starting with the _next_
release of GNU make, '$?' will contain all prerequisites that caused release of GNU make, '$?' will contain all prerequisites that caused
the target to be considered out of date. the target to be considered out of date.
See http://savannah.gnu.org/bugs/?16051 See https://savannah.gnu.org/bugs/?16051
* WARNING: Backward-incompatibility! * WARNING: Backward-incompatibility!
GNU make now implements a generic "second expansion" feature on the GNU make now implements a generic "second expansion" feature on the
@@ -588,7 +597,7 @@ Version 3.81 (01 Apr 2006)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103 https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
Version 3.80 (03 Oct 2002) Version 3.80 (03 Oct 2002)
@@ -706,7 +715,7 @@ Version 3.80 (03 Oct 2002)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102 https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
Version 3.79.1 (23 Jun 2000) Version 3.79.1 (23 Jun 2000)

View File

@@ -4,7 +4,7 @@ scriptversion=2019-01-04.17; # UTC
# Bootstrap this package from checked-out sources. # Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2019 Free Software Foundation, Inc. # Copyright (C) 2003-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -162,18 +162,11 @@ bootstrap_post_import_hook() { :; }
# Override it via your own definition in bootstrap.conf. # Override it via your own definition in bootstrap.conf.
bootstrap_epilogue() { :; } bootstrap_epilogue() { :; }
# The command to download all .po files for a specified domain into # The command to download all .po files for a specified domain into a
# a specified directory. Fill in the first %s is the domain name, and # specified directory. Fill in the first %s with the destination
# the second with the destination directory. Use rsync's -L and -r # directory and the second with the domain name.
# options because the latest/%s directory and the .po files within are
# all symlinks.
po_download_command_format=\ po_download_command_format=\
"rsync --delete --exclude '*.s1' -Lrtvz \ "wget --mirror --level=1 -nd -nv -A.po -P '%s' \
'translationproject.org::tp/latest/%s/' '%s'"
# Fallback for downloading .po files (if rsync fails).
po_download_command_format2=\
"wget --mirror -nd -q -np -A.po -P '%s' \
https://translationproject.org/latest/%s/" https://translationproject.org/latest/%s/"
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
@@ -741,10 +734,7 @@ download_po_files() {
subdir=$1 subdir=$1
domain=$2 domain=$2
echo "$me: getting translations into $subdir for $domain..." echo "$me: getting translations into $subdir for $domain..."
cmd=$(printf "$po_download_command_format" "$domain" "$subdir") cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
eval "$cmd" && return
# Fallback to HTTPS.
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
eval "$cmd" eval "$cmd"
} }

View File

@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License along with # You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>. # this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([GNU make],[4.2.93],[bug-make@gnu.org]) AC_INIT([GNU make],[4.3],[bug-make@gnu.org])
AC_PREREQ([2.69]) AC_PREREQ([2.69])
@@ -176,7 +176,7 @@ AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AS_IF([test "x$with_guile" != xno], AS_IF([test "x$with_guile" != xno],
[ guile_versions="2.2 2.0 1.8" [ guile_versions="3.0 2.2 2.0 1.8"
guile_version=no guile_version=no
have_guile=no have_guile=no
AC_MSG_CHECKING([for GNU Guile]) AC_MSG_CHECKING([for GNU Guile])
@@ -184,13 +184,21 @@ AS_IF([test "x$with_guile" != xno],
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], []) PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
done done
AC_MSG_RESULT([$guile_version]) AC_MSG_RESULT([$guile_version])
if test "$have_guile" = yes; then AS_IF([test "$have_guile" = yes],
PKG_CHECK_MODULES(GUILE, [guile-$guile_version]) [ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support]) # Unfortunately Guile requires a C99 compiler but GNU make doesn't, so
fi # verify we can actually compile the header.
keep_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $pkg_cv_GUILE_CFLAGS"
AC_CHECK_HEADER([libguile.h],
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
[have_guile=no],
[/* Avoid configuration error warnings. */])
CPPFLAGS="$keep_CPPFLAGS"
])
]) ])
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes]) AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = "yes"])
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , , AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT [AC_INCLUDES_DEFAULT

View File

@@ -3,7 +3,7 @@
@setfilename make.info @setfilename make.info
@include version.texi @include version.texi
@set EDITION 0.74 @set EDITION 0.75
@settitle GNU @code{make} @settitle GNU @code{make}
@setchapternewpage odd @setchapternewpage odd
@@ -1932,8 +1932,8 @@ more recent than it.
@item @item
How to update the file @file{foo.o}: by running @code{cc} as stated. How to update the file @file{foo.o}: by running @code{cc} as stated.
The recipe does not explicitly mention @file{defs.h}, but we presume The recipe does not explicitly mention @file{defs.h}, but we presume
that @file{foo.c} includes it, and that that is why @file{defs.h} was that @file{foo.c} includes it, and that is why @file{defs.h} was added
added to the prerequisites. to the prerequisites.
@end itemize @end itemize
@end ifnottex @end ifnottex
@@ -4533,6 +4533,19 @@ target is updated in some atomic fashion, or exists only to record a
modification-time (its contents do not matter), or must exist at all modification-time (its contents do not matter), or must exist at all
times to prevent other sorts of trouble. times to prevent other sorts of trouble.
Although @code{make} does its best to clean up there are certain situations
in which cleanup is impossible. For example, @code{make} may be killed by
an uncatchable signal. Or, one of the programs make invokes may be killed
or crash, leaving behind an up-to-date but corrupt target file: @code{make}
will not realize that this failure requires the target to be cleaned. Or
@code{make} itself may encounter a bug and crash.
For these reasons it's best to write @emph{defensive recipes}, which won't
leave behind corrupted targets even if they fail. Most commonly these
recipes create temporary files rather than updating the target directly,
then rename the temporary file to the final target name. Some compilers
already behave this way, so that you don't need to write a defensive recipe.
@node Recursion, Canned Recipes, Interrupts, Recipes @node Recursion, Canned Recipes, Interrupts, Recipes
@section Recursive Use of @code{make} @section Recursive Use of @code{make}
@cindex recursion @cindex recursion
@@ -9918,6 +9931,10 @@ and linking with a single @code{cc} command. The optimized rule is used in
preference to the step-by-step chain because it comes earlier in the preference to the step-by-step chain because it comes earlier in the
ordering of rules. ordering of rules.
Finally, for performance reasons @code{make} will not consider non-terminal
match-anything rules (i.e., @samp{%:}) when searching for a rule to
build a prerequisite of an implicit rule (@pxref{Match-Anything Rules}).
@node Pattern Rules, Last Resort, Chained Rules, Implicit Rules @node Pattern Rules, Last Resort, Chained Rules, Implicit Rules
@section Defining and Redefining Pattern Rules @section Defining and Redefining Pattern Rules
@@ -10407,9 +10424,10 @@ remade from any other files; therefore, @code{make} can save time by not
looking for ways to remake them.@refill looking for ways to remake them.@refill
If you do not mark the match-anything rule as terminal, then it is If you do not mark the match-anything rule as terminal, then it is
non-terminal. A non-terminal match-anything rule cannot apply to a file name non-terminal. A non-terminal match-anything rule cannot apply to a
that indicates a specific type of data. A file name indicates a specific prerequisite of an implicit rule, or to a file name that indicates a
type of data if some non-match-anything implicit rule target matches it. specific type of data. A file name indicates a specific type of data
if some non-match-anything implicit rule target matches it.
For example, the file name @file{foo.c} matches the target for the pattern For example, the file name @file{foo.c} matches the target for the pattern
rule @samp{%.c : %.y} (the rule to run Yacc). Regardless of whether this rule @samp{%.c : %.y} (the rule to run Yacc). Regardless of whether this
@@ -10646,8 +10664,9 @@ Make a list of all the pattern rules one of whose targets matches
matched against @var{t}; otherwise, against @var{n}. matched against @var{t}; otherwise, against @var{n}.
@item @item
If any rule in that list is @emph{not} a match-anything rule, then If any rule in that list is @emph{not} a match-anything rule, or if
remove all non-terminal match-anything rules from the list. @var{t} is a prerequisite of an implicit rule, then remove all
non-terminal match-anything rules from the list.
@item @item
Remove from the list all rules with no recipe. Remove from the list all rules with no recipe.
@@ -12731,6 +12750,18 @@ receive only part of the information necessary. In this case, the child
will generate this warning message and proceed with its build in a will generate this warning message and proceed with its build in a
sequential manner. sequential manner.
@item warning: ignoring prerequisites on suffix rule definition
According to POSIX, a suffix rule cannot contain prerequisites. If a rule
that could be a suffix rule has prerequisites it is interpreted as a simple
explicit rule, with an odd target name. This requirement is obeyed when
POSIX-conforming mode is enabled (the @code{.POSIX} target is defined). In
versions of GNU @code{make} prior to 4.3, no warning was emitted and a
suffix rule was created, however all prerequisites were ignored and were not
part of the suffix rule. Starting with GNU @code{make} 4.3 the behavior is
the same, and in addition this warning is generated. In a future version
the POSIX-conforming behavior will be the only behavior: no rule with a
prerequisite can be suffix rule and this warning will be removed.
@end table @end table
@node Complex Makefile, GNU Free Documentation License, Error Messages, Top @node Complex Makefile, GNU Free Documentation License, Error Messages, Top
@@ -13013,7 +13044,7 @@ tar.zoo: $(SRCS) $(AUX)
@end example @end example
@node GNU Free Documentation License, Concept Index, Complex Makefile, Top @node GNU Free Documentation License, Concept Index, Complex Makefile, Top
@appendixsec GNU Free Documentation License @appendix GNU Free Documentation License
@cindex FDL, GNU Free Documentation License @cindex FDL, GNU Free Documentation License
@include fdl.texi @include fdl.texi

View File

@@ -231,15 +231,36 @@ get-doc/make-stds.texi get-doc/fdl.texi:
# Alternative configuration checks. # # Alternative configuration checks. #
# ---------------------------------- # # ---------------------------------- #
CFGCHECK_CONFIGFLAGS =
CFGCHECK_BUILDFLAGS =
CFGCHECK_MAKEFLAGS = CFLAGS='$(AM_CFLAGS)'
checkcfg.strict-c90: CFGCHECK_CONFIGFLAGS = CFLAGS='-std=c90 -pedantic'
checkcfg.strict-c90: CFGCHECK_MAKEFLAGS =
checkcfg.no-jobserver:CFGCHECK_CONFIGFLAGS = --disable-job-server
checkcfg.no-load: CFGCHECK_CONFIGFLAGS = --disable-load
checkcfg.no-guile: CFGCHECK_CONFIGFLAGS = --without-guile
checkcfg.no-spawn: CFGCHECK_CONFIGFLAGS = --disable-posix-spawn
checkcfg.no-sysglob: CFGCHECK_CONFIGFLAGS = make_cv_sys_gnu_glob=no
checkcfg.no-loadavg: CFGCHECK_CONFIGFLAGS = ac_cv_func_getloadavg=no \
ac_cv_have_decl_getloadavg=no \
gl_cv_have_raw_decl_getloadavg=no \
ac_cv_lib_util_getloadavg=no \
ac_cv_lib_getloadavg_getloadavg=no
checkcfg.no-sync: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_OUTPUT_SYNC
checkcfg.no-archives: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_ARCHIVES
CONFIG_CHECKS := \ CONFIG_CHECKS := \
checkcfg.--disable-job-server \ checkcfg.strict-c90 \
checkcfg.--disable-load \ checkcfg.no-jobserver \
checkcfg.--without-guile \ checkcfg.no-load \
checkcfg.--disable-posix-spawn \ checkcfg.no-guile \
checkcfg.make_cv_sys_gnu_glob^no \ checkcfg.no-spawn \
checkcfg.ac_cv_func_getloadavg^no+ac_cv_have_decl_getloadavg^no+gl_cv_have_raw_decl_getloadavg^no+ac_cv_lib_util_getloadavg^no+ac_cv_lib_getloadavg_getloadavg^no \ checkcfg.no-sysglob \
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \ checkcfg.no-loadavg \
checkcfg.CPPFLAGS^-DNO_ARCHIVES checkcfg.no-sync \
checkcfg.no-archives
.PHONY: check-alt-config .PHONY: check-alt-config
check-alt-config: $(CONFIG_CHECKS) check-alt-config: $(CONFIG_CHECKS)
@@ -251,20 +272,20 @@ NR_MAKE = $(MAKE)
$(CONFIG_CHECKS): checkcfg.%: distdir $(CONFIG_CHECKS): checkcfg.%: distdir
@echo "Building $@ (output in checkcfg.$*.log)" @echo "Building $@ (output in checkcfg.$*.log)"
exec >'checkcfg.$*.log' 2>&1; \ exec >'checkcfg.$*.log' 2>&1; \
echo "Testing configure with $(subst ^,=,$(subst +, ,$*))"; set -x; \ echo "Testing configure with $(CFGCHECK_CONFIGFLAGS)"; set -x; \
rm -rf $(distdir)/_build \ rm -rf $(distdir)/_build \
&& mkdir $(distdir)/_build \ && mkdir $(distdir)/_build \
&& cd $(distdir)/_build \ && cd $(distdir)/_build \
&& ../configure --srcdir=.. $(subst ^,=,$(subst +, ,$*)) \ && ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
exec >>'checkcfg.$*.log' 2>&1; set -x; \ exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \ cd $(distdir)/_build \
&& OUTDIR=_bld ../build.sh \ && OUTDIR=_bld ../build.sh $(CFGCHECK_BUILD_FLAGS) \
&& _bld/make $(AM_MAKEFLAGS) check-local \ && _bld/make $(AM_MAKEFLAGS) check-local \
&& _bld/make $(AM_MAKEFLAGS) clean && _bld/make $(AM_MAKEFLAGS) clean
exec >>'checkcfg.$*.log' 2>&1; set -x; \ exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \ cd $(distdir)/_build \
&& $(NR_MAKE) $(AM_MAKEFLAGS) CFLAGS='$(AM_CFLAGS)' \ && $(NR_MAKE) $(AM_MAKEFLAGS) $(CFGCHECK_MAKEFLAGS) \
&& ./make $(AM_MAKEFLAGS) check \ && ./make $(AM_MAKEFLAGS) check \
&& ./make $(AM_MAKEFLAGS) clean && ./make $(AM_MAKEFLAGS) clean

View File

@@ -100,7 +100,7 @@ struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t
#define alloc_seq_elt(_t) xcalloc (sizeof (_t)) #define alloc_seq_elt(_t) xcalloc (sizeof (_t))
void free_ns_chain (struct nameseq *n); void free_ns_chain (struct nameseq *n);
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) #if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
/* Use inline to get real type-checking. */ /* Use inline to get real type-checking. */
#define SI static inline #define SI static inline
SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); } SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); }

View File

@@ -640,9 +640,10 @@ expand_deps (struct file *f)
struct dep * struct dep *
expand_extra_prereqs (const struct variable *extra) expand_extra_prereqs (const struct variable *extra)
{ {
struct dep *d;
struct dep *prereqs = extra ? split_prereqs (variable_expand (extra->value)) : NULL; struct dep *prereqs = extra ? split_prereqs (variable_expand (extra->value)) : NULL;
for (struct dep *d = prereqs; d; d = d->next) for (d = prereqs; d; d = d->next)
{ {
d->file = lookup_file (d->name); d->file = lookup_file (d->name);
if (!d->file) if (!d->file)

View File

@@ -2785,9 +2785,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
#else /* must be UNIX-ish */ #else /* must be UNIX-ish */
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!"; static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
static const char *sh_cmds[] = static const char *sh_cmds[] =
{ ".", ":", "break", "case", "cd", "command", "continue", "eval", "exec", { ".", ":", "alias", "bg", "break", "case", "cd", "command", "continue",
"exit", "export", "for", "if", "login", "logout", "read", "readonly", "eval", "exec", "exit", "export", "fc", "fg", "for", "getopts", "hash",
"set", "shift", "switch", "test", "times", "trap", "ulimit", "umask", "if", "jobs", "login", "logout", "read", "readonly", "return", "set",
"shift", "test", "times", "trap", "type", "ulimit", "umask", "unalias",
"unset", "wait", "while", 0 }; "unset", "wait", "while", 0 };
# ifdef HAVE_DOS_PATHS # ifdef HAVE_DOS_PATHS

View File

@@ -80,11 +80,11 @@ char **construct_command_argv (char *line, char **restp, struct file *file,
pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv); pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv);
#ifdef _AMIGA #ifdef _AMIGA
void exec_command (char **argv) __attribute__ ((noreturn)); void exec_command (char **argv) NORETURN;
#elif defined(__EMX__) #elif defined(__EMX__)
int exec_command (char **argv, char **envp); int exec_command (char **argv, char **envp);
#else #else
void exec_command (char **argv, char **envp) __attribute__ ((noreturn)); void exec_command (char **argv, char **envp) NORETURN;
#endif #endif
void unblock_all_sigs (void); void unblock_all_sigs (void);

View File

@@ -96,7 +96,7 @@ int chdir ();
#endif #endif
#ifndef STDC_HEADERS #ifndef STDC_HEADERS
# ifndef sun /* Sun has an incorrect decl in a header. */ # ifndef sun /* Sun has an incorrect decl in a header. */
void exit (int) __attribute__ ((noreturn)); void exit (int) NORETURN;
# endif # endif
double atof (); double atof ();
#endif #endif

View File

@@ -220,19 +220,22 @@ extern int vms_legacy_behavior;
extern int vms_unix_simulation; extern int vms_unix_simulation;
#endif #endif
#ifndef __attribute__ #if !defined(__attribute__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
/* This feature is available in gcc versions 2.5 and later. */ /* Don't use __attribute__ if it's not supported. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define ATTRIBUTE(x)
# define __attribute__(x) #else
# endif # define ATTRIBUTE(x) __attribute__ (x)
#endif
/* The __-protected variants of 'format' and 'printf' attributes /* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format # define __format__ format
# define __printf__ printf # define __printf__ printf
# endif
#endif #endif
#define UNUSED __attribute__ ((unused))
#define UNUSED ATTRIBUTE ((unused))
#define NORETURN ATTRIBUTE ((noreturn))
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) #if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
# include <stdlib.h> # include <stdlib.h>
@@ -255,8 +258,8 @@ void *malloc (int);
void *realloc (void *, int); void *realloc (void *, int);
void free (void *); void free (void *);
void abort (void) __attribute__ ((noreturn)); void abort (void) NORETURN;
void exit (int) __attribute__ ((noreturn)); void exit (int) NORETURN;
# endif /* HAVE_STDLIB_H. */ # endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */ #endif /* Standard headers. */
@@ -327,7 +330,7 @@ extern mode_t umask (mode_t);
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) #define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
#if defined(__GNUC__) || defined(ENUM_BITFIELDS) #if defined(ENUM_BITFIELDS) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define ENUM_BITFIELD(bits) :bits # define ENUM_BITFIELD(bits) :bits
#else #else
# define ENUM_BITFIELD(bits) # define ENUM_BITFIELD(bits)
@@ -486,12 +489,12 @@ typedef struct
const char *concat (unsigned int, ...); const char *concat (unsigned int, ...);
void message (int prefix, size_t length, const char *fmt, ...) void message (int prefix, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4))); ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void error (const floc *flocp, size_t length, const char *fmt, ...) void error (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4))); ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void fatal (const floc *flocp, size_t length, const char *fmt, ...) void fatal (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 3, 4))); ATTRIBUTE ((noreturn, __format__ (__printf__, 3, 4)));
void out_of_memory () __attribute__((noreturn)); void out_of_memory () NORETURN;
/* When adding macros to this list be sure to update the value of /* When adding macros to this list be sure to update the value of
XGETTEXT_OPTIONS in the po/Makevars file. */ XGETTEXT_OPTIONS in the po/Makevars file. */
@@ -509,8 +512,8 @@ void out_of_memory () __attribute__((noreturn));
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \ #define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
(_f), (_n), (_s)) (_f), (_n), (_s))
void die (int) __attribute__ ((noreturn)); void die (int) NORETURN;
void pfatal_with_name (const char *) __attribute__ ((noreturn)); void pfatal_with_name (const char *) NORETURN;
void perror_with_name (const char *, const char *); void perror_with_name (const char *, const char *);
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s)) #define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
void *xmalloc (size_t); void *xmalloc (size_t);

View File

@@ -71,14 +71,16 @@ snap_implicit_rules (void)
{ {
char *name = NULL; char *name = NULL;
size_t namelen = 0; size_t namelen = 0;
struct rule *rule;
struct dep *dep;
struct dep *prereqs = expand_extra_prereqs (lookup_variable (STRING_SIZE_TUPLE(".EXTRA_PREREQS"))); struct dep *prereqs = expand_extra_prereqs (lookup_variable (STRING_SIZE_TUPLE(".EXTRA_PREREQS")));
unsigned int pre_deps = 0; unsigned int pre_deps = 0;
max_pattern_dep_length = 0; max_pattern_dep_length = 0;
for (struct dep *d = prereqs; d; d = d->next) for (dep = prereqs; dep; dep = dep->next)
{ {
size_t l = strlen (dep_name (d)); size_t l = strlen (dep_name (dep));
if (l > max_pattern_dep_length) if (l > max_pattern_dep_length)
max_pattern_dep_length = l; max_pattern_dep_length = l;
++pre_deps; ++pre_deps;
@@ -86,7 +88,7 @@ snap_implicit_rules (void)
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0; num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
for (struct rule *rule = pattern_rules; rule; rule = rule->next) for (rule = pattern_rules; rule; rule = rule->next)
{ {
unsigned int ndeps = pre_deps; unsigned int ndeps = pre_deps;
struct dep *lastdep = NULL; struct dep *lastdep = NULL;
@@ -96,7 +98,7 @@ snap_implicit_rules (void)
if (rule->num > max_pattern_targets) if (rule->num > max_pattern_targets)
max_pattern_targets = rule->num; max_pattern_targets = rule->num;
for (struct dep *dep = rule->deps; dep != 0; dep = dep->next) for (dep = rule->deps; dep != 0; dep = dep->next)
{ {
const char *dname = dep_name (dep); const char *dname = dep_name (dep);
size_t len = strlen (dname); size_t len = strlen (dname);
@@ -270,11 +272,23 @@ convert_to_pattern (void)
memcpy (rulename + slen, dep_name (d2), s2len + 1); memcpy (rulename + slen, dep_name (d2), s2len + 1);
f = lookup_file (rulename); f = lookup_file (rulename);
/* No target, or no commands, or it has deps: it can't be a /* No target, or no commands: it can't be a suffix rule. */
suffix rule. */ if (f == 0 || f->cmds == 0)
if (f == 0 || f->cmds == 0 || f->deps != 0)
continue; continue;
/* POSIX says that suffix rules can't have prerequisites.
In POSIX mode, don't make this a suffix rule. Previous versions
of GNU make did treat this as a suffix rule and ignored the
prerequisites, which is bad. In the future we'll do the same as
POSIX, but for now preserve the old behavior and warn about it. */
if (f->deps != 0)
{
if (posix_pedantic)
continue;
error (&f->cmds->fileinfo, 0,
_("warning: ignoring prerequisites on suffix rule definition"));
}
if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a') if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a')
/* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'. /* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'.
It also generates a normal '%.a: %.X' rule below. */ It also generates a normal '%.a: %.X' rule below. */

View File

@@ -51,7 +51,9 @@ run_make_test(q!
unlink('foo.baz'); unlink('foo.baz');
# Test #4: Suffix rules with deps are not suffix rules # SV 40657: Test #4: "Suffix rules" with deps are normal rules
my $prewarn = 'warning: ignoring prerequisites on suffix rule definition';
touch('foo.bar'); touch('foo.bar');
@@ -59,20 +61,39 @@ run_make_test(q!
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .biz .baz .SUFFIXES: .biz .baz
$X.POSIX:
.baz.biz: foo.bar ; @echo make $@ from $< .baz.biz: foo.bar ; @echo make $@ from $<
!, !,
'.baz.biz', "make .baz.biz from foo.bar\n"); 'X=1 .baz.biz', "#MAKEFILE#:7: $prewarn\nmake .baz.biz from foo.bar\n");
# SV 40657: Test #5: In POSIX mode we don't get a warning
run_make_test(undef, 'X= .baz.biz', "make .baz.biz from foo.bar\n");
unlink('foo.bar'); unlink('foo.bar');
# Test #5: Should not create pattern rules for it either # SV 40657: Test #6: In POSIX mode, no pattern rules should be created
touch('foo.baz'); utouch(-20, 'foo.baz');
run_make_test(undef, run_make_test(undef,
'foo.biz', "#MAKE#: *** No rule to make target 'foo.biz'. Stop.\n", 512); 'X= foo.biz', "#MAKE#: *** No rule to make target 'foo.biz'. Stop.\n", 512);
unlink('foo.baz'); # SV 40657: Test #7: In Non-POSIX mode, a pattern rule is created
run_make_test(undef,
'X=1 foo.biz', "#MAKEFILE#:7: $prewarn\nmake foo.biz from foo.baz\n");
# SV 40657: Test #8: ... but any prerequisites are ignored
utouch(-10, 'foo.biz');
touch('foo.bar');
run_make_test(undef,
'X=1 foo.biz', "#MAKEFILE#:7: $prewarn\n#MAKE#: 'foo.biz' is up to date.\n");
unlink('foo.baz', 'foo.biz', 'foo.bar');
# Complete # Complete
1; 1;

View File

@@ -237,7 +237,7 @@ sub toplevel
if (-d $workpath) { if (-d $workpath) {
print "Clearing $workpath...\n"; print "Clearing $workpath...\n";
&remove_directory_tree("$workpath/") &remove_directory_tree("$workpath/")
or &error ("Couldn't wipe out $workpath\n"); or &error ("Couldn't wipe out $workpath: $!\n");
} else { } else {
mkdir ($workpath, 0777) or &error ("Couldn't mkdir $workpath: $!\n"); mkdir ($workpath, 0777) or &error ("Couldn't mkdir $workpath: $!\n");
} }
@@ -1129,8 +1129,9 @@ sub remove_directory_tree
-e $targetdir or return 1; -e $targetdir or return 1;
&remove_directory_tree_inner ("RDT00", $targetdir) or return 0; &remove_directory_tree_inner ("RDT00", $targetdir) or return 0;
if ($nuketop) { if ($nuketop && !rmdir ($targetdir)) {
rmdir($targetdir) or return 0; print "Cannot remove $targetdir: $!\n";
return 0;
} }
return 1; return 1;
@@ -1149,10 +1150,16 @@ sub remove_directory_tree_inner
lstat ($object); lstat ($object);
if (-d _ && &remove_directory_tree_inner ($subdirhandle, $object)) { if (-d _ && &remove_directory_tree_inner ($subdirhandle, $object)) {
rmdir $object or return 0; if (!rmdir($object)) {
print "Cannot remove $object: $!\n";
return 0;
}
} else { } else {
if ($^O ne 'VMS') { if ($^O ne 'VMS') {
unlink $object or return 0; if (!unlink $object) {
print "Cannot unlink $object: $!\n";
return 0;
}
} else { } else {
# VMS can have multiple versions of a file. # VMS can have multiple versions of a file.
1 while unlink $object; 1 while unlink $object;