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
27 LIBPATH="${1#--libpath=}"
34 PREFIX="${1#--prefix=}"
37 echo "Unknown option $1"
44 if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
45 LIBPATH=`pwd`/${LIBPATH:-..}
49 mkdir -p "$INCLUDEDIR/msp"
54 for i in $REQUIRED; do
55 path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -n1`
56 if [ -z "$path" -o ! -d "$path/source" ]; then
57 missing="$missing msp$i"
59 if [ $i = "core" ]; then
60 ln -sf $path/source/* "$INCLUDEDIR/msp/"
62 ln -sf $path/source "$INCLUDEDIR/msp/$i"
64 sources="$sources `find $path/source -name '*.cpp'`"
68 if [ ! -z "$missing" ]; then
69 echo "The following libraries were not found:$missing"
70 echo "I looked for them in $LIBPATH"
71 echo "If they are somewhere else, please add --libpath=PATH to the command line."
75 echo "Compiling builder-stage1. This may take several minutes."
76 g++ $sources -o builder-stage1 $CFLAGS $LIBS
77 echo "Using builder-stage1 to compile builder."
79 if [ "$PREFIX" ]; then
80 ARGS="$ARGS --prefix='$PREFIX'"
82 eval "./builder-stage1 $ARGS"