From 3293ab17f8300cc95cf82366770553056fdeccc1 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Tue, 2 May 2017 15:47:11 +0200 Subject: [PATCH] Link and execute the test program for completeness --- config.gnu.mk | 4 ++-- rules.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.gnu.mk b/config.gnu.mk index 51a7a33..bf4a73a 100644 --- a/config.gnu.mk +++ b/config.gnu.mk @@ -84,5 +84,5 @@ AS_DEPEND= $(CC) $(CPPFLAGS) $(CPPFLAGS_$*) -MM -MP -MF $@ -MT $(@:.d=) $< # Configuration checks #------------------------------------------------------------------------------ -CC_CONFIG= mkdir -p "$$(dirname "$@")" ; echo '\#define HAVE_$*_H' $$($(CC) $(CFLAGS) -Werror -c "$<" -o "$<".o > "$<".err 2>&1 && echo 1 || echo 0) | tr '[:lower:]' '[:upper:]' | sed -e 's|[^[:alnum:]]|_|g' -e 's|_DEFINE_\(.*\)_0|/* \#undef \1 */|g' -e 's|_DEFINE_\(.*\)_1|\#define \1 1|g' > "$@" -CXX_CONFIG= mkdir -p "$$(dirname "$@")" ; echo '\#define HAVE_$*' $$($(CXX) $(CXXFLAGS) -Werror -c "$<" -o "$<".o > "$<".err 2>&1 && echo 1 || echo 0) | tr '[:lower:]' '[:upper:]' | sed -e 's|[^[:alnum:]]|_|g' -e 's|_DEFINE_\(.*\)_0|/* \#undef \1 */|g' -e 's|_DEFINE_\(.*\)_1|\#define \1 1|g' > "$@" +CC_CONFIG= mkdir -p "$$(dirname "$@")" ; echo '\#define HAVE_$*_H' $$($(CC) $(CFLAGS) "$<" -o "$<".exe > "$<".err 2>&1 && "$<".exe && echo 1 || echo 0) | tr '[:lower:]' '[:upper:]' | sed -e 's|[^[:alnum:]]|_|g' -e 's|_DEFINE_\(.*\)_0|/* \#undef \1 */|g' -e 's|_DEFINE_\(.*\)_1|\#define \1 1|g' > "$@" +CXX_CONFIG= mkdir -p "$$(dirname "$@")" ; echo '\#define HAVE_$*' $$($(CXX) $(CXXFLAGS) "$<" -o "$<".exe > "$<".err 2>&1 && "$<".exe && echo 1 || echo 0) | tr '[:lower:]' '[:upper:]' | sed -e 's|[^[:alnum:]]|_|g' -e 's|_DEFINE_\(.*\)_0|/* \#undef \1 */|g' -e 's|_DEFINE_\(.*\)_1|\#define \1 1|g' > "$@" diff --git a/rules.mk b/rules.mk index 1447ed7..c354cb9 100644 --- a/rules.mk +++ b/rules.mk @@ -375,13 +375,13 @@ config.h: $(CONFIG:%=$(OBJDIR)/%) $(OBJDIR)/HAVE_<%.h>: $(OBJDIR)/CONFIG_HAVE_%.c $(PRINT_CONFIG) $(CC_CONFIG) $(OBJDIR)/CONFIG_HAVE_%.c: $(OBJDIR)/.mkdir - $(PRINT_GENERATE) mkdir -p "$$(dirname "$@")" ; echo '#include' "<$*.h>" > "$@" + $(PRINT_GENERATE) mkdir -p "$$(dirname "$@")" ; echo '#include' "<$*.h>" > "$@"; echo 'int main() { return 0; }' >> "$@" # C++ Standard headers, e.g. HAVE_ $(OBJDIR)/HAVE_<%>: $(OBJDIR)/CONFIG_HAVE_%.cpp $(PRINT_CONFIG) $(CXX_CONFIG) $(OBJDIR)/CONFIG_HAVE_%.cpp: $(OBJDIR)/.mkdir - $(PRINT_GENERATE) mkdir -p "$$(dirname "$@")" ; echo '#include' "<$*>" > "$@" + $(PRINT_GENERATE) mkdir -p "$$(dirname "$@")" ; echo '#include' "<$*>" > "$@"; echo 'int main() { return 0; }' >> "$@" # Check if a function is present $(OBJDIR)/HAVE_%: $(OBJDIR)/CONFIG_CHECK_%.c