Don't print errors if "include" is specified with no arguments.
New test suite for the $(shell ...) function.
+2005-06-26 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Fix bug in ANSI_STRING/strerror() handling; only define
+ it if ANSI_STRING is not set.
+
2005-06-25 Paul D. Smith <psmith@gnu.org>
+ * read.c (eval): If no filenames are passed to any of the
+ "include" variants, don't print an error.
+ * doc/make.texi (Include): Document this.
+ Fixes Savannah bug #1761.
+
* job.c (construct_command_argv_internal): Sanitize handling of
backslash/newline pairs according to POSIX: that is, keep the
backslash-newline in the command script, but remove a following
@end example
@noindent
-@var{filenames} can contain shell file name patterns.
+@var{filenames} can contain shell file name patterns. If
+@var{filenames} is empty, nothing is included and no error is printed.
@cindex shell file name pattern (in @code{include})
@cindex shell wildcards (in @code{include})
@cindex wildcard, in @code{include}
Supports ``job server'' enhanced parallel builds. @xref{Parallel,
,Parallel Execution}.
+@item else-if
+Supports ``else if'' non-nested conditionals. @xref{Conditional
+Syntax, ,Syntax of Conditionals}.
+
@item check-symlink
Supports the @code{-L} (@code{--check-symlink-times}) flag.
@xref{Options Summary, ,Summary of Options}.
because target_environment hits a loop trying to expand $(var)
to put it in the environment. This is even more confusing when
var was not explicitly exported, but just appeared in the
- calling environment. */
+ calling environment.
+
+ envp = target_environment (NILF);
+ */
envp = environ;
/* Set up .FEATURES */
define_variable (".FEATURES", 9,
- "target-specific order-only second-expansion",
+ "target-specific order-only second-expansion else-if",
o_default, 0);
#ifdef MAKE_JOBSERVER
do_variable_definition (NILF, ".FEATURES", "jobserver",
extern void bcopy PARAMS ((const char *b1, char *b2, int));
# endif
-#endif /* ANSI_STRING. */
-#undef ANSI_STRING
-
/* SCO Xenix has a buggy macro definition in <string.h>. */
#undef strerror
-
-#if !defined(ANSI_STRING) && !defined(__DECC)
+#if !defined(__DECC)
extern char *strerror PARAMS ((int errnum));
#endif
+#endif /* !ANSI_STRING. */
+#undef ANSI_STRING
+
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
int noerror = (p[0] != 'i');
p = allocated_variable_expand (p2);
+
+ /* If no filenames, it's a no-op. */
if (*p == '\0')
- {
- error (fstart,
- _("no file name for `%sinclude'"), noerror ? "-" : "");
- continue;
- }
+ continue;
/* Parse the list of file names. */
p2 = p;
+2005-06-26 Paul D. Smith <psmith@gnu.org>
+
+ * scripts/functions/shell: New test suite for the shell function.
+
2005-06-25 Paul D. Smith <psmith@gnu.org>
+ * scripts/features/include: Test include/-include/sinclude with no
+ arguments. Tests fix for Savannah bug #1761.
+
* scripts/misc/general3: Implement comprehensive testing of
backslash-newline behavior in command scripts: various types of
quoting, fast path / slow path, etc.
bar:; @false
', '', '');
+# Check include, sinclude, -include with no filenames.
+# (Savannah bug #1761).
+
+run_make_test('
+.PHONY: all
+all:; @:
+include
+-include
+sinclude', '', '');
+
1;
--- /dev/null
+# -*-perl-*-
+
+$description = 'Test the $(shell ...) function.';
+
+$details = '';
+
+
+# Test shells inside rules.
+run_make_test('.PHONY: all
+all: ; @echo $(shell echo hi)
+','','hi');
+
+
+# Test shells inside exported environment variables.
+# This is the test that fails if we try to put make exported variables into
+# the environment for a $(shell ...) call.
+run_make_test('
+export HI = $(shell echo hi)
+.PHONY: all
+all: ; @echo $$HI
+','','hi');
+
+1;