with "hungarian/hungarian"; with "gtkada_conditional"; project Agpl is type Boolean is ("True", "False"); type Enabled_Disabled is ("Enabled", "Disabled"); type Yes_No is ("Yes", "No"); for Source_Dirs use (); for Object_Dir use "obj"; for Exec_Dir use "obj"; for Languages use ("Ada", "C", "C++"); Lib_Name := "agpl"; Lib_Version := "20070228"; type Build_Type is ("Debug", "Release", "No_Options", "Profile"); type Linking_Type is ("Dependencies", "Static_Library", "Dynamic_Library"); Build : Build_Type := external ("Agpl_Build", "Debug"); Link : Linking_Type := External ("Agpl_Link", "Dependencies"); case Link is when "Dependencies" => null; when "Static_Library" => for Library_Dir use "libstatic"; for Library_Name use Lib_Name; for Library_Kind use "Static"; for Library_Version use Lib_Name & ".a." & Lib_Version; when "Dynamic_Library" => for Library_Dir use "libdynamic"; for Library_Name use Lib_Name; for Library_Kind use "Dynamic"; for Library_Version use Lib_Name & ".so." & Lib_Version; end case; -- Selective functionalities of Agpl Include_Base : Yes_No := External ("Agpl_Include_Base", "Yes"); Include_Concorde : Yes_No := External ("Agpl_Include_Concorde", "Yes"); Include_Gtk : Yes_No := External ("Agpl_Include_Gtk", "No"); -- Requires GtkAda Include_Http : Yes_No := External ("Agpl_Include_Http", "No"); -- Requires AWS Include_Db : Yes_No := External ("Agpl_Include_Db", "No"); Include_Boost : Yes_No := External ("Agpl_Include_Boost", "Yes"); -- Requires Boost Graph Include_Pngio : Yes_No := External ("Agpl_Include_PngIO", "Yes"); Include_Test : Yes_No := External ("Agpl_Include_Test", "No"); Trace_Enabled : Enabled_Disabled := External ("Agpl_Trace", "Enabled"); case Include_Base is when "Yes" => for Source_Dirs use ("src", "./3rdparty/asl", "./3rdparty/mw", "./3rdparty/xmlada"); when "No" => for Source_Dirs use (); end case; case Include_Concorde is when "Yes" => for Source_Dirs use project'Source_Dirs & "agpl-concorde"; when "No" => null; end case; case Include_Gtk is when "Yes" => for Source_Dirs use project'Source_Dirs & "agpl-gdk"; when "No" => null; end case; case Include_Http is when "Yes" => for Source_Dirs use project'Source_Dirs & "agpl-http"; when "No" => null; end case; case Include_Db is when "Yes" => for Source_Dirs use project'Source_Dirs & "agpl-db"; when "No" => null; end case; case Include_Boost is when "Yes" => for Source_Dirs use project'Source_Dirs & "agpl-boost"; when "No" => null; end case; case Include_Test is when "Yes" => for Source_Dirs use project'Source_Dirs & "tests"; when "No" => null; end case; case Include_Pngio is when "Yes" => for Source_Dirs use project'Source_Dirs & "./3rdparty/png_io" & "./3rdparty/zlib_ada"; when "No" => null; end case; case Trace_Enabled is when "Enabled" => for Source_Dirs use project'Source_Dirs & ("trace_true"); when "Disabled" => for Source_Dirs use project'Source_Dirs & ("trace_false"); end case; package Ide is for Vcs_Kind use "Subversion"; end Ide; package Compiler is for Default_Switches ("C") use ("-g", "-Wall", "-O2"); for Default_Switches ("C++") use ("-g", "-Wall", "-O2"); for Default_Switches ("Ada") use ("-g", "-s", "-gnatf", "-gnat05", "-gnatwcfjklmopruvz", "-gnatyacehikn", "-gnatqQ"); -- Switches for files with problems -- for Switches ("agpl-gdk.adb") use Compiler'Default_Switches ("Ada") & ("-O0", "-gnatao", "-fstack-check"); -- for Switches ("agpl-gdk-drawer_figures.adb") use Compiler'Default_Switches ("Ada") & ("-O0", "-gnatao", "-fstack-check"); case Build is when "Profile" => for Default_Switches ("Ada") use Compiler'Default_Switches ("Ada") & ("-O2", "-gnato", "-fstack-check", "-gnata", "-gnatpg"); when "Debug" => for Default_Switches ("Ada") use Compiler'Default_Switches ("Ada") & ("-O2", "-gnato", "-fstack-check", "-gnata"); when "Release" => for Default_Switches ("Ada") use Compiler'Default_Switches ("Ada") & ("-O3", "-gnatn"); for Default_Switches ("C") use Compiler'Default_Switches ("C") & ("-O3"); for Default_Switches ("C++") use Compiler'Default_Switches ("C") & ("-O3"); when "No_Options" => for Default_Switches ("Ada") use ("-gnat05"); -- Deliberately override default switches not to have any! end case; end Compiler; package Binder is for Default_Switches ("Ada") use ("-E", "-g", "-r"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g", "-Wl,--gc-sections"); for Default_Switches ("C") use ("-g"); for Default_Switches ("C++") use ("-g"); case Include_Concorde is when "Yes" => for Linker_Options use ("-Lagpl-concorde"); when "No" => null; end case; end Linker; package Builder is for Default_Switches ("Ada") use ("-g"); end Builder; package Pretty_Printer is for Default_Switches ("Ada") use ("-A1", "-A2", "-A3", "-A4"); end Pretty_Printer; package Naming is for Specification_Suffix ("C") use ".h"; for Implementation_Suffix ("C") use ".c"; for Specification_Suffix ("C++") use ".hh"; for Implementation_Suffix ("C++") use ".cc"; for Specification_Suffix ("Changelog") use "changelog"; for Specification_Suffix ("Project file") use ".gpr"; for Specification_Suffix ("Python") use ".py"; end Naming; end Agpl;