1 # generated automatically by aclocal 1.11.2 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15 m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18 [m4_warning([this file was generated for autoconf 2.68.
19 You have another version of autoconf. It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically `autoreconf'.])])
23 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
25 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27 # This program is free software; you can redistribute it and/or modify
28 # it under the terms of the GNU General Public License as published by
29 # the Free Software Foundation; either version 2 of the License, or
30 # (at your option) any later version.
32 # This program is distributed in the hope that it will be useful, but
33 # WITHOUT ANY WARRANTY; without even the implied warranty of
34 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35 # General Public License for more details.
37 # You should have received a copy of the GNU General Public License
38 # along with this program; if not, write to the Free Software
39 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 # As a special exception to the GNU General Public License, if you
42 # distribute this file as part of a program that contains a
43 # configuration script generated by Autoconf, you may include it under
44 # the same distribution terms that you use for the rest of that program.
46 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
47 # ----------------------------------
48 AC_DEFUN([PKG_PROG_PKG_CONFIG],
49 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
50 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
51 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
52 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
53 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
55 if test -n "$PKG_CONFIG"; then
56 _pkg_min_version=m4_default([$1], [0.9.0])
57 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
58 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
66 ])# PKG_PROG_PKG_CONFIG
68 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
70 # Check to see whether a particular set of modules exists. Similar
71 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
74 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
75 # this or PKG_CHECK_MODULES is called, or make sure to call
76 # PKG_CHECK_EXISTS manually
77 # --------------------------------------------------------------
78 AC_DEFUN([PKG_CHECK_EXISTS],
79 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80 if test -n "$PKG_CONFIG" && \
81 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
82 m4_ifval([$2], [$2], [:])
88 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
89 # ---------------------------------------------
90 m4_define([_PKG_CONFIG],
91 [if test -n "$PKG_CONFIG"; then
92 if test -n "$$1"; then
95 PKG_CHECK_EXISTS([$3],
96 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
104 # _PKG_SHORT_ERRORS_SUPPORTED
105 # -----------------------------
106 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
107 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
108 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
109 _pkg_short_errors_supported=yes
111 _pkg_short_errors_supported=no
113 ])# _PKG_SHORT_ERRORS_SUPPORTED
116 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
117 # [ACTION-IF-NOT-FOUND])
120 # Note that if there is a possibility the first call to
121 # PKG_CHECK_MODULES might not happen, you should be sure to include an
122 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125 # --------------------------------------------------------------
126 AC_DEFUN([PKG_CHECK_MODULES],
127 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
128 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
129 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
132 AC_MSG_CHECKING([for $1])
134 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
135 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
137 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
138 and $1[]_LIBS to avoid the need to call pkg-config.
139 See the pkg-config man page for more details.])
141 if test $pkg_failed = yes; then
142 _PKG_SHORT_ERRORS_SUPPORTED
143 if test $_pkg_short_errors_supported = yes; then
144 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
146 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
148 # Put the nasty error message in config.log where it belongs
149 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
151 ifelse([$4], , [AC_MSG_ERROR(dnl
152 [Package requirements ($2) were not met:
156 Consider adjusting the PKG_CONFIG_PATH environment variable if you
157 installed software in a non-standard prefix.
162 elif test $pkg_failed = untried; then
163 ifelse([$4], , [AC_MSG_FAILURE(dnl
164 [The pkg-config script could not be found or is too old. Make sure it
165 is in your PATH or set the PKG_CONFIG environment variable to the full
170 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
173 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
176 ifelse([$3], , :, [$3])
178 ])# PKG_CHECK_MODULES
180 dnl ---------------------------------------------------------------------------
181 dnl Author: wxWidgets development team,
182 dnl Francesco Montorsi,
183 dnl Bob McCown (Mac-testing)
184 dnl Creation date: 24/11/2001
186 dnl ---------------------------------------------------------------------------
188 dnl ===========================================================================
189 dnl Table of Contents of this macro file:
190 dnl -------------------------------------
192 dnl SECTION A: wxWidgets main macros
193 dnl - WX_CONFIG_OPTIONS
194 dnl - WX_CONFIG_CHECK
196 dnl - WX_STANDARD_OPTIONS
197 dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
198 dnl - WX_DETECT_STANDARD_OPTION_VALUES
200 dnl SECTION B: wxWidgets-related utilities
201 dnl - WX_LIKE_LIBNAME
202 dnl - WX_ARG_ENABLE_YESNOAUTO
203 dnl - WX_ARG_WITH_YESNOAUTO
205 dnl SECTION C: messages to the user
206 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG
207 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
208 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END
209 dnl - WX_BOOLOPT_SUMMARY
211 dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra
212 dnl debug output on stdout from these macros.
213 dnl ===========================================================================
216 dnl ---------------------------------------------------------------------------
217 dnl Macros for wxWidgets detection. Typically used in configure.in as:
219 dnl AC_ARG_ENABLE(...)
222 dnl WX_CONFIG_OPTIONS
225 dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1])
226 dnl if test "$wxWin" != 1; then
228 dnl wxWidgets must be installed on your system
229 dnl but wx-config script couldn't be found.
231 dnl Please check that wx-config is in path, the directory
232 dnl where wxWidgets libraries are installed (returned by
233 dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
234 dnl equivalent variable and wxWidgets version is 2.3.4 or above.
237 dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
238 dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
239 dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
241 dnl LIBS="$LIBS $WX_LIBS"
243 dnl If you want to support standard --enable-debug/unicode/shared options, you
244 dnl may do the following:
247 dnl AC_CANONICAL_SYSTEM
249 dnl # define configure options
250 dnl WX_CONFIG_OPTIONS
251 dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
253 dnl # basic configure checks
256 dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
258 dnl WX_UNICODE=$UNICODE
260 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
261 dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS])
262 dnl WX_DETECT_STANDARD_OPTION_VALUES
264 dnl # write the output files
265 dnl AC_CONFIG_FILES([Makefile ...])
268 dnl # optional: just to show a message to the user
269 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
271 dnl ---------------------------------------------------------------------------
274 dnl ---------------------------------------------------------------------------
275 dnl WX_CONFIG_OPTIONS
277 dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
278 dnl --wx-config command line options
279 dnl ---------------------------------------------------------------------------
281 AC_DEFUN([WX_CONFIG_OPTIONS],
284 [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH],
285 [ wx_config_name="$withval/wx-config"
286 wx_config_args="--inplace"])
287 AC_ARG_WITH(wx-config,
288 [ --with-wx-config=CONFIG wx-config script to use (optional)],
289 wx_config_name="$withval" )
290 AC_ARG_WITH(wx-prefix,
291 [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
292 wx_config_prefix="$withval", wx_config_prefix="")
293 AC_ARG_WITH(wx-exec-prefix,
294 [ --with-wx-exec-prefix=PREFIX
295 Exec prefix where wxWidgets is installed (optional)],
296 wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
299 dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
300 dnl wx_ver_ok=yes if it is:
301 AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
304 if test "x$WX_VERSION" != x ; then
305 if test $wx_config_major_version -gt $1; then
308 if test $wx_config_major_version -eq $1; then
309 if test $wx_config_minor_version -gt $2; then
312 if test $wx_config_minor_version -eq $2; then
313 if test $wx_config_micro_version -ge $3; then
323 dnl ---------------------------------------------------------------------------
324 dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
325 dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
327 dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
328 dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
329 dnl environment variable to override the default name of the wx-config script
330 dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
331 dnl case the macro won't even waste time on tests for its existence.
333 dnl Optional WX-LIBS argument contains comma- or space-separated list of
334 dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS
335 dnl and WX_LIBS_STATIC will contain flags to link with all of the core
336 dnl wxWidgets libraries.
338 dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
339 dnl invocation command in present. It can be used to fine-tune lookup of
340 dnl best wxWidgets build available.
343 dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
344 dnl [--unicode --debug])
345 dnl ---------------------------------------------------------------------------
348 dnl Get the cflags and libraries from the wx-config script
350 AC_DEFUN([WX_CONFIG_CHECK],
352 dnl do we have wx-config name: it can be wx-config or wxd-config or ...
353 if test x${WX_CONFIG_NAME+set} != xset ; then
354 WX_CONFIG_NAME=wx-config
357 if test "x$wx_config_name" != x ; then
358 WX_CONFIG_NAME="$wx_config_name"
361 dnl deal with optional prefixes
362 if test x$wx_config_exec_prefix != x ; then
363 wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
364 WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
366 if test x$wx_config_prefix != x ; then
367 wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
368 WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
370 if test "$cross_compiling" = "yes"; then
371 wx_config_args="$wx_config_args --host=$host_alias"
374 dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
375 if test -x "$WX_CONFIG_NAME" ; then
376 AC_MSG_CHECKING(for wx-config)
377 WX_CONFIG_PATH="$WX_CONFIG_NAME"
378 AC_MSG_RESULT($WX_CONFIG_PATH)
380 AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
383 if test "$WX_CONFIG_PATH" != "no" ; then
386 min_wx_version=ifelse([$1], ,2.2.1,$1)
387 if test -z "$5" ; then
388 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
390 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
393 dnl don't add the libraries ($4) to this variable as this would result in
394 dnl an error when it's used with --version below
395 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5"
397 WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
398 wx_config_major_version=`echo $WX_VERSION | \
399 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
400 wx_config_minor_version=`echo $WX_VERSION | \
401 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
402 wx_config_micro_version=`echo $WX_VERSION | \
403 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
405 wx_requested_major_version=`echo $min_wx_version | \
406 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
407 wx_requested_minor_version=`echo $min_wx_version | \
408 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
409 wx_requested_micro_version=`echo $min_wx_version | \
410 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
412 _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
413 [$wx_requested_minor_version],
414 [$wx_requested_micro_version])
416 if test -n "$wx_ver_ok"; then
417 AC_MSG_RESULT(yes (version $WX_VERSION))
418 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4`
420 dnl is this even still appropriate? --static is a real option now
421 dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
422 dnl what the user actually wants, making this redundant at best.
423 dnl For now keep it in case anyone actually used it in the past.
424 AC_MSG_CHECKING([for wxWidgets static library])
425 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null`
426 if test "x$WX_LIBS_STATIC" = "x"; then
432 dnl starting with version 2.2.6 wx-config has --cppflags argument
434 if test $wx_config_major_version -gt 2; then
437 if test $wx_config_major_version -eq 2; then
438 if test $wx_config_minor_version -gt 2; then
441 if test $wx_config_minor_version -eq 2; then
442 if test $wx_config_micro_version -ge 6; then
450 dnl starting with version 2.7.0 wx-config has --rescomp option
452 if test $wx_config_major_version -gt 2; then
455 if test $wx_config_major_version -eq 2; then
456 if test $wx_config_minor_version -ge 7; then
461 if test "x$wx_has_rescomp" = x ; then
462 dnl cannot give any useful info for resource compiler
465 WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
468 if test "x$wx_has_cppflags" = x ; then
469 dnl no choice but to define all flags like CFLAGS
470 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
471 WX_CPPFLAGS=$WX_CFLAGS
472 WX_CXXFLAGS=$WX_CFLAGS
474 WX_CFLAGS_ONLY=$WX_CFLAGS
475 WX_CXXFLAGS_ONLY=$WX_CFLAGS
477 dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
478 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4`
479 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4`
480 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
482 WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
483 WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
486 ifelse([$2], , :, [$2])
490 if test "x$WX_VERSION" = x; then
491 dnl no wx-config at all
494 AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
504 if test ! -z "$5"; then
507 The configuration you asked for $PACKAGE_NAME requires a wxWidgets
508 build with the following settings:
510 but such build is not available.
512 To see the wxWidgets builds available on this system, please use
513 'wx-config --list' command. To use the default build, returned by
514 'wx-config --selected-config', use the options with their 'auto'
520 The requested wxWidgets build couldn't be found.
523 If you still get this error, then check that 'wx-config' is
524 in path, the directory where wxWidgets libraries are installed
525 (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
526 or equivalent variable and wxWidgets version is $1 or above."
528 ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3])
540 ifelse([$3], , :, [$3])
544 AC_SUBST(WX_CPPFLAGS)
546 AC_SUBST(WX_CXXFLAGS)
547 AC_SUBST(WX_CFLAGS_ONLY)
548 AC_SUBST(WX_CXXFLAGS_ONLY)
550 AC_SUBST(WX_LIBS_STATIC)
554 dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols
555 dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness):
556 WX_VERSION_MAJOR="$wx_config_major_version"
557 WX_VERSION_MINOR="$wx_config_minor_version"
558 WX_VERSION_MICRO="$wx_config_micro_version"
559 AC_SUBST(WX_VERSION_MAJOR)
560 AC_SUBST(WX_VERSION_MINOR)
561 AC_SUBST(WX_VERSION_MICRO)
564 dnl ---------------------------------------------------------------------------
565 dnl Get information on the wxrc program for making C++, Python and xrs
568 dnl AC_ARG_ENABLE(...)
571 dnl WX_CONFIG_OPTIONS
573 dnl WX_CONFIG_CHECK(2.6.0, wxWin=1)
574 dnl if test "$wxWin" != 1; then
576 dnl wxWidgets must be installed on your system
577 dnl but wx-config script couldn't be found.
579 dnl Please check that wx-config is in path, the directory
580 dnl where wxWidgets libraries are installed (returned by
581 dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
582 dnl equivalent variable and wxWidgets version is 2.6.0 or above.
586 dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
587 dnl if test "x$HAVE_WXRC" != x1; then
589 dnl The wxrc program was not installed or not found.
591 dnl Please check the wxWidgets installation.
595 dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
596 dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
597 dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
599 dnl LDFLAGS="$LDFLAGS $WX_LIBS"
600 dnl ---------------------------------------------------------------------------
602 dnl ---------------------------------------------------------------------------
603 dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
605 dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
606 dnl resources. The variable WXRC will be set and substituted in the configure
607 dnl script and Makefiles.
610 dnl WXRC_CHECK([wxrc=1], [wxrc=0])
611 dnl ---------------------------------------------------------------------------
614 dnl wxrc program from the wx-config script
616 AC_DEFUN([WXRC_CHECK],
618 AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
620 if test "x$WX_CONFIG_NAME" = x; then
621 AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
624 AC_MSG_CHECKING([for wxrc])
626 if test "x$WXRC" = x ; then
627 dnl wx-config --utility is a new addition to wxWidgets:
628 _WX_PRIVATE_CHECK_VERSION(2,5,3)
629 if test -n "$wx_ver_ok"; then
630 WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
634 if test "x$WXRC" = x ; then
635 AC_MSG_RESULT([not found])
636 ifelse([$2], , :, [$2])
638 AC_MSG_RESULT([$WXRC])
639 ifelse([$1], , :, [$1])
646 dnl ---------------------------------------------------------------------------
647 dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
649 dnl Sets the "output-var" variable to the name of a library named with same
651 dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets
652 dnl the $lib variable to:
653 dnl 'mine_gtk2ud_test-2.8'
654 dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28
655 dnl ---------------------------------------------------------------------------
656 AC_DEFUN([WX_LIKE_LIBNAME],
658 wx_temp="$2""_""$WX_PORT"
660 dnl add the [u][d] string
661 if test "$WX_UNICODE" = "1"; then
662 wx_temp="$wx_temp""u"
664 if test "$WX_DEBUG" = "1"; then
665 wx_temp="$wx_temp""d"
668 dnl complete the name of the lib
669 wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR"
671 dnl save it in the user's variable
675 dnl ---------------------------------------------------------------------------
676 dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
678 dnl Two little custom macros which define the ENABLE/WITH configure arguments.
680 dnl $1 = the name of the --enable / --with feature
681 dnl $2 = the name of the variable associated
682 dnl $3 = the description of that feature
683 dnl $4 = the default value for that feature
684 dnl $5 = additional action to do in case option is given with "yes" value
685 dnl ---------------------------------------------------------------------------
686 AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO],
688 AC_HELP_STRING([--enable-$1], [$3 (default is $4)]),
689 [], [enableval="$4"])
691 dnl Show a message to the user about this option
692 AC_MSG_CHECKING([for the --enable-$1 option])
693 if test "$enableval" = "yes" ; then
697 elif test "$enableval" = "no" ; then
700 elif test "$enableval" = "auto" ; then
701 AC_MSG_RESULT([will be automatically detected])
705 Unrecognized option value (allowed values: yes, no, auto)
710 AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
712 AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
715 dnl Show a message to the user about this option
716 AC_MSG_CHECKING([for the --with-$1 option])
717 if test "$withval" = "yes" ; then
721 dnl NB: by default we don't allow --with-$1=no option
722 dnl since it does not make much sense !
723 elif test "$6" = "1" -a "$withval" = "no" ; then
726 elif test "$withval" = "auto" ; then
727 AC_MSG_RESULT([will be automatically detected])
731 Unrecognized option value (allowed values: yes, auto)
737 dnl ---------------------------------------------------------------------------
738 dnl WX_STANDARD_OPTIONS([options-to-add])
740 dnl Adds to the configure script one or more of the following options:
741 dnl --enable-[debug|unicode|shared|wxshared|wxdebug]
742 dnl --with-[gtk|msw|motif|x11|mac|mgl|dfb]
744 dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED,
745 dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values.
747 dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the
748 dnl --enable-unicode option (in boolean format) while the second indicates
749 dnl if wxWidgets was built in Unicode mode (and still is in boolean format).
750 dnl ---------------------------------------------------------------------------
751 AC_DEFUN([WX_STANDARD_OPTIONS],
754 dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if
755 dnl the $1 argument contains respectively the debug,unicode or shared options.
757 dnl be careful here not to set debug flag if only "wxdebug" was specified
758 ifelse(regexp([$1], [\bdebug]), [-1],,
759 [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])])
761 ifelse(index([$1], [unicode]), [-1],,
762 [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])])
764 ifelse(regexp([$1], [\bshared]), [-1],,
765 [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])])
767 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option
768 dnl which must be able to accept the auto|gtk1|gtk2|msw|... values
769 ifelse(index([$1], [toolkit]), [-1],,
771 AC_ARG_WITH([toolkit],
772 AC_HELP_STRING([--with-toolkit],
773 [Build against a specific wxWidgets toolkit (default is auto)]),
774 [], [withval="auto"])
776 dnl Show a message to the user about this option
777 AC_MSG_CHECKING([for the --with-toolkit option])
778 if test "$withval" = "auto" ; then
779 AC_MSG_RESULT([will be automatically detected])
784 dnl PORT must be one of the allowed values
785 if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \
786 "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \
787 "$TOOLKIT" != "x11" -a "$TOOLKIT" != "mac" -a \
788 "$TOOLKIT" != "mgl" -a "$TOOLKIT" != "dfb" ; then
790 Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, x11, mac, mgl, dfb)
794 AC_MSG_RESULT([$TOOLKIT])
798 dnl ****** IMPORTANT *******
799 dnl Unlike for the UNICODE setting, you can build your program in
800 dnl shared mode against a static build of wxWidgets. Thus we have the
801 dnl following option which allows these mixtures. E.g.
803 dnl ./configure --disable-shared --with-wxshared
805 dnl will build your library in static mode against the first available
806 dnl shared build of wxWidgets.
808 dnl Note that's not possible to do the viceversa:
810 dnl ./configure --enable-shared --without-wxshared
812 dnl Doing so you would try to build your library in shared mode against a static
813 dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) !
814 dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES
815 dnl (where we know what 'auto' should be expanded to).
817 dnl If you try to build something in ANSI mode against a UNICODE build
818 dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets,
819 dnl then at best you'll get ton of linking errors !
820 dnl ************************
822 ifelse(index([$1], [wxshared]), [-1],,
824 WX_ARG_WITH_YESNOAUTO(
825 [wxshared], [WX_SHARED],
826 [Force building against a shared build of wxWidgets, even if --disable-shared is given],
830 dnl Just like for SHARED and WX_SHARED it may happen that some adventurous
831 dnl peoples will want to mix a wxWidgets release build with a debug build of
832 dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables.
833 ifelse(index([$1], [wxdebug]), [-1],,
835 WX_ARG_WITH_YESNOAUTO(
836 [wxdebug], [WX_DEBUG],
837 [Force building against a debug build of wxWidgets, even if --disable-debug is given],
841 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option
842 dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values
843 ifelse(index([$1], [wxversion]), [-1],,
845 AC_ARG_WITH([wxversion],
846 AC_HELP_STRING([--with-wxversion],
847 [Build against a specific version of wxWidgets (default is auto)]),
848 [], [withval="auto"])
850 dnl Show a message to the user about this option
851 AC_MSG_CHECKING([for the --with-wxversion option])
852 if test "$withval" = "auto" ; then
853 AC_MSG_RESULT([will be automatically detected])
857 wx_requested_major_version=`echo $withval | \
858 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
859 wx_requested_minor_version=`echo $withval | \
860 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
862 dnl both vars above must be exactly 1 digit
863 if test "${#wx_requested_major_version}" != "1" -o \
864 "${#wx_requested_minor_version}" != "1" ; then
866 Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0)
870 WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version"
871 AC_MSG_RESULT([$WX_RELEASE])
875 if test "$WX_DEBUG_CONFIGURE" = "1"; then
876 echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG"
877 echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE"
878 echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED"
879 echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT"
880 echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE"
885 dnl ---------------------------------------------------------------------------
886 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
888 dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values
889 dnl which are different from "auto".
890 dnl Thus this macro needs to be called only once all options have been set.
891 dnl ---------------------------------------------------------------------------
892 AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
894 if test "$WX_SHARED" = "1" ; then
895 WXCONFIG_FLAGS="--static=no "
896 elif test "$WX_SHARED" = "0" ; then
897 WXCONFIG_FLAGS="--static=yes "
900 if test "$WX_DEBUG" = "1" ; then
901 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes "
902 elif test "$WX_DEBUG" = "0" ; then
903 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no "
906 dnl The user should have set WX_UNICODE=UNICODE
907 if test "$WX_UNICODE" = "1" ; then
908 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes "
909 elif test "$WX_UNICODE" = "0" ; then
910 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no "
913 if test "$TOOLKIT" != "auto" ; then
914 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
917 if test "$WX_RELEASE" != "auto" ; then
918 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
921 dnl strip out the last space of the string
922 WXCONFIG_FLAGS=${WXCONFIG_FLAGS% }
924 if test "$WX_DEBUG_CONFIGURE" = "1"; then
925 echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS"
930 dnl ---------------------------------------------------------------------------
931 dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
932 dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
934 dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets
935 dnl additional CPP flags and put the result of the search in WX_$RESULTVAR
936 dnl also adding the "yes" or "no" message result to MSG.
937 dnl ---------------------------------------------------------------------------
938 AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
940 if test "$$1" = "auto" ; then
942 dnl The user does not have particular preferences for this option;
943 dnl so we will detect the wxWidgets relative build setting and use it
944 AC_MSG_CHECKING([$3])
946 dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2
947 dnl string or to 0 otherwise.
948 dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it
949 dnl doesn't work; we use 'expr STRING : REGEXP' instead
950 WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*")
952 if test "$WX_$1" != "0"; then
955 ifelse([$4], , :, [$4])
959 ifelse([$5], , :, [$5])
963 dnl Use the setting given by the user
968 dnl ---------------------------------------------------------------------------
969 dnl WX_DETECT_STANDARD_OPTION_VALUES
971 dnl Detects the values of the following variables:
975 dnl 4) WX_SHARED (and also WX_STATIC)
977 dnl from the previously selected wxWidgets build; this macro in fact must be
978 dnl called *after* calling the WX_CONFIG_CHECK macro.
980 dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set
981 dnl by WX_CONFIG_CHECK macro
982 dnl ---------------------------------------------------------------------------
983 AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
985 dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits,
986 dnl while WX_RELEASE only the major.minor ones.
987 WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR"
988 if test $WX_RELEASE -lt 26 ; then
991 Cannot detect the wxWidgets configuration for the selected wxWidgets build
992 since its version is $WX_VERSION < 2.6.0; please install a newer
993 version of wxWidgets.
997 dnl The wx-config we are using understands the "--selected_config"
998 dnl option which returns an easy-parseable string !
999 WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config)
1001 if test "$WX_DEBUG_CONFIGURE" = "1"; then
1002 echo "[[dbg]] Using wx-config --selected-config"
1003 echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
1007 dnl we could test directly for WX_SHARED with a line like:
1008 dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared],
1009 dnl [if wxWidgets was built in SHARED mode])
1010 dnl but wx-config --selected-config DOES NOT outputs the 'shared'
1011 dnl word when wx was built in shared mode; it rather outputs the
1012 dnl 'static' word when built in static mode.
1013 if test $WX_SHARED = "1"; then
1015 elif test $WX_SHARED = "0"; then
1017 elif test $WX_SHARED = "auto"; then
1021 dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables
1022 _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode],
1023 [if wxWidgets was built with UNICODE enabled])
1024 _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug],
1025 [if wxWidgets was built in DEBUG mode])
1026 _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static],
1027 [if wxWidgets was built in STATIC mode])
1029 dnl init WX_SHARED from WX_STATIC
1030 if test "$WX_STATIC" != "0"; then
1036 AC_SUBST(WX_UNICODE)
1040 dnl detect the WX_PORT to use
1041 if test "$TOOLKIT" = "auto" ; then
1043 dnl The user does not have particular preferences for this option;
1044 dnl so we will detect the wxWidgets relative build setting and use it
1045 AC_MSG_CHECKING([which wxWidgets toolkit was selected])
1047 WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*")
1048 WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*")
1049 WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*")
1050 WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*")
1051 WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*")
1052 WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*")
1053 WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*")
1054 WX_MGLPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mgl.*")
1055 WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*")
1058 if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi
1059 if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi
1060 if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi
1061 if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi
1062 if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi
1063 if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi
1064 if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi
1065 if test "$WX_MGLPORT" != "0"; then WX_PORT="mgl"; fi
1066 if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi
1068 dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac
1069 dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above)
1070 WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*")
1071 if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi
1073 dnl check at least one of the WX_*PORT has been set !
1075 if test "$WX_PORT" = "unknown" ; then
1077 Cannot detect the currently installed wxWidgets port !
1078 Please check your 'wx-config --cxxflags'...
1082 AC_MSG_RESULT([$WX_PORT])
1085 dnl Use the setting given by the user
1086 if test -z "$TOOLKIT" ; then
1096 if test "$WX_DEBUG_CONFIGURE" = "1"; then
1097 echo "[[dbg]] Values of all WX_* options after final detection:"
1098 echo "[[dbg]] WX_DEBUG: $WX_DEBUG"
1099 echo "[[dbg]] WX_UNICODE: $WX_UNICODE"
1100 echo "[[dbg]] WX_SHARED: $WX_SHARED"
1101 echo "[[dbg]] WX_RELEASE: $WX_RELEASE"
1102 echo "[[dbg]] WX_PORT: $WX_PORT"
1105 dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when
1106 dnl the user gives the options:
1107 dnl ./configure --enable-shared --without-wxshared
1109 dnl ./configure --enable-shared
1110 dnl but there is only a static build of wxWidgets available.
1111 if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then
1113 Cannot build shared library against a static build of wxWidgets !
1114 This error happens because the wxWidgets build which was selected
1115 has been detected as static while you asked to build $PACKAGE_NAME
1116 as shared library and this is not possible.
1117 Use the '--disable-shared' option to build $PACKAGE_NAME
1118 as static library or '--with-wxshared' to use wxWidgets as shared library.
1122 dnl now we can finally update the DEBUG,UNICODE,SHARED options
1123 dnl to their final values if they were set to 'auto'
1124 if test "$DEBUG" = "auto"; then
1127 if test "$UNICODE" = "auto"; then
1130 if test "$SHARED" = "auto"; then
1133 if test "$TOOLKIT" = "auto"; then
1137 dnl in case the user needs a BUILD=debug/release var...
1138 if test "$DEBUG" = "1"; then
1140 elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then
1144 dnl respect the DEBUG variable adding the optimize/debug flags
1145 dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we
1146 dnl don't need to set them, too
1147 if test "$DEBUG" = "1"; then
1148 CXXFLAGS="$CXXFLAGS -g -O0"
1149 CFLAGS="$CFLAGS -g -O0"
1151 CXXFLAGS="$CXXFLAGS -O2"
1152 CFLAGS="$CFLAGS -O2"
1156 dnl ---------------------------------------------------------------------------
1157 dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for],
1158 dnl [what to print when var is 1],
1159 dnl [what to print when var is 0])
1161 dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0.
1162 dnl This macro mainly exists just to make configure.ac scripts more readable.
1164 dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments
1165 dnl if you want that m4 avoid to throw away the spaces prefixed to the
1167 dnl ---------------------------------------------------------------------------
1168 AC_DEFUN([WX_BOOLOPT_SUMMARY],
1170 if test "x$$1" = "x1" ; then
1172 elif test "x$$1" = "x0" ; then
1179 dnl ---------------------------------------------------------------------------
1180 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
1182 dnl Shows a summary message to the user about the WX_* variable contents.
1183 dnl This macro is used typically at the end of the configure script.
1184 dnl ---------------------------------------------------------------------------
1185 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG],
1188 echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION"
1189 echo " has the following settings:"
1190 WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"])
1191 WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
1192 WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"])
1193 echo " - VERSION: $WX_VERSION"
1194 echo " - PORT: $WX_PORT"
1198 dnl ---------------------------------------------------------------------------
1199 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1201 dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info
1202 dnl about the configuration of the package which used the wxpresets.
1205 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
1206 dnl echo " - Package setting 1: $SETTING1"
1207 dnl echo " - Package setting 2: $SETTING1"
1209 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1211 dnl ---------------------------------------------------------------------------
1212 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
1215 echo " ----------------------------------------------------------------"
1216 echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed."
1217 echo " Summary of main configuration settings for $PACKAGE_NAME:"
1218 WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"])
1219 WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
1220 WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"])
1223 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
1225 WX_STANDARD_OPTIONS_SUMMARY_MSG
1227 echo " Now, just run make."
1228 echo " ----------------------------------------------------------------"
1233 dnl ---------------------------------------------------------------------------
1234 dnl Deprecated macro wrappers
1235 dnl ---------------------------------------------------------------------------
1237 AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS])
1238 AC_DEFUN([AM_PATH_WXCONFIG], [
1239 WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5])
1241 AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])
1243 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
1246 # This file is free software; the Free Software Foundation
1247 # gives unlimited permission to copy and/or distribute it,
1248 # with or without modifications, as long as this notice is preserved.
1252 # AM_AUTOMAKE_VERSION(VERSION)
1253 # ----------------------------
1254 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1255 # generated from the m4 files accompanying Automake X.Y.
1256 # (This private macro should not be called outside this file.)
1257 AC_DEFUN([AM_AUTOMAKE_VERSION],
1258 [am__api_version='1.11'
1259 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1260 dnl require some minimum version. Point them to the right macro.
1261 m4_if([$1], [1.11.2], [],
1262 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1265 # _AM_AUTOCONF_VERSION(VERSION)
1266 # -----------------------------
1267 # aclocal traces this macro to find the Autoconf version.
1268 # This is a private macro too. Using m4_define simplifies
1269 # the logic in aclocal, which can simply ignore this definition.
1270 m4_define([_AM_AUTOCONF_VERSION], [])
1272 # AM_SET_CURRENT_AUTOMAKE_VERSION
1273 # -------------------------------
1274 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1275 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1276 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1277 [AM_AUTOMAKE_VERSION([1.11.2])dnl
1278 m4_ifndef([AC_AUTOCONF_VERSION],
1279 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1280 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1282 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
1284 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1286 # This file is free software; the Free Software Foundation
1287 # gives unlimited permission to copy and/or distribute it,
1288 # with or without modifications, as long as this notice is preserved.
1292 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1293 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
1294 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1296 # Of course, Automake must honor this variable whenever it calls a
1297 # tool from the auxiliary directory. The problem is that $srcdir (and
1298 # therefore $ac_aux_dir as well) can be either absolute or relative,
1299 # depending on how configure is run. This is pretty annoying, since
1300 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1301 # source directory, any form will work fine, but in subdirectories a
1302 # relative path needs to be adjusted first.
1304 # $ac_aux_dir/missing
1305 # fails when called from a subdirectory if $ac_aux_dir is relative
1306 # $top_srcdir/$ac_aux_dir/missing
1307 # fails if $ac_aux_dir is absolute,
1308 # fails when called from a subdirectory in a VPATH build with
1309 # a relative $ac_aux_dir
1311 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1312 # are both prefixed by $srcdir. In an in-source build this is usually
1313 # harmless because $srcdir is `.', but things will broke when you
1314 # start a VPATH build or use an absolute $srcdir.
1316 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1317 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
1318 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1319 # and then we would define $MISSING as
1320 # MISSING="\${SHELL} $am_aux_dir/missing"
1321 # This will work as long as MISSING is not called from configure, because
1322 # unfortunately $(top_srcdir) has no meaning in configure.
1323 # However there are other variables, like CC, which are often used in
1324 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1326 # Another solution, used here, is to always expand $ac_aux_dir to an
1327 # absolute PATH. The drawback is that using absolute paths prevent a
1328 # configured tree to be moved without reconfiguration.
1330 AC_DEFUN([AM_AUX_DIR_EXPAND],
1331 [dnl Rely on autoconf to set up CDPATH properly.
1332 AC_PREREQ([2.50])dnl
1333 # expand $ac_aux_dir to an absolute path
1334 am_aux_dir=`cd $ac_aux_dir && pwd`
1337 # AM_CONDITIONAL -*- Autoconf -*-
1339 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1340 # Free Software Foundation, Inc.
1342 # This file is free software; the Free Software Foundation
1343 # gives unlimited permission to copy and/or distribute it,
1344 # with or without modifications, as long as this notice is preserved.
1348 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1349 # -------------------------------------
1350 # Define a conditional.
1351 AC_DEFUN([AM_CONDITIONAL],
1353 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1354 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1355 AC_SUBST([$1_TRUE])dnl
1356 AC_SUBST([$1_FALSE])dnl
1357 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1358 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1359 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1367 AC_CONFIG_COMMANDS_PRE(
1368 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1369 AC_MSG_ERROR([[conditional "$1" was never defined.
1370 Usually this means the macro was only invoked conditionally.]])
1373 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
1374 # 2010, 2011 Free Software Foundation, Inc.
1376 # This file is free software; the Free Software Foundation
1377 # gives unlimited permission to copy and/or distribute it,
1378 # with or without modifications, as long as this notice is preserved.
1382 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1383 # written in clear, in which case automake, when reading aclocal.m4,
1384 # will think it sees a *use*, and therefore will trigger all it's
1385 # C support machinery. Also note that it means that autoscan, seeing
1386 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1389 # _AM_DEPENDENCIES(NAME)
1390 # ----------------------
1391 # See how the compiler implements dependency checking.
1392 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1393 # We try a few techniques and use that to set a single cache variable.
1395 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1396 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1397 # dependency, and given that the user is not expected to run this macro,
1398 # just rely on AC_PROG_CC.
1399 AC_DEFUN([_AM_DEPENDENCIES],
1400 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1401 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1402 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1403 AC_REQUIRE([AM_DEP_TRACK])dnl
1405 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
1406 [$1], CXX, [depcc="$CXX" am_compiler_list=],
1407 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1408 [$1], UPC, [depcc="$UPC" am_compiler_list=],
1409 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
1410 [depcc="$$1" am_compiler_list=])
1412 AC_CACHE_CHECK([dependency style of $depcc],
1413 [am_cv_$1_dependencies_compiler_type],
1414 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1415 # We make a subdir and do the tests there. Otherwise we can end up
1416 # making bogus files that we don't know about and never remove. For
1417 # instance it was reported that on HP-UX the gcc test will end up
1418 # making a dummy file named `D' -- because `-MD' means `put the output
1422 # Copy depcomp to subdir because otherwise we won't find it if we're
1423 # using a relative directory.
1424 cp "$am_depcomp" conftest.dir
1426 # We will build objects and dependencies in a subdirectory because
1427 # it helps to detect inapplicable dependency modes. For instance
1428 # both Tru64's cc and ICC support -MD to output dependencies as a
1429 # side effect of compilation, but ICC will put the dependencies in
1430 # the current directory while Tru64 will put them in the object
1434 am_cv_$1_dependencies_compiler_type=none
1435 if test "$am_compiler_list" = ""; then
1436 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1440 [case " $depcc " in #(
1441 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1444 [case " $depcc " in #(
1445 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1448 for depmode in $am_compiler_list; do
1449 # Setup a source with many dependencies, because some compilers
1450 # like to wrap large dependency lists on column 80 (with \), and
1451 # we should not choose a depcomp mode which is confused by this.
1453 # We need to recreate these files for each test, as the compiler may
1454 # overwrite some of them when testing with obscure command lines.
1455 # This happens at least with the AIX C compiler.
1457 for i in 1 2 3 4 5 6; do
1458 echo '#include "conftst'$i'.h"' >> sub/conftest.c
1459 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1460 # Solaris 8's {/usr,}/bin/sh.
1461 touch sub/conftst$i.h
1463 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1465 # We check with `-c' and `-o' for the sake of the "dashmstdout"
1466 # mode. It turns out that the SunPro C++ compiler does not properly
1467 # handle `-M -o', and we need to detect this. Also, some Intel
1468 # versions had trouble with output in subdirs
1469 am__obj=sub/conftest.${OBJEXT-o}
1470 am__minus_obj="-o $am__obj"
1473 # This depmode causes a compiler race in universal mode.
1474 test "$am__universal" = false || continue
1477 # after this tag, mechanisms are not by side-effect, so they'll
1478 # only be used when explicitly requested
1479 if test "x$enable_dependency_tracking" = xyes; then
1485 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1486 # This compiler won't grok `-c -o', but also, the minuso test has
1487 # not run yet. These depmodes are late enough in the game, and
1488 # so weak that their functioning should not be impacted.
1489 am__obj=conftest.${OBJEXT-o}
1494 if depmode=$depmode \
1495 source=sub/conftest.c object=$am__obj \
1496 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1497 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1498 >/dev/null 2>conftest.err &&
1499 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1500 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1501 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1502 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1503 # icc doesn't choke on unknown options, it will just issue warnings
1504 # or remarks (even with -Werror). So we grep stderr for any message
1505 # that says an option was ignored or not supported.
1506 # When given -MP, icc 7.0 and 7.1 complain thusly:
1507 # icc: Command line warning: ignoring option '-M'; no argument required
1508 # The diagnosis changed in icc 8.0:
1509 # icc: Command line remark: option '-MP' not supported
1510 if (grep 'ignoring option' conftest.err ||
1511 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1512 am_cv_$1_dependencies_compiler_type=$depmode
1521 am_cv_$1_dependencies_compiler_type=none
1524 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1525 AM_CONDITIONAL([am__fastdep$1], [
1526 test "x$enable_dependency_tracking" != xno \
1527 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1533 # Choose a directory name for dependency files.
1534 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1535 AC_DEFUN([AM_SET_DEPDIR],
1536 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1537 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1543 AC_DEFUN([AM_DEP_TRACK],
1544 [AC_ARG_ENABLE(dependency-tracking,
1545 [ --disable-dependency-tracking speeds up one-time build
1546 --enable-dependency-tracking do not reject slow dependency extractors])
1547 if test "x$enable_dependency_tracking" != xno; then
1548 am_depcomp="$ac_aux_dir/depcomp"
1552 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1553 AC_SUBST([AMDEPBACKSLASH])dnl
1554 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1555 AC_SUBST([am__nodep])dnl
1556 _AM_SUBST_NOTMAKE([am__nodep])dnl
1559 # Generate code to set up dependency tracking. -*- Autoconf -*-
1561 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1562 # Free Software Foundation, Inc.
1564 # This file is free software; the Free Software Foundation
1565 # gives unlimited permission to copy and/or distribute it,
1566 # with or without modifications, as long as this notice is preserved.
1570 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1571 # ------------------------------
1572 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1574 # Autoconf 2.62 quotes --file arguments for eval, but not when files
1575 # are listed without --file. Let's play safe and only enable the eval
1576 # if we detect the quoting.
1577 case $CONFIG_FILES in
1578 *\'*) eval set x "$CONFIG_FILES" ;;
1579 *) set x $CONFIG_FILES ;;
1584 # Strip MF so we end up with the name of the file.
1585 mf=`echo "$mf" | sed -e 's/:.*$//'`
1586 # Check whether this is an Automake generated Makefile or not.
1587 # We used to match only the files named `Makefile.in', but
1588 # some people rename them; so instead we look at the file content.
1589 # Grep'ing the first line is not enough: some people post-process
1590 # each Makefile.in and add a new line on top of each file to say so.
1591 # Grep'ing the whole file is not good either: AIX grep has a line
1592 # limit of 2048, but all sed's we know have understand at least 4000.
1593 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1594 dirpart=`AS_DIRNAME("$mf")`
1598 # Extract the definition of DEPDIR, am__include, and am__quote
1599 # from the Makefile without running `make'.
1600 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1601 test -z "$DEPDIR" && continue
1602 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1603 test -z "am__include" && continue
1604 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1605 # When using ansi2knr, U may be empty or an underscore; expand it
1606 U=`sed -n 's/^U = //p' < "$mf"`
1607 # Find all dependency output files, they are included files with
1608 # $(DEPDIR) in their names. We invoke sed twice because it is the
1609 # simplest approach to changing $(DEPDIR) to its actual value in the
1611 for file in `sed -n "
1612 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1613 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1614 # Make sure the directory exists.
1615 test -f "$dirpart/$file" && continue
1616 fdir=`AS_DIRNAME(["$file"])`
1617 AS_MKDIR_P([$dirpart/$fdir])
1618 # echo "creating $dirpart/$file"
1619 echo '# dummy' > "$dirpart/$file"
1623 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1626 # AM_OUTPUT_DEPENDENCY_COMMANDS
1627 # -----------------------------
1628 # This macro should only be invoked once -- use via AC_REQUIRE.
1630 # This code is only required when automatic dependency tracking
1631 # is enabled. FIXME. This creates each `.P' file that we will
1632 # need in order to bootstrap the dependency handling code.
1633 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1634 [AC_CONFIG_COMMANDS([depfiles],
1635 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1636 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1639 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1640 # Free Software Foundation, Inc.
1642 # This file is free software; the Free Software Foundation
1643 # gives unlimited permission to copy and/or distribute it,
1644 # with or without modifications, as long as this notice is preserved.
1648 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
1649 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1651 # Do all the work for Automake. -*- Autoconf -*-
1653 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1654 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1656 # This file is free software; the Free Software Foundation
1657 # gives unlimited permission to copy and/or distribute it,
1658 # with or without modifications, as long as this notice is preserved.
1662 # This macro actually does too much. Some checks are only needed if
1663 # your package does certain things. But this isn't really a big deal.
1665 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1666 # AM_INIT_AUTOMAKE([OPTIONS])
1667 # -----------------------------------------------
1668 # The call with PACKAGE and VERSION arguments is the old style
1669 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1670 # and VERSION should now be passed to AC_INIT and removed from
1671 # the call to AM_INIT_AUTOMAKE.
1672 # We support both call styles for the transition. After
1673 # the next Automake release, Autoconf can make the AC_INIT
1674 # arguments mandatory, and then we can depend on a new Autoconf
1675 # release and drop the old call support.
1676 AC_DEFUN([AM_INIT_AUTOMAKE],
1677 [AC_PREREQ([2.62])dnl
1678 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1679 dnl the ones we care about.
1680 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1681 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1682 AC_REQUIRE([AC_PROG_INSTALL])dnl
1683 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1684 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1685 # is not polluted with repeated "-I."
1686 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1687 # test to see if srcdir already configured
1688 if test -f $srcdir/config.status; then
1689 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1693 # test whether we have cygpath
1694 if test -z "$CYGPATH_W"; then
1695 if (cygpath --version) >/dev/null 2>/dev/null; then
1696 CYGPATH_W='cygpath -w'
1701 AC_SUBST([CYGPATH_W])
1703 # Define the identity of the package.
1704 dnl Distinguish between old-style and new-style calls.
1706 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1707 AC_SUBST([PACKAGE], [$1])dnl
1708 AC_SUBST([VERSION], [$2])],
1709 [_AM_SET_OPTIONS([$1])dnl
1710 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1711 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1712 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1713 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1714 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1716 _AM_IF_OPTION([no-define],,
1717 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1718 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1720 # Some tools Automake needs.
1721 AC_REQUIRE([AM_SANITY_CHECK])dnl
1722 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1723 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1724 AM_MISSING_PROG(AUTOCONF, autoconf)
1725 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1726 AM_MISSING_PROG(AUTOHEADER, autoheader)
1727 AM_MISSING_PROG(MAKEINFO, makeinfo)
1728 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1729 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1730 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1731 # We need awk for the "check" target. The system "awk" is bad on
1733 AC_REQUIRE([AC_PROG_AWK])dnl
1734 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1735 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1736 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1737 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1738 [_AM_PROG_TAR([v7])])])
1739 _AM_IF_OPTION([no-dependencies],,
1740 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1741 [_AM_DEPENDENCIES(CC)],
1742 [define([AC_PROG_CC],
1743 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1744 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1745 [_AM_DEPENDENCIES(CXX)],
1746 [define([AC_PROG_CXX],
1747 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1748 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1749 [_AM_DEPENDENCIES(OBJC)],
1750 [define([AC_PROG_OBJC],
1751 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1753 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1754 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1755 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
1756 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1757 AC_CONFIG_COMMANDS_PRE(dnl
1758 [m4_provide_if([_AM_COMPILER_EXEEXT],
1759 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1762 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
1763 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1764 dnl mangled by Autoconf and run in a shell conditional statement.
1765 m4_define([_AC_COMPILER_EXEEXT],
1766 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1769 # When config.status generates a header, we must update the stamp-h file.
1770 # This file resides in the same directory as the config header
1771 # that is generated. The stamp files are numbered to have different names.
1773 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1774 # loop where config.status creates the headers, so we can generate
1775 # our stamp files there.
1776 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1777 [# Compute $1's index in $config_headers.
1780 for _am_header in $config_headers :; do
1782 $_am_arg | $_am_arg:* )
1785 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1788 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1790 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
1793 # This file is free software; the Free Software Foundation
1794 # gives unlimited permission to copy and/or distribute it,
1795 # with or without modifications, as long as this notice is preserved.
1799 # AM_PROG_INSTALL_SH
1800 # ------------------
1801 # Define $install_sh.
1802 AC_DEFUN([AM_PROG_INSTALL_SH],
1803 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1804 if test x"${install_sh}" != xset; then
1807 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1809 install_sh="\${SHELL} $am_aux_dir/install-sh"
1812 AC_SUBST(install_sh)])
1814 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
1816 # This file is free software; the Free Software Foundation
1817 # gives unlimited permission to copy and/or distribute it,
1818 # with or without modifications, as long as this notice is preserved.
1822 # Check whether the underlying file-system supports filenames
1823 # with a leading dot. For instance MS-DOS doesn't.
1824 AC_DEFUN([AM_SET_LEADING_DOT],
1825 [rm -rf .tst 2>/dev/null
1826 mkdir .tst 2>/dev/null
1827 if test -d .tst; then
1832 rmdir .tst 2>/dev/null
1833 AC_SUBST([am__leading_dot])])
1835 # Check to see how 'make' treats includes. -*- Autoconf -*-
1837 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
1839 # This file is free software; the Free Software Foundation
1840 # gives unlimited permission to copy and/or distribute it,
1841 # with or without modifications, as long as this notice is preserved.
1847 # Check to see how make treats includes.
1848 AC_DEFUN([AM_MAKE_INCLUDE],
1849 [am_make=${MAKE-make}
1850 cat > confinc << 'END'
1852 @echo this is the am__doit target
1855 # If we don't find an include directive, just comment out the code.
1856 AC_MSG_CHECKING([for style of include used by $am_make])
1860 # First try GNU make style include.
1861 echo "include confinc" > confmf
1862 # Ignore all kinds of additional output from `make'.
1863 case `$am_make -s -f confmf 2> /dev/null` in #(
1864 *the\ am__doit\ target*)
1870 # Now try BSD make style include.
1871 if test "$am__include" = "#"; then
1872 echo '.include "confinc"' > confmf
1873 case `$am_make -s -f confmf 2> /dev/null` in #(
1874 *the\ am__doit\ target*)
1875 am__include=.include
1881 AC_SUBST([am__include])
1882 AC_SUBST([am__quote])
1883 AC_MSG_RESULT([$_am_result])
1884 rm -f confinc confmf
1887 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
1889 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1890 # Free Software Foundation, Inc.
1892 # This file is free software; the Free Software Foundation
1893 # gives unlimited permission to copy and/or distribute it,
1894 # with or without modifications, as long as this notice is preserved.
1898 # AM_MISSING_PROG(NAME, PROGRAM)
1899 # ------------------------------
1900 AC_DEFUN([AM_MISSING_PROG],
1901 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1902 $1=${$1-"${am_missing_run}$2"}
1906 # AM_MISSING_HAS_RUN
1907 # ------------------
1908 # Define MISSING if not defined so far and test if it supports --run.
1909 # If it does, set am_missing_run to use it, otherwise, to nothing.
1910 AC_DEFUN([AM_MISSING_HAS_RUN],
1911 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1912 AC_REQUIRE_AUX_FILE([missing])dnl
1913 if test x"${MISSING+set}" != xset; then
1916 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1918 MISSING="\${SHELL} $am_aux_dir/missing" ;;
1921 # Use eval to expand $SHELL
1922 if eval "$MISSING --run true"; then
1923 am_missing_run="$MISSING --run "
1926 AC_MSG_WARN([`missing' script is too old or missing])
1930 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
1933 # This file is free software; the Free Software Foundation
1934 # gives unlimited permission to copy and/or distribute it,
1935 # with or without modifications, as long as this notice is preserved.
1941 # Check for `mkdir -p'.
1942 AC_DEFUN([AM_PROG_MKDIR_P],
1943 [AC_PREREQ([2.60])dnl
1944 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1945 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
1946 dnl while keeping a definition of mkdir_p for backward compatibility.
1947 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1948 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1949 dnl Makefile.ins that do not define MKDIR_P, so we do our own
1950 dnl adjustment using top_builddir (which is defined more often than
1952 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1954 [[\\/$]]* | ?:[[\\/]]*) ;;
1955 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1959 # Helper functions for option handling. -*- Autoconf -*-
1961 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
1964 # This file is free software; the Free Software Foundation
1965 # gives unlimited permission to copy and/or distribute it,
1966 # with or without modifications, as long as this notice is preserved.
1970 # _AM_MANGLE_OPTION(NAME)
1971 # -----------------------
1972 AC_DEFUN([_AM_MANGLE_OPTION],
1973 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1975 # _AM_SET_OPTION(NAME)
1976 # --------------------
1977 # Set option NAME. Presently that only means defining a flag for this option.
1978 AC_DEFUN([_AM_SET_OPTION],
1979 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1981 # _AM_SET_OPTIONS(OPTIONS)
1982 # ------------------------
1983 # OPTIONS is a space-separated list of Automake options.
1984 AC_DEFUN([_AM_SET_OPTIONS],
1985 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1987 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1988 # -------------------------------------------
1989 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1990 AC_DEFUN([_AM_IF_OPTION],
1991 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1993 # Check to make sure that the build environment is sane. -*- Autoconf -*-
1995 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1996 # Free Software Foundation, Inc.
1998 # This file is free software; the Free Software Foundation
1999 # gives unlimited permission to copy and/or distribute it,
2000 # with or without modifications, as long as this notice is preserved.
2006 AC_DEFUN([AM_SANITY_CHECK],
2007 [AC_MSG_CHECKING([whether build environment is sane])
2010 echo timestamp > conftest.file
2011 # Reject unsafe characters in $srcdir or the absolute working directory
2012 # name. Accept space and tab only in the latter.
2016 *[[\\\"\#\$\&\'\`$am_lf]]*)
2017 AC_MSG_ERROR([unsafe absolute working directory name]);;
2020 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
2021 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2024 # Do `set' in a subshell so we don't clobber the current shell's
2025 # arguments. Must try -L first in case configure is actually a
2026 # symlink; some systems play weird games with the mod time of symlinks
2027 # (eg FreeBSD returns the mod time of the symlink's containing
2030 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2031 if test "$[*]" = "X"; then
2033 set X `ls -t "$srcdir/configure" conftest.file`
2036 if test "$[*]" != "X $srcdir/configure conftest.file" \
2037 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2039 # If neither matched, then we have a broken ls. This can happen
2040 # if, for instance, CONFIG_SHELL is bash and it inherits a
2041 # broken ls alias from the environment. This has actually
2042 # happened. Such a system could not be considered "sane".
2043 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2044 alias in your environment])
2047 test "$[2]" = conftest.file
2053 AC_MSG_ERROR([newly created file is older than distributed files!
2054 Check your system clock])
2056 AC_MSG_RESULT(yes)])
2058 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
2060 # This file is free software; the Free Software Foundation
2061 # gives unlimited permission to copy and/or distribute it,
2062 # with or without modifications, as long as this notice is preserved.
2066 # AM_PROG_INSTALL_STRIP
2067 # ---------------------
2068 # One issue with vendor `install' (even GNU) is that you can't
2069 # specify the program used to strip binaries. This is especially
2070 # annoying in cross-compiling environments, where the build's strip
2071 # is unlikely to handle the host's binaries.
2072 # Fortunately install-sh will honor a STRIPPROG variable, so we
2073 # always use install-sh in `make install-strip', and initialize
2074 # STRIPPROG with the value of the STRIP variable (set by the user).
2075 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2076 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2077 # Installed binaries are usually stripped using `strip' when the user
2078 # run `make install-strip'. However `strip' might not be the right
2079 # tool to use in cross-compilation environments, therefore Automake
2080 # will honor the `STRIP' environment variable to overrule this program.
2081 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2082 if test "$cross_compiling" != no; then
2083 AC_CHECK_TOOL([STRIP], [strip], :)
2085 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2086 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2088 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
2090 # This file is free software; the Free Software Foundation
2091 # gives unlimited permission to copy and/or distribute it,
2092 # with or without modifications, as long as this notice is preserved.
2096 # _AM_SUBST_NOTMAKE(VARIABLE)
2097 # ---------------------------
2098 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2099 # This macro is traced by Automake.
2100 AC_DEFUN([_AM_SUBST_NOTMAKE])
2102 # AM_SUBST_NOTMAKE(VARIABLE)
2103 # --------------------------
2104 # Public sister of _AM_SUBST_NOTMAKE.
2105 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2107 # Check how to create a tarball. -*- Autoconf -*-
2109 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
2111 # This file is free software; the Free Software Foundation
2112 # gives unlimited permission to copy and/or distribute it,
2113 # with or without modifications, as long as this notice is preserved.
2117 # _AM_PROG_TAR(FORMAT)
2118 # --------------------
2119 # Check how to create a tarball in format FORMAT.
2120 # FORMAT should be one of `v7', `ustar', or `pax'.
2122 # Substitute a variable $(am__tar) that is a command
2123 # writing to stdout a FORMAT-tarball containing the directory
2125 # tardir=directory && $(am__tar) > result.tar
2127 # Substitute a variable $(am__untar) that extract such
2128 # a tarball read from stdin.
2129 # $(am__untar) < result.tar
2130 AC_DEFUN([_AM_PROG_TAR],
2131 [# Always define AMTAR for backward compatibility.
2132 AM_MISSING_PROG([AMTAR], [tar])
2134 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2135 [m4_case([$1], [ustar],, [pax],,
2136 [m4_fatal([Unknown tar format])])
2137 AC_MSG_CHECKING([how to create a $1 tar archive])
2138 # Loop over all known methods to create a tar archive until one works.
2139 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2140 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2141 # Do not fold the above two line into one, because Tru64 sh and
2142 # Solaris sh will not grok spaces in the rhs of `-'.
2143 for _am_tool in $_am_tools
2147 for _am_tar in tar gnutar gtar;
2149 AM_RUN_LOG([$_am_tar --version]) && break
2151 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2152 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2153 am__untar="$_am_tar -xf -"
2156 # Must skip GNU tar: if it does not support --format= it doesn't create
2157 # ustar tarball either.
2158 (tar --version) >/dev/null 2>&1 && continue
2159 am__tar='tar chf - "$$tardir"'
2160 am__tar_='tar chf - "$tardir"'
2161 am__untar='tar xf -'
2164 am__tar='pax -L -x $1 -w "$$tardir"'
2165 am__tar_='pax -L -x $1 -w "$tardir"'
2169 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2170 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2171 am__untar='cpio -i -H $1 -d'
2180 # If the value was cached, stop now. We just wanted to have am__tar
2181 # and am__untar set.
2182 test -n "${am_cv_prog_tar_$1}" && break
2184 # tar/untar a dummy directory, and stop if the command works
2187 echo GrepMe > conftest.dir/file
2188 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2190 if test -s conftest.tar; then
2191 AM_RUN_LOG([$am__untar <conftest.tar])
2192 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2197 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2198 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2200 AC_SUBST([am__untar])