Rombobjörn

summaryrefslogtreecommitdiff
path: root/build_milter_api.gpr.gp
blob: b8b2e335e280b27a5059927bd7d49338c8b9b33a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- project file to compile the Ada Milter API into a shared library
-- Copyright 2009 - 2013 B. Persson, Bjorn@Rombobeorn.se
--
-- This project file is free software: you can redistribute it and/or modify it
-- under the terms of the GNU General Public License version 3, as published
-- by the Free Software Foundation.


with "comfignat.gpr";
with "system_log.gpr";

library project Build_Milter_API is

   Version := "2.1.2";

   #if Wrap_Threads then
      Wrap_Flag := "-w";
      On_Or_Off := "on";
   #else
      Wrap_Flag := "";
      On_Or_Off := "off";
   #end if;

   for Library_Name      use "adamilter";
   for Library_Kind      use "dynamic";
   for Library_Version   use "libadamilter-" & Version & Wrap_Flag & ".so.0";
   for Languages         use ("Ada", "C");
   for Library_Interface use ("Milter_API", "Berkeley_Exit_Codes");
   for Source_Dirs       use ($Srcdir);
   for Object_Dir        use Comfignat.Objdir;
   for Library_Src_Dir   use Comfignat.Stage_Includedir & "/adamilter";
   for Library_Dir       use Comfignat.Stage_Libdir;
   for Library_ALI_Dir   use Comfignat.Stage_Alidir & "/adamilter";

   package Naming is
      for body("Milter_API.Start_Wrapping") use
         "milter_api-start_wrapping." & On_Or_Off & ".adb";
   end Naming;

   package Compiler is
      for Default_Switches ("Ada") use ("-gnato");
   end Compiler;

   -- Ensure that the shared library will be initialized. GPRbuild 2010 doesn't
   -- pass -a automatically. (Fixed in GPRbuild 2012.)
   package Binder is
      for Default_Switches ("Ada") use ("-a");
   end Binder;

   -- libadamilter shall link to libmilter.
   -- Also use any linker options that LDFLAGS might contain. This is necessary
   -- because Gnatmake and GPRbuild lack a command line separator for shared
   -- library linker options.
   for Library_Options use external_as_list("LDFLAGS", " ") & ("-lmilter");

   #if Wrap_Threads then
      package Linker is
         -- When the test milter links to libadamilter it shall link to
         -- libadamilter_thread_wrapper and libdl too.
         for Linker_Options use ("-ladamilter_thread_wrapper", "-ldl");
      end Linker;
   #end if;

end Build_Milter_API;