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" -o "$SYSTEM" = "FreeBSD" ]; 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=}"
55 COMPILER="${1#--compiler=}"
62 echo "Unknown option $1"
69 if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
70 LIBPATH=`pwd`/${LIBPATH:-..}
74 mkdir -p "$INCLUDEDIR/msp"
79 for i in $REQUIRED; do
80 path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -n1`
81 if [ -z "$path" -o ! -d "$path/source" ]; then
82 missing="$missing msp$i"
84 headers=`find $path/source \( -name windows -prune \) -o \( -name '*.h' -print \)`
86 rel=${j#$path/source/}
88 if [ "$comp" = "$rel" ]; then
91 mkdir -p "$INCLUDEDIR/msp/$comp"
92 ln -sf $j "$INCLUDEDIR/msp/$comp/"
94 sources="$sources `find $path/source \( -name windows -prune \) -o \( -name '*.cpp' -print \)`"
98 if [ ! -z "$missing" ]; then
99 echo "The following libraries were not found:$missing"
100 echo "I looked for them in $LIBPATH"
101 echo "If they are somewhere else, please add --libpath=PATH to the command line."
105 echo "Compiling builder-stage1. This may take several minutes."
107 for i in $sources; do
108 obj=`mktemp temp/bootstrap/XXXXXX`
114 if [ -d "$dir/unix" ]; then
115 flags="$flags -iquote $dir -iquote $dir/unix"
117 $COMPILER -c $DEBUG $i -o $obj $flags
118 objects="$objects $obj"
120 $COMPILER $objects -o builder-stage1 $LIBS
122 if [ "$KEEP_TEMP" != "yes" ]; then
127 echo "Using builder-stage1 to compile builder."
129 if [ "$PREFIX" ]; then
130 ARGS="$ARGS --prefix='$PREFIX'"
132 if [ "$CUSTOM_COMPILER" = "yes" ]; then
133 ARGS="$ARGS CXX=$COMPILER"
135 eval "./builder-stage1 $ARGS"