Patch #1826459: Make: reconfigure on configure change (saving environment)
svn-id: r29435
This commit is contained in:
parent
443dff5285
commit
b820b661c7
2 changed files with 23 additions and 4 deletions
13
Makefile
13
Makefile
|
@ -16,7 +16,7 @@ MODULES :=
|
|||
MODULE_DIRS :=
|
||||
|
||||
# Load the make rules generated by configure
|
||||
include config.mk
|
||||
-include config.mk
|
||||
|
||||
CXXFLAGS:= -Wall $(CXXFLAGS)
|
||||
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas
|
||||
|
@ -44,9 +44,14 @@ include $(srcdir)/Makefile.common
|
|||
|
||||
# check if configure has been run or has been changed since last run
|
||||
config.mk: $(srcdir)/configure
|
||||
@echo "You need to run ./configure before you can run make"
|
||||
@echo "Either you haven't run it before or it has changed."
|
||||
@exit 1
|
||||
ifdef CONFIG_MK_IS_PRESENT
|
||||
@echo "Running $(srcdir)/configure with the last specified parameters"
|
||||
@sleep 2s
|
||||
@LDFLAGS=$(SAVED_LDFLAGS) CXX=$(SAVED_CXX) CXXFLAGS=$(SAVED_CXXFLAGS) CPPFLAGS=$(SAVED_CPPFLAGS) \
|
||||
$(srcdir)/configure $(SAVED_CONFIGFLAGS)
|
||||
else
|
||||
$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
|
||||
endif
|
||||
|
||||
install: all
|
||||
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
|
||||
|
|
14
configure
vendored
14
configure
vendored
|
@ -9,6 +9,12 @@
|
|||
# * detect whether the chosen backend is available (e.g. call sdl-config)
|
||||
# * ....
|
||||
|
||||
# Save the current environment variables for next runs
|
||||
SAVED_CONFIGFLAGS=$@
|
||||
SAVED_LDFLAGS=$LDFLAGS
|
||||
SAVED_CXX=$CXX
|
||||
SAVED_CXXFLAGS=$CXXFLAGS
|
||||
SAVED_CPPFLAGS=$CPPFLAGS
|
||||
|
||||
# use environment vars if set
|
||||
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
|
||||
|
@ -1625,6 +1631,14 @@ INCLUDES += $INCLUDES
|
|||
OBJS += $OBJS
|
||||
DEFINES += $DEFINES
|
||||
LDFLAGS += $LDFLAGS
|
||||
|
||||
SAVED_CONFIGFLAGS := $SAVED_CONFIGFLAGS
|
||||
SAVED_LDFLAGS := $SAVED_LDFLAGS
|
||||
SAVED_CXX := $SAVED_CXX
|
||||
SAVED_CXXFLAGS := $SAVED_CXXFLAGS
|
||||
SAVED_CPPFLAGS := $SAVED_CPPFLAGS
|
||||
|
||||
CONFIG_MK_IS_PRESENT := 1
|
||||
EOF
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue