project Common is

   for Source_Dirs use ();
   type Bld_Type is ("prod", "debug", "prod_strict", "prod_no_checks");
   Bld : Bld_Type := external ("BLD", "prod");

   type OS_Type is ("default_Unix", "powerpc_aix", "pa_hpux");
   OS : OS_Type := external ("OPSYS", "default_Unix");

   Ada_Strict_Switches  := ("-gnatf", "-gnatwae", "-gnatw.g",  "-gnatyg", "-gnatyS");
   Ada_Relaxed_Switches := ("-gnatf", "-gnatws");

   Processors := External ("PROCESSORS", "1");

   package Builder is

      case bld is
         when "prod" =>
            for Default_Switches ("ada") use Ada_Relaxed_Switches & ("-O2");
         when "prod_strict" =>
            for Default_Switches ("ada") use Ada_Strict_Switches & ("-O2");
         when "debug" =>
            for Default_Switches ("ada")
              use Ada_Strict_Switches & ("-g", "-gnata");
         when "prod_no_checks" =>
            for Default_Switches ("ada")
              use Ada_Strict_Switches & ("-O2", "-gnatp");
      end case;

      case OS is
         when "powerpc_aix" =>
            for Default_Switches ("ada") use
              Builder'Default_Switches ("ada") & ("-mminimal-toc");
         when "pa_hpux" =>
            for Default_Switches ("ada") use
              Builder'Default_Switches ("ada") & ("-mdisable-indexing");
         when others =>
            null;
      end case;

      for Default_Switches ("ada") use
        Builder'Default_Switches ("ada") & ("-m", "-j" & Processors);
   end Builder;

   package Binder is
      for Default_Switches ("ada") use ("-static");
   end Binder;

   package Ide is
      for Vcs_Kind use "Subversion";
   end Ide;

end Common;
