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