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: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Very basic question: How to use gnatmake (not gprbuild) using external libraries? Date: Wed, 28 Jun 2023 09:20:05 +0200 Organization: A noiseless patient Spider Message-ID: References: <021a84aa-a34d-4e19-bc14-8643532f001fn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 28 Jun 2023 07:20:06 -0000 (UTC) Injection-Info: dont-email.me; posting-host="f2a47a551e980a7158613db6b70f5f8a"; logging-data="1796319"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lIaB0keHAnJ5iv/WCpbXyyu7AUvzRK40=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:trIZRIu0rBQSyxgqHjgBRvNyl9I= Content-Language: en-US In-Reply-To: <021a84aa-a34d-4e19-bc14-8643532f001fn@googlegroups.com> Xref: news.eternal-september.org comp.lang.ada:65360 List-Id: On 2023-06-28 01:44, Kenneth Wolcott wrote: > > 1. Where do I place the SDL library from GitHub? That is up to you. It goes in /path/to/SDL/, where you choose /path/to/. > 2. Do I compile/install the package? The library may have specific compilation/installation instructions. Generally you should follow those. > 3. When using gnatmake do I use -I to specify where the library I'm referencing is found? This depends on the answer to 2. If you have all the source files for the library in /path/to/SDL/, and have compiled them so their .ali and .o files are also there, then using -I/path/to/SDL/ works fine. This is simple and easy. As S/W engineers always try to keep things as simple as possible, this is the approach I tend to use. Coders, on the other hand, like to introduce unnecessary complexity, and you will find lots of projects with baroque directory structures, maybe with source files in /path/to/SDL/src/, .ali and .o files in /path/to/SDL/lib/, test program source files in /path/to/SDL/test/src, their .ali and .o files in /path/to/SDL/test/lib/, and executables in /path/to/SDL/test/bin/. Such directory structures are gnatmake unfriendly, and the simple -I approach doesn't work. You'll have to look into the exact meaning of -I and -a, and maybe others. > 4. Once #3 is answered, I assume that I "with package" as if the '*.ad[sb]' files were co-located with my Ada program, is that correct? The Ada language definition is independent of how and where source and compilation artifacts are stored, so context clauses are necessarily independent of such concepts. In other words, yes. This kind of information is handled by the compilation options such as -I. -- Jeff Carter "He nevere yet no vileynye ne sayde In al his lyf unto no maner wight." Canterbury Tales 156