mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-01 09:10:37 +00:00
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).
This commit is contained in:
parent
4dbdddc89e
commit
172583fd17
|
@ -28,7 +28,7 @@ cp -r internal/source/* internal/temp/
|
|||
cd internal/c
|
||||
echo -n "Bootstrapping QB64..."
|
||||
if [[ $OS == "osx" ]]; then
|
||||
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
|
||||
clang -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
|
||||
else
|
||||
g++ -w qbx.cpp libqb/os/lnx/libqb_setup.o parts/video/font/ttf/os/lnx/src.o parts/core/os/lnx/src.a -lGL -lGLU -lX11 -lcurses -lpthread -ldl -lrt -D FREEGLUT_STATIC -DDEPENDENCY_USER_MODS -o ../../qb64_bootstrap
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
setup_osx.command
|
||||
setup_macos.command
|
||||
internal/c/c_compiler
|
||||
qb64_start_osx.command
|
||||
qb64_start_macos.command
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
setup_lnx.sh
|
||||
setup_osx.command
|
||||
qb64_start_osx.command
|
||||
setup_macos.command
|
||||
qb64_start_macos.command
|
||||
secure-file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
g++ -c -w -Wall ../../../libqb.mm -D DEPENDENCY_AUDIO_OUT -D DEPENDENCY_AUDIO_DECODE -D DEPENDENCY_AUDIO_CONVERSION -o libqb_test_only.o
|
||||
clang -c -w -Wall ../../../libqb.mm -D DEPENDENCY_AUDIO_OUT -D DEPENDENCY_AUDIO_DECODE -D DEPENDENCY_AUDIO_CONVERSION -o libqb_test_only.o
|
||||
echo "Press any key to continue"
|
||||
Pause()
|
||||
{
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
cd "$(dirname "$0")"
|
||||
g++ -c -w -Wall ../../../libqb.mm -D DEPENDENCY_LOADFONT -o libqb_setup.o
|
||||
clang -c -w -Wall ../../../libqb.mm -D DEPENDENCY_LOADFONT -o libqb_setup.o
|
||||
|
||||
|
|
4
internal/c/makeline_macos.txt
Normal file
4
internal/c/makeline_macos.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
clang -w qbx.cpp -framework OpenGL -framework IOKit -framework GLUT -framework OpenGL -framework Cocoa -o
|
||||
|
||||
(below for reference purposes only, above is minimum viable)
|
||||
clang -w qbx.cpp -framework ApplicationServices -framework OpenGL -framework IOKit -framework CoreServices -framework CoreFoundation -framework GLUT -framework OpenGL -framework Cocoa -o
|
|
@ -1,4 +0,0 @@
|
|||
g++ -w qbx.cpp -framework OpenGL -framework IOKit -framework GLUT -framework OpenGL -framework Cocoa -o
|
||||
|
||||
(below for reference purposes only, above is minimum viable)
|
||||
g++ -w qbx.cpp -framework ApplicationServices -framework OpenGL -framework IOKit -framework CoreServices -framework CoreFoundation -framework GLUT -framework OpenGL -framework Cocoa -o
|
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -c ../../src/resample.c -o temp/resample.o
|
||||
clang -c ../../src/resample.c -o temp/resample.o
|
||||
ar rcs src.a temp/resample.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -c ../../src/minimp3.c -o temp/minimp3.o
|
||||
clang -c ../../src/minimp3.c -o temp/minimp3.o
|
||||
ar rcs src.a temp/minimp3.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -c ../../src/stb_vorbis.c -o src.o
|
||||
clang -c ../../src/stb_vorbis.c -o src.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -s -c -w -Wall ../../src/Gamepad_macosx.c -o temp/Gamepad_macosx.o
|
||||
gcc -s -c -w -Wall ../../src/Gamepad_private.c -o temp/Gamepad_private.o
|
||||
clang -s -c -w -Wall ../../src/Gamepad_macosx.c -o temp/Gamepad_macosx.o
|
||||
clang -s -c -w -Wall ../../src/Gamepad_private.c -o temp/Gamepad_private.o
|
||||
ar rcs src.a temp/Gamepad_private.o temp/Gamepad_macosx.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
g++ -s -c -w -Wall ../../src/freetypeamalgam.c -o src.o
|
||||
clang -s -c -w -Wall ../../src/freetypeamalgam.c -o src.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
{
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
cd "$(dirname "$0")"
|
||||
g++ -s -c -w -Wall ../../src/freetypeamalgam.c -o src.o
|
||||
clang -s -c -w -Wall ../../src/freetypeamalgam.c -o src.o
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
cd "$(dirname "$0")"
|
||||
|
||||
rm libqb/os/win/*.o
|
||||
rm libqb/os/lnx/*.o
|
||||
rm libqb/os/osx/*.o
|
||||
|
||||
rm parts/core/os/win/src.a
|
||||
rm parts/core/os/lnx/src.a
|
||||
rm parts/core/os/osx/src.a
|
||||
rm parts/core/os/win/temp/*.o
|
||||
rm parts/core/os/lnx/temp/*.o
|
||||
rm parts/core/os/osx/temp/*.o
|
||||
|
||||
rm parts/audio/decode/mp3/os/win/src.a
|
||||
rm parts/audio/decode/mp3/os/lnx/src.a
|
||||
rm parts/audio/decode/mp3/os/osx/src.a
|
||||
rm parts/audio/decode/mp3/os/win/temp/*.o
|
||||
rm parts/audio/decode/mp3/os/lnx/temp/*.o
|
||||
rm parts/audio/decode/mp3/os/osx/temp/*.o
|
||||
|
||||
rm parts/audio/decode/ogg/os/win/src.o
|
||||
rm parts/audio/decode/ogg/os/lnx/src.o
|
||||
rm parts/audio/decode/ogg/os/osx/src.o
|
||||
rm parts/audio/decode/ogg/os/win/temp/*.o
|
||||
rm parts/audio/decode/ogg/os/lnx/temp/*.o
|
||||
rm parts/audio/decode/ogg/os/osx/temp/*.o
|
||||
|
||||
rm parts/audio/conversion/os/win/src.a
|
||||
rm parts/audio/conversion/os/lnx/src.a
|
||||
rm parts/audio/conversion/os/osx/src.a
|
||||
rm parts/audio/conversion/os/win/temp/*.o
|
||||
rm parts/audio/conversion/os/lnx/temp/*.o
|
||||
rm parts/audio/conversion/os/osx/temp/*.o
|
||||
|
||||
rm parts/audio/out/os/win/src.a
|
||||
rm parts/audio/out/os/lnx/src.a
|
||||
rm parts/audio/out/os/osx/src.a
|
||||
rm parts/audio/out/os/win/temp/*.o
|
||||
rm parts/audio/out/os/lnx/temp/*.o
|
||||
rm parts/audio/out/os/osx/temp/*.o
|
||||
|
||||
rm parts/video/font/ttf/os/win/src.o
|
||||
rm parts/video/font/ttf/os/lnx/src.o
|
||||
rm parts/video/font/ttf/os/osx/src.o
|
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
./qb64 &
|
||||
osascript -e 'tell application "Terminal" to close (every window whose name contains "qb64_start_osx.command")' &
|
||||
osascript -e 'tell application "Terminal" to close (every window whose name contains "qb64_start_macos.command")' &
|
||||
osascript -e 'if (count the windows of application "Terminal") is 0 then tell application "Terminal" to quit' &
|
||||
exit
|
|
@ -14,8 +14,8 @@ find . -type f -iname "*.a" -exec rm -f {} \;
|
|||
find . -type f -iname "*.o" -exec rm -f {} \;
|
||||
rm ./internal/temp/*
|
||||
|
||||
if [ -z "$(which g++)" ]; then
|
||||
echo "GNU C++ compiler not detected (g++)"
|
||||
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
|
||||
|
@ -48,7 +48,7 @@ popd >/dev/null
|
|||
echo "Building 'QB64' (~3 min)"
|
||||
cp ./internal/source/* ./internal/temp/
|
||||
pushd internal/c >/dev/null
|
||||
g++ -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
|
||||
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 ""
|
|
@ -48,7 +48,7 @@ IF _DIREXISTS("internal") = 0 THEN
|
|||
PRINT "QB64 cannot locate the 'internal' folder"
|
||||
PRINT
|
||||
PRINT "Check that QB64 has been extracted properly."
|
||||
PRINT "For MacOSX, launch 'qb64_start.command' or enter './qb64' in Terminal."
|
||||
PRINT "For macOS, launch 'qb64_start_macos.command' or enter './qb64' in Terminal."
|
||||
PRINT "For Linux, in the console enter './qb64'."
|
||||
DO
|
||||
_LIMIT 1
|
||||
|
@ -12163,7 +12163,7 @@ IF os$ = "LNX" THEN
|
|||
END IF
|
||||
|
||||
IF INSTR(_OS$, "[MACOSX]") THEN
|
||||
OPEN "./internal/c/makeline_osx.txt" FOR INPUT AS #150
|
||||
OPEN "./internal/c/makeline_macos.txt" FOR INPUT AS #150
|
||||
ELSE
|
||||
OPEN "./internal/c/makeline_lnx.txt" FOR INPUT AS #150
|
||||
END IF
|
||||
|
@ -12230,17 +12230,17 @@ IF os$ = "LNX" THEN
|
|||
IF INSTR(_OS$, "[MACOSX]") THEN
|
||||
|
||||
ffh = FREEFILE
|
||||
OPEN tmpdir$ + "recompile_osx.command" FOR OUTPUT AS #ffh
|
||||
OPEN tmpdir$ + "recompile_macos.command" FOR OUTPUT AS #ffh
|
||||
PRINT #ffh, "cd " + CHR_QUOTE + "$(dirname " + CHR_QUOTE + "$0" + CHR_QUOTE + ")" + CHR_QUOTE + CHR$(10);
|
||||
PRINT #ffh, "echo " + CHR_QUOTE + "Recompiling..." + CHR_QUOTE + CHR$(10);
|
||||
PRINT #ffh, "cd ../c" + CHR$(10);
|
||||
PRINT #ffh, a$ + CHR$(10);
|
||||
PRINT #ffh, "read -p " + CHR_QUOTE + "Press ENTER to exit..." + CHR_QUOTE + CHR$(10);
|
||||
CLOSE ffh
|
||||
SHELL _HIDE "chmod +x " + tmpdir$ + "recompile_osx.command"
|
||||
SHELL _HIDE "chmod +x " + tmpdir$ + "recompile_macos.command"
|
||||
|
||||
ffh = FREEFILE
|
||||
OPEN tmpdir$ + "debug_osx.command" FOR OUTPUT AS #ffh
|
||||
OPEN tmpdir$ + "debug_macos.command" FOR OUTPUT AS #ffh
|
||||
PRINT #ffh, "cd " + CHR_QUOTE + "$(dirname " + CHR_QUOTE + "$0" + CHR_QUOTE + ")" + CHR_QUOTE + CHR$(10);
|
||||
PRINT #ffh, "Pause()" + CHR$(10);
|
||||
PRINT #ffh, "{" + CHR$(10);
|
||||
|
@ -12257,7 +12257,7 @@ IF os$ = "LNX" THEN
|
|||
PRINT #ffh, "gdb " + CHR$(34) + path.exe$ + file$ + extension$ + CHR$(34) + CHR$(10);
|
||||
PRINT #ffh, "Pause" + CHR$(10);
|
||||
CLOSE ffh
|
||||
SHELL _HIDE "chmod +x " + tmpdir$ + "debug_osx.command"
|
||||
SHELL _HIDE "chmod +x " + tmpdir$ + "debug_macos.command"
|
||||
|
||||
ELSE
|
||||
|
||||
|
@ -12507,7 +12507,7 @@ FUNCTION ParseCMDLineArgs$ ()
|
|||
CHDIR "./internal/c"
|
||||
|
||||
IF INSTR(_OS$, "[MACOSX]") THEN
|
||||
SHELL _HIDE "./purge_all_precompiled_content_osx.command"
|
||||
SHELL _HIDE "./purge_all_precompiled_content_macos.command"
|
||||
ELSE
|
||||
SHELL _HIDE "./purge_all_precompiled_content_lnx.sh"
|
||||
END IF
|
||||
|
@ -12555,7 +12555,7 @@ FUNCTION ParseCMDLineArgs$ ()
|
|||
CHDIR "./internal/c"
|
||||
|
||||
IF INSTR(_OS$, "[MACOSX]") THEN
|
||||
SHELL _HIDE "./purge_all_precompiled_content_osx.command"
|
||||
SHELL _HIDE "./purge_all_precompiled_content_macos.command"
|
||||
ELSE
|
||||
SHELL _HIDE "./purge_all_precompiled_content_lnx.sh"
|
||||
END IF
|
||||
|
@ -12575,7 +12575,7 @@ FUNCTION ParseCMDLineArgs$ ()
|
|||
CHDIR "./internal/c"
|
||||
|
||||
IF INSTR(_OS$, "[MACOSX]") THEN
|
||||
SHELL _HIDE "./purge_all_precompiled_content_osx.command"
|
||||
SHELL _HIDE "./purge_all_precompiled_content_macos.command"
|
||||
ELSE
|
||||
SHELL _HIDE "./purge_all_precompiled_content_lnx.sh"
|
||||
END IF
|
||||
|
|
Loading…
Reference in a new issue