Skip to content

Instantly share code, notes, and snippets.

@ober
Created July 2, 2022 11:36
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 ober/69f258935010f961fbb3a98fe273fa05 to your computer and use it in GitHub Desktop.
Save ober/69f258935010f961fbb3a98fe273fa05 to your computer and use it in GitHub Desktop.
OpenBSD gerbil/gambit builder
#!/bin/sh
set -eu
# OpenBSD builder
# pkg_add automake autoconf gcc-11 gmake
GERBIL_VERSION=v0.17
GAMBIT_VERSION=v4.9.4
GAMBIT_SRC=/opt/gambit-src
GERBIL_SRC=/opt/gerbil-src
DEBIAN_FRONTEND=noninteractive
GAMBIT_HOME=/opt/gambit
GERBIL_BUILD_CORES=4
GERBIL_HOME=/opt/gerbil
GERBIL_PATH=/src/.gerbil
export CFLAGS="-I/usr/local/include"
export CPPFLAGS="$CFLAGS"
export LDFLAGS="-L/usr/local/lib -lm"
export PATH=$GERBIL_HOME/bin:$GAMBIT_HOME/current/bin:$PATH
build-gambit(){
if [[ ! -d $GAMBIT_SRC ]]; then
git clone https://github.com/gambit/gambit /opt/gambit-src
fi
cd ${GAMBIT_SRC}
git fetch -a && git clean -xfd && git reset --hard
git checkout ${GAMBIT_VERSION}
./configure CC='egcc' --enable-default-runtime-options=f8,-8,t8 --enable-openssl=/usr/local/ --enable-multiple-versions --enable-single-host --prefix=${GAMBIT_HOME}
gmake -j${GERBIL_BUILD_CORES}
gmake bootstrap
gmake bootclean
gmake -j${GERBIL_BUILD_CORES}
gmake -j${GERBIL_BUILD_CORES} modules
gmake install
}
build-gerbil() {
if [[ ! -d ${GERBIL_SRC} ]]; then
git clone https://github.com/vyzo/gerbil ${GERBIL_SRC}
fi
alias gcc=/usr/local/bin/egcc
ln -s /usr/local/bin/egcc /usr/local/bin/gcc||true
cd ${GERBIL_SRC}/src
git fetch -a && git clean -xfd && git reset --hard
git checkout ${GERBIL_VERSION}
./configure \
--prefix=${GERBIL_HOME} \
--enable-leveldb \
--enable-libxml \
--enable-libyaml \
--enable-mysql \
--enable-lmdb
./build.sh
./install
}
build-gambit
build-gerbil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment