Skip to content

Instantly share code, notes, and snippets.

@cryptorick
Last active February 26, 2017 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryptorick/4751704217ded2484aac50bb02cb2e1a to your computer and use it in GitHub Desktop.
Save cryptorick/4751704217ded2484aac50bb02cb2e1a to your computer and use it in GitHub Desktop.
Building XS on OpenBSD 6.0

Building XS on OpenBSD

These are some notes on building XS on OpenBSD 6.0. YMMV with other versions (maybe). They follow the build routine outlined in the INSTALL document.

NOTE: Prefixes for install target directories (established by the --prefix option in configure) are not discussed -- this seems to be more of a personal preference for people, even though I must mention that the OpenBSD package manager installs its bits into /usr/local/bin; so, you may not want to use that for your prefix. However, I gather, from reading the openbsd-misc mailing list, that some experienced users still install non-package-manager software there also. Your choice.

Prerequisite

As a prerequisite, you might have to pkg_add the following (I'm not sure, because I didn't start from a clean OpenBSD install; so this is a "best guess"): autoconf, automake, boehm-gc, boost, gmake.

Build

Get the source.

$ git clone https://github.com/frytvm/XS.git
$ cd XS

Running autoreconf -i (as it says to do in INSTALL) should fail, e.g.

$ autoreconf -i
Provide an AUTOCONF_VERSION environment variable, please

unless you set the variables AUTOCONF_VERSION and AUTOCONF_VERSION.

$ export AUTOCONF_VERSION=$(ls -1 $(whence autoconf)-* | tail -1 | awk -F- '{print $NF}') 
$ export AUTOMAKE_VERSION=$(ls -1 $(whence automake)-* | tail -1 | awk -F- '{print $NF}')

To confirm this worked, you should get something like this output now:

$ echo AUTOCONF_VERSION=$AUTOCONF_VERSION AUTOMAKE_VERSION=$AUTOMAKE_VERSION
AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.15

Now, do it. It should work.

$ autoreconf -i

configure should be run by setting some variables in its invocation, because gcc and g++ built for the OpenBSD base system do not search the /usr/local/... directories (where the dependencies installed via the package manager live).

$ ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2 -I/usr/local/include" LDFLAGS="-L/usr/local/lib"

make is run as usual, but you should probably run GNU make. make is OpenBSD's make. If you installed the gmake package, you can do this.

$ gmake

Test

gmake test will fail because AFAIK there is no /dev/shm on OpenBSD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment