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

aggregate project Libada is
   for Project_Files use ("libgnat.gpr", "libgnarl.gpr");

   Config_File := External ("CONFIG_FILE", "");

   package Builder is
      case Config_File is
         when ""     => null;
         when others => for Global_Configuration_Pragmas use Config_File;
      end case;
   end Builder;

end Libada;