From 7f1c4e9abcb104d0f3c635c88fceb28ab1d42d84 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Tue, 21 Nov 2017 11:36:54 +0100 Subject: [PATCH] Make sure pkgconfig are analyzed before checking configuration --- rules.mk | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/rules.mk b/rules.mk index 4f4c0d9..15d85d7 100644 --- a/rules.mk +++ b/rules.mk @@ -396,6 +396,8 @@ endif NORM_CONFIG=$(subst <,.lt.,$(subst >,.gt.,$(subst /,.sl.,$(CONFIG)))) ORIG_TARGET=$(subst .lt.,<,$(subst .gt.,>,$(subst .sl.,/,$*))) +CONFIG_DEPS= $(MAKEFILE_DEPS) $(OBJDIR)/.mkdir \ + $(PKGCONFIGS:%=$(OBJROOT)/%.pkg-config.mk) config.h: $(NORM_CONFIG:%=$(OBJDIR)/HAVE_%) $(PRINT_GENERATE) cat $^ > $@ @@ -405,32 +407,32 @@ $(OBJDIR)/HAVE_%.mk: $(OBJDIR)/HAVE_% $(MAKEFILE_DEPS) -include $(NORM_CONFIG:%=$(OBJDIR)/HAVE_%.mk) # C standard headers, e.g. HAVE_ -$(OBJDIR)/HAVE_.lt.%.h.gt.: $(OBJDIR)/CONFIG_HAVE_%.c $(MAKEFILE_DEPS) +$(OBJDIR)/HAVE_.lt.%.h.gt.: $(OBJDIR)/CONFIG_HAVE_%.c $(CONFIG_DEPS) $(PRINT_CONFIG) $(CC_CONFIG) -$(OBJDIR)/CONFIG_HAVE_%.c: $(OBJDIR)/.mkdir $(MAKEFILE_DEPS) +$(OBJDIR)/CONFIG_HAVE_%.c: $(OBJDIR)/.mkdir $(CONFIG_DEPS) $(PRINT_COMMAND) echo '#include' "<$(ORIG_TARGET).h>" > "$@"; echo 'int main() { return 0; }' >> "$@" .PRECIOUS: $(OBJDIR)/CONFIG_HAVE_%.c # C++ Standard headers, e.g. HAVE_ -$(OBJDIR)/HAVE_.lt.%.gt.: $(OBJDIR)/CONFIG_HAVE_%.cpp $(MAKEFILE_DEPS) +$(OBJDIR)/HAVE_.lt.%.gt.: $(OBJDIR)/CONFIG_HAVE_%.cpp $(CONFIG_DEPS) $(PRINT_CONFIG) $(CXX_CONFIG) -$(OBJDIR)/CONFIG_HAVE_%.cpp: $(OBJDIR)/.mkdir $(MAKEFILE_DEPS) +$(OBJDIR)/CONFIG_HAVE_%.cpp: $(OBJDIR)/.mkdir $(CONFIG_DEPS) $(PRINT_COMMAND) echo '#include' "<$(ORIG_TARGET)>" > "$@"; echo 'int main() { return 0; }' >> "$@" .PRECIOUS: $(OBJDIR)/CONFIG_HAVE_%.cpp # Library -$(OBJDIR)/HAVE_lib%: $(OBJDIR)/CONFIG_LIB%.c $(MAKEFILE_DEPS) +$(OBJDIR)/HAVE_lib%: $(OBJDIR)/CONFIG_LIB%.c $(CONFIG_DEPS) $(PRINT_LIBCONFIG) $(LIB_CONFIG) -$(OBJDIR)/CONFIG_LIB%.c: $(OBJDIR)/.mkdir $(MAKEFILE_DEPS) +$(OBJDIR)/CONFIG_LIB%.c: $(OBJDIR)/.mkdir $(CONFIG_DEPS) $(PRINT_COMMAND) echo 'int main() { return 0; }' > "$@" .PRECIOUS: $(OBJDIR)/CONFIG_LIB%.c # Check if a function is present -$(OBJDIR)/HAVE_%: $(OBJDIR)/CONFIG_CHECK_%.c $(MAKEFILE_DEPS) +$(OBJDIR)/HAVE_%: $(OBJDIR)/CONFIG_CHECK_%.c $(CONFIG_DEPS) $(PRINT_CONFIG) $(FN_CONFIG) -$(OBJDIR)/CONFIG_CHECK_%.c: $(BUILD)config/check_%.c $(OBJDIR)/.mkdir $(MAKEFILE_DEPS) +$(OBJDIR)/CONFIG_CHECK_%.c: $(BUILD)config/check_%.c $(CONFIG_DEPS) $(PRINT_COPY) cp $< $@ -$(OBJDIR)/CONFIG_CHECK_%.c: config/check_%.c $(OBJDIR)/.mkdir $(MAKEFILE_DEPS) +$(OBJDIR)/CONFIG_CHECK_%.c: config/check_%.c $(CONFIG_DEPS) $(PRINT_COPY) cp $< $@ .PRECIOUS: $(OBJDIR)/CONFIG_CHECK_%.c