------------------------------------------------------------------------------
--                              Ada Web Server                              --
--                                                                          --
--                         Copyright (C) 2003-2007                          --
--                                 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 "../shared.gpr";
with "../include/include";
with "../src/src";
with "asis";

project Tools is

   for Languages use ("Ada", "Project file", "makefile");

   for Source_Dirs use (".", "../templates_parser/tools");

   for Main use ("awsres", "hotplug_password", "templates2ada", "webxref",
                 "templatespp");

   case Shared.XMLAda is
      when "Installed" =>
         for Main use project'Main & ("wsdl2aws");
      when "Disabled" =>
         for Locally_Removed_Files use
           Project'Locally_Removed_Files & ("wsdl2aws.adb");
   end case;

   case Shared.ASIS is
      when "Installed" =>
         for Main use project'Main & ("ada2wsdl-main");
      when "Disabled" =>
         for Locally_Removed_Files use Project'Locally_Removed_Files &
           ("ada2wsdl.ads", "ada2wsdl.adb",
            "ada2wsdl-generator.ads", "ada2wsdl-generator.adb",
            "ada2wsdl-main.ads", "ada2wsdl-main.adb",
            "ada2wsdl-options.ads", "ada2wsdl-options.adb",
            "ada2wsdl-parser.ads", "ada2wsdl-parser.adb");
   end case;

   for Object_Dir use "../" & Shared'Object_Dir & "/tools";
   for Exec_Dir use "../" & Shared'Exec_Dir & "/tools";

   --------------
   -- Compiler --
   --------------

   package Compiler renames Shared.Compiler;

   ------------
   -- Binder --
   ------------

   package Binder renames Shared.Binder;

   -------------
   -- Builder --
   -------------

   package Builder renames Shared.Builder;

   ---------
   -- Ide --
   ---------

   package Ide renames Shared.Ide;

   ------------
   -- Linker --
   ------------

   package Linker is

      case Shared.Build is
         when "Release" =>
            for Default_Switches ("Ada") use ("-s");
	 when others =>
            null;
      end case;

      for Switches ("awsres.adb") use
         Linker'Default_Switches ("Ada") & Shared.ZLib;
      for Switches ("wsdl2aws.adb") use
         Linker'Default_Switches ("Ada") & Shared.ZLib;
      for Switches ("ada2wsdl-main.adb") use
         Linker'Default_Switches ("Ada") & Shared.ZLib & ("-lasis");

   end Linker;

end Tools;
