From 7677589ac641bc6fb4b46ac3de14429a939e57e7 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 5 Sep 1999 13:47:23 +0000 Subject: [PATCH] * guile-snarf.in: Be sure to exit with an error if CPP does. * Makefile.am (.c.x): Delete the .x file and exit with an error status if guile-snarf exits with an error status. * Makefile.in: Regenerated. --- libguile/Makefile.am | 3 ++- libguile/Makefile.in | 3 ++- libguile/guile-snarf.in | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index b94510604..609d0935c 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -155,7 +155,8 @@ libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status SUFFIXES = .x .c.x: - ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ + ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \ + || (rm $@; false) ## Add -MG to make the .x magic work with auto-dep code. MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) diff --git a/libguile/Makefile.in b/libguile/Makefile.in index 6d4445cc4..70a804b94 100644 --- a/libguile/Makefile.in +++ b/libguile/Makefile.in @@ -691,7 +691,8 @@ libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status @echo '}' >> libpath.tmp @mv libpath.tmp libpath.h .c.x: - ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ + ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \ + || (rm $@; false) cpp_err_symbols.c: cpp_err_symbols.in $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \ diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in index b9a9a0cfc..0a776df71 100644 --- a/libguile/guile-snarf.in +++ b/libguile/guile-snarf.in @@ -1,9 +1,16 @@ #!/bin/sh # Extract the initialization actions for builtin things. +temp="/tmp/snarf.$$" +trap "rm -f $temp" 0 1 2 15 + ## Let the user override the preprocessor autoconf found. test -n "${CPP+set}" || CPP="@CPP@" -${CPP} -DSCM_MAGIC_SNARFER "$@" | grep "^ *% *% *%" | sed -e "s/^ *% *% *%//" + +## We must use a temporary file here, instead of a pipe, because we +## need to know if CPP exits with a non-zero status. +${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $? +< ${temp} grep "^ *% *% *%" | sed -e "s/^ *% *% *%//" ## Apparently, AIX's preprocessor is unhappy if you try to #include an ## empty file. -- 2.20.1