v
[gdash.git] / aclocal.m4
blob8089aa3050290cc295a3ef8d444a2a33a0ecfd15
1 # generated automatically by aclocal 1.11.6 -*- Autoconf -*-
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.
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.
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.69],,
18 [m4_warning([this file was generated for autoconf 2.69.
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 # gettext.m4 serial 63 (gettext-0.18)
24 dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
25 dnl This file is free software; the Free Software Foundation
26 dnl gives unlimited permission to copy and/or distribute it,
27 dnl with or without modifications, as long as this notice is preserved.
28 dnl
29 dnl This file can can be used in projects which are not available under
30 dnl the GNU General Public License or the GNU Library General Public
31 dnl License but which still want to provide support for the GNU gettext
32 dnl functionality.
33 dnl Please note that the actual code of the GNU gettext library is covered
34 dnl by the GNU Library General Public License, and the rest of the GNU
35 dnl gettext package package is covered by the GNU General Public License.
36 dnl They are *not* in the public domain.
38 dnl Authors:
39 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
40 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
42 dnl Macro to add for using GNU gettext.
44 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
45 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
46 dnl    default (if it is not specified or empty) is 'no-libtool'.
47 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
48 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
49 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
50 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
51 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
52 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
53 dnl    $(top_builddir)/intl/libintl.a will be created.
54 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
55 dnl    implementations (in libc or libintl) without the ngettext() function
56 dnl    will be ignored.  If NEEDSYMBOL is specified and is
57 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
58 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
59 dnl INTLDIR is used to find the intl libraries.  If empty,
60 dnl    the value `$(top_builddir)/intl/' is used.
61 dnl
62 dnl The result of the configuration is one of three cases:
63 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
64 dnl    and used.
65 dnl    Catalog format: GNU --> install in $(datadir)
66 dnl    Catalog extension: .mo after installation, .gmo in source tree
67 dnl 2) GNU gettext has been found in the system's C library.
68 dnl    Catalog format: GNU --> install in $(datadir)
69 dnl    Catalog extension: .mo after installation, .gmo in source tree
70 dnl 3) No internationalization, always use English msgid.
71 dnl    Catalog format: none
72 dnl    Catalog extension: none
73 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
74 dnl The use of .gmo is historical (it was needed to avoid overwriting the
75 dnl GNU format catalogs when building on a platform with an X/Open gettext),
76 dnl but we keep it in order not to force irrelevant filename changes on the
77 dnl maintainers.
78 dnl
79 AC_DEFUN([AM_GNU_GETTEXT],
81   dnl Argument checking.
82   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
83     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
84 ])])])])])
85   ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
86     [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
87   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
88     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
89 ])])])])
90   define([gt_included_intl],
91     ifelse([$1], [external],
92       ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
93       [yes]))
94   define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
95   gt_NEEDS_INIT
96   AM_GNU_GETTEXT_NEED([$2])
98   AC_REQUIRE([AM_PO_SUBDIRS])dnl
99   ifelse(gt_included_intl, yes, [
100     AC_REQUIRE([AM_INTL_SUBDIR])dnl
101   ])
103   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
104   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
105   AC_REQUIRE([AC_LIB_RPATH])
107   dnl Sometimes libintl requires libiconv, so first search for libiconv.
108   dnl Ideally we would do this search only after the
109   dnl      if test "$USE_NLS" = "yes"; then
110   dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
111   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
112   dnl the configure script would need to contain the same shell code
113   dnl again, outside any 'if'. There are two solutions:
114   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
115   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
116   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
117   dnl documented, we avoid it.
118   ifelse(gt_included_intl, yes, , [
119     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
120   ])
122   dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
123   gt_INTL_MACOSX
125   dnl Set USE_NLS.
126   AC_REQUIRE([AM_NLS])
128   ifelse(gt_included_intl, yes, [
129     BUILD_INCLUDED_LIBINTL=no
130     USE_INCLUDED_LIBINTL=no
131   ])
132   LIBINTL=
133   LTLIBINTL=
134   POSUB=
136   dnl Add a version number to the cache macros.
137   case " $gt_needs " in
138     *" need-formatstring-macros "*) gt_api_version=3 ;;
139     *" need-ngettext "*) gt_api_version=2 ;;
140     *) gt_api_version=1 ;;
141   esac
142   gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
143   gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
145   dnl If we use NLS figure out what method
146   if test "$USE_NLS" = "yes"; then
147     gt_use_preinstalled_gnugettext=no
148     ifelse(gt_included_intl, yes, [
149       AC_MSG_CHECKING([whether included gettext is requested])
150       AC_ARG_WITH([included-gettext],
151         [  --with-included-gettext use the GNU gettext library included here],
152         nls_cv_force_use_gnu_gettext=$withval,
153         nls_cv_force_use_gnu_gettext=no)
154       AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
156       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
157       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
158     ])
159         dnl User does not insist on using GNU NLS library.  Figure out what
160         dnl to use.  If GNU gettext is available we use this.  Else we have
161         dnl to fall back to GNU NLS library.
163         if test $gt_api_version -ge 3; then
164           gt_revision_test_code='
165 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
166 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
167 #endif
168 changequote(,)dnl
169 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
170 changequote([,])dnl
172         else
173           gt_revision_test_code=
174         fi
175         if test $gt_api_version -ge 2; then
176           gt_expression_test_code=' + * ngettext ("", "", 0)'
177         else
178           gt_expression_test_code=
179         fi
181         AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
182          [AC_TRY_LINK([#include <libintl.h>
183 $gt_revision_test_code
184 extern int _nl_msg_cat_cntr;
185 extern int *_nl_domain_bindings;],
186             [bindtextdomain ("", "");
187 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
188             [eval "$gt_func_gnugettext_libc=yes"],
189             [eval "$gt_func_gnugettext_libc=no"])])
191         if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
192           dnl Sometimes libintl requires libiconv, so first search for libiconv.
193           ifelse(gt_included_intl, yes, , [
194             AM_ICONV_LINK
195           ])
196           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
197           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
198           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
199           dnl even if libiconv doesn't exist.
200           AC_LIB_LINKFLAGS_BODY([intl])
201           AC_CACHE_CHECK([for GNU gettext in libintl],
202             [$gt_func_gnugettext_libintl],
203            [gt_save_CPPFLAGS="$CPPFLAGS"
204             CPPFLAGS="$CPPFLAGS $INCINTL"
205             gt_save_LIBS="$LIBS"
206             LIBS="$LIBS $LIBINTL"
207             dnl Now see whether libintl exists and does not depend on libiconv.
208             AC_TRY_LINK([#include <libintl.h>
209 $gt_revision_test_code
210 extern int _nl_msg_cat_cntr;
211 extern
212 #ifdef __cplusplus
214 #endif
215 const char *_nl_expand_alias (const char *);],
216               [bindtextdomain ("", "");
217 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
218               [eval "$gt_func_gnugettext_libintl=yes"],
219               [eval "$gt_func_gnugettext_libintl=no"])
220             dnl Now see whether libintl exists and depends on libiconv.
221             if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
222               LIBS="$LIBS $LIBICONV"
223               AC_TRY_LINK([#include <libintl.h>
224 $gt_revision_test_code
225 extern int _nl_msg_cat_cntr;
226 extern
227 #ifdef __cplusplus
229 #endif
230 const char *_nl_expand_alias (const char *);],
231                 [bindtextdomain ("", "");
232 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
233                [LIBINTL="$LIBINTL $LIBICONV"
234                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
235                 eval "$gt_func_gnugettext_libintl=yes"
236                ])
237             fi
238             CPPFLAGS="$gt_save_CPPFLAGS"
239             LIBS="$gt_save_LIBS"])
240         fi
242         dnl If an already present or preinstalled GNU gettext() is found,
243         dnl use it.  But if this macro is used in GNU gettext, and GNU
244         dnl gettext is already preinstalled in libintl, we update this
245         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
246         if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
247            || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
248                 && test "$PACKAGE" != gettext-runtime \
249                 && test "$PACKAGE" != gettext-tools; }; then
250           gt_use_preinstalled_gnugettext=yes
251         else
252           dnl Reset the values set by searching for libintl.
253           LIBINTL=
254           LTLIBINTL=
255           INCINTL=
256         fi
258     ifelse(gt_included_intl, yes, [
259         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
260           dnl GNU gettext is not found in the C library.
261           dnl Fall back on included GNU gettext library.
262           nls_cv_use_gnu_gettext=yes
263         fi
264       fi
266       if test "$nls_cv_use_gnu_gettext" = "yes"; then
267         dnl Mark actions used to generate GNU NLS library.
268         BUILD_INCLUDED_LIBINTL=yes
269         USE_INCLUDED_LIBINTL=yes
270         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
271         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
272         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
273       fi
275       CATOBJEXT=
276       if test "$gt_use_preinstalled_gnugettext" = "yes" \
277          || test "$nls_cv_use_gnu_gettext" = "yes"; then
278         dnl Mark actions to use GNU gettext tools.
279         CATOBJEXT=.gmo
280       fi
281     ])
283     if test -n "$INTL_MACOSX_LIBS"; then
284       if test "$gt_use_preinstalled_gnugettext" = "yes" \
285          || test "$nls_cv_use_gnu_gettext" = "yes"; then
286         dnl Some extra flags are needed during linking.
287         LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
288         LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
289       fi
290     fi
292     if test "$gt_use_preinstalled_gnugettext" = "yes" \
293        || test "$nls_cv_use_gnu_gettext" = "yes"; then
294       AC_DEFINE([ENABLE_NLS], [1],
295         [Define to 1 if translation of program messages to the user's native language
296    is requested.])
297     else
298       USE_NLS=no
299     fi
300   fi
302   AC_MSG_CHECKING([whether to use NLS])
303   AC_MSG_RESULT([$USE_NLS])
304   if test "$USE_NLS" = "yes"; then
305     AC_MSG_CHECKING([where the gettext function comes from])
306     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
307       if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
308         gt_source="external libintl"
309       else
310         gt_source="libc"
311       fi
312     else
313       gt_source="included intl directory"
314     fi
315     AC_MSG_RESULT([$gt_source])
316   fi
318   if test "$USE_NLS" = "yes"; then
320     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
321       if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
322         AC_MSG_CHECKING([how to link with libintl])
323         AC_MSG_RESULT([$LIBINTL])
324         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
325       fi
327       dnl For backward compatibility. Some packages may be using this.
328       AC_DEFINE([HAVE_GETTEXT], [1],
329        [Define if the GNU gettext() function is already present or preinstalled.])
330       AC_DEFINE([HAVE_DCGETTEXT], [1],
331        [Define if the GNU dcgettext() function is already present or preinstalled.])
332     fi
334     dnl We need to process the po/ directory.
335     POSUB=po
336   fi
338   ifelse(gt_included_intl, yes, [
339     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
340     dnl to 'yes' because some of the testsuite requires it.
341     if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
342       BUILD_INCLUDED_LIBINTL=yes
343     fi
345     dnl Make all variables we use known to autoconf.
346     AC_SUBST([BUILD_INCLUDED_LIBINTL])
347     AC_SUBST([USE_INCLUDED_LIBINTL])
348     AC_SUBST([CATOBJEXT])
350     dnl For backward compatibility. Some configure.ins may be using this.
351     nls_cv_header_intl=
352     nls_cv_header_libgt=
354     dnl For backward compatibility. Some Makefiles may be using this.
355     DATADIRNAME=share
356     AC_SUBST([DATADIRNAME])
358     dnl For backward compatibility. Some Makefiles may be using this.
359     INSTOBJEXT=.mo
360     AC_SUBST([INSTOBJEXT])
362     dnl For backward compatibility. Some Makefiles may be using this.
363     GENCAT=gencat
364     AC_SUBST([GENCAT])
366     dnl For backward compatibility. Some Makefiles may be using this.
367     INTLOBJS=
368     if test "$USE_INCLUDED_LIBINTL" = yes; then
369       INTLOBJS="\$(GETTOBJS)"
370     fi
371     AC_SUBST([INTLOBJS])
373     dnl Enable libtool support if the surrounding package wishes it.
374     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
375     AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
376   ])
378   dnl For backward compatibility. Some Makefiles may be using this.
379   INTLLIBS="$LIBINTL"
380   AC_SUBST([INTLLIBS])
382   dnl Make all documented variables known to autoconf.
383   AC_SUBST([LIBINTL])
384   AC_SUBST([LTLIBINTL])
385   AC_SUBST([POSUB])
389 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
390 m4_define([gt_NEEDS_INIT],
392   m4_divert_text([DEFAULTS], [gt_needs=])
393   m4_define([gt_NEEDS_INIT], [])
397 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
398 AC_DEFUN([AM_GNU_GETTEXT_NEED],
400   m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
404 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
405 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
407 # Configure paths for GLIB
408 # Owen Taylor     1997-2001
410 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
411 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
412 dnl gthread, or gio is specified in MODULES, pass to pkg-config
414 AC_DEFUN([AM_PATH_GLIB_2_0],
415 [dnl 
416 dnl Get the cflags and libraries from pkg-config
418 AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
419                     , enable_glibtest=yes)
421   pkg_config_args=glib-2.0
422   for module in . $4
423   do
424       case "$module" in
425          gmodule) 
426              pkg_config_args="$pkg_config_args gmodule-2.0"
427          ;;
428          gmodule-no-export) 
429              pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
430          ;;
431          gobject) 
432              pkg_config_args="$pkg_config_args gobject-2.0"
433          ;;
434          gthread) 
435              pkg_config_args="$pkg_config_args gthread-2.0"
436          ;;
437          gio*) 
438              pkg_config_args="$pkg_config_args $module-2.0"
439          ;;
440       esac
441   done
443   PKG_PROG_PKG_CONFIG([0.16])
445   no_glib=""
447   if test "x$PKG_CONFIG" = x ; then
448     no_glib=yes
449     PKG_CONFIG=no
450   fi
452   min_glib_version=ifelse([$1], ,2.0.0,$1)
453   AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
455   if test x$PKG_CONFIG != xno ; then
456     ## don't try to run the test against uninstalled libtool libs
457     if $PKG_CONFIG --uninstalled $pkg_config_args; then
458           echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
459           enable_glibtest=no
460     fi
462     if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
463           :
464     else
465           no_glib=yes
466     fi
467   fi
469   if test x"$no_glib" = x ; then
470     GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
471     GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
472     GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
473     GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
475     GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
476     GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
477     glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
478            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
479     glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
480            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
481     glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
482            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
483     if test "x$enable_glibtest" = "xyes" ; then
484       ac_save_CFLAGS="$CFLAGS"
485       ac_save_LIBS="$LIBS"
486       CFLAGS="$CFLAGS $GLIB_CFLAGS"
487       LIBS="$GLIB_LIBS $LIBS"
489 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
490 dnl checks the results of pkg-config to some extent)
492       rm -f conf.glibtest
493       AC_TRY_RUN([
494 #include <glib.h>
495 #include <stdio.h>
496 #include <stdlib.h>
498 int 
499 main ()
501   unsigned int major, minor, micro;
502   char *tmp_version;
504   fclose (fopen ("conf.glibtest", "w"));
506   /* HP/UX 9 (%@#!) writes to sscanf strings */
507   tmp_version = g_strdup("$min_glib_version");
508   if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
509      printf("%s, bad version string\n", "$min_glib_version");
510      exit(1);
511    }
513   if ((glib_major_version != $glib_config_major_version) ||
514       (glib_minor_version != $glib_config_minor_version) ||
515       (glib_micro_version != $glib_config_micro_version))
516     {
517       printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
518              $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
519              glib_major_version, glib_minor_version, glib_micro_version);
520       printf ("*** was found! If pkg-config was correct, then it is best\n");
521       printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
522       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
523       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
524       printf("*** required on your system.\n");
525       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
526       printf("*** to point to the correct configuration files\n");
527     } 
528   else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
529            (glib_minor_version != GLIB_MINOR_VERSION) ||
530            (glib_micro_version != GLIB_MICRO_VERSION))
531     {
532       printf("*** GLIB header files (version %d.%d.%d) do not match\n",
533              GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
534       printf("*** library (version %d.%d.%d)\n",
535              glib_major_version, glib_minor_version, glib_micro_version);
536     }
537   else
538     {
539       if ((glib_major_version > major) ||
540         ((glib_major_version == major) && (glib_minor_version > minor)) ||
541         ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
542       {
543         return 0;
544        }
545      else
546       {
547         printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
548                glib_major_version, glib_minor_version, glib_micro_version);
549         printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
550                major, minor, micro);
551         printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
552         printf("***\n");
553         printf("*** If you have already installed a sufficiently new version, this error\n");
554         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
555         printf("*** being found. The easiest way to fix this is to remove the old version\n");
556         printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
557         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
558         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
559         printf("*** so that the correct libraries are found at run-time))\n");
560       }
561     }
562   return 1;
564 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
565        CFLAGS="$ac_save_CFLAGS"
566        LIBS="$ac_save_LIBS"
567      fi
568   fi
569   if test "x$no_glib" = x ; then
570      AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
571      ifelse([$2], , :, [$2])     
572   else
573      AC_MSG_RESULT(no)
574      if test "$PKG_CONFIG" = "no" ; then
575        echo "*** A new enough version of pkg-config was not found."
576        echo "*** See http://www.freedesktop.org/software/pkgconfig/"
577      else
578        if test -f conf.glibtest ; then
579         :
580        else
581           echo "*** Could not run GLIB test program, checking why..."
582           ac_save_CFLAGS="$CFLAGS"
583           ac_save_LIBS="$LIBS"
584           CFLAGS="$CFLAGS $GLIB_CFLAGS"
585           LIBS="$LIBS $GLIB_LIBS"
586           AC_TRY_LINK([
587 #include <glib.h>
588 #include <stdio.h>
589 ],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
590         [ echo "*** The test program compiled, but did not run. This usually means"
591           echo "*** that the run-time linker is not finding GLIB or finding the wrong"
592           echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
593           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
594           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
595           echo "*** is required on your system"
596           echo "***"
597           echo "*** If you have an old version installed, it is best to remove it, although"
598           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
599         [ echo "*** The test program failed to compile or link. See the file config.log for the"
600           echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
601           CFLAGS="$ac_save_CFLAGS"
602           LIBS="$ac_save_LIBS"
603        fi
604      fi
605      GLIB_CFLAGS=""
606      GLIB_LIBS=""
607      GLIB_GENMARSHAL=""
608      GOBJECT_QUERY=""
609      GLIB_MKENUMS=""
610      GLIB_COMPILE_RESOURCES=""
611      ifelse([$3], , :, [$3])
612   fi
613   AC_SUBST(GLIB_CFLAGS)
614   AC_SUBST(GLIB_LIBS)
615   AC_SUBST(GLIB_GENMARSHAL)
616   AC_SUBST(GOBJECT_QUERY)
617   AC_SUBST(GLIB_MKENUMS)
618   AC_SUBST(GLIB_COMPILE_RESOURCES)
619   rm -f conf.glibtest
622 # Configure paths for GTK+
623 # Owen Taylor     1997-2001
625 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
626 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
627 dnl pass to pkg-config
629 AC_DEFUN([AM_PATH_GTK_2_0],
630 [dnl 
631 dnl Get the cflags and libraries from pkg-config
633 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
634                     , enable_gtktest=yes)
636   pkg_config_args=gtk+-2.0
637   for module in . $4
638   do
639       case "$module" in
640          gthread) 
641              pkg_config_args="$pkg_config_args gthread-2.0"
642          ;;
643       esac
644   done
646   no_gtk=""
648   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
650   if test x$PKG_CONFIG != xno ; then
651     if pkg-config --atleast-pkgconfig-version 0.7 ; then
652       :
653     else
654       echo "*** pkg-config too old; version 0.7 or better required."
655       no_gtk=yes
656       PKG_CONFIG=no
657     fi
658   else
659     no_gtk=yes
660   fi
662   min_gtk_version=ifelse([$1], ,2.0.0,$1)
663   AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
665   if test x$PKG_CONFIG != xno ; then
666     ## don't try to run the test against uninstalled libtool libs
667     if $PKG_CONFIG --uninstalled $pkg_config_args; then
668           echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
669           enable_gtktest=no
670     fi
672     if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
673           :
674     else
675           no_gtk=yes
676     fi
677   fi
679   if test x"$no_gtk" = x ; then
680     GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
681     GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
682     gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
683            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
684     gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
685            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
686     gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
687            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
688     if test "x$enable_gtktest" = "xyes" ; then
689       ac_save_CFLAGS="$CFLAGS"
690       ac_save_LIBS="$LIBS"
691       CFLAGS="$CFLAGS $GTK_CFLAGS"
692       LIBS="$GTK_LIBS $LIBS"
694 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
695 dnl checks the results of pkg-config to some extent)
697       rm -f conf.gtktest
698       AC_TRY_RUN([
699 #include <gtk/gtk.h>
700 #include <stdio.h>
701 #include <stdlib.h>
703 int 
704 main ()
706   int major, minor, micro;
707   char *tmp_version;
709   fclose (fopen ("conf.gtktest", "w"));
711   /* HP/UX 9 (%@#!) writes to sscanf strings */
712   tmp_version = g_strdup("$min_gtk_version");
713   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
714      printf("%s, bad version string\n", "$min_gtk_version");
715      exit(1);
716    }
718   if ((gtk_major_version != $gtk_config_major_version) ||
719       (gtk_minor_version != $gtk_config_minor_version) ||
720       (gtk_micro_version != $gtk_config_micro_version))
721     {
722       printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
723              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
724              gtk_major_version, gtk_minor_version, gtk_micro_version);
725       printf ("*** was found! If pkg-config was correct, then it is best\n");
726       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
727       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
728       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
729       printf("*** required on your system.\n");
730       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
731       printf("*** to point to the correct configuration files\n");
732     } 
733   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
734            (gtk_minor_version != GTK_MINOR_VERSION) ||
735            (gtk_micro_version != GTK_MICRO_VERSION))
736     {
737       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
738              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
739       printf("*** library (version %d.%d.%d)\n",
740              gtk_major_version, gtk_minor_version, gtk_micro_version);
741     }
742   else
743     {
744       if ((gtk_major_version > major) ||
745         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
746         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
747       {
748         return 0;
749        }
750      else
751       {
752         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
753                gtk_major_version, gtk_minor_version, gtk_micro_version);
754         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
755                major, minor, micro);
756         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
757         printf("***\n");
758         printf("*** If you have already installed a sufficiently new version, this error\n");
759         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
760         printf("*** being found. The easiest way to fix this is to remove the old version\n");
761         printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
762         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
763         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
764         printf("*** so that the correct libraries are found at run-time))\n");
765       }
766     }
767   return 1;
769 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
770        CFLAGS="$ac_save_CFLAGS"
771        LIBS="$ac_save_LIBS"
772      fi
773   fi
774   if test "x$no_gtk" = x ; then
775      AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
776      ifelse([$2], , :, [$2])     
777   else
778      AC_MSG_RESULT(no)
779      if test "$PKG_CONFIG" = "no" ; then
780        echo "*** A new enough version of pkg-config was not found."
781        echo "*** See http://pkgconfig.sourceforge.net"
782      else
783        if test -f conf.gtktest ; then
784         :
785        else
786           echo "*** Could not run GTK+ test program, checking why..."
787           ac_save_CFLAGS="$CFLAGS"
788           ac_save_LIBS="$LIBS"
789           CFLAGS="$CFLAGS $GTK_CFLAGS"
790           LIBS="$LIBS $GTK_LIBS"
791           AC_TRY_LINK([
792 #include <gtk/gtk.h>
793 #include <stdio.h>
794 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
795         [ echo "*** The test program compiled, but did not run. This usually means"
796           echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
797           echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
798           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
799           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
800           echo "*** is required on your system"
801           echo "***"
802           echo "*** If you have an old version installed, it is best to remove it, although"
803           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
804         [ echo "*** The test program failed to compile or link. See the file config.log for the"
805           echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
806           CFLAGS="$ac_save_CFLAGS"
807           LIBS="$ac_save_LIBS"
808        fi
809      fi
810      GTK_CFLAGS=""
811      GTK_LIBS=""
812      ifelse([$3], , :, [$3])
813   fi
814   AC_SUBST(GTK_CFLAGS)
815   AC_SUBST(GTK_LIBS)
816   rm -f conf.gtktest
819 # iconv.m4 serial 11 (gettext-0.18.1)
820 dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
821 dnl This file is free software; the Free Software Foundation
822 dnl gives unlimited permission to copy and/or distribute it,
823 dnl with or without modifications, as long as this notice is preserved.
825 dnl From Bruno Haible.
827 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
829   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
830   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
831   AC_REQUIRE([AC_LIB_RPATH])
833   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
834   dnl accordingly.
835   AC_LIB_LINKFLAGS_BODY([iconv])
838 AC_DEFUN([AM_ICONV_LINK],
840   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
841   dnl those with the standalone portable GNU libiconv installed).
842   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
844   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
845   dnl accordingly.
846   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
848   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
849   dnl because if the user has installed libiconv and not disabled its use
850   dnl via --without-libiconv-prefix, he wants to use it. The first
851   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
852   am_save_CPPFLAGS="$CPPFLAGS"
853   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
855   AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
856     am_cv_func_iconv="no, consider installing GNU libiconv"
857     am_cv_lib_iconv=no
858     AC_TRY_LINK([#include <stdlib.h>
859 #include <iconv.h>],
860       [iconv_t cd = iconv_open("","");
861        iconv(cd,NULL,NULL,NULL,NULL);
862        iconv_close(cd);],
863       [am_cv_func_iconv=yes])
864     if test "$am_cv_func_iconv" != yes; then
865       am_save_LIBS="$LIBS"
866       LIBS="$LIBS $LIBICONV"
867       AC_TRY_LINK([#include <stdlib.h>
868 #include <iconv.h>],
869         [iconv_t cd = iconv_open("","");
870          iconv(cd,NULL,NULL,NULL,NULL);
871          iconv_close(cd);],
872         [am_cv_lib_iconv=yes]
873         [am_cv_func_iconv=yes])
874       LIBS="$am_save_LIBS"
875     fi
876   ])
877   if test "$am_cv_func_iconv" = yes; then
878     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
879       dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
880       am_save_LIBS="$LIBS"
881       if test $am_cv_lib_iconv = yes; then
882         LIBS="$LIBS $LIBICONV"
883       fi
884       AC_TRY_RUN([
885 #include <iconv.h>
886 #include <string.h>
887 int main ()
889   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
890      returns.  */
891   {
892     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
893     if (cd_utf8_to_88591 != (iconv_t)(-1))
894       {
895         static const char input[] = "\342\202\254"; /* EURO SIGN */
896         char buf[10];
897         const char *inptr = input;
898         size_t inbytesleft = strlen (input);
899         char *outptr = buf;
900         size_t outbytesleft = sizeof (buf);
901         size_t res = iconv (cd_utf8_to_88591,
902                             (char **) &inptr, &inbytesleft,
903                             &outptr, &outbytesleft);
904         if (res == 0)
905           return 1;
906       }
907   }
908   /* Test against Solaris 10 bug: Failures are not distinguishable from
909      successful returns.  */
910   {
911     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
912     if (cd_ascii_to_88591 != (iconv_t)(-1))
913       {
914         static const char input[] = "\263";
915         char buf[10];
916         const char *inptr = input;
917         size_t inbytesleft = strlen (input);
918         char *outptr = buf;
919         size_t outbytesleft = sizeof (buf);
920         size_t res = iconv (cd_ascii_to_88591,
921                             (char **) &inptr, &inbytesleft,
922                             &outptr, &outbytesleft);
923         if (res == 0)
924           return 1;
925       }
926   }
927 #if 0 /* This bug could be worked around by the caller.  */
928   /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
929   {
930     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
931     if (cd_88591_to_utf8 != (iconv_t)(-1))
932       {
933         static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
934         char buf[50];
935         const char *inptr = input;
936         size_t inbytesleft = strlen (input);
937         char *outptr = buf;
938         size_t outbytesleft = sizeof (buf);
939         size_t res = iconv (cd_88591_to_utf8,
940                             (char **) &inptr, &inbytesleft,
941                             &outptr, &outbytesleft);
942         if ((int)res > 0)
943           return 1;
944       }
945   }
946 #endif
947   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
948      provided.  */
949   if (/* Try standardized names.  */
950       iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
951       /* Try IRIX, OSF/1 names.  */
952       && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
953       /* Try AIX names.  */
954       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
955       /* Try HP-UX names.  */
956       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
957     return 1;
958   return 0;
959 }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
960         [case "$host_os" in
961            aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
962            *)            am_cv_func_iconv_works="guessing yes" ;;
963          esac])
964       LIBS="$am_save_LIBS"
965     ])
966     case "$am_cv_func_iconv_works" in
967       *no) am_func_iconv=no am_cv_lib_iconv=no ;;
968       *)   am_func_iconv=yes ;;
969     esac
970   else
971     am_func_iconv=no am_cv_lib_iconv=no
972   fi
973   if test "$am_func_iconv" = yes; then
974     AC_DEFINE([HAVE_ICONV], [1],
975       [Define if you have the iconv() function and it works.])
976   fi
977   if test "$am_cv_lib_iconv" = yes; then
978     AC_MSG_CHECKING([how to link with libiconv])
979     AC_MSG_RESULT([$LIBICONV])
980   else
981     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
982     dnl either.
983     CPPFLAGS="$am_save_CPPFLAGS"
984     LIBICONV=
985     LTLIBICONV=
986   fi
987   AC_SUBST([LIBICONV])
988   AC_SUBST([LTLIBICONV])
991 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
992 dnl avoid warnings like
993 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
994 dnl This is tricky because of the way 'aclocal' is implemented:
995 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
996 dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
997 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
998 dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
999 dnl   warnings.
1000 m4_define([gl_iconv_AC_DEFUN],
1001   m4_version_prereq([2.64],
1002     [[AC_DEFUN_ONCE(
1003         [$1], [$2])]],
1004     [[AC_DEFUN(
1005         [$1], [$2])]]))
1006 gl_iconv_AC_DEFUN([AM_ICONV],
1008   AM_ICONV_LINK
1009   if test "$am_cv_func_iconv" = yes; then
1010     AC_MSG_CHECKING([for iconv declaration])
1011     AC_CACHE_VAL([am_cv_proto_iconv], [
1012       AC_TRY_COMPILE([
1013 #include <stdlib.h>
1014 #include <iconv.h>
1015 extern
1016 #ifdef __cplusplus
1018 #endif
1019 #if defined(__STDC__) || defined(__cplusplus)
1020 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1021 #else
1022 size_t iconv();
1023 #endif
1024 ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
1025       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
1026     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1027     AC_MSG_RESULT([
1028          $am_cv_proto_iconv])
1029     AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
1030       [Define as const if the declaration of iconv() needs const.])
1031   fi
1034 # intlmacosx.m4 serial 3 (gettext-0.18)
1035 dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
1036 dnl This file is free software; the Free Software Foundation
1037 dnl gives unlimited permission to copy and/or distribute it,
1038 dnl with or without modifications, as long as this notice is preserved.
1040 dnl This file can can be used in projects which are not available under
1041 dnl the GNU General Public License or the GNU Library General Public
1042 dnl License but which still want to provide support for the GNU gettext
1043 dnl functionality.
1044 dnl Please note that the actual code of the GNU gettext library is covered
1045 dnl by the GNU Library General Public License, and the rest of the GNU
1046 dnl gettext package package is covered by the GNU General Public License.
1047 dnl They are *not* in the public domain.
1049 dnl Checks for special options needed on MacOS X.
1050 dnl Defines INTL_MACOSX_LIBS.
1051 AC_DEFUN([gt_INTL_MACOSX],
1053   dnl Check for API introduced in MacOS X 10.2.
1054   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1055     [gt_cv_func_CFPreferencesCopyAppValue],
1056     [gt_save_LIBS="$LIBS"
1057      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1058      AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
1059        [CFPreferencesCopyAppValue(NULL, NULL)],
1060        [gt_cv_func_CFPreferencesCopyAppValue=yes],
1061        [gt_cv_func_CFPreferencesCopyAppValue=no])
1062      LIBS="$gt_save_LIBS"])
1063   if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1064     AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1065       [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1066   fi
1067   dnl Check for API introduced in MacOS X 10.3.
1068   AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
1069     [gt_save_LIBS="$LIBS"
1070      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1071      AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
1072        [gt_cv_func_CFLocaleCopyCurrent=yes],
1073        [gt_cv_func_CFLocaleCopyCurrent=no])
1074      LIBS="$gt_save_LIBS"])
1075   if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1076     AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
1077       [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1078   fi
1079   INTL_MACOSX_LIBS=
1080   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1081     INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1082   fi
1083   AC_SUBST([INTL_MACOSX_LIBS])
1086 # lib-ld.m4 serial 4 (gettext-0.18)
1087 dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
1088 dnl This file is free software; the Free Software Foundation
1089 dnl gives unlimited permission to copy and/or distribute it,
1090 dnl with or without modifications, as long as this notice is preserved.
1092 dnl Subroutines of libtool.m4,
1093 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1094 dnl with libtool.m4.
1096 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1097 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1098 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
1099 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1100 case `$LD -v 2>&1 </dev/null` in
1101 *GNU* | *'with BFD'*)
1102   acl_cv_prog_gnu_ld=yes ;;
1104   acl_cv_prog_gnu_ld=no ;;
1105 esac])
1106 with_gnu_ld=$acl_cv_prog_gnu_ld
1109 dnl From libtool-1.4. Sets the variable LD.
1110 AC_DEFUN([AC_LIB_PROG_LD],
1111 [AC_ARG_WITH([gnu-ld],
1112 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
1113 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1114 AC_REQUIRE([AC_PROG_CC])dnl
1115 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1116 # Prepare PATH_SEPARATOR.
1117 # The user is always right.
1118 if test "${PATH_SEPARATOR+set}" != set; then
1119   echo "#! /bin/sh" >conf$$.sh
1120   echo  "exit 0"   >>conf$$.sh
1121   chmod +x conf$$.sh
1122   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1123     PATH_SEPARATOR=';'
1124   else
1125     PATH_SEPARATOR=:
1126   fi
1127   rm -f conf$$.sh
1129 ac_prog=ld
1130 if test "$GCC" = yes; then
1131   # Check if gcc -print-prog-name=ld gives a path.
1132   AC_MSG_CHECKING([for ld used by GCC])
1133   case $host in
1134   *-*-mingw*)
1135     # gcc leaves a trailing carriage return which upsets mingw
1136     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1137   *)
1138     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1139   esac
1140   case $ac_prog in
1141     # Accept absolute paths.
1142     [[\\/]* | [A-Za-z]:[\\/]*)]
1143       [re_direlt='/[^/][^/]*/\.\./']
1144       # Canonicalize the path of ld
1145       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1146       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1147         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1148       done
1149       test -z "$LD" && LD="$ac_prog"
1150       ;;
1151   "")
1152     # If it fails, then pretend we aren't using GCC.
1153     ac_prog=ld
1154     ;;
1155   *)
1156     # If it is relative, then search for the first ld in PATH.
1157     with_gnu_ld=unknown
1158     ;;
1159   esac
1160 elif test "$with_gnu_ld" = yes; then
1161   AC_MSG_CHECKING([for GNU ld])
1162 else
1163   AC_MSG_CHECKING([for non-GNU ld])
1165 AC_CACHE_VAL([acl_cv_path_LD],
1166 [if test -z "$LD"; then
1167   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1168   for ac_dir in $PATH; do
1169     test -z "$ac_dir" && ac_dir=.
1170     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1171       acl_cv_path_LD="$ac_dir/$ac_prog"
1172       # Check to see if the program is GNU ld.  I'd rather use --version,
1173       # but apparently some GNU ld's only accept -v.
1174       # Break only if it was the GNU/non-GNU ld that we prefer.
1175       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1176       *GNU* | *'with BFD'*)
1177         test "$with_gnu_ld" != no && break ;;
1178       *)
1179         test "$with_gnu_ld" != yes && break ;;
1180       esac
1181     fi
1182   done
1183   IFS="$ac_save_ifs"
1184 else
1185   acl_cv_path_LD="$LD" # Let the user override the test with a path.
1186 fi])
1187 LD="$acl_cv_path_LD"
1188 if test -n "$LD"; then
1189   AC_MSG_RESULT([$LD])
1190 else
1191   AC_MSG_RESULT([no])
1193 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1194 AC_LIB_PROG_LD_GNU
1197 # lib-link.m4 serial 21 (gettext-0.18)
1198 dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
1199 dnl This file is free software; the Free Software Foundation
1200 dnl gives unlimited permission to copy and/or distribute it,
1201 dnl with or without modifications, as long as this notice is preserved.
1203 dnl From Bruno Haible.
1205 AC_PREREQ([2.54])
1207 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1208 dnl the libraries corresponding to explicit and implicit dependencies.
1209 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1210 dnl augments the CPPFLAGS variable.
1211 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1212 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1213 AC_DEFUN([AC_LIB_LINKFLAGS],
1215   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1216   AC_REQUIRE([AC_LIB_RPATH])
1217   pushdef([Name],[translit([$1],[./-], [___])])
1218   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1219                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1220   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1221     AC_LIB_LINKFLAGS_BODY([$1], [$2])
1222     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1223     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1224     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1225     ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1226   ])
1227   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1228   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1229   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1230   LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1231   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1232   AC_SUBST([LIB]NAME)
1233   AC_SUBST([LTLIB]NAME)
1234   AC_SUBST([LIB]NAME[_PREFIX])
1235   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1236   dnl results of this search when this library appears as a dependency.
1237   HAVE_LIB[]NAME=yes
1238   popdef([NAME])
1239   popdef([Name])
1242 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
1243 dnl searches for libname and the libraries corresponding to explicit and
1244 dnl implicit dependencies, together with the specified include files and
1245 dnl the ability to compile and link the specified testcode. The missing-message
1246 dnl defaults to 'no' and may contain additional hints for the user.
1247 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
1248 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1249 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1250 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1251 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1252 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1253 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1255   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1256   AC_REQUIRE([AC_LIB_RPATH])
1257   pushdef([Name],[translit([$1],[./-], [___])])
1258   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1259                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1261   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1262   dnl accordingly.
1263   AC_LIB_LINKFLAGS_BODY([$1], [$2])
1265   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1266   dnl because if the user has installed lib[]Name and not disabled its use
1267   dnl via --without-lib[]Name-prefix, he wants to use it.
1268   ac_save_CPPFLAGS="$CPPFLAGS"
1269   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1271   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1272     ac_save_LIBS="$LIBS"
1273     dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
1274     dnl because these -l options might require -L options that are present in
1275     dnl LIBS. -l options benefit only from the -L options listed before it.
1276     dnl Otherwise, add it to the front of LIBS, because it may be a static
1277     dnl library that depends on another static library that is present in LIBS.
1278     dnl Static libraries benefit only from the static libraries listed after
1279     dnl it.
1280     case " $LIB[]NAME" in
1281       *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
1282       *)       LIBS="$LIB[]NAME $LIBS" ;;
1283     esac
1284     AC_TRY_LINK([$3], [$4],
1285       [ac_cv_lib[]Name=yes],
1286       [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
1287     LIBS="$ac_save_LIBS"
1288   ])
1289   if test "$ac_cv_lib[]Name" = yes; then
1290     HAVE_LIB[]NAME=yes
1291     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
1292     AC_MSG_CHECKING([how to link with lib[]$1])
1293     AC_MSG_RESULT([$LIB[]NAME])
1294   else
1295     HAVE_LIB[]NAME=no
1296     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1297     dnl $INC[]NAME either.
1298     CPPFLAGS="$ac_save_CPPFLAGS"
1299     LIB[]NAME=
1300     LTLIB[]NAME=
1301     LIB[]NAME[]_PREFIX=
1302   fi
1303   AC_SUBST([HAVE_LIB]NAME)
1304   AC_SUBST([LIB]NAME)
1305   AC_SUBST([LTLIB]NAME)
1306   AC_SUBST([LIB]NAME[_PREFIX])
1307   popdef([NAME])
1308   popdef([Name])
1311 dnl Determine the platform dependent parameters needed to use rpath:
1312 dnl   acl_libext,
1313 dnl   acl_shlibext,
1314 dnl   acl_hardcode_libdir_flag_spec,
1315 dnl   acl_hardcode_libdir_separator,
1316 dnl   acl_hardcode_direct,
1317 dnl   acl_hardcode_minus_L.
1318 AC_DEFUN([AC_LIB_RPATH],
1320   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1321   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1322   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1323   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1324   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1325   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1326   AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
1327     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1328     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1329     . ./conftest.sh
1330     rm -f ./conftest.sh
1331     acl_cv_rpath=done
1332   ])
1333   wl="$acl_cv_wl"
1334   acl_libext="$acl_cv_libext"
1335   acl_shlibext="$acl_cv_shlibext"
1336   acl_libname_spec="$acl_cv_libname_spec"
1337   acl_library_names_spec="$acl_cv_library_names_spec"
1338   acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1339   acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1340   acl_hardcode_direct="$acl_cv_hardcode_direct"
1341   acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1342   dnl Determine whether the user wants rpath handling at all.
1343   AC_ARG_ENABLE([rpath],
1344     [  --disable-rpath         do not hardcode runtime library paths],
1345     :, enable_rpath=yes)
1348 dnl AC_LIB_FROMPACKAGE(name, package)
1349 dnl declares that libname comes from the given package. The configure file
1350 dnl will then not have a --with-libname-prefix option but a
1351 dnl --with-package-prefix option. Several libraries can come from the same
1352 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
1353 dnl macro call that searches for libname.
1354 AC_DEFUN([AC_LIB_FROMPACKAGE],
1356   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1357                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1358   define([acl_frompackage_]NAME, [$2])
1359   popdef([NAME])
1360   pushdef([PACK],[$2])
1361   pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
1362                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1363   define([acl_libsinpackage_]PACKUP,
1364     m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
1365   popdef([PACKUP])
1366   popdef([PACK])
1369 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1370 dnl the libraries corresponding to explicit and implicit dependencies.
1371 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1372 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1373 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1374 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1376   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1377   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1378                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1379   pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
1380   pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
1381                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1382   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
1383   dnl Autoconf >= 2.61 supports dots in --with options.
1384   pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
1385   dnl By default, look in $includedir and $libdir.
1386   use_additional=yes
1387   AC_LIB_WITH_FINAL_PREFIX([
1388     eval additional_includedir=\"$includedir\"
1389     eval additional_libdir=\"$libdir\"
1390   ])
1391   AC_ARG_WITH(P_A_C_K[-prefix],
1392 [[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
1393   --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
1395     if test "X$withval" = "Xno"; then
1396       use_additional=no
1397     else
1398       if test "X$withval" = "X"; then
1399         AC_LIB_WITH_FINAL_PREFIX([
1400           eval additional_includedir=\"$includedir\"
1401           eval additional_libdir=\"$libdir\"
1402         ])
1403       else
1404         additional_includedir="$withval/include"
1405         additional_libdir="$withval/$acl_libdirstem"
1406         if test "$acl_libdirstem2" != "$acl_libdirstem" \
1407            && ! test -d "$withval/$acl_libdirstem"; then
1408           additional_libdir="$withval/$acl_libdirstem2"
1409         fi
1410       fi
1411     fi
1413   dnl Search the library and its dependencies in $additional_libdir and
1414   dnl $LDFLAGS. Using breadth-first-seach.
1415   LIB[]NAME=
1416   LTLIB[]NAME=
1417   INC[]NAME=
1418   LIB[]NAME[]_PREFIX=
1419   dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
1420   dnl computed. So it has to be reset here.
1421   HAVE_LIB[]NAME=
1422   rpathdirs=
1423   ltrpathdirs=
1424   names_already_handled=
1425   names_next_round='$1 $2'
1426   while test -n "$names_next_round"; do
1427     names_this_round="$names_next_round"
1428     names_next_round=
1429     for name in $names_this_round; do
1430       already_handled=
1431       for n in $names_already_handled; do
1432         if test "$n" = "$name"; then
1433           already_handled=yes
1434           break
1435         fi
1436       done
1437       if test -z "$already_handled"; then
1438         names_already_handled="$names_already_handled $name"
1439         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1440         dnl or AC_LIB_HAVE_LINKFLAGS call.
1441         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1442         eval value=\"\$HAVE_LIB$uppername\"
1443         if test -n "$value"; then
1444           if test "$value" = yes; then
1445             eval value=\"\$LIB$uppername\"
1446             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1447             eval value=\"\$LTLIB$uppername\"
1448             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1449           else
1450             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1451             dnl that this library doesn't exist. So just drop it.
1452             :
1453           fi
1454         else
1455           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1456           dnl and the already constructed $LIBNAME/$LTLIBNAME.
1457           found_dir=
1458           found_la=
1459           found_so=
1460           found_a=
1461           eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
1462           if test -n "$acl_shlibext"; then
1463             shrext=".$acl_shlibext"             # typically: shrext=.so
1464           else
1465             shrext=
1466           fi
1467           if test $use_additional = yes; then
1468             dir="$additional_libdir"
1469             dnl The same code as in the loop below:
1470             dnl First look for a shared library.
1471             if test -n "$acl_shlibext"; then
1472               if test -f "$dir/$libname$shrext"; then
1473                 found_dir="$dir"
1474                 found_so="$dir/$libname$shrext"
1475               else
1476                 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1477                   ver=`(cd "$dir" && \
1478                         for f in "$libname$shrext".*; do echo "$f"; done \
1479                         | sed -e "s,^$libname$shrext\\\\.,," \
1480                         | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1481                         | sed 1q ) 2>/dev/null`
1482                   if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1483                     found_dir="$dir"
1484                     found_so="$dir/$libname$shrext.$ver"
1485                   fi
1486                 else
1487                   eval library_names=\"$acl_library_names_spec\"
1488                   for f in $library_names; do
1489                     if test -f "$dir/$f"; then
1490                       found_dir="$dir"
1491                       found_so="$dir/$f"
1492                       break
1493                     fi
1494                   done
1495                 fi
1496               fi
1497             fi
1498             dnl Then look for a static library.
1499             if test "X$found_dir" = "X"; then
1500               if test -f "$dir/$libname.$acl_libext"; then
1501                 found_dir="$dir"
1502                 found_a="$dir/$libname.$acl_libext"
1503               fi
1504             fi
1505             if test "X$found_dir" != "X"; then
1506               if test -f "$dir/$libname.la"; then
1507                 found_la="$dir/$libname.la"
1508               fi
1509             fi
1510           fi
1511           if test "X$found_dir" = "X"; then
1512             for x in $LDFLAGS $LTLIB[]NAME; do
1513               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1514               case "$x" in
1515                 -L*)
1516                   dir=`echo "X$x" | sed -e 's/^X-L//'`
1517                   dnl First look for a shared library.
1518                   if test -n "$acl_shlibext"; then
1519                     if test -f "$dir/$libname$shrext"; then
1520                       found_dir="$dir"
1521                       found_so="$dir/$libname$shrext"
1522                     else
1523                       if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1524                         ver=`(cd "$dir" && \
1525                               for f in "$libname$shrext".*; do echo "$f"; done \
1526                               | sed -e "s,^$libname$shrext\\\\.,," \
1527                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1528                               | sed 1q ) 2>/dev/null`
1529                         if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1530                           found_dir="$dir"
1531                           found_so="$dir/$libname$shrext.$ver"
1532                         fi
1533                       else
1534                         eval library_names=\"$acl_library_names_spec\"
1535                         for f in $library_names; do
1536                           if test -f "$dir/$f"; then
1537                             found_dir="$dir"
1538                             found_so="$dir/$f"
1539                             break
1540                           fi
1541                         done
1542                       fi
1543                     fi
1544                   fi
1545                   dnl Then look for a static library.
1546                   if test "X$found_dir" = "X"; then
1547                     if test -f "$dir/$libname.$acl_libext"; then
1548                       found_dir="$dir"
1549                       found_a="$dir/$libname.$acl_libext"
1550                     fi
1551                   fi
1552                   if test "X$found_dir" != "X"; then
1553                     if test -f "$dir/$libname.la"; then
1554                       found_la="$dir/$libname.la"
1555                     fi
1556                   fi
1557                   ;;
1558               esac
1559               if test "X$found_dir" != "X"; then
1560                 break
1561               fi
1562             done
1563           fi
1564           if test "X$found_dir" != "X"; then
1565             dnl Found the library.
1566             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1567             if test "X$found_so" != "X"; then
1568               dnl Linking with a shared library. We attempt to hardcode its
1569               dnl directory into the executable's runpath, unless it's the
1570               dnl standard /usr/lib.
1571               if test "$enable_rpath" = no \
1572                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
1573                  || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
1574                 dnl No hardcoding is needed.
1575                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1576               else
1577                 dnl Use an explicit option to hardcode DIR into the resulting
1578                 dnl binary.
1579                 dnl Potentially add DIR to ltrpathdirs.
1580                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1581                 haveit=
1582                 for x in $ltrpathdirs; do
1583                   if test "X$x" = "X$found_dir"; then
1584                     haveit=yes
1585                     break
1586                   fi
1587                 done
1588                 if test -z "$haveit"; then
1589                   ltrpathdirs="$ltrpathdirs $found_dir"
1590                 fi
1591                 dnl The hardcoding into $LIBNAME is system dependent.
1592                 if test "$acl_hardcode_direct" = yes; then
1593                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1594                   dnl resulting binary.
1595                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1596                 else
1597                   if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1598                     dnl Use an explicit option to hardcode DIR into the resulting
1599                     dnl binary.
1600                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1601                     dnl Potentially add DIR to rpathdirs.
1602                     dnl The rpathdirs will be appended to $LIBNAME at the end.
1603                     haveit=
1604                     for x in $rpathdirs; do
1605                       if test "X$x" = "X$found_dir"; then
1606                         haveit=yes
1607                         break
1608                       fi
1609                     done
1610                     if test -z "$haveit"; then
1611                       rpathdirs="$rpathdirs $found_dir"
1612                     fi
1613                   else
1614                     dnl Rely on "-L$found_dir".
1615                     dnl But don't add it if it's already contained in the LDFLAGS
1616                     dnl or the already constructed $LIBNAME
1617                     haveit=
1618                     for x in $LDFLAGS $LIB[]NAME; do
1619                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1620                       if test "X$x" = "X-L$found_dir"; then
1621                         haveit=yes
1622                         break
1623                       fi
1624                     done
1625                     if test -z "$haveit"; then
1626                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1627                     fi
1628                     if test "$acl_hardcode_minus_L" != no; then
1629                       dnl FIXME: Not sure whether we should use
1630                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1631                       dnl here.
1632                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1633                     else
1634                       dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1635                       dnl here, because this doesn't fit in flags passed to the
1636                       dnl compiler. So give up. No hardcoding. This affects only
1637                       dnl very old systems.
1638                       dnl FIXME: Not sure whether we should use
1639                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1640                       dnl here.
1641                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1642                     fi
1643                   fi
1644                 fi
1645               fi
1646             else
1647               if test "X$found_a" != "X"; then
1648                 dnl Linking with a static library.
1649                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1650               else
1651                 dnl We shouldn't come here, but anyway it's good to have a
1652                 dnl fallback.
1653                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1654               fi
1655             fi
1656             dnl Assume the include files are nearby.
1657             additional_includedir=
1658             case "$found_dir" in
1659               */$acl_libdirstem | */$acl_libdirstem/)
1660                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1661                 if test "$name" = '$1'; then
1662                   LIB[]NAME[]_PREFIX="$basedir"
1663                 fi
1664                 additional_includedir="$basedir/include"
1665                 ;;
1666               */$acl_libdirstem2 | */$acl_libdirstem2/)
1667                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
1668                 if test "$name" = '$1'; then
1669                   LIB[]NAME[]_PREFIX="$basedir"
1670                 fi
1671                 additional_includedir="$basedir/include"
1672                 ;;
1673             esac
1674             if test "X$additional_includedir" != "X"; then
1675               dnl Potentially add $additional_includedir to $INCNAME.
1676               dnl But don't add it
1677               dnl   1. if it's the standard /usr/include,
1678               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1679               dnl   3. if it's already present in $CPPFLAGS or the already
1680               dnl      constructed $INCNAME,
1681               dnl   4. if it doesn't exist as a directory.
1682               if test "X$additional_includedir" != "X/usr/include"; then
1683                 haveit=
1684                 if test "X$additional_includedir" = "X/usr/local/include"; then
1685                   if test -n "$GCC"; then
1686                     case $host_os in
1687                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1688                     esac
1689                   fi
1690                 fi
1691                 if test -z "$haveit"; then
1692                   for x in $CPPFLAGS $INC[]NAME; do
1693                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1694                     if test "X$x" = "X-I$additional_includedir"; then
1695                       haveit=yes
1696                       break
1697                     fi
1698                   done
1699                   if test -z "$haveit"; then
1700                     if test -d "$additional_includedir"; then
1701                       dnl Really add $additional_includedir to $INCNAME.
1702                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1703                     fi
1704                   fi
1705                 fi
1706               fi
1707             fi
1708             dnl Look for dependencies.
1709             if test -n "$found_la"; then
1710               dnl Read the .la file. It defines the variables
1711               dnl dlname, library_names, old_library, dependency_libs, current,
1712               dnl age, revision, installed, dlopen, dlpreopen, libdir.
1713               save_libdir="$libdir"
1714               case "$found_la" in
1715                 */* | *\\*) . "$found_la" ;;
1716                 *) . "./$found_la" ;;
1717               esac
1718               libdir="$save_libdir"
1719               dnl We use only dependency_libs.
1720               for dep in $dependency_libs; do
1721                 case "$dep" in
1722                   -L*)
1723                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1724                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1725                     dnl But don't add it
1726                     dnl   1. if it's the standard /usr/lib,
1727                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1728                     dnl   3. if it's already present in $LDFLAGS or the already
1729                     dnl      constructed $LIBNAME,
1730                     dnl   4. if it doesn't exist as a directory.
1731                     if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
1732                        && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
1733                       haveit=
1734                       if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
1735                          || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
1736                         if test -n "$GCC"; then
1737                           case $host_os in
1738                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1739                           esac
1740                         fi
1741                       fi
1742                       if test -z "$haveit"; then
1743                         haveit=
1744                         for x in $LDFLAGS $LIB[]NAME; do
1745                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1746                           if test "X$x" = "X-L$additional_libdir"; then
1747                             haveit=yes
1748                             break
1749                           fi
1750                         done
1751                         if test -z "$haveit"; then
1752                           if test -d "$additional_libdir"; then
1753                             dnl Really add $additional_libdir to $LIBNAME.
1754                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1755                           fi
1756                         fi
1757                         haveit=
1758                         for x in $LDFLAGS $LTLIB[]NAME; do
1759                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1760                           if test "X$x" = "X-L$additional_libdir"; then
1761                             haveit=yes
1762                             break
1763                           fi
1764                         done
1765                         if test -z "$haveit"; then
1766                           if test -d "$additional_libdir"; then
1767                             dnl Really add $additional_libdir to $LTLIBNAME.
1768                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1769                           fi
1770                         fi
1771                       fi
1772                     fi
1773                     ;;
1774                   -R*)
1775                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
1776                     if test "$enable_rpath" != no; then
1777                       dnl Potentially add DIR to rpathdirs.
1778                       dnl The rpathdirs will be appended to $LIBNAME at the end.
1779                       haveit=
1780                       for x in $rpathdirs; do
1781                         if test "X$x" = "X$dir"; then
1782                           haveit=yes
1783                           break
1784                         fi
1785                       done
1786                       if test -z "$haveit"; then
1787                         rpathdirs="$rpathdirs $dir"
1788                       fi
1789                       dnl Potentially add DIR to ltrpathdirs.
1790                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1791                       haveit=
1792                       for x in $ltrpathdirs; do
1793                         if test "X$x" = "X$dir"; then
1794                           haveit=yes
1795                           break
1796                         fi
1797                       done
1798                       if test -z "$haveit"; then
1799                         ltrpathdirs="$ltrpathdirs $dir"
1800                       fi
1801                     fi
1802                     ;;
1803                   -l*)
1804                     dnl Handle this in the next round.
1805                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1806                     ;;
1807                   *.la)
1808                     dnl Handle this in the next round. Throw away the .la's
1809                     dnl directory; it is already contained in a preceding -L
1810                     dnl option.
1811                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1812                     ;;
1813                   *)
1814                     dnl Most likely an immediate library name.
1815                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1816                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1817                     ;;
1818                 esac
1819               done
1820             fi
1821           else
1822             dnl Didn't find the library; assume it is in the system directories
1823             dnl known to the linker and runtime loader. (All the system
1824             dnl directories known to the linker should also be known to the
1825             dnl runtime loader, otherwise the system is severely misconfigured.)
1826             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1827             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1828           fi
1829         fi
1830       fi
1831     done
1832   done
1833   if test "X$rpathdirs" != "X"; then
1834     if test -n "$acl_hardcode_libdir_separator"; then
1835       dnl Weird platform: only the last -rpath option counts, the user must
1836       dnl pass all path elements in one option. We can arrange that for a
1837       dnl single library, but not when more than one $LIBNAMEs are used.
1838       alldirs=
1839       for found_dir in $rpathdirs; do
1840         alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1841       done
1842       dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1843       acl_save_libdir="$libdir"
1844       libdir="$alldirs"
1845       eval flag=\"$acl_hardcode_libdir_flag_spec\"
1846       libdir="$acl_save_libdir"
1847       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1848     else
1849       dnl The -rpath options are cumulative.
1850       for found_dir in $rpathdirs; do
1851         acl_save_libdir="$libdir"
1852         libdir="$found_dir"
1853         eval flag=\"$acl_hardcode_libdir_flag_spec\"
1854         libdir="$acl_save_libdir"
1855         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1856       done
1857     fi
1858   fi
1859   if test "X$ltrpathdirs" != "X"; then
1860     dnl When using libtool, the option that works for both libraries and
1861     dnl executables is -R. The -R options are cumulative.
1862     for found_dir in $ltrpathdirs; do
1863       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1864     done
1865   fi
1866   popdef([P_A_C_K])
1867   popdef([PACKLIBS])
1868   popdef([PACKUP])
1869   popdef([PACK])
1870   popdef([NAME])
1873 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1874 dnl unless already present in VAR.
1875 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1876 dnl contains two or three consecutive elements that belong together.
1877 AC_DEFUN([AC_LIB_APPENDTOVAR],
1879   for element in [$2]; do
1880     haveit=
1881     for x in $[$1]; do
1882       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1883       if test "X$x" = "X$element"; then
1884         haveit=yes
1885         break
1886       fi
1887     done
1888     if test -z "$haveit"; then
1889       [$1]="${[$1]}${[$1]:+ }$element"
1890     fi
1891   done
1894 dnl For those cases where a variable contains several -L and -l options
1895 dnl referring to unknown libraries and directories, this macro determines the
1896 dnl necessary additional linker options for the runtime path.
1897 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1898 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1899 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1900 dnl otherwise linking without libtool is assumed.
1901 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1903   AC_REQUIRE([AC_LIB_RPATH])
1904   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1905   $1=
1906   if test "$enable_rpath" != no; then
1907     if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1908       dnl Use an explicit option to hardcode directories into the resulting
1909       dnl binary.
1910       rpathdirs=
1911       next=
1912       for opt in $2; do
1913         if test -n "$next"; then
1914           dir="$next"
1915           dnl No need to hardcode the standard /usr/lib.
1916           if test "X$dir" != "X/usr/$acl_libdirstem" \
1917              && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1918             rpathdirs="$rpathdirs $dir"
1919           fi
1920           next=
1921         else
1922           case $opt in
1923             -L) next=yes ;;
1924             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1925                  dnl No need to hardcode the standard /usr/lib.
1926                  if test "X$dir" != "X/usr/$acl_libdirstem" \
1927                     && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1928                    rpathdirs="$rpathdirs $dir"
1929                  fi
1930                  next= ;;
1931             *) next= ;;
1932           esac
1933         fi
1934       done
1935       if test "X$rpathdirs" != "X"; then
1936         if test -n ""$3""; then
1937           dnl libtool is used for linking. Use -R options.
1938           for dir in $rpathdirs; do
1939             $1="${$1}${$1:+ }-R$dir"
1940           done
1941         else
1942           dnl The linker is used for linking directly.
1943           if test -n "$acl_hardcode_libdir_separator"; then
1944             dnl Weird platform: only the last -rpath option counts, the user
1945             dnl must pass all path elements in one option.
1946             alldirs=
1947             for dir in $rpathdirs; do
1948               alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1949             done
1950             acl_save_libdir="$libdir"
1951             libdir="$alldirs"
1952             eval flag=\"$acl_hardcode_libdir_flag_spec\"
1953             libdir="$acl_save_libdir"
1954             $1="$flag"
1955           else
1956             dnl The -rpath options are cumulative.
1957             for dir in $rpathdirs; do
1958               acl_save_libdir="$libdir"
1959               libdir="$dir"
1960               eval flag=\"$acl_hardcode_libdir_flag_spec\"
1961               libdir="$acl_save_libdir"
1962               $1="${$1}${$1:+ }$flag"
1963             done
1964           fi
1965         fi
1966       fi
1967     fi
1968   fi
1969   AC_SUBST([$1])
1972 # lib-prefix.m4 serial 7 (gettext-0.18)
1973 dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
1974 dnl This file is free software; the Free Software Foundation
1975 dnl gives unlimited permission to copy and/or distribute it,
1976 dnl with or without modifications, as long as this notice is preserved.
1978 dnl From Bruno Haible.
1980 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1981 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1982 dnl require excessive bracketing.
1983 ifdef([AC_HELP_STRING],
1984 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1985 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1987 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1988 dnl to access previously installed libraries. The basic assumption is that
1989 dnl a user will want packages to use other packages he previously installed
1990 dnl with the same --prefix option.
1991 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1992 dnl libraries, but is otherwise very convenient.
1993 AC_DEFUN([AC_LIB_PREFIX],
1995   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1996   AC_REQUIRE([AC_PROG_CC])
1997   AC_REQUIRE([AC_CANONICAL_HOST])
1998   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1999   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2000   dnl By default, look in $includedir and $libdir.
2001   use_additional=yes
2002   AC_LIB_WITH_FINAL_PREFIX([
2003     eval additional_includedir=\"$includedir\"
2004     eval additional_libdir=\"$libdir\"
2005   ])
2006   AC_LIB_ARG_WITH([lib-prefix],
2007 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2008   --without-lib-prefix    don't search for libraries in includedir and libdir],
2010     if test "X$withval" = "Xno"; then
2011       use_additional=no
2012     else
2013       if test "X$withval" = "X"; then
2014         AC_LIB_WITH_FINAL_PREFIX([
2015           eval additional_includedir=\"$includedir\"
2016           eval additional_libdir=\"$libdir\"
2017         ])
2018       else
2019         additional_includedir="$withval/include"
2020         additional_libdir="$withval/$acl_libdirstem"
2021       fi
2022     fi
2024   if test $use_additional = yes; then
2025     dnl Potentially add $additional_includedir to $CPPFLAGS.
2026     dnl But don't add it
2027     dnl   1. if it's the standard /usr/include,
2028     dnl   2. if it's already present in $CPPFLAGS,
2029     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
2030     dnl   4. if it doesn't exist as a directory.
2031     if test "X$additional_includedir" != "X/usr/include"; then
2032       haveit=
2033       for x in $CPPFLAGS; do
2034         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2035         if test "X$x" = "X-I$additional_includedir"; then
2036           haveit=yes
2037           break
2038         fi
2039       done
2040       if test -z "$haveit"; then
2041         if test "X$additional_includedir" = "X/usr/local/include"; then
2042           if test -n "$GCC"; then
2043             case $host_os in
2044               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2045             esac
2046           fi
2047         fi
2048         if test -z "$haveit"; then
2049           if test -d "$additional_includedir"; then
2050             dnl Really add $additional_includedir to $CPPFLAGS.
2051             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2052           fi
2053         fi
2054       fi
2055     fi
2056     dnl Potentially add $additional_libdir to $LDFLAGS.
2057     dnl But don't add it
2058     dnl   1. if it's the standard /usr/lib,
2059     dnl   2. if it's already present in $LDFLAGS,
2060     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
2061     dnl   4. if it doesn't exist as a directory.
2062     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2063       haveit=
2064       for x in $LDFLAGS; do
2065         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2066         if test "X$x" = "X-L$additional_libdir"; then
2067           haveit=yes
2068           break
2069         fi
2070       done
2071       if test -z "$haveit"; then
2072         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2073           if test -n "$GCC"; then
2074             case $host_os in
2075               linux*) haveit=yes;;
2076             esac
2077           fi
2078         fi
2079         if test -z "$haveit"; then
2080           if test -d "$additional_libdir"; then
2081             dnl Really add $additional_libdir to $LDFLAGS.
2082             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2083           fi
2084         fi
2085       fi
2086     fi
2087   fi
2090 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2091 dnl acl_final_exec_prefix, containing the values to which $prefix and
2092 dnl $exec_prefix will expand at the end of the configure script.
2093 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2095   dnl Unfortunately, prefix and exec_prefix get only finally determined
2096   dnl at the end of configure.
2097   if test "X$prefix" = "XNONE"; then
2098     acl_final_prefix="$ac_default_prefix"
2099   else
2100     acl_final_prefix="$prefix"
2101   fi
2102   if test "X$exec_prefix" = "XNONE"; then
2103     acl_final_exec_prefix='${prefix}'
2104   else
2105     acl_final_exec_prefix="$exec_prefix"
2106   fi
2107   acl_save_prefix="$prefix"
2108   prefix="$acl_final_prefix"
2109   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2110   prefix="$acl_save_prefix"
2113 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2114 dnl variables prefix and exec_prefix bound to the values they will have
2115 dnl at the end of the configure script.
2116 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2118   acl_save_prefix="$prefix"
2119   prefix="$acl_final_prefix"
2120   acl_save_exec_prefix="$exec_prefix"
2121   exec_prefix="$acl_final_exec_prefix"
2122   $1
2123   exec_prefix="$acl_save_exec_prefix"
2124   prefix="$acl_save_prefix"
2127 dnl AC_LIB_PREPARE_MULTILIB creates
2128 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
2129 dnl   "lib" or "lib64" or "lib/64",
2130 dnl - a variable acl_libdirstem2, as a secondary possible value for
2131 dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
2132 dnl   "lib/amd64".
2133 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2135   dnl There is no formal standard regarding lib and lib64.
2136   dnl On glibc systems, the current practice is that on a system supporting
2137   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2138   dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
2139   dnl the compiler's default mode by looking at the compiler's library search
2140   dnl path. If at least one of its elements ends in /lib64 or points to a
2141   dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
2142   dnl Otherwise we use the default, namely "lib".
2143   dnl On Solaris systems, the current practice is that on a system supporting
2144   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2145   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
2146   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
2147   AC_REQUIRE([AC_CANONICAL_HOST])
2148   acl_libdirstem=lib
2149   acl_libdirstem2=
2150   case "$host_os" in
2151     solaris*)
2152       dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
2153       dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
2154       dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
2155       dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
2156       dnl symlink is missing, so we set acl_libdirstem2 too.
2157       AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
2158         [AC_EGREP_CPP([sixtyfour bits], [
2159 #ifdef _LP64
2160 sixtyfour bits
2161 #endif
2162            ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
2163         ])
2164       if test $gl_cv_solaris_64bit = yes; then
2165         acl_libdirstem=lib/64
2166         case "$host_cpu" in
2167           sparc*)        acl_libdirstem2=lib/sparcv9 ;;
2168           i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
2169         esac
2170       fi
2171       ;;
2172     *)
2173       searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2174       if test -n "$searchpath"; then
2175         acl_save_IFS="${IFS=    }"; IFS=":"
2176         for searchdir in $searchpath; do
2177           if test -d "$searchdir"; then
2178             case "$searchdir" in
2179               */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2180               */../ | */.. )
2181                 # Better ignore directories of this form. They are misleading.
2182                 ;;
2183               *) searchdir=`cd "$searchdir" && pwd`
2184                  case "$searchdir" in
2185                    */lib64 ) acl_libdirstem=lib64 ;;
2186                  esac ;;
2187             esac
2188           fi
2189         done
2190         IFS="$acl_save_IFS"
2191       fi
2192       ;;
2193   esac
2194   test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
2197 # nls.m4 serial 5 (gettext-0.18)
2198 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
2199 dnl Inc.
2200 dnl This file is free software; the Free Software Foundation
2201 dnl gives unlimited permission to copy and/or distribute it,
2202 dnl with or without modifications, as long as this notice is preserved.
2204 dnl This file can can be used in projects which are not available under
2205 dnl the GNU General Public License or the GNU Library General Public
2206 dnl License but which still want to provide support for the GNU gettext
2207 dnl functionality.
2208 dnl Please note that the actual code of the GNU gettext library is covered
2209 dnl by the GNU Library General Public License, and the rest of the GNU
2210 dnl gettext package package is covered by the GNU General Public License.
2211 dnl They are *not* in the public domain.
2213 dnl Authors:
2214 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2215 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2217 AC_PREREQ([2.50])
2219 AC_DEFUN([AM_NLS],
2221   AC_MSG_CHECKING([whether NLS is requested])
2222   dnl Default is enabled NLS
2223   AC_ARG_ENABLE([nls],
2224     [  --disable-nls           do not use Native Language Support],
2225     USE_NLS=$enableval, USE_NLS=yes)
2226   AC_MSG_RESULT([$USE_NLS])
2227   AC_SUBST([USE_NLS])
2230 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2231 # serial 1 (pkg-config-0.24)
2233 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
2235 # This program is free software; you can redistribute it and/or modify
2236 # it under the terms of the GNU General Public License as published by
2237 # the Free Software Foundation; either version 2 of the License, or
2238 # (at your option) any later version.
2240 # This program is distributed in the hope that it will be useful, but
2241 # WITHOUT ANY WARRANTY; without even the implied warranty of
2242 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2243 # General Public License for more details.
2245 # You should have received a copy of the GNU General Public License
2246 # along with this program; if not, write to the Free Software
2247 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2249 # As a special exception to the GNU General Public License, if you
2250 # distribute this file as part of a program that contains a
2251 # configuration script generated by Autoconf, you may include it under
2252 # the same distribution terms that you use for the rest of that program.
2254 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
2255 # ----------------------------------
2256 AC_DEFUN([PKG_PROG_PKG_CONFIG],
2257 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2258 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
2259 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
2260 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
2261 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
2262 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
2264 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2265         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2267 if test -n "$PKG_CONFIG"; then
2268         _pkg_min_version=m4_default([$1], [0.9.0])
2269         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2270         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2271                 AC_MSG_RESULT([yes])
2272         else
2273                 AC_MSG_RESULT([no])
2274                 PKG_CONFIG=""
2275         fi
2276 fi[]dnl
2277 ])# PKG_PROG_PKG_CONFIG
2279 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2281 # Check to see whether a particular set of modules exists.  Similar
2282 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
2284 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2285 # only at the first occurence in configure.ac, so if the first place
2286 # it's called might be skipped (such as if it is within an "if", you
2287 # have to call PKG_CHECK_EXISTS manually
2288 # --------------------------------------------------------------
2289 AC_DEFUN([PKG_CHECK_EXISTS],
2290 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2291 if test -n "$PKG_CONFIG" && \
2292     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2293   m4_default([$2], [:])
2294 m4_ifvaln([$3], [else
2295   $3])dnl
2296 fi])
2298 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2299 # ---------------------------------------------
2300 m4_define([_PKG_CONFIG],
2301 [if test -n "$$1"; then
2302     pkg_cv_[]$1="$$1"
2303  elif test -n "$PKG_CONFIG"; then
2304     PKG_CHECK_EXISTS([$3],
2305                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
2306                       test "x$?" != "x0" && pkg_failed=yes ],
2307                      [pkg_failed=yes])
2308  else
2309     pkg_failed=untried
2310 fi[]dnl
2311 ])# _PKG_CONFIG
2313 # _PKG_SHORT_ERRORS_SUPPORTED
2314 # -----------------------------
2315 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2316 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2317 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2318         _pkg_short_errors_supported=yes
2319 else
2320         _pkg_short_errors_supported=no
2321 fi[]dnl
2322 ])# _PKG_SHORT_ERRORS_SUPPORTED
2325 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2326 # [ACTION-IF-NOT-FOUND])
2329 # Note that if there is a possibility the first call to
2330 # PKG_CHECK_MODULES might not happen, you should be sure to include an
2331 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2334 # --------------------------------------------------------------
2335 AC_DEFUN([PKG_CHECK_MODULES],
2336 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2337 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2338 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2340 pkg_failed=no
2341 AC_MSG_CHECKING([for $1])
2343 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2344 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
2346 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2347 and $1[]_LIBS to avoid the need to call pkg-config.
2348 See the pkg-config man page for more details.])
2350 if test $pkg_failed = yes; then
2351         AC_MSG_RESULT([no])
2352         _PKG_SHORT_ERRORS_SUPPORTED
2353         if test $_pkg_short_errors_supported = yes; then
2354                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
2355         else 
2356                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
2357         fi
2358         # Put the nasty error message in config.log where it belongs
2359         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2361         m4_default([$4], [AC_MSG_ERROR(
2362 [Package requirements ($2) were not met:
2364 $$1_PKG_ERRORS
2366 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2367 installed software in a non-standard prefix.
2369 _PKG_TEXT])[]dnl
2370         ])
2371 elif test $pkg_failed = untried; then
2372         AC_MSG_RESULT([no])
2373         m4_default([$4], [AC_MSG_FAILURE(
2374 [The pkg-config script could not be found or is too old.  Make sure it
2375 is in your PATH or set the PKG_CONFIG environment variable to the full
2376 path to pkg-config.
2378 _PKG_TEXT
2380 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
2381         ])
2382 else
2383         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2384         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2385         AC_MSG_RESULT([yes])
2386         $3
2387 fi[]dnl
2388 ])# PKG_CHECK_MODULES
2390 # po.m4 serial 17 (gettext-0.18)
2391 dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
2392 dnl This file is free software; the Free Software Foundation
2393 dnl gives unlimited permission to copy and/or distribute it,
2394 dnl with or without modifications, as long as this notice is preserved.
2396 dnl This file can can be used in projects which are not available under
2397 dnl the GNU General Public License or the GNU Library General Public
2398 dnl License but which still want to provide support for the GNU gettext
2399 dnl functionality.
2400 dnl Please note that the actual code of the GNU gettext library is covered
2401 dnl by the GNU Library General Public License, and the rest of the GNU
2402 dnl gettext package package is covered by the GNU General Public License.
2403 dnl They are *not* in the public domain.
2405 dnl Authors:
2406 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2407 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2409 AC_PREREQ([2.50])
2411 dnl Checks for all prerequisites of the po subdirectory.
2412 AC_DEFUN([AM_PO_SUBDIRS],
2414   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2415   AC_REQUIRE([AC_PROG_INSTALL])dnl
2416   AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
2417   AC_REQUIRE([AM_NLS])dnl
2419   dnl Release version of the gettext macros. This is used to ensure that
2420   dnl the gettext macros and po/Makefile.in.in are in sync.
2421   AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
2423   dnl Perform the following tests also if --disable-nls has been given,
2424   dnl because they are needed for "make dist" to work.
2426   dnl Search for GNU msgfmt in the PATH.
2427   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2428   dnl The second test excludes FreeBSD msgfmt.
2429   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2430     [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2431      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2432     :)
2433   AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
2435   dnl Test whether it is GNU msgfmt >= 0.15.
2436 changequote(,)dnl
2437   case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2438     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2439     *) MSGFMT_015=$MSGFMT ;;
2440   esac
2441 changequote([,])dnl
2442   AC_SUBST([MSGFMT_015])
2443 changequote(,)dnl
2444   case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2445     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2446     *) GMSGFMT_015=$GMSGFMT ;;
2447   esac
2448 changequote([,])dnl
2449   AC_SUBST([GMSGFMT_015])
2451   dnl Search for GNU xgettext 0.12 or newer in the PATH.
2452   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2453   dnl The second test excludes FreeBSD xgettext.
2454   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2455     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2456      (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2457     :)
2458   dnl Remove leftover from FreeBSD xgettext call.
2459   rm -f messages.po
2461   dnl Test whether it is GNU xgettext >= 0.15.
2462 changequote(,)dnl
2463   case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2464     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2465     *) XGETTEXT_015=$XGETTEXT ;;
2466   esac
2467 changequote([,])dnl
2468   AC_SUBST([XGETTEXT_015])
2470   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2471   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2472     [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2474   dnl Installation directories.
2475   dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2476   dnl have to define it here, so that it can be used in po/Makefile.
2477   test -n "$localedir" || localedir='${datadir}/locale'
2478   AC_SUBST([localedir])
2480   dnl Support for AM_XGETTEXT_OPTION.
2481   test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2482   AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2484   AC_CONFIG_COMMANDS([po-directories], [[
2485     for ac_file in $CONFIG_FILES; do
2486       # Support "outfile[:infile[:infile...]]"
2487       case "$ac_file" in
2488         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2489       esac
2490       # PO directories have a Makefile.in generated from Makefile.in.in.
2491       case "$ac_file" in */Makefile.in)
2492         # Adjust a relative srcdir.
2493         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2494         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2495         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2496         # In autoconf-2.13 it is called $ac_given_srcdir.
2497         # In autoconf-2.50 it is called $srcdir.
2498         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2499         case "$ac_given_srcdir" in
2500           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2501           /*) top_srcdir="$ac_given_srcdir" ;;
2502           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2503         esac
2504         # Treat a directory as a PO directory if and only if it has a
2505         # POTFILES.in file. This allows packages to have multiple PO
2506         # directories under different names or in different locations.
2507         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2508           rm -f "$ac_dir/POTFILES"
2509           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2510           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2511           POMAKEFILEDEPS="POTFILES.in"
2512           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2513           # on $ac_dir but don't depend on user-specified configuration
2514           # parameters.
2515           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2516             # The LINGUAS file contains the set of available languages.
2517             if test -n "$OBSOLETE_ALL_LINGUAS"; then
2518               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2519             fi
2520             ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2521             # Hide the ALL_LINGUAS assigment from automake < 1.5.
2522             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2523             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2524           else
2525             # The set of available languages was given in configure.in.
2526             # Hide the ALL_LINGUAS assigment from automake < 1.5.
2527             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2528           fi
2529           # Compute POFILES
2530           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2531           # Compute UPDATEPOFILES
2532           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2533           # Compute DUMMYPOFILES
2534           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2535           # Compute GMOFILES
2536           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2537           case "$ac_given_srcdir" in
2538             .) srcdirpre= ;;
2539             *) srcdirpre='$(srcdir)/' ;;
2540           esac
2541           POFILES=
2542           UPDATEPOFILES=
2543           DUMMYPOFILES=
2544           GMOFILES=
2545           for lang in $ALL_LINGUAS; do
2546             POFILES="$POFILES $srcdirpre$lang.po"
2547             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2548             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2549             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2550           done
2551           # CATALOGS depends on both $ac_dir and the user's LINGUAS
2552           # environment variable.
2553           INST_LINGUAS=
2554           if test -n "$ALL_LINGUAS"; then
2555             for presentlang in $ALL_LINGUAS; do
2556               useit=no
2557               if test "%UNSET%" != "$LINGUAS"; then
2558                 desiredlanguages="$LINGUAS"
2559               else
2560                 desiredlanguages="$ALL_LINGUAS"
2561               fi
2562               for desiredlang in $desiredlanguages; do
2563                 # Use the presentlang catalog if desiredlang is
2564                 #   a. equal to presentlang, or
2565                 #   b. a variant of presentlang (because in this case,
2566                 #      presentlang can be used as a fallback for messages
2567                 #      which are not translated in the desiredlang catalog).
2568                 case "$desiredlang" in
2569                   "$presentlang"*) useit=yes;;
2570                 esac
2571               done
2572               if test $useit = yes; then
2573                 INST_LINGUAS="$INST_LINGUAS $presentlang"
2574               fi
2575             done
2576           fi
2577           CATALOGS=
2578           if test -n "$INST_LINGUAS"; then
2579             for lang in $INST_LINGUAS; do
2580               CATALOGS="$CATALOGS $lang.gmo"
2581             done
2582           fi
2583           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2584           sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
2585           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2586             if test -f "$f"; then
2587               case "$f" in
2588                 *.orig | *.bak | *~) ;;
2589                 *) cat "$f" >> "$ac_dir/Makefile" ;;
2590               esac
2591             fi
2592           done
2593         fi
2594         ;;
2595       esac
2596     done]],
2597    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2598     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2599     # from automake < 1.5.
2600     eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2601     # Capture the value of LINGUAS because we need it to compute CATALOGS.
2602     LINGUAS="${LINGUAS-%UNSET%}"
2603    ])
2606 dnl Postprocesses a Makefile in a directory containing PO files.
2607 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2609   # When this code is run, in config.status, two variables have already been
2610   # set:
2611   # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2612   # - LINGUAS is the value of the environment variable LINGUAS at configure
2613   #   time.
2615 changequote(,)dnl
2616   # Adjust a relative srcdir.
2617   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2618   ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2619   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2620   # In autoconf-2.13 it is called $ac_given_srcdir.
2621   # In autoconf-2.50 it is called $srcdir.
2622   test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2623   case "$ac_given_srcdir" in
2624     .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2625     /*) top_srcdir="$ac_given_srcdir" ;;
2626     *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2627   esac
2629   # Find a way to echo strings without interpreting backslash.
2630   if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2631     gt_echo='echo'
2632   else
2633     if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2634       gt_echo='printf %s\n'
2635     else
2636       echo_func () {
2637         cat <<EOT
2640       }
2641       gt_echo='echo_func'
2642     fi
2643   fi
2645   # A sed script that extracts the value of VARIABLE from a Makefile.
2646   sed_x_variable='
2647 # Test if the hold space is empty.
2649 s/P/P/
2652 # Yes it was empty. Look if we have the expected variable definition.
2653 /^[      ]*VARIABLE[     ]*=/{
2654   # Seen the first line of the variable definition.
2655   s/^[   ]*VARIABLE[     ]*=//
2656   ba
2660 # Here we are processing a line from the variable definition.
2661 # Remove comment, more precisely replace it with a space.
2662 s/#.*$/ /
2663 # See if the line ends in a backslash.
2666 s/\\$//
2667 # Print the line, without the trailing backslash.
2670 # There was no trailing backslash. The end of the variable definition is
2671 # reached. Clear the hold space.
2672 s/^.*$//
2676 # A trailing backslash means that the variable definition continues in the
2677 # next line. Put a nonempty string into the hold space to indicate this.
2678 s/^.*$/P/
2682 changequote([,])dnl
2684   # Set POTFILES to the value of the Makefile variable POTFILES.
2685   sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2686   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2687   # Compute POTFILES_DEPS as
2688   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2689   POTFILES_DEPS=
2690   for file in $POTFILES; do
2691     POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2692   done
2693   POMAKEFILEDEPS=""
2695   if test -n "$OBSOLETE_ALL_LINGUAS"; then
2696     test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2697   fi
2698   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2699     # The LINGUAS file contains the set of available languages.
2700     ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2701     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2702   else
2703     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2704     sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2705     ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2706   fi
2707   # Hide the ALL_LINGUAS assigment from automake < 1.5.
2708   eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2709   # Compute POFILES
2710   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2711   # Compute UPDATEPOFILES
2712   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2713   # Compute DUMMYPOFILES
2714   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2715   # Compute GMOFILES
2716   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2717   # Compute PROPERTIESFILES
2718   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2719   # Compute CLASSFILES
2720   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2721   # Compute QMFILES
2722   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2723   # Compute MSGFILES
2724   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2725   # Compute RESOURCESDLLFILES
2726   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2727   case "$ac_given_srcdir" in
2728     .) srcdirpre= ;;
2729     *) srcdirpre='$(srcdir)/' ;;
2730   esac
2731   POFILES=
2732   UPDATEPOFILES=
2733   DUMMYPOFILES=
2734   GMOFILES=
2735   PROPERTIESFILES=
2736   CLASSFILES=
2737   QMFILES=
2738   MSGFILES=
2739   RESOURCESDLLFILES=
2740   for lang in $ALL_LINGUAS; do
2741     POFILES="$POFILES $srcdirpre$lang.po"
2742     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2743     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2744     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2745     PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2746     CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2747     QMFILES="$QMFILES $srcdirpre$lang.qm"
2748     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2749     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2750     frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2751     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2752   done
2753   # CATALOGS depends on both $ac_dir and the user's LINGUAS
2754   # environment variable.
2755   INST_LINGUAS=
2756   if test -n "$ALL_LINGUAS"; then
2757     for presentlang in $ALL_LINGUAS; do
2758       useit=no
2759       if test "%UNSET%" != "$LINGUAS"; then
2760         desiredlanguages="$LINGUAS"
2761       else
2762         desiredlanguages="$ALL_LINGUAS"
2763       fi
2764       for desiredlang in $desiredlanguages; do
2765         # Use the presentlang catalog if desiredlang is
2766         #   a. equal to presentlang, or
2767         #   b. a variant of presentlang (because in this case,
2768         #      presentlang can be used as a fallback for messages
2769         #      which are not translated in the desiredlang catalog).
2770         case "$desiredlang" in
2771           "$presentlang"*) useit=yes;;
2772         esac
2773       done
2774       if test $useit = yes; then
2775         INST_LINGUAS="$INST_LINGUAS $presentlang"
2776       fi
2777     done
2778   fi
2779   CATALOGS=
2780   JAVACATALOGS=
2781   QTCATALOGS=
2782   TCLCATALOGS=
2783   CSHARPCATALOGS=
2784   if test -n "$INST_LINGUAS"; then
2785     for lang in $INST_LINGUAS; do
2786       CATALOGS="$CATALOGS $lang.gmo"
2787       JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2788       QTCATALOGS="$QTCATALOGS $lang.qm"
2789       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2790       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2791       frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2792       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2793     done
2794   fi
2796   sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
2797   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2798     # Add dependencies that cannot be formulated as a simple suffix rule.
2799     for lang in $ALL_LINGUAS; do
2800       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2801       cat >> "$ac_file.tmp" <<EOF
2802 $frobbedlang.msg: $lang.po
2803         @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2804         \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2806     done
2807   fi
2808   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2809     # Add dependencies that cannot be formulated as a simple suffix rule.
2810     for lang in $ALL_LINGUAS; do
2811       frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2812       cat >> "$ac_file.tmp" <<EOF
2813 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2814         @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2815         \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2817     done
2818   fi
2819   if test -n "$POMAKEFILEDEPS"; then
2820     cat >> "$ac_file.tmp" <<EOF
2821 Makefile: $POMAKEFILEDEPS
2823   fi
2824   mv "$ac_file.tmp" "$ac_file"
2827 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2828 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2830   XGETTEXT_EXTRA_OPTIONS=
2833 dnl Registers an option to be passed to xgettext in the po subdirectory.
2834 AC_DEFUN([AM_XGETTEXT_OPTION],
2836   AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2837   XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
2840 # progtest.m4 serial 6 (gettext-0.18)
2841 dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
2842 dnl This file is free software; the Free Software Foundation
2843 dnl gives unlimited permission to copy and/or distribute it,
2844 dnl with or without modifications, as long as this notice is preserved.
2846 dnl This file can can be used in projects which are not available under
2847 dnl the GNU General Public License or the GNU Library General Public
2848 dnl License but which still want to provide support for the GNU gettext
2849 dnl functionality.
2850 dnl Please note that the actual code of the GNU gettext library is covered
2851 dnl by the GNU Library General Public License, and the rest of the GNU
2852 dnl gettext package package is covered by the GNU General Public License.
2853 dnl They are *not* in the public domain.
2855 dnl Authors:
2856 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2858 AC_PREREQ([2.50])
2860 # Search path for a program which passes the given test.
2862 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2863 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2864 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2866 # Prepare PATH_SEPARATOR.
2867 # The user is always right.
2868 if test "${PATH_SEPARATOR+set}" != set; then
2869   echo "#! /bin/sh" >conf$$.sh
2870   echo  "exit 0"   >>conf$$.sh
2871   chmod +x conf$$.sh
2872   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2873     PATH_SEPARATOR=';'
2874   else
2875     PATH_SEPARATOR=:
2876   fi
2877   rm -f conf$$.sh
2880 # Find out how to test for executable files. Don't use a zero-byte file,
2881 # as systems may use methods other than mode bits to determine executability.
2882 cat >conf$$.file <<_ASEOF
2883 #! /bin/sh
2884 exit 0
2885 _ASEOF
2886 chmod +x conf$$.file
2887 if test -x conf$$.file >/dev/null 2>&1; then
2888   ac_executable_p="test -x"
2889 else
2890   ac_executable_p="test -f"
2892 rm -f conf$$.file
2894 # Extract the first word of "$2", so it can be a program name with args.
2895 set dummy $2; ac_word=[$]2
2896 AC_MSG_CHECKING([for $ac_word])
2897 AC_CACHE_VAL([ac_cv_path_$1],
2898 [case "[$]$1" in
2899   [[\\/]]* | ?:[[\\/]]*)
2900     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2901     ;;
2902   *)
2903     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2904     for ac_dir in ifelse([$5], , $PATH, [$5]); do
2905       IFS="$ac_save_IFS"
2906       test -z "$ac_dir" && ac_dir=.
2907       for ac_exec_ext in '' $ac_executable_extensions; do
2908         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2909           echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2910           if [$3]; then
2911             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2912             break 2
2913           fi
2914         fi
2915       done
2916     done
2917     IFS="$ac_save_IFS"
2918 dnl If no 4th arg is given, leave the cache variable unset,
2919 dnl so AC_PATH_PROGS will keep looking.
2920 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2921 ])dnl
2922     ;;
2923 esac])dnl
2924 $1="$ac_cv_path_$1"
2925 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2926   AC_MSG_RESULT([$][$1])
2927 else
2928   AC_MSG_RESULT([no])
2930 AC_SUBST([$1])dnl
2933 # Configure paths for SDL
2934 # Sam Lantinga 9/21/99
2935 # stolen from Manish Singh
2936 # stolen back from Frank Belew
2937 # stolen from Manish Singh
2938 # Shamelessly stolen from Owen Taylor
2940 # serial 1
2942 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
2943 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
2945 AC_DEFUN([AM_PATH_SDL],
2946 [dnl 
2947 dnl Get the cflags and libraries from the sdl-config script
2949 AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
2950             sdl_prefix="$withval", sdl_prefix="")
2951 AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
2952             sdl_exec_prefix="$withval", sdl_exec_prefix="")
2953 AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
2954                     , enable_sdltest=yes)
2956   if test x$sdl_exec_prefix != x ; then
2957     sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
2958     if test x${SDL_CONFIG+set} != xset ; then
2959       SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
2960     fi
2961   fi
2962   if test x$sdl_prefix != x ; then
2963     sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
2964     if test x${SDL_CONFIG+set} != xset ; then
2965       SDL_CONFIG=$sdl_prefix/bin/sdl-config
2966     fi
2967   fi
2969   as_save_PATH="$PATH"
2970   if test "x$prefix" != xNONE; then
2971     PATH="$prefix/bin:$prefix/usr/bin:$PATH"
2972   fi
2973   AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
2974   PATH="$as_save_PATH"
2975   min_sdl_version=ifelse([$1], ,0.11.0,$1)
2976   AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
2977   no_sdl=""
2978   if test "$SDL_CONFIG" = "no" ; then
2979     no_sdl=yes
2980   else
2981     SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
2982     SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
2984     sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
2985            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
2986     sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
2987            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
2988     sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
2989            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
2990     if test "x$enable_sdltest" = "xyes" ; then
2991       ac_save_CFLAGS="$CFLAGS"
2992       ac_save_CXXFLAGS="$CXXFLAGS"
2993       ac_save_LIBS="$LIBS"
2994       CFLAGS="$CFLAGS $SDL_CFLAGS"
2995       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
2996       LIBS="$LIBS $SDL_LIBS"
2998 dnl Now check if the installed SDL is sufficiently new. (Also sanity
2999 dnl checks the results of sdl-config to some extent
3001       rm -f conf.sdltest
3002       AC_TRY_RUN([
3003 #include <stdio.h>
3004 #include <stdlib.h>
3005 #include <string.h>
3006 #include "SDL.h"
3008 char*
3009 my_strdup (char *str)
3011   char *new_str;
3012   
3013   if (str)
3014     {
3015       new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
3016       strcpy (new_str, str);
3017     }
3018   else
3019     new_str = NULL;
3020   
3021   return new_str;
3024 int main (int argc, char *argv[])
3026   int major, minor, micro;
3027   char *tmp_version;
3029   /* This hangs on some systems (?)
3030   system ("touch conf.sdltest");
3031   */
3032   { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
3034   /* HP/UX 9 (%@#!) writes to sscanf strings */
3035   tmp_version = my_strdup("$min_sdl_version");
3036   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
3037      printf("%s, bad version string\n", "$min_sdl_version");
3038      exit(1);
3039    }
3041    if (($sdl_major_version > major) ||
3042       (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
3043       (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
3044     {
3045       return 0;
3046     }
3047   else
3048     {
3049       printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
3050       printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
3051       printf("*** best to upgrade to the required version.\n");
3052       printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
3053       printf("*** to point to the correct copy of sdl-config, and remove the file\n");
3054       printf("*** config.cache before re-running configure\n");
3055       return 1;
3056     }
3059 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
3060        CFLAGS="$ac_save_CFLAGS"
3061        CXXFLAGS="$ac_save_CXXFLAGS"
3062        LIBS="$ac_save_LIBS"
3063      fi
3064   fi
3065   if test "x$no_sdl" = x ; then
3066      AC_MSG_RESULT(yes)
3067      ifelse([$2], , :, [$2])     
3068   else
3069      AC_MSG_RESULT(no)
3070      if test "$SDL_CONFIG" = "no" ; then
3071        echo "*** The sdl-config script installed by SDL could not be found"
3072        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
3073        echo "*** your path, or set the SDL_CONFIG environment variable to the"
3074        echo "*** full path to sdl-config."
3075      else
3076        if test -f conf.sdltest ; then
3077         :
3078        else
3079           echo "*** Could not run SDL test program, checking why..."
3080           CFLAGS="$CFLAGS $SDL_CFLAGS"
3081           CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
3082           LIBS="$LIBS $SDL_LIBS"
3083           AC_TRY_LINK([
3084 #include <stdio.h>
3085 #include "SDL.h"
3087 int main(int argc, char *argv[])
3088 { return 0; }
3089 #undef  main
3090 #define main K_and_R_C_main
3091 ],      [ return 0; ],
3092         [ echo "*** The test program compiled, but did not run. This usually means"
3093           echo "*** that the run-time linker is not finding SDL or finding the wrong"
3094           echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
3095           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
3096           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
3097           echo "*** is required on your system"
3098           echo "***"
3099           echo "*** If you have an old version installed, it is best to remove it, although"
3100           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
3101         [ echo "*** The test program failed to compile or link. See the file config.log for the"
3102           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
3103           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
3104           echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
3105           CFLAGS="$ac_save_CFLAGS"
3106           CXXFLAGS="$ac_save_CXXFLAGS"
3107           LIBS="$ac_save_LIBS"
3108        fi
3109      fi
3110      SDL_CFLAGS=""
3111      SDL_LIBS=""
3112      ifelse([$3], , :, [$3])
3113   fi
3114   AC_SUBST(SDL_CFLAGS)
3115   AC_SUBST(SDL_LIBS)
3116   rm -f conf.sdltest
3119 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
3120 # Foundation, Inc.
3122 # This file is free software; the Free Software Foundation
3123 # gives unlimited permission to copy and/or distribute it,
3124 # with or without modifications, as long as this notice is preserved.
3126 # serial 1
3128 # AM_AUTOMAKE_VERSION(VERSION)
3129 # ----------------------------
3130 # Automake X.Y traces this macro to ensure aclocal.m4 has been
3131 # generated from the m4 files accompanying Automake X.Y.
3132 # (This private macro should not be called outside this file.)
3133 AC_DEFUN([AM_AUTOMAKE_VERSION],
3134 [am__api_version='1.11'
3135 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3136 dnl require some minimum version.  Point them to the right macro.
3137 m4_if([$1], [1.11.6], [],
3138       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3141 # _AM_AUTOCONF_VERSION(VERSION)
3142 # -----------------------------
3143 # aclocal traces this macro to find the Autoconf version.
3144 # This is a private macro too.  Using m4_define simplifies
3145 # the logic in aclocal, which can simply ignore this definition.
3146 m4_define([_AM_AUTOCONF_VERSION], [])
3148 # AM_SET_CURRENT_AUTOMAKE_VERSION
3149 # -------------------------------
3150 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
3151 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
3152 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3153 [AM_AUTOMAKE_VERSION([1.11.6])dnl
3154 m4_ifndef([AC_AUTOCONF_VERSION],
3155   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3156 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
3158 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
3160 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
3162 # This file is free software; the Free Software Foundation
3163 # gives unlimited permission to copy and/or distribute it,
3164 # with or without modifications, as long as this notice is preserved.
3166 # serial 1
3168 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
3169 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
3170 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
3172 # Of course, Automake must honor this variable whenever it calls a
3173 # tool from the auxiliary directory.  The problem is that $srcdir (and
3174 # therefore $ac_aux_dir as well) can be either absolute or relative,
3175 # depending on how configure is run.  This is pretty annoying, since
3176 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
3177 # source directory, any form will work fine, but in subdirectories a
3178 # relative path needs to be adjusted first.
3180 # $ac_aux_dir/missing
3181 #    fails when called from a subdirectory if $ac_aux_dir is relative
3182 # $top_srcdir/$ac_aux_dir/missing
3183 #    fails if $ac_aux_dir is absolute,
3184 #    fails when called from a subdirectory in a VPATH build with
3185 #          a relative $ac_aux_dir
3187 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
3188 # are both prefixed by $srcdir.  In an in-source build this is usually
3189 # harmless because $srcdir is `.', but things will broke when you
3190 # start a VPATH build or use an absolute $srcdir.
3192 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
3193 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
3194 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
3195 # and then we would define $MISSING as
3196 #   MISSING="\${SHELL} $am_aux_dir/missing"
3197 # This will work as long as MISSING is not called from configure, because
3198 # unfortunately $(top_srcdir) has no meaning in configure.
3199 # However there are other variables, like CC, which are often used in
3200 # configure, and could therefore not use this "fixed" $ac_aux_dir.
3202 # Another solution, used here, is to always expand $ac_aux_dir to an
3203 # absolute PATH.  The drawback is that using absolute paths prevent a
3204 # configured tree to be moved without reconfiguration.
3206 AC_DEFUN([AM_AUX_DIR_EXPAND],
3207 [dnl Rely on autoconf to set up CDPATH properly.
3208 AC_PREREQ([2.50])dnl
3209 # expand $ac_aux_dir to an absolute path
3210 am_aux_dir=`cd $ac_aux_dir && pwd`
3213 # AM_CONDITIONAL                                            -*- Autoconf -*-
3215 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
3216 # Free Software Foundation, Inc.
3218 # This file is free software; the Free Software Foundation
3219 # gives unlimited permission to copy and/or distribute it,
3220 # with or without modifications, as long as this notice is preserved.
3222 # serial 9
3224 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
3225 # -------------------------------------
3226 # Define a conditional.
3227 AC_DEFUN([AM_CONDITIONAL],
3228 [AC_PREREQ(2.52)dnl
3229  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
3230         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
3231 AC_SUBST([$1_TRUE])dnl
3232 AC_SUBST([$1_FALSE])dnl
3233 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
3234 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
3235 m4_define([_AM_COND_VALUE_$1], [$2])dnl
3236 if $2; then
3237   $1_TRUE=
3238   $1_FALSE='#'
3239 else
3240   $1_TRUE='#'
3241   $1_FALSE=
3243 AC_CONFIG_COMMANDS_PRE(
3244 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3245   AC_MSG_ERROR([[conditional "$1" was never defined.
3246 Usually this means the macro was only invoked conditionally.]])
3247 fi])])
3249 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
3250 # 2010, 2011 Free Software Foundation, Inc.
3252 # This file is free software; the Free Software Foundation
3253 # gives unlimited permission to copy and/or distribute it,
3254 # with or without modifications, as long as this notice is preserved.
3256 # serial 12
3258 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
3259 # written in clear, in which case automake, when reading aclocal.m4,
3260 # will think it sees a *use*, and therefore will trigger all it's
3261 # C support machinery.  Also note that it means that autoscan, seeing
3262 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
3265 # _AM_DEPENDENCIES(NAME)
3266 # ----------------------
3267 # See how the compiler implements dependency checking.
3268 # NAME is "CC", "CXX", "GCJ", or "OBJC".
3269 # We try a few techniques and use that to set a single cache variable.
3271 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3272 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3273 # dependency, and given that the user is not expected to run this macro,
3274 # just rely on AC_PROG_CC.
3275 AC_DEFUN([_AM_DEPENDENCIES],
3276 [AC_REQUIRE([AM_SET_DEPDIR])dnl
3277 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3278 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
3279 AC_REQUIRE([AM_DEP_TRACK])dnl
3281 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
3282        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
3283        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3284        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
3285        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
3286                    [depcc="$$1"   am_compiler_list=])
3288 AC_CACHE_CHECK([dependency style of $depcc],
3289                [am_cv_$1_dependencies_compiler_type],
3290 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3291   # We make a subdir and do the tests there.  Otherwise we can end up
3292   # making bogus files that we don't know about and never remove.  For
3293   # instance it was reported that on HP-UX the gcc test will end up
3294   # making a dummy file named `D' -- because `-MD' means `put the output
3295   # in D'.
3296   rm -rf conftest.dir
3297   mkdir conftest.dir
3298   # Copy depcomp to subdir because otherwise we won't find it if we're
3299   # using a relative directory.
3300   cp "$am_depcomp" conftest.dir
3301   cd conftest.dir
3302   # We will build objects and dependencies in a subdirectory because
3303   # it helps to detect inapplicable dependency modes.  For instance
3304   # both Tru64's cc and ICC support -MD to output dependencies as a
3305   # side effect of compilation, but ICC will put the dependencies in
3306   # the current directory while Tru64 will put them in the object
3307   # directory.
3308   mkdir sub
3310   am_cv_$1_dependencies_compiler_type=none
3311   if test "$am_compiler_list" = ""; then
3312      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3313   fi
3314   am__universal=false
3315   m4_case([$1], [CC],
3316     [case " $depcc " in #(
3317      *\ -arch\ *\ -arch\ *) am__universal=true ;;
3318      esac],
3319     [CXX],
3320     [case " $depcc " in #(
3321      *\ -arch\ *\ -arch\ *) am__universal=true ;;
3322      esac])
3324   for depmode in $am_compiler_list; do
3325     # Setup a source with many dependencies, because some compilers
3326     # like to wrap large dependency lists on column 80 (with \), and
3327     # we should not choose a depcomp mode which is confused by this.
3328     #
3329     # We need to recreate these files for each test, as the compiler may
3330     # overwrite some of them when testing with obscure command lines.
3331     # This happens at least with the AIX C compiler.
3332     : > sub/conftest.c
3333     for i in 1 2 3 4 5 6; do
3334       echo '#include "conftst'$i'.h"' >> sub/conftest.c
3335       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3336       # Solaris 8's {/usr,}/bin/sh.
3337       touch sub/conftst$i.h
3338     done
3339     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3341     # We check with `-c' and `-o' for the sake of the "dashmstdout"
3342     # mode.  It turns out that the SunPro C++ compiler does not properly
3343     # handle `-M -o', and we need to detect this.  Also, some Intel
3344     # versions had trouble with output in subdirs
3345     am__obj=sub/conftest.${OBJEXT-o}
3346     am__minus_obj="-o $am__obj"
3347     case $depmode in
3348     gcc)
3349       # This depmode causes a compiler race in universal mode.
3350       test "$am__universal" = false || continue
3351       ;;
3352     nosideeffect)
3353       # after this tag, mechanisms are not by side-effect, so they'll
3354       # only be used when explicitly requested
3355       if test "x$enable_dependency_tracking" = xyes; then
3356         continue
3357       else
3358         break
3359       fi
3360       ;;
3361     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3362       # This compiler won't grok `-c -o', but also, the minuso test has
3363       # not run yet.  These depmodes are late enough in the game, and
3364       # so weak that their functioning should not be impacted.
3365       am__obj=conftest.${OBJEXT-o}
3366       am__minus_obj=
3367       ;;
3368     none) break ;;
3369     esac
3370     if depmode=$depmode \
3371        source=sub/conftest.c object=$am__obj \
3372        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3373        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3374          >/dev/null 2>conftest.err &&
3375        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3376        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3377        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3378        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3379       # icc doesn't choke on unknown options, it will just issue warnings
3380       # or remarks (even with -Werror).  So we grep stderr for any message
3381       # that says an option was ignored or not supported.
3382       # When given -MP, icc 7.0 and 7.1 complain thusly:
3383       #   icc: Command line warning: ignoring option '-M'; no argument required
3384       # The diagnosis changed in icc 8.0:
3385       #   icc: Command line remark: option '-MP' not supported
3386       if (grep 'ignoring option' conftest.err ||
3387           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3388         am_cv_$1_dependencies_compiler_type=$depmode
3389         break
3390       fi
3391     fi
3392   done
3394   cd ..
3395   rm -rf conftest.dir
3396 else
3397   am_cv_$1_dependencies_compiler_type=none
3400 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
3401 AM_CONDITIONAL([am__fastdep$1], [
3402   test "x$enable_dependency_tracking" != xno \
3403   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3407 # AM_SET_DEPDIR
3408 # -------------
3409 # Choose a directory name for dependency files.
3410 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
3411 AC_DEFUN([AM_SET_DEPDIR],
3412 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3413 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3417 # AM_DEP_TRACK
3418 # ------------
3419 AC_DEFUN([AM_DEP_TRACK],
3420 [AC_ARG_ENABLE(dependency-tracking,
3421 [  --disable-dependency-tracking  speeds up one-time build
3422   --enable-dependency-tracking   do not reject slow dependency extractors])
3423 if test "x$enable_dependency_tracking" != xno; then
3424   am_depcomp="$ac_aux_dir/depcomp"
3425   AMDEPBACKSLASH='\'
3426   am__nodep='_no'
3428 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3429 AC_SUBST([AMDEPBACKSLASH])dnl
3430 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3431 AC_SUBST([am__nodep])dnl
3432 _AM_SUBST_NOTMAKE([am__nodep])dnl
3435 # Generate code to set up dependency tracking.              -*- Autoconf -*-
3437 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3438 # Free Software Foundation, Inc.
3440 # This file is free software; the Free Software Foundation
3441 # gives unlimited permission to copy and/or distribute it,
3442 # with or without modifications, as long as this notice is preserved.
3444 #serial 5
3446 # _AM_OUTPUT_DEPENDENCY_COMMANDS
3447 # ------------------------------
3448 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3450   # Autoconf 2.62 quotes --file arguments for eval, but not when files
3451   # are listed without --file.  Let's play safe and only enable the eval
3452   # if we detect the quoting.
3453   case $CONFIG_FILES in
3454   *\'*) eval set x "$CONFIG_FILES" ;;
3455   *)   set x $CONFIG_FILES ;;
3456   esac
3457   shift
3458   for mf
3459   do
3460     # Strip MF so we end up with the name of the file.
3461     mf=`echo "$mf" | sed -e 's/:.*$//'`
3462     # Check whether this is an Automake generated Makefile or not.
3463     # We used to match only the files named `Makefile.in', but
3464     # some people rename them; so instead we look at the file content.
3465     # Grep'ing the first line is not enough: some people post-process
3466     # each Makefile.in and add a new line on top of each file to say so.
3467     # Grep'ing the whole file is not good either: AIX grep has a line
3468     # limit of 2048, but all sed's we know have understand at least 4000.
3469     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3470       dirpart=`AS_DIRNAME("$mf")`
3471     else
3472       continue
3473     fi
3474     # Extract the definition of DEPDIR, am__include, and am__quote
3475     # from the Makefile without running `make'.
3476     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3477     test -z "$DEPDIR" && continue
3478     am__include=`sed -n 's/^am__include = //p' < "$mf"`
3479     test -z "am__include" && continue
3480     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3481     # When using ansi2knr, U may be empty or an underscore; expand it
3482     U=`sed -n 's/^U = //p' < "$mf"`
3483     # Find all dependency output files, they are included files with
3484     # $(DEPDIR) in their names.  We invoke sed twice because it is the
3485     # simplest approach to changing $(DEPDIR) to its actual value in the
3486     # expansion.
3487     for file in `sed -n "
3488       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3489          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3490       # Make sure the directory exists.
3491       test -f "$dirpart/$file" && continue
3492       fdir=`AS_DIRNAME(["$file"])`
3493       AS_MKDIR_P([$dirpart/$fdir])
3494       # echo "creating $dirpart/$file"
3495       echo '# dummy' > "$dirpart/$file"
3496     done
3497   done
3499 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3502 # AM_OUTPUT_DEPENDENCY_COMMANDS
3503 # -----------------------------
3504 # This macro should only be invoked once -- use via AC_REQUIRE.
3506 # This code is only required when automatic dependency tracking
3507 # is enabled.  FIXME.  This creates each `.P' file that we will
3508 # need in order to bootstrap the dependency handling code.
3509 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3510 [AC_CONFIG_COMMANDS([depfiles],
3511      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3512      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3515 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3516 # Free Software Foundation, Inc.
3518 # This file is free software; the Free Software Foundation
3519 # gives unlimited permission to copy and/or distribute it,
3520 # with or without modifications, as long as this notice is preserved.
3522 # serial 8
3524 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
3525 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
3527 # Do all the work for Automake.                             -*- Autoconf -*-
3529 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3530 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
3532 # This file is free software; the Free Software Foundation
3533 # gives unlimited permission to copy and/or distribute it,
3534 # with or without modifications, as long as this notice is preserved.
3536 # serial 16
3538 # This macro actually does too much.  Some checks are only needed if
3539 # your package does certain things.  But this isn't really a big deal.
3541 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3542 # AM_INIT_AUTOMAKE([OPTIONS])
3543 # -----------------------------------------------
3544 # The call with PACKAGE and VERSION arguments is the old style
3545 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
3546 # and VERSION should now be passed to AC_INIT and removed from
3547 # the call to AM_INIT_AUTOMAKE.
3548 # We support both call styles for the transition.  After
3549 # the next Automake release, Autoconf can make the AC_INIT
3550 # arguments mandatory, and then we can depend on a new Autoconf
3551 # release and drop the old call support.
3552 AC_DEFUN([AM_INIT_AUTOMAKE],
3553 [AC_PREREQ([2.62])dnl
3554 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
3555 dnl the ones we care about.
3556 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
3557 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
3558 AC_REQUIRE([AC_PROG_INSTALL])dnl
3559 if test "`cd $srcdir && pwd`" != "`pwd`"; then
3560   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
3561   # is not polluted with repeated "-I."
3562   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
3563   # test to see if srcdir already configured
3564   if test -f $srcdir/config.status; then
3565     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
3566   fi
3569 # test whether we have cygpath
3570 if test -z "$CYGPATH_W"; then
3571   if (cygpath --version) >/dev/null 2>/dev/null; then
3572     CYGPATH_W='cygpath -w'
3573   else
3574     CYGPATH_W=echo
3575   fi
3577 AC_SUBST([CYGPATH_W])
3579 # Define the identity of the package.
3580 dnl Distinguish between old-style and new-style calls.
3581 m4_ifval([$2],
3582 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
3583  AC_SUBST([PACKAGE], [$1])dnl
3584  AC_SUBST([VERSION], [$2])],
3585 [_AM_SET_OPTIONS([$1])dnl
3586 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
3587 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
3588   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
3589  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
3590  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
3592 _AM_IF_OPTION([no-define],,
3593 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
3594  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
3596 # Some tools Automake needs.
3597 AC_REQUIRE([AM_SANITY_CHECK])dnl
3598 AC_REQUIRE([AC_ARG_PROGRAM])dnl
3599 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
3600 AM_MISSING_PROG(AUTOCONF, autoconf)
3601 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
3602 AM_MISSING_PROG(AUTOHEADER, autoheader)
3603 AM_MISSING_PROG(MAKEINFO, makeinfo)
3604 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3605 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
3606 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
3607 # We need awk for the "check" target.  The system "awk" is bad on
3608 # some platforms.
3609 AC_REQUIRE([AC_PROG_AWK])dnl
3610 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3611 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3612 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
3613               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
3614                              [_AM_PROG_TAR([v7])])])
3615 _AM_IF_OPTION([no-dependencies],,
3616 [AC_PROVIDE_IFELSE([AC_PROG_CC],
3617                   [_AM_DEPENDENCIES(CC)],
3618                   [define([AC_PROG_CC],
3619                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
3620 AC_PROVIDE_IFELSE([AC_PROG_CXX],
3621                   [_AM_DEPENDENCIES(CXX)],
3622                   [define([AC_PROG_CXX],
3623                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
3624 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
3625                   [_AM_DEPENDENCIES(OBJC)],
3626                   [define([AC_PROG_OBJC],
3627                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
3629 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
3630 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
3631 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
3632 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
3633 AC_CONFIG_COMMANDS_PRE(dnl
3634 [m4_provide_if([_AM_COMPILER_EXEEXT],
3635   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
3638 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
3639 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
3640 dnl mangled by Autoconf and run in a shell conditional statement.
3641 m4_define([_AC_COMPILER_EXEEXT],
3642 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
3645 # When config.status generates a header, we must update the stamp-h file.
3646 # This file resides in the same directory as the config header
3647 # that is generated.  The stamp files are numbered to have different names.
3649 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
3650 # loop where config.status creates the headers, so we can generate
3651 # our stamp files there.
3652 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
3653 [# Compute $1's index in $config_headers.
3654 _am_arg=$1
3655 _am_stamp_count=1
3656 for _am_header in $config_headers :; do
3657   case $_am_header in
3658     $_am_arg | $_am_arg:* )
3659       break ;;
3660     * )
3661       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
3662   esac
3663 done
3664 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
3666 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
3667 # Inc.
3669 # This file is free software; the Free Software Foundation
3670 # gives unlimited permission to copy and/or distribute it,
3671 # with or without modifications, as long as this notice is preserved.
3673 # serial 1
3675 # AM_PROG_INSTALL_SH
3676 # ------------------
3677 # Define $install_sh.
3678 AC_DEFUN([AM_PROG_INSTALL_SH],
3679 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3680 if test x"${install_sh}" != xset; then
3681   case $am_aux_dir in
3682   *\ * | *\     *)
3683     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
3684   *)
3685     install_sh="\${SHELL} $am_aux_dir/install-sh"
3686   esac
3688 AC_SUBST(install_sh)])
3690 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
3692 # This file is free software; the Free Software Foundation
3693 # gives unlimited permission to copy and/or distribute it,
3694 # with or without modifications, as long as this notice is preserved.
3696 # serial 2
3698 # Check whether the underlying file-system supports filenames
3699 # with a leading dot.  For instance MS-DOS doesn't.
3700 AC_DEFUN([AM_SET_LEADING_DOT],
3701 [rm -rf .tst 2>/dev/null
3702 mkdir .tst 2>/dev/null
3703 if test -d .tst; then
3704   am__leading_dot=.
3705 else
3706   am__leading_dot=_
3708 rmdir .tst 2>/dev/null
3709 AC_SUBST([am__leading_dot])])
3711 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
3713 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
3715 # This file is free software; the Free Software Foundation
3716 # gives unlimited permission to copy and/or distribute it,
3717 # with or without modifications, as long as this notice is preserved.
3719 # serial 4
3721 # AM_MAKE_INCLUDE()
3722 # -----------------
3723 # Check to see how make treats includes.
3724 AC_DEFUN([AM_MAKE_INCLUDE],
3725 [am_make=${MAKE-make}
3726 cat > confinc << 'END'
3727 am__doit:
3728         @echo this is the am__doit target
3729 .PHONY: am__doit
3731 # If we don't find an include directive, just comment out the code.
3732 AC_MSG_CHECKING([for style of include used by $am_make])
3733 am__include="#"
3734 am__quote=
3735 _am_result=none
3736 # First try GNU make style include.
3737 echo "include confinc" > confmf
3738 # Ignore all kinds of additional output from `make'.
3739 case `$am_make -s -f confmf 2> /dev/null` in #(
3740 *the\ am__doit\ target*)
3741   am__include=include
3742   am__quote=
3743   _am_result=GNU
3744   ;;
3745 esac
3746 # Now try BSD make style include.
3747 if test "$am__include" = "#"; then
3748    echo '.include "confinc"' > confmf
3749    case `$am_make -s -f confmf 2> /dev/null` in #(
3750    *the\ am__doit\ target*)
3751      am__include=.include
3752      am__quote="\""
3753      _am_result=BSD
3754      ;;
3755    esac
3757 AC_SUBST([am__include])
3758 AC_SUBST([am__quote])
3759 AC_MSG_RESULT([$_am_result])
3760 rm -f confinc confmf
3763 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
3764 # Free Software Foundation, Inc.
3766 # This file is free software; the Free Software Foundation
3767 # gives unlimited permission to copy and/or distribute it,
3768 # with or without modifications, as long as this notice is preserved.
3770 # serial 6
3772 # AM_PROG_CC_C_O
3773 # --------------
3774 # Like AC_PROG_CC_C_O, but changed for automake.
3775 AC_DEFUN([AM_PROG_CC_C_O],
3776 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
3777 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3778 AC_REQUIRE_AUX_FILE([compile])dnl
3779 # FIXME: we rely on the cache variable name because
3780 # there is no other way.
3781 set dummy $CC
3782 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
3783 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
3784 if test "$am_t" != yes; then
3785    # Losing compiler, so override with the script.
3786    # FIXME: It is wrong to rewrite CC.
3787    # But if we don't then we get into trouble of one sort or another.
3788    # A longer-term fix would be to have automake use am__CC in this case,
3789    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3790    CC="$am_aux_dir/compile $CC"
3792 dnl Make sure AC_PROG_CC is never called again, or it will override our
3793 dnl setting of CC.
3794 m4_define([AC_PROG_CC],
3795           [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
3798 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
3800 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
3801 # Free Software Foundation, Inc.
3803 # This file is free software; the Free Software Foundation
3804 # gives unlimited permission to copy and/or distribute it,
3805 # with or without modifications, as long as this notice is preserved.
3807 # serial 6
3809 # AM_MISSING_PROG(NAME, PROGRAM)
3810 # ------------------------------
3811 AC_DEFUN([AM_MISSING_PROG],
3812 [AC_REQUIRE([AM_MISSING_HAS_RUN])
3813 $1=${$1-"${am_missing_run}$2"}
3814 AC_SUBST($1)])
3817 # AM_MISSING_HAS_RUN
3818 # ------------------
3819 # Define MISSING if not defined so far and test if it supports --run.
3820 # If it does, set am_missing_run to use it, otherwise, to nothing.
3821 AC_DEFUN([AM_MISSING_HAS_RUN],
3822 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3823 AC_REQUIRE_AUX_FILE([missing])dnl
3824 if test x"${MISSING+set}" != xset; then
3825   case $am_aux_dir in
3826   *\ * | *\     *)
3827     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
3828   *)
3829     MISSING="\${SHELL} $am_aux_dir/missing" ;;
3830   esac
3832 # Use eval to expand $SHELL
3833 if eval "$MISSING --run true"; then
3834   am_missing_run="$MISSING --run "
3835 else
3836   am_missing_run=
3837   AC_MSG_WARN([`missing' script is too old or missing])
3841 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
3842 # Inc.
3844 # This file is free software; the Free Software Foundation
3845 # gives unlimited permission to copy and/or distribute it,
3846 # with or without modifications, as long as this notice is preserved.
3848 # serial 1
3850 # AM_PROG_MKDIR_P
3851 # ---------------
3852 # Check for `mkdir -p'.
3853 AC_DEFUN([AM_PROG_MKDIR_P],
3854 [AC_PREREQ([2.60])dnl
3855 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3856 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
3857 dnl while keeping a definition of mkdir_p for backward compatibility.
3858 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
3859 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
3860 dnl Makefile.ins that do not define MKDIR_P, so we do our own
3861 dnl adjustment using top_builddir (which is defined more often than
3862 dnl MKDIR_P).
3863 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
3864 case $mkdir_p in
3865   [[\\/$]]* | ?:[[\\/]]*) ;;
3866   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
3867 esac
3870 # Helper functions for option handling.                     -*- Autoconf -*-
3872 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
3873 # Foundation, Inc.
3875 # This file is free software; the Free Software Foundation
3876 # gives unlimited permission to copy and/or distribute it,
3877 # with or without modifications, as long as this notice is preserved.
3879 # serial 5
3881 # _AM_MANGLE_OPTION(NAME)
3882 # -----------------------
3883 AC_DEFUN([_AM_MANGLE_OPTION],
3884 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
3886 # _AM_SET_OPTION(NAME)
3887 # --------------------
3888 # Set option NAME.  Presently that only means defining a flag for this option.
3889 AC_DEFUN([_AM_SET_OPTION],
3890 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
3892 # _AM_SET_OPTIONS(OPTIONS)
3893 # ------------------------
3894 # OPTIONS is a space-separated list of Automake options.
3895 AC_DEFUN([_AM_SET_OPTIONS],
3896 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
3898 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
3899 # -------------------------------------------
3900 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
3901 AC_DEFUN([_AM_IF_OPTION],
3902 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
3904 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
3906 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
3907 # Free Software Foundation, Inc.
3909 # This file is free software; the Free Software Foundation
3910 # gives unlimited permission to copy and/or distribute it,
3911 # with or without modifications, as long as this notice is preserved.
3913 # serial 5
3915 # AM_SANITY_CHECK
3916 # ---------------
3917 AC_DEFUN([AM_SANITY_CHECK],
3918 [AC_MSG_CHECKING([whether build environment is sane])
3919 # Just in case
3920 sleep 1
3921 echo timestamp > conftest.file
3922 # Reject unsafe characters in $srcdir or the absolute working directory
3923 # name.  Accept space and tab only in the latter.
3924 am_lf='
3926 case `pwd` in
3927   *[[\\\"\#\$\&\'\`$am_lf]]*)
3928     AC_MSG_ERROR([unsafe absolute working directory name]);;
3929 esac
3930 case $srcdir in
3931   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
3932     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
3933 esac
3935 # Do `set' in a subshell so we don't clobber the current shell's
3936 # arguments.  Must try -L first in case configure is actually a
3937 # symlink; some systems play weird games with the mod time of symlinks
3938 # (eg FreeBSD returns the mod time of the symlink's containing
3939 # directory).
3940 if (
3941    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
3942    if test "$[*]" = "X"; then
3943       # -L didn't work.
3944       set X `ls -t "$srcdir/configure" conftest.file`
3945    fi
3946    rm -f conftest.file
3947    if test "$[*]" != "X $srcdir/configure conftest.file" \
3948       && test "$[*]" != "X conftest.file $srcdir/configure"; then
3950       # If neither matched, then we have a broken ls.  This can happen
3951       # if, for instance, CONFIG_SHELL is bash and it inherits a
3952       # broken ls alias from the environment.  This has actually
3953       # happened.  Such a system could not be considered "sane".
3954       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
3955 alias in your environment])
3956    fi
3958    test "$[2]" = conftest.file
3959    )
3960 then
3961    # Ok.
3962    :
3963 else
3964    AC_MSG_ERROR([newly created file is older than distributed files!
3965 Check your system clock])
3967 AC_MSG_RESULT(yes)])
3969 # Copyright (C) 2009, 2011  Free Software Foundation, Inc.
3971 # This file is free software; the Free Software Foundation
3972 # gives unlimited permission to copy and/or distribute it,
3973 # with or without modifications, as long as this notice is preserved.
3975 # serial 2
3977 # AM_SILENT_RULES([DEFAULT])
3978 # --------------------------
3979 # Enable less verbose build rules; with the default set to DEFAULT
3980 # (`yes' being less verbose, `no' or empty being verbose).
3981 AC_DEFUN([AM_SILENT_RULES],
3982 [AC_ARG_ENABLE([silent-rules],
3983 [  --enable-silent-rules          less verbose build output (undo: `make V=1')
3984   --disable-silent-rules         verbose build output (undo: `make V=0')])
3985 case $enable_silent_rules in
3986 yes) AM_DEFAULT_VERBOSITY=0;;
3987 no)  AM_DEFAULT_VERBOSITY=1;;
3988 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
3989 esac
3991 dnl A few `make' implementations (e.g., NonStop OS and NextStep)
3992 dnl do not support nested variable expansions.
3993 dnl See automake bug#9928 and bug#10237.
3994 am_make=${MAKE-make}
3995 AC_CACHE_CHECK([whether $am_make supports nested variables],
3996    [am_cv_make_support_nested_variables],
3997    [if AS_ECHO([['TRUE=$(BAR$(V))
3998 BAR0=false
3999 BAR1=true
4001 am__doit:
4002         @$(TRUE)
4003 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
4004   am_cv_make_support_nested_variables=yes
4005 else
4006   am_cv_make_support_nested_variables=no
4007 fi])
4008 if test $am_cv_make_support_nested_variables = yes; then
4009   dnl Using `$V' instead of `$(V)' breaks IRIX make.
4010   AM_V='$(V)'
4011   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
4012 else
4013   AM_V=$AM_DEFAULT_VERBOSITY
4014   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
4016 AC_SUBST([AM_V])dnl
4017 AM_SUBST_NOTMAKE([AM_V])dnl
4018 AC_SUBST([AM_DEFAULT_V])dnl
4019 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
4020 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
4021 AM_BACKSLASH='\'
4022 AC_SUBST([AM_BACKSLASH])dnl
4023 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
4026 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
4028 # This file is free software; the Free Software Foundation
4029 # gives unlimited permission to copy and/or distribute it,
4030 # with or without modifications, as long as this notice is preserved.
4032 # serial 1
4034 # AM_PROG_INSTALL_STRIP
4035 # ---------------------
4036 # One issue with vendor `install' (even GNU) is that you can't
4037 # specify the program used to strip binaries.  This is especially
4038 # annoying in cross-compiling environments, where the build's strip
4039 # is unlikely to handle the host's binaries.
4040 # Fortunately install-sh will honor a STRIPPROG variable, so we
4041 # always use install-sh in `make install-strip', and initialize
4042 # STRIPPROG with the value of the STRIP variable (set by the user).
4043 AC_DEFUN([AM_PROG_INSTALL_STRIP],
4044 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4045 # Installed binaries are usually stripped using `strip' when the user
4046 # run `make install-strip'.  However `strip' might not be the right
4047 # tool to use in cross-compilation environments, therefore Automake
4048 # will honor the `STRIP' environment variable to overrule this program.
4049 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
4050 if test "$cross_compiling" != no; then
4051   AC_CHECK_TOOL([STRIP], [strip], :)
4053 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
4054 AC_SUBST([INSTALL_STRIP_PROGRAM])])
4056 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
4058 # This file is free software; the Free Software Foundation
4059 # gives unlimited permission to copy and/or distribute it,
4060 # with or without modifications, as long as this notice is preserved.
4062 # serial 3
4064 # _AM_SUBST_NOTMAKE(VARIABLE)
4065 # ---------------------------
4066 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
4067 # This macro is traced by Automake.
4068 AC_DEFUN([_AM_SUBST_NOTMAKE])
4070 # AM_SUBST_NOTMAKE(VARIABLE)
4071 # --------------------------
4072 # Public sister of _AM_SUBST_NOTMAKE.
4073 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
4075 # Check how to create a tarball.                            -*- Autoconf -*-
4077 # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
4079 # This file is free software; the Free Software Foundation
4080 # gives unlimited permission to copy and/or distribute it,
4081 # with or without modifications, as long as this notice is preserved.
4083 # serial 2
4085 # _AM_PROG_TAR(FORMAT)
4086 # --------------------
4087 # Check how to create a tarball in format FORMAT.
4088 # FORMAT should be one of `v7', `ustar', or `pax'.
4090 # Substitute a variable $(am__tar) that is a command
4091 # writing to stdout a FORMAT-tarball containing the directory
4092 # $tardir.
4093 #     tardir=directory && $(am__tar) > result.tar
4095 # Substitute a variable $(am__untar) that extract such
4096 # a tarball read from stdin.
4097 #     $(am__untar) < result.tar
4098 AC_DEFUN([_AM_PROG_TAR],
4099 [# Always define AMTAR for backward compatibility.  Yes, it's still used
4100 # in the wild :-(  We should find a proper way to deprecate it ...
4101 AC_SUBST([AMTAR], ['$${TAR-tar}'])
4102 m4_if([$1], [v7],
4103      [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
4104      [m4_case([$1], [ustar],, [pax],,
4105               [m4_fatal([Unknown tar format])])
4106 AC_MSG_CHECKING([how to create a $1 tar archive])
4107 # Loop over all known methods to create a tar archive until one works.
4108 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
4109 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
4110 # Do not fold the above two line into one, because Tru64 sh and
4111 # Solaris sh will not grok spaces in the rhs of `-'.
4112 for _am_tool in $_am_tools
4114   case $_am_tool in
4115   gnutar)
4116     for _am_tar in tar gnutar gtar;
4117     do
4118       AM_RUN_LOG([$_am_tar --version]) && break
4119     done
4120     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
4121     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
4122     am__untar="$_am_tar -xf -"
4123     ;;
4124   plaintar)
4125     # Must skip GNU tar: if it does not support --format= it doesn't create
4126     # ustar tarball either.
4127     (tar --version) >/dev/null 2>&1 && continue
4128     am__tar='tar chf - "$$tardir"'
4129     am__tar_='tar chf - "$tardir"'
4130     am__untar='tar xf -'
4131     ;;
4132   pax)
4133     am__tar='pax -L -x $1 -w "$$tardir"'
4134     am__tar_='pax -L -x $1 -w "$tardir"'
4135     am__untar='pax -r'
4136     ;;
4137   cpio)
4138     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
4139     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
4140     am__untar='cpio -i -H $1 -d'
4141     ;;
4142   none)
4143     am__tar=false
4144     am__tar_=false
4145     am__untar=false
4146     ;;
4147   esac
4149   # If the value was cached, stop now.  We just wanted to have am__tar
4150   # and am__untar set.
4151   test -n "${am_cv_prog_tar_$1}" && break
4153   # tar/untar a dummy directory, and stop if the command works
4154   rm -rf conftest.dir
4155   mkdir conftest.dir
4156   echo GrepMe > conftest.dir/file
4157   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
4158   rm -rf conftest.dir
4159   if test -s conftest.tar; then
4160     AM_RUN_LOG([$am__untar <conftest.tar])
4161     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
4162   fi
4163 done
4164 rm -rf conftest.dir
4166 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
4167 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
4168 AC_SUBST([am__tar])
4169 AC_SUBST([am__untar])
4170 ]) # _AM_PROG_TAR
4172 m4_include([m4/ax_check_gl.m4])
4173 m4_include([m4/ax_lang_compiler_ms.m4])