Files
aws/shared.gpr

225 lines
7.0 KiB
Plaintext
Raw Permalink Normal View History

2003-05-06 17:42:32 +00:00
------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2003-2024, AdaCore --
2003-05-06 17:42:32 +00:00
-- --
2011-12-31 15:52:39 +01:00
-- This is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This software is distributed in the hope that it will --
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty --
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
2003-05-06 17:42:32 +00:00
-- --
2011-12-31 15:52:39 +01:00
-- You should have received a copy of the GNU General Public License --
-- distributed with this software; see file COPYING3. If not, go --
-- to http://www.gnu.org/licenses for a complete copy of the license. --
2003-05-06 17:42:32 +00:00
------------------------------------------------------------------------------
2011-05-31 15:23:30 +02:00
abstract project Shared is
2003-05-06 17:42:32 +00:00
for Source_Dirs use ();
Build_Target_Dir := external("TGT_DIR");
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("PRJ_BUILD", "Debug");
2003-05-06 17:42:32 +00:00
type Install_Status is ("Installed", "Disabled");
Processors := External ("PROCESSORS", "0");
type Boolean is ("true", "false");
Thread_Sanitizer : Boolean := External ("THREAD_SANITIZER", "false");
-------------
-- SOCKLIB --
-------------
type SOCKLIB_Type is ("gnat", "ipv6", "ipv4");
SOCKLIB : SOCKLIB_Type := external ("PRJ_SOCKLIB", "gnat");
------------
-- SOCKET --
------------
type Socket_Type is ("std", "ssl", "openssl", "gnutls");
Socket : Socket_Type := external ("SOCKET", "std");
2022-01-21 13:50:54 +06:00
SSL_Dynamic : Boolean := External ("SSL_DYNAMIC", "false");
--------------------------
-- Static / Relocatable --
--------------------------
type Library_Kind is ("relocatable", "static", "static-pic");
Library_Type : Library_Kind := external ("LIBRARY_TYPE", "static");
---------------------
-- Target to build --
---------------------
Target := external ("TARGET", "i686-pc-mingw32");
type S_Target_type is ("Windows_NT", "UNIX", "Darwin", "vxworks", "freebsd");
S_Target : S_Target_Type := external ("PRJ_TARGET");
-----------------------
-- Build directories --
-----------------------
Target_Dir := Target;
case Build is
when "Debug" =>
for Exec_Dir use Target_Dir & "/debug/" & Library_Type;
when "Release" =>
for Exec_Dir use Target_Dir & "/release/" & Library_Type;
2018-03-14 18:58:00 +01:00
end case;
for Object_Dir use Project'Exec_Dir & "/obj";
for Library_Dir use Project'Exec_Dir & "/lib";
------------------------
-- External Libraries --
------------------------
XMLAda : Install_Status := external ("PRJ_XMLADA", "Installed");
LAL : Install_Status := external ("PRJ_LAL", "Installed");
LDAP : Install_Status := external ("PRJ_LDAP", "Installed");
--------------------
-- External flags --
--------------------
Adaflags := External_As_List ("ADAFLAGS", " ");
Cflags := External_As_List ("CFLAGS", " ");
Cppflags := External_As_List ("CPPFLAGS", " ");
Ldflags := External_As_List ("LDFLAGS", " ");
2003-12-20 11:55:25 +00:00
---------
-- Ide --
---------
type VCS_Type is ("Subversion", "Git");
2011-02-25 16:14:07 +01:00
VCS_Kind : VCS_Type := external ("PRJ_VCS", "Git");
2003-12-20 11:55:25 +00:00
package Ide is
for VCS_Kind use VCS_Kind;
for VCS_Log_Check
use "style_checker -l70 -H";
for VCS_File_Check
use "style_checker -ign out -ign tmplt -ign sed -ign txt"
& " -lang Ada -cp -cy -sp -gnat2022"
2007-02-02 17:53:26 +00:00
& " -lang XML -l256";
2003-12-20 11:55:25 +00:00
end Ide;
2003-05-06 17:42:32 +00:00
--------------
-- Compiler --
--------------
Global_Options := ();
-- Options used for all Ada units in both Debug and Release modes
Instrument_Options := ();
-- Instrumentation option
case Thread_Sanitizer is
when "false" =>
null;
when "true" =>
Instrument_Options := ("-fsanitize=thread");
end case;
Common_Options :=
("-gnat2022", "-gnatwcfijkmruv", "-gnaty3abBcdefhiIklmnoOprstx")
& Global_Options & Instrument_Options;
2006-07-06 18:12:05 +00:00
-- Common options used for the Debug and Release modes
Debug_Options :=
("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato", "-Wall", "-gnatwe");
Release_Options := ("-O2", "-gnatn");
2003-05-06 17:42:32 +00:00
package Compiler is
for Driver ("Makefile") use "";
2003-05-06 17:42:32 +00:00
case Build is
when "Debug" =>
for Default_Switches ("Ada") use Common_Options & Debug_Options;
for Default_Switches ("C")
use ("-g", "-Wno-implicit-function-declaration");
2003-05-06 17:42:32 +00:00
when "Release" =>
for Default_Switches ("Ada") use Common_Options & Release_Options;
for Default_Switches ("C")
use ("-O2", "-Wno-implicit-function-declaration");
2003-05-06 17:42:32 +00:00
end case;
for Switches ("ssl-thin.ads")
use Compiler'Default_Switches ("Ada") & "-gnatyM300";
-- The file ssl-thin.ads is generated from ssl-thin__openssl.ads or from
-- ssl-thin__gnutls.ads and was reformatted with gnatpp, but gnatpp
-- unable to split long line of aspect list, see V117-043. It is because
-- we use "-gnatyM300" option to increate maximum line length.
case S_Target is
when "Darwin" =>
for Default_Switches ("Ada")
use Compiler'Default_Switches ("Ada") & ("-fno-common");
when others =>
null;
end case;
-- ADAFLAGS and CFLAGS should come last so that command line
-- settings override the ones in this project.
for Default_Switches ("Ada") use
Compiler'Default_Switches ("Ada") & Adaflags;
for Default_Switches ("C") use
Compiler'Default_Switches ("C") & Cflags & Cppflags;
2003-05-06 17:42:32 +00:00
end Compiler;
------------
-- Binder --
------------
package Binder is
for Default_Switches ("Ada") use ("-E");
end Binder;
2003-05-06 17:42:32 +00:00
-------------
-- Builder --
-------------
package Builder is
for Switches (others) use ("-m", "-j" & Processors);
2003-05-06 17:42:32 +00:00
end Builder;
------------
-- Linker --
------------
package Linker is
for Default_Switches ("Ada") use Ldflags & Instrument_Options;
end Linker;
-- LDFLAGS should come first so that command line settings
-- influence the way -l options are handled afterwards.
-- For library projects, use Leading_Library_Options instead.
Leading_Library_Options := Ldflags;
------------
-- Naming --
------------
package Naming is
for Implementation_Suffix ("Makefile") use ".txt";
for Implementation_Exceptions ("Makefile") use ("Makefile");
end Naming;
2003-05-06 17:42:32 +00:00
end Shared;