X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=bootstrap.sh;h=b647568cb0347aa3eb1ab77193ef7581af5fc01b;hb=HEAD;hp=b8531257a94a68b134cfadb8b4f31acd2b61406c;hpb=f0d8e265d9de06e56fb26b404c89515816b72b7b;p=builder.git diff --git a/bootstrap.sh b/bootstrap.sh index b853125..b647568 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,13 +2,11 @@ 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" -if pkg-config --exists "sigc++-2.0 >= 2.5.1"; then - CFLAGS="$CFLAGS -std=c++11" -fi MACHINE="`uname -m`" SYSTEM="`uname -s`" if [ "$MACHINE" = "x86_64" ]; then @@ -69,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="" @@ -100,8 +101,7 @@ for i in $REQUIRED; do 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 @@ -136,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 @@ -152,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"