1 -- This is a project file used to rebuild the GNAT run-time for debug
2 -- or instrumentation purposes.
4 -- Here is how to use this project file:
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>
14 -- $ cp -a `gprls -v \
15 -- [--target=<target>] --RTS=native | grep adainclude` .
21 -- $ xcopy /s /path/to/adainclude adainclude
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.
28 -- $ echo "pragma Normalize_Scalars;" > gnat.adc
30 -- Note that this step is usually not needed, and most pragmas are not
31 -- relevant to the GNAT run time.
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)
37 -- 4. Run gprbuild on libada.gpr, e.g:
38 -- $ gprbuild -p -Plibada -j0 -XCFLAGS="-O2 -g" -XADAFLAGS="-gnatn"
40 -- or for a cross target:
42 -- $ gprbuild --target=powerpc-elf -p -Plibada -j0 [...]
44 -- if you created a gnat.adc file at step 2, add "-XCONFIG_FILE=gnat.adc" to
45 -- the gprbuild switches.
47 -- The above command will build libgnat.a and libgnarl.a with the given
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
55 -- $ gprbuild -p -Plibada -j0 -XLIBRARY_KIND=dynamic [...]
56 -- $ gprbuild -p -Plibada -j0 -XLIBRARY_KIND=static [...]
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
62 -- $ gprbuild --RTS=.../rts-debug ...
64 -- for Runtime ("Ada") use ".../rts-debug";
66 aggregate project Libada is
67 for Project_Files use ("libgnat.gpr", "libgnarl.gpr");
69 Config_File := External ("CONFIG_FILE", "");
74 when others => for Global_Configuration_Pragmas use Config_File;