]> git.saurik.com Git - wxWidgets.git/blame - wxwin.m4
Test to avoid crashes in some circumstances
[wxWidgets.git] / wxwin.m4
CommitLineData
33e61c47
VZ
1dnl ---------------------------------------------------------------------------
2dnl Author: wxWidgets development team,
3dnl Francesco Montorsi,
4dnl Bob McCown (Mac-testing)
5dnl Creation date: 24/11/2001
6dnl RCS-ID: $Id$
7dnl ---------------------------------------------------------------------------
8
9dnl ===========================================================================
10dnl Table of Contents of this macro file:
11dnl -------------------------------------
12dnl
13dnl SECTION A: wxWidgets main macros
14dnl - WX_CONFIG_OPTIONS
15dnl - WX_CONFIG_CHECK
16dnl - WXRC_CHECK
17dnl - WX_STANDARD_OPTIONS
18dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
19dnl - WX_DETECT_STANDARD_OPTION_VALUES
20dnl
21dnl SECTION B: wxWidgets-related utilities
22dnl - WX_LIKE_LIBNAME
23dnl - WX_ARG_ENABLE_YESNOAUTO
24dnl - WX_ARG_WITH_YESNOAUTO
25dnl
26dnl SECTION C: messages to the user
27dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG
28dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
29dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END
30dnl - WX_BOOLOPT_SUMMARY
31dnl
32dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra
33dnl debug output on stdout from these macros.
34dnl ===========================================================================
35
36
debc175a 37dnl ---------------------------------------------------------------------------
128c8706 38dnl Macros for wxWidgets detection. Typically used in configure.in as:
debc175a 39dnl
5ff72dc4
VZ
40dnl AC_ARG_ENABLE(...)
41dnl AC_ARG_WITH(...)
42dnl ...
33e61c47 43dnl WX_CONFIG_OPTIONS
5ff72dc4
VZ
44dnl ...
45dnl ...
33e61c47 46dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1])
debc175a
VS
47dnl if test "$wxWin" != 1; then
48dnl AC_MSG_ERROR([
128c8706 49dnl wxWidgets must be installed on your system
5ff72dc4
VZ
50dnl but wx-config script couldn't be found.
51dnl
52dnl Please check that wx-config is in path, the directory
128c8706 53dnl where wxWidgets libraries are installed (returned by
5ff72dc4 54dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
128c8706 55dnl equivalent variable and wxWidgets version is 2.3.4 or above.
debc175a
VS
56dnl ])
57dnl fi
58dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
59dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
60dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
5ff72dc4 61dnl
80f3a6b0 62dnl LIBS="$LIBS $WX_LIBS"
33e61c47
VZ
63dnl
64dnl If you want to support standard --enable-debug/unicode/shared options, you
65dnl may do the following:
66dnl
67dnl ...
68dnl AC_CANONICAL_SYSTEM
69dnl
70dnl # define configure options
71dnl WX_CONFIG_OPTIONS
72dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
73dnl
74dnl # basic configure checks
75dnl ...
76dnl
77dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
78dnl WX_DEBUG=$DEBUG
79dnl WX_UNICODE=$UNICODE
80dnl
81dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
82dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS])
83dnl WX_DETECT_STANDARD_OPTION_VALUES
84dnl
85dnl # write the output files
86dnl AC_CONFIG_FILES([Makefile ...])
87dnl AC_OUTPUT
88dnl
89dnl # optional: just to show a message to the user
90dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
91dnl
debc175a
VS
92dnl ---------------------------------------------------------------------------
93
33e61c47 94
debc175a 95dnl ---------------------------------------------------------------------------
33e61c47 96dnl WX_CONFIG_OPTIONS
debc175a 97dnl
5ff72dc4
VZ
98dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
99dnl --wx-config command line options
debc175a
VS
100dnl ---------------------------------------------------------------------------
101
33e61c47 102AC_DEFUN([WX_CONFIG_OPTIONS],
debc175a 103[
5ff72dc4 104 AC_ARG_WITH(wxdir,
128c8706 105 [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH],
5ff72dc4
VZ
106 [ wx_config_name="$withval/wx-config"
107 wx_config_args="--inplace"])
108 AC_ARG_WITH(wx-config,
109 [ --with-wx-config=CONFIG wx-config script to use (optional)],
110 wx_config_name="$withval" )
111 AC_ARG_WITH(wx-prefix,
128c8706 112 [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
5ff72dc4
VZ
113 wx_config_prefix="$withval", wx_config_prefix="")
114 AC_ARG_WITH(wx-exec-prefix,
115 [ --with-wx-exec-prefix=PREFIX
128c8706 116 Exec prefix where wxWidgets is installed (optional)],
5ff72dc4 117 wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
debc175a
VS
118])
119
ed33d524
VS
120dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
121dnl wx_ver_ok=yes if it is:
122AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
123[
124 wx_ver_ok=""
731eee9a 125 if test "x$WX_VERSION" != x ; then
ed33d524
VS
126 if test $wx_config_major_version -gt $1; then
127 wx_ver_ok=yes
128 else
129 if test $wx_config_major_version -eq $1; then
130 if test $wx_config_minor_version -gt $2; then
131 wx_ver_ok=yes
132 else
133 if test $wx_config_minor_version -eq $2; then
134 if test $wx_config_micro_version -ge $3; then
135 wx_ver_ok=yes
136 fi
137 fi
138 fi
139 fi
140 fi
141 fi
142])
143
debc175a 144dnl ---------------------------------------------------------------------------
33e61c47 145dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
8708fa76 146dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
debc175a 147dnl
128c8706
VS
148dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
149dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
debc175a
VS
150dnl environment variable to override the default name of the wx-config script
151dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
152dnl case the macro won't even waste time on tests for its existence.
c5be79d9 153dnl
8708fa76 154dnl Optional WX-LIBS argument contains comma- or space-separated list of
128c8706 155dnl wxWidgets libraries to link against (it may include contrib libraries). If
8708fa76 156dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
128c8706 157dnl link with all of the core wxWidgets libraries.
8708fa76
VS
158dnl
159dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
160dnl invocation command in present. It can be used to fine-tune lookup of
161dnl best wxWidgets build available.
c5be79d9
VS
162dnl
163dnl Example use:
33e61c47 164dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
8708fa76 165dnl [--unicode --debug])
debc175a
VS
166dnl ---------------------------------------------------------------------------
167
168dnl
169dnl Get the cflags and libraries from the wx-config script
170dnl
33e61c47 171AC_DEFUN([WX_CONFIG_CHECK],
debc175a
VS
172[
173 dnl do we have wx-config name: it can be wx-config or wxd-config or ...
174 if test x${WX_CONFIG_NAME+set} != xset ; then
175 WX_CONFIG_NAME=wx-config
176 fi
5ff72dc4 177
debc175a
VS
178 if test "x$wx_config_name" != x ; then
179 WX_CONFIG_NAME="$wx_config_name"
180 fi
181
182 dnl deal with optional prefixes
183 if test x$wx_config_exec_prefix != x ; then
184 wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
8e1aefe0 185 WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
debc175a
VS
186 fi
187 if test x$wx_config_prefix != x ; then
188 wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
8e1aefe0 189 WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
debc175a 190 fi
48112931
VS
191 if test "$cross_compiling" = "yes"; then
192 wx_config_args="$wx_config_args --host=$host_alias"
193 fi
debc175a 194
8e1aefe0
VS
195 dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
196 if test -x "$WX_CONFIG_NAME" ; then
197 AC_MSG_CHECKING(for wx-config)
198 WX_CONFIG_PATH="$WX_CONFIG_NAME"
199 AC_MSG_RESULT($WX_CONFIG_PATH)
200 else
201 AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
debc175a
VS
202 fi
203
204 if test "$WX_CONFIG_PATH" != "no" ; then
731eee9a 205 WX_VERSION=""
debc175a
VS
206
207 min_wx_version=ifelse([$1], ,2.2.1,$1)
8708fa76 208 if test -z "$5" ; then
128c8706 209 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
8708fa76 210 else
128c8706 211 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
8708fa76 212 fi
debc175a 213
a8571f4e
VZ
214 dnl don't add the libraries ($4) to this variable as this would result in
215 dnl an error when it's used with --version below
216 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5"
debc175a 217
731eee9a
VZ
218 WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
219 wx_config_major_version=`echo $WX_VERSION | \
debc175a 220 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
731eee9a 221 wx_config_minor_version=`echo $WX_VERSION | \
debc175a 222 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
731eee9a 223 wx_config_micro_version=`echo $WX_VERSION | \
debc175a
VS
224 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
225
226 wx_requested_major_version=`echo $min_wx_version | \
227 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
228 wx_requested_minor_version=`echo $min_wx_version | \
229 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
230 wx_requested_micro_version=`echo $min_wx_version | \
231 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
232
ed33d524
VS
233 _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
234 [$wx_requested_minor_version],
235 [$wx_requested_micro_version])
debc175a 236
3f45f8bf 237 if test -n "$wx_ver_ok"; then
731eee9a 238 AC_MSG_RESULT(yes (version $WX_VERSION))
a8571f4e 239 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4`
3f45f8bf
RL
240
241 dnl is this even still appropriate? --static is a real option now
242 dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
243 dnl what the user actually wants, making this redundant at best.
244 dnl For now keep it in case anyone actually used it in the past.
128c8706 245 AC_MSG_CHECKING([for wxWidgets static library])
a8571f4e 246 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null`
a1d47842
VZ
247 if test "x$WX_LIBS_STATIC" = "x"; then
248 AC_MSG_RESULT(no)
249 else
3f45f8bf
RL
250 AC_MSG_RESULT(yes)
251 fi
debc175a
VS
252
253 dnl starting with version 2.2.6 wx-config has --cppflags argument
254 wx_has_cppflags=""
255 if test $wx_config_major_version -gt 2; then
256 wx_has_cppflags=yes
257 else
258 if test $wx_config_major_version -eq 2; then
259 if test $wx_config_minor_version -gt 2; then
260 wx_has_cppflags=yes
261 else
262 if test $wx_config_minor_version -eq 2; then
263 if test $wx_config_micro_version -ge 6; then
264 wx_has_cppflags=yes
265 fi
266 fi
267 fi
268 fi
269 fi
270
692ebda6
JS
271 dnl starting with version 2.7.0 wx-config has --rescomp option
272 wx_has_rescomp=""
273 if test $wx_config_major_version -gt 2; then
274 wx_has_rescomp=yes
275 else
276 if test $wx_config_major_version -eq 2; then
277 if test $wx_config_minor_version -ge 7; then
278 wx_has_rescomp=yes
279 fi
280 fi
281 fi
282 if test "x$wx_has_rescomp" = x ; then
283 dnl cannot give any useful info for resource compiler
284 WX_RESCOMP=
285 else
286 WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
287 fi
288
debc175a
VS
289 if test "x$wx_has_cppflags" = x ; then
290 dnl no choice but to define all flags like CFLAGS
a8571f4e 291 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
debc175a
VS
292 WX_CPPFLAGS=$WX_CFLAGS
293 WX_CXXFLAGS=$WX_CFLAGS
294
295 WX_CFLAGS_ONLY=$WX_CFLAGS
296 WX_CXXFLAGS_ONLY=$WX_CFLAGS
297 else
298 dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
a8571f4e
VZ
299 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4`
300 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4`
301 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
debc175a
VS
302
303 WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
304 WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
305 fi
debc175a 306
3f45f8bf
RL
307 ifelse([$2], , :, [$2])
308
debc175a 309 else
3f45f8bf 310
731eee9a 311 if test "x$WX_VERSION" = x; then
5ff72dc4
VZ
312 dnl no wx-config at all
313 AC_MSG_RESULT(no)
debc175a 314 else
731eee9a 315 AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
debc175a
VS
316 fi
317
318 WX_CFLAGS=""
319 WX_CPPFLAGS=""
320 WX_CXXFLAGS=""
321 WX_LIBS=""
322 WX_LIBS_STATIC=""
692ebda6 323 WX_RESCOMP=""
33e61c47
VZ
324
325 if test ! -z "$5"; then
326
327 wx_error_message="
328 The configuration you asked for $PACKAGE_NAME requires a wxWidgets
329 build with the following settings:
330 $5
331 but such build is not available.
332
333 To see the wxWidgets builds available on this system, please use
334 'wx-config --list' command. To use the default build, returned by
335 'wx-config --selected-config', use the options with their 'auto'
336 default values."
337
338 fi
339
340 wx_error_message="
341 The requested wxWidgets build couldn't be found.
342 $wx_error_message
343
344 If you still get this error, then check that 'wx-config' is
345 in path, the directory where wxWidgets libraries are installed
346 (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
347 or equivalent variable and wxWidgets version is $1 or above."
348
349 ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3])
3f45f8bf 350
debc175a 351 fi
80f3a6b0
JS
352 else
353
354 WX_CFLAGS=""
355 WX_CPPFLAGS=""
356 WX_CXXFLAGS=""
357 WX_LIBS=""
358 WX_LIBS_STATIC=""
692ebda6
JS
359 WX_RESCOMP=""
360
80f3a6b0
JS
361 ifelse([$3], , :, [$3])
362
debc175a
VS
363 fi
364
365 AC_SUBST(WX_CPPFLAGS)
366 AC_SUBST(WX_CFLAGS)
367 AC_SUBST(WX_CXXFLAGS)
368 AC_SUBST(WX_CFLAGS_ONLY)
369 AC_SUBST(WX_CXXFLAGS_ONLY)
370 AC_SUBST(WX_LIBS)
371 AC_SUBST(WX_LIBS_STATIC)
731eee9a 372 AC_SUBST(WX_VERSION)
692ebda6 373 AC_SUBST(WX_RESCOMP)
33e61c47
VZ
374
375 dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols
376 dnl to support wxpresets bakefiles
377 WX_VERSION_MAJOR="$wx_config_major_version"
378 WX_VERSION_MINOR="$wx_config_minor_version"
379 AC_SUBST(WX_VERSION_MAJOR)
380 AC_SUBST(WX_VERSION_MINOR)
debc175a 381])
ed33d524
VS
382
383dnl ---------------------------------------------------------------------------
384dnl Get information on the wxrc program for making C++, Python and xrs
385dnl resource files.
386dnl
387dnl AC_ARG_ENABLE(...)
388dnl AC_ARG_WITH(...)
389dnl ...
33e61c47 390dnl WX_CONFIG_OPTIONS
ed33d524 391dnl ...
33e61c47 392dnl WX_CONFIG_CHECK(2.6.0, wxWin=1)
ed33d524
VS
393dnl if test "$wxWin" != 1; then
394dnl AC_MSG_ERROR([
395dnl wxWidgets must be installed on your system
396dnl but wx-config script couldn't be found.
397dnl
398dnl Please check that wx-config is in path, the directory
399dnl where wxWidgets libraries are installed (returned by
400dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
401dnl equivalent variable and wxWidgets version is 2.6.0 or above.
402dnl ])
403dnl fi
404dnl
33e61c47 405dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
ed33d524
VS
406dnl if test "x$HAVE_WXRC" != x1; then
407dnl AC_MSG_ERROR([
408dnl The wxrc program was not installed or not found.
409dnl
410dnl Please check the wxWidgets installation.
411dnl ])
412dnl fi
413dnl
414dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
415dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
416dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
417dnl
418dnl LDFLAGS="$LDFLAGS $WX_LIBS"
419dnl ---------------------------------------------------------------------------
420
ed33d524 421dnl ---------------------------------------------------------------------------
33e61c47 422dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
ed33d524
VS
423dnl
424dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
425dnl resources. The variable WXRC will be set and substituted in the configure
426dnl script and Makefiles.
427dnl
428dnl Example use:
33e61c47 429dnl WXRC_CHECK([wxrc=1], [wxrc=0])
ed33d524
VS
430dnl ---------------------------------------------------------------------------
431
432dnl
433dnl wxrc program from the wx-config script
434dnl
33e61c47 435AC_DEFUN([WXRC_CHECK],
ed33d524
VS
436[
437 AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
438
439 if test "x$WX_CONFIG_NAME" = x; then
440 AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
441 else
442
443 AC_MSG_CHECKING([for wxrc])
444
445 if test "x$WXRC" = x ; then
446 dnl wx-config --utility is a new addition to wxWidgets:
447 _WX_PRIVATE_CHECK_VERSION(2,5,3)
448 if test -n "$wx_ver_ok"; then
449 WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
450 fi
451 fi
452
453 if test "x$WXRC" = x ; then
454 AC_MSG_RESULT([not found])
455 ifelse([$2], , :, [$2])
456 else
457 AC_MSG_RESULT([$WXRC])
458 ifelse([$1], , :, [$1])
459 fi
460
461 AC_SUBST(WXRC)
462 fi
463])
33e61c47
VZ
464
465dnl ---------------------------------------------------------------------------
466dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
467dnl
468dnl Sets the "output-var" variable to the name of a library named with same
469dnl wxWidgets rule.
470dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets
471dnl the $lib variable to:
472dnl 'mine_gtk2ud_test-2.8'
473dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_VERSION=28
474dnl ---------------------------------------------------------------------------
475AC_DEFUN([WX_LIKE_LIBNAME],
476 [
477 wx_temp="$2""_""$WX_PORT"
478
479 dnl add the [u][d] string
480 if test "$WX_UNICODE" = "1"; then
481 wx_temp="$wx_temp""u"
482 fi
483 if test "$WX_DEBUG" = "1"; then
484 wx_temp="$wx_temp""d"
485 fi
486
487 dnl complete the name of the lib
488 wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR"
489
490 dnl save it in the user's variable
491 $1=$wx_temp
492 ])
493
494dnl ---------------------------------------------------------------------------
495dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
496dnl
497dnl Two little custom macros which define the ENABLE/WITH configure arguments.
498dnl Macro arguments:
499dnl $1 = the name of the --enable / --with feature
500dnl $2 = the name of the variable associated
501dnl $3 = the description of that feature
502dnl $4 = the default value for that feature
503dnl $5 = additional action to do in case option is given with "yes" value
504dnl ---------------------------------------------------------------------------
505AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO],
506 [AC_ARG_ENABLE($1,
507 AC_HELP_STRING([--enable-$1], [$3 (default is $4)]),
508 [], [enableval="$4"])
509
510 dnl Show a message to the user about this option
511 AC_MSG_CHECKING([for the --enable-$1 option])
512 if test "$enableval" = "yes" ; then
513 AC_MSG_RESULT([yes])
514 $2=1
515 $5
516 elif test "$enableval" = "no" ; then
517 AC_MSG_RESULT([no])
518 $2=0
519 elif test "$enableval" = "auto" ; then
520 AC_MSG_RESULT([will be automatically detected])
521 $2="auto"
522 else
523 AC_MSG_ERROR([
524 Unrecognized option value (allowed values: yes, no, auto)
525 ])
526 fi
527 ])
528
529AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
530 [AC_ARG_WITH($1,
531 AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
532 [], [withval="$4"])
533
534 dnl Show a message to the user about this option
535 AC_MSG_CHECKING([for the --with-$1 option])
536 if test "$withval" = "yes" ; then
537 AC_MSG_RESULT([yes])
538 $2=1
539 $5
540 dnl NB: by default we don't allow --with-$1=no option
541 dnl since it does not make much sense !
542 elif test "$6" = "1" -a "$withval" = "no" ; then
543 AC_MSG_RESULT([no])
544 $2=0
545 elif test "$withval" = "auto" ; then
546 AC_MSG_RESULT([will be automatically detected])
547 $2="auto"
548 else
549 AC_MSG_ERROR([
550 Unrecognized option value (allowed values: yes, auto)
551 ])
552 fi
553 ])
554
555
556dnl ---------------------------------------------------------------------------
557dnl WX_STANDARD_OPTIONS([options-to-add])
558dnl
559dnl Adds to the configure script one or more of the following options:
560dnl --enable-[debug|unicode|shared|wxshared|wxdebug]
561dnl --with-[gtk|msw|motif|x11|mac|mgl|dfb]
562dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED,
563dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values.
564dnl
565dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the
566dnl --enable-unicode option (in boolean format) while the second indicates
567dnl if wxWidgets was built in Unicode mode (and still is in boolean format).
568dnl ---------------------------------------------------------------------------
569AC_DEFUN([WX_STANDARD_OPTIONS],
570 [
571
572 dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if
573 dnl the $1 argument contains respectively the debug,unicode or shared options.
574
575 ifelse(index([$1], [debug]), [-1],,
576 [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])])
577
578 ifelse(index([$1], [unicode]), [-1],,
579 [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])])
580
581 ifelse(index([$1], [shared]), [-1],,
582 [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])])
583
584 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option
585 dnl which must be able to accept the auto|gtk1|gtk2|msw|... values
586 ifelse(index([$1], [toolkit]), [-1],,
587 [
588 AC_ARG_WITH([toolkit],
589 AC_HELP_STRING([--with-toolkit],
590 [Build against a specific wxWidgets toolkit (default is auto)]),
591 [], [withval="auto"])
592
593 dnl Show a message to the user about this option
594 AC_MSG_CHECKING([for the --with-toolkit option])
595 if test "$withval" = "auto" ; then
596 AC_MSG_RESULT([will be automatically detected])
597 TOOLKIT="auto"
598 else
599 TOOLKIT="$withval"
600
601 dnl PORT must be one of the allowed values
602 if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \
603 "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \
604 "$TOOLKIT" != "x11" -a "$TOOLKIT" != "mac" -a \
605 "$TOOLKIT" != "mgl" -a "$TOOLKIT" != "dfb" ; then
606 AC_MSG_ERROR([
607 Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, x11, mac, mgl, dfb)
608 ])
609 fi
610
611 AC_MSG_RESULT([$TOOLKIT])
612 fi
613 ])
614
615 dnl ****** IMPORTANT *******
616 dnl Unlike for the UNICODE setting, you can build your program in
617 dnl shared mode against a static build of wxWidgets. Thus we have the
618 dnl following option which allows these mixtures. E.g.
619 dnl
620 dnl ./configure --disable-shared --with-wxshared
621 dnl
622 dnl will build your library in static mode against the first available
623 dnl shared build of wxWidgets.
624 dnl
625 dnl Note that's not possible to do the viceversa:
626 dnl
627 dnl ./configure --enable-shared --without-wxshared
628 dnl
629 dnl Doing so you would try to build your library in shared mode against a static
630 dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) !
631 dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES
632 dnl (where we know what 'auto' should be expanded to).
633 dnl
634 dnl If you try to build something in ANSI mode against a UNICODE build
635 dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets,
636 dnl then at best you'll get ton of linking errors !
637 dnl ************************
638
639 ifelse(index([$1], [wxshared]), [-1],,
640 [
641 WX_ARG_WITH_YESNOAUTO(
642 [wxshared], [WX_SHARED],
643 [Force building against a shared build of wxWidgets, even if --disable-shared is given],
644 [auto], [], [1])
645 ])
646
647 dnl Just like for SHARED and WX_SHARED it may happen that some adventurous
648 dnl peoples will want to mix a wxWidgets release build with a debug build of
649 dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables.
650 ifelse(index([$1], [wxdebug]), [-1],,
651 [
652 WX_ARG_WITH_YESNOAUTO(
653 [wxdebug], [WX_DEBUG],
654 [Force building against a debug build of wxWidgets, even if --disable-debug is given],
655 [auto], [], [1])
656 ])
657
658 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option
659 dnl which must be able to accept the auto|26|27|28... values
660 ifelse(index([$1], [wxversion]), [-1],,
661 [
662 AC_ARG_WITH([wxversion],
663 AC_HELP_STRING([--with-wxversion],
664 [Build against a specific version of wxWidgets (default is auto)]),
665 [], [withval="auto"])
666
667 dnl Show a message to the user about this option
668 AC_MSG_CHECKING([for the --with-wxversion option])
669 if test "$withval" = "auto" ; then
670 AC_MSG_RESULT([will be automatically detected])
671 WX_VERSION="auto"
672 else
673
674 wx_requested_major_version=`echo $withval | \
675 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
676 wx_requested_minor_version=`echo $withval | \
677 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
678
679 dnl both vars above must be exactly 1 digit
680 if test "${#wx_requested_major_version}" != "1" -o \
681 "${#wx_requested_minor_version}" != "1" ; then
682 AC_MSG_ERROR([
683 Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9)
684 ])
685 fi
686
687 WX_VERSION="$wx_requested_major_version"".""$wx_requested_minor_version"
688 AC_MSG_RESULT([$WX_VERSION])
689 fi
690 ])
691
692 if test "$WX_DEBUG_CONFIGURE" = "1"; then
693 echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG"
694 echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE"
695 echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED"
696 echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT"
697 echo "[[dbg]] VERSION: $VERSION, WX_VERSION: $WX_VERSION"
698 fi
699 ])
700
701
702dnl ---------------------------------------------------------------------------
703dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
704dnl
705dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values
706dnl which are different from "auto".
707dnl Thus this macro needs to be called only once all options have been set.
708dnl ---------------------------------------------------------------------------
709AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
710 [
711 if test "$WX_SHARED" = "1" ; then
712 WXCONFIG_FLAGS="--static=no "
713 elif test "$WX_SHARED" = "0" ; then
714 WXCONFIG_FLAGS="--static=yes "
715 fi
716
717 if test "$WX_DEBUG" = "1" ; then
718 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes "
719 elif test "$WX_DEBUG" = "0" ; then
720 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no "
721 fi
722
723 dnl The user should have set WX_UNICODE=UNICODE
724 if test "$WX_UNICODE" = "1" ; then
725 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes "
726 elif test "$WX_UNICODE" = "0" ; then
727 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no "
728 fi
729
730 if test "$TOOLKIT" != "auto" ; then
731 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
732 fi
733
734 if test "$WX_VERSION" != "auto" ; then
735 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_VERSION "
736 fi
737
738 dnl strip out the last space of the string
739 WXCONFIG_FLAGS=${WXCONFIG_FLAGS% }
740
741 if test "$WX_DEBUG_CONFIGURE" = "1"; then
742 echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS"
743 fi
744 ])
745
746
747dnl ---------------------------------------------------------------------------
748dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
749dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
750dnl
751dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets
752dnl additional CPP flags and put the result of the search in WX_$RESULTVAR
753dnl also adding the "yes" or "no" message result to MSG.
754dnl ---------------------------------------------------------------------------
755AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
756 [
757 if test "$$1" = "auto" ; then
758
759 dnl The user does not have particular preferences for this option;
760 dnl so we will detect the wxWidgets relative build setting and use it
761 AC_MSG_CHECKING([$3])
762
763 dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2
764 dnl string or to 0 otherwise.
765 dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it
766 dnl doesn't work; we use 'expr STRING : REGEXP' instead
767 WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*")
768
769 if test "$WX_$1" != "0"; then
770 WX_$1=1
771 AC_MSG_RESULT([yes])
772 ifelse([$4], , :, [$4])
773 else
774 WX_$1=0
775 AC_MSG_RESULT([no])
776 ifelse([$5], , :, [$5])
777 fi
778 else
779
780 dnl Use the setting given by the user
781 WX_$1=$$1
782 fi
783 ])
784
785dnl ---------------------------------------------------------------------------
786dnl WX_DETECT_STANDARD_OPTION_VALUES
787dnl
788dnl Detects the values of the following variables:
789dnl 1) WX_VERSION
790dnl 2) WX_UNICODE
791dnl 3) WX_DEBUG
792dnl 4) WX_SHARED (and also WX_STATIC)
793dnl 5) WX_PORT
794dnl from the previously selected wxWidgets build; this macro in fact must be
795dnl called *after* calling the WX_CONFIG_CHECK macro.
796dnl
797dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set
798dnl by WX_CONFIG_CHECK macro
799dnl ---------------------------------------------------------------------------
800AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
801 [
802 WX_VERSION="$WX_VERSION_MAJOR""$WX_VERSION_MINOR"
803 if test $WX_VERSION -lt 26 ; then
804
805 AC_MSG_ERROR([
806 Cannot detect the wxWidgets configuration for the selected wxWidgets build
731eee9a 807 since its version is $WX_VERSION < 2.6.0; please install a newer
33e61c47
VZ
808 version of wxWidgets.
809 ])
810 fi
811
812 dnl The wx-config we are using understands the "--selected_config"
813 dnl option which returns an easy-parseable string !
814 WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config)
815
816 if test "$WX_DEBUG_CONFIGURE" = "1"; then
817 echo "[[dbg]] Using wx-config --selected-config"
818 echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
819 fi
820
821
822 dnl we could test directly for WX_SHARED with a line like:
823 dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared],
824 dnl [if wxWidgets was built in SHARED mode])
825 dnl but wx-config --selected-config DOES NOT outputs the 'shared'
826 dnl word when wx was built in shared mode; it rather outputs the
827 dnl 'static' word when built in static mode.
828 if test $WX_SHARED = "1"; then
829 STATIC=0
830 elif test $WX_SHARED = "0"; then
831 STATIC=1
832 elif test $WX_SHARED = "auto"; then
833 STATIC="auto"
834 fi
835
836 dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables
837 _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode],
838 [if wxWidgets was built with UNICODE enabled])
839 _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug],
840 [if wxWidgets was built in DEBUG mode])
841 _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static],
842 [if wxWidgets was built in STATIC mode])
843
844 dnl init WX_SHARED from WX_STATIC
845 if test "$WX_STATIC" != "0"; then
846 WX_SHARED=0
847 else
848 WX_SHARED=1
849 fi
850
851 AC_SUBST(WX_UNICODE)
852 AC_SUBST(WX_DEBUG)
853 AC_SUBST(WX_SHARED)
854
855 dnl detect the WX_PORT to use
856 if test "$TOOLKIT" = "auto" ; then
857
858 dnl The user does not have particular preferences for this option;
859 dnl so we will detect the wxWidgets relative build setting and use it
860 AC_MSG_CHECKING([which wxWidgets toolkit was selected])
861
862 WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*")
863 WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*")
864 WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*")
865 WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*")
866 WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*")
867 WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*")
868 WX_MGLPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mgl.*")
869 WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*")
870
871 WX_PORT="unknown"
872 if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi
873 if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi
874 if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi
875 if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi
876 if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi
877 if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi
878 if test "$WX_MGLPORT" != "0"; then WX_PORT="mgl"; fi
879 if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi
880
881 dnl check at least one of the WX_*PORT has been set !
882
883 if test "$WX_PORT" = "unknown" ; then
884 AC_MSG_ERROR([
885 Cannot detect the currently installed wxWidgets port !
886 Please check your 'wx-config --cxxflags'...
887 ])
888 fi
889
890 AC_MSG_RESULT([$WX_PORT])
891 else
892
893 dnl Use the setting given by the user
894 if test -z "$TOOLKIT" ; then
895 WX_PORT=$TOOLKIT
896 else
897 dnl try with PORT
898 WX_PORT=$PORT
899 fi
900 fi
901
902 AC_SUBST(WX_PORT)
903
904 if test "$WX_DEBUG_CONFIGURE" = "1"; then
905 echo "[[dbg]] Values of all WX_* options after final detection:"
906 echo "[[dbg]] WX_DEBUG: $WX_DEBUG"
907 echo "[[dbg]] WX_UNICODE: $WX_UNICODE"
908 echo "[[dbg]] WX_SHARED: $WX_SHARED"
909 echo "[[dbg]] WX_VERSION: $WX_VERSION"
910 echo "[[dbg]] WX_PORT: $WX_PORT"
911 fi
912
913 dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when
914 dnl the user gives the options:
915 dnl ./configure --enable-shared --without-wxshared
916 dnl or just do
917 dnl ./configure --enable-shared
918 dnl but there is only a static build of wxWidgets available.
919 if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then
920 AC_MSG_ERROR([
921 Cannot build shared library against a static build of wxWidgets !
922 This error happens because the wxWidgets build which was selected
923 has been detected as static while you asked to build $PACKAGE_NAME
924 as shared library and this is not possible.
925 Use the '--disable-shared' option to build $PACKAGE_NAME
926 as static library or '--with-wxshared' to use wxWidgets as shared library.
927 ])
928 fi
929
930 dnl now we can finally update the DEBUG,UNICODE,SHARED options
931 dnl to their final values if they were set to 'auto'
932 if test "$DEBUG" = "auto"; then
933 DEBUG=$WX_DEBUG
934
935 dnl in case user wants a BUILD=debug/release var...
936 if test "$DEBUG" = "1"; then
937 BUILD="debug"
938 elif test "$DEBUG" = ""; then
939 BUILD="release"
940 fi
941 fi
942 if test "$UNICODE" = "auto"; then
943 UNICODE=$WX_UNICODE
944 fi
945 if test "$SHARED" = "auto"; then
946 SHARED=$WX_SHARED
947 fi
948 if test "$TOOLKIT" = "auto"; then
949 TOOLKIT=$WX_PORT
950 fi
951
952 dnl respect the DEBUG variable adding the optimize/debug flags
953 dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we
954 dnl don't need to set them, too
955 if test "$DEBUG" = "1"; then
956 CXXFLAGS="$CXXFLAGS -g -O0"
957 CFLAGS="$CFLAGS -g -O0"
958 else
959 CXXFLAGS="$CXXFLAGS -O2"
960 CFLAGS="$CFLAGS -O2"
961 fi
962 ])
963
964dnl ---------------------------------------------------------------------------
965dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for],
966dnl [what to print when var is 1],
967dnl [what to print when var is 0])
968dnl
969dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0.
970dnl This macro mainly exists just to make configure.ac scripts more readable.
971dnl
972dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments
973dnl if you want that m4 avoid to throw away the spaces prefixed to the
974dnl argument value.
975dnl ---------------------------------------------------------------------------
976AC_DEFUN([WX_BOOLOPT_SUMMARY],
977 [
978 if test "x$$1" = "x1" ; then
979 echo $2
980 elif test "x$$1" = "x0" ; then
981 echo $3
982 else
983 echo "$1 is $$1"
984 fi
985 ])
986
987dnl ---------------------------------------------------------------------------
988dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
989dnl
990dnl Shows a summary message to the user about the WX_* variable contents.
991dnl This macro is used typically at the end of the configure script.
992dnl ---------------------------------------------------------------------------
993AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG],
994 [
995 echo
996 echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION"
997 echo " has the following settings:"
998 WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"])
999 WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
1000 WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"])
731eee9a 1001 echo " - VERSION: $WX_VERSION"
33e61c47
VZ
1002 echo " - PORT: $WX_PORT"
1003 ])
1004
1005
1006dnl ---------------------------------------------------------------------------
1007dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1008dnl
1009dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info
1010dnl about the configuration of the package which used the wxpresets.
1011dnl
1012dnl Typical usage:
1013dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
1014dnl echo " - Package setting 1: $SETTING1"
1015dnl echo " - Package setting 2: $SETTING1"
1016dnl ...
1017dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1018dnl
1019dnl ---------------------------------------------------------------------------
1020AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
1021 [
1022 echo
1023 echo " ----------------------------------------------------------------"
1024 echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed."
1025 echo " Summary of main configuration settings for $PACKAGE_NAME:"
1026 WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"])
1027 WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
1028 WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"])
1029 ])
1030
1031AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
1032 [
1033 WX_STANDARD_OPTIONS_SUMMARY_MSG
1034 echo
1035 echo " Now, just run make."
1036 echo " ----------------------------------------------------------------"
1037 echo
1038 ])
1039
1040
1041dnl ---------------------------------------------------------------------------
1042dnl Deprecated macro wrappers
1043dnl ---------------------------------------------------------------------------
1044
1045AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS])
fb5b1321
VZ
1046AC_DEFUN([AM_PATH_WXCONFIG], [
1047 WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5])
1048])
33e61c47
VZ
1049
1050