1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-04 22:20:24 +00:00
qb64/setup_macos.command
Fellippe Heitor 172583fd17 Replaces g++ with clang for the remaining macOS scripts.
If a user has Homebrew installed, calling g++ won't use Apple's Xcode version of the tool, which is required by QB64. This fix continues on with the patch introduced in 4dbdddc89e.

Extra "osx" references replaced with "macOS", but nothing substantial (almost aesthetic).
2020-02-20 20:52:30 -03:00

68 lines
1.6 KiB
Bash
Executable file

cd "$(dirname "$0")"
Pause()
{
OLDCONFIG=`stty -g`
stty -icanon -echo min 1 time 0
dd count=1 2>/dev/null
stty $OLDCONFIG
}
echo "QB64 Setup"
echo ""
find . -name "*.command" -exec chmod +x {} \;
find . -type f -iname "*.a" -exec rm -f {} \;
find . -type f -iname "*.o" -exec rm -f {} \;
rm ./internal/temp/*
if [ -z "$(which clang)" ]; then
echo "Apple's C++ compiler not found."
echo "Attempting to install Apple's Command Line Tools for Xcode..."
echo "After installation is finished, run this setup script again."
xcode-select --install
Pause
exit 1
fi
echo "Building library 'LibQB'"
pushd internal/c/libqb/os/osx >/dev/null
rm -f libqb_setup.o
./setup_build.command
if [ ! -f ./libqb_setup.o ]; then
echo "Compilation of ./internal/c/libqb/os/osx/libqb_setup.o failed!"
Pause
exit 1
fi
popd >/dev/null
echo "Building library 'FreeType'"
pushd internal/c/parts/video/font/ttf/os/osx >/dev/null
rm -f src.o
./setup_build.command
if [ ! -f ./src.o ]; then
echo "Compilation of ./internal/c/parts/video/font/ttf/os/osx/src.o failed!"
Pause
exit 1
fi
popd >/dev/null
echo "Building 'QB64' (~3 min)"
cp ./internal/source/* ./internal/temp/
pushd internal/c >/dev/null
clang -w qbx.cpp libqb/os/osx/libqb_setup.o parts/video/font/ttf/os/osx/src.o -framework GLUT -framework OpenGL -framework Cocoa -o ../../qb64
popd >/dev/null
echo ""
if [ -f ./qb64 ]; then
echo "Launching 'QB64'"
./qb64
echo ""
echo "Note: 'qb64' is located in same folder as this setup program."
echo "Press any key to continue..."
Pause
else
echo "Compilation of QB64 failed!"
Pause
exit 1
fi