diff --git a/INSTALL.md b/INSTALL.md index 164fb3de..37210cab 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 d2eb57c0..265055f8 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) -ifeq ($(COMPRESS_CORE),yes) -COMPRESS_CORE_OPT = --compress-core -else -COMPRESS_CORE_OPT = -endif +COMPRESS_CORE ?= $(shell $(CL) --noinform \ + --quit \ + --eval '(when (member :sb-core-compression cl:*features*) (write-string "yes"))') + endif -ifeq ($(CL),sbcl) -BUILDAPP_OPTS = --require sb-posix \ - --require sb-bsd-sockets \ - --require sb-rotate-byte +# note: on Windows_NT, we never core-compress; see above. +ifeq ($(COMPRESS_CORE),yes) +COMPRESS_CORE_OPT = --compress-core endif DEBUILD_ROOT = /tmp/pgloader diff --git a/README.md b/README.md index b79183b0..c8f68f3e 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