| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | NAME="[boost]" |
|---|
| 4 | WORKING_DIR="boost/boost_1_60_0" |
|---|
| 5 | |
|---|
| 6 | BUILD_DIR=build |
|---|
| 7 | STAGE_DIR=stage |
|---|
| 8 | TEMP_INC_DIR="stripped_orxonox" |
|---|
| 9 | |
|---|
| 10 | source ./build_common.sh |
|---|
| 11 | |
|---|
| 12 | if [ $DO_CLEAN -eq 1 ] |
|---|
| 13 | then |
|---|
| 14 | rm -rf $BUILD_DIR |
|---|
| 15 | check_result $? "cleaning build dir" |
|---|
| 16 | rm -rf $STAGE_DIR |
|---|
| 17 | check_result $? "cleaning stage dir" |
|---|
| 18 | rm -rf "bin.v2" |
|---|
| 19 | check_result $? "cleaning dist dir" |
|---|
| 20 | rm -rf "dist" |
|---|
| 21 | check_result $? "cleaning dist dir" |
|---|
| 22 | rm -rf "tools/build/src/engine/bin.ntx86" |
|---|
| 23 | check_result $? "cleaning dist dir" |
|---|
| 24 | rm -rf "tools/build/src/engine/bootstrap" |
|---|
| 25 | check_result $? "cleaning dist dir" |
|---|
| 26 | rm -rf "libs/config/checks/architecture/bin" |
|---|
| 27 | check_result $? "cleaning dist dir" |
|---|
| 28 | rm -rf $TEMP_INC_DIR |
|---|
| 29 | check_result $? "cleaning temp include dir" |
|---|
| 30 | fi |
|---|
| 31 | |
|---|
| 32 | if [ $DO_BUILD -eq 1 ] |
|---|
| 33 | then |
|---|
| 34 | # build bjam |
|---|
| 35 | ./bootstrap.bat |
|---|
| 36 | check_result $? "bootstrap" |
|---|
| 37 | |
|---|
| 38 | # compile libraries |
|---|
| 39 | ./b2 --build-dir=$BUILD_DIR --stagedir=$STAGE_DIR toolset=gcc variant=release link=shared threading=multi --build-type=complete stage -j8 \ |
|---|
| 40 | --with-thread --with-filesystem --with-system --with-date_time --with-atomic |
|---|
| 41 | check_result $? "compiling" |
|---|
| 42 | |
|---|
| 43 | # copy libraries into target directory |
|---|
| 44 | find $STAGE_DIR -name "*.dll" -exec cp -a {} ${TARGET_BIN_DIR} \; |
|---|
| 45 | check_result $? "copying libraries" |
|---|
| 46 | |
|---|
| 47 | # build bcp |
|---|
| 48 | cd tools/bcp |
|---|
| 49 | ../../bjam toolset=gcc -j8 |
|---|
| 50 | check_result $? "building bcp" |
|---|
| 51 | cd ../.. |
|---|
| 52 | |
|---|
| 53 | # prepare includes |
|---|
| 54 | mkdir -p ${TEMP_INC_DIR} |
|---|
| 55 | check_result $? "creating temp include dir" |
|---|
| 56 | |
|---|
| 57 | ./dist/bin/bcp atomic bimap date_time filesystem preprocessor thread ${TEMP_INC_DIR} |
|---|
| 58 | check_result $? "creating stripped includes" |
|---|
| 59 | |
|---|
| 60 | # copy includes |
|---|
| 61 | mkdir -p ${TARGET_INC_DIR}/boost |
|---|
| 62 | check_result $? "creating include dir" |
|---|
| 63 | cp -aT ${TEMP_INC_DIR}/boost ${TARGET_INC_DIR}/boost/boost |
|---|
| 64 | check_result $? "copying includes" |
|---|
| 65 | |
|---|
| 66 | echo "${NAME} Finished building ${NAME}" |
|---|
| 67 | fi |
|---|