Ticket #8744: reconfigure3.patch

File reconfigure3.patch, 1.8 KB (added by jvprat, 17 years ago)
  • configure

     
    99# * detect whether the chosen backend is available (e.g. call sdl-config)
    1010# * ....
    1111
     12# Save the current environment variables for next runs
     13SAVED_CONFIGFLAGS=$@
     14SAVED_LDFLAGS=$LDFLAGS
     15SAVED_CXX=$CXX
     16SAVED_CXXFLAGS=$CXXFLAGS
     17SAVED_CPPFLAGS=$CPPFLAGS
    1218
    1319# use environment vars if set
    1420CXXFLAGS="$CXXFLAGS $CPPFLAGS"
     
    16251631OBJS += $OBJS
    16261632DEFINES += $DEFINES
    16271633LDFLAGS += $LDFLAGS
     1634
     1635SAVED_CONFIGFLAGS := $SAVED_CONFIGFLAGS
     1636SAVED_LDFLAGS     := $SAVED_LDFLAGS
     1637SAVED_CXX         := $SAVED_CXX
     1638SAVED_CXXFLAGS    := $SAVED_CXXFLAGS
     1639SAVED_CPPFLAGS    := $SAVED_CPPFLAGS
     1640
     1641CONFIG_MAK_IS_PRESENT := 1
    16281642EOF
    16291643
    16301644#
  • Makefile

     
    1616MODULE_DIRS :=
    1717
    1818# Load the make rules generated by configure
    19 include config.mk
     19-include config.mk
    2020
    2121CXXFLAGS:= -Wall $(CXXFLAGS)
    2222CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas
     
    4444
    4545# check if configure has been run or has been changed since last run
    4646config.mk: $(srcdir)/configure
    47         @echo "You need to run ./configure before you can run make"
    48         @echo "Either you haven't run it before or it has changed."
    49         @exit 1
     47ifdef CONFIG_MAK_IS_PRESENT
     48        @echo "Running $(srcdir)/configure with the last specified parameters"
     49        @sleep 2s
     50        @LDFLAGS=$(SAVED_LDFLAGS) CXX=$(SAVED_CXX) CXXFLAGS=$(SAVED_CXXFLAGS) CPPFLAGS=$(SAVED_CPPFLAGS) \
     51                $(srcdir)/configure $(SAVED_CONFIGFLAGS)
     52else
     53        $(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
     54endif
    5055
    5156install: all
    5257        $(INSTALL) -d "$(DESTDIR)$(BINDIR)"