1 # generated automatically by aclocal 1.13.4 -*- Autoconf -*-
3 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 dnl ---------------------------------------------------------------------------
16 dnl Author: wxWidgets development team,
17 dnl Francesco Montorsi,
18 dnl Bob McCown (Mac-testing)
19 dnl Creation date: 24/11/2001
20 dnl ---------------------------------------------------------------------------
22 dnl ===========================================================================
23 dnl Table of Contents of this macro file:
24 dnl -------------------------------------
26 dnl SECTION A: wxWidgets main macros
27 dnl - WX_CONFIG_OPTIONS
30 dnl - WX_STANDARD_OPTIONS
31 dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
32 dnl - WX_DETECT_STANDARD_OPTION_VALUES
34 dnl SECTION B: wxWidgets-related utilities
36 dnl - WX_ARG_ENABLE_YESNOAUTO
37 dnl - WX_ARG_WITH_YESNOAUTO
39 dnl SECTION C: messages to the user
40 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG
41 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
42 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END
43 dnl - WX_BOOLOPT_SUMMARY
45 dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra
46 dnl debug output on stdout from these macros.
47 dnl ===========================================================================
50 dnl ---------------------------------------------------------------------------
51 dnl Macros for wxWidgets detection. Typically used in configure.in as:
53 dnl AC_ARG_ENABLE(...)
59 dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1])
60 dnl if test "$wxWin" != 1; then
62 dnl wxWidgets must be installed on your system
63 dnl but wx-config script couldn't be found.
65 dnl Please check that wx-config is in path, the directory
66 dnl where wxWidgets libraries are installed (returned by
67 dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
68 dnl equivalent variable and wxWidgets version is 2.3.4 or above.
71 dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
72 dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
73 dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
75 dnl LIBS="$LIBS $WX_LIBS"
77 dnl If you want to support standard --enable-debug/unicode/shared options, you
78 dnl may do the following:
81 dnl AC_CANONICAL_SYSTEM
83 dnl # define configure options
85 dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
87 dnl # basic configure checks
90 dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
92 dnl WX_UNICODE=$UNICODE
94 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
95 dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS])
96 dnl WX_DETECT_STANDARD_OPTION_VALUES
98 dnl # write the output files
99 dnl AC_CONFIG_FILES([Makefile ...])
102 dnl # optional: just to show a message to the user
103 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
105 dnl ---------------------------------------------------------------------------
108 dnl ---------------------------------------------------------------------------
109 dnl WX_CONFIG_OPTIONS
111 dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
112 dnl --wx-config command line options
113 dnl ---------------------------------------------------------------------------
115 AC_DEFUN([WX_CONFIG_OPTIONS],
118 [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH],
119 [ wx_config_name="$withval/wx-config"
120 wx_config_args="--inplace"])
121 AC_ARG_WITH(wx-config,
122 [ --with-wx-config=CONFIG wx-config script to use (optional)],
123 wx_config_name="$withval" )
124 AC_ARG_WITH(wx-prefix,
125 [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
126 wx_config_prefix="$withval", wx_config_prefix="")
127 AC_ARG_WITH(wx-exec-prefix,
128 [ --with-wx-exec-prefix=PREFIX
129 Exec prefix where wxWidgets is installed (optional)],
130 wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
133 dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
134 dnl wx_ver_ok=yes if it is:
135 AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
138 if test "x$WX_VERSION" != x ; then
139 if test $wx_config_major_version -gt $1; then
142 if test $wx_config_major_version -eq $1; then
143 if test $wx_config_minor_version -gt $2; then
146 if test $wx_config_minor_version -eq $2; then
147 if test $wx_config_micro_version -ge $3; then
157 dnl ---------------------------------------------------------------------------
158 dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
159 dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
161 dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
162 dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
163 dnl environment variable to override the default name of the wx-config script
164 dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
165 dnl case the macro won't even waste time on tests for its existence.
167 dnl Optional WX-LIBS argument contains comma- or space-separated list of
168 dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS
169 dnl and WX_LIBS_STATIC will contain flags to link with all of the core
170 dnl wxWidgets libraries.
172 dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
173 dnl invocation command in present. It can be used to fine-tune lookup of
174 dnl best wxWidgets build available.
177 dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
178 dnl [--unicode --debug])
179 dnl ---------------------------------------------------------------------------
182 dnl Get the cflags and libraries from the wx-config script
184 AC_DEFUN([WX_CONFIG_CHECK],
186 dnl do we have wx-config name: it can be wx-config or wxd-config or ...
187 if test x${WX_CONFIG_NAME+set} != xset ; then
188 WX_CONFIG_NAME=wx-config
191 if test "x$wx_config_name" != x ; then
192 WX_CONFIG_NAME="$wx_config_name"
195 dnl deal with optional prefixes
196 if test x$wx_config_exec_prefix != x ; then
197 wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
198 WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
200 if test x$wx_config_prefix != x ; then
201 wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
202 WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
204 if test "$cross_compiling" = "yes"; then
205 wx_config_args="$wx_config_args --host=$host_alias"
208 dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
209 if test -x "$WX_CONFIG_NAME" ; then
210 AC_MSG_CHECKING(for wx-config)
211 WX_CONFIG_PATH="$WX_CONFIG_NAME"
212 AC_MSG_RESULT($WX_CONFIG_PATH)
214 AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
217 if test "$WX_CONFIG_PATH" != "no" ; then
220 min_wx_version=ifelse([$1], ,2.2.1,$1)
221 if test -z "$5" ; then
222 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
224 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
227 dnl don't add the libraries ($4) to this variable as this would result in
228 dnl an error when it's used with --version below
229 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5"
231 WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
232 wx_config_major_version=`echo $WX_VERSION | \
233 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
234 wx_config_minor_version=`echo $WX_VERSION | \
235 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
236 wx_config_micro_version=`echo $WX_VERSION | \
237 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
239 wx_requested_major_version=`echo $min_wx_version | \
240 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
241 wx_requested_minor_version=`echo $min_wx_version | \
242 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
243 wx_requested_micro_version=`echo $min_wx_version | \
244 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
246 _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
247 [$wx_requested_minor_version],
248 [$wx_requested_micro_version])
250 if test -n "$wx_ver_ok"; then
251 AC_MSG_RESULT(yes (version $WX_VERSION))
252 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4`
254 dnl is this even still appropriate? --static is a real option now
255 dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
256 dnl what the user actually wants, making this redundant at best.
257 dnl For now keep it in case anyone actually used it in the past.
258 AC_MSG_CHECKING([for wxWidgets static library])
259 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null`
260 if test "x$WX_LIBS_STATIC" = "x"; then
266 dnl starting with version 2.2.6 wx-config has --cppflags argument
268 if test $wx_config_major_version -gt 2; then
271 if test $wx_config_major_version -eq 2; then
272 if test $wx_config_minor_version -gt 2; then
275 if test $wx_config_minor_version -eq 2; then
276 if test $wx_config_micro_version -ge 6; then
284 dnl starting with version 2.7.0 wx-config has --rescomp option
286 if test $wx_config_major_version -gt 2; then
289 if test $wx_config_major_version -eq 2; then
290 if test $wx_config_minor_version -ge 7; then
295 if test "x$wx_has_rescomp" = x ; then
296 dnl cannot give any useful info for resource compiler
299 WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
302 if test "x$wx_has_cppflags" = x ; then
303 dnl no choice but to define all flags like CFLAGS
304 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
305 WX_CPPFLAGS=$WX_CFLAGS
306 WX_CXXFLAGS=$WX_CFLAGS
308 WX_CFLAGS_ONLY=$WX_CFLAGS
309 WX_CXXFLAGS_ONLY=$WX_CFLAGS
311 dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
312 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4`
313 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4`
314 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
316 WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
317 WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
320 ifelse([$2], , :, [$2])
324 if test "x$WX_VERSION" = x; then
325 dnl no wx-config at all
328 AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
338 if test ! -z "$5"; then
341 The configuration you asked for $PACKAGE_NAME requires a wxWidgets
342 build with the following settings:
344 but such build is not available.
346 To see the wxWidgets builds available on this system, please use
347 'wx-config --list' command. To use the default build, returned by
348 'wx-config --selected-config', use the options with their 'auto'
354 The requested wxWidgets build couldn't be found.
357 If you still get this error, then check that 'wx-config' is
358 in path, the directory where wxWidgets libraries are installed
359 (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
360 or equivalent variable and wxWidgets version is $1 or above."
362 ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3])
374 ifelse([$3], , :, [$3])
378 AC_SUBST(WX_CPPFLAGS)
380 AC_SUBST(WX_CXXFLAGS)
381 AC_SUBST(WX_CFLAGS_ONLY)
382 AC_SUBST(WX_CXXFLAGS_ONLY)
384 AC_SUBST(WX_LIBS_STATIC)
388 dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols
389 dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness):
390 WX_VERSION_MAJOR="$wx_config_major_version"
391 WX_VERSION_MINOR="$wx_config_minor_version"
392 WX_VERSION_MICRO="$wx_config_micro_version"
393 AC_SUBST(WX_VERSION_MAJOR)
394 AC_SUBST(WX_VERSION_MINOR)
395 AC_SUBST(WX_VERSION_MICRO)
398 dnl ---------------------------------------------------------------------------
399 dnl Get information on the wxrc program for making C++, Python and xrs
402 dnl AC_ARG_ENABLE(...)
405 dnl WX_CONFIG_OPTIONS
407 dnl WX_CONFIG_CHECK(2.6.0, wxWin=1)
408 dnl if test "$wxWin" != 1; then
410 dnl wxWidgets must be installed on your system
411 dnl but wx-config script couldn't be found.
413 dnl Please check that wx-config is in path, the directory
414 dnl where wxWidgets libraries are installed (returned by
415 dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
416 dnl equivalent variable and wxWidgets version is 2.6.0 or above.
420 dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
421 dnl if test "x$HAVE_WXRC" != x1; then
423 dnl The wxrc program was not installed or not found.
425 dnl Please check the wxWidgets installation.
429 dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
430 dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
431 dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
433 dnl LDFLAGS="$LDFLAGS $WX_LIBS"
434 dnl ---------------------------------------------------------------------------
436 dnl ---------------------------------------------------------------------------
437 dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
439 dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
440 dnl resources. The variable WXRC will be set and substituted in the configure
441 dnl script and Makefiles.
444 dnl WXRC_CHECK([wxrc=1], [wxrc=0])
445 dnl ---------------------------------------------------------------------------
448 dnl wxrc program from the wx-config script
450 AC_DEFUN([WXRC_CHECK],
452 AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
454 if test "x$WX_CONFIG_NAME" = x; then
455 AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
458 AC_MSG_CHECKING([for wxrc])
460 if test "x$WXRC" = x ; then
461 dnl wx-config --utility is a new addition to wxWidgets:
462 _WX_PRIVATE_CHECK_VERSION(2,5,3)
463 if test -n "$wx_ver_ok"; then
464 WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
468 if test "x$WXRC" = x ; then
469 AC_MSG_RESULT([not found])
470 ifelse([$2], , :, [$2])
472 AC_MSG_RESULT([$WXRC])
473 ifelse([$1], , :, [$1])
480 dnl ---------------------------------------------------------------------------
481 dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
483 dnl Sets the "output-var" variable to the name of a library named with same
485 dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets
486 dnl the $lib variable to:
487 dnl 'mine_gtk2ud_test-2.8'
488 dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28
489 dnl ---------------------------------------------------------------------------
490 AC_DEFUN([WX_LIKE_LIBNAME],
492 wx_temp="$2""_""$WX_PORT"
494 dnl add the [u][d] string
495 if test "$WX_UNICODE" = "1"; then
496 wx_temp="$wx_temp""u"
498 if test "$WX_DEBUG" = "1"; then
499 wx_temp="$wx_temp""d"
502 dnl complete the name of the lib
503 wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR"
505 dnl save it in the user's variable
509 dnl ---------------------------------------------------------------------------
510 dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
512 dnl Two little custom macros which define the ENABLE/WITH configure arguments.
514 dnl $1 = the name of the --enable / --with feature
515 dnl $2 = the name of the variable associated
516 dnl $3 = the description of that feature
517 dnl $4 = the default value for that feature
518 dnl $5 = additional action to do in case option is given with "yes" value
519 dnl ---------------------------------------------------------------------------
520 AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO],
522 AC_HELP_STRING([--enable-$1], [$3 (default is $4)]),
523 [], [enableval="$4"])
525 dnl Show a message to the user about this option
526 AC_MSG_CHECKING([for the --enable-$1 option])
527 if test "$enableval" = "yes" ; then
531 elif test "$enableval" = "no" ; then
534 elif test "$enableval" = "auto" ; then
535 AC_MSG_RESULT([will be automatically detected])
539 Unrecognized option value (allowed values: yes, no, auto)
544 AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
546 AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
549 dnl Show a message to the user about this option
550 AC_MSG_CHECKING([for the --with-$1 option])
551 if test "$withval" = "yes" ; then
555 dnl NB: by default we don't allow --with-$1=no option
556 dnl since it does not make much sense !
557 elif test "$6" = "1" -a "$withval" = "no" ; then
560 elif test "$withval" = "auto" ; then
561 AC_MSG_RESULT([will be automatically detected])
565 Unrecognized option value (allowed values: yes, auto)
571 dnl ---------------------------------------------------------------------------
572 dnl WX_STANDARD_OPTIONS([options-to-add])
574 dnl Adds to the configure script one or more of the following options:
575 dnl --enable-[debug|unicode|shared|wxshared|wxdebug]
576 dnl --with-[gtk|msw|motif|x11|mac|dfb]
578 dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED,
579 dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values.
581 dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the
582 dnl --enable-unicode option (in boolean format) while the second indicates
583 dnl if wxWidgets was built in Unicode mode (and still is in boolean format).
584 dnl ---------------------------------------------------------------------------
585 AC_DEFUN([WX_STANDARD_OPTIONS],
588 dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if
589 dnl the $1 argument contains respectively the debug,unicode or shared options.
591 dnl be careful here not to set debug flag if only "wxdebug" was specified
592 ifelse(regexp([$1], [\bdebug]), [-1],,
593 [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])])
595 ifelse(index([$1], [unicode]), [-1],,
596 [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])])
598 ifelse(regexp([$1], [\bshared]), [-1],,
599 [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])])
601 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option
602 dnl which must be able to accept the auto|gtk1|gtk2|msw|... values
603 ifelse(index([$1], [toolkit]), [-1],,
605 AC_ARG_WITH([toolkit],
606 AC_HELP_STRING([--with-toolkit],
607 [Build against a specific wxWidgets toolkit (default is auto)]),
608 [], [withval="auto"])
610 dnl Show a message to the user about this option
611 AC_MSG_CHECKING([for the --with-toolkit option])
612 if test "$withval" = "auto" ; then
613 AC_MSG_RESULT([will be automatically detected])
618 dnl PORT must be one of the allowed values
619 if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \
620 "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \
621 "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \
622 "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then
624 Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11)
628 AC_MSG_RESULT([$TOOLKIT])
632 dnl ****** IMPORTANT *******
633 dnl Unlike for the UNICODE setting, you can build your program in
634 dnl shared mode against a static build of wxWidgets. Thus we have the
635 dnl following option which allows these mixtures. E.g.
637 dnl ./configure --disable-shared --with-wxshared
639 dnl will build your library in static mode against the first available
640 dnl shared build of wxWidgets.
642 dnl Note that's not possible to do the viceversa:
644 dnl ./configure --enable-shared --without-wxshared
646 dnl Doing so you would try to build your library in shared mode against a static
647 dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) !
648 dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES
649 dnl (where we know what 'auto' should be expanded to).
651 dnl If you try to build something in ANSI mode against a UNICODE build
652 dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets,
653 dnl then at best you'll get ton of linking errors !
654 dnl ************************
656 ifelse(index([$1], [wxshared]), [-1],,
658 WX_ARG_WITH_YESNOAUTO(
659 [wxshared], [WX_SHARED],
660 [Force building against a shared build of wxWidgets, even if --disable-shared is given],
664 dnl Just like for SHARED and WX_SHARED it may happen that some adventurous
665 dnl peoples will want to mix a wxWidgets release build with a debug build of
666 dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables.
667 ifelse(index([$1], [wxdebug]), [-1],,
669 WX_ARG_WITH_YESNOAUTO(
670 [wxdebug], [WX_DEBUG],
671 [Force building against a debug build of wxWidgets, even if --disable-debug is given],
675 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option
676 dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values
677 ifelse(index([$1], [wxversion]), [-1],,
679 AC_ARG_WITH([wxversion],
680 AC_HELP_STRING([--with-wxversion],
681 [Build against a specific version of wxWidgets (default is auto)]),
682 [], [withval="auto"])
684 dnl Show a message to the user about this option
685 AC_MSG_CHECKING([for the --with-wxversion option])
686 if test "$withval" = "auto" ; then
687 AC_MSG_RESULT([will be automatically detected])
691 wx_requested_major_version=`echo $withval | \
692 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
693 wx_requested_minor_version=`echo $withval | \
694 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
696 dnl both vars above must be exactly 1 digit
697 if test "${#wx_requested_major_version}" != "1" -o \
698 "${#wx_requested_minor_version}" != "1" ; then
700 Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0)
704 WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version"
705 AC_MSG_RESULT([$WX_RELEASE])
709 if test "$WX_DEBUG_CONFIGURE" = "1"; then
710 echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG"
711 echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE"
712 echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED"
713 echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT"
714 echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE"
719 dnl ---------------------------------------------------------------------------
720 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
722 dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values
723 dnl which are different from "auto".
724 dnl Thus this macro needs to be called only once all options have been set.
725 dnl ---------------------------------------------------------------------------
726 AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
728 if test "$WX_SHARED" = "1" ; then
729 WXCONFIG_FLAGS="--static=no "
730 elif test "$WX_SHARED" = "0" ; then
731 WXCONFIG_FLAGS="--static=yes "
734 if test "$WX_DEBUG" = "1" ; then
735 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes "
736 elif test "$WX_DEBUG" = "0" ; then
737 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no "
740 dnl The user should have set WX_UNICODE=UNICODE
741 if test "$WX_UNICODE" = "1" ; then
742 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes "
743 elif test "$WX_UNICODE" = "0" ; then
744 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no "
747 if test "$TOOLKIT" != "auto" ; then
748 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
751 if test "$WX_RELEASE" != "auto" ; then
752 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
755 dnl strip out the last space of the string
756 WXCONFIG_FLAGS=${WXCONFIG_FLAGS% }
758 if test "$WX_DEBUG_CONFIGURE" = "1"; then
759 echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS"
764 dnl ---------------------------------------------------------------------------
765 dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
766 dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
768 dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets
769 dnl additional CPP flags and put the result of the search in WX_$RESULTVAR
770 dnl also adding the "yes" or "no" message result to MSG.
771 dnl ---------------------------------------------------------------------------
772 AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
774 if test "$$1" = "auto" ; then
776 dnl The user does not have particular preferences for this option;
777 dnl so we will detect the wxWidgets relative build setting and use it
778 AC_MSG_CHECKING([$3])
780 dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2
781 dnl string or to 0 otherwise.
782 dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it
783 dnl doesn't work; we use 'expr STRING : REGEXP' instead
784 WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*")
786 if test "$WX_$1" != "0"; then
789 ifelse([$4], , :, [$4])
793 ifelse([$5], , :, [$5])
797 dnl Use the setting given by the user
802 dnl ---------------------------------------------------------------------------
803 dnl WX_DETECT_STANDARD_OPTION_VALUES
805 dnl Detects the values of the following variables:
809 dnl 4) WX_SHARED (and also WX_STATIC)
811 dnl from the previously selected wxWidgets build; this macro in fact must be
812 dnl called *after* calling the WX_CONFIG_CHECK macro.
814 dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set
815 dnl by WX_CONFIG_CHECK macro
816 dnl ---------------------------------------------------------------------------
817 AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
819 dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits,
820 dnl while WX_RELEASE only the major.minor ones.
821 WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR"
822 if test $WX_RELEASE -lt 26 ; then
825 Cannot detect the wxWidgets configuration for the selected wxWidgets build
826 since its version is $WX_VERSION < 2.6.0; please install a newer
827 version of wxWidgets.
831 dnl The wx-config we are using understands the "--selected_config"
832 dnl option which returns an easy-parseable string !
833 WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config)
835 if test "$WX_DEBUG_CONFIGURE" = "1"; then
836 echo "[[dbg]] Using wx-config --selected-config"
837 echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
841 dnl we could test directly for WX_SHARED with a line like:
842 dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared],
843 dnl [if wxWidgets was built in SHARED mode])
844 dnl but wx-config --selected-config DOES NOT outputs the 'shared'
845 dnl word when wx was built in shared mode; it rather outputs the
846 dnl 'static' word when built in static mode.
847 if test $WX_SHARED = "1"; then
849 elif test $WX_SHARED = "0"; then
851 elif test $WX_SHARED = "auto"; then
855 dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables
856 _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode],
857 [if wxWidgets was built with UNICODE enabled])
858 _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug],
859 [if wxWidgets was built in DEBUG mode])
860 _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static],
861 [if wxWidgets was built in STATIC mode])
863 dnl init WX_SHARED from WX_STATIC
864 if test "$WX_STATIC" != "0"; then
874 dnl detect the WX_PORT to use
875 if test "$TOOLKIT" = "auto" ; then
877 dnl The user does not have particular preferences for this option;
878 dnl so we will detect the wxWidgets relative build setting and use it
879 AC_MSG_CHECKING([which wxWidgets toolkit was selected])
881 WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*")
882 WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*")
883 WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*")
884 WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*")
885 WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*")
886 WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*")
887 WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*")
888 WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*")
891 if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi
892 if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi
893 if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi
894 if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi
895 if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi
896 if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi
897 if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi
898 if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi
900 dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac
901 dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above)
902 WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*")
903 if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi
905 dnl check at least one of the WX_*PORT has been set !
907 if test "$WX_PORT" = "unknown" ; then
909 Cannot detect the currently installed wxWidgets port !
910 Please check your 'wx-config --cxxflags'...
914 AC_MSG_RESULT([$WX_PORT])
917 dnl Use the setting given by the user
918 if test -z "$TOOLKIT" ; then
928 if test "$WX_DEBUG_CONFIGURE" = "1"; then
929 echo "[[dbg]] Values of all WX_* options after final detection:"
930 echo "[[dbg]] WX_DEBUG: $WX_DEBUG"
931 echo "[[dbg]] WX_UNICODE: $WX_UNICODE"
932 echo "[[dbg]] WX_SHARED: $WX_SHARED"
933 echo "[[dbg]] WX_RELEASE: $WX_RELEASE"
934 echo "[[dbg]] WX_PORT: $WX_PORT"
937 dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when
938 dnl the user gives the options:
939 dnl ./configure --enable-shared --without-wxshared
941 dnl ./configure --enable-shared
942 dnl but there is only a static build of wxWidgets available.
943 if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then
945 Cannot build shared library against a static build of wxWidgets !
946 This error happens because the wxWidgets build which was selected
947 has been detected as static while you asked to build $PACKAGE_NAME
948 as shared library and this is not possible.
949 Use the '--disable-shared' option to build $PACKAGE_NAME
950 as static library or '--with-wxshared' to use wxWidgets as shared library.
954 dnl now we can finally update the DEBUG,UNICODE,SHARED options
955 dnl to their final values if they were set to 'auto'
956 if test "$DEBUG" = "auto"; then
959 if test "$UNICODE" = "auto"; then
962 if test "$SHARED" = "auto"; then
965 if test "$TOOLKIT" = "auto"; then
969 dnl in case the user needs a BUILD=debug/release var...
970 if test "$DEBUG" = "1"; then
972 elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then
976 dnl respect the DEBUG variable adding the optimize/debug flags
977 dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we
978 dnl don't need to set them, too
979 if test "$DEBUG" = "1"; then
980 CXXFLAGS="$CXXFLAGS -g -O0"
981 CFLAGS="$CFLAGS -g -O0"
983 CXXFLAGS="$CXXFLAGS -O2"
988 dnl ---------------------------------------------------------------------------
989 dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for],
990 dnl [what to print when var is 1],
991 dnl [what to print when var is 0])
993 dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0.
994 dnl This macro mainly exists just to make configure.ac scripts more readable.
996 dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments
997 dnl if you want that m4 avoid to throw away the spaces prefixed to the
999 dnl ---------------------------------------------------------------------------
1000 AC_DEFUN([WX_BOOLOPT_SUMMARY],
1002 if test "x$$1" = "x1" ; then
1004 elif test "x$$1" = "x0" ; then
1011 dnl ---------------------------------------------------------------------------
1012 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
1014 dnl Shows a summary message to the user about the WX_* variable contents.
1015 dnl This macro is used typically at the end of the configure script.
1016 dnl ---------------------------------------------------------------------------
1017 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG],
1020 echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION"
1021 echo " has the following settings:"
1022 WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"])
1023 WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
1024 WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"])
1025 echo " - VERSION: $WX_VERSION"
1026 echo " - PORT: $WX_PORT"
1030 dnl ---------------------------------------------------------------------------
1031 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1033 dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info
1034 dnl about the configuration of the package which used the wxpresets.
1037 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
1038 dnl echo " - Package setting 1: $SETTING1"
1039 dnl echo " - Package setting 2: $SETTING1"
1041 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1043 dnl ---------------------------------------------------------------------------
1044 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
1047 echo " ----------------------------------------------------------------"
1048 echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed."
1049 echo " Summary of main configuration settings for $PACKAGE_NAME:"
1050 WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"])
1051 WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
1052 WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"])
1055 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
1057 WX_STANDARD_OPTIONS_SUMMARY_MSG
1059 echo " Now, just run make."
1060 echo " ----------------------------------------------------------------"
1065 dnl ---------------------------------------------------------------------------
1066 dnl Deprecated macro wrappers
1067 dnl ---------------------------------------------------------------------------
1069 AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS])
1070 AC_DEFUN([AM_PATH_WXCONFIG], [
1071 WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5])
1073 AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])
1075 # AM_COND_IF -*- Autoconf -*-
1077 # Copyright (C) 2008-2013 Free Software Foundation, Inc.
1079 # This file is free software; the Free Software Foundation
1080 # gives unlimited permission to copy and/or distribute it,
1081 # with or without modifications, as long as this notice is preserved.
1087 # These macros are only used for tracing.
1088 m4_define([_AM_COND_IF])
1089 m4_define([_AM_COND_ELSE])
1090 m4_define([_AM_COND_ENDIF])
1092 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
1093 # ---------------------------------------
1094 # If the shell condition COND is true, execute IF-TRUE, otherwise execute
1095 # IF-FALSE. Allow automake to learn about conditional instantiating macros
1096 # (the AC_CONFIG_FOOS).
1097 AC_DEFUN([AM_COND_IF],
1098 [m4_ifndef([_AM_COND_VALUE_$1],
1099 [m4_fatal([$0: no such condition "$1"])])dnl
1100 _AM_COND_IF([$1])dnl
1101 if test -z "$$1_TRUE"; then :
1104 [_AM_COND_ELSE([$1])dnl
1108 _AM_COND_ENDIF([$1])dnl
1112 # AM_CONDITIONAL -*- Autoconf -*-
1114 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
1116 # This file is free software; the Free Software Foundation
1117 # gives unlimited permission to copy and/or distribute it,
1118 # with or without modifications, as long as this notice is preserved.
1120 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1121 # -------------------------------------
1122 # Define a conditional.
1123 AC_DEFUN([AM_CONDITIONAL],
1124 [AC_PREREQ([2.52])dnl
1125 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1126 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1127 AC_SUBST([$1_TRUE])dnl
1128 AC_SUBST([$1_FALSE])dnl
1129 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1130 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1131 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1139 AC_CONFIG_COMMANDS_PRE(
1140 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1141 AC_MSG_ERROR([[conditional "$1" was never defined.
1142 Usually this means the macro was only invoked conditionally.]])
1145 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1147 # This file is free software; the Free Software Foundation
1148 # gives unlimited permission to copy and/or distribute it,
1149 # with or without modifications, as long as this notice is preserved.
1151 # _AM_SUBST_NOTMAKE(VARIABLE)
1152 # ---------------------------
1153 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1154 # This macro is traced by Automake.
1155 AC_DEFUN([_AM_SUBST_NOTMAKE])
1157 # AM_SUBST_NOTMAKE(VARIABLE)
1158 # --------------------------
1159 # Public sister of _AM_SUBST_NOTMAKE.
1160 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])