Sync Mk with ports
[dports.git] / Mk / bsd.wx.mk
1 #-*- tab-width: 4; -*-
2 # ex:ts=4
3 #
4 # $FreeBSD: Mk/bsd.wx.mk 327608 2013-09-19 09:58:00Z gahr $
5 #
6 # bsd.wx.mk - Support for wxWidgets based ports.
7 #
8 # Created by: Alejandro Pulver <alepulver@FreeBSD.org>
9 #
10 # Please view me with 4 column tabs!
11 #
12 # The following variables can be defined in a port that uses the wxWidgets
13 # library, contributed libraries, WxPython and/or more wxWidgets related
14 # components (with run and/or build dependencies). It can be used after and/or
15 # before bsd.port.pre.mk, but Python components will only work if Python
16 # variables (e.g. USE_PYTHON) are defined before it (this is a bsd.python.mk
17 # limitation), at least it is manually included.
18 # USE_WX                - Set to the list of wxWidgets versions that can be used by
19 #                                 the port. The syntax allows the following elements:
20 #                                 - Single version (e.g. "2.4").
21 #                                 - Range of versions (e.g. "2.4-2.6"). Must be ascending.
22 #                                 - Partial range: single version and upper (e.g. "2.4+").
23 #                                 - Partial range: single version and lower (e.g. "-2.6").
24 #                                 Multiple elements can be specified separated by spaces.
25 # USE_WX_NOT    - Set to the list of wxWidgets versions that can't be used by
26 #                                 the port. In other words, it removes some versions from
27 #                                 USE_WX. If the latter is not defined, it will have the value
28 #                                 of all the possible versions. The syntax is like USE_WX.
29 # WX_COMPS              - Set to the list of wxWidgets components the port uses.
30 #                                 Several components can be specified separated by spaces. By
31 #                                 default it will have the value of "wx". Suffixes in the form
32 #                                 ":xxx" may be added to the components to determine the
33 #                                 dependency type.
34 #                                 The available components are:
35 #                                 wx                    - The wxWidgets library.
36 #                                 contrib               - The wxWidgets contributed libraries.
37 #                                 python                - The wxWidgets API for Python.
38 #                                 svg                   - WxSVG (only for 2.6).
39 #                                 The available dependency types are:
40 #                                 build                 - Requires component for building.
41 #                                 lib                   - Requires component for building and running.
42 #                                 run                   - Requires component for running.
43 #                                 If no suffix is present then "run" will be used for "python"
44 #                                 and "lib" for others.
45 # WX_CONF_ARGS  - Set to "absolute" or "relative" if the port needs configure
46 #                                 arguments in addition to the WX_CONFIG environment variable.
47 #                                 It determines the type of parameters that have to be passed
48 #                                 to the configure script. In the first case it adds
49 #                                 "--with-wx-config=${WX_CONFIG}" (absolute path of
50 #                                 WX_CONFIG), and in second one "--with-wx=${LOCALBASE}" plus
51 #                                 "--with-wx-config=${WX_CONFIG:T} (prefix and name).
52 # WX_PREMK              - Define to determine version and define WX_CONFIG/WX_VERSION
53 #                                 after <bsd.port.pre.mk> (in case the port needs to manually run
54 #                                 the script).
55 # WX_UNICODE    - Define if the port needs the Unicode version of the
56 #                                 wxWidgets library and/or contributed libraries.
57 #                                 NOTE: this should NOT be used for ports that can be compiled
58 #                                 with Unicode or not, but for the ones that require it.
59 # WANT_UNICODE  - Define if the port prefers Unicode, but doesn't require it.
60 # WANT_WX               - Set to "yes" or a valid single version (no ranges, etc).
61 #                                 In both cases it will detect the installed wxWidgets
62 #                                 components and add them to the variable HAVE_WX. If a
63 #                                 version is selected, HAVE_WX will contain a list of
64 #                                 components in the other case it will contain a list of
65 #                                 "component-version" pairs (e.g. wx-2.6, contrib-2.4, etc).
66 #                                 It has to be used before bsd.port.pre.mk.
67 # WANT_WX_VER   - Set to the prefered wxWidgets version for the port. It must
68 #                                 be present in USE_WX or missing in USE_WX_NOT. This is
69 #                                 overriden by the user variable WITH_WX_VER if set. It can
70 #                                 contain multiple versions in order of preference (last ones
71 #                                 are tried first).
72 #
73 # The following variables are intended for the user and can be defined in
74 # make.conf.
75 # WITH_UNICODE  - Define if you prefer the Unicode version when available.
76 # WITHOUT_UNICODE
77 #                               - Define if you prefer the non Unicode version (this
78 #                                 variable disables WITH_UNICODE and WANT_UNICODE).
79 # WITH_WX_VER   - Define to the list of prefered versions in reverse order.
80 #
81 # The following variables are defined by this file, to be read from the port.
82 # WX_CONFIG             - The path to the wx-config program (with different name).
83 # WXRC_CMD              - The path to the wxrc program (with different name).
84 # WX_VERSION    - The wxWidgets version that is going to be used.
85 # WX_UNICODE    - If this variable is not defined by the port (which means it
86 #                                 requires the Unicode version of wxWidgets), it will be
87 #                                 defined in the case the Unicode version is used (enabled by
88 #                                 WITH_UNICODE or WANT_UNICODE).
89 # HAVE_WX               - The list of wxWidgets components installed, if WANT_WX was
90 #                                 defined. The components will have version suffix if it was
91 #                                 set to "yes".
92 #
93 # Examples:
94 # - A port that needs wxWidgets 2.6 and contributed libraries with Unicode.
95 #       USE_WX=         2.6
96 #       WX_COMPS=       wx contrib
97 #       WX_UNICODE=     yes
98 # - A port that needs WxPython 2.4 for running.
99 #       USE_PYTHON=     yes
100 #       USE_WX=         2.4
101 #       WX_COMPS=       python:run
102 # - A port that needs WxPython 2.4 or 2.6 for building.
103 #       USE_PYTHON=     yes
104 #       USE_WX=         2.4 2.6
105 #       WX_COMPS=       python:build
106 # - A port that needs wxWidgets version 2.4 or higher and contributed
107 #       libraries.
108 #       USE_WX=         2.4+
109 #       WX_COMPS=       wx contrib
110 # - A port that needs wxWidgets of any version other than 2.4.
111 #       USE_WX_NOT=     2.4
112 #
113
114 WX_Include_MAINTAINER=  alepulver@FreeBSD.org
115
116 #
117 # Global definitions.
118 #
119
120 .if !defined(_WX_Definitions_Done)
121 _WX_Definitions_Done=   yes
122
123 #
124 # Common variables:
125 # _WX_COMPS_ALL                 - List of valid components.
126 # _WX_DEP_TYPES_ALL             - List of valid dependency types.
127 # _WX_VERS_ALL                  - List of supported versions.
128 # _WX_VERS_UC_ALL               - List of Unicode capable versions.
129 # _WX_VERS_LISTS                - Reverse lists preference order.
130 #
131
132 _WX_COMPS_ALL=                  wx contrib python svg
133 _WX_DEP_TYPES_ALL=              build lib run
134 _WX_VERS_ALL=                   2.6 2.8 2.9
135 _WX_VERS_UC_ALL=                2.6 2.8 2.9
136 _WX_VERS_SKIP=                  2.9
137 _WX_VERS_LISTS=                 WANT_WX_VER WITH_WX_VER _WX_VER_INSTALLED
138
139 #
140 # Variables used to determine what is needed:
141 # _WX_PORT_comp_ver             - Port directory.
142 # _WX_LIB_comp_ver              - Name of the shared library (optional).
143 # _WX_SHVER_comp_ver    - Shared library version (optional).
144 # _WX_FILE_comp_ver             - File installed by that component.
145 # _WX_DEPTYPE_comp_ver  - Default dependency type (optional).
146 #
147
148 # wxgtk 2.6
149 _WX_PORT_wx_2.6=                x11-toolkits/wxgtk26${_WX_UCL}
150 _WX_LIB_wx_2.6=                 wx_base${_WX_UC}-2.6
151
152 _WX_PORT_common_2.6=    x11-toolkits/wxgtk26-common
153 _WX_FILE_common_2.6=    ${LOCALBASE}/include/wx-2.6/wx/wxprec.h
154
155 _WX_PORT_contrib_2.6=   x11-toolkits/wxgtk26${_WX_UCL}-contrib
156 _WX_LIB_contrib_2.6=    wx_gtk2${_WX_UC}_animate-2.6
157
158 _WX_PORT_python_2.6=    x11-toolkits/py-wxPython26${_WX_UCL}
159 _WX_FILE_python_2.6=    ${PYTHON_SITELIBDIR}/wx-2.6-gtk2${_WX_PYSUFX}/wx/__init__.py
160
161 # wxgtk 2.8
162 _WX_PORT_wx_2.8=                x11-toolkits/wxgtk28${_WX_UCL}
163 _WX_LIB_wx_2.8=                 wx_base${_WX_UC}-2.8
164
165 _WX_PORT_common_2.8=    x11-toolkits/wxgtk28-common
166 _WX_FILE_common_2.8=    ${LOCALBASE}/include/wx-2.8/wx/wxprec.h
167
168 _WX_PORT_contrib_2.8=   x11-toolkits/wxgtk28${_WX_UCL}-contrib
169 _WX_LIB_contrib_2.8=    wx_gtk2${_WX_UC}_fl-2.8
170
171 _WX_PORT_python_2.8=    x11-toolkits/py-wxPython28${_WX_UCL}
172 _WX_FILE_python_2.8=    ${PYTHON_SITELIBDIR}/wx-2.8-gtk2${_WX_PYSUFX}/wx/__init__.py
173
174 _WX_PORT_svg_2.8=               graphics/wxsvg
175 _WX_LIB_svg_2.8=                wxsvg
176
177 # wxgtk 2.9
178 _WX_PORT_wx_2.9=                x11-toolkits/wxgtk29
179 _WX_LIB_wx_2.9=                 wx_baseu-2.9
180
181 # Set _WX_SHVER_comp_ver to 0 and _WX_FILE_comp_ver for libs appropiately.
182 # Set _WX_DEPTYPE_comp_ver for "python" to "run", and others to "lib".
183
184 .       for comp in ${_WX_COMPS_ALL}
185 _WX_COMP=                               ${comp}
186 .               for ver in ${_WX_VERS_ALL}
187 .                       if defined(_WX_LIB_${comp}_${ver})
188 _WX_SHVER_${comp}_${ver}=       0
189 _WX_FILE_${comp}_${ver}=        ${LOCALBASE}/lib/lib${_WX_LIB_${comp}_${ver}}.so.${_WX_SHVER_${comp}_${ver}}
190 .                       endif
191 .                       if ${_WX_COMP} == "python"
192 _WX_DEPTYPE_${comp}_${ver}=     run
193 .                       else
194 _WX_DEPTYPE_${comp}_${ver}=     lib
195 .                       endif
196 .               endfor
197 .       endfor
198 .endif          # !_WX_Defined_Done
199
200 #
201 # Check if the user/port wants Unicode.
202 #
203
204 .if (!defined(WITHOUT_UNICODE) && \
205     (defined(WITH_UNICODE) || defined(WANT_UNICODE)))
206 _WX_UC_AVAILABLE=                       yes
207 .else
208 .       undef _WX_UC_AVAILABLE
209 .endif
210
211 #
212 # Check if we are going to determine the version.
213 #
214
215 .if !defined(_WX_Version_Done) && (defined(_POSTMKINCLUDED) || \
216     (defined(WX_PREMK) && defined(BEFOREPORTMK) && \
217     (defined(USE_WX) || defined(USE_WX_NOT))))
218 _WX_Need_Version=                       yes
219 .endif
220
221 #
222 # Check for present components.
223 #
224
225 # Requested by the user.
226
227 .if defined(WANT_WX) && defined(BEFOREPORTMK)
228 _WANT_WX=                               ${WANT_WX}
229 .endif
230
231 # Used for autodetection of installed versions.
232
233 .if defined(_WX_Need_Version)
234 _WANT_WX=                               yes
235 .endif
236
237 .if defined(_WANT_WX)
238
239 # Check if Unicode will be used.
240
241 .       for __WANT_WX in ${_WANT_WX}
242 .               if defined(_WX_UC_AVAILABLE) && \
243                    (${_WX_VERS_UC_ALL:M${__WANT_WX}} != "" || ${_WANT_WX:tl} == "yes")
244 _WX_WANT_UNICODE=               yes
245 .               endif
246 .       endfor
247
248 # These variables are reprocessed later so they won't affect other parts.
249
250 .       if defined(WX_UNICODE) || defined(_WX_WANT_UNICODE)
251 _WX_VER_FINAL=                  ${_WX_VERS_UC_ALL}
252 _WX_UC=                                 u
253 _WX_UCL=                                -unicode
254 _WX_PYSUFX=                             -unicode
255 .       else
256 _WX_VER_FINAL=                  ${_WX_VERS_ALL}
257 _WX_UC=                                 #
258 _WX_UCL=                                #
259 _WX_PYSUFX=                             -ansi
260 .       endif
261
262 # Fill _HAVE_WX with the installed components.
263
264 .       undef _HAVE_WX
265 .       for __WANT_WX in ${_WANT_WX}
266 # Check if _WANT_WX contains more than one word.
267 .               if defined(_HAVE_WX)
268 IGNORE?=                                selected multiple values for WANT_WX: ${_WANT_WX}
269 .               endif
270 _HAVE_WX=                               #
271 # Check for all versions.
272 .               if ${_WANT_WX:tl} == "yes"
273 .                       for comp in ${_WX_COMPS_ALL}
274 .                               for ver in ${_WX_VER_FINAL}
275 _WX_COMP=                               _WX_FILE_${comp}_${ver}
276 .                                       if defined(${_WX_COMP}) && exists(${${_WX_COMP}})
277 _HAVE_WX+=                              ${comp}-${ver}
278 .                                       endif
279 .                               endfor
280 .                       endfor
281 # Check for a specific version.
282 .               elif ${_WX_VERS_ALL:M${__WANT_WX}}
283 .                       for comp in ${_WX_COMPS_ALL}
284 .                               if exists(${_WX_FILE_${comp}_${__WANT_WX}})
285 _HAVE_WX+=                              ${comp}
286 .                               endif
287 .                       endfor
288 .               else
289 IGNORE?=                                selected an invalid value for WANT_WX: ${__WANT_WX}
290 .               endif
291 .       endfor
292 .endif          # _WANT_WX
293
294 # Requested by the user.
295
296 .if defined(WANT_WX) && defined(BEFOREPORTMK)
297 HAVE_WX:=                               ${_HAVE_WX}
298 .endif
299
300 # Used for autodetection of installed versions.
301
302 .if defined(_WX_Need_Version)
303 _WX_VER_INSTALLED:=             ${_HAVE_WX:Mwx-*:S/wx-//}
304 .endif
305
306 #
307 # Select wxWidgets version.
308 #
309
310 .if defined(_WX_Need_Version)
311 _WX_Version_Done=               yes
312
313 #
314 # Basic component parsing (ignores dependency types).
315 #
316 # The variables used are:
317 # _WX_COMP                              - Component part.
318 # _WX_COMPS_FINAL               - Final list of components.
319 #
320
321 # Detect duplicated components.
322
323 _WX_COMPS_FINAL=                #
324 .for comp in ${WX_COMPS}
325 _WX_COMP=                               ${comp:C/:([[:alpha:]]+)$//}
326 .       for __WX_COMP in ${_WX_COMP}
327 .               if ${_WX_COMPS_ALL:M${__WX_COMP}} == ""
328 IGNORE?=                                selected an invalid wxWidgets component: ${__WX_COMP}
329 .               endif
330 .       endfor
331 .       for newcomp in ${_WX_COMP}
332 .               if ${_WX_COMPS_FINAL:M${newcomp}} == "" && !defined(IGNORE)
333 _WX_COMPS_FINAL+=               ${newcomp}
334 .               endif
335 .       endfor
336 .endfor
337
338 # Set defaults (if one isn't present).
339
340 USE_WX?=                                ${_WX_VERS_ALL}
341 USE_WX_NOT?=                    #
342
343 #
344 # Make lists of valid and invalid versions.
345 #
346 # The following variables are used:
347 # _WX_VER_CHECK                 - If the version is a single one, express in a range.
348 # _WX_VER_MIN                   - Lower version of the range.
349 # _WX_VER_MAX                   - Higher version of the range.
350 # _WX_VER_LIST                  - List of requested versions.
351 # _WX_VER_NOT_LIST              - List of disallowed versions.
352 # _WX_VER_MERGED                - List of requested version without disallowed ones.
353 #
354
355 .for list in VER VER_NOT
356 _WX_${list}_LIST=               #
357 .       for ver in ${USE_WX${list:C/VER//}}
358 _WX_VER_CHECK:=                 ${ver:C/^([[:digit:]]+(\.[[:digit:]]+)*)$/\1-\1/}
359 _WX_VER_MIN:=                   ${_WX_VER_CHECK:C/([[:digit:]]+(\.[[:digit:]]+)*)[-+].*/\1/}
360 _WX_VER_MAX:=                   ${_WX_VER_CHECK:C/.*-([[:digit:]]+(\.[[:digit:]]+)*)/\1/}
361 # Minimum version not specified.
362 .               if ${_WX_VER_MIN} == ${_WX_VER_CHECK}
363 .                       undef _WX_VER_MIN
364 .                       for v in ${_WX_VERS_ALL}
365 .                               if ${_WX_VER_CHECK:C/[-+]//} == ${v} || ${_WX_VERS_SKIP:M${v}} == ""
366 _WX_VER_MIN?=                   ${v}
367 .                               endif
368 .                       endfor
369 .               endif
370 # Maximum version not specified.
371 .               if ${_WX_VER_MAX} == ${_WX_VER_CHECK}
372 .                       for v in ${_WX_VERS_ALL}
373 .                               if ${_WX_VER_CHECK:C/[-+]//} == ${v} || ${_WX_VERS_SKIP:M${v}} == ""
374 _WX_VER_MAX=                    ${v}
375 .                               endif
376 .                       endfor
377 .               endif
378 # Expand versions and add valid ones to each list.
379 .               for v in ${_WX_VERS_ALL}
380 .                       if ${_WX_VER_MIN} <= ${v} && ${_WX_VER_MAX} >= ${v} && \
381                            ${_WX_${list}_LIST:M${v}} == ""
382 _WX_${list}_LIST+=              ${v}
383 .                       endif
384 .               endfor
385 .       endfor
386 .endfor
387
388 # Merge the lists into a single list of valid versions.
389
390 _WX_VER_MERGED=                 #
391 .for ver in ${_WX_VER_LIST}
392 .       if ${_WX_VER_NOT_LIST:M${ver}} == ""
393 _WX_VER_MERGED+=                ${ver}
394 .       endif
395 .endfor
396
397 # Check for a null version.
398
399 .if empty(_WX_VER_MERGED)
400 IGNORE?=                                selected a null or invalid wxWidgets version
401 .endif
402
403 # Avoid versions which have unavailable components.
404
405 .for ver in ${_WX_VER_MERGED}
406 .       for comp in ${_WX_COMPS_FINAL}
407 .               if !defined(_WX_PORT_${comp}_${ver})
408 _WX_WRONG_COMPS+=               ${comp}
409 _WX_WRONG_VERS+=                ${ver}
410 _WX_VER_MERGED:=                ${_WX_VER_MERGED:N${ver}}
411 .               endif
412 .       endfor
413 .endfor
414
415 .if empty(_WX_VER_MERGED)
416 IGNORE?=                                selected wxWidgets versions (${_WX_WRONG_VERS}) which do not have the selected components (${_WX_WRONG_COMPS})
417 .endif
418
419 #
420 # Unicode support.
421 #
422
423 # Create a list of capable versions.
424
425 _WX_VER_UC=                             #
426 .for ver in ${_WX_VER_MERGED}
427 .       if ${_WX_VERS_UC_ALL:M${ver}} != ""
428 _WX_VER_UC+=                    ${ver}
429 .       endif
430 .endfor
431
432 # Requested by the user or port (optional).
433
434 .if defined(_WX_UC_AVAILABLE)
435 .       for ver in ${_WX_VER_UC}
436 .               if ${_WX_VERS_UC_ALL:M${ver}} != ""
437 WX_UNICODE=                             yes
438 .               endif
439 .       endfor
440 .endif
441
442 # Requested by the port (mandatory).
443
444 .if defined(WX_UNICODE)
445 .       if empty(_WX_VER_UC)
446 IGNORE?=                                selected a wxWidgets version which does not support Unicode: ${_WX_VER_MERGED}
447 .       endif
448 .endif
449
450 # Set Unicode variables.
451
452 .if defined(WX_UNICODE)
453 _WX_VER_FINAL=                  ${_WX_VER_UC}
454 _WX_UC=                                 u
455 _WX_UCL=                                -unicode
456 _WX_PYSUFX=                             -unicode
457 .else
458 _WX_VER_FINAL=                  ${_WX_VER_MERGED}
459 _WX_UC=                                 #
460 _WX_UCL=                                #
461 _WX_PYSUFX=                             -ansi
462 .endif
463
464 # Remove unusable installed versions.
465
466 .for ver in ${_WX_VER_INSTALLED}
467 .       if ${_WX_VER_FINAL:M${ver}} == ""
468 _WX_VER_INSTALLED:=             ${_WX_VER_INSTALLED:N${ver}}
469 .       endif
470 .endfor
471
472 #
473 # Choose final version.
474 #
475
476 #
477 # Check for the following (in order):
478 # 1) WITH_WX_VER                - User preference.
479 # 2) WANT_WX_VER                - Port preference.
480 # 3) _WX_VER_INSTALLED  - Installed versions.
481 # 4) _WX_VER_FINAL              - Available versions.
482 #
483
484 .for list in _WX_VER_FINAL ${_WX_VERS_LISTS}
485 .       if defined(${list})
486 .               for ver in ${${list}}
487 .                       if ${_WX_VER_FINAL:M${ver}} != ""
488 _WX_VER=                                ${ver}
489 .                       endif
490 .               endfor
491 .       endif
492 .endfor
493
494 #
495 # Set variables.
496 #
497
498 WX_CONFIG?=                             ${LOCALBASE}/bin/wxgtk2${_WX_UC}-${_WX_VER}-config
499 WXRC_CMD?=                              ${LOCALBASE}/bin/wxrc-gtk2${_WX_UC}-${_WX_VER}
500 WX_VERSION?=                    ${_WX_VER}
501
502 .endif          # _WX_Need_Version
503
504 #
505 # Process components list and add dependencies, variables, etc.
506 #
507
508 .if defined(_POSTMKINCLUDED)
509
510 #
511 # Component parsing.
512 #
513 # The variables used are:
514 # _WX_COMP                              - Component part.
515 # _WX_DEP_TYPE                  - Dependency type part.
516 # _WX_COMP_NEW                  - Component + dependency type.
517 # _WX_COMPS_FINAL               - Final list of components with dependency types.
518 #
519
520 # Default components.
521
522 WX_COMPS?=                              wx
523
524 # Detect invalid and duplicated components.
525
526 _WX_COMPS_FINAL=                #
527 .for comp in ${WX_COMPS}
528 _WX_COMP=                               ${comp:C/:([[:alpha:]]+)$//}
529 .       if ${_WX_COMP} == ${comp}
530 _WX_DEP_TYPE=                   ${_WX_DEPTYPE_${comp}_${_WX_VER}}
531 .       else
532 _WX_DEP_TYPE=                   ${comp:C/.+:([[:alpha:]]+)$/\1/}
533 .       endif
534 _WX_COMP_NEW=                   ${_WX_COMP}_${_WX_DEP_TYPE}
535 .       for __WX_COMP in ${_WX_COMP}
536 .               if ${_WX_COMPS_ALL:M${__WX_COMP}} == ""
537 IGNORE?=                                selected an invalid wxWidgets component: ${__WX_COMP}
538 .               endif
539 .       endfor
540 .       for __WX_DEP_TYPE in ${_WX_DEP_TYPE}
541 .               if ${_WX_DEP_TYPES_ALL:M${__WX_DEP_TYPE}} == ""
542 IGNORE?=                                selected an invalid wxWidgets dependency type: ${__WX_DEP_TYPE}
543 .               endif
544 .       endfor
545 .       if !defined(_WX_PORT_${_WX_COMP}_${_WX_VER})
546 IGNORE?=                                selected a wxWidgets component (${_WX_COMP}) which is not available for the selected version (${_WX_VER})
547 .       endif
548 .       for newcomp in ${_WX_COMP_NEW}
549 .               if ${_WX_COMPS_FINAL:M${newcomp}} == "" && !defined(IGNORE)
550 _WX_COMPS_FINAL+=               ${newcomp}
551 .               endif
552 .       endfor
553 .endfor
554
555 # Add dependencies.
556 #
557 # The variable used are:
558 # _WX_COMP              -               - Component part.
559 # _WX_DEP_TYPE                  - Dependency type part.
560
561 .for comp in ${_WX_COMPS_FINAL}
562 _WX_COMP=                               ${comp:C/_([[:alpha:]]+)$//}
563 _WX_DEP_TYPE=                   ${comp:C/.+_([[:alpha:]]+)$/\1/}
564 # XXX Need a .for loop here so the variable is expanded before the assignment.
565 .       for comp_part in ${_WX_COMP}
566 .               if ${_WX_DEP_TYPE} == "lib"
567 .                       if defined(_WX_LIB_${_WX_COMP}_${_WX_VER})
568 LIB_DEPENDS+=                   ${_WX_LIB_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
569 BUILD_DEPENDS+=                 ${_WX_FILE_common_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_common_${_WX_VER}}
570 .                       else
571 BUILD_DEPENDS+=                 ${_WX_FILE_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
572 RUN_DEPENDS+=                   ${_WX_FILE_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
573 .                       endif
574 .               else
575 ${_WX_DEP_TYPE:tu}_DEPENDS+=    ${_WX_FILE_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
576 .               endif
577 .       endfor
578 .endfor
579
580 #
581 # Set build related variables.
582 #
583
584 MAKE_ENV+=                              WX_CONFIG=${WX_CONFIG}
585 CONFIGURE_ENV+=                 WX_CONFIG=${WX_CONFIG}
586
587 .if defined(WX_CONF_ARGS)
588 .       if ${WX_CONF_ARGS:tl} == "absolute"
589 CONFIGURE_ARGS+=                --with-wx-config=${WX_CONFIG}
590 .       elif ${WX_CONF_ARGS:tl} == "relative"
591 CONFIGURE_ARGS+=                --with-wx=${LOCALBASE} \
592                                                 --with-wx-config=${WX_CONFIG:T}
593 .       else
594 IGNORE?=                                selected an invalid wxWidgets configure argument type: ${WX_CONF_ARGS}
595 .       endif
596 .endif
597
598 .endif          # _POSTMKINCLUDED