Skip to content

Instantly share code, notes, and snippets.

@mattintosh4
Last active December 16, 2015 18:49
Show Gist options
  • Save mattintosh4/5480820 to your computer and use it in GitHub Desktop.
Save mattintosh4/5480820 to your computer and use it in GitHub Desktop.
  1. m4 with --program-prefix=g.
    after installation, export M4=/usr/local/bin/gm4.
  • autoconf
  • automake
  • libtool with --program-prefix=g
    after installation, export LIBTOOL=/usr/local/bin/glibtool
    export LIBTOOLIZE=/usr/local/bin/glibtoolize.
  • pkg-config with --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig.
  • gettext
  • libffi
  • glib
  • freetype
  • libpng
  • nasm
  • libjpeg-turbo
  • tiff
  • jasper
  • libicns

Env

CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -I/usr/local/include"
LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -L/usr/local/lib"
#!/bin/bash
which git || exit
ditto /usr/local/src/repos/freetype /tmp/build/freetype &&
cd $_ &&
git checkout -f master &&
# note: /usr/bin/glibtool (2.2.4) can't installed shared libraries
sh autogen.sh && # libtool 2.4.2, Autotools 2.69
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/usr/bin/env - LC_ALL=C SHELL=/bin/bash bash -x
readonly name=gdb-7.6
readonly prefix=/usr/local
readonly source=/usr/local/src/tarballs/${name}.tar.bz2
readonly workdir=/tmp/build
readonly sdkroot=/Developer/SDKs/MacOSX10.6.sdk
export PATH=${prefix}/bin:${prefix}/sbin:/usr/bin:/bin:/usr/sbin:/sbin
export CC="${prefix}/gcc48/bin/gcc"
export CXX="${prefix}/gcc48/bin/g++"
export CFLAGS="-arch ${HOSTTYPE} -pipe -O3 -march=core2 -mtune=core2 -mmacosx-version-min=$(sw_vers -productVersion)"
export CXXFLAGS="${CFLAGS}"
export CPPFLAGS="-isysroot ${sdkroot} -I${prefix}/include"
export LDFLAGS="-Wl,-syslibroot,${sdkroot} -L${prefix}/lib"
[ -x ${MAKE=${prefix}/bin/make} ] && export MAKE || :
[ -x ${OBJDUMP=${prefix}/bin/gobjdump} ] && export OBJDUMP || :
[ -x ${OBJCOPY=${prefix}/bin/gobjcopy} ] && export OBJCOPY || :
install -d ${workdir} &&
cd ${workdir} &&
test ! -d ${name} || rm -rf ${name}
tar -x -f ${source} &&
cd ${name} &&
./configure \
--prefix=${prefix} \
--build=${MACHTYPE} \
--disable-libstdcxx \
--disable-isl-version-check \
--disable-cloog-version-check \
--enable-lto \
--enable-objc-gc \
--with-mpc=${prefix} \
--with-mpfr=${prefix} \
--with-gmp=${prefix} \
--with-cloog=${prefix} \
--with-isl=${prefix} \
--with-host-libstdcxx=-lstdc++ \
&&
make &&
make install || exit 1
#!/bin/bash
install -d /tmp/build &&
cd $_ &&
tar -xf /usr/local/src/tarballs/gettext-0.18.2.tar.gz &&
cd gettext-0.18.2 &&
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
ditto /usr/local/src/repos/glib /tmp/build/glib &&
cd $_ &&
git checkout -f 2.36.1 &&
# note: autogen.sh will find /usr/bin/libtool (2.2.4), but it does not work
LIBTOOL=/usr/local/bin/glibtool LIBTOOLIZE=/usr/local/bin/glibtoolize sh autogen.sh --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 --disable-gtk-doc &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
ditto /usr/local/src/repos/libffi /tmp/build/libffi &&
cd $_ &&
git checkout -f master &&
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
which git || exit
ditto /usr/local/src/repos/libpng /tmp/build/libpng &&
cd $_ &&
git checkout -f libpng16 &&
autoreconf -i && # autoreconf => autoreconf-2.69
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
install -d /tmp/build &&
cd $_ &&
tar -xf /usr/local/src/tarballs/libtool-2.4.2.tar.gz &&
cd libtool-2.4.2 &&
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 --program-prefix=g &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
which gettext || exit
install -d /tmp/build &&
cd $_ &&
tar -xf /usr/local/src/tarballs/nano-2.2.6.tar.gz &&
cd nano-2.2.6 &&
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
install -d /tmp/build &&
cd $_ &&
tar -xf /usr/local/src/tarballs/pkg-config-0.28.tar.gz &&
cd pkg-config-0.28 &&
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 \
--disable-debug \
--disable-host-tool \
--with-internal-glib \
--with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig &&
make -j $(sysctl -n hw.ncpu) &&
make install
#!/bin/bash
install -d /tmp/build &&
cd $_ &&
tar -xf /usr/local/src/tarballs/readline-6.2.tar.gz &&
cd readline-6.2 &&
# note: GCC 4.8.1 failed to build?
./configure --prefix=/usr/local --build=x86_64-apple-darwin10.8.0 --with-curses CC="/usr/local/bin/clang" CXX="/usr/local/bin/clang++" &&
make -j $(sysctl -n hw.ncpu) &&
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment