Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Remove functions from ConnectionObject interface
[xestiaab/.git] / source / aclocal.m4
1 # generated automatically by aclocal 1.14.1 -*- 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
12 # PARTICULAR PURPOSE.
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 -------------------------------------
25 dnl
26 dnl SECTION A: wxWidgets main macros
27 dnl  - WX_CONFIG_OPTIONS
28 dnl  - WX_CONFIG_CHECK
29 dnl  - WXRC_CHECK
30 dnl  - WX_STANDARD_OPTIONS
31 dnl  - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
32 dnl  - WX_DETECT_STANDARD_OPTION_VALUES
33 dnl
34 dnl SECTION B: wxWidgets-related utilities
35 dnl  - WX_LIKE_LIBNAME
36 dnl  - WX_ARG_ENABLE_YESNOAUTO
37 dnl  - WX_ARG_WITH_YESNOAUTO
38 dnl
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
44 dnl
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:
52 dnl
53 dnl     AC_ARG_ENABLE(...)
54 dnl     AC_ARG_WITH(...)
55 dnl        ...
56 dnl     WX_CONFIG_OPTIONS
57 dnl        ...
58 dnl        ...
59 dnl     WX_CONFIG_CHECK([2.6.0], [wxWin=1])
60 dnl     if test "$wxWin" != 1; then
61 dnl        AC_MSG_ERROR([
62 dnl                wxWidgets must be installed on your system
63 dnl                but wx-config script couldn't be found.
64 dnl
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.
69 dnl        ])
70 dnl     fi
71 dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
72 dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
73 dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
74 dnl
75 dnl     LIBS="$LIBS $WX_LIBS"
76 dnl
77 dnl If you want to support standard --enable-debug/unicode/shared options, you
78 dnl may do the following:
79 dnl
80 dnl     ...
81 dnl     AC_CANONICAL_SYSTEM
82 dnl
83 dnl     # define configure options
84 dnl     WX_CONFIG_OPTIONS
85 dnl     WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
86 dnl
87 dnl     # basic configure checks
88 dnl     ...
89 dnl
90 dnl     # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
91 dnl     WX_DEBUG=$DEBUG
92 dnl     WX_UNICODE=$UNICODE
93 dnl
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
97 dnl
98 dnl     # write the output files
99 dnl     AC_CONFIG_FILES([Makefile ...])
100 dnl     AC_OUTPUT
101 dnl
102 dnl     # optional: just to show a message to the user
103 dnl     WX_STANDARD_OPTIONS_SUMMARY_MSG
104 dnl
105 dnl ---------------------------------------------------------------------------
108 dnl ---------------------------------------------------------------------------
109 dnl WX_CONFIG_OPTIONS
110 dnl
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],
117     AC_ARG_WITH(wxdir,
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="")
131 ])
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],
137     wx_ver_ok=""
138     if test "x$WX_VERSION" != x ; then
139       if test $wx_config_major_version -gt $1; then
140         wx_ver_ok=yes
141       else
142         if test $wx_config_major_version -eq $1; then
143            if test $wx_config_minor_version -gt $2; then
144               wx_ver_ok=yes
145            else
146               if test $wx_config_minor_version -eq $2; then
147                  if test $wx_config_micro_version -ge $3; then
148                     wx_ver_ok=yes
149                  fi
150               fi
151            fi
152         fi
153       fi
154     fi
155 ])
157 dnl ---------------------------------------------------------------------------
158 dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
159 dnl                  [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
160 dnl
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.
166 dnl
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.
171 dnl
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.
175 dnl
176 dnl Example use:
177 dnl   WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
178 dnl                    [--unicode --debug])
179 dnl ---------------------------------------------------------------------------
181 dnl
182 dnl Get the cflags and libraries from the wx-config script
183 dnl
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
189   fi
191   if test "x$wx_config_name" != x ; then
192      WX_CONFIG_NAME="$wx_config_name"
193   fi
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"
199   fi
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"
203   fi
204   if test "$cross_compiling" = "yes"; then
205      wx_config_args="$wx_config_args --host=$host_alias"
206   fi
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)
213   else
214      AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
215   fi
217   if test "$WX_CONFIG_PATH" != "no" ; then
218     WX_VERSION=""
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])
223     else
224       AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
225     fi
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
261         AC_MSG_RESULT(no)
262       else
263         AC_MSG_RESULT(yes)
264       fi
266       dnl starting with version 2.2.6 wx-config has --cppflags argument
267       wx_has_cppflags=""
268       if test $wx_config_major_version -gt 2; then
269         wx_has_cppflags=yes
270       else
271         if test $wx_config_major_version -eq 2; then
272            if test $wx_config_minor_version -gt 2; then
273               wx_has_cppflags=yes
274            else
275               if test $wx_config_minor_version -eq 2; then
276                  if test $wx_config_micro_version -ge 6; then
277                     wx_has_cppflags=yes
278                  fi
279               fi
280            fi
281         fi
282       fi
284       dnl starting with version 2.7.0 wx-config has --rescomp option
285       wx_has_rescomp=""
286       if test $wx_config_major_version -gt 2; then
287         wx_has_rescomp=yes
288       else
289         if test $wx_config_major_version -eq 2; then
290            if test $wx_config_minor_version -ge 7; then
291               wx_has_rescomp=yes
292            fi
293         fi
294       fi
295       if test "x$wx_has_rescomp" = x ; then
296          dnl cannot give any useful info for resource compiler
297          WX_RESCOMP=
298       else
299          WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
300       fi
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
310       else
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 *@@"`
318       fi
320       ifelse([$2], , :, [$2])
322     else
324        if test "x$WX_VERSION" = x; then
325           dnl no wx-config at all
326           AC_MSG_RESULT(no)
327        else
328           AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
329        fi
331        WX_CFLAGS=""
332        WX_CPPFLAGS=""
333        WX_CXXFLAGS=""
334        WX_LIBS=""
335        WX_LIBS_STATIC=""
336        WX_RESCOMP=""
338        if test ! -z "$5"; then
340           wx_error_message="
341     The configuration you asked for $PACKAGE_NAME requires a wxWidgets
342     build with the following settings:
343         $5
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'
349     default values."
351        fi
353        wx_error_message="
354     The requested wxWidgets build couldn't be found.
355     $wx_error_message
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])
364     fi
365   else
367     WX_CFLAGS=""
368     WX_CPPFLAGS=""
369     WX_CXXFLAGS=""
370     WX_LIBS=""
371     WX_LIBS_STATIC=""
372     WX_RESCOMP=""
374     ifelse([$3], , :, [$3])
376   fi
378   AC_SUBST(WX_CPPFLAGS)
379   AC_SUBST(WX_CFLAGS)
380   AC_SUBST(WX_CXXFLAGS)
381   AC_SUBST(WX_CFLAGS_ONLY)
382   AC_SUBST(WX_CXXFLAGS_ONLY)
383   AC_SUBST(WX_LIBS)
384   AC_SUBST(WX_LIBS_STATIC)
385   AC_SUBST(WX_VERSION)
386   AC_SUBST(WX_RESCOMP)
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)
396 ])
398 dnl ---------------------------------------------------------------------------
399 dnl Get information on the wxrc program for making C++, Python and xrs
400 dnl resource files.
401 dnl
402 dnl     AC_ARG_ENABLE(...)
403 dnl     AC_ARG_WITH(...)
404 dnl        ...
405 dnl     WX_CONFIG_OPTIONS
406 dnl        ...
407 dnl     WX_CONFIG_CHECK(2.6.0, wxWin=1)
408 dnl     if test "$wxWin" != 1; then
409 dnl        AC_MSG_ERROR([
410 dnl                wxWidgets must be installed on your system
411 dnl                but wx-config script couldn't be found.
412 dnl
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.
417 dnl        ])
418 dnl     fi
419 dnl
420 dnl     WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
421 dnl     if test "x$HAVE_WXRC" != x1; then
422 dnl         AC_MSG_ERROR([
423 dnl                The wxrc program was not installed or not found.
424 dnl
425 dnl                Please check the wxWidgets installation.
426 dnl         ])
427 dnl     fi
428 dnl
429 dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
430 dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
431 dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
432 dnl
433 dnl     LDFLAGS="$LDFLAGS $WX_LIBS"
434 dnl ---------------------------------------------------------------------------
436 dnl ---------------------------------------------------------------------------
437 dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
438 dnl
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.
442 dnl
443 dnl Example use:
444 dnl   WXRC_CHECK([wxrc=1], [wxrc=0])
445 dnl ---------------------------------------------------------------------------
447 dnl
448 dnl wxrc program from the wx-config script
449 dnl
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.])
456   else
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`
465       fi
466     fi
468     if test "x$WXRC" = x ; then
469       AC_MSG_RESULT([not found])
470       ifelse([$2], , :, [$2])
471     else
472       AC_MSG_RESULT([$WXRC])
473       ifelse([$1], , :, [$1])
474     fi
476     AC_SUBST(WXRC)
477   fi
478 ])
480 dnl ---------------------------------------------------------------------------
481 dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
482 dnl
483 dnl Sets the "output-var" variable to the name of a library named with same
484 dnl wxWidgets rule.
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],
491     [
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"
497         fi
498         if test "$WX_DEBUG" = "1"; then
499             wx_temp="$wx_temp""d"
500         fi
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
506         $1=$wx_temp
507     ])
509 dnl ---------------------------------------------------------------------------
510 dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
511 dnl
512 dnl Two little custom macros which define the ENABLE/WITH configure arguments.
513 dnl Macro 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],
521          [AC_ARG_ENABLE($1,
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
528                 AC_MSG_RESULT([yes])
529                 $2=1
530                 $5
531             elif test "$enableval" = "no" ; then
532                 AC_MSG_RESULT([no])
533                 $2=0
534             elif test "$enableval" = "auto" ; then
535                 AC_MSG_RESULT([will be automatically detected])
536                 $2="auto"
537             else
538                 AC_MSG_ERROR([
539     Unrecognized option value (allowed values: yes, no, auto)
540                 ])
541             fi
542          ])
544 AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
545          [AC_ARG_WITH($1,
546             AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
547             [], [withval="$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
552                 AC_MSG_RESULT([yes])
553                 $2=1
554                 $5
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
558                 AC_MSG_RESULT([no])
559                 $2=0
560             elif test "$withval" = "auto" ; then
561                 AC_MSG_RESULT([will be automatically detected])
562                 $2="auto"
563             else
564                 AC_MSG_ERROR([
565     Unrecognized option value (allowed values: yes, auto)
566                 ])
567             fi
568          ])
571 dnl ---------------------------------------------------------------------------
572 dnl WX_STANDARD_OPTIONS([options-to-add])
573 dnl
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]
577 dnl   --with-wxversion
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.
580 dnl
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],
586         [
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],,
604                [
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])
614                     TOOLKIT="auto"
615                 else
616                     TOOLKIT="$withval"
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
623                         AC_MSG_ERROR([
624     Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11)
625                         ])
626                     fi
628                     AC_MSG_RESULT([$TOOLKIT])
629                 fi
630                ])
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.
636         dnl
637         dnl      ./configure --disable-shared --with-wxshared
638         dnl
639         dnl   will build your library in static mode against the first available
640         dnl   shared build of wxWidgets.
641         dnl
642         dnl   Note that's not possible to do the viceversa:
643         dnl
644         dnl      ./configure --enable-shared --without-wxshared
645         dnl
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).
650         dnl
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],,
657                [
658                 WX_ARG_WITH_YESNOAUTO(
659                     [wxshared], [WX_SHARED],
660                     [Force building against a shared build of wxWidgets, even if --disable-shared is given],
661                     [auto], [], [1])
662                ])
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],,
668                [
669                 WX_ARG_WITH_YESNOAUTO(
670                     [wxdebug], [WX_DEBUG],
671                     [Force building against a debug build of wxWidgets, even if --disable-debug is given],
672                     [auto], [], [1])
673                ])
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],,
678                [
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])
688                     WX_RELEASE="auto"
689                 else
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
699                         AC_MSG_ERROR([
700     Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0)
701                         ])
702                     fi
704                     WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version"
705                     AC_MSG_RESULT([$WX_RELEASE])
706                 fi
707                ])
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"
715         fi
716     ])
719 dnl ---------------------------------------------------------------------------
720 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
721 dnl
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],
727         [
728         if test "$WX_SHARED" = "1" ; then
729             WXCONFIG_FLAGS="--static=no "
730         elif test "$WX_SHARED" = "0" ; then
731             WXCONFIG_FLAGS="--static=yes "
732         fi
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 "
738         fi
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 "
745         fi
747         if test "$TOOLKIT" != "auto" ; then
748             WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
749         fi
751         if test "$WX_RELEASE" != "auto" ; then
752             WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
753         fi
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"
760         fi
761     ])
764 dnl ---------------------------------------------------------------------------
765 dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
766 dnl                             [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
767 dnl
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],
773         [
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
787                 WX_$1=1
788                 AC_MSG_RESULT([yes])
789                 ifelse([$4], , :, [$4])
790             else
791                 WX_$1=0
792                 AC_MSG_RESULT([no])
793                 ifelse([$5], , :, [$5])
794             fi
795         else
797             dnl Use the setting given by the user
798             WX_$1=$$1
799         fi
800     ])
802 dnl ---------------------------------------------------------------------------
803 dnl WX_DETECT_STANDARD_OPTION_VALUES
804 dnl
805 dnl Detects the values of the following variables:
806 dnl 1) WX_RELEASE
807 dnl 2) WX_UNICODE
808 dnl 3) WX_DEBUG
809 dnl 4) WX_SHARED    (and also WX_STATIC)
810 dnl 5) WX_PORT
811 dnl from the previously selected wxWidgets build; this macro in fact must be
812 dnl called *after* calling the WX_CONFIG_CHECK macro.
813 dnl
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],
818         [
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
824             AC_MSG_ERROR([
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.
828                          ])
829         fi
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"
838         fi
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
848             STATIC=0
849         elif test $WX_SHARED = "0"; then
850             STATIC=1
851         elif test $WX_SHARED = "auto"; then
852             STATIC="auto"
853         fi
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
865             WX_SHARED=0
866         else
867             WX_SHARED=1
868         fi
870         AC_SUBST(WX_UNICODE)
871         AC_SUBST(WX_DEBUG)
872         AC_SUBST(WX_SHARED)
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.*")
890             WX_PORT="unknown"
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
908                 AC_MSG_ERROR([
909         Cannot detect the currently installed wxWidgets port !
910         Please check your 'wx-config --cxxflags'...
911                             ])
912             fi
914             AC_MSG_RESULT([$WX_PORT])
915         else
917             dnl Use the setting given by the user
918             if test -z "$TOOLKIT" ; then
919                 WX_PORT=$TOOLKIT
920             else
921                 dnl try with PORT
922                 WX_PORT=$PORT
923             fi
924         fi
926         AC_SUBST(WX_PORT)
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"
935         fi
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
940         dnl or just do
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
944             AC_MSG_ERROR([
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.
951                          ])
952         fi
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
957             DEBUG=$WX_DEBUG
958         fi
959         if test "$UNICODE" = "auto"; then
960             UNICODE=$WX_UNICODE
961         fi
962         if test "$SHARED" = "auto"; then
963             SHARED=$WX_SHARED
964         fi
965         if test "$TOOLKIT" = "auto"; then
966             TOOLKIT=$WX_PORT
967         fi
969         dnl in case the user needs a BUILD=debug/release var...
970         if test "$DEBUG" = "1"; then
971             BUILD="debug"
972         elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then
973             BUILD="release"
974         fi
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"
982         else
983             CXXFLAGS="$CXXFLAGS -O2"
984             CFLAGS="$CFLAGS -O2"
985         fi
986     ])
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])
992 dnl
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.
995 dnl
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
998 dnl       argument value.
999 dnl ---------------------------------------------------------------------------
1000 AC_DEFUN([WX_BOOLOPT_SUMMARY],
1001         [
1002         if test "x$$1" = "x1" ; then
1003             echo $2
1004         elif test "x$$1" = "x0" ; then
1005             echo $3
1006         else
1007             echo "$1 is $$1"
1008         fi
1009     ])
1011 dnl ---------------------------------------------------------------------------
1012 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
1013 dnl
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],
1018         [
1019         echo
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"
1027     ])
1030 dnl ---------------------------------------------------------------------------
1031 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1032 dnl
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.
1035 dnl
1036 dnl Typical usage:
1037 dnl    WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
1038 dnl    echo "   - Package setting 1: $SETTING1"
1039 dnl    echo "   - Package setting 2: $SETTING1"
1040 dnl    ...
1041 dnl    WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1042 dnl
1043 dnl ---------------------------------------------------------------------------
1044 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
1045         [
1046         echo
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"])
1053     ])
1055 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
1056         [
1057         WX_STANDARD_OPTIONS_SUMMARY_MSG
1058         echo
1059         echo "  Now, just run make."
1060         echo " ----------------------------------------------------------------"
1061         echo
1062     ])
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])
1072 ])
1073 AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])
1074 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1075 # serial 1 (pkg-config-0.24)
1076
1077 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
1079 # This program is free software; you can redistribute it and/or modify
1080 # it under the terms of the GNU General Public License as published by
1081 # the Free Software Foundation; either version 2 of the License, or
1082 # (at your option) any later version.
1084 # This program is distributed in the hope that it will be useful, but
1085 # WITHOUT ANY WARRANTY; without even the implied warranty of
1086 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1087 # General Public License for more details.
1089 # You should have received a copy of the GNU General Public License
1090 # along with this program; if not, write to the Free Software
1091 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1093 # As a special exception to the GNU General Public License, if you
1094 # distribute this file as part of a program that contains a
1095 # configuration script generated by Autoconf, you may include it under
1096 # the same distribution terms that you use for the rest of that program.
1098 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1099 # ----------------------------------
1100 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1101 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1102 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1103 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1104 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1105 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1106 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1108 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1109         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1110 fi
1111 if test -n "$PKG_CONFIG"; then
1112         _pkg_min_version=m4_default([$1], [0.9.0])
1113         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1114         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1115                 AC_MSG_RESULT([yes])
1116         else
1117                 AC_MSG_RESULT([no])
1118                 PKG_CONFIG=""
1119         fi
1120 fi[]dnl
1121 ])# PKG_PROG_PKG_CONFIG
1123 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1125 # Check to see whether a particular set of modules exists.  Similar
1126 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1128 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1129 # only at the first occurence in configure.ac, so if the first place
1130 # it's called might be skipped (such as if it is within an "if", you
1131 # have to call PKG_CHECK_EXISTS manually
1132 # --------------------------------------------------------------
1133 AC_DEFUN([PKG_CHECK_EXISTS],
1134 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1135 if test -n "$PKG_CONFIG" && \
1136     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1137   m4_default([$2], [:])
1138 m4_ifvaln([$3], [else
1139   $3])dnl
1140 fi])
1142 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1143 # ---------------------------------------------
1144 m4_define([_PKG_CONFIG],
1145 [if test -n "$$1"; then
1146     pkg_cv_[]$1="$$1"
1147  elif test -n "$PKG_CONFIG"; then
1148     PKG_CHECK_EXISTS([$3],
1149                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1150                       test "x$?" != "x0" && pkg_failed=yes ],
1151                      [pkg_failed=yes])
1152  else
1153     pkg_failed=untried
1154 fi[]dnl
1155 ])# _PKG_CONFIG
1157 # _PKG_SHORT_ERRORS_SUPPORTED
1158 # -----------------------------
1159 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1160 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1161 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1162         _pkg_short_errors_supported=yes
1163 else
1164         _pkg_short_errors_supported=no
1165 fi[]dnl
1166 ])# _PKG_SHORT_ERRORS_SUPPORTED
1169 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1170 # [ACTION-IF-NOT-FOUND])
1173 # Note that if there is a possibility the first call to
1174 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1175 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1178 # --------------------------------------------------------------
1179 AC_DEFUN([PKG_CHECK_MODULES],
1180 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1181 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1182 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1184 pkg_failed=no
1185 AC_MSG_CHECKING([for $1])
1187 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1188 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1190 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1191 and $1[]_LIBS to avoid the need to call pkg-config.
1192 See the pkg-config man page for more details.])
1194 if test $pkg_failed = yes; then
1195         AC_MSG_RESULT([no])
1196         _PKG_SHORT_ERRORS_SUPPORTED
1197         if test $_pkg_short_errors_supported = yes; then
1198                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1199         else 
1200                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1201         fi
1202         # Put the nasty error message in config.log where it belongs
1203         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1205         m4_default([$4], [AC_MSG_ERROR(
1206 [Package requirements ($2) were not met:
1208 $$1_PKG_ERRORS
1210 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1211 installed software in a non-standard prefix.
1213 _PKG_TEXT])[]dnl
1214         ])
1215 elif test $pkg_failed = untried; then
1216         AC_MSG_RESULT([no])
1217         m4_default([$4], [AC_MSG_FAILURE(
1218 [The pkg-config script could not be found or is too old.  Make sure it
1219 is in your PATH or set the PKG_CONFIG environment variable to the full
1220 path to pkg-config.
1222 _PKG_TEXT
1224 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1225         ])
1226 else
1227         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1228         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1229         AC_MSG_RESULT([yes])
1230         $3
1231 fi[]dnl
1232 ])# PKG_CHECK_MODULES
1235 # PKG_INSTALLDIR(DIRECTORY)
1236 # -------------------------
1237 # Substitutes the variable pkgconfigdir as the location where a module
1238 # should install pkg-config .pc files. By default the directory is
1239 # $libdir/pkgconfig, but the default can be changed by passing
1240 # DIRECTORY. The user can override through the --with-pkgconfigdir
1241 # parameter.
1242 AC_DEFUN([PKG_INSTALLDIR],
1243 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1244 m4_pushdef([pkg_description],
1245     [pkg-config installation directory @<:@]pkg_default[@:>@])
1246 AC_ARG_WITH([pkgconfigdir],
1247     [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1248     [with_pkgconfigdir=]pkg_default)
1249 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1250 m4_popdef([pkg_default])
1251 m4_popdef([pkg_description])
1252 ]) dnl PKG_INSTALLDIR
1255 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
1256 # -------------------------
1257 # Substitutes the variable noarch_pkgconfigdir as the location where a
1258 # module should install arch-independent pkg-config .pc files. By
1259 # default the directory is $datadir/pkgconfig, but the default can be
1260 # changed by passing DIRECTORY. The user can override through the
1261 # --with-noarch-pkgconfigdir parameter.
1262 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
1263 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1264 m4_pushdef([pkg_description],
1265     [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1266 AC_ARG_WITH([noarch-pkgconfigdir],
1267     [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1268     [with_noarch_pkgconfigdir=]pkg_default)
1269 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1270 m4_popdef([pkg_default])
1271 m4_popdef([pkg_description])
1272 ]) dnl PKG_NOARCH_INSTALLDIR
1275 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1276 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1277 # -------------------------------------------
1278 # Retrieves the value of the pkg-config variable for the given module.
1279 AC_DEFUN([PKG_CHECK_VAR],
1280 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1281 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1283 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
1284 AS_VAR_COPY([$1], [pkg_cv_][$1])
1286 AS_VAR_IF([$1], [""], [$5], [$4])dnl
1287 ])# PKG_CHECK_VAR
1289 # AM_COND_IF                                            -*- Autoconf -*-
1291 # Copyright (C) 2008-2013 Free Software Foundation, Inc.
1293 # This file is free software; the Free Software Foundation
1294 # gives unlimited permission to copy and/or distribute it,
1295 # with or without modifications, as long as this notice is preserved.
1297 # _AM_COND_IF
1298 # _AM_COND_ELSE
1299 # _AM_COND_ENDIF
1300 # --------------
1301 # These macros are only used for tracing.
1302 m4_define([_AM_COND_IF])
1303 m4_define([_AM_COND_ELSE])
1304 m4_define([_AM_COND_ENDIF])
1306 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
1307 # ---------------------------------------
1308 # If the shell condition COND is true, execute IF-TRUE, otherwise execute
1309 # IF-FALSE.  Allow automake to learn about conditional instantiating macros
1310 # (the AC_CONFIG_FOOS).
1311 AC_DEFUN([AM_COND_IF],
1312 [m4_ifndef([_AM_COND_VALUE_$1],
1313            [m4_fatal([$0: no such condition "$1"])])dnl
1314 _AM_COND_IF([$1])dnl
1315 if test -z "$$1_TRUE"; then :
1316   m4_n([$2])[]dnl
1317 m4_ifval([$3],
1318 [_AM_COND_ELSE([$1])dnl
1319 else
1320   $3
1321 ])dnl
1322 _AM_COND_ENDIF([$1])dnl
1323 fi[]dnl
1324 ])
1326 # AM_CONDITIONAL                                            -*- Autoconf -*-
1328 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
1330 # This file is free software; the Free Software Foundation
1331 # gives unlimited permission to copy and/or distribute it,
1332 # with or without modifications, as long as this notice is preserved.
1334 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1335 # -------------------------------------
1336 # Define a conditional.
1337 AC_DEFUN([AM_CONDITIONAL],
1338 [AC_PREREQ([2.52])dnl
1339  m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1340        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1341 AC_SUBST([$1_TRUE])dnl
1342 AC_SUBST([$1_FALSE])dnl
1343 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1344 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1345 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1346 if $2; then
1347   $1_TRUE=
1348   $1_FALSE='#'
1349 else
1350   $1_TRUE='#'
1351   $1_FALSE=
1352 fi
1353 AC_CONFIG_COMMANDS_PRE(
1354 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1355   AC_MSG_ERROR([[conditional "$1" was never defined.
1356 Usually this means the macro was only invoked conditionally.]])
1357 fi])])
1359 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1361 # This file is free software; the Free Software Foundation
1362 # gives unlimited permission to copy and/or distribute it,
1363 # with or without modifications, as long as this notice is preserved.
1365 # _AM_SUBST_NOTMAKE(VARIABLE)
1366 # ---------------------------
1367 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1368 # This macro is traced by Automake.
1369 AC_DEFUN([_AM_SUBST_NOTMAKE])
1371 # AM_SUBST_NOTMAKE(VARIABLE)
1372 # --------------------------
1373 # Public sister of _AM_SUBST_NOTMAKE.
1374 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy