6 INCLUDEDIR=temp/bootstrap/include
7 REQUIRED="core datafile"
8 CFLAGS="-I$INCLUDEDIR `pkg-config --cflags sigc++-2.0`"
9 LIBS="`pkg-config --libs sigc++-2.0` -lpthread"
12 if [ "$MACHINE" = "x86_64" ]; then
13 MULTIARCH="x86_64-linux-gnu"
15 MULTIARCH="i386-linux-gnu"
17 if [ "$SYSTEM" = "Darwin" ]; then
18 if which clang++ >/dev/null; then
26 if [ -e /usr/lib/libdl.so -o -e /usr/lib/$MULTIARCH/libdl.so ]; then
37 LIBPATH="${1#--libpath=}"
44 PREFIX="${1#--prefix=}"
50 echo "Unknown option $1"
57 if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
58 LIBPATH=`pwd`/${LIBPATH:-..}
62 mkdir -p "$INCLUDEDIR/msp"
67 for i in $REQUIRED; do
68 path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -n1`
69 if [ -z "$path" -o ! -d "$path/source" ]; then
70 missing="$missing msp$i"
72 headers=`find $path/source \( -name windows -prune \) -o \( -name '*.h' -print \)`
74 rel=${j#$path/source/}
76 if [ "$comp" = "$rel" ]; then
79 mkdir -p "$INCLUDEDIR/msp/$comp"
80 ln -sf $j "$INCLUDEDIR/msp/$comp/"
82 sources="$sources `find $path/source \( -name windows -prune \) -o \( -name '*.cpp' -print \)`"
86 if [ ! -z "$missing" ]; then
87 echo "The following libraries were not found:$missing"
88 echo "I looked for them in $LIBPATH"
89 echo "If they are somewhere else, please add --libpath=PATH to the command line."
93 echo "Compiling builder-stage1. This may take several minutes."
96 obj=`mktemp temp/bootstrap/XXXXXX`
102 if [ -d "$dir/unix" ]; then
103 flags="$flags -iquote $dir -iquote $dir/unix"
105 $COMPILER -c $i -o $obj $flags
106 objects="$objects $obj"
108 $COMPILER $objects -o builder-stage1 $LIBS
110 if [ "$KEEP_TEMP" != "yes" ]; then
115 echo "Using builder-stage1 to compile builder."
117 if [ "$PREFIX" ]; then
118 ARGS="$ARGS --prefix='$PREFIX'"
120 eval "./builder-stage1 $ARGS"