Pike Distribution on OSX

[ Start > PikeDevel > Pike Distribution on OSX ] [ Edit this Page | Show Page Versions | Show Raw Source ]

This procedure a fresh install of pike with all non-Apple dependencies as static libraries, so that they don't have to be installed on each machine.

Note: If you just care about installing Pike locally, homebrew has recipes for all of the dependencies you might need, as well as a (hopefully) up-to-date recipe for pike itself. There’s no need to follow this procedure if you can use homebrew… it’s a much quicker process: just do a  brew install pike. Also, the pkgsrc packaging system is available for OSX, and it generally does a better job of restricting package dependencies, and a pike build configuration is in final testing and will likely be available by the time you read this.

This process as-written also has a downside if you plan on installing external modules from source: The installed module build files will reference a bunch of paths from this build process, which likely won't exist on other machines, so you'd need to edit those files to correct the paths.

Dependencies included: gmp, nettle, jpeg, pcre, mariadb

Additional library dependencies may be included, as long as they are compiled as static libs (and without shared libs) and installed into the devel-$SDKVER directory before Pike is built. Do not, for example, install any libraries through Homebrew or other package managers.

Also, we're using the OSX 10.9 (Mavericks) SDK so that we can use the resulting Pike on any OSX machine running 10.9 and newer.

Note: This process can be used for other OS/SDK version combinations.

Note:  When using the 10.11 and 10.12 SDKs, the openssl headers and libs have been removed (they have been deprecated since 10.7). The OS still includes the dynamic libs, so to enable SSL support in the MariaDB/MySQL driver, you should copy /usr/lib/libssl* from the base OS and the headers from a configured copy of openssl 0.9.8z+ into the SDK and devel-10.12/include respectively.

Note: Some of the download links have changed since this article was written. It's recommended that newer versions of the dependent libraries be used. On arm64 systems, this may be required.

1. Install fresh OSX 10.9

2. Install Command line tools for Xcode from developer.apple.com (much smaller download)

3. Install HomeBrew

4. Turn off HomeBrew analytics

  brew analytics off

5. Install wget and xz

  brew install wget

brew install xz

brew install cmake

6. Make devel directory:

  mkdir $HOME/devel

cd $HOME/devel

7. Install MacOSX 10.9 SDK:

8. Create a environment settings file for building Pike and its dependencies called pike_env:

  cat << EOF > $HOME/devel/pike_env 
  CPPFLAGS="-isysroot $HOME/devel/MacOSX$SDKVER.sdk -I$HOME/devel/devel-$SDKVER/include" 
  export LOCALE LC_ALL 

9. Source the pike environment into the shell:

  . $HOME/devel/pike_env 

10. Download and install static gmp into SDK:

  cd $HOME/devel

wget https://gmplib.org/download/gmp/gmp-5.1.3.tar.xz

xz -d gmp-5.1.3.tar.xz

tar xvf gmp-5.1.3.tar

cd gmp-5.1.3.tar

./configure --with-pic --disable-shared --enable-static --prefix=$HOME/devel/devel-$SDKVER


make install

01. Download and install static nettle into SDK:

  cd $HOME/devel

wget https://ftp.gnu.org/gnu/nettle/nettle-3.3.tar.gz

tar zxvf nettle-3.3.tar.gz

cd nettle-3.3

./configure --disable-shared --enable-static --prefix=$HOME/devel/devel-$SDKVER


make install

12. Download and install static jpeglib into SDK:

  cd $HOME/devel

wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz

tar zxvf jpegsrc.v8d.tar.gz

cd jpeg-8d

./configure --disable-shared --enable-static --disable-dependency-tracking --prefix=$HOME/devel/devel-$SDKVER


make install

13. Download and install static pcre into SDK:

  wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz

tar xvf pcre-8.40.tar.gz

cd pcre-8.40

./configure --disable-shared --enable-static --disable-dependency-tracking --enable-utf8 --enable-pcre8 --enable-pcre16 --enable-pcre32 --enable-unicode-properties --enable-jit --prefix=$HOME/devel/devel-$SDKVER


make install

14. Download and install mariadb-connector-c into SDK:

  wget https://downloads.mariadb.org/interstitial/connector-c-2.3.2/mariadb-connector-c-2.3.2-src.tar.gz/from/http%3A//sfo1.mirrors.digitalocean.com/mariadb/

tar xzvf mariadb-connector-c-2.3.2-src.tar.gz

cd mariadb-connector-c-2.3.2-src


make all install

cp mariadb_config/mariadb_config /usr/local/bin

rm $HOME/devel/devel-$SDKVER/lib/mariadb/*.dylib

15. Download and install free type into SDK

  cd $HOME/devel

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.gz

tar xzvf freetype-2.5.5.tar.gz

cd freetype-2.5.5

./configure --disable-shared --enable-static --disable-dependency-tracking --prefix=$HOME/devel/devel-$SDKVER


make install

~~Note~: $HOME/devel/devel-$SDKVER/bin/freetype2-config  needs to be modified so that it returns the static lib options as the pike configure script doesn’t include the —static option.

16. Download and package Pike:

  cd $HOME/devel

wget http://pike.lysator.liu.se/pub/pike/latest-stable/Pike-v8.0.404.tar.gz

tar zxvf Pike-v8.0.404.tar.gz

cd Pike-v8.0.404


make verify

make bin_export

cd build/darwin-14.5.0-x86_64

17. Pike installer is located in build directory:

  ls -l Pike-v8.0.404-darwin-14.5.0-x86_64

Powered by PikeWiki2

gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University