~ chicken-core (chicken-5) 5599f26f0761791d4940a82f674a46eb5eb8b996


commit 5599f26f0761791d4940a82f674a46eb5eb8b996
Author:     unknown <felix@.(none)>
AuthorDate: Wed Nov 4 09:49:01 2009 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Nov 23 17:51:25 2009 +0100

    allow using config-file for make variables

diff --git a/Makefile b/Makefile
index f1aaa31a..947963ac 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,11 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
+
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 STANDARD_TARGETS \
 	= all clean distclean spotless install uninstall confclean check \
 	  fullcheck dist libs bootstrap
@@ -51,30 +56,28 @@ $(STANDARD_TARGETS):
 	@exit 1
 else
 all:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) all
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) all
 clean:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) clean
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) clean
 distclean:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) distclean
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) distclean
 spotless:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) spotless
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) spotless
 install:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) install
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) install
 uninstall:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) uninstall
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) uninstall
 confclean:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) confclean
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) confclean
 check:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) check
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) check
 fullcheck:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) fullcheck
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) fullcheck
 dist:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) distfiles
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) distfiles
 	csi -s scripts/makedist.scm
 libs:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) libs
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) libs
 bootstrap:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) bootstrap
-bench:
-	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) bench
+	$(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) bootstrap
 endif
diff --git a/Makefile.bsd b/Makefile.bsd
index 84307e27..8151479e 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR = ./
 
 # platform configuration
diff --git a/Makefile.cross-linux-mingw b/Makefile.cross-linux-mingw
index 1f246059..7ebb077d 100644
--- a/Makefile.cross-linux-mingw
+++ b/Makefile.cross-linux-mingw
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR = ./
 
 # platform configuration
diff --git a/Makefile.cygwin b/Makefile.cygwin
index 5c693c4c..33a8fb07 100644
--- a/Makefile.cygwin
+++ b/Makefile.cygwin
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR = ./
 
 # platform configuration
diff --git a/Makefile.linux b/Makefile.linux
index c8506b9c..dc3f320e 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR ?= ./
 
 # platform configuration
diff --git a/Makefile.macosx b/Makefile.macosx
index bf3f59ea..eb849cd8 100644
--- a/Makefile.macosx
+++ b/Makefile.macosx
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR = ./
 
 # platform configuration
diff --git a/Makefile.mingw b/Makefile.mingw
index 45bc7fae..fac617a9 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SEP = $(strip \)
 SRCDIR =.$(SEP)
 
diff --git a/Makefile.mingw-msys b/Makefile.mingw-msys
index 116b3d80..d1162c0c 100644
--- a/Makefile.mingw-msys
+++ b/Makefile.mingw-msys
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR = ./
 
 # platform configuration
diff --git a/Makefile.solaris b/Makefile.solaris
index 8987282a..6d90072a 100644
--- a/Makefile.solaris
+++ b/Makefile.solaris
@@ -25,6 +25,10 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
 SRCDIR = ./
 
 # platform configuration
diff --git a/README b/README
index 448c142a..00cb58d8 100644
--- a/README
+++ b/README
@@ -186,6 +186,12 @@
 	  When VARDIR is specified, extensions will be stored in
 	  "<VARDIR>/chicken/<BINARYVERSION>", conforming to the FHS.
 
+	CONFIG=
+	  If you build CHICKEN often, passing all those make variables
+	  can get annoying. An alternative is to create a configuration
+	  file defining the required variables and passing "CONFIG=<configfile>"
+	  to make(1).
+
 
         To remove CHICKEN from your file-system, enter (probably as
         root):
diff --git a/rules.make b/rules.make
index dbf64bcb..3488f10a 100644
--- a/rules.make
+++ b/rules.make
@@ -852,8 +852,8 @@ install:
 	  $(CHICKEN_STATUS_PROGRAM)$(EXE) $(CHICKEN_SETUP_PROGRAM)$(EXE) \
 	  $(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE) \
 	  $(IMPORT_LIBRARIES:%=%.so) $(IMPORT_LIBRARIES:%=%.import.so)
-	$(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) \
-	  SONAME_VERSION=.$(BINARYVERSION) install
+	$(MAKE) -f CONFIG=$(CONFIG) $(SRCDIR)Makefile.$(PLATFORM) NEEDS_RELINKING=no \
+	  RUNTIME_LINKER_PATH=$(LIBDIR) SONAME_VERSION=.$(BINARYVERSION) install
 	$(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) \
 	  $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)
 ifndef STATICBUILD
@@ -1334,11 +1334,12 @@ compiler-check:
 bootstrap: 
 	gzip -d -c $(SRCDIR)bootstrap.tar.gz | tar xvf -
 	touch *.c
-	$(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 DEBUGBUILD=1 PLATFORM=$(PLATFORM) \
-	  chicken$(EXE)
+	$(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) STATICBUILD=1 \
+	  DEBUGBUILD=1 PLATFORM=$(PLATFORM) chicken$(EXE)
 	$(COPY_COMMAND) chicken$(EXE) chicken-boot$(EXE)
 	touch *.scm
-	$(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) PLATFORM=$(PLATFORM) confclean
+	$(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) PLATFORM=$(PLATFORM) \
+	  confclean
 
 $(SRCDIR)bootstrap.tar.gz: distfiles
 	tar cfz $@ library.c eval.c data-structures.c ports.c files.c extras.c lolevel.c utils.c tcp.c \
Trap