Make sure pkgconfig are analyzed before checking configuration

This commit is contained in:
Christophe de Dinechin 2017-11-21 11:36:54 +01:00
parent 85baa3471d
commit 7f1c4e9abc
1 changed files with 11 additions and 9 deletions

View File

@ -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_<stdio.h>
$(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_<iostream>
$(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