X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=bootstrap.sh;h=b8531257a94a68b134cfadb8b4f31acd2b61406c;hb=HEAD;hp=02fbd33445a9735dd78e5c3c3d71f7446d54619d;hpb=c932c038879f7101eaba8ca123b39ef5c4330b65;p=builder.git diff --git a/bootstrap.sh b/bootstrap.sh index 02fbd33..b647568 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,9 +2,10 @@ set -e +SOURCEDIRS="source/lib source/bootstrap plugins/base plugins/gnu" INCLUDEDIR=temp/bootstrap/include REQUIRED="core datafile" -CFLAGS="-I$INCLUDEDIR `pkg-config --cflags sigc++-2.0`" +CFLAGS="-std=c++11 -iquote . -I$INCLUDEDIR `pkg-config --cflags sigc++-2.0`" LIBS="`pkg-config --libs sigc++-2.0` -lpthread" MACHINE="`uname -m`" SYSTEM="`uname -s`" @@ -66,13 +67,16 @@ while [ "$1" ]; do done if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then - LIBPATH=`pwd`/${LIBPATH:-..} + LIBPATH="$PWD/${LIBPATH:-..}" fi rm -rf "$INCLUDEDIR" mkdir -p "$INCLUDEDIR/msp" -sources=source/*.cpp +sources=`find $SOURCEDIRS -name '*.cpp'` + +mkdir -p "$INCLUDEDIR/msp/builder" +ln -sf "$PWD/source/lib"/*.h "$INCLUDEDIR/msp/builder/" use_overlays="unix generic" missing="" @@ -94,11 +98,10 @@ for i in $REQUIRED; do done findargs="$subdirs" if [ "$check_overlay" ]; then - findargs="$findargs -mindepth 1 ( -type d ! ( $check_overlay ) -prune ) ," + findargs="$findargs -mindepth 1 ( -type d ! ( $check_overlay ) -prune -false ) -o " fi - headers=`find $findargs -name '*.h'` - for j in $headers; do + for j in `find $findargs -name '*.h'`; do rel=${j#$path/source/} comp=${rel%%/*} if [ "$comp" = "$rel" ]; then @@ -133,9 +136,11 @@ for i in $sources; do break fi done + echo "Compiling $i" $COMPILER -c $DEBUG $i -o $obj $flags objects="$objects $obj" done +echo "Linking builder-stage1" $COMPILER $objects -o builder-stage1 $LIBS if [ "$KEEP_TEMP" != "yes" ]; then @@ -149,6 +154,6 @@ if [ "$PREFIX" ]; then ARGS="$ARGS --prefix='$PREFIX'" fi if [ "$CUSTOM_COMPILER" = "yes" ]; then - ARGS="$ARGS CXX=$COMPILER" + ARGS="$ARGS --compiler=$COMPILER" fi eval "./builder-stage1 $ARGS"