2003-05-06 17:42:32 +00:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
-- Ada Web Server --
|
|
|
|
|
-- --
|
2024-02-05 18:54:27 +01:00
|
|
|
-- 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
|
|
|
|
2007-09-23 07:52:42 +00:00
|
|
|
for Source_Dirs use ();
|
|
|
|
|
|
2024-01-05 18:11:01 +01:00
|
|
|
Build_Target_Dir := external("TGT_DIR");
|
|
|
|
|
|
2003-08-02 08:07:21 +00:00
|
|
|
type Build_Type is ("Debug", "Release");
|
2007-09-28 16:24:41 +00:00
|
|
|
Build : Build_Type := external ("PRJ_BUILD", "Debug");
|
2003-05-06 17:42:32 +00:00
|
|
|
|
2007-09-23 07:52:42 +00:00
|
|
|
type Install_Status is ("Installed", "Disabled");
|
2003-12-19 19:49:11 +00:00
|
|
|
|
2013-11-01 11:10:55 +01:00
|
|
|
Processors := External ("PROCESSORS", "0");
|
2010-07-31 15:21:46 +00:00
|
|
|
|
2021-06-24 20:15:40 +06:00
|
|
|
type Boolean is ("true", "false");
|
|
|
|
|
|
|
|
|
|
Thread_Sanitizer : Boolean := External ("THREAD_SANITIZER", "false");
|
|
|
|
|
|
2005-02-16 14:52:24 +00:00
|
|
|
-------------
|
|
|
|
|
-- SOCKLIB --
|
|
|
|
|
-------------
|
|
|
|
|
|
2018-07-09 19:50:13 +06:00
|
|
|
type SOCKLIB_Type is ("gnat", "ipv6", "ipv4");
|
|
|
|
|
SOCKLIB : SOCKLIB_Type := external ("PRJ_SOCKLIB", "gnat");
|
2005-02-16 14:52:24 +00:00
|
|
|
|
2007-09-23 07:52:42 +00:00
|
|
|
------------
|
|
|
|
|
-- 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");
|
|
|
|
|
|
2007-11-03 11:54:58 +00:00
|
|
|
--------------------------
|
|
|
|
|
-- Static / Relocatable --
|
|
|
|
|
--------------------------
|
|
|
|
|
|
2023-07-24 15:56:51 +02:00
|
|
|
type Library_Kind is ("relocatable", "static", "static-pic");
|
2008-05-17 10:52:39 +00:00
|
|
|
Library_Type : Library_Kind := external ("LIBRARY_TYPE", "static");
|
2007-11-03 11:54:58 +00:00
|
|
|
|
2009-12-29 21:57:54 +00:00
|
|
|
---------------------
|
|
|
|
|
-- Target to build --
|
|
|
|
|
---------------------
|
|
|
|
|
|
2012-10-14 16:31:15 +02:00
|
|
|
Target := external ("TARGET", "i686-pc-mingw32");
|
|
|
|
|
|
2013-10-09 15:38:42 +02:00
|
|
|
type S_Target_type is ("Windows_NT", "UNIX", "Darwin", "vxworks", "freebsd");
|
2012-10-14 16:31:15 +02:00
|
|
|
S_Target : S_Target_Type := external ("PRJ_TARGET");
|
2009-12-29 21:57:54 +00:00
|
|
|
|
2007-11-03 11:54:58 +00:00
|
|
|
-----------------------
|
|
|
|
|
-- Build directories --
|
|
|
|
|
-----------------------
|
|
|
|
|
|
2024-01-05 18:11:01 +01:00
|
|
|
Target_Dir := Target;
|
2007-11-03 11:54:58 +00:00
|
|
|
|
|
|
|
|
case Build is
|
|
|
|
|
when "Debug" =>
|
2024-01-05 18:11:01 +01:00
|
|
|
for Exec_Dir use Target_Dir & "/debug/" & Library_Type;
|
2007-11-03 11:54:58 +00:00
|
|
|
when "Release" =>
|
2024-01-05 18:11:01 +01:00
|
|
|
for Exec_Dir use Target_Dir & "/release/" & Library_Type;
|
2018-03-14 18:58:00 +01:00
|
|
|
end case;
|
2007-11-03 11:54:58 +00:00
|
|
|
|
|
|
|
|
for Object_Dir use Project'Exec_Dir & "/obj";
|
|
|
|
|
for Library_Dir use Project'Exec_Dir & "/lib";
|
|
|
|
|
|
2007-09-23 07:52:42 +00:00
|
|
|
------------------------
|
|
|
|
|
-- External Libraries --
|
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
|
|
XMLAda : Install_Status := external ("PRJ_XMLADA", "Installed");
|
2020-02-24 19:46:32 +01:00
|
|
|
LAL : Install_Status := external ("PRJ_LAL", "Installed");
|
2007-09-23 07:52:42 +00:00
|
|
|
LDAP : Install_Status := external ("PRJ_LDAP", "Installed");
|
|
|
|
|
|
2014-08-18 10:53:22 +02:00
|
|
|
--------------------
|
|
|
|
|
-- External flags --
|
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
|
|
Adaflags := External_As_List ("ADAFLAGS", " ");
|
|
|
|
|
Cflags := External_As_List ("CFLAGS", " ");
|
2020-04-16 23:52:13 +02:00
|
|
|
Cppflags := External_As_List ("CPPFLAGS", " ");
|
2014-08-18 10:53:22 +02:00
|
|
|
Ldflags := External_As_List ("LDFLAGS", " ");
|
|
|
|
|
|
2003-12-20 11:55:25 +00:00
|
|
|
---------
|
|
|
|
|
-- Ide --
|
|
|
|
|
---------
|
|
|
|
|
|
2008-09-10 16:35:59 +00:00
|
|
|
type VCS_Type is ("Subversion", "Git");
|
2011-02-25 16:14:07 +01:00
|
|
|
VCS_Kind : VCS_Type := external ("PRJ_VCS", "Git");
|
2008-09-10 16:35:59 +00:00
|
|
|
|
2003-12-20 11:55:25 +00:00
|
|
|
package Ide is
|
2008-09-10 16:35:59 +00:00
|
|
|
for VCS_Kind use VCS_Kind;
|
2006-09-06 13:46:55 +00:00
|
|
|
for VCS_Log_Check
|
2007-08-06 17:29:52 +00:00
|
|
|
use "style_checker -l70 -H";
|
2006-09-06 13:46:55 +00:00
|
|
|
for VCS_File_Check
|
2007-08-01 17:20:20 +00:00
|
|
|
use "style_checker -ign out -ign tmplt -ign sed -ign txt"
|
2024-02-13 21:59:58 +01:00
|
|
|
& " -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 --
|
|
|
|
|
--------------
|
|
|
|
|
|
2008-08-01 14:51:27 +00:00
|
|
|
Global_Options := ();
|
2006-03-15 18:18:04 +00:00
|
|
|
-- Options used for all Ada units in both Debug and Release modes
|
|
|
|
|
|
2021-06-24 20:15:40 +06:00
|
|
|
Instrument_Options := ();
|
|
|
|
|
-- Instrumentation option
|
|
|
|
|
|
|
|
|
|
case Thread_Sanitizer is
|
|
|
|
|
when "false" =>
|
|
|
|
|
null;
|
|
|
|
|
when "true" =>
|
|
|
|
|
Instrument_Options := ("-fsanitize=thread");
|
|
|
|
|
end case;
|
|
|
|
|
|
2007-08-01 17:20:20 +00:00
|
|
|
Common_Options :=
|
2024-02-13 21:59:58 +01:00
|
|
|
("-gnat2022", "-gnatwcfijkmruv", "-gnaty3abBcdefhiIklmnoOprstx")
|
2021-06-24 20:15:40 +06:00
|
|
|
& Global_Options & Instrument_Options;
|
2006-07-06 18:12:05 +00:00
|
|
|
-- Common options used for the Debug and Release modes
|
2006-04-26 13:37:14 +00:00
|
|
|
|
2007-08-01 17:20:20 +00:00
|
|
|
Debug_Options :=
|
2022-02-06 20:44:28 +06:00
|
|
|
("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato", "-Wall", "-gnatwe");
|
2006-04-26 13:37:14 +00:00
|
|
|
|
2022-02-06 20:44:28 +06:00
|
|
|
Release_Options := ("-O2", "-gnatn");
|
2005-03-23 14:21:16 +00:00
|
|
|
|
2003-05-06 17:42:32 +00:00
|
|
|
package Compiler is
|
|
|
|
|
|
2015-06-16 17:08:05 +02:00
|
|
|
for Driver ("Makefile") use "";
|
2012-06-26 17:24:17 +02:00
|
|
|
|
2003-05-06 17:42:32 +00:00
|
|
|
case Build is
|
|
|
|
|
when "Debug" =>
|
2005-03-23 14:21:16 +00:00
|
|
|
for Default_Switches ("Ada") use Common_Options & Debug_Options;
|
2017-04-27 12:16:49 +02:00
|
|
|
for Default_Switches ("C")
|
|
|
|
|
use ("-g", "-Wno-implicit-function-declaration");
|
2003-05-06 17:42:32 +00:00
|
|
|
|
2003-08-02 08:07:21 +00:00
|
|
|
when "Release" =>
|
2005-03-23 14:21:16 +00:00
|
|
|
for Default_Switches ("Ada") use Common_Options & Release_Options;
|
2017-04-27 12:16:49 +02:00
|
|
|
for Default_Switches ("C")
|
|
|
|
|
use ("-O2", "-Wno-implicit-function-declaration");
|
2003-05-06 17:42:32 +00:00
|
|
|
end case;
|
|
|
|
|
|
2022-02-06 20:44:28 +06:00
|
|
|
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.
|
|
|
|
|
|
2012-10-14 16:31:15 +02:00
|
|
|
case S_Target is
|
2007-10-25 20:30:02 +00:00
|
|
|
when "Darwin" =>
|
|
|
|
|
for Default_Switches ("Ada")
|
|
|
|
|
use Compiler'Default_Switches ("Ada") & ("-fno-common");
|
|
|
|
|
when others =>
|
|
|
|
|
null;
|
|
|
|
|
end case;
|
|
|
|
|
|
2014-08-18 10:53:22 +02:00
|
|
|
-- 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
|
2020-04-16 23:52:13 +02:00
|
|
|
Compiler'Default_Switches ("C") & Cflags & Cppflags;
|
2014-08-18 10:53:22 +02:00
|
|
|
|
2003-05-06 17:42:32 +00:00
|
|
|
end Compiler;
|
|
|
|
|
|
2004-11-26 22:47:55 +00:00
|
|
|
------------
|
|
|
|
|
-- Binder --
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
package Binder is
|
|
|
|
|
for Default_Switches ("Ada") use ("-E");
|
|
|
|
|
end Binder;
|
|
|
|
|
|
2003-05-06 17:42:32 +00:00
|
|
|
-------------
|
|
|
|
|
-- Builder --
|
|
|
|
|
-------------
|
|
|
|
|
|
|
|
|
|
package Builder is
|
2010-07-31 15:21:46 +00:00
|
|
|
for Switches (others) use ("-m", "-j" & Processors);
|
2003-05-06 17:42:32 +00:00
|
|
|
end Builder;
|
|
|
|
|
|
2014-08-18 10:53:22 +02:00
|
|
|
------------
|
|
|
|
|
-- Linker --
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
package Linker is
|
2021-06-24 20:15:40 +06:00
|
|
|
for Default_Switches ("Ada") use Ldflags & Instrument_Options;
|
2014-08-18 10:53:22 +02:00
|
|
|
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;
|
|
|
|
|
|
2012-06-26 17:24:17 +02:00
|
|
|
------------
|
|
|
|
|
-- Naming --
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
package Naming is
|
2015-06-16 17:08:05 +02:00
|
|
|
for Implementation_Suffix ("Makefile") use ".txt";
|
|
|
|
|
for Implementation_Exceptions ("Makefile") use ("Makefile");
|
2012-06-26 17:24:17 +02:00
|
|
|
end Naming;
|
|
|
|
|
|
2003-05-06 17:42:32 +00:00
|
|
|
end Shared;
|