1 | # (C) Copyright Gennadiy Rozental 2002. Permission to copy, use, |
---|
2 | # modify, sell and distribute this software is granted provided this |
---|
3 | # copyright notice appears in all copies. This software is provided |
---|
4 | # "as is" without express or implied warranty, and with no claim as |
---|
5 | # to its suitability for any purpose. |
---|
6 | |
---|
7 | # Use this toolset to add STLport flavor for any base toolset |
---|
8 | # define STLPORT_LIB_BASE_NAME to the shared between debug and release |
---|
9 | # versions prefix for stlport library name for example stlport_sunpro |
---|
10 | # Define STLPORT_AUTOLINK to use the autolink facilities of the new |
---|
11 | # STLport-5.0 |
---|
12 | |
---|
13 | # STLport iostreams or native iostreams |
---|
14 | feature stlport-iostream : on off ; |
---|
15 | |
---|
16 | # STLport extensions |
---|
17 | feature stlport-extensions : on off ; |
---|
18 | |
---|
19 | # STLport anachronisms |
---|
20 | feature stlport-anachronisms : on off ; |
---|
21 | |
---|
22 | # STLport debug allocation |
---|
23 | feature stlport-debug-alloc : off on ; |
---|
24 | |
---|
25 | # ? |
---|
26 | feature stlport-cstd-namespace : std global ; |
---|
27 | |
---|
28 | # STLport-5 libraries are located in cross-compilation individual subdirectories. |
---|
29 | feature stlport-cross : off on ; |
---|
30 | |
---|
31 | CURR_TOOLSET = $(gCURRENT_TOOLSET) ; |
---|
32 | |
---|
33 | # STLport versions |
---|
34 | STLPORT_VERSIONS(default) ?= 4.6.2 ; |
---|
35 | STLPORT_VERSIONS(4) ?= 4.6.2 4.6 4.5.3 4.5 ; |
---|
36 | STLPORT_VERSIONS(5) ?= 5.0 ; |
---|
37 | STLPORT_VERSION ?= $(STLPORT_VERSION(default)) ; |
---|
38 | STLPORT_VERSIONS ?= $(STLPORT_VERSIONS(4)) $(STLPORT_VERSIONS(5)) ; |
---|
39 | feature stlport-version : [ unique $(STLPORT_VERSION) $(STLPORT_VERSIONS) ] ; |
---|
40 | flags $(CURR_TOOLSET) STLPORT_VERSION_RELEVANT_FEATURE <stlport-version> ; |
---|
41 | |
---|
42 | # singleton variables... |
---|
43 | set-as-singleton STLPORT_INCLUDE_DIRECTORY STLPORT_LIB_DIRECTORY STLPORT_PATH STLPORT_ROOT ; |
---|
44 | |
---|
45 | ############################################################################# |
---|
46 | |
---|
47 | # Returns a path which is assumed to be the root of the STLport installation. |
---|
48 | # |
---|
49 | # The result depends on the current version X.Y of STLport. |
---|
50 | # 1. If global STLPORT_<X.Y>_PATH is set, return it. |
---|
51 | # 2. If global STLPORT_PATH is set, return $(STLPORT_PATH)/STLport-<X.Y> |
---|
52 | # |
---|
53 | rule get-stlport-root |
---|
54 | { |
---|
55 | local version = [ get-values <stlport-version> : $(gBUILD_PROPERTIES) ] ; |
---|
56 | version ?= $(STLPORT_VERSION) ; |
---|
57 | |
---|
58 | local path ; |
---|
59 | path ?= $(STLPORT_$(version)_PATH) ; |
---|
60 | path ?= $(STLPORT_PATH)$(SLASH)STLport-$(version) ; |
---|
61 | path ?= $(STLPORT_ROOT) ; #<< For backward compatability. |
---|
62 | |
---|
63 | if $(version) && ! $(path) |
---|
64 | { |
---|
65 | local dollar = "$" ; |
---|
66 | ECHO **** No STLPORT_PATH configured. *** ; |
---|
67 | ECHO To configure STLport for use with the $(CURR_TOOLSET) toolset, the following variables can be set: ; |
---|
68 | ECHO ; |
---|
69 | ECHO STLPORT_PATH - A directory containing at least one subdirectory of the form /STLport-<version> ; |
---|
70 | ECHO " where STLport installations can be found." ; |
---|
71 | ECHO ; |
---|
72 | ECHO STLPORT_<version>_PATH - The directory where the specific STLport <version> installation can be ; |
---|
73 | ECHO " found, in case there is no central location appropriate for STLPORT_PATH, above, or a" ; |
---|
74 | ECHO " particular version's installation is not located in the usual place." ; |
---|
75 | ECHO ; |
---|
76 | ECHO STLPORT_VERSION - The version of STLport in use by default. Defaults to \"$(STLPORT_VERSIONS(default))\". Other ; |
---|
77 | ECHO " values can be selected in parallel setting the build property <stlport-version> to" ; |
---|
78 | ECHO " values from the list of $(dollar)(STLPORT_VERSIONS)" ; |
---|
79 | ECHO ; |
---|
80 | ECHO STLPORT_VERSIONS - Alternate versions of STLport available on this machine. Defaults to $(STLPORT_VERSIONS:J=" ") . ; |
---|
81 | ECHO ; |
---|
82 | ECHO "Note that STLport iostreams are /not/ in use by default. To enable them, you must place" ; |
---|
83 | ECHO " <stlport-iostream>on in your BUILD variable or in target requirements." ; |
---|
84 | EXIT ; |
---|
85 | } |
---|
86 | |
---|
87 | return $(path) ; |
---|
88 | } |
---|
89 | |
---|
90 | ############################################################################# |
---|
91 | |
---|
92 | STLPORT_INCLUDE_DIRECTORY ?= stlport ; |
---|
93 | STLPORT_LIB_DIRECTORY ?= lib ; |
---|
94 | STLPORT_BIN_DIRECTORY ?= bin ; |
---|
95 | STLPORT_LIB_DEBUG_SUFFIX ?= _stldebug ; |
---|
96 | |
---|
97 | # Clear out the STD paths so that the real toolset doesn't include |
---|
98 | # anything but the STLport as the STD. But also set the STDLIBPATH to |
---|
99 | # include the compiler libs afterwards as STLport still relies on the |
---|
100 | # rest of the runtime. |
---|
101 | local .stdlibpath = $(STDLIBPATH) ; |
---|
102 | STDHDRS = ; |
---|
103 | STDLIBPATH = ; |
---|
104 | |
---|
105 | ### Common options. |
---|
106 | |
---|
107 | flags $(CURR_TOOLSET) STDHDRS : [ join [ get-stlport-root ] $(SLASH)$(STLPORT_INCLUDE_DIRECTORY) ] ; |
---|
108 | flags $(CURR_TOOLSET) DEFINES <stlport-extensions>off : _STLP_NO_EXTENSIONS=1 ; |
---|
109 | flags $(CURR_TOOLSET) DEFINES <stlport-anachronisms>off : _STLP_NO_ANACHRONISMS=1 ; |
---|
110 | flags $(CURR_TOOLSET) DEFINES <stlport-cstd-namespace>global : _STLP_VENDOR_GLOBAL_CSTD=1 ; |
---|
111 | flags $(CURR_TOOLSET) DEFINES <exception-handling>off : _STLP_NO_EXCEPTIONS=1 ; |
---|
112 | flags $(CURR_TOOLSET) DEFINES <stlport-debug-alloc>on : _STLP_DEBUG_ALLOC=1 ; |
---|
113 | flags $(CURR_TOOLSET) DEFINES <runtime-build>debug : _STLP_DEBUG=1 _STLP_DEBUG_UNINITIALIZED=1 ; |
---|
114 | flags $(CURR_TOOLSET) DEFINES <runtime-link>dynamic : _STLP_USE_DYNAMIC_LIB=1 ; |
---|
115 | |
---|
116 | ### STLport 4.x |
---|
117 | |
---|
118 | flags $(CURR_TOOLSET) DEFINES |
---|
119 | <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>off : |
---|
120 | _STLP_NO_OWN_IOSTREAMS=1 _STLP_HAS_NO_NEW_IOSTREAMS=1 ; |
---|
121 | flags $(CURR_TOOLSET) STDLIBPATH |
---|
122 | <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on : |
---|
123 | [ join [ get-stlport-root ] $(SLASH)$(STLPORT_LIB_DIRECTORY) ] |
---|
124 | $(.stdlibpath) ; |
---|
125 | flags $(CURR_TOOLSET) FINDLIBS |
---|
126 | <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>debug/<runtime-link>static : |
---|
127 | $(STLPORT_LIB_BASE_NAME)$(STLPORT_LIB_DEBUG_SUFFIX)$(STLPORT_LIB_STATIC_SUFFIX) ; |
---|
128 | flags $(CURR_TOOLSET) FINDLIBS |
---|
129 | <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>debug/<runtime-link>dynamic : |
---|
130 | $(STLPORT_LIB_BASE_NAME)$(STLPORT_LIB_DEBUG_SUFFIX) ; |
---|
131 | flags $(CURR_TOOLSET) FINDLIBS |
---|
132 | <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>release/<runtime-link>static : |
---|
133 | $(STLPORT_LIB_BASE_NAME)$(STLPORT_LIB_STATIC_SUFFIX) ; |
---|
134 | flags $(CURR_TOOLSET) FINDLIBS |
---|
135 | <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>release/<runtime-link>dynamic : |
---|
136 | $(STLPORT_LIB_BASE_NAME) ; |
---|
137 | |
---|
138 | ### STLport 5.x |
---|
139 | |
---|
140 | switch $(CURR_TOOLSET) |
---|
141 | { |
---|
142 | case msvc* : STLPORT_AUTOLINK = TRUE ; |
---|
143 | case vc* : STLPORT_AUTOLINK = TRUE ; |
---|
144 | } |
---|
145 | |
---|
146 | switch $(CURR_TOOLSET) |
---|
147 | { |
---|
148 | case intel-win32* : STLPORT_CROSS_DIR ?= icl ; |
---|
149 | case iw* : STLPORT_CROSS_DIR ?= icl ; |
---|
150 | case msvc* : STLPORT_CROSS_DIR ?= vc6 ; |
---|
151 | case vc-6* : STLPORT_CROSS_DIR ?= vc6 ; |
---|
152 | case vc-7-* : STLPORT_CROSS_DIR ?= vc70 ; |
---|
153 | case vc-7_0* : STLPORT_CROSS_DIR ?= vc70 ; |
---|
154 | case vc-7_1* : STLPORT_CROSS_DIR ?= vc71 ; |
---|
155 | case vc-8* : STLPORT_CROSS_DIR ?= vc8 ; |
---|
156 | } |
---|
157 | |
---|
158 | switch $(CURR_TOOLSET) |
---|
159 | { |
---|
160 | # GCC compilers have 'g' to indicate debug. |
---|
161 | case gcc* : STLPORT_DEBUG_SUFFIX ?= g ; |
---|
162 | case mingw* : STLPORT_DEBUG_SUFFIX ?= g ; |
---|
163 | case darwin* : STLPORT_DEBUG_SUFFIX ?= g ; |
---|
164 | # The others use 'd'. |
---|
165 | case * : STLPORT_DEBUG_SUFFIX ?= d ; |
---|
166 | } |
---|
167 | |
---|
168 | # STLport-5 doesn't directly support single-threaded builds. There is an open |
---|
169 | # question if single-threaded application code can be combined with the |
---|
170 | # multi-threaded STLport-5. Until that's answered this is commented out and |
---|
171 | # boost-base.jam requires all builds to be multi-threaded. |
---|
172 | #~ flags $(CURR_TOOLSET) DEFINES |
---|
173 | #~ <stlport-version>$(STLPORT_VERSIONS(5)) : |
---|
174 | #~ _STLP_THREADS=1 ; |
---|
175 | |
---|
176 | flags $(CURR_TOOLSET) STDLIBPATH |
---|
177 | <stlport-version>$(STLPORT_VERSIONS(5))/<stlport-cross>off : |
---|
178 | [ join [ get-stlport-root ] $(SLASH)$(STLPORT_LIB_DIRECTORY) ] |
---|
179 | [ join [ get-stlport-root ] $(SLASH)$(STLPORT_BIN_DIRECTORY) ] |
---|
180 | $(.stdlibpath) ; |
---|
181 | flags $(CURR_TOOLSET) STDLIBPATH |
---|
182 | <stlport-version>$(STLPORT_VERSIONS(5))/<stlport-cross>on : |
---|
183 | [ join [ get-stlport-root ] $(SLASH)$(STLPORT_LIB_DIRECTORY) $(SLASH)$(STLPORT_CROSS_DIR) ] |
---|
184 | [ join [ get-stlport-root ] $(SLASH)$(STLPORT_BIN_DIRECTORY) $(SLASH)$(STLPORT_CROSS_DIR) ] |
---|
185 | $(.stdlibpath) ; |
---|
186 | |
---|
187 | if ! $(STLPORT_AUTOLINK) |
---|
188 | { |
---|
189 | STLPORT_LIB_STATIC_SUFFIX ?= "" ; |
---|
190 | for local v in $(STLPORT_VERSIONS(5)) |
---|
191 | { |
---|
192 | flags $(CURR_TOOLSET) FINDLIBS |
---|
193 | <stlport-version>$(v)/<runtime-build>debug/<runtime-link>static : |
---|
194 | stlportstl$(STLPORT_DEBUG_SUFFIX)$(STLPORT_LIB_STATIC_SUFFIX).$(v) ; |
---|
195 | flags $(CURR_TOOLSET) FINDLIBS |
---|
196 | <stlport-version>$(v)/<runtime-build>debug/<runtime-link>dynamic : |
---|
197 | stlportstl$(STLPORT_DEBUG_SUFFIX).$(v) ; |
---|
198 | flags $(CURR_TOOLSET) FINDLIBS |
---|
199 | <stlport-version>$(v)/<runtime-build>release/<runtime-link>static : |
---|
200 | stlport$(STLPORT_LIB_STATIC_SUFFIX).$(v) ; |
---|
201 | flags $(CURR_TOOLSET) FINDLIBS |
---|
202 | <stlport-version>$(v)/<runtime-build>release/<runtime-link>dynamic : |
---|
203 | stlport.$(v) ; |
---|
204 | } |
---|
205 | } |
---|