diff --git a/.ci/bootstrap.sh b/.ci/bootstrap.sh index 1e7740984..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 - 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..e7e35e664 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 diff --git a/internal/c/libqb/os/osx/build_test.command b/internal/c/libqb/os/osx/build_test.command index aa2b456d7..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")" -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..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")" -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_osx.txt b/internal/c/makeline_osx.txt index 2406a18c6..f44517f5c 100644 --- a/internal/c/makeline_osx.txt +++ b/internal/c/makeline_osx.txt @@ -1,4 +1,4 @@ -g++ -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) -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 +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/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/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 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..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")" -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..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")" -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_osx.command index 0d58b169d..258114a19 100755 --- a/internal/c/purge_all_precompiled_content_osx.command +++ b/internal/c/purge_all_precompiled_content_osx.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_osx.command index b8d5d6476..9b00597d5 100755 --- a/qb64_start_osx.command +++ b/qb64_start_osx.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_osx.command index a4b00d78a..75f9af949 100755 --- a/setup_osx.command +++ b/setup_osx.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 ""