From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Exporting linker options from library GPR Date: Thu, 15 Feb 2018 08:49:41 +0000 Organization: A noiseless patient Spider Message-ID: References: <981893565.540207668.848900.laguest-archeia.com@nntp.aioe.org> <101626dd-bbd5-4e10-a383-3c5e29d4bc88@googlegroups.com> <1663297707.540284845.822306.laguest-archeia.com@nntp.aioe.org> <301425720.540294866.314644.laguest-archeia.com@nntp.aioe.org> <836a0b01-419e-4b53-a15c-75bc7d41b462@googlegroups.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: reader02.eternal-september.org; posting-host="85dcee59ce540dd7d5106e1e10fed727"; logging-data="30494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TGGrwnvaPR8J4lPGz7Dph1Kci9g0S8/k=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:EtGNeG72UIJh4ByqEp+L2Msiw9g= sha1:/gnsdZpCubmNyEejZUswWurhofc= Xref: reader02.eternal-september.org comp.lang.ada:50450 Date: 2018-02-15T08:49:41+00:00 List-Id: --=-=-= Content-Type: text/plain Lucretia writes: Do you think we should raise an issue on github for this discussion? (to take it off the group) > I have it building on Mac OS X as a static lib, but the options are > controlled from the makefile. When I built it as a dynamic library, I got (with some builds) an ACCVIO during elaboration, which I took to be down to failing to initialize libsdlada.dylib (it's not built as an SAL). > To make it consistent, I'd either have to remove the sdl2-config call > for other all other OSes and get the flags from the script and copy > them across, hoping they are correct. Or, the sdl2-config needs to be > callable and expandable from the gpr file, which I don't think is > possible. > > So, before I push the changes, can anyone tell me if this is possible? As a possible alternative, the attached makefile fragment works out whether you're on Darwin or not, so you could decide in the makefile how to get the options & then pass them through to the gpr. --=-=-= Content-Type: text/plain Content-Disposition: inline Content-Description: Mkaefile fragment DARWIN = $(shell if gcc -v 2>&1 | grep darwin >/dev/null 2>&1; then \ echo 1; \ else \ echo 0; \ fi) FLAGS = $(shell if [ $(DARWIN) -eq 1 ]; then \ echo "-framework SDL2"; \ else \ echo "result of sdl2-config"; \ fi) all: @echo $(FLAGS) --=-=-=--