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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,24e6afa64057ccaf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-08 18:24:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!spamfinder.gnilink.net!nwrddc01.gnilink.net.POSTED!53ab2750!not-for-mail Subject: Re: Building a minimal-source-code Ada library with GNAT From: Michael Card Newsgroups: comp.lang.ada Message-ID: <080320022124260513%thehouseofcards@remove.this.part.mac.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 8bit User-Agent: Thoth/1.4.5 (Carbon/OS X) Date: Sat, 09 Mar 2002 02:24:52 GMT NNTP-Posting-Host: 129.44.206.66 X-Complaints-To: business-support@verizon.com X-Trace: nwrddc01.gnilink.net 1015640692 129.44.206.66 (Fri, 08 Mar 2002 21:24:52 EST) NNTP-Posting-Date: Fri, 08 Mar 2002 21:24:52 EST Xref: archiver1.google.com comp.lang.ada:20966 Date: 2002-03-09T02:24:52+00:00 List-Id: Chris- Thanks for the suggestions. The use of -I vs -A didn't change anything for me, but I did figure out how to do this. As it turns out, the crucial step I was missing was that my .o and .ali files had to be created as the resulting of LINKING one or more applications that used the top-level packages. So, the steps I followed were: 1. I ran gnatmake a few times to build several applications, so that as a result all of the top-level packages would be used (i.e. all of the top-level public generics would be instantiated), i.e. gnatmake -g -gnatE my_application -I /path_to_my_app_source -I/path_to_lib1_source -I/path_to_lib2_source -largs -lsocket -lnsl gnatmake -g -gnatE my_application_2 -I /path_to_my_app_source -I/path_to_lib1_source -I/path_to_lib2_source -largs -lsocket -lnsl 2. Next, I created subdirectories to hold the .o files and the .ali files that would be put into the Ada libraries 3. I moved the .o and .ali files into their respective subdirectories. I did as you suggested and did a chmod 444 to make the .ali files read-only. 4. I created an object archive of all of the .o files in the library subdirectories using ar, then deleted the .o files. The archives had the usual naming convention, i.e. lib.a 5. I used cp -p to copy the necessary .ads and .adb files into the library subdirectories, leaving out the source code that was not needed for compilation that I wanted to "hide" from users of the libraries 6. After doing these things, I cleaned (rm *.*) the directory where I initially build the applications, and I was able to build and run them successfully using my new GNAT Ada libraries like this: gnatmake -g -gnatE my_application -I /path_to_my_app_source -I/path_to_Adalib_1 -I/path_to_Adalib_2 -L/path_to_Adalib_1 -L/path_to_Adalib_2 -largs -lsocket -lnsl -lAdalib1_name -lAdalib2_name - Mike In article , Christoph Grein wrote: > > and still got this error. For the gnatmake, I used the -A > library> option to point to these Ada libraries, as it looked like this > > was what I should use. For example: > > > > gnatmake -g -gnatE my_application -A/path_to_library > > -A/path_to_library_2 -largs -lsocket -lnsl > > See the "Search Paths and the Run-Time Library (RTL)" section in Gnat UG. The > correct > switch is -Idir. Also make the ALI files read only.