Ticket #8744: reconfigure2.patch

File reconfigure2.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
     13SAVE_CONFIGFLAGS=$@
     14SAVE_LDFLAGS=$LDFLAGS
     15SAVE_CXX=$CXX
     16SAVE_CXXFLAGS=$CXXFLAGS
     17SAVE_CPPFLAGS=$CPPFLAGS
    1218
    1319# use environment vars if set
    1420CXXFLAGS="$CXXFLAGS $CPPFLAGS"
     
    16251631OBJS += $OBJS
    16261632DEFINES += $DEFINES
    16271633LDFLAGS += $LDFLAGS
     1634
     1635SAVE_CONFIGFLAGS := $SAVE_CONFIGFLAGS
     1636SAVE_LDFLAGS     := $SAVE_LDFLAGS
     1637SAVE_CXX         := $SAVE_CXX
     1638SAVE_CXXFLAGS    := $SAVE_CXXFLAGS
     1639SAVE_CPPFLAGS    := $SAVE_CPPFLAGS
    16281640EOF
    16291641
    16301642#
  • 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 BACKEND
     48        @echo "Running $(srcdir)/configure with the last specified parameters"
     49        @sleep 2s
     50        @LDFLAGS=$(SAVE_LDFLAGS) CXX=$(SAVE_CXX) CXXFLAGS=$(SAVE_CXXFLAGS) CPPFLAGS=$(SAVE_CPPFLAGS) \
     51                $(srcdir)/configure $(SAVE_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)"