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"
11 if [ "$MACHINE" = "x86_64" ]; then
12 MULTIARCH="x86_64-linux-gnu"
14 MULTIARCH="i386-linux-gnu"
16 if [ -e /usr/lib/libdl.so -o -e /usr/lib/$MULTIARCH/libdl.so ]; then
19 if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
20 LIBPATH=`pwd`/${LIBPATH:-..}
24 mkdir -p "$INCLUDEDIR/msp"
29 for i in $REQUIRED; do
30 path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -n1`
31 if [ -z "$path" -o ! -d "$path/source" ]; then
32 missing="$missing msp$i"
34 if [ $i = "core" ]; then
35 ln -sf $path/source/* "$INCLUDEDIR/msp/"
37 ln -sf $path/source "$INCLUDEDIR/msp/$i"
39 sources="$sources `find $path/source -name '*.cpp'`"
43 if [ ! -z "$missing" ]; then
44 echo "The following libraries were not found:$missing"
45 echo "I looked for them in $LIBPATH"
46 echo "If they are somewhere else, please adjust the LIBPATH environment variable."
50 echo "Compiling builder-stage1. This may take several minutes."
51 g++ $sources -o builder-stage1 $CFLAGS $LIBS
52 echo "Using builder-stage1 to compile builder."