From 4dbdddc89eb02fbdc661859a7ea3dbf41fc8433e Mon Sep 17 00:00:00 2001 From: Pirachy Date: Wed, 19 Feb 2020 12:50:50 +0000 Subject: [PATCH 1/4] Updated build.command to specifically work with Apple's Clang Fixed an issue where Apple's Clang is forcefully used instead of GCC for compiling QB64 applications. (Fixes issues for those using true GCC via Homebrew and not Clang that just has a symlink of GCC). --- .../c/parts/audio/out/os/osx/build.command | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/internal/c/parts/audio/out/os/osx/build.command b/internal/c/parts/audio/out/os/osx/build.command index dfc0f393c..0d56cbdb0 100755 --- a/internal/c/parts/audio/out/os/osx/build.command +++ b/internal/c/parts/audio/out/os/osx/build.command @@ -1,32 +1,32 @@ cd "$(dirname "$0")" -gcc -s -c -w -Wall ../../src/coreaudio.c -D AL_LIBTYPE_STATIC -o temp/coreaudio.o -gcc -s -c -w -Wall ../../src/helpers.c -D AL_LIBTYPE_STATIC -o temp/helpers.o -gcc -s -c -w -Wall ../../src/bs2b.c -D AL_LIBTYPE_STATIC -o temp/bs2b.o -gcc -s -c -w -Wall ../../src/alAuxEffectSlot.c -D AL_LIBTYPE_STATIC -o temp/alAuxEffectSlot.o -gcc -s -c -w -Wall ../../src/alBuffer.c -D AL_LIBTYPE_STATIC -o temp/alBuffer.o -gcc -s -c -w -Wall ../../src/ALc.c -D AL_LIBTYPE_STATIC -o temp/ALc.o -gcc -s -c -w -Wall ../../src/alcConfig.c -D AL_LIBTYPE_STATIC -o temp/alcConfig.o -gcc -s -c -w -Wall ../../src/alcDedicated.c -D AL_LIBTYPE_STATIC -o temp/alcDedicated.o -gcc -s -c -w -Wall ../../src/alcEcho.c -D AL_LIBTYPE_STATIC -o temp/alcEcho.o -gcc -s -c -w -Wall ../../src/alcModulator.c -D AL_LIBTYPE_STATIC -o temp/alcModulator.o -gcc -s -c -w -Wall ../../src/alcReverb.c -D AL_LIBTYPE_STATIC -o temp/alcReverb.o -gcc -s -c -w -Wall ../../src/alcRing.c -D AL_LIBTYPE_STATIC -o temp/alcRing.o -gcc -s -c -w -Wall ../../src/alcThread.c -D AL_LIBTYPE_STATIC -o temp/alcThread.o -gcc -s -c -w -Wall ../../src/alEffect.c -D AL_LIBTYPE_STATIC -o temp/alEffect.o -gcc -s -c -w -Wall ../../src/alError.c -D AL_LIBTYPE_STATIC -o temp/alError.o -gcc -s -c -w -Wall ../../src/alExtension.c -D AL_LIBTYPE_STATIC -o temp/alExtension.o -gcc -s -c -w -Wall ../../src/alFilter.c -D AL_LIBTYPE_STATIC -o temp/alFilter.o -gcc -s -c -w -Wall ../../src/alListener.c -D AL_LIBTYPE_STATIC -o temp/alListener.o -gcc -s -c -w -Wall ../../src/alSource.c -D AL_LIBTYPE_STATIC -o temp/alSource.o -gcc -s -c -w -Wall ../../src/alState.c -D AL_LIBTYPE_STATIC -o temp/alState.o -gcc -s -c -w -Wall ../../src/alThunk.c -D AL_LIBTYPE_STATIC -o temp/alThunk.o -gcc -s -c -w -Wall ../../src/ALu.c -D AL_LIBTYPE_STATIC -o temp/ALu.o -gcc -s -c -w -Wall ../../src/hrtf.c -D AL_LIBTYPE_STATIC -o temp/hrtf.o -gcc -s -c -w -Wall ../../src/loopback.c -D AL_LIBTYPE_STATIC -o temp/loopback.o -gcc -s -c -w -Wall ../../src/mixer.c -D AL_LIBTYPE_STATIC -o temp/mixer.o -gcc -s -c -w -Wall ../../src/null.c -D AL_LIBTYPE_STATIC -o temp/null.o -gcc -s -c -w -Wall ../../src/panning.c -D AL_LIBTYPE_STATIC -o temp/panning.o -gcc -s -c -w -Wall ../../src/wave.c -D AL_LIBTYPE_STATIC -o temp/wave.o +clang -s -c -w -Wall ../../src/coreaudio.c -D AL_LIBTYPE_STATIC -o temp/coreaudio.o +clang -s -c -w -Wall ../../src/helpers.c -D AL_LIBTYPE_STATIC -o temp/helpers.o +clang -s -c -w -Wall ../../src/bs2b.c -D AL_LIBTYPE_STATIC -o temp/bs2b.o +clang -s -c -w -Wall ../../src/alAuxEffectSlot.c -D AL_LIBTYPE_STATIC -o temp/alAuxEffectSlot.o +clang -s -c -w -Wall ../../src/alBuffer.c -D AL_LIBTYPE_STATIC -o temp/alBuffer.o +clang -s -c -w -Wall ../../src/ALc.c -D AL_LIBTYPE_STATIC -o temp/ALc.o +clang -s -c -w -Wall ../../src/alcConfig.c -D AL_LIBTYPE_STATIC -o temp/alcConfig.o +clang -s -c -w -Wall ../../src/alcDedicated.c -D AL_LIBTYPE_STATIC -o temp/alcDedicated.o +clang -s -c -w -Wall ../../src/alcEcho.c -D AL_LIBTYPE_STATIC -o temp/alcEcho.o +clang -s -c -w -Wall ../../src/alcModulator.c -D AL_LIBTYPE_STATIC -o temp/alcModulator.o +clang -s -c -w -Wall ../../src/alcReverb.c -D AL_LIBTYPE_STATIC -o temp/alcReverb.o +clang -s -c -w -Wall ../../src/alcRing.c -D AL_LIBTYPE_STATIC -o temp/alcRing.o +clang -s -c -w -Wall ../../src/alcThread.c -D AL_LIBTYPE_STATIC -o temp/alcThread.o +clang -s -c -w -Wall ../../src/alEffect.c -D AL_LIBTYPE_STATIC -o temp/alEffect.o +clang -s -c -w -Wall ../../src/alError.c -D AL_LIBTYPE_STATIC -o temp/alError.o +clang -s -c -w -Wall ../../src/alExtension.c -D AL_LIBTYPE_STATIC -o temp/alExtension.o +clang -s -c -w -Wall ../../src/alFilter.c -D AL_LIBTYPE_STATIC -o temp/alFilter.o +clang -s -c -w -Wall ../../src/alListener.c -D AL_LIBTYPE_STATIC -o temp/alListener.o +clang -s -c -w -Wall ../../src/alSource.c -D AL_LIBTYPE_STATIC -o temp/alSource.o +clang -s -c -w -Wall ../../src/alState.c -D AL_LIBTYPE_STATIC -o temp/alState.o +clang -s -c -w -Wall ../../src/alThunk.c -D AL_LIBTYPE_STATIC -o temp/alThunk.o +clang -s -c -w -Wall ../../src/ALu.c -D AL_LIBTYPE_STATIC -o temp/ALu.o +clang -s -c -w -Wall ../../src/hrtf.c -D AL_LIBTYPE_STATIC -o temp/hrtf.o +clang -s -c -w -Wall ../../src/loopback.c -D AL_LIBTYPE_STATIC -o temp/loopback.o +clang -s -c -w -Wall ../../src/mixer.c -D AL_LIBTYPE_STATIC -o temp/mixer.o +clang -s -c -w -Wall ../../src/null.c -D AL_LIBTYPE_STATIC -o temp/null.o +clang -s -c -w -Wall ../../src/panning.c -D AL_LIBTYPE_STATIC -o temp/panning.o +clang -s -c -w -Wall ../../src/wave.c -D AL_LIBTYPE_STATIC -o temp/wave.o ar rcs src.a temp/alAuxEffectSlot.o temp/alBuffer.o temp/ALc.o temp/alcConfig.o temp/alcDedicated.o temp/alcEcho.o temp/alcModulator.o temp/alcReverb.o temp/alcRing.o temp/alcThread.o temp/alEffect.o temp/alError.o temp/alExtension.o temp/alFilter.o temp/alListener.o temp/coreaudio.o temp/alSource.o temp/alState.o temp/alThunk.o temp/ALu.o temp/hrtf.o temp/loopback.o temp/mixer.o temp/null.o temp/panning.o temp/wave.o temp/helpers.o temp/bs2b.o echo "Press any key to continue..." Pause() @@ -44,28 +44,28 @@ Pause ####### added for OSX (above) -gcc -s -c -w -Wall ../../src/coreaudio.c -D AL_LIBTYPE_STATIC -o temp/coreaudio.o +clang -s -c -w -Wall ../../src/coreaudio.c -D AL_LIBTYPE_STATIC -o temp/coreaudio.o ###### removed for osx -gcc -s -c -w -Wall ../../src/alsa.c -D AL_LIBTYPE_STATIC -o temp/alsa.o +clang -s -c -w -Wall ../../src/alsa.c -D AL_LIBTYPE_STATIC -o temp/alsa.o ####Compiled but unrequired (using ALSA instead)#### -gcc -s -c -w -Wall ../../src/oss.c -D AL_LIBTYPE_STATIC -o temp/oss.o +clang -s -c -w -Wall ../../src/oss.c -D AL_LIBTYPE_STATIC -o temp/oss.o temp/oss.o -gcc -s -c -w -Wall ../../src/pulseaudio.c -D AL_LIBTYPE_STATIC -o temp/pulseaudio.o +clang -s -c -w -Wall ../../src/pulseaudio.c -D AL_LIBTYPE_STATIC -o temp/pulseaudio.o temp/pulseaudio.o ####These all failed to compile in Ubuntu#### -gcc -s -c -w -Wall ../../src/solaris.c -D AL_LIBTYPE_STATIC -o temp/solaris.o -gcc -s -c -w -Wall ../../src/sndio.c -D AL_LIBTYPE_STATIC -o temp/sndio.o -gcc -s -c -w -Wall ../../src/portaudio.c -D AL_LIBTYPE_STATIC -o temp/portaudio.o -gcc -s -c -w -Wall ../../src/coreaudio.c -D AL_LIBTYPE_STATIC -o temp/coreaudio.o -gcc -s -c -w -Wall ../../src/opensl.c -D AL_LIBTYPE_STATIC -o temp/opensl.o +clang -s -c -w -Wall ../../src/solaris.c -D AL_LIBTYPE_STATIC -o temp/solaris.o +clang -s -c -w -Wall ../../src/sndio.c -D AL_LIBTYPE_STATIC -o temp/sndio.o +clang -s -c -w -Wall ../../src/portaudio.c -D AL_LIBTYPE_STATIC -o temp/portaudio.o +clang -s -c -w -Wall ../../src/coreaudio.c -D AL_LIBTYPE_STATIC -o temp/coreaudio.o +clang -s -c -w -Wall ../../src/opensl.c -D AL_LIBTYPE_STATIC -o temp/opensl.o ####These are Windows specific#### -gcc -s -c -w -Wall ../../src/dsound.c -D AL_LIBTYPE_STATIC -o temp/dsound.o -gcc -s -c -w -Wall ../../src/mmdevapi.c -D AL_LIBTYPE_STATIC -o temp/mmdevapi.o -gcc -s -c -w -Wall ../../src/winmm.c -D AL_LIBTYPE_STATIC -o temp/winmm.o +clang -s -c -w -Wall ../../src/dsound.c -D AL_LIBTYPE_STATIC -o temp/dsound.o +clang -s -c -w -Wall ../../src/mmdevapi.c -D AL_LIBTYPE_STATIC -o temp/mmdevapi.o +clang -s -c -w -Wall ../../src/winmm.c -D AL_LIBTYPE_STATIC -o temp/winmm.o From 172583fd17524eb3b600066a1ab163c393a93718 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Thu, 20 Feb 2020 20:52:30 -0300 Subject: [PATCH 2/4] 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 4dbdddc89eb02fbdc661859a7ea3dbf41fc8433e. Extra "osx" references replaced with "macOS", but nothing substantial (almost aesthetic). --- .ci/bootstrap.sh | 2 +- .ci/lnx-exclusion.list | 4 ++-- .ci/win-exclusion.list | 4 ++-- internal/c/libqb/os/osx/build_test.command | 2 +- internal/c/libqb/os/osx/setup_build.command | 2 +- internal/c/makeline_macos.txt | 4 ++++ internal/c/makeline_osx.txt | 4 ---- .../audio/conversion/os/osx/build.command | 2 +- .../decode/mp3_mini/os/osx/build.command | 2 +- .../audio/decode/ogg/os/osx/build.command | 2 +- .../game_controller/os/osx/build.command | 4 ++-- .../parts/video/font/ttf/os/osx/build.command | 2 +- .../video/font/ttf/os/osx/setup_build.command | 2 +- ...rge_all_precompiled_content_macos.command} | 24 +++++++++---------- ...rt_osx.command => qb64_start_macos.command | 2 +- setup_osx.command => setup_macos.command | 6 ++--- source/qb64.bas | 18 +++++++------- 17 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 internal/c/makeline_macos.txt delete mode 100644 internal/c/makeline_osx.txt rename internal/c/{purge_all_precompiled_content_osx.command => purge_all_precompiled_content_macos.command} (51%) rename qb64_start_osx.command => qb64_start_macos.command (80%) rename setup_osx.command => setup_macos.command (86%) 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 From c22ef3ac96b19d6baac944b4228ba7a002ef40e6 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Thu, 20 Feb 2020 21:43:23 -0300 Subject: [PATCH 3/4] And clang++ where applicable. --- .ci/bootstrap.sh | 2 +- internal/c/libqb/os/osx/build_test.command | 2 +- internal/c/libqb/os/osx/setup_build.command | 2 +- internal/c/makeline_macos.txt | 4 ++-- internal/c/parts/video/font/ttf/os/osx/build.command | 2 +- internal/c/parts/video/font/ttf/os/osx/setup_build.command | 2 +- setup_macos.command | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.ci/bootstrap.sh b/.ci/bootstrap.sh index 5cacdd352..ac43d2b76 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 - 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 + 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/internal/c/libqb/os/osx/build_test.command b/internal/c/libqb/os/osx/build_test.command index 2e8b54995..0d6da4916 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")" -clang -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 1c3a4cd57..6db7d8eb1 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")" -clang -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 index 8323298da..f44517f5c 100644 --- a/internal/c/makeline_macos.txt +++ b/internal/c/makeline_macos.txt @@ -1,4 +1,4 @@ -clang -w qbx.cpp -framework OpenGL -framework IOKit -framework GLUT -framework OpenGL -framework Cocoa -o +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 +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/parts/video/font/ttf/os/osx/build.command b/internal/c/parts/video/font/ttf/os/osx/build.command index 89ae17c1a..0f64658b1 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")" -clang -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 dbce6d1e5..0ea7f68d1 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")" -clang -s -c -w -Wall ../../src/freetypeamalgam.c -o src.o +clang++ -s -c -w -Wall ../../src/freetypeamalgam.c -o src.o diff --git a/setup_macos.command b/setup_macos.command index 79fddb89d..01cb7a0bc 100755 --- a/setup_macos.command +++ b/setup_macos.command @@ -48,7 +48,7 @@ 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 +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 "" From 5860026d7948062124efe743f13177292a8e83c2 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Thu, 20 Feb 2020 22:02:54 -0300 Subject: [PATCH 4/4] Too soon to drop osx... --- .ci/lnx-exclusion.list | 2 +- .ci/win-exclusion.list | 4 ++-- .../c/{makeline_macos.txt => makeline_osx.txt} | 0 ... purge_all_precompiled_content_osx.command} | 0 ...art_macos.command => qb64_start_osx.command | 0 setup_macos.command => setup_osx.command | 2 +- source/qb64.bas | 18 +++++++++--------- 7 files changed, 13 insertions(+), 13 deletions(-) rename internal/c/{makeline_macos.txt => makeline_osx.txt} (100%) rename internal/c/{purge_all_precompiled_content_macos.command => purge_all_precompiled_content_osx.command} (100%) rename qb64_start_macos.command => qb64_start_osx.command (100%) rename setup_macos.command => setup_osx.command (97%) diff --git a/.ci/lnx-exclusion.list b/.ci/lnx-exclusion.list index 398c86db0..e7e35e664 100644 --- a/.ci/lnx-exclusion.list +++ b/.ci/lnx-exclusion.list @@ -1,3 +1,3 @@ setup_macos.command internal/c/c_compiler -qb64_start_macos.command +qb64_start_osx.command diff --git a/.ci/win-exclusion.list b/.ci/win-exclusion.list index 2a3956e3e..6d4e4f388 100644 --- a/.ci/win-exclusion.list +++ b/.ci/win-exclusion.list @@ -1,4 +1,4 @@ setup_lnx.sh -setup_macos.command -qb64_start_macos.command +setup_osx.command +qb64_start_osx.command secure-file diff --git a/internal/c/makeline_macos.txt b/internal/c/makeline_osx.txt similarity index 100% rename from internal/c/makeline_macos.txt rename to internal/c/makeline_osx.txt diff --git a/internal/c/purge_all_precompiled_content_macos.command b/internal/c/purge_all_precompiled_content_osx.command similarity index 100% rename from internal/c/purge_all_precompiled_content_macos.command rename to internal/c/purge_all_precompiled_content_osx.command diff --git a/qb64_start_macos.command b/qb64_start_osx.command similarity index 100% rename from qb64_start_macos.command rename to qb64_start_osx.command diff --git a/setup_macos.command b/setup_osx.command similarity index 97% rename from setup_macos.command rename to setup_osx.command index 01cb7a0bc..75f9af949 100755 --- a/setup_macos.command +++ b/setup_osx.command @@ -14,7 +14,7 @@ find . -type f -iname "*.a" -exec rm -f {} \; find . -type f -iname "*.o" -exec rm -f {} \; rm ./internal/temp/* -if [ -z "$(which clang)" ]; then +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." diff --git a/source/qb64.bas b/source/qb64.bas index 330445094..fd31fe7b1 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 macOS, launch 'qb64_start_macos.command' or enter './qb64' in Terminal." + PRINT "For MacOSX, launch 'qb64_start.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_macos.txt" FOR INPUT AS #150 + OPEN "./internal/c/makeline_osx.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_macos.command" FOR OUTPUT AS #ffh + OPEN tmpdir$ + "recompile_osx.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_macos.command" + SHELL _HIDE "chmod +x " + tmpdir$ + "recompile_osx.command" ffh = FREEFILE - OPEN tmpdir$ + "debug_macos.command" FOR OUTPUT AS #ffh + OPEN tmpdir$ + "debug_osx.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_macos.command" + SHELL _HIDE "chmod +x " + tmpdir$ + "debug_osx.command" ELSE @@ -12507,7 +12507,7 @@ FUNCTION ParseCMDLineArgs$ () CHDIR "./internal/c" IF INSTR(_OS$, "[MACOSX]") THEN - SHELL _HIDE "./purge_all_precompiled_content_macos.command" + SHELL _HIDE "./purge_all_precompiled_content_osx.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_macos.command" + SHELL _HIDE "./purge_all_precompiled_content_osx.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_macos.command" + SHELL _HIDE "./purge_all_precompiled_content_osx.command" ELSE SHELL _HIDE "./purge_all_precompiled_content_lnx.sh" END IF