diff --git a/.ci/bootstrap.sh b/.ci/bootstrap.sh index 1e7740984..5cacdd352 100755 --- a/.ci/bootstrap.sh +++ b/.ci/bootstrap.sh @@ -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 diff --git a/.ci/lnx-exclusion.list b/.ci/lnx-exclusion.list index 16a8f91df..398c86db0 100644 --- a/.ci/lnx-exclusion.list +++ b/.ci/lnx-exclusion.list @@ -1,3 +1,3 @@ -setup_osx.command +setup_macos.command internal/c/c_compiler -qb64_start_osx.command +qb64_start_macos.command diff --git a/.ci/win-exclusion.list b/.ci/win-exclusion.list index 6d4e4f388..2a3956e3e 100644 --- a/.ci/win-exclusion.list +++ b/.ci/win-exclusion.list @@ -1,4 +1,4 @@ setup_lnx.sh -setup_osx.command -qb64_start_osx.command +setup_macos.command +qb64_start_macos.command secure-file diff --git a/internal/c/libqb/os/osx/build_test.command b/internal/c/libqb/os/osx/build_test.command index aa2b456d7..2e8b54995 100755 --- a/internal/c/libqb/os/osx/build_test.command +++ b/internal/c/libqb/os/osx/build_test.command @@ -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() { diff --git a/internal/c/libqb/os/osx/setup_build.command b/internal/c/libqb/os/osx/setup_build.command index e81aaea6b..1c3a4cd57 100755 --- a/internal/c/libqb/os/osx/setup_build.command +++ b/internal/c/libqb/os/osx/setup_build.command @@ -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 diff --git a/internal/c/makeline_macos.txt b/internal/c/makeline_macos.txt new file mode 100644 index 000000000..8323298da --- /dev/null +++ b/internal/c/makeline_macos.txt @@ -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 \ No newline at end of file diff --git a/internal/c/makeline_osx.txt b/internal/c/makeline_osx.txt deleted file mode 100644 index 2406a18c6..000000000 --- a/internal/c/makeline_osx.txt +++ /dev/null @@ -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 \ No newline at end of file diff --git a/internal/c/parts/audio/conversion/os/osx/build.command b/internal/c/parts/audio/conversion/os/osx/build.command index f376f5474..42121347c 100755 --- a/internal/c/parts/audio/conversion/os/osx/build.command +++ b/internal/c/parts/audio/conversion/os/osx/build.command @@ -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() diff --git a/internal/c/parts/audio/decode/mp3_mini/os/osx/build.command b/internal/c/parts/audio/decode/mp3_mini/os/osx/build.command index dabea0015..54115af58 100755 --- a/internal/c/parts/audio/decode/mp3_mini/os/osx/build.command +++ b/internal/c/parts/audio/decode/mp3_mini/os/osx/build.command @@ -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() diff --git a/internal/c/parts/audio/decode/ogg/os/osx/build.command b/internal/c/parts/audio/decode/ogg/os/osx/build.command index 3f6f4a6f6..7622b01d4 100755 --- a/internal/c/parts/audio/decode/ogg/os/osx/build.command +++ b/internal/c/parts/audio/decode/ogg/os/osx/build.command @@ -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() { diff --git a/internal/c/parts/input/game_controller/os/osx/build.command b/internal/c/parts/input/game_controller/os/osx/build.command index 204f63593..61e35f063 100755 --- a/internal/c/parts/input/game_controller/os/osx/build.command +++ b/internal/c/parts/input/game_controller/os/osx/build.command @@ -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() diff --git a/internal/c/parts/video/font/ttf/os/osx/build.command b/internal/c/parts/video/font/ttf/os/osx/build.command index bfb617298..89ae17c1a 100755 --- a/internal/c/parts/video/font/ttf/os/osx/build.command +++ b/internal/c/parts/video/font/ttf/os/osx/build.command @@ -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() { diff --git a/internal/c/parts/video/font/ttf/os/osx/setup_build.command b/internal/c/parts/video/font/ttf/os/osx/setup_build.command index 8ef9a0363..dbce6d1e5 100755 --- a/internal/c/parts/video/font/ttf/os/osx/setup_build.command +++ b/internal/c/parts/video/font/ttf/os/osx/setup_build.command @@ -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 diff --git a/internal/c/purge_all_precompiled_content_osx.command b/internal/c/purge_all_precompiled_content_macos.command similarity index 51% rename from internal/c/purge_all_precompiled_content_osx.command rename to internal/c/purge_all_precompiled_content_macos.command index 0d58b169d..258114a19 100755 --- a/internal/c/purge_all_precompiled_content_osx.command +++ b/internal/c/purge_all_precompiled_content_macos.command @@ -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 \ No newline at end of file +rm parts/video/font/ttf/os/osx/src.o \ No newline at end of file diff --git a/qb64_start_osx.command b/qb64_start_macos.command similarity index 80% rename from qb64_start_osx.command rename to qb64_start_macos.command index b8d5d6476..9b00597d5 100755 --- a/qb64_start_osx.command +++ b/qb64_start_macos.command @@ -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 \ No newline at end of file diff --git a/setup_osx.command b/setup_macos.command similarity index 86% rename from setup_osx.command rename to setup_macos.command index a4b00d78a..79fddb89d 100755 --- a/setup_osx.command +++ b/setup_macos.command @@ -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 "" diff --git a/source/qb64.bas b/source/qb64.bas index fd31fe7b1..330445094 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -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