1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 18:10:24 +00:00
qb64/.travis/build-osx.sh

67 lines
1.5 KiB
Bash
Raw Normal View History

2018-01-11 09:54:21 +00:00
#!/bin/sh
2018-01-11 10:14:15 +00:00
g++ --version
2018-01-11 09:54:21 +00:00
###### Part 1: Build old QB64 ######
echo "Preparing bootstrap:"
find . -type f -iname "*.command" -exec chmod +x {} \;
find . -type f -iname "*.a" -exec rm {} \;
find . -type f -iname "*.o" -exec rm {} \;
rm internal/temp/* 2> /dev/null
com_build() {
cd internal/c/$1/os/osx
2018-01-11 10:14:15 +00:00
echo "Building $2..."
2018-01-11 09:54:21 +00:00
./setup_build.command
if [ $? -ne 0 ]; then
echo "$2 build failed."
exit 1
fi
echo "Done"
cd - > /dev/null
}
com_build "libqb" "libQB"
com_build "parts/video/font/ttf" "FreeType"
cp -r internal/source/* internal/temp/
cd internal/c
2018-01-11 10:14:15 +00:00
echo "Bootstrapping QB64..."
2019-02-23 12:44:26 +00:00
g++ -w qbx.cpp libqb/os/osx/libqb_setup.o parts/video/font/ttf/os/osx/src.o -framework GLUT -framework OpenGL -framework Cocoa -lcurses -o ../../qb64_bootstrap
2018-01-11 09:54:21 +00:00
if [ $? -ne 0 ]; then
echo "QB64 bootstrap failed"
exit 1
fi
echo "Done"
cd - > /dev/null
###### Part 2: Build new QB64 from .bas sources ######
2018-01-11 10:14:15 +00:00
echo "Translating .bas source..."
2018-11-02 09:17:33 +00:00
echo From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt
2018-01-11 09:54:21 +00:00
./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output
rm qb64_bootstrap
if [ `grep -v '^WARNING' /tmp/qb64-output | wc -l` -gt 2 ]; then
2018-01-11 09:54:21 +00:00
cat /tmp/qb64-output
rm /tmp/qb64-output
exit 1
fi
echo "Done"
2018-01-11 10:14:15 +00:00
echo "Testing compile/link..."
2018-01-11 09:54:21 +00:00
# extract g++ line
cd internal/temp/
2018-01-11 10:14:15 +00:00
cpp_call=`awk '$1=="g++" {print $0}' < recompile_osx.command`
2018-01-11 09:54:21 +00:00
# run g++
cd ../c/
$cpp_call -o ../../qb64_testrun
if [ $? -ne 0 -o ! -f ../../qb64_testrun ]; then
echo "Compile/link test failed"
exit 1
fi
cd ../../
rm qb64_testrun
echo "Done"
exit