| 1 |
-- This is a project file used to rebuild the GNAT run-time for debug |
| 2 |
-- or instrumentation purposes. |
| 3 |
-- |
| 4 |
-- Here is how to use this project file: |
| 5 |
-- |
| 6 |
-- 1. Create a new directory (e.g. "rts-debug"), then copy the adainclude |
| 7 |
-- directory from the reference runtime that you want to rebuild. |
| 8 |
-- You can find the relevant adainclude directory by running the command |
| 9 |
-- gprls -v [--target=<target>] [--RTS=<runtime>] and using the adainclude |
| 10 |
-- directory listed. For example: |
| 11 |
-- $ cd <reference directory> |
| 12 |
-- $ mkdir rts-debug |
| 13 |
-- $ cd rts-debug |
| 14 |
-- $ cp -a `gprls -v \ |
| 15 |
-- [--target=<target>] --RTS=native | grep adainclude` . |
| 16 |
-- $ cd adainclude |
| 17 |
-- |
| 18 |
-- or under Windows: |
| 19 |
-- |
| 20 |
-- $ mkdir adainclude |
| 21 |
-- $ xcopy /s /path/to/adainclude adainclude |
| 22 |
-- $ cd adainclude |
| 23 |
-- |
| 24 |
-- 2. If needed (e.g for pragma Normalize_Scalars), create a file called |
| 25 |
-- gnat.adc in the adainclude directory containing the configuration pragmas |
| 26 |
-- you want to use to build the library, e.g. |
| 27 |
-- |
| 28 |
-- $ echo "pragma Normalize_Scalars;" > gnat.adc |
| 29 |
-- |
| 30 |
-- Note that this step is usually not needed, and most pragmas are not |
| 31 |
-- relevant to the GNAT run time. |
| 32 |
-- |
| 33 |
-- 3. Determine the values of the following variables |
| 34 |
-- CFLAGS (back end compilation flags such as -g -O2) |
| 35 |
-- ADAFLAGS (front end compilation flags such as -gnatn) |
| 36 |
-- |
| 37 |
-- 4. Run gprbuild on libada.gpr, e.g: |
| 38 |
-- $ gprbuild -p -Plibada -j0 -XCFLAGS="-O2 -g" -XADAFLAGS="-gnatn" |
| 39 |
-- |
| 40 |
-- or for a cross target: |
| 41 |
-- |
| 42 |
-- $ gprbuild --target=powerpc-elf -p -Plibada -j0 [...] |
| 43 |
-- |
| 44 |
-- if you created a gnat.adc file at step 2, add "-XCONFIG_FILE=gnat.adc" to |
| 45 |
-- the gprbuild switches. |
| 46 |
-- |
| 47 |
-- The above command will build libgnat.a and libgnarl.a with the given |
| 48 |
-- switches. |
| 49 |
-- |
| 50 |
-- 4b. In order to generate shared libraries instead, add |
| 51 |
-- "-XLIBRARY_KIND=dynamic" to the gprbuild switches, and if you want to |
| 52 |
-- build both shared and static libraries, you can run gprbuild twice in |
| 53 |
-- a row, e.g: |
| 54 |
-- |
| 55 |
-- $ gprbuild -p -Plibada -j0 -XLIBRARY_KIND=dynamic [...] |
| 56 |
-- $ gprbuild -p -Plibada -j0 -XLIBRARY_KIND=static [...] |
| 57 |
-- |
| 58 |
-- 5. Once the above gprbuild command is successful, you can use this new |
| 59 |
-- runtime directory by specifying it either via the --RTS= switch on the |
| 60 |
-- command line or via the attribute Runtime ("Ada") in the main project |
| 61 |
-- file: |
| 62 |
-- $ gprbuild --RTS=.../rts-debug ... |
| 63 |
-- or |
| 64 |
-- for Runtime ("Ada") use ".../rts-debug"; |
| 65 |
|
| 66 |
aggregate project Libada is |
| 67 |
for Project_Files use ("libgnat.gpr", "libgnarl.gpr"); |
| 68 |
|
| 69 |
Config_File := External ("CONFIG_FILE", ""); |
| 70 |
|
| 71 |
package Builder is |
| 72 |
case Config_File is |
| 73 |
when "" => null; |
| 74 |
when others => for Global_Configuration_Pragmas use Config_File; |
| 75 |
end case; |
| 76 |
end Builder; |
| 77 |
|
| 78 |
end Libada; |