initial commit, lordsawar source, slightly modified
[lordsawar] / aclocal.m4
1 # generated automatically by aclocal 1.11 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 m4_ifndef([AC_AUTOCONF_VERSION],
15   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
17 [m4_warning([this file was generated for autoconf 2.64.
18 You have another version of autoconf.  It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
23 # Copyright (C) 2001-2003,2004 Red Hat, Inc.
24 #
25 # This file is free software, distributed under the terms of the GNU
26 # General Public License.  As a special exception to the GNU General
27 # Public License, this file may be distributed as part of a program
28 # that contains a configuration script generated by Autoconf, under
29 # the same distribution terms as the rest of that program.
30 #
31 # This file can be copied and used freely without restrictions.  It can
32 # be used in projects which are not available under the GNU Public License
33 # but which still want to provide support for the GNU gettext functionality.
34 #
35 # Macro to add for using GNU gettext.
36 # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
37 #
38 # Modified to never use included libintl. 
39 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
40 #
41 # Major rework to remove unused code
42 # Owen Taylor <otaylor@redhat.com>, 12/11/2002
43 #
44 # Added better handling of ALL_LINGUAS from GNU gettext version 
45 # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
46 #
47 # Modified to require ngettext
48 # Matthias Clasen <mclasen@redhat.com> 08/06/2004
49 #
50 # We need this here as well, since someone might use autoconf-2.5x
51 # to configure GLib then an older version to configure a package
52 # using AM_GLIB_GNU_GETTEXT
53 AC_PREREQ(2.53)
54
55 dnl
56 dnl We go to great lengths to make sure that aclocal won't 
57 dnl try to pull in the installed version of these macros
58 dnl when running aclocal in the glib directory.
59 dnl
60 m4_copy([AC_DEFUN],[glib_DEFUN])
61 m4_copy([AC_REQUIRE],[glib_REQUIRE])
62 dnl
63 dnl At the end, if we're not within glib, we'll define the public
64 dnl definitions in terms of our private definitions.
65 dnl
66
67 # GLIB_LC_MESSAGES
68 #--------------------
69 glib_DEFUN([GLIB_LC_MESSAGES],
70   [AC_CHECK_HEADERS([locale.h])
71     if test $ac_cv_header_locale_h = yes; then
72     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
73       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
74        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
75     if test $am_cv_val_LC_MESSAGES = yes; then
76       AC_DEFINE(HAVE_LC_MESSAGES, 1,
77         [Define if your <locale.h> file defines LC_MESSAGES.])
78     fi
79   fi])
80
81 # GLIB_PATH_PROG_WITH_TEST
82 #----------------------------
83 dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
84 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
85 glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
86 [# Extract the first word of "$2", so it can be a program name with args.
87 set dummy $2; ac_word=[$]2
88 AC_MSG_CHECKING([for $ac_word])
89 AC_CACHE_VAL(ac_cv_path_$1,
90 [case "[$]$1" in
91   /*)
92   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
93   ;;
94   *)
95   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
96   for ac_dir in ifelse([$5], , $PATH, [$5]); do
97     test -z "$ac_dir" && ac_dir=.
98     if test -f $ac_dir/$ac_word; then
99       if [$3]; then
100         ac_cv_path_$1="$ac_dir/$ac_word"
101         break
102       fi
103     fi
104   done
105   IFS="$ac_save_ifs"
106 dnl If no 4th arg is given, leave the cache variable unset,
107 dnl so AC_PATH_PROGS will keep looking.
108 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
109 ])dnl
110   ;;
111 esac])dnl
112 $1="$ac_cv_path_$1"
113 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
114   AC_MSG_RESULT([$]$1)
115 else
116   AC_MSG_RESULT(no)
117 fi
118 AC_SUBST($1)dnl
119 ])
120
121 # GLIB_WITH_NLS
122 #-----------------
123 glib_DEFUN([GLIB_WITH_NLS],
124   dnl NLS is obligatory
125   [USE_NLS=yes
126     AC_SUBST(USE_NLS)
127
128     gt_cv_have_gettext=no
129
130     CATOBJEXT=NONE
131     XGETTEXT=:
132     INTLLIBS=
133
134     AC_CHECK_HEADER(libintl.h,
135      [gt_cv_func_dgettext_libintl="no"
136       libintl_extra_libs=""
137
138       #
139       # First check in libc
140       #
141       AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
142         [AC_TRY_LINK([
143 #include <libintl.h>
144 ],
145          [return !ngettext ("","", 1)],
146           gt_cv_func_ngettext_libc=yes,
147           gt_cv_func_ngettext_libc=no)
148         ])
149   
150       if test "$gt_cv_func_ngettext_libc" = "yes" ; then
151               AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
152                 [AC_TRY_LINK([
153 #include <libintl.h>
154 ],
155                   [return !dgettext ("","")],
156                   gt_cv_func_dgettext_libc=yes,
157                   gt_cv_func_dgettext_libc=no)
158                 ])
159       fi
160   
161       if test "$gt_cv_func_ngettext_libc" = "yes" ; then
162         AC_CHECK_FUNCS(bind_textdomain_codeset)
163       fi
164
165       #
166       # If we don't have everything we want, check in libintl
167       #
168       if test "$gt_cv_func_dgettext_libc" != "yes" \
169          || test "$gt_cv_func_ngettext_libc" != "yes" \
170          || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
171         
172         AC_CHECK_LIB(intl, bindtextdomain,
173             [AC_CHECK_LIB(intl, ngettext,
174                     [AC_CHECK_LIB(intl, dgettext,
175                                   gt_cv_func_dgettext_libintl=yes)])])
176
177         if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
178           AC_MSG_CHECKING([if -liconv is needed to use gettext])
179           AC_MSG_RESULT([])
180           AC_CHECK_LIB(intl, ngettext,
181                 [AC_CHECK_LIB(intl, dcgettext,
182                        [gt_cv_func_dgettext_libintl=yes
183                         libintl_extra_libs=-liconv],
184                         :,-liconv)],
185                 :,-liconv)
186         fi
187
188         #
189         # If we found libintl, then check in it for bind_textdomain_codeset();
190         # we'll prefer libc if neither have bind_textdomain_codeset(),
191         # and both have dgettext and ngettext
192         #
193         if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
194           glib_save_LIBS="$LIBS"
195           LIBS="$LIBS -lintl $libintl_extra_libs"
196           unset ac_cv_func_bind_textdomain_codeset
197           AC_CHECK_FUNCS(bind_textdomain_codeset)
198           LIBS="$glib_save_LIBS"
199
200           if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
201             gt_cv_func_dgettext_libc=no
202           else
203             if test "$gt_cv_func_dgettext_libc" = "yes" \
204                 && test "$gt_cv_func_ngettext_libc" = "yes"; then
205               gt_cv_func_dgettext_libintl=no
206             fi
207           fi
208         fi
209       fi
210
211       if test "$gt_cv_func_dgettext_libc" = "yes" \
212         || test "$gt_cv_func_dgettext_libintl" = "yes"; then
213         gt_cv_have_gettext=yes
214       fi
215   
216       if test "$gt_cv_func_dgettext_libintl" = "yes"; then
217         INTLLIBS="-lintl $libintl_extra_libs"
218       fi
219   
220       if test "$gt_cv_have_gettext" = "yes"; then
221         AC_DEFINE(HAVE_GETTEXT,1,
222           [Define if the GNU gettext() function is already present or preinstalled.])
223         GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
224           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
225         if test "$MSGFMT" != "no"; then
226           glib_save_LIBS="$LIBS"
227           LIBS="$LIBS $INTLLIBS"
228           AC_CHECK_FUNCS(dcgettext)
229           MSGFMT_OPTS=
230           AC_MSG_CHECKING([if msgfmt accepts -c])
231           GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
232 msgid ""
233 msgstr ""
234 "Content-Type: text/plain; charset=UTF-8\n"
235 "Project-Id-Version: test 1.0\n"
236 "PO-Revision-Date: 2007-02-15 12:01+0100\n"
237 "Last-Translator: test <foo@bar.xx>\n"
238 "Language-Team: C <LL@li.org>\n"
239 "MIME-Version: 1.0\n"
240 "Content-Transfer-Encoding: 8bit\n"
241 ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
242           AC_SUBST(MSGFMT_OPTS)
243           AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
244           GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
245             [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
246           AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
247                          return _nl_msg_cat_cntr],
248             [CATOBJEXT=.gmo 
249              DATADIRNAME=share],
250             [case $host in
251             *-*-solaris*)
252             dnl On Solaris, if bind_textdomain_codeset is in libc,
253             dnl GNU format message catalog is always supported,
254             dnl since both are added to the libc all together.
255             dnl Hence, we'd like to go with DATADIRNAME=share and
256             dnl and CATOBJEXT=.gmo in this case.
257             AC_CHECK_FUNC(bind_textdomain_codeset,
258               [CATOBJEXT=.gmo 
259                DATADIRNAME=share],
260               [CATOBJEXT=.mo
261                DATADIRNAME=lib])
262             ;;
263             *)
264             CATOBJEXT=.mo
265             DATADIRNAME=lib
266             ;;
267             esac])
268           LIBS="$glib_save_LIBS"
269           INSTOBJEXT=.mo
270         else
271           gt_cv_have_gettext=no
272         fi
273       fi
274     ])
275
276     if test "$gt_cv_have_gettext" = "yes" ; then
277       AC_DEFINE(ENABLE_NLS, 1,
278         [always defined to indicate that i18n is enabled])
279     fi
280
281     dnl Test whether we really found GNU xgettext.
282     if test "$XGETTEXT" != ":"; then
283       dnl If it is not GNU xgettext we define it as : so that the
284       dnl Makefiles still can work.
285       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
286         : ;
287       else
288         AC_MSG_RESULT(
289           [found xgettext program is not GNU xgettext; ignore it])
290         XGETTEXT=":"
291       fi
292     fi
293
294     # We need to process the po/ directory.
295     POSUB=po
296
297     AC_OUTPUT_COMMANDS(
298       [case "$CONFIG_FILES" in *po/Makefile.in*)
299         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
300       esac])
301
302     dnl These rules are solely for the distribution goal.  While doing this
303     dnl we only have to keep exactly one list of the available catalogs
304     dnl in configure.in.
305     for lang in $ALL_LINGUAS; do
306       GMOFILES="$GMOFILES $lang.gmo"
307       POFILES="$POFILES $lang.po"
308     done
309
310     dnl Make all variables we use known to autoconf.
311     AC_SUBST(CATALOGS)
312     AC_SUBST(CATOBJEXT)
313     AC_SUBST(DATADIRNAME)
314     AC_SUBST(GMOFILES)
315     AC_SUBST(INSTOBJEXT)
316     AC_SUBST(INTLLIBS)
317     AC_SUBST(PO_IN_DATADIR_TRUE)
318     AC_SUBST(PO_IN_DATADIR_FALSE)
319     AC_SUBST(POFILES)
320     AC_SUBST(POSUB)
321   ])
322
323 # AM_GLIB_GNU_GETTEXT
324 # -------------------
325 # Do checks necessary for use of gettext. If a suitable implementation 
326 # of gettext is found in either in libintl or in the C library,
327 # it will set INTLLIBS to the libraries needed for use of gettext
328 # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
329 # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
330 # on various variables needed by the Makefile.in.in installed by 
331 # glib-gettextize.
332 dnl
333 glib_DEFUN([GLIB_GNU_GETTEXT],
334   [AC_REQUIRE([AC_PROG_CC])dnl
335    AC_REQUIRE([AC_HEADER_STDC])dnl
336    
337    GLIB_LC_MESSAGES
338    GLIB_WITH_NLS
339
340    if test "$gt_cv_have_gettext" = "yes"; then
341      if test "x$ALL_LINGUAS" = "x"; then
342        LINGUAS=
343      else
344        AC_MSG_CHECKING(for catalogs to be installed)
345        NEW_LINGUAS=
346        for presentlang in $ALL_LINGUAS; do
347          useit=no
348          if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
349            desiredlanguages="$LINGUAS"
350          else
351            desiredlanguages="$ALL_LINGUAS"
352          fi
353          for desiredlang in $desiredlanguages; do
354            # Use the presentlang catalog if desiredlang is
355            #   a. equal to presentlang, or
356            #   b. a variant of presentlang (because in this case,
357            #      presentlang can be used as a fallback for messages
358            #      which are not translated in the desiredlang catalog).
359            case "$desiredlang" in
360              "$presentlang"*) useit=yes;;
361            esac
362          done
363          if test $useit = yes; then
364            NEW_LINGUAS="$NEW_LINGUAS $presentlang"
365          fi
366        done
367        LINGUAS=$NEW_LINGUAS
368        AC_MSG_RESULT($LINGUAS)
369      fi
370
371      dnl Construct list of names of catalog files to be constructed.
372      if test -n "$LINGUAS"; then
373        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
374      fi
375    fi
376
377    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
378    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
379    dnl Try to locate is.
380    MKINSTALLDIRS=
381    if test -n "$ac_aux_dir"; then
382      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
383    fi
384    if test -z "$MKINSTALLDIRS"; then
385      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
386    fi
387    AC_SUBST(MKINSTALLDIRS)
388
389    dnl Generate list of files to be processed by xgettext which will
390    dnl be included in po/Makefile.
391    test -d po || mkdir po
392    if test "x$srcdir" != "x."; then
393      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
394        posrcprefix="$srcdir/"
395      else
396        posrcprefix="../$srcdir/"
397      fi
398    else
399      posrcprefix="../"
400    fi
401    rm -f po/POTFILES
402    sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
403         < $srcdir/po/POTFILES.in > po/POTFILES
404   ])
405
406 # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
407 # -------------------------------
408 # Define VARIABLE to the location where catalog files will
409 # be installed by po/Makefile.
410 glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
411 [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
412 glib_save_prefix="$prefix"
413 glib_save_exec_prefix="$exec_prefix"
414 glib_save_datarootdir="$datarootdir"
415 test "x$prefix" = xNONE && prefix=$ac_default_prefix
416 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
417 datarootdir=`eval echo "${datarootdir}"`
418 if test "x$CATOBJEXT" = "x.mo" ; then
419   localedir=`eval echo "${libdir}/locale"`
420 else
421   localedir=`eval echo "${datadir}/locale"`
422 fi
423 prefix="$glib_save_prefix"
424 exec_prefix="$glib_save_exec_prefix"
425 datarootdir="$glib_save_datarootdir"
426 AC_DEFINE_UNQUOTED($1, "$localedir",
427   [Define the location where the catalogs will be installed])
428 ])
429
430 dnl
431 dnl Now the definitions that aclocal will find
432 dnl
433 ifdef(glib_configure_in,[],[
434 AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
435 AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
436 ])dnl
437
438 # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
439
440 # Create a temporary file with TEST-FILE as its contents and pass the
441 # file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
442 # 0 and perform ACTION-IF-FAIL for any other exit status.
443 AC_DEFUN([GLIB_RUN_PROG],
444 [cat >conftest.foo <<_ACEOF
445 $2
446 _ACEOF
447 if AC_RUN_LOG([$1 conftest.foo]); then
448   m4_ifval([$3], [$3], [:])
449 m4_ifvaln([$4], [else $4])dnl
450 echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
451 sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
452 fi])
453
454
455 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
456
457 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
458 #
459 # This program is free software; you can redistribute it and/or modify
460 # it under the terms of the GNU General Public License as published by
461 # the Free Software Foundation; either version 2 of the License, or
462 # (at your option) any later version.
463 #
464 # This program is distributed in the hope that it will be useful, but
465 # WITHOUT ANY WARRANTY; without even the implied warranty of
466 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
467 # General Public License for more details.
468 #
469 # You should have received a copy of the GNU General Public License
470 # along with this program; if not, write to the Free Software
471 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
472 #
473 # As a special exception to the GNU General Public License, if you
474 # distribute this file as part of a program that contains a
475 # configuration script generated by Autoconf, you may include it under
476 # the same distribution terms that you use for the rest of that program.
477
478 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
479 # ----------------------------------
480 AC_DEFUN([PKG_PROG_PKG_CONFIG],
481 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
482 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
483 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
484 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
485         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
486 fi
487 if test -n "$PKG_CONFIG"; then
488         _pkg_min_version=m4_default([$1], [0.9.0])
489         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
490         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
491                 AC_MSG_RESULT([yes])
492         else
493                 AC_MSG_RESULT([no])
494                 PKG_CONFIG=""
495         fi
496                 
497 fi[]dnl
498 ])# PKG_PROG_PKG_CONFIG
499
500 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
501 #
502 # Check to see whether a particular set of modules exists.  Similar
503 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
504 #
505 #
506 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
507 # this or PKG_CHECK_MODULES is called, or make sure to call
508 # PKG_CHECK_EXISTS manually
509 # --------------------------------------------------------------
510 AC_DEFUN([PKG_CHECK_EXISTS],
511 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
512 if test -n "$PKG_CONFIG" && \
513     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
514   m4_ifval([$2], [$2], [:])
515 m4_ifvaln([$3], [else
516   $3])dnl
517 fi])
518
519
520 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
521 # ---------------------------------------------
522 m4_define([_PKG_CONFIG],
523 [if test -n "$PKG_CONFIG"; then
524     if test -n "$$1"; then
525         pkg_cv_[]$1="$$1"
526     else
527         PKG_CHECK_EXISTS([$3],
528                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
529                          [pkg_failed=yes])
530     fi
531 else
532         pkg_failed=untried
533 fi[]dnl
534 ])# _PKG_CONFIG
535
536 # _PKG_SHORT_ERRORS_SUPPORTED
537 # -----------------------------
538 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
539 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
540 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
541         _pkg_short_errors_supported=yes
542 else
543         _pkg_short_errors_supported=no
544 fi[]dnl
545 ])# _PKG_SHORT_ERRORS_SUPPORTED
546
547
548 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
549 # [ACTION-IF-NOT-FOUND])
550 #
551 #
552 # Note that if there is a possibility the first call to
553 # PKG_CHECK_MODULES might not happen, you should be sure to include an
554 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
555 #
556 #
557 # --------------------------------------------------------------
558 AC_DEFUN([PKG_CHECK_MODULES],
559 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
560 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
561 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
562
563 pkg_failed=no
564 AC_MSG_CHECKING([for $1])
565
566 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
567 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
568
569 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
570 and $1[]_LIBS to avoid the need to call pkg-config.
571 See the pkg-config man page for more details.])
572
573 if test $pkg_failed = yes; then
574         _PKG_SHORT_ERRORS_SUPPORTED
575         if test $_pkg_short_errors_supported = yes; then
576                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
577         else 
578                 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
579         fi
580         # Put the nasty error message in config.log where it belongs
581         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
582
583         ifelse([$4], , [AC_MSG_ERROR(dnl
584 [Package requirements ($2) were not met:
585
586 $$1_PKG_ERRORS
587
588 Consider adjusting the PKG_CONFIG_PATH environment variable if you
589 installed software in a non-standard prefix.
590
591 _PKG_TEXT
592 ])],
593                 [AC_MSG_RESULT([no])
594                 $4])
595 elif test $pkg_failed = untried; then
596         ifelse([$4], , [AC_MSG_FAILURE(dnl
597 [The pkg-config script could not be found or is too old.  Make sure it
598 is in your PATH or set the PKG_CONFIG environment variable to the full
599 path to pkg-config.
600
601 _PKG_TEXT
602
603 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
604                 [$4])
605 else
606         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
607         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
608         AC_MSG_RESULT([yes])
609         ifelse([$3], , :, [$3])
610 fi[]dnl
611 ])# PKG_CHECK_MODULES
612
613 # Configure paths for SDL
614 # Sam Lantinga 9/21/99
615 # stolen from Manish Singh
616 # stolen back from Frank Belew
617 # stolen from Manish Singh
618 # Shamelessly stolen from Owen Taylor
619
620 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
621 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
622 dnl
623 AC_DEFUN([AM_PATH_SDL],
624 [dnl 
625 dnl Get the cflags and libraries from the sdl-config script
626 dnl
627 AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
628             sdl_prefix="$withval", sdl_prefix="")
629 AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
630             sdl_exec_prefix="$withval", sdl_exec_prefix="")
631 AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
632                     , enable_sdltest=yes)
633
634   if test x$sdl_exec_prefix != x ; then
635     sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
636     if test x${SDL_CONFIG+set} != xset ; then
637       SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
638     fi
639   fi
640   if test x$sdl_prefix != x ; then
641     sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
642     if test x${SDL_CONFIG+set} != xset ; then
643       SDL_CONFIG=$sdl_prefix/bin/sdl-config
644     fi
645   fi
646
647   if test "x$prefix" != xNONE; then
648     PATH="$prefix/bin:$prefix/usr/bin:$PATH"
649   fi
650   AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
651   min_sdl_version=ifelse([$1], ,0.11.0,$1)
652   AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
653   no_sdl=""
654   if test "$SDL_CONFIG" = "no" ; then
655     no_sdl=yes
656   else
657     SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
658     SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
659
660     sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
661            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
662     sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
663            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
664     sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
665            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
666     if test "x$enable_sdltest" = "xyes" ; then
667       ac_save_CFLAGS="$CFLAGS"
668       ac_save_CXXFLAGS="$CXXFLAGS"
669       ac_save_LIBS="$LIBS"
670       CFLAGS="$CFLAGS $SDL_CFLAGS"
671       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
672       LIBS="$LIBS $SDL_LIBS"
673 dnl
674 dnl Now check if the installed SDL is sufficiently new. (Also sanity
675 dnl checks the results of sdl-config to some extent
676 dnl
677       rm -f conf.sdltest
678       AC_TRY_RUN([
679 #include <stdio.h>
680 #include <stdlib.h>
681 #include <string.h>
682 #include "SDL.h"
683
684 char*
685 my_strdup (char *str)
686 {
687   char *new_str;
688   
689   if (str)
690     {
691       new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
692       strcpy (new_str, str);
693     }
694   else
695     new_str = NULL;
696   
697   return new_str;
698 }
699
700 int main (int argc, char *argv[])
701 {
702   int major, minor, micro;
703   char *tmp_version;
704
705   /* This hangs on some systems (?)
706   system ("touch conf.sdltest");
707   */
708   { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
709
710   /* HP/UX 9 (%@#!) writes to sscanf strings */
711   tmp_version = my_strdup("$min_sdl_version");
712   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
713      printf("%s, bad version string\n", "$min_sdl_version");
714      exit(1);
715    }
716
717    if (($sdl_major_version > major) ||
718       (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
719       (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
720     {
721       return 0;
722     }
723   else
724     {
725       printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
726       printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
727       printf("*** best to upgrade to the required version.\n");
728       printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
729       printf("*** to point to the correct copy of sdl-config, and remove the file\n");
730       printf("*** config.cache before re-running configure\n");
731       return 1;
732     }
733 }
734
735 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
736        CFLAGS="$ac_save_CFLAGS"
737        CXXFLAGS="$ac_save_CXXFLAGS"
738        LIBS="$ac_save_LIBS"
739      fi
740   fi
741   if test "x$no_sdl" = x ; then
742      AC_MSG_RESULT(yes)
743      ifelse([$2], , :, [$2])     
744   else
745      AC_MSG_RESULT(no)
746      if test "$SDL_CONFIG" = "no" ; then
747        echo "*** The sdl-config script installed by SDL could not be found"
748        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
749        echo "*** your path, or set the SDL_CONFIG environment variable to the"
750        echo "*** full path to sdl-config."
751      else
752        if test -f conf.sdltest ; then
753         :
754        else
755           echo "*** Could not run SDL test program, checking why..."
756           CFLAGS="$CFLAGS $SDL_CFLAGS"
757           CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
758           LIBS="$LIBS $SDL_LIBS"
759           AC_TRY_LINK([
760 #include <stdio.h>
761 #include "SDL.h"
762
763 int main(int argc, char *argv[])
764 { return 0; }
765 #undef  main
766 #define main K_and_R_C_main
767 ],      [ return 0; ],
768         [ echo "*** The test program compiled, but did not run. This usually means"
769           echo "*** that the run-time linker is not finding SDL or finding the wrong"
770           echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
771           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
772           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
773           echo "*** is required on your system"
774           echo "***"
775           echo "*** If you have an old version installed, it is best to remove it, although"
776           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
777         [ echo "*** The test program failed to compile or link. See the file config.log for the"
778           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
779           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
780           echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
781           CFLAGS="$ac_save_CFLAGS"
782           CXXFLAGS="$ac_save_CXXFLAGS"
783           LIBS="$ac_save_LIBS"
784        fi
785      fi
786      SDL_CFLAGS=""
787      SDL_LIBS=""
788      ifelse([$3], , :, [$3])
789   fi
790   AC_SUBST(SDL_CFLAGS)
791   AC_SUBST(SDL_LIBS)
792   rm -f conf.sdltest
793 ])
794
795 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
796 #
797 # This file is free software; the Free Software Foundation
798 # gives unlimited permission to copy and/or distribute it,
799 # with or without modifications, as long as this notice is preserved.
800
801 # AM_AUTOMAKE_VERSION(VERSION)
802 # ----------------------------
803 # Automake X.Y traces this macro to ensure aclocal.m4 has been
804 # generated from the m4 files accompanying Automake X.Y.
805 # (This private macro should not be called outside this file.)
806 AC_DEFUN([AM_AUTOMAKE_VERSION],
807 [am__api_version='1.11'
808 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
809 dnl require some minimum version.  Point them to the right macro.
810 m4_if([$1], [1.11], [],
811       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
812 ])
813
814 # _AM_AUTOCONF_VERSION(VERSION)
815 # -----------------------------
816 # aclocal traces this macro to find the Autoconf version.
817 # This is a private macro too.  Using m4_define simplifies
818 # the logic in aclocal, which can simply ignore this definition.
819 m4_define([_AM_AUTOCONF_VERSION], [])
820
821 # AM_SET_CURRENT_AUTOMAKE_VERSION
822 # -------------------------------
823 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
824 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
825 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
826 [AM_AUTOMAKE_VERSION([1.11])dnl
827 m4_ifndef([AC_AUTOCONF_VERSION],
828   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
829 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
830
831 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
832
833 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
834 #
835 # This file is free software; the Free Software Foundation
836 # gives unlimited permission to copy and/or distribute it,
837 # with or without modifications, as long as this notice is preserved.
838
839 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
840 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
841 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
842 #
843 # Of course, Automake must honor this variable whenever it calls a
844 # tool from the auxiliary directory.  The problem is that $srcdir (and
845 # therefore $ac_aux_dir as well) can be either absolute or relative,
846 # depending on how configure is run.  This is pretty annoying, since
847 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
848 # source directory, any form will work fine, but in subdirectories a
849 # relative path needs to be adjusted first.
850 #
851 # $ac_aux_dir/missing
852 #    fails when called from a subdirectory if $ac_aux_dir is relative
853 # $top_srcdir/$ac_aux_dir/missing
854 #    fails if $ac_aux_dir is absolute,
855 #    fails when called from a subdirectory in a VPATH build with
856 #          a relative $ac_aux_dir
857 #
858 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
859 # are both prefixed by $srcdir.  In an in-source build this is usually
860 # harmless because $srcdir is `.', but things will broke when you
861 # start a VPATH build or use an absolute $srcdir.
862 #
863 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
864 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
865 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
866 # and then we would define $MISSING as
867 #   MISSING="\${SHELL} $am_aux_dir/missing"
868 # This will work as long as MISSING is not called from configure, because
869 # unfortunately $(top_srcdir) has no meaning in configure.
870 # However there are other variables, like CC, which are often used in
871 # configure, and could therefore not use this "fixed" $ac_aux_dir.
872 #
873 # Another solution, used here, is to always expand $ac_aux_dir to an
874 # absolute PATH.  The drawback is that using absolute paths prevent a
875 # configured tree to be moved without reconfiguration.
876
877 AC_DEFUN([AM_AUX_DIR_EXPAND],
878 [dnl Rely on autoconf to set up CDPATH properly.
879 AC_PREREQ([2.50])dnl
880 # expand $ac_aux_dir to an absolute path
881 am_aux_dir=`cd $ac_aux_dir && pwd`
882 ])
883
884 # AM_CONDITIONAL                                            -*- Autoconf -*-
885
886 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
887 # Free Software Foundation, Inc.
888 #
889 # This file is free software; the Free Software Foundation
890 # gives unlimited permission to copy and/or distribute it,
891 # with or without modifications, as long as this notice is preserved.
892
893 # serial 9
894
895 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
896 # -------------------------------------
897 # Define a conditional.
898 AC_DEFUN([AM_CONDITIONAL],
899 [AC_PREREQ(2.52)dnl
900  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
901         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
902 AC_SUBST([$1_TRUE])dnl
903 AC_SUBST([$1_FALSE])dnl
904 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
905 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
906 m4_define([_AM_COND_VALUE_$1], [$2])dnl
907 if $2; then
908   $1_TRUE=
909   $1_FALSE='#'
910 else
911   $1_TRUE='#'
912   $1_FALSE=
913 fi
914 AC_CONFIG_COMMANDS_PRE(
915 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
916   AC_MSG_ERROR([[conditional "$1" was never defined.
917 Usually this means the macro was only invoked conditionally.]])
918 fi])])
919
920 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
921 # Free Software Foundation, Inc.
922 #
923 # This file is free software; the Free Software Foundation
924 # gives unlimited permission to copy and/or distribute it,
925 # with or without modifications, as long as this notice is preserved.
926
927 # serial 10
928
929 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
930 # written in clear, in which case automake, when reading aclocal.m4,
931 # will think it sees a *use*, and therefore will trigger all it's
932 # C support machinery.  Also note that it means that autoscan, seeing
933 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
934
935
936 # _AM_DEPENDENCIES(NAME)
937 # ----------------------
938 # See how the compiler implements dependency checking.
939 # NAME is "CC", "CXX", "GCJ", or "OBJC".
940 # We try a few techniques and use that to set a single cache variable.
941 #
942 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
943 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
944 # dependency, and given that the user is not expected to run this macro,
945 # just rely on AC_PROG_CC.
946 AC_DEFUN([_AM_DEPENDENCIES],
947 [AC_REQUIRE([AM_SET_DEPDIR])dnl
948 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
949 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
950 AC_REQUIRE([AM_DEP_TRACK])dnl
951
952 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
953        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
954        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
955        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
956        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
957                    [depcc="$$1"   am_compiler_list=])
958
959 AC_CACHE_CHECK([dependency style of $depcc],
960                [am_cv_$1_dependencies_compiler_type],
961 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
962   # We make a subdir and do the tests there.  Otherwise we can end up
963   # making bogus files that we don't know about and never remove.  For
964   # instance it was reported that on HP-UX the gcc test will end up
965   # making a dummy file named `D' -- because `-MD' means `put the output
966   # in D'.
967   mkdir conftest.dir
968   # Copy depcomp to subdir because otherwise we won't find it if we're
969   # using a relative directory.
970   cp "$am_depcomp" conftest.dir
971   cd conftest.dir
972   # We will build objects and dependencies in a subdirectory because
973   # it helps to detect inapplicable dependency modes.  For instance
974   # both Tru64's cc and ICC support -MD to output dependencies as a
975   # side effect of compilation, but ICC will put the dependencies in
976   # the current directory while Tru64 will put them in the object
977   # directory.
978   mkdir sub
979
980   am_cv_$1_dependencies_compiler_type=none
981   if test "$am_compiler_list" = ""; then
982      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
983   fi
984   am__universal=false
985   m4_case([$1], [CC],
986     [case " $depcc " in #(
987      *\ -arch\ *\ -arch\ *) am__universal=true ;;
988      esac],
989     [CXX],
990     [case " $depcc " in #(
991      *\ -arch\ *\ -arch\ *) am__universal=true ;;
992      esac])
993
994   for depmode in $am_compiler_list; do
995     # Setup a source with many dependencies, because some compilers
996     # like to wrap large dependency lists on column 80 (with \), and
997     # we should not choose a depcomp mode which is confused by this.
998     #
999     # We need to recreate these files for each test, as the compiler may
1000     # overwrite some of them when testing with obscure command lines.
1001     # This happens at least with the AIX C compiler.
1002     : > sub/conftest.c
1003     for i in 1 2 3 4 5 6; do
1004       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1005       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1006       # Solaris 8's {/usr,}/bin/sh.
1007       touch sub/conftst$i.h
1008     done
1009     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1010
1011     # We check with `-c' and `-o' for the sake of the "dashmstdout"
1012     # mode.  It turns out that the SunPro C++ compiler does not properly
1013     # handle `-M -o', and we need to detect this.  Also, some Intel
1014     # versions had trouble with output in subdirs
1015     am__obj=sub/conftest.${OBJEXT-o}
1016     am__minus_obj="-o $am__obj"
1017     case $depmode in
1018     gcc)
1019       # This depmode causes a compiler race in universal mode.
1020       test "$am__universal" = false || continue
1021       ;;
1022     nosideeffect)
1023       # after this tag, mechanisms are not by side-effect, so they'll
1024       # only be used when explicitly requested
1025       if test "x$enable_dependency_tracking" = xyes; then
1026         continue
1027       else
1028         break
1029       fi
1030       ;;
1031     msvisualcpp | msvcmsys)
1032       # This compiler won't grok `-c -o', but also, the minuso test has
1033       # not run yet.  These depmodes are late enough in the game, and
1034       # so weak that their functioning should not be impacted.
1035       am__obj=conftest.${OBJEXT-o}
1036       am__minus_obj=
1037       ;;
1038     none) break ;;
1039     esac
1040     if depmode=$depmode \
1041        source=sub/conftest.c object=$am__obj \
1042        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1043        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1044          >/dev/null 2>conftest.err &&
1045        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1046        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1047        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1048        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1049       # icc doesn't choke on unknown options, it will just issue warnings
1050       # or remarks (even with -Werror).  So we grep stderr for any message
1051       # that says an option was ignored or not supported.
1052       # When given -MP, icc 7.0 and 7.1 complain thusly:
1053       #   icc: Command line warning: ignoring option '-M'; no argument required
1054       # The diagnosis changed in icc 8.0:
1055       #   icc: Command line remark: option '-MP' not supported
1056       if (grep 'ignoring option' conftest.err ||
1057           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1058         am_cv_$1_dependencies_compiler_type=$depmode
1059         break
1060       fi
1061     fi
1062   done
1063
1064   cd ..
1065   rm -rf conftest.dir
1066 else
1067   am_cv_$1_dependencies_compiler_type=none
1068 fi
1069 ])
1070 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1071 AM_CONDITIONAL([am__fastdep$1], [
1072   test "x$enable_dependency_tracking" != xno \
1073   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1074 ])
1075
1076
1077 # AM_SET_DEPDIR
1078 # -------------
1079 # Choose a directory name for dependency files.
1080 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1081 AC_DEFUN([AM_SET_DEPDIR],
1082 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1083 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1084 ])
1085
1086
1087 # AM_DEP_TRACK
1088 # ------------
1089 AC_DEFUN([AM_DEP_TRACK],
1090 [AC_ARG_ENABLE(dependency-tracking,
1091 [  --disable-dependency-tracking  speeds up one-time build
1092   --enable-dependency-tracking   do not reject slow dependency extractors])
1093 if test "x$enable_dependency_tracking" != xno; then
1094   am_depcomp="$ac_aux_dir/depcomp"
1095   AMDEPBACKSLASH='\'
1096 fi
1097 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1098 AC_SUBST([AMDEPBACKSLASH])dnl
1099 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1100 ])
1101
1102 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1103
1104 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1105 # Free Software Foundation, Inc.
1106 #
1107 # This file is free software; the Free Software Foundation
1108 # gives unlimited permission to copy and/or distribute it,
1109 # with or without modifications, as long as this notice is preserved.
1110
1111 #serial 5
1112
1113 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1114 # ------------------------------
1115 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1116 [{
1117   # Autoconf 2.62 quotes --file arguments for eval, but not when files
1118   # are listed without --file.  Let's play safe and only enable the eval
1119   # if we detect the quoting.
1120   case $CONFIG_FILES in
1121   *\'*) eval set x "$CONFIG_FILES" ;;
1122   *)   set x $CONFIG_FILES ;;
1123   esac
1124   shift
1125   for mf
1126   do
1127     # Strip MF so we end up with the name of the file.
1128     mf=`echo "$mf" | sed -e 's/:.*$//'`
1129     # Check whether this is an Automake generated Makefile or not.
1130     # We used to match only the files named `Makefile.in', but
1131     # some people rename them; so instead we look at the file content.
1132     # Grep'ing the first line is not enough: some people post-process
1133     # each Makefile.in and add a new line on top of each file to say so.
1134     # Grep'ing the whole file is not good either: AIX grep has a line
1135     # limit of 2048, but all sed's we know have understand at least 4000.
1136     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1137       dirpart=`AS_DIRNAME("$mf")`
1138     else
1139       continue
1140     fi
1141     # Extract the definition of DEPDIR, am__include, and am__quote
1142     # from the Makefile without running `make'.
1143     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1144     test -z "$DEPDIR" && continue
1145     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1146     test -z "am__include" && continue
1147     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1148     # When using ansi2knr, U may be empty or an underscore; expand it
1149     U=`sed -n 's/^U = //p' < "$mf"`
1150     # Find all dependency output files, they are included files with
1151     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1152     # simplest approach to changing $(DEPDIR) to its actual value in the
1153     # expansion.
1154     for file in `sed -n "
1155       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1156          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1157       # Make sure the directory exists.
1158       test -f "$dirpart/$file" && continue
1159       fdir=`AS_DIRNAME(["$file"])`
1160       AS_MKDIR_P([$dirpart/$fdir])
1161       # echo "creating $dirpart/$file"
1162       echo '# dummy' > "$dirpart/$file"
1163     done
1164   done
1165 }
1166 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1167
1168
1169 # AM_OUTPUT_DEPENDENCY_COMMANDS
1170 # -----------------------------
1171 # This macro should only be invoked once -- use via AC_REQUIRE.
1172 #
1173 # This code is only required when automatic dependency tracking
1174 # is enabled.  FIXME.  This creates each `.P' file that we will
1175 # need in order to bootstrap the dependency handling code.
1176 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1177 [AC_CONFIG_COMMANDS([depfiles],
1178      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1179      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1180 ])
1181
1182 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1183 # Free Software Foundation, Inc.
1184 #
1185 # This file is free software; the Free Software Foundation
1186 # gives unlimited permission to copy and/or distribute it,
1187 # with or without modifications, as long as this notice is preserved.
1188
1189 # serial 8
1190
1191 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1192 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1193
1194 # Do all the work for Automake.                             -*- Autoconf -*-
1195
1196 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1197 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1198 #
1199 # This file is free software; the Free Software Foundation
1200 # gives unlimited permission to copy and/or distribute it,
1201 # with or without modifications, as long as this notice is preserved.
1202
1203 # serial 16
1204
1205 # This macro actually does too much.  Some checks are only needed if
1206 # your package does certain things.  But this isn't really a big deal.
1207
1208 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1209 # AM_INIT_AUTOMAKE([OPTIONS])
1210 # -----------------------------------------------
1211 # The call with PACKAGE and VERSION arguments is the old style
1212 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1213 # and VERSION should now be passed to AC_INIT and removed from
1214 # the call to AM_INIT_AUTOMAKE.
1215 # We support both call styles for the transition.  After
1216 # the next Automake release, Autoconf can make the AC_INIT
1217 # arguments mandatory, and then we can depend on a new Autoconf
1218 # release and drop the old call support.
1219 AC_DEFUN([AM_INIT_AUTOMAKE],
1220 [AC_PREREQ([2.62])dnl
1221 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1222 dnl the ones we care about.
1223 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1224 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1225 AC_REQUIRE([AC_PROG_INSTALL])dnl
1226 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1227   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1228   # is not polluted with repeated "-I."
1229   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1230   # test to see if srcdir already configured
1231   if test -f $srcdir/config.status; then
1232     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1233   fi
1234 fi
1235
1236 # test whether we have cygpath
1237 if test -z "$CYGPATH_W"; then
1238   if (cygpath --version) >/dev/null 2>/dev/null; then
1239     CYGPATH_W='cygpath -w'
1240   else
1241     CYGPATH_W=echo
1242   fi
1243 fi
1244 AC_SUBST([CYGPATH_W])
1245
1246 # Define the identity of the package.
1247 dnl Distinguish between old-style and new-style calls.
1248 m4_ifval([$2],
1249 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1250  AC_SUBST([PACKAGE], [$1])dnl
1251  AC_SUBST([VERSION], [$2])],
1252 [_AM_SET_OPTIONS([$1])dnl
1253 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1254 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1255   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1256  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1257  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1258
1259 _AM_IF_OPTION([no-define],,
1260 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1261  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1262
1263 # Some tools Automake needs.
1264 AC_REQUIRE([AM_SANITY_CHECK])dnl
1265 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1266 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1267 AM_MISSING_PROG(AUTOCONF, autoconf)
1268 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1269 AM_MISSING_PROG(AUTOHEADER, autoheader)
1270 AM_MISSING_PROG(MAKEINFO, makeinfo)
1271 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1272 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1273 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1274 # We need awk for the "check" target.  The system "awk" is bad on
1275 # some platforms.
1276 AC_REQUIRE([AC_PROG_AWK])dnl
1277 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1278 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1279 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1280               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1281                              [_AM_PROG_TAR([v7])])])
1282 _AM_IF_OPTION([no-dependencies],,
1283 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1284                   [_AM_DEPENDENCIES(CC)],
1285                   [define([AC_PROG_CC],
1286                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1287 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1288                   [_AM_DEPENDENCIES(CXX)],
1289                   [define([AC_PROG_CXX],
1290                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1291 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1292                   [_AM_DEPENDENCIES(OBJC)],
1293                   [define([AC_PROG_OBJC],
1294                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1295 ])
1296 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1297 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1298 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1299 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1300 AC_CONFIG_COMMANDS_PRE(dnl
1301 [m4_provide_if([_AM_COMPILER_EXEEXT],
1302   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1303 ])
1304
1305 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1306 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1307 dnl mangled by Autoconf and run in a shell conditional statement.
1308 m4_define([_AC_COMPILER_EXEEXT],
1309 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1310
1311
1312 # When config.status generates a header, we must update the stamp-h file.
1313 # This file resides in the same directory as the config header
1314 # that is generated.  The stamp files are numbered to have different names.
1315
1316 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1317 # loop where config.status creates the headers, so we can generate
1318 # our stamp files there.
1319 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1320 [# Compute $1's index in $config_headers.
1321 _am_arg=$1
1322 _am_stamp_count=1
1323 for _am_header in $config_headers :; do
1324   case $_am_header in
1325     $_am_arg | $_am_arg:* )
1326       break ;;
1327     * )
1328       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1329   esac
1330 done
1331 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1332
1333 # Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1334 #
1335 # This file is free software; the Free Software Foundation
1336 # gives unlimited permission to copy and/or distribute it,
1337 # with or without modifications, as long as this notice is preserved.
1338
1339 # AM_PROG_INSTALL_SH
1340 # ------------------
1341 # Define $install_sh.
1342 AC_DEFUN([AM_PROG_INSTALL_SH],
1343 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1344 if test x"${install_sh}" != xset; then
1345   case $am_aux_dir in
1346   *\ * | *\     *)
1347     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1348   *)
1349     install_sh="\${SHELL} $am_aux_dir/install-sh"
1350   esac
1351 fi
1352 AC_SUBST(install_sh)])
1353
1354 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1355 #
1356 # This file is free software; the Free Software Foundation
1357 # gives unlimited permission to copy and/or distribute it,
1358 # with or without modifications, as long as this notice is preserved.
1359
1360 # serial 2
1361
1362 # Check whether the underlying file-system supports filenames
1363 # with a leading dot.  For instance MS-DOS doesn't.
1364 AC_DEFUN([AM_SET_LEADING_DOT],
1365 [rm -rf .tst 2>/dev/null
1366 mkdir .tst 2>/dev/null
1367 if test -d .tst; then
1368   am__leading_dot=.
1369 else
1370   am__leading_dot=_
1371 fi
1372 rmdir .tst 2>/dev/null
1373 AC_SUBST([am__leading_dot])])
1374
1375 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1376
1377 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1378 #
1379 # This file is free software; the Free Software Foundation
1380 # gives unlimited permission to copy and/or distribute it,
1381 # with or without modifications, as long as this notice is preserved.
1382
1383 # serial 4
1384
1385 # AM_MAKE_INCLUDE()
1386 # -----------------
1387 # Check to see how make treats includes.
1388 AC_DEFUN([AM_MAKE_INCLUDE],
1389 [am_make=${MAKE-make}
1390 cat > confinc << 'END'
1391 am__doit:
1392         @echo this is the am__doit target
1393 .PHONY: am__doit
1394 END
1395 # If we don't find an include directive, just comment out the code.
1396 AC_MSG_CHECKING([for style of include used by $am_make])
1397 am__include="#"
1398 am__quote=
1399 _am_result=none
1400 # First try GNU make style include.
1401 echo "include confinc" > confmf
1402 # Ignore all kinds of additional output from `make'.
1403 case `$am_make -s -f confmf 2> /dev/null` in #(
1404 *the\ am__doit\ target*)
1405   am__include=include
1406   am__quote=
1407   _am_result=GNU
1408   ;;
1409 esac
1410 # Now try BSD make style include.
1411 if test "$am__include" = "#"; then
1412    echo '.include "confinc"' > confmf
1413    case `$am_make -s -f confmf 2> /dev/null` in #(
1414    *the\ am__doit\ target*)
1415      am__include=.include
1416      am__quote="\""
1417      _am_result=BSD
1418      ;;
1419    esac
1420 fi
1421 AC_SUBST([am__include])
1422 AC_SUBST([am__quote])
1423 AC_MSG_RESULT([$_am_result])
1424 rm -f confinc confmf
1425 ])
1426
1427 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1428
1429 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1430 # Free Software Foundation, Inc.
1431 #
1432 # This file is free software; the Free Software Foundation
1433 # gives unlimited permission to copy and/or distribute it,
1434 # with or without modifications, as long as this notice is preserved.
1435
1436 # serial 6
1437
1438 # AM_MISSING_PROG(NAME, PROGRAM)
1439 # ------------------------------
1440 AC_DEFUN([AM_MISSING_PROG],
1441 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1442 $1=${$1-"${am_missing_run}$2"}
1443 AC_SUBST($1)])
1444
1445
1446 # AM_MISSING_HAS_RUN
1447 # ------------------
1448 # Define MISSING if not defined so far and test if it supports --run.
1449 # If it does, set am_missing_run to use it, otherwise, to nothing.
1450 AC_DEFUN([AM_MISSING_HAS_RUN],
1451 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1452 AC_REQUIRE_AUX_FILE([missing])dnl
1453 if test x"${MISSING+set}" != xset; then
1454   case $am_aux_dir in
1455   *\ * | *\     *)
1456     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1457   *)
1458     MISSING="\${SHELL} $am_aux_dir/missing" ;;
1459   esac
1460 fi
1461 # Use eval to expand $SHELL
1462 if eval "$MISSING --run true"; then
1463   am_missing_run="$MISSING --run "
1464 else
1465   am_missing_run=
1466   AC_MSG_WARN([`missing' script is too old or missing])
1467 fi
1468 ])
1469
1470 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1471 #
1472 # This file is free software; the Free Software Foundation
1473 # gives unlimited permission to copy and/or distribute it,
1474 # with or without modifications, as long as this notice is preserved.
1475
1476 # AM_PROG_MKDIR_P
1477 # ---------------
1478 # Check for `mkdir -p'.
1479 AC_DEFUN([AM_PROG_MKDIR_P],
1480 [AC_PREREQ([2.60])dnl
1481 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1482 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1483 dnl while keeping a definition of mkdir_p for backward compatibility.
1484 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1485 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1486 dnl Makefile.ins that do not define MKDIR_P, so we do our own
1487 dnl adjustment using top_builddir (which is defined more often than
1488 dnl MKDIR_P).
1489 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1490 case $mkdir_p in
1491   [[\\/$]]* | ?:[[\\/]]*) ;;
1492   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1493 esac
1494 ])
1495
1496 # Helper functions for option handling.                     -*- Autoconf -*-
1497
1498 # Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1499 #
1500 # This file is free software; the Free Software Foundation
1501 # gives unlimited permission to copy and/or distribute it,
1502 # with or without modifications, as long as this notice is preserved.
1503
1504 # serial 4
1505
1506 # _AM_MANGLE_OPTION(NAME)
1507 # -----------------------
1508 AC_DEFUN([_AM_MANGLE_OPTION],
1509 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1510
1511 # _AM_SET_OPTION(NAME)
1512 # ------------------------------
1513 # Set option NAME.  Presently that only means defining a flag for this option.
1514 AC_DEFUN([_AM_SET_OPTION],
1515 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1516
1517 # _AM_SET_OPTIONS(OPTIONS)
1518 # ----------------------------------
1519 # OPTIONS is a space-separated list of Automake options.
1520 AC_DEFUN([_AM_SET_OPTIONS],
1521 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1522
1523 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1524 # -------------------------------------------
1525 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1526 AC_DEFUN([_AM_IF_OPTION],
1527 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1528
1529 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1530
1531 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1532 # Free Software Foundation, Inc.
1533 #
1534 # This file is free software; the Free Software Foundation
1535 # gives unlimited permission to copy and/or distribute it,
1536 # with or without modifications, as long as this notice is preserved.
1537
1538 # serial 5
1539
1540 # AM_SANITY_CHECK
1541 # ---------------
1542 AC_DEFUN([AM_SANITY_CHECK],
1543 [AC_MSG_CHECKING([whether build environment is sane])
1544 # Just in case
1545 sleep 1
1546 echo timestamp > conftest.file
1547 # Reject unsafe characters in $srcdir or the absolute working directory
1548 # name.  Accept space and tab only in the latter.
1549 am_lf='
1550 '
1551 case `pwd` in
1552   *[[\\\"\#\$\&\'\`$am_lf]]*)
1553     AC_MSG_ERROR([unsafe absolute working directory name]);;
1554 esac
1555 case $srcdir in
1556   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
1557     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1558 esac
1559
1560 # Do `set' in a subshell so we don't clobber the current shell's
1561 # arguments.  Must try -L first in case configure is actually a
1562 # symlink; some systems play weird games with the mod time of symlinks
1563 # (eg FreeBSD returns the mod time of the symlink's containing
1564 # directory).
1565 if (
1566    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1567    if test "$[*]" = "X"; then
1568       # -L didn't work.
1569       set X `ls -t "$srcdir/configure" conftest.file`
1570    fi
1571    rm -f conftest.file
1572    if test "$[*]" != "X $srcdir/configure conftest.file" \
1573       && test "$[*]" != "X conftest.file $srcdir/configure"; then
1574
1575       # If neither matched, then we have a broken ls.  This can happen
1576       # if, for instance, CONFIG_SHELL is bash and it inherits a
1577       # broken ls alias from the environment.  This has actually
1578       # happened.  Such a system could not be considered "sane".
1579       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1580 alias in your environment])
1581    fi
1582
1583    test "$[2]" = conftest.file
1584    )
1585 then
1586    # Ok.
1587    :
1588 else
1589    AC_MSG_ERROR([newly created file is older than distributed files!
1590 Check your system clock])
1591 fi
1592 AC_MSG_RESULT(yes)])
1593
1594 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1595 #
1596 # This file is free software; the Free Software Foundation
1597 # gives unlimited permission to copy and/or distribute it,
1598 # with or without modifications, as long as this notice is preserved.
1599
1600 # AM_PROG_INSTALL_STRIP
1601 # ---------------------
1602 # One issue with vendor `install' (even GNU) is that you can't
1603 # specify the program used to strip binaries.  This is especially
1604 # annoying in cross-compiling environments, where the build's strip
1605 # is unlikely to handle the host's binaries.
1606 # Fortunately install-sh will honor a STRIPPROG variable, so we
1607 # always use install-sh in `make install-strip', and initialize
1608 # STRIPPROG with the value of the STRIP variable (set by the user).
1609 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1610 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1611 # Installed binaries are usually stripped using `strip' when the user
1612 # run `make install-strip'.  However `strip' might not be the right
1613 # tool to use in cross-compilation environments, therefore Automake
1614 # will honor the `STRIP' environment variable to overrule this program.
1615 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1616 if test "$cross_compiling" != no; then
1617   AC_CHECK_TOOL([STRIP], [strip], :)
1618 fi
1619 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1620 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1621
1622 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1623 #
1624 # This file is free software; the Free Software Foundation
1625 # gives unlimited permission to copy and/or distribute it,
1626 # with or without modifications, as long as this notice is preserved.
1627
1628 # serial 2
1629
1630 # _AM_SUBST_NOTMAKE(VARIABLE)
1631 # ---------------------------
1632 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1633 # This macro is traced by Automake.
1634 AC_DEFUN([_AM_SUBST_NOTMAKE])
1635
1636 # AM_SUBST_NOTMAKE(VARIABLE)
1637 # ---------------------------
1638 # Public sister of _AM_SUBST_NOTMAKE.
1639 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1640
1641 # Check how to create a tarball.                            -*- Autoconf -*-
1642
1643 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1644 #
1645 # This file is free software; the Free Software Foundation
1646 # gives unlimited permission to copy and/or distribute it,
1647 # with or without modifications, as long as this notice is preserved.
1648
1649 # serial 2
1650
1651 # _AM_PROG_TAR(FORMAT)
1652 # --------------------
1653 # Check how to create a tarball in format FORMAT.
1654 # FORMAT should be one of `v7', `ustar', or `pax'.
1655 #
1656 # Substitute a variable $(am__tar) that is a command
1657 # writing to stdout a FORMAT-tarball containing the directory
1658 # $tardir.
1659 #     tardir=directory && $(am__tar) > result.tar
1660 #
1661 # Substitute a variable $(am__untar) that extract such
1662 # a tarball read from stdin.
1663 #     $(am__untar) < result.tar
1664 AC_DEFUN([_AM_PROG_TAR],
1665 [# Always define AMTAR for backward compatibility.
1666 AM_MISSING_PROG([AMTAR], [tar])
1667 m4_if([$1], [v7],
1668      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1669      [m4_case([$1], [ustar],, [pax],,
1670               [m4_fatal([Unknown tar format])])
1671 AC_MSG_CHECKING([how to create a $1 tar archive])
1672 # Loop over all known methods to create a tar archive until one works.
1673 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1674 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1675 # Do not fold the above two line into one, because Tru64 sh and
1676 # Solaris sh will not grok spaces in the rhs of `-'.
1677 for _am_tool in $_am_tools
1678 do
1679   case $_am_tool in
1680   gnutar)
1681     for _am_tar in tar gnutar gtar;
1682     do
1683       AM_RUN_LOG([$_am_tar --version]) && break
1684     done
1685     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1686     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1687     am__untar="$_am_tar -xf -"
1688     ;;
1689   plaintar)
1690     # Must skip GNU tar: if it does not support --format= it doesn't create
1691     # ustar tarball either.
1692     (tar --version) >/dev/null 2>&1 && continue
1693     am__tar='tar chf - "$$tardir"'
1694     am__tar_='tar chf - "$tardir"'
1695     am__untar='tar xf -'
1696     ;;
1697   pax)
1698     am__tar='pax -L -x $1 -w "$$tardir"'
1699     am__tar_='pax -L -x $1 -w "$tardir"'
1700     am__untar='pax -r'
1701     ;;
1702   cpio)
1703     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1704     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1705     am__untar='cpio -i -H $1 -d'
1706     ;;
1707   none)
1708     am__tar=false
1709     am__tar_=false
1710     am__untar=false
1711     ;;
1712   esac
1713
1714   # If the value was cached, stop now.  We just wanted to have am__tar
1715   # and am__untar set.
1716   test -n "${am_cv_prog_tar_$1}" && break
1717
1718   # tar/untar a dummy directory, and stop if the command works
1719   rm -rf conftest.dir
1720   mkdir conftest.dir
1721   echo GrepMe > conftest.dir/file
1722   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1723   rm -rf conftest.dir
1724   if test -s conftest.tar; then
1725     AM_RUN_LOG([$am__untar <conftest.tar])
1726     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1727   fi
1728 done
1729 rm -rf conftest.dir
1730
1731 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1732 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1733 AC_SUBST([am__tar])
1734 AC_SUBST([am__untar])
1735 ]) # _AM_PROG_TAR
1736
1737 m4_include([m4/gettext.m4])
1738 m4_include([m4/iconv.m4])
1739 m4_include([m4/intlmacosx.m4])
1740 m4_include([m4/intltool.m4])
1741 m4_include([m4/lib-ld.m4])
1742 m4_include([m4/lib-link.m4])
1743 m4_include([m4/lib-prefix.m4])
1744 m4_include([m4/libtool.m4])
1745 m4_include([m4/ltoptions.m4])
1746 m4_include([m4/ltsugar.m4])
1747 m4_include([m4/ltversion.m4])
1748 m4_include([m4/lt~obsolete.m4])
1749 m4_include([m4/nls.m4])
1750 m4_include([m4/po.m4])
1751 m4_include([m4/progtest.m4])