summaryrefslogtreecommitdiff
path: root/libs/regex/build/Jamfile.v2
blob: 75bf2a63949fc399a950043fd12c8aa9c79c6da7 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# copyright John Maddock 2003
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or copy at 
# http://www.boost.org/LICENSE_1_0.txt.

import modules ;

project : requirements
   # default to all warnings on:
   <warnings>all
   ;

local disable-icu = [ MATCH (--disable-icu) : [ modules.peek : ARGV ] ] ;

rule path_options ( properties * )
{
    local result ;
    if <address-model>64 in $(properties) && <toolset>msvc in $(properties) 
    {
    	result = <search>$(ICU_PATH)/bin64 <search>$(ICU_PATH)/lib64 ;
    }
    else
    {
    	result = <search>$(ICU_PATH)/bin <search>$(ICU_PATH)/lib ;
    }
    return $(result) ;
}


#
# ICU configuration:
#
if ! $(disable-icu)
{

   if [ modules.peek : ICU_PATH ]
   {    
       ICU_PATH =  [ modules.peek : ICU_PATH ] ;
   }
   if [ modules.peek : ICU_LINK ]
   {    
       ICU_LINK =  [ modules.peek : ICU_LINK ] ;
   }

   if $(ICU_LINK)
   {
      ICU_OPTS = <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <define>BOOST_HAS_ICU=1 <runtime-link>shared ;
   }
   else
   {
      lib icuuc : :                                                               <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuuc : : <toolset>msvc                     <variant>debug <name>icuucd <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>icuucd <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuuc : : <name>this_is_an_invalid_library_name ;

      lib icudt : : <name>icudata                                   <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icudt : : <name>icudt   <toolset>msvc                     <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icudt : : <name>icudt   <toolset>intel <target-os>windows <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icudt : : <name>this_is_an_invalid_library_name ;

      lib icuin : :                                                    <name>icui18n <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuin : : <toolset>msvc                     <variant>debug   <name>icuind  <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuin : : <toolset>msvc                     <variant>release <name>icuin   <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuin : : <toolset>intel <target-os>windows <variant>debug   <name>icuind  <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuin : : <toolset>intel <target-os>windows <variant>release <name>icuin   <link>shared <runtime-link>shared <conditional>@path_options ;
      lib icuin : : <name>this_is_an_invalid_library_name ;

      if $(ICU_PATH)
      {
         icuucd_name = [ GLOB $(ICU_PATH)/bin : icuuc??d.dll ] ;
         if ! $(icuucd_name)
         {
            icuucd_name = [ GLOB $(ICU_PATH)/bin64 : icuuc??d.dll ] ;
         }
         icuuc_name = [ GLOB $(ICU_PATH)/bin : icuuc??.dll ] ;
         if ! $(icuuc_name)
         {
            icuuc_name = [ GLOB $(ICU_PATH)/bin64 : icuuc??.dll ] ;
         }
         icudt_name = [ GLOB $(ICU_PATH)/bin : icudt??.dll ] ;
         if ! $(icudt_name)
         {
            icudt_name = [ GLOB $(ICU_PATH)/bin64 : icudt??.dll ] ;
         }
         icuin_name = [ GLOB $(ICU_PATH)/bin : icuin??.dll ] ;
         if ! $(icuin_name)
         {
            icuin_name = [ GLOB $(ICU_PATH)/bin64 : icuin??.dll ] ;
         }
         icuind_name = [ GLOB $(ICU_PATH)/bin : icuin??d.dll ] ;
         if ! $(icuind_name)
         {
            icuind_name = [ GLOB $(ICU_PATH)/bin64 : icuin??d.dll ] ;
         }

         #ECHO $(icuucd_name:B) $(icuuc_name:B) $(icudt_name:B) $(icuin_name:B) $(icuind_name:B) ;
      }

      ICU_OPTS = 
         <include>$(ICU_PATH)/include 
         <library>icuuc/<link>shared/<runtime-link>shared 
         <library>icudt/<link>shared/<runtime-link>shared 
         <library>icuin/<link>shared/<runtime-link>shared 
         <define>BOOST_HAS_ICU=1 
         <runtime-link>shared
         <toolset>msvc:<linkflags>/delayload:$(icuucd_name:B).dll
         <toolset>msvc:<linkflags>/delayload:$(icuuc_name:B).dll
         <toolset>msvc:<linkflags>/delayload:$(icudt_name:B).dll
         <toolset>msvc:<linkflags>/delayload:$(icuin_name:B).dll
         <toolset>msvc:<linkflags>/delayload:$(icuind_name:B).dll
         <toolset>msvc:<linkflags>delayimp.lib 
         ;
   }

}

exe has_icu : ./has_icu_test.cpp  : $(ICU_OPTS) ;
explicit has_icu ;

alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;

SOURCES = 
   c_regex_traits.cpp
   cpp_regex_traits.cpp
   cregex.cpp
   fileiter.cpp
   icu.cpp
   instances.cpp
   posix_api.cpp
   regex.cpp
   regex_debug.cpp
   regex_raw_buffer.cpp
   regex_traits_defaults.cpp
   static_mutex.cpp
   w32_regex_traits.cpp
   wc_regex_traits.cpp
   wide_posix_api.cpp
   winstances.cpp 
   usinstances.cpp ;


lib boost_regex : ../src/$(SOURCES) icu_options
    :         
	     <link>shared:<define>BOOST_REGEX_DYN_LINK=1
	     #<toolset>gcc-mw:<link>static
	     #<toolset>gcc-mingw:<link>static
	     <toolset>gcc-cygwin:<link>static
    ;

boost-install boost_regex ;