From 6dcdf4711b5e7d935dccc38384738782e3a28a2d Mon Sep 17 00:00:00 2001 From: Richard Michael Date: Fri, 11 Dec 2015 18:34:33 -0500 Subject: [PATCH] Easier install by detecting SBCL core-compression. Various Linux distributions provide SBCL without core-compression enabled. On the other hand, Mac OSX (at least via `homebrew`) SBCL with core-compression enabled. To make installation easier, teach the make process to detect core-compression, and use it if possible. --- INSTALL.md | 7 +++---- Makefile | 25 ++++++++++++------------- README.md | 10 +++------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 164fb3d..37210ca 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -60,9 +60,9 @@ Now that the dependences are installed, just type make. make -If using Mac OS X, and depending on how you did install `SBCL` and which -version you have (the brew default did change recently), you might need to -ask the Makefile to refrain from trying to compress your binary image: +If your `SBCL` supports core compression, the make process will use it +to generate a smaller binary. To force disabling core compression, you +may use: make COMPRESS_CORE=no @@ -101,4 +101,3 @@ The `build` step install build dependencies in a debian jessie container, then `git clone` and build `pgloader` in `/opt/src/pgloader` and finally copy the resulting binary image in `/usr/local/bin/pgloader` so that it's easily available. - diff --git a/Makefile b/Makefile index d2eb57c..265055f 100644 --- a/Makefile +++ b/Makefile @@ -35,27 +35,26 @@ BUILDAPP_CCL = $(BUILDDIR)/bin/buildapp.ccl$(EXE) BUILDAPP_SBCL = $(BUILDDIR)/bin/buildapp.sbcl$(EXE) ifeq ($(CL),sbcl) -BUILDAPP = $(BUILDAPP_SBCL) -CL_OPTS = --no-sysinit --no-userinit +BUILDAPP = $(BUILDAPP_SBCL) +BUILDAPP_OPTS = --require sb-posix \ + --require sb-bsd-sockets \ + --require sb-rotate-byte +CL_OPTS = --noinform --no-sysinit --no-userinit else BUILDAPP = $(BUILDAPP_CCL) CL_OPTS = --no-init endif -COMPRESS_CORE ?= yes - ifeq ($(CL),sbcl) +COMPRESS_CORE ?= $(shell $(CL) --noinform \ + --quit \ + --eval '(when (member :sb-core-compression cl:*features*) (write-string "yes"))') + +endif + +# note: on Windows_NT, we never core-compress; see above. ifeq ($(COMPRESS_CORE),yes) COMPRESS_CORE_OPT = --compress-core -else -COMPRESS_CORE_OPT = -endif -endif - -ifeq ($(CL),sbcl) -BUILDAPP_OPTS = --require sb-posix \ - --require sb-bsd-sockets \ - --require sb-rotate-byte endif DEBUILD_ROOT = /tmp/pgloader diff --git a/README.md b/README.md index b79183b..c8f68f3 100644 --- a/README.md +++ b/README.md @@ -103,13 +103,9 @@ binary image, though it's possible to build using $ make CL=ccl pgloader -Note that the `Makefile` uses the `--compress-core` option when using SBCL, -that should be enabled in your local copy of `SBCL`. If that's not the case, -it's probably because you did compile and install `SBCL` yourself, so that -you have a decently recent version to use. Then you need to compile it with -the `--with-sb-core-compression` option. - -You can also remove the `--compress-core` option that way: +If using `SBCL` and it supports core compression, the make process will +use it to generate a smaller binary. To force disabling core +compression, you may use: $ make COMPRESS_CORE=no pgloader