------------------------------------------------------------------------------
--                              Ada Web Server                              --
--                                                                          --
--                         Copyright (C) 2005-2008                          --
--                                 AdaCore                                  --
--                                                                          --
--  This library is free software; you can redistribute it and/or modify    --
--  it under the terms of the GNU General Public License as published by    --
--  the Free Software Foundation; either version 2 of the License, or (at   --
--  your option) any later version.                                         --
--                                                                          --
--  This library 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.                                --
--                                                                          --
--  You should have received a copy of the GNU General Public License       --
--  along with this library; if not, write to the Free Software Foundation, --
--  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.          --
--                                                                          --
------------------------------------------------------------------------------

with "aws_config";

project AWS_Shared is

   for Source_Dirs use ();

   type Library_Kind is ("relocatable", "static");
   Library_Type : Library_Kind :=
      external ("LIBRARY_TYPE", AWS_Config.Default_Library_Type);

   for Library_Dir use "../../aws";

   case Library_Type is
      when "static" =>
         for Library_Dir use Project'Library_Dir & "/static";
      when "relocatable" =>
         for Library_Dir use Project'Library_Dir & "/relocatable";
   end case;

   ------------
   -- Naming --
   ------------

   package Naming is

      -- Templates Parser

      for Specification ("Templates_Parser.Configuration")
        use "templates_parser-configuration__aws.ads";

      for Implementation ("Templates_Parser.Input")
        use "templates_parser-input__aws.adb";

      for Implementation ("Templates_Parser.Tasking")
        use "templates_parser-tasking__standard_tasking.adb";

      --  SOCKLIB

      case AWS_Config.SOCKLIB is
         when "GNAT" =>
            for Implementation ("AWS.Net.Std")
              use "aws-net-std__gnat.adb";
         when "IPv6" =>
            for Implementation ("AWS.Net.Std")
              use "aws-net-std__ipv6.adb";
      end case;

      --  SSL Lib

      case AWS_Config.Socket is
         when "std" =>
            for Specification ("SSL.Thin") use "ssl-thin__dummy.ads";
            for Implementation ("AWS.Net.SSL")
              use "aws-net-ssl__dummy.adb";
            for Implementation ("AWS.Net.SSL.Certificate")
              use "aws-net-ssl-certificate__dummy.adb";
         when "openssl" =>
            for Specification ("SSL.Thin") use "ssl-thin__openssl.ads";
            for Implementation ("AWS.Net.SSL")
              use "aws-net-ssl__openssl.adb";
            for Implementation ("AWS.Net.SSL.Certificate")
              use "aws-net-ssl-certificate__openssl.adb";
         when "gnutls" =>
            for Specification ("SSL.Thin") use "ssl-thin__gnutls.ads";
            for Implementation ("AWS.Net.SSL")
              use "aws-net-ssl__gnutls.adb";
            for Implementation ("AWS.Net.SSL.Certificate")
              use "aws-net-ssl-certificate__gnutls.adb";
      end case;

   end Naming;

end AWS_Shared;
