Skip to content

Commit

Permalink
Easier install by detecting SBCL core-compression.
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
richardkmichael committed Jan 10, 2016
1 parent d60b64c commit 6dcdf47
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
7 changes: 3 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

25 changes: 12 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6dcdf47

Please sign in to comment.