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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
with "gnatvsn";
with "gnatprj";
with "xmlada";
project Gprbuild is
type OS_Type is ("unix", "avms", "ivms", "Windows_NT");
OS : OS_Type := external ("OS", "unix");
type Build_Type is ("debug", "production", "coverage", "profiling");
Bld : Build_Type := external ("BUILD", "debug");
type Build_Tool_Type is ("gnatmake", "gprbuild");
Build_Tool : Build_Tool_Type := external ("BUILD_TOOL", "gnatmake");
type VCS_Type is ("Subversion", "Git", "auto");
VCS_Kind : VCS_Type := external ("PRJ_VCS", "Subversion");
Processors := external ("PROCESSORS", "1");
for Main use
("gprconfig-main.adb",
"gprbuild-main.adb",
"gprbind.adb",
"gprlib.adb",
"gprclean-main.adb",
"gprinstall-main.adb",
"gprslave.adb");
for Source_Dirs use ("src");
case Build_Tool is
when "gprbuild" =>
case Bld is
when "production" => for Object_Dir use "bootstrap/obj";
when "coverage" => for Object_Dir use "bootstrap/obj-cov";
when "profiling" => for Object_Dir use "bootstrap/obj-prof";
when "debug" => for Object_Dir use "bootstrap/obj-debug";
end case;
for Exec_Dir use "bootstrap";
when "gnatmake" =>
case Bld is
when "production" => for Object_Dir use "obj";
when "coverage" => for Object_Dir use "obj-cov";
when "profiling" => for Object_Dir use "obj-prof";
when "debug" => for Object_Dir use "obj-debug";
end case;
for Exec_Dir use ".";
end case;
case Build_Tool is
when "gprbuild" =>
for Languages use ("Ada", "C");
when "gnatmake" =>
for Languages use ("Ada", "C");
-- We only build the Ada part with projects so that we do not
-- have boostrap issues with gprbuild.
end case;
package Builder is
for Executable ("gprconfig-main.adb") use "gprconfig";
for Executable ("gprbuild-main.adb") use "gprbuild";
for Executable ("gprclean-main.adb") use "gprclean";
for Executable ("gprinstall-main.adb") use "gprinstall";
for Default_Switches ("Ada") use ("-m", "-j" & Processors);
for Switches ("Ada") use ();
end Builder;
package Compiler is
common_switches := ("-gnat12", "-gnaty", "-gnatQ");
case Bld is
when "debug" =>
for Default_Switches ("Ada") use common_switches &
("-g", "-gnata", "-gnatVa", "-gnatwaCJI"
, "-gnatwe"
, "-gnatyg"
);
for Local_Configuration_Pragmas use "debug.adc";
when "coverage" =>
for Default_Switches ("Ada") use common_switches &
("-ftest-coverage", "-fprofile-arcs");
when "profiling" =>
for Default_Switches ("Ada") use common_switches &
("-pg", "-g");
when "production" =>
for Default_Switches ("Ada") use common_switches &
("-O2", "-gnatpn", "-gnatws")
& External_As_List ("ADAFLAGS", " ");
end case;
end Compiler;
package Binder is
common_switches := ();
case Bld is
when "debug" =>
for Default_Switches ("Ada") use common_switches
& ("-Sin")
;
when "coverage" | "profiling" | "production" =>
for Default_Switches ("Ada") use common_switches;
end case;
end Binder;
package Linker is
Common_Switches := ();
-- We use project'Object_Dir here instead of GprBuild'Object_Dir
-- for compatibility with GNAT Pro 6.0.2.
Common_Switches_VMS :=
(project'Object_Dir & "/gprbuild_dummies.obj",
project'Object_Dir & "/link.obj");
case Build_Tool is
when "gnatmake" =>
-- Link manually the C part
case Bld is
when "production" | "debug" =>
case OS is
when "avms" | "ivms" =>
for Default_Switches ("Ada") use Common_Switches_VMS;
when others =>
for Default_Switches ("Ada") use
External_As_List ("LDFLAGS", " ")
& Common_Switches;
end case;
when "coverage" =>
case OS is
when "avms" | "ivms" =>
for Default_Switches ("Ada") use Common_Switches_VMS;
when others =>
for Default_Switches ("Ada") use
Common_Switches & ("-lgcov");
end case;
when "profiling" =>
for Default_Switches ("Ada") use Common_Switches & ("-pg", "-g");
end case;
when "gprbuild" =>
null;
end case;
end Linker;
Common_Excluded_Source_Files :=
("gprlib-build_shared_lib.adb",
"gprlib-build_shared_lib-nosymbols.adb",
"gprlib-build_shared_lib-vms.adb");
case Build_Tool is
when "gprbuild" =>
case OS is
when "unix" | "Windows_NT" =>
for Locally_Removed_Files
use Common_Excluded_Source_Files;
-- Excluded_Source_File not supported by GNAT Pro 6.0.2
when "avms" | "ivms" =>
for Locally_Removed_Files
use Common_Excluded_Source_Files;
-- Excluded_Source_File not supported by GNAT Pro 6.0.2
end case;
when "gnatmake" =>
null;
end case;
package Naming is
case OS is
when "unix" | "Windows_NT" =>
for Body ("gprlib.build_shared_lib")
use "gprlib-build_shared_lib-nosymbols.adb";
when "avms" =>
for Body ("gprlib.build_shared_lib")
use "gprlib-build_shared_lib-vms.adb";
when "ivms" =>
for Body ("gprlib.build_shared_lib")
use "gprlib-build_shared_lib-vms.adb";
end case;
end Naming;
package IDE is
for VCS_Kind use VCS_Kind;
end IDE;
end Gprbuild;
|