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=}"
40 echo "Unknown option $1"
47 if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
48 LIBPATH=`pwd`/${LIBPATH:-..}
52 mkdir -p "$INCLUDEDIR/msp"
57 for i in $REQUIRED; do
58 path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -n1`
59 if [ -z "$path" -o ! -d "$path/source" ]; then
60 missing="$missing msp$i"
62 headers=`find $path/source \( -name windows -prune \) -o \( -name '*.h' -print \)`
64 rel=${j#$path/source/}
66 if [ "$comp" = "$rel" ]; then
69 mkdir -p "$INCLUDEDIR/msp/$comp"
70 ln -sf $j "$INCLUDEDIR/msp/$comp/"
72 sources="$sources `find $path/source \( -name windows -prune \) -o \( -name '*.cpp' -print \)`"
76 if [ ! -z "$missing" ]; then
77 echo "The following libraries were not found:$missing"
78 echo "I looked for them in $LIBPATH"
79 echo "If they are somewhere else, please add --libpath=PATH to the command line."
83 echo "Compiling builder-stage1. This may take several minutes."
86 obj=`mktemp --tmpdir=temp/bootstrap XXXXXX.o`
90 if [ -d "$dir/unix" ]; then
91 flags="$flags -iquote $dir -iquote $dir/unix"
93 g++ -c $i -o $obj $flags
94 objects="$objects $obj"
96 g++ $objects -o builder-stage1 $LIBS
98 if [ "$KEEP_TEMP" != "yes" ]; then
103 echo "Using builder-stage1 to compile builder."
105 if [ "$PREFIX" ]; then
106 ARGS="$ARGS --prefix='$PREFIX'"
108 eval "./builder-stage1 $ARGS"