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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-07 21:45:21 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: Building a minimal-source-code Ada library with GNAT From: Michael Card Newsgroups: comp.lang.ada Message-ID: <080320020044528204%thehouseofcards@remove.this.part.mac.com> 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: Fri, 08 Mar 2002 05:45:18 GMT NNTP-Posting-Host: 129.44.207.92 X-Complaints-To: business-support@verizon.com X-Trace: nwrddc01.gnilink.net 1015566318 129.44.207.92 (Fri, 08 Mar 2002 00:45:18 EST) NNTP-Posting-Date: Fri, 08 Mar 2002 00:45:18 EST Xref: archiver1.google.com comp.lang.ada:20927 Date: 2002-03-08T05:45:18+00:00 List-Id: Hello CLA- I am trying to do something with GNAT 3.14 that I have not done before and I am hoping someone out there has done this and can point me in the right direction. Google searches for this info have proved fruitless. What I am trying to do is build a GNAT Ada library that contains all of the .o and .ali files for a re-usable software component and as little of the re-usable component's source code as possible. What I did to build the library was to compile all of the source code and then delete the .adb (body) files that a user would not need to see from the directory containing the GNAT Ada library. The code is something like this: top_level_pkg.ads -- root pkg user withs in top_level_pkg.adb -- root pkg body, deleted user doesn't need it top_level_pkg-public_generic_child_1.ads -- spec of generic child user will need to instantiate top_level_pkg-public_generic_child_1.adb -- body of generic child 1 top_level_pkg-public_generic_child_2.ads -- another generic for user top_level_pkg-public_generic_child_2.adb -- body of generic child 2 top_level_pkg-private_child_1.ads -- spec of private pkg, included because bodies of public generics with this in top_level_pkg-private_child_1.adb -- deleted, user doesn't need it top_level_pkg-private_child_2.ads -- 2nd private pkg withed in by bodies of public generic child pkgs top_level_pkg-private_child_2.adb -- deleted, user doesn't need it The code is compiled simply like this: foreach f (*.ad{s,b}) gcc -c $f end and the un-needed .adb files are deleted. The idea is to expose only the code you want the user to see, hiding the rest of the source and providing only .ali and .o files for the removed .adb files. Since none of the bodies removed are necessary for a user to compile against the library, it seems like this should work. When I try a gnatmake against such a library, however, the compilation goes fine but the gnatbind fails in an interesting way. It gives errors like this: error: filename.adb needs to be recompiled The interesting thing is that filename.adb may be one of the removed files, but I built a library leaving in the files it complained about and still got this error. For the gnatmake, I used the -A 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 Again, the compilation goes fine even with these .adb files removed, th eproblem is in gnatbind. I also tried using the -x and -t options on gnatbind but got the same error: gnatmake -g -gnatE my_application -A/path_to_library -A/path_to_library_2 -largs -lsocket -lnsl -bargs -x -t Has anyone else ever tried this? I assume it must be possible to release a library in GNAT without providing ALL of the source code, but I cannot figure out how to do this. Any guidanace would be much appreciated! Thanks, Mike