From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Re: SDL Ada package fails to compile on Mac, gnat 13.1, missing "SDL2_ttf/SDL_ttf.h" Date: Sun, 2 Jul 2023 20:52:51 +0100 Organization: A noiseless patient Spider Message-ID: References: <5bd661f7-f077-47e4-a3c0-aef7d3b41059n@googlegroups.com> <5442a053-9c59-4be4-8485-b0df2e589aedn@googlegroups.com> <21e6c8c0-ec62-4192-aa5d-39d38149821cn@googlegroups.com> <016412bf-0247-466b-add9-8b5d41c6a9d7n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 2 Jul 2023 19:52:51 -0000 (UTC) Injection-Info: dont-email.me; posting-host="3d2e373835969da469cdae163b3cb584"; logging-data="3581941"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rY8nokkRGg4MQQKMPX/Jpp+Jx+BYFTYg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Cancel-Lock: sha1:TiMkmCGXTVJhbxdIQ8sOaNooW1o= In-Reply-To: <016412bf-0247-466b-add9-8b5d41c6a9d7n@googlegroups.com> Content-Language: en-GB Xref: news.eternal-september.org comp.lang.ada:65404 List-Id: On 02/07/2023 20:26, Kenneth Wolcott wrote: >> Google Groups has suppressed Luke's two posts with attached patches. > > Well, that's a very logical explanation for me not seeing anything to respond to :-) Friggin' goggle. It's this (within the source dir - patch --dry-run -p1 < test.patch): diff --git a/build/gnat/makefile b/build/gnat/makefile index b13930f..0046490 100644 --- a/build/gnat/makefile +++ b/build/gnat/makefile @@ -90,7 +90,7 @@ tests: $(LIB_NAME) tests.gpr $(TESTS_SRCS) tests.gpr: $(TESTS_SRCS) gen/$(SDL_MODE)/test/libtestmaths.so $(GPRMAKE) -p -gnat2012 -XSDL_MODE=$(SDL_MODE) -XSDL_PLATFORM=$(SDL_PLATFORM) \ - -Ptests.gpr ${SDL2_CONFIG} + -Ptests.gpr # ${SDL2_CONFIG} # Maths library @@ -111,7 +111,7 @@ unit_tests: $(LIB_NAME) build_unit_tests/unit_tests build_unit_tests/unit_tests: $(GPRMAKE) -p -gnat2012 -XSDL_MODE=$(SDL_MODE) -XSDL_PLATFORM=$(SDL_PLATFORM) \ - -Punit_tests.gpr ${SDL2_CONFIG} + -Punit_tests.gpr # ${SDL2_CONFIG} .PHONY: clean-unit_tests diff --git a/build/gnat/sdlada.gpr b/build/gnat/sdlada.gpr index adc77f5..13ef8ee 100644 --- a/build/gnat/sdlada.gpr +++ b/build/gnat/sdlada.gpr @@ -1,10 +1,21 @@ library project SDLAda is - type Platform_Type is ("linux", "bsd", "windows", "macosx", "macos_homebrew", "ios", "android"); + type Platform_Type is ("linux", + "bsd", + "windows", + "macosx", + "macos_homebrew", + "macos_ports", + "ios", + "android"); type Mode_Type is ("debug", "release"); Platform : Platform_Type := external ("SDL_PLATFORM", "linux"); Mode : Mode_Type := external ("SDL_MODE", "debug"); + package Builder is + for Default_Switches ("Ada") use ("-gnat2012", "-gnata"); + end Builder; + Source_Platform := ""; case Platform is @@ -52,6 +63,11 @@ library project SDLAda is "-I/usr/local/include", "-D_REENTRANT"); + when "macos_ports" => + C_Switches := C_Switches & ("-DSDL_MACPORTS", + "-I/opt/local/include", + "-D_THREAD_SAFE"); + when others => null; end case; @@ -59,4 +75,33 @@ library project SDLAda is for Default_Switches ("C") use Common_Switches & C_Switches; for Default_Switches ("Ada") use Common_Switches & Ada_Switches; end Compiler; + + package Linker is + Linker_Switches := (); + + case Platform is + when "linux" | "bsd" | "android" | "windows" => + Linker_Switches := Linker_Switches & ("-lSDL2", + "-lSDL2_ttf", + "-lSDL2_image", + "-L/usr/lib64"); + + when "macos_homebrew" => + Linker_Switches := Linker_Switches & ("-lSDL2", + "-lSDL2_ttf", + "-lSDL2_image", + "-L/usr/local/lib"); + + when "macos_ports" => + Linker_Switches := Linker_Switches & ("-lSDL2", + "-lSDL2_ttf", + "-lSDL2_image", + "-L/opt/local/lib"); + + when others => + null; + end case; + + for Switches ("Ada") use Linker_Switches; + end Linker; end SDLAda; diff --git a/build/gnat/sdlada_image.gpr b/build/gnat/sdlada_image.gpr index 1098095..5a9764f 100644 --- a/build/gnat/sdlada_image.gpr +++ b/build/gnat/sdlada_image.gpr @@ -11,4 +11,5 @@ library project SDLAda_Image is for Library_Version use "libsdlada_image.so." & Version; package Compiler renames SDLAda.Compiler; + package Linker renames SDLAda.Linker; end SDLAda_Image; diff --git a/build/gnat/tests.gpr b/build/gnat/tests.gpr index 70dceff..51ee201 100644 --- a/build/gnat/tests.gpr +++ b/build/gnat/tests.gpr @@ -15,24 +15,5 @@ project Tests is "ttf.adb"); package Compiler renames SDLAda.Compiler; - - package Linker is - - Linker_Switches := (); - - case Sdlada.Platform is - when "macos_homebrew" => - Linker_Switches := Linker_Switches & ("-lSDL2", - "-lSDL2_ttf", - "-lSDL2_image", - "-L/usr/local/lib"); - - when others => - null; - end case; - - for Switches ("Ada") use Linker_Switches; - - end Linker; - + package Linker renames SDLAda.Linker; end Tests; diff --git a/build/gnat/tests_image.gpr b/build/gnat/tests_image.gpr index f23be3c..fd68309 100644 --- a/build/gnat/tests_image.gpr +++ b/build/gnat/tests_image.gpr @@ -8,6 +8,7 @@ project Tests_Image is for Main use ("load_surface.adb"); package Compiler renames SDLAda.Compiler; + package Linker renames SDLAda.Linker; -- package Builder is -- for Default_Switches ("Ada") use ("-gnat2012", "-gnata"); --, "-gnatG"); diff --git a/build/gnat/unit_tests.gpr b/build/gnat/unit_tests.gpr index c469a34..27dd38f 100644 --- a/build/gnat/unit_tests.gpr +++ b/build/gnat/unit_tests.gpr @@ -17,4 +17,5 @@ project Unit_Tests is -- end Ide; package Compiler renames SDLAda.Compiler; + package Linker renames SDLAda.Linker; end Unit_Tests; diff --git a/src/image/version_images.c b/src/image/version_images.c index ba5be68..47813a1 100644 --- a/src/image/version_images.c +++ b/src/image/version_images.c @@ -21,7 +21,7 @@ * distribution. **********************************************************************************************************************/ #ifdef __APPLE__ - #ifdef SDL_HOMEBREW + #if defined (SDL_HOMEBREW) || defined (SDL_MACPORTS) #include #else #include diff --git a/src/ttf/version_ttf.c b/src/ttf/version_ttf.c index cedfebc..0819103 100644 --- a/src/ttf/version_ttf.c +++ b/src/ttf/version_ttf.c @@ -21,7 +21,7 @@ * distribution. **********************************************************************************************************************/ #ifdef __APPLE__ - #ifdef SDL_HOMEBREW + #if defined (SDL_HOMEBREW) || defined (SDL_MACPORTS) #include #else #include