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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,4486f278cc4730a7 X-Google-Attributes: gid103376,public From: gisle@struts.ii.uib.no (Gisle =?iso-8859-1?Q?S=E6lensminde?=) Subject: Re: Multiple partitions with GNAT 3.12p Date: 2000/11/15 Message-ID: #1/1 X-Deja-AN: 693894154 Content-Transfer-Encoding: 8bit References: <3A1284C8.58C2405D@CCI.de> Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: abuse@uib.no X-Trace: toralf.uib.no 974296130 59334 129.177.17.22 (15 Nov 2000 13:48:50 GMT) Organization: University of Bergen Mime-Version: 1.0 User-Agent: slrn/0.9.6.2 (SunOS) NNTP-Posting-Date: 15 Nov 2000 13:48:50 GMT Newsgroups: comp.lang.ada Date: 2000-11-15T13:48:50+00:00 List-Id: In article <3A1284C8.58C2405D@CCI.de>, Vincent Smeets wrote: >Hallo, > >I'm using GNAT 3.12p. How can I compile and link a program with multiple >partitions? What must I do to create the partitions? > >As an example, I want package A to be a separate partition from the main >program B. > >package A is > procedure P (I : String); >end A; > >with Ada.Text_IO; >package body A is > procedure P (I : String) is > begin > Ada.Text_IO.Put_Line (I); > end P; >end A; > >with A; >procedure B is >begin > A.P ("Testing partitions."); >end B: I presume you mean compilation unit, and not partition, that means something else in Ada95 terminology (Distributed programming) Run the program gnatchop that comes with GNAT. % gnatchop adafile This produce the files a.ads a.adb and b.adb, containing the expected units. GNAT expect it that way. Then run gnatmake on B. % gnatmake b.adb Gnatmake will the compile a and then b, and link the whole thing into an executable file. This works because the "right" filenames are used. If you of some reason want to use other filenames (e.g. for legacy code) Then this can be specified throgh an adc-file, but you usally don't want to do this. All of this is documented in the documentation following GNAT. If you use Linux, "The Big Online Book of Linux Ada Programming" may be useful (esp ch 4). http://www.vaxxine.com/pegasoft/homes/book.html -- -- Gisle S�lensminde ( gisle@ii.uib.no ) With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. (from RFC 1925)