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
22 if [ -e /usr/lib/libdl.so -o -e /usr/lib/$MULTIARCH/libdl.so ]; then
33 LIBPATH="${1#--libpath=}"
40 PREFIX="${1#--prefix=}"
46 echo "Unknown option $1"
53 if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
54 LIBPATH=`pwd`/${LIBPATH:-..}
58 mkdir -p "$INCLUDEDIR/msp"
63 for i in $REQUIRED; do
64 path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -n1`
65 if [ -z "$path" -o ! -d "$path/source" ]; then
66 missing="$missing msp$i"
68 headers=`find $path/source \( -name windows -prune \) -o \( -name '*.h' -print \)`
70 rel=${j#$path/source/}
72 if [ "$comp" = "$rel" ]; then
75 mkdir -p "$INCLUDEDIR/msp/$comp"
76 ln -sf $j "$INCLUDEDIR/msp/$comp/"
78 sources="$sources `find $path/source \( -name windows -prune \) -o \( -name '*.cpp' -print \)`"
82 if [ ! -z "$missing" ]; then
83 echo "The following libraries were not found:$missing"
84 echo "I looked for them in $LIBPATH"
85 echo "If they are somewhere else, please add --libpath=PATH to the command line."
89 echo "Compiling builder-stage1. This may take several minutes."
92 obj=`mktemp temp/bootstrap/XXXXXX`
98 if [ -d "$dir/unix" ]; then
99 flags="$flags -iquote $dir -iquote $dir/unix"
101 $COMPILER -c $i -o $obj $flags
102 objects="$objects $obj"
104 $COMPILER $objects -o builder-stage1 $LIBS
106 if [ "$KEEP_TEMP" != "yes" ]; then
111 echo "Using builder-stage1 to compile builder."
113 if [ "$PREFIX" ]; then
114 ARGS="$ARGS --prefix='$PREFIX'"
116 eval "./builder-stage1 $ARGS"