OSDN Git Service

イニシャルコミット。
[marathon/ShapeFusion.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.2 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5 # Inc.
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.
9
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
13 # PARTICULAR PURPOSE.
14
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'.])])
22
23 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
24
25 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26 #
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.
31 #
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.
36 #
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.
40 #
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.
45
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])
54 fi
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
59                 AC_MSG_RESULT([yes])
60         else
61                 AC_MSG_RESULT([no])
62                 PKG_CONFIG=""
63         fi
64                 
65 fi[]dnl
66 ])# PKG_PROG_PKG_CONFIG
67
68 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
69 #
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.
72 #
73 #
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], [:])
83 m4_ifvaln([$3], [else
84   $3])dnl
85 fi])
86
87
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
93         pkg_cv_[]$1="$$1"
94     else
95         PKG_CHECK_EXISTS([$3],
96                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
97                          [pkg_failed=yes])
98     fi
99 else
100         pkg_failed=untried
101 fi[]dnl
102 ])# _PKG_CONFIG
103
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
110 else
111         _pkg_short_errors_supported=no
112 fi[]dnl
113 ])# _PKG_SHORT_ERRORS_SUPPORTED
114
115
116 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
117 # [ACTION-IF-NOT-FOUND])
118 #
119 #
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
123 #
124 #
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
130
131 pkg_failed=no
132 AC_MSG_CHECKING([for $1])
133
134 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
135 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
136
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.])
140
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"`
145         else 
146                 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
147         fi
148         # Put the nasty error message in config.log where it belongs
149         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150
151         ifelse([$4], , [AC_MSG_ERROR(dnl
152 [Package requirements ($2) were not met:
153
154 $$1_PKG_ERRORS
155
156 Consider adjusting the PKG_CONFIG_PATH environment variable if you
157 installed software in a non-standard prefix.
158
159 _PKG_TEXT
160 ])],
161                 [$4])
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
166 path to pkg-config.
167
168 _PKG_TEXT
169
170 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
171                 [$4])
172 else
173         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175         AC_MSG_RESULT([yes])
176         ifelse([$3], , :, [$3])
177 fi[]dnl
178 ])# PKG_CHECK_MODULES
179
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
185 dnl RCS-ID:          $Id$
186 dnl ---------------------------------------------------------------------------
187
188 dnl ===========================================================================
189 dnl Table of Contents of this macro file:
190 dnl -------------------------------------
191 dnl
192 dnl SECTION A: wxWidgets main macros
193 dnl  - WX_CONFIG_OPTIONS
194 dnl  - WX_CONFIG_CHECK
195 dnl  - WXRC_CHECK
196 dnl  - WX_STANDARD_OPTIONS
197 dnl  - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
198 dnl  - WX_DETECT_STANDARD_OPTION_VALUES
199 dnl
200 dnl SECTION B: wxWidgets-related utilities
201 dnl  - WX_LIKE_LIBNAME
202 dnl  - WX_ARG_ENABLE_YESNOAUTO
203 dnl  - WX_ARG_WITH_YESNOAUTO
204 dnl
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
210 dnl
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 ===========================================================================
214
215
216 dnl ---------------------------------------------------------------------------
217 dnl Macros for wxWidgets detection. Typically used in configure.in as:
218 dnl
219 dnl     AC_ARG_ENABLE(...)
220 dnl     AC_ARG_WITH(...)
221 dnl        ...
222 dnl     WX_CONFIG_OPTIONS
223 dnl        ...
224 dnl        ...
225 dnl     WX_CONFIG_CHECK([2.6.0], [wxWin=1])
226 dnl     if test "$wxWin" != 1; then
227 dnl        AC_MSG_ERROR([
228 dnl                wxWidgets must be installed on your system
229 dnl                but wx-config script couldn't be found.
230 dnl
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.
235 dnl        ])
236 dnl     fi
237 dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
238 dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
239 dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
240 dnl
241 dnl     LIBS="$LIBS $WX_LIBS"
242 dnl
243 dnl If you want to support standard --enable-debug/unicode/shared options, you
244 dnl may do the following:
245 dnl
246 dnl     ...
247 dnl     AC_CANONICAL_SYSTEM
248 dnl
249 dnl     # define configure options
250 dnl     WX_CONFIG_OPTIONS
251 dnl     WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
252 dnl
253 dnl     # basic configure checks
254 dnl     ...
255 dnl
256 dnl     # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
257 dnl     WX_DEBUG=$DEBUG
258 dnl     WX_UNICODE=$UNICODE
259 dnl
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
263 dnl
264 dnl     # write the output files
265 dnl     AC_CONFIG_FILES([Makefile ...])
266 dnl     AC_OUTPUT
267 dnl
268 dnl     # optional: just to show a message to the user
269 dnl     WX_STANDARD_OPTIONS_SUMMARY_MSG
270 dnl
271 dnl ---------------------------------------------------------------------------
272
273
274 dnl ---------------------------------------------------------------------------
275 dnl WX_CONFIG_OPTIONS
276 dnl
277 dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
278 dnl --wx-config command line options
279 dnl ---------------------------------------------------------------------------
280
281 AC_DEFUN([WX_CONFIG_OPTIONS],
282 [
283     AC_ARG_WITH(wxdir,
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="")
297 ])
298
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],
302 [
303     wx_ver_ok=""
304     if test "x$WX_VERSION" != x ; then
305       if test $wx_config_major_version -gt $1; then
306         wx_ver_ok=yes
307       else
308         if test $wx_config_major_version -eq $1; then
309            if test $wx_config_minor_version -gt $2; then
310               wx_ver_ok=yes
311            else
312               if test $wx_config_minor_version -eq $2; then
313                  if test $wx_config_micro_version -ge $3; then
314                     wx_ver_ok=yes
315                  fi
316               fi
317            fi
318         fi
319       fi
320     fi
321 ])
322
323 dnl ---------------------------------------------------------------------------
324 dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
325 dnl                  [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
326 dnl
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.
332 dnl
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.
337 dnl
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.
341 dnl
342 dnl Example use:
343 dnl   WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
344 dnl                    [--unicode --debug])
345 dnl ---------------------------------------------------------------------------
346
347 dnl
348 dnl Get the cflags and libraries from the wx-config script
349 dnl
350 AC_DEFUN([WX_CONFIG_CHECK],
351 [
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
355   fi
356
357   if test "x$wx_config_name" != x ; then
358      WX_CONFIG_NAME="$wx_config_name"
359   fi
360
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"
365   fi
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"
369   fi
370   if test "$cross_compiling" = "yes"; then
371      wx_config_args="$wx_config_args --host=$host_alias"
372   fi
373
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)
379   else
380      AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
381   fi
382
383   if test "$WX_CONFIG_PATH" != "no" ; then
384     WX_VERSION=""
385
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])
389     else
390       AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
391     fi
392
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"
396
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/'`
404
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/'`
411
412     _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
413                               [$wx_requested_minor_version],
414                               [$wx_requested_micro_version])
415
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`
419
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
427         AC_MSG_RESULT(no)
428       else
429         AC_MSG_RESULT(yes)
430       fi
431
432       dnl starting with version 2.2.6 wx-config has --cppflags argument
433       wx_has_cppflags=""
434       if test $wx_config_major_version -gt 2; then
435         wx_has_cppflags=yes
436       else
437         if test $wx_config_major_version -eq 2; then
438            if test $wx_config_minor_version -gt 2; then
439               wx_has_cppflags=yes
440            else
441               if test $wx_config_minor_version -eq 2; then
442                  if test $wx_config_micro_version -ge 6; then
443                     wx_has_cppflags=yes
444                  fi
445               fi
446            fi
447         fi
448       fi
449
450       dnl starting with version 2.7.0 wx-config has --rescomp option
451       wx_has_rescomp=""
452       if test $wx_config_major_version -gt 2; then
453         wx_has_rescomp=yes
454       else
455         if test $wx_config_major_version -eq 2; then
456            if test $wx_config_minor_version -ge 7; then
457               wx_has_rescomp=yes
458            fi
459         fi
460       fi
461       if test "x$wx_has_rescomp" = x ; then
462          dnl cannot give any useful info for resource compiler
463          WX_RESCOMP=
464       else
465          WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
466       fi
467
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
473
474          WX_CFLAGS_ONLY=$WX_CFLAGS
475          WX_CXXFLAGS_ONLY=$WX_CFLAGS
476       else
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`
481
482          WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
483          WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
484       fi
485
486       ifelse([$2], , :, [$2])
487
488     else
489
490        if test "x$WX_VERSION" = x; then
491           dnl no wx-config at all
492           AC_MSG_RESULT(no)
493        else
494           AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
495        fi
496
497        WX_CFLAGS=""
498        WX_CPPFLAGS=""
499        WX_CXXFLAGS=""
500        WX_LIBS=""
501        WX_LIBS_STATIC=""
502        WX_RESCOMP=""
503
504        if test ! -z "$5"; then
505
506           wx_error_message="
507     The configuration you asked for $PACKAGE_NAME requires a wxWidgets
508     build with the following settings:
509         $5
510     but such build is not available.
511
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'
515     default values."
516
517        fi
518
519        wx_error_message="
520     The requested wxWidgets build couldn't be found.
521     $wx_error_message
522
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."
527
528        ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3])
529
530     fi
531   else
532
533     WX_CFLAGS=""
534     WX_CPPFLAGS=""
535     WX_CXXFLAGS=""
536     WX_LIBS=""
537     WX_LIBS_STATIC=""
538     WX_RESCOMP=""
539
540     ifelse([$3], , :, [$3])
541
542   fi
543
544   AC_SUBST(WX_CPPFLAGS)
545   AC_SUBST(WX_CFLAGS)
546   AC_SUBST(WX_CXXFLAGS)
547   AC_SUBST(WX_CFLAGS_ONLY)
548   AC_SUBST(WX_CXXFLAGS_ONLY)
549   AC_SUBST(WX_LIBS)
550   AC_SUBST(WX_LIBS_STATIC)
551   AC_SUBST(WX_VERSION)
552   AC_SUBST(WX_RESCOMP)
553
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)
562 ])
563
564 dnl ---------------------------------------------------------------------------
565 dnl Get information on the wxrc program for making C++, Python and xrs
566 dnl resource files.
567 dnl
568 dnl     AC_ARG_ENABLE(...)
569 dnl     AC_ARG_WITH(...)
570 dnl        ...
571 dnl     WX_CONFIG_OPTIONS
572 dnl        ...
573 dnl     WX_CONFIG_CHECK(2.6.0, wxWin=1)
574 dnl     if test "$wxWin" != 1; then
575 dnl        AC_MSG_ERROR([
576 dnl                wxWidgets must be installed on your system
577 dnl                but wx-config script couldn't be found.
578 dnl
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.
583 dnl        ])
584 dnl     fi
585 dnl
586 dnl     WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
587 dnl     if test "x$HAVE_WXRC" != x1; then
588 dnl         AC_MSG_ERROR([
589 dnl                The wxrc program was not installed or not found.
590 dnl
591 dnl                Please check the wxWidgets installation.
592 dnl         ])
593 dnl     fi
594 dnl
595 dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
596 dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
597 dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
598 dnl
599 dnl     LDFLAGS="$LDFLAGS $WX_LIBS"
600 dnl ---------------------------------------------------------------------------
601
602 dnl ---------------------------------------------------------------------------
603 dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
604 dnl
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.
608 dnl
609 dnl Example use:
610 dnl   WXRC_CHECK([wxrc=1], [wxrc=0])
611 dnl ---------------------------------------------------------------------------
612
613 dnl
614 dnl wxrc program from the wx-config script
615 dnl
616 AC_DEFUN([WXRC_CHECK],
617 [
618   AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
619
620   if test "x$WX_CONFIG_NAME" = x; then
621     AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
622   else
623
624     AC_MSG_CHECKING([for wxrc])
625
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`
631       fi
632     fi
633
634     if test "x$WXRC" = x ; then
635       AC_MSG_RESULT([not found])
636       ifelse([$2], , :, [$2])
637     else
638       AC_MSG_RESULT([$WXRC])
639       ifelse([$1], , :, [$1])
640     fi
641
642     AC_SUBST(WXRC)
643   fi
644 ])
645
646 dnl ---------------------------------------------------------------------------
647 dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
648 dnl
649 dnl Sets the "output-var" variable to the name of a library named with same
650 dnl wxWidgets rule.
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],
657     [
658         wx_temp="$2""_""$WX_PORT"
659
660         dnl add the [u][d] string
661         if test "$WX_UNICODE" = "1"; then
662             wx_temp="$wx_temp""u"
663         fi
664         if test "$WX_DEBUG" = "1"; then
665             wx_temp="$wx_temp""d"
666         fi
667
668         dnl complete the name of the lib
669         wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR"
670
671         dnl save it in the user's variable
672         $1=$wx_temp
673     ])
674
675 dnl ---------------------------------------------------------------------------
676 dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
677 dnl
678 dnl Two little custom macros which define the ENABLE/WITH configure arguments.
679 dnl Macro 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],
687          [AC_ARG_ENABLE($1,
688             AC_HELP_STRING([--enable-$1], [$3 (default is $4)]),
689             [], [enableval="$4"])
690
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
694                 AC_MSG_RESULT([yes])
695                 $2=1
696                 $5
697             elif test "$enableval" = "no" ; then
698                 AC_MSG_RESULT([no])
699                 $2=0
700             elif test "$enableval" = "auto" ; then
701                 AC_MSG_RESULT([will be automatically detected])
702                 $2="auto"
703             else
704                 AC_MSG_ERROR([
705     Unrecognized option value (allowed values: yes, no, auto)
706                 ])
707             fi
708          ])
709
710 AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
711          [AC_ARG_WITH($1,
712             AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
713             [], [withval="$4"])
714
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
718                 AC_MSG_RESULT([yes])
719                 $2=1
720                 $5
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
724                 AC_MSG_RESULT([no])
725                 $2=0
726             elif test "$withval" = "auto" ; then
727                 AC_MSG_RESULT([will be automatically detected])
728                 $2="auto"
729             else
730                 AC_MSG_ERROR([
731     Unrecognized option value (allowed values: yes, auto)
732                 ])
733             fi
734          ])
735
736
737 dnl ---------------------------------------------------------------------------
738 dnl WX_STANDARD_OPTIONS([options-to-add])
739 dnl
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]
743 dnl   --with-wxversion
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.
746 dnl
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],
752         [
753
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.
756
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])])
760
761         ifelse(index([$1], [unicode]), [-1],,
762                [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])])
763
764         ifelse(regexp([$1], [\bshared]), [-1],,
765                [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])])
766
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],,
770                [
771                 AC_ARG_WITH([toolkit],
772                             AC_HELP_STRING([--with-toolkit],
773                                            [Build against a specific wxWidgets toolkit (default is auto)]),
774                             [], [withval="auto"])
775
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])
780                     TOOLKIT="auto"
781                 else
782                     TOOLKIT="$withval"
783
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
789                         AC_MSG_ERROR([
790     Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, x11, mac, mgl, dfb)
791                         ])
792                     fi
793
794                     AC_MSG_RESULT([$TOOLKIT])
795                 fi
796                ])
797
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.
802         dnl
803         dnl      ./configure --disable-shared --with-wxshared
804         dnl
805         dnl   will build your library in static mode against the first available
806         dnl   shared build of wxWidgets.
807         dnl
808         dnl   Note that's not possible to do the viceversa:
809         dnl
810         dnl      ./configure --enable-shared --without-wxshared
811         dnl
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).
816         dnl
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 ************************
821
822         ifelse(index([$1], [wxshared]), [-1],,
823                [
824                 WX_ARG_WITH_YESNOAUTO(
825                     [wxshared], [WX_SHARED],
826                     [Force building against a shared build of wxWidgets, even if --disable-shared is given],
827                     [auto], [], [1])
828                ])
829
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],,
834                [
835                 WX_ARG_WITH_YESNOAUTO(
836                     [wxdebug], [WX_DEBUG],
837                     [Force building against a debug build of wxWidgets, even if --disable-debug is given],
838                     [auto], [], [1])
839                ])
840
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],,
844                [
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"])
849
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])
854                     WX_RELEASE="auto"
855                 else
856
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/'`
861
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
865                         AC_MSG_ERROR([
866     Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0)
867                         ])
868                     fi
869
870                     WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version"
871                     AC_MSG_RESULT([$WX_RELEASE])
872                 fi
873                ])
874
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"
881         fi
882     ])
883
884
885 dnl ---------------------------------------------------------------------------
886 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
887 dnl
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],
893         [
894         if test "$WX_SHARED" = "1" ; then
895             WXCONFIG_FLAGS="--static=no "
896         elif test "$WX_SHARED" = "0" ; then
897             WXCONFIG_FLAGS="--static=yes "
898         fi
899
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 "
904         fi
905
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 "
911         fi
912
913         if test "$TOOLKIT" != "auto" ; then
914             WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
915         fi
916
917         if test "$WX_RELEASE" != "auto" ; then
918             WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
919         fi
920
921         dnl strip out the last space of the string
922         WXCONFIG_FLAGS=${WXCONFIG_FLAGS% }
923
924         if test "$WX_DEBUG_CONFIGURE" = "1"; then
925             echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS"
926         fi
927     ])
928
929
930 dnl ---------------------------------------------------------------------------
931 dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
932 dnl                             [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
933 dnl
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],
939         [
940         if test "$$1" = "auto" ; then
941
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])
945
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.*")
951
952             if test "$WX_$1" != "0"; then
953                 WX_$1=1
954                 AC_MSG_RESULT([yes])
955                 ifelse([$4], , :, [$4])
956             else
957                 WX_$1=0
958                 AC_MSG_RESULT([no])
959                 ifelse([$5], , :, [$5])
960             fi
961         else
962
963             dnl Use the setting given by the user
964             WX_$1=$$1
965         fi
966     ])
967
968 dnl ---------------------------------------------------------------------------
969 dnl WX_DETECT_STANDARD_OPTION_VALUES
970 dnl
971 dnl Detects the values of the following variables:
972 dnl 1) WX_RELEASE
973 dnl 2) WX_UNICODE
974 dnl 3) WX_DEBUG
975 dnl 4) WX_SHARED    (and also WX_STATIC)
976 dnl 5) WX_PORT
977 dnl from the previously selected wxWidgets build; this macro in fact must be
978 dnl called *after* calling the WX_CONFIG_CHECK macro.
979 dnl
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],
984         [
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
989
990             AC_MSG_ERROR([
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.
994                          ])
995         fi
996
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)
1000
1001         if test "$WX_DEBUG_CONFIGURE" = "1"; then
1002             echo "[[dbg]] Using wx-config --selected-config"
1003             echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
1004         fi
1005
1006
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
1014             STATIC=0
1015         elif test $WX_SHARED = "0"; then
1016             STATIC=1
1017         elif test $WX_SHARED = "auto"; then
1018             STATIC="auto"
1019         fi
1020
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])
1028
1029         dnl init WX_SHARED from WX_STATIC
1030         if test "$WX_STATIC" != "0"; then
1031             WX_SHARED=0
1032         else
1033             WX_SHARED=1
1034         fi
1035
1036         AC_SUBST(WX_UNICODE)
1037         AC_SUBST(WX_DEBUG)
1038         AC_SUBST(WX_SHARED)
1039
1040         dnl detect the WX_PORT to use
1041         if test "$TOOLKIT" = "auto" ; then
1042
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])
1046
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.*")
1056
1057             WX_PORT="unknown"
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
1067
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
1072
1073             dnl check at least one of the WX_*PORT has been set !
1074
1075             if test "$WX_PORT" = "unknown" ; then
1076                 AC_MSG_ERROR([
1077         Cannot detect the currently installed wxWidgets port !
1078         Please check your 'wx-config --cxxflags'...
1079                             ])
1080             fi
1081
1082             AC_MSG_RESULT([$WX_PORT])
1083         else
1084
1085             dnl Use the setting given by the user
1086             if test -z "$TOOLKIT" ; then
1087                 WX_PORT=$TOOLKIT
1088             else
1089                 dnl try with PORT
1090                 WX_PORT=$PORT
1091             fi
1092         fi
1093
1094         AC_SUBST(WX_PORT)
1095
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"
1103         fi
1104
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
1108         dnl or just do
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
1112             AC_MSG_ERROR([
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.
1119                          ])
1120         fi
1121
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
1125             DEBUG=$WX_DEBUG
1126         fi
1127         if test "$UNICODE" = "auto"; then
1128             UNICODE=$WX_UNICODE
1129         fi
1130         if test "$SHARED" = "auto"; then
1131             SHARED=$WX_SHARED
1132         fi
1133         if test "$TOOLKIT" = "auto"; then
1134             TOOLKIT=$WX_PORT
1135         fi
1136
1137         dnl in case the user needs a BUILD=debug/release var...
1138         if test "$DEBUG" = "1"; then
1139             BUILD="debug"
1140         elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then
1141             BUILD="release"
1142         fi
1143
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"
1150         else
1151             CXXFLAGS="$CXXFLAGS -O2"
1152             CFLAGS="$CFLAGS -O2"
1153         fi
1154     ])
1155
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])
1160 dnl
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.
1163 dnl
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
1166 dnl       argument value.
1167 dnl ---------------------------------------------------------------------------
1168 AC_DEFUN([WX_BOOLOPT_SUMMARY],
1169         [
1170         if test "x$$1" = "x1" ; then
1171             echo $2
1172         elif test "x$$1" = "x0" ; then
1173             echo $3
1174         else
1175             echo "$1 is $$1"
1176         fi
1177     ])
1178
1179 dnl ---------------------------------------------------------------------------
1180 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
1181 dnl
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],
1186         [
1187         echo
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"
1195     ])
1196
1197
1198 dnl ---------------------------------------------------------------------------
1199 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1200 dnl
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.
1203 dnl
1204 dnl Typical usage:
1205 dnl    WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
1206 dnl    echo "   - Package setting 1: $SETTING1"
1207 dnl    echo "   - Package setting 2: $SETTING1"
1208 dnl    ...
1209 dnl    WX_STANDARD_OPTIONS_SUMMARY_MSG_END
1210 dnl
1211 dnl ---------------------------------------------------------------------------
1212 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
1213         [
1214         echo
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"])
1221     ])
1222
1223 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
1224         [
1225         WX_STANDARD_OPTIONS_SUMMARY_MSG
1226         echo
1227         echo "  Now, just run make."
1228         echo " ----------------------------------------------------------------"
1229         echo
1230     ])
1231
1232
1233 dnl ---------------------------------------------------------------------------
1234 dnl Deprecated macro wrappers
1235 dnl ---------------------------------------------------------------------------
1236
1237 AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS])
1238 AC_DEFUN([AM_PATH_WXCONFIG], [
1239     WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5])
1240 ])
1241 AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])
1242
1243 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
1244 # Foundation, Inc.
1245 #
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.
1249
1250 # serial 1
1251
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
1263 ])
1264
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], [])
1271
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]))])
1281
1282 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1283
1284 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1285 #
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.
1289
1290 # serial 1
1291
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/../..'.
1295 #
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.
1303 #
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
1310 #
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.
1315 #
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.
1325 #
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.
1329
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`
1335 ])
1336
1337 # AM_CONDITIONAL                                            -*- Autoconf -*-
1338
1339 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1340 # Free Software Foundation, Inc.
1341 #
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.
1345
1346 # serial 9
1347
1348 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1349 # -------------------------------------
1350 # Define a conditional.
1351 AC_DEFUN([AM_CONDITIONAL],
1352 [AC_PREREQ(2.52)dnl
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
1360 if $2; then
1361   $1_TRUE=
1362   $1_FALSE='#'
1363 else
1364   $1_TRUE='#'
1365   $1_FALSE=
1366 fi
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.]])
1371 fi])])
1372
1373 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
1374 # 2010, 2011 Free Software Foundation, Inc.
1375 #
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.
1379
1380 # serial 12
1381
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...
1387
1388
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.
1394 #
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
1404
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=])
1411
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
1419   # in D'.
1420   rm -rf conftest.dir
1421   mkdir conftest.dir
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
1425   cd 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
1431   # directory.
1432   mkdir sub
1433
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`
1437   fi
1438   am__universal=false
1439   m4_case([$1], [CC],
1440     [case " $depcc " in #(
1441      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1442      esac],
1443     [CXX],
1444     [case " $depcc " in #(
1445      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1446      esac])
1447
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.
1452     #
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.
1456     : > sub/conftest.c
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
1462     done
1463     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1464
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"
1471     case $depmode in
1472     gcc)
1473       # This depmode causes a compiler race in universal mode.
1474       test "$am__universal" = false || continue
1475       ;;
1476     nosideeffect)
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
1480         continue
1481       else
1482         break
1483       fi
1484       ;;
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}
1490       am__minus_obj=
1491       ;;
1492     none) break ;;
1493     esac
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
1513         break
1514       fi
1515     fi
1516   done
1517
1518   cd ..
1519   rm -rf conftest.dir
1520 else
1521   am_cv_$1_dependencies_compiler_type=none
1522 fi
1523 ])
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])
1528 ])
1529
1530
1531 # AM_SET_DEPDIR
1532 # -------------
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
1538 ])
1539
1540
1541 # AM_DEP_TRACK
1542 # ------------
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"
1549   AMDEPBACKSLASH='\'
1550   am__nodep='_no'
1551 fi
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
1557 ])
1558
1559 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1560
1561 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1562 # Free Software Foundation, Inc.
1563 #
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.
1567
1568 #serial 5
1569
1570 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1571 # ------------------------------
1572 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1573 [{
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 ;;
1580   esac
1581   shift
1582   for mf
1583   do
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")`
1595     else
1596       continue
1597     fi
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
1610     # expansion.
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"
1620     done
1621   done
1622 }
1623 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1624
1625
1626 # AM_OUTPUT_DEPENDENCY_COMMANDS
1627 # -----------------------------
1628 # This macro should only be invoked once -- use via AC_REQUIRE.
1629 #
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"])
1637 ])
1638
1639 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1640 # Free Software Foundation, Inc.
1641 #
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.
1645
1646 # serial 8
1647
1648 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1649 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1650
1651 # Do all the work for Automake.                             -*- Autoconf -*-
1652
1653 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1654 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1655 #
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.
1659
1660 # serial 16
1661
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.
1664
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])
1690   fi
1691 fi
1692
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'
1697   else
1698     CYGPATH_W=echo
1699   fi
1700 fi
1701 AC_SUBST([CYGPATH_W])
1702
1703 # Define the identity of the package.
1704 dnl Distinguish between old-style and new-style calls.
1705 m4_ifval([$2],
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
1715
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
1719
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
1732 # some platforms.
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
1752 ])
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
1760 ])
1761
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])])
1767
1768
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.
1772
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.
1778 _am_arg=$1
1779 _am_stamp_count=1
1780 for _am_header in $config_headers :; do
1781   case $_am_header in
1782     $_am_arg | $_am_arg:* )
1783       break ;;
1784     * )
1785       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1786   esac
1787 done
1788 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1789
1790 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
1791 # Inc.
1792 #
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.
1796
1797 # serial 1
1798
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
1805   case $am_aux_dir in
1806   *\ * | *\     *)
1807     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1808   *)
1809     install_sh="\${SHELL} $am_aux_dir/install-sh"
1810   esac
1811 fi
1812 AC_SUBST(install_sh)])
1813
1814 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1815 #
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.
1819
1820 # serial 2
1821
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
1828   am__leading_dot=.
1829 else
1830   am__leading_dot=_
1831 fi
1832 rmdir .tst 2>/dev/null
1833 AC_SUBST([am__leading_dot])])
1834
1835 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1836
1837 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1838 #
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.
1842
1843 # serial 4
1844
1845 # AM_MAKE_INCLUDE()
1846 # -----------------
1847 # Check to see how make treats includes.
1848 AC_DEFUN([AM_MAKE_INCLUDE],
1849 [am_make=${MAKE-make}
1850 cat > confinc << 'END'
1851 am__doit:
1852         @echo this is the am__doit target
1853 .PHONY: am__doit
1854 END
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])
1857 am__include="#"
1858 am__quote=
1859 _am_result=none
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*)
1865   am__include=include
1866   am__quote=
1867   _am_result=GNU
1868   ;;
1869 esac
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
1876      am__quote="\""
1877      _am_result=BSD
1878      ;;
1879    esac
1880 fi
1881 AC_SUBST([am__include])
1882 AC_SUBST([am__quote])
1883 AC_MSG_RESULT([$_am_result])
1884 rm -f confinc confmf
1885 ])
1886
1887 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1888
1889 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1890 # Free Software Foundation, Inc.
1891 #
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.
1895
1896 # serial 6
1897
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"}
1903 AC_SUBST($1)])
1904
1905
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
1914   case $am_aux_dir in
1915   *\ * | *\     *)
1916     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1917   *)
1918     MISSING="\${SHELL} $am_aux_dir/missing" ;;
1919   esac
1920 fi
1921 # Use eval to expand $SHELL
1922 if eval "$MISSING --run true"; then
1923   am_missing_run="$MISSING --run "
1924 else
1925   am_missing_run=
1926   AC_MSG_WARN([`missing' script is too old or missing])
1927 fi
1928 ])
1929
1930 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
1931 # Inc.
1932 #
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.
1936
1937 # serial 1
1938
1939 # AM_PROG_MKDIR_P
1940 # ---------------
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
1951 dnl MKDIR_P).
1952 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1953 case $mkdir_p in
1954   [[\\/$]]* | ?:[[\\/]]*) ;;
1955   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1956 esac
1957 ])
1958
1959 # Helper functions for option handling.                     -*- Autoconf -*-
1960
1961 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
1962 # Foundation, Inc.
1963 #
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.
1967
1968 # serial 5
1969
1970 # _AM_MANGLE_OPTION(NAME)
1971 # -----------------------
1972 AC_DEFUN([_AM_MANGLE_OPTION],
1973 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1974
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)])
1980
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)])])
1986
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])])
1992
1993 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1994
1995 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1996 # Free Software Foundation, Inc.
1997 #
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.
2001
2002 # serial 5
2003
2004 # AM_SANITY_CHECK
2005 # ---------------
2006 AC_DEFUN([AM_SANITY_CHECK],
2007 [AC_MSG_CHECKING([whether build environment is sane])
2008 # Just in case
2009 sleep 1
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.
2013 am_lf='
2014 '
2015 case `pwd` in
2016   *[[\\\"\#\$\&\'\`$am_lf]]*)
2017     AC_MSG_ERROR([unsafe absolute working directory name]);;
2018 esac
2019 case $srcdir in
2020   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2021     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2022 esac
2023
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
2028 # directory).
2029 if (
2030    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2031    if test "$[*]" = "X"; then
2032       # -L didn't work.
2033       set X `ls -t "$srcdir/configure" conftest.file`
2034    fi
2035    rm -f conftest.file
2036    if test "$[*]" != "X $srcdir/configure conftest.file" \
2037       && test "$[*]" != "X conftest.file $srcdir/configure"; then
2038
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])
2045    fi
2046
2047    test "$[2]" = conftest.file
2048    )
2049 then
2050    # Ok.
2051    :
2052 else
2053    AC_MSG_ERROR([newly created file is older than distributed files!
2054 Check your system clock])
2055 fi
2056 AC_MSG_RESULT(yes)])
2057
2058 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
2059 #
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.
2063
2064 # serial 1
2065
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], :)
2084 fi
2085 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2086 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2087
2088 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
2089 #
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.
2093
2094 # serial 3
2095
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])
2101
2102 # AM_SUBST_NOTMAKE(VARIABLE)
2103 # --------------------------
2104 # Public sister of _AM_SUBST_NOTMAKE.
2105 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2106
2107 # Check how to create a tarball.                            -*- Autoconf -*-
2108
2109 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2110 #
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.
2114
2115 # serial 2
2116
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'.
2121 #
2122 # Substitute a variable $(am__tar) that is a command
2123 # writing to stdout a FORMAT-tarball containing the directory
2124 # $tardir.
2125 #     tardir=directory && $(am__tar) > result.tar
2126 #
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])
2133 m4_if([$1], [v7],
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
2144 do
2145   case $_am_tool in
2146   gnutar)
2147     for _am_tar in tar gnutar gtar;
2148     do
2149       AM_RUN_LOG([$_am_tar --version]) && break
2150     done
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 -"
2154     ;;
2155   plaintar)
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 -'
2162     ;;
2163   pax)
2164     am__tar='pax -L -x $1 -w "$$tardir"'
2165     am__tar_='pax -L -x $1 -w "$tardir"'
2166     am__untar='pax -r'
2167     ;;
2168   cpio)
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'
2172     ;;
2173   none)
2174     am__tar=false
2175     am__tar_=false
2176     am__untar=false
2177     ;;
2178   esac
2179
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
2183
2184   # tar/untar a dummy directory, and stop if the command works
2185   rm -rf conftest.dir
2186   mkdir conftest.dir
2187   echo GrepMe > conftest.dir/file
2188   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2189   rm -rf conftest.dir
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
2193   fi
2194 done
2195 rm -rf conftest.dir
2196
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])])
2199 AC_SUBST([am__tar])
2200 AC_SUBST([am__untar])
2201 ]) # _AM_PROG_TAR
2202