bug repairs and update for libgpiv3 interface
[gpiv.git] / aclocal.m4
blobebdee2cac8b11085c6f479b817048901335b1b29
1 # generated automatically by aclocal 1.10.1 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
14 m4_ifndef([AC_AUTOCONF_VERSION],
15   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(AC_AUTOCONF_VERSION, [2.61],,
17 [m4_warning([this file was generated for autoconf 2.61.
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'.])])
22 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
23 # Copyright (C) 2001-2003,2004 Red Hat, Inc.
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.
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.
35 # Macro to add for using GNU gettext.
36 # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
38 # Modified to never use included libintl. 
39 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
41 # Major rework to remove unused code
42 # Owen Taylor <otaylor@redhat.com>, 12/11/2002
44 # Added better handling of ALL_LINGUAS from GNU gettext version 
45 # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
47 # Modified to require ngettext
48 # Matthias Clasen <mclasen@redhat.com> 08/06/2004
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)
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
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])
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)
118 AC_SUBST($1)dnl
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)
128     gt_cv_have_gettext=no
130     CATOBJEXT=NONE
131     XGETTEXT=:
132     INTLLIBS=
134     AC_CHECK_HEADER(libintl.h,
135      [gt_cv_func_dgettext_libintl="no"
136       libintl_extra_libs=""
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>
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>
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
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)])])
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
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"
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
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     ])
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
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
294     # We need to process the po/ directory.
295     POSUB=po
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])
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
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   ])
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.
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
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
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
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)
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   ])
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"`
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])
431 dnl Now the definitions that aclocal will find
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
438 # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
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
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])
456 dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
457 # serial 40 IT_PROG_INTLTOOL
458 AC_DEFUN([IT_PROG_INTLTOOL], [
459 AC_PREREQ([2.50])dnl
460 AC_REQUIRE([AM_NLS])dnl
462 case "$am__api_version" in
463     1.[01234])
464         AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
465     ;;
466     *)
467     ;;
468 esac
470 if test -n "$1"; then
471     AC_MSG_CHECKING([for intltool >= $1])
473     INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
474     INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
475     [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
476     ]
477     AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
478     test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
479         AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
482 AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
483 AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
484 AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
485 if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
486     AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
489   INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
490 INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
491      INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
492      INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
493       INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
494      INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
495    INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
496     INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
497 INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
498        INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
499       INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
500       INTLTOOL_XML_NOMERGE_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' 
501       INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
502       INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
503     INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
504   INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
505     INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
506     INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
507    INTLTOOL_POLICY_RULE='%.policy:    %.policy.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
509 AC_SUBST(INTLTOOL_DESKTOP_RULE)
510 AC_SUBST(INTLTOOL_DIRECTORY_RULE)
511 AC_SUBST(INTLTOOL_KEYS_RULE)
512 AC_SUBST(INTLTOOL_PROP_RULE)
513 AC_SUBST(INTLTOOL_OAF_RULE)
514 AC_SUBST(INTLTOOL_PONG_RULE)
515 AC_SUBST(INTLTOOL_SERVER_RULE)
516 AC_SUBST(INTLTOOL_SHEET_RULE)
517 AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
518 AC_SUBST(INTLTOOL_UI_RULE)
519 AC_SUBST(INTLTOOL_XAM_RULE)
520 AC_SUBST(INTLTOOL_KBD_RULE)
521 AC_SUBST(INTLTOOL_XML_RULE)
522 AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
523 AC_SUBST(INTLTOOL_CAVES_RULE)
524 AC_SUBST(INTLTOOL_SCHEMAS_RULE)
525 AC_SUBST(INTLTOOL_THEME_RULE)
526 AC_SUBST(INTLTOOL_SERVICE_RULE)
527 AC_SUBST(INTLTOOL_POLICY_RULE)
529 # Check the gettext tools to make sure they are GNU
530 AC_PATH_PROG(XGETTEXT, xgettext)
531 AC_PATH_PROG(MSGMERGE, msgmerge)
532 AC_PATH_PROG(MSGFMT, msgfmt)
533 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
534 if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
535     AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
537 xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
538 mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
539 mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
540 if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
541     AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
544 AC_PATH_PROG(INTLTOOL_PERL, [perl])
545 if test -z "$INTLTOOL_PERL"; then
546    AC_MSG_ERROR([perl not found; required for intltool])
548 if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
549    AC_MSG_ERROR([perl 5.x required for intltool])
551 if test "x$2" != "xno-xml"; then
552    AC_MSG_CHECKING([for XML::Parser])
553    if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
554        AC_MSG_RESULT([ok])
555    else
556        AC_MSG_ERROR([XML::Parser perl module is required for intltool])
557    fi
560 # Substitute ALL_LINGUAS so we can use it in po/Makefile
561 AC_SUBST(ALL_LINGUAS)
563 # Set DATADIRNAME correctly if it is not set yet
564 # (copied from glib-gettext.m4)
565 if test -z "$DATADIRNAME"; then
566   AC_LINK_IFELSE(
567     [AC_LANG_PROGRAM([[]],
568                      [[extern int _nl_msg_cat_cntr;
569                        return _nl_msg_cat_cntr]])],
570     [DATADIRNAME=share],
571     [case $host in
572     *-*-solaris*)
573     dnl On Solaris, if bind_textdomain_codeset is in libc,
574     dnl GNU format message catalog is always supported,
575     dnl since both are added to the libc all together.
576     dnl Hence, we'd like to go with DATADIRNAME=share
577     dnl in this case.
578     AC_CHECK_FUNC(bind_textdomain_codeset,
579       [DATADIRNAME=share], [DATADIRNAME=lib])
580     ;;
581     *)
582     [DATADIRNAME=lib]
583     ;;
584     esac])
586 AC_SUBST(DATADIRNAME)
588 IT_PO_SUBDIR([po])
593 # IT_PO_SUBDIR(DIRNAME)
594 # ---------------------
595 # All po subdirs have to be declared with this macro; the subdir "po" is
596 # declared by IT_PROG_INTLTOOL.
598 AC_DEFUN([IT_PO_SUBDIR],
599 [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
601 dnl The following CONFIG_COMMANDS should be exetuted at the very end
602 dnl of config.status.
603 AC_CONFIG_COMMANDS_PRE([
604   AC_CONFIG_COMMANDS([$1/stamp-it], [
605     if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" ]; then
606        AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
607     fi
608     rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
609     >"$1/stamp-it.tmp"
610     [sed '/^#/d
611          s/^[[].*] *//
612          /^[    ]*$/d
613         '"s|^|  $ac_top_srcdir/|" \
614       "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
615     ]
616     [sed '/^POTFILES =/,/[^\\]$/ {
617                 /^POTFILES =/!d
618                 r $1/POTFILES
619           }
620          ' "$1/Makefile.in" >"$1/Makefile"]
621     rm -f "$1/Makefile.tmp"
622     mv "$1/stamp-it.tmp" "$1/stamp-it"
623   ])
624 ])dnl
627 # deprecated macros
628 AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
629 # A hint is needed for aclocal from Automake <= 1.9.4:
630 # AC_DEFUN([AC_PROG_INTLTOOL], ...)
633 # nls.m4 serial 3 (gettext-0.15)
634 dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
635 dnl This file is free software; the Free Software Foundation
636 dnl gives unlimited permission to copy and/or distribute it,
637 dnl with or without modifications, as long as this notice is preserved.
639 dnl This file can can be used in projects which are not available under
640 dnl the GNU General Public License or the GNU Library General Public
641 dnl License but which still want to provide support for the GNU gettext
642 dnl functionality.
643 dnl Please note that the actual code of the GNU gettext library is covered
644 dnl by the GNU Library General Public License, and the rest of the GNU
645 dnl gettext package package is covered by the GNU General Public License.
646 dnl They are *not* in the public domain.
648 dnl Authors:
649 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
650 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
652 AC_PREREQ(2.50)
654 AC_DEFUN([AM_NLS],
656   AC_MSG_CHECKING([whether NLS is requested])
657   dnl Default is enabled NLS
658   AC_ARG_ENABLE(nls,
659     [  --disable-nls           do not use Native Language Support],
660     USE_NLS=$enableval, USE_NLS=yes)
661   AC_MSG_RESULT($USE_NLS)
662   AC_SUBST(USE_NLS)
665 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
667 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
669 # This program is free software; you can redistribute it and/or modify
670 # it under the terms of the GNU General Public License as published by
671 # the Free Software Foundation; either version 2 of the License, or
672 # (at your option) any later version.
674 # This program is distributed in the hope that it will be useful, but
675 # WITHOUT ANY WARRANTY; without even the implied warranty of
676 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
677 # General Public License for more details.
679 # You should have received a copy of the GNU General Public License
680 # along with this program; if not, write to the Free Software
681 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
683 # As a special exception to the GNU General Public License, if you
684 # distribute this file as part of a program that contains a
685 # configuration script generated by Autoconf, you may include it under
686 # the same distribution terms that you use for the rest of that program.
688 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
689 # ----------------------------------
690 AC_DEFUN([PKG_PROG_PKG_CONFIG],
691 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
692 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
693 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
694 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
695         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
697 if test -n "$PKG_CONFIG"; then
698         _pkg_min_version=m4_default([$1], [0.9.0])
699         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
700         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
701                 AC_MSG_RESULT([yes])
702         else
703                 AC_MSG_RESULT([no])
704                 PKG_CONFIG=""
705         fi
706                 
707 fi[]dnl
708 ])# PKG_PROG_PKG_CONFIG
710 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
712 # Check to see whether a particular set of modules exists.  Similar
713 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
716 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
717 # this or PKG_CHECK_MODULES is called, or make sure to call
718 # PKG_CHECK_EXISTS manually
719 # --------------------------------------------------------------
720 AC_DEFUN([PKG_CHECK_EXISTS],
721 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
722 if test -n "$PKG_CONFIG" && \
723     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
724   m4_ifval([$2], [$2], [:])
725 m4_ifvaln([$3], [else
726   $3])dnl
727 fi])
730 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
731 # ---------------------------------------------
732 m4_define([_PKG_CONFIG],
733 [if test -n "$PKG_CONFIG"; then
734     if test -n "$$1"; then
735         pkg_cv_[]$1="$$1"
736     else
737         PKG_CHECK_EXISTS([$3],
738                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
739                          [pkg_failed=yes])
740     fi
741 else
742         pkg_failed=untried
743 fi[]dnl
744 ])# _PKG_CONFIG
746 # _PKG_SHORT_ERRORS_SUPPORTED
747 # -----------------------------
748 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
749 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
750 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
751         _pkg_short_errors_supported=yes
752 else
753         _pkg_short_errors_supported=no
754 fi[]dnl
755 ])# _PKG_SHORT_ERRORS_SUPPORTED
758 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
759 # [ACTION-IF-NOT-FOUND])
762 # Note that if there is a possibility the first call to
763 # PKG_CHECK_MODULES might not happen, you should be sure to include an
764 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
767 # --------------------------------------------------------------
768 AC_DEFUN([PKG_CHECK_MODULES],
769 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
770 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
771 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
773 pkg_failed=no
774 AC_MSG_CHECKING([for $1])
776 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
777 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
779 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
780 and $1[]_LIBS to avoid the need to call pkg-config.
781 See the pkg-config man page for more details.])
783 if test $pkg_failed = yes; then
784         _PKG_SHORT_ERRORS_SUPPORTED
785         if test $_pkg_short_errors_supported = yes; then
786                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
787         else 
788                 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
789         fi
790         # Put the nasty error message in config.log where it belongs
791         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
793         ifelse([$4], , [AC_MSG_ERROR(dnl
794 [Package requirements ($2) were not met:
796 $$1_PKG_ERRORS
798 Consider adjusting the PKG_CONFIG_PATH environment variable if you
799 installed software in a non-standard prefix.
801 _PKG_TEXT
802 ])],
803                 [AC_MSG_RESULT([no])
804                 $4])
805 elif test $pkg_failed = untried; then
806         ifelse([$4], , [AC_MSG_FAILURE(dnl
807 [The pkg-config script could not be found or is too old.  Make sure it
808 is in your PATH or set the PKG_CONFIG environment variable to the full
809 path to pkg-config.
811 _PKG_TEXT
813 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
814                 [$4])
815 else
816         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
817         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
818         AC_MSG_RESULT([yes])
819         ifelse([$3], , :, [$3])
820 fi[]dnl
821 ])# PKG_CHECK_MODULES
823 # Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
825 # This file is free software; the Free Software Foundation
826 # gives unlimited permission to copy and/or distribute it,
827 # with or without modifications, as long as this notice is preserved.
829 # AM_AUTOMAKE_VERSION(VERSION)
830 # ----------------------------
831 # Automake X.Y traces this macro to ensure aclocal.m4 has been
832 # generated from the m4 files accompanying Automake X.Y.
833 # (This private macro should not be called outside this file.)
834 AC_DEFUN([AM_AUTOMAKE_VERSION],
835 [am__api_version='1.10'
836 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
837 dnl require some minimum version.  Point them to the right macro.
838 m4_if([$1], [1.10.1], [],
839       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
842 # _AM_AUTOCONF_VERSION(VERSION)
843 # -----------------------------
844 # aclocal traces this macro to find the Autoconf version.
845 # This is a private macro too.  Using m4_define simplifies
846 # the logic in aclocal, which can simply ignore this definition.
847 m4_define([_AM_AUTOCONF_VERSION], [])
849 # AM_SET_CURRENT_AUTOMAKE_VERSION
850 # -------------------------------
851 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
852 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
853 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
854 [AM_AUTOMAKE_VERSION([1.10.1])dnl
855 m4_ifndef([AC_AUTOCONF_VERSION],
856   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
857 _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
859 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
861 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
863 # This file is free software; the Free Software Foundation
864 # gives unlimited permission to copy and/or distribute it,
865 # with or without modifications, as long as this notice is preserved.
867 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
868 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
869 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
871 # Of course, Automake must honor this variable whenever it calls a
872 # tool from the auxiliary directory.  The problem is that $srcdir (and
873 # therefore $ac_aux_dir as well) can be either absolute or relative,
874 # depending on how configure is run.  This is pretty annoying, since
875 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
876 # source directory, any form will work fine, but in subdirectories a
877 # relative path needs to be adjusted first.
879 # $ac_aux_dir/missing
880 #    fails when called from a subdirectory if $ac_aux_dir is relative
881 # $top_srcdir/$ac_aux_dir/missing
882 #    fails if $ac_aux_dir is absolute,
883 #    fails when called from a subdirectory in a VPATH build with
884 #          a relative $ac_aux_dir
886 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
887 # are both prefixed by $srcdir.  In an in-source build this is usually
888 # harmless because $srcdir is `.', but things will broke when you
889 # start a VPATH build or use an absolute $srcdir.
891 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
892 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
893 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
894 # and then we would define $MISSING as
895 #   MISSING="\${SHELL} $am_aux_dir/missing"
896 # This will work as long as MISSING is not called from configure, because
897 # unfortunately $(top_srcdir) has no meaning in configure.
898 # However there are other variables, like CC, which are often used in
899 # configure, and could therefore not use this "fixed" $ac_aux_dir.
901 # Another solution, used here, is to always expand $ac_aux_dir to an
902 # absolute PATH.  The drawback is that using absolute paths prevent a
903 # configured tree to be moved without reconfiguration.
905 AC_DEFUN([AM_AUX_DIR_EXPAND],
906 [dnl Rely on autoconf to set up CDPATH properly.
907 AC_PREREQ([2.50])dnl
908 # expand $ac_aux_dir to an absolute path
909 am_aux_dir=`cd $ac_aux_dir && pwd`
913 # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
914 # Free Software Foundation, Inc.
916 # This file is free software; the Free Software Foundation
917 # gives unlimited permission to copy and/or distribute it,
918 # with or without modifications, as long as this notice is preserved.
920 # serial 4
922 # This was merged into AC_PROG_CC in Autoconf.
924 AU_DEFUN([AM_PROG_CC_STDC],
925 [AC_PROG_CC
926 AC_DIAGNOSE([obsolete], [$0:
927         your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
928         `ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
929         you adjust the code.  You can also remove the above call to
930         AC_PROG_CC if you already called it elsewhere.])
931 am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
933 AU_DEFUN([fp_PROG_CC_STDC])
935 # AM_CONDITIONAL                                            -*- Autoconf -*-
937 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
938 # Free Software Foundation, Inc.
940 # This file is free software; the Free Software Foundation
941 # gives unlimited permission to copy and/or distribute it,
942 # with or without modifications, as long as this notice is preserved.
944 # serial 8
946 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
947 # -------------------------------------
948 # Define a conditional.
949 AC_DEFUN([AM_CONDITIONAL],
950 [AC_PREREQ(2.52)dnl
951  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
952         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
953 AC_SUBST([$1_TRUE])dnl
954 AC_SUBST([$1_FALSE])dnl
955 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
956 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
957 if $2; then
958   $1_TRUE=
959   $1_FALSE='#'
960 else
961   $1_TRUE='#'
962   $1_FALSE=
964 AC_CONFIG_COMMANDS_PRE(
965 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
966   AC_MSG_ERROR([[conditional "$1" was never defined.
967 Usually this means the macro was only invoked conditionally.]])
968 fi])])
970 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
971 # Free Software Foundation, Inc.
973 # This file is free software; the Free Software Foundation
974 # gives unlimited permission to copy and/or distribute it,
975 # with or without modifications, as long as this notice is preserved.
977 # serial 9
979 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
980 # written in clear, in which case automake, when reading aclocal.m4,
981 # will think it sees a *use*, and therefore will trigger all it's
982 # C support machinery.  Also note that it means that autoscan, seeing
983 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
986 # _AM_DEPENDENCIES(NAME)
987 # ----------------------
988 # See how the compiler implements dependency checking.
989 # NAME is "CC", "CXX", "GCJ", or "OBJC".
990 # We try a few techniques and use that to set a single cache variable.
992 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
993 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
994 # dependency, and given that the user is not expected to run this macro,
995 # just rely on AC_PROG_CC.
996 AC_DEFUN([_AM_DEPENDENCIES],
997 [AC_REQUIRE([AM_SET_DEPDIR])dnl
998 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
999 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1000 AC_REQUIRE([AM_DEP_TRACK])dnl
1002 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1003        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1004        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1005        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1006        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1007                    [depcc="$$1"   am_compiler_list=])
1009 AC_CACHE_CHECK([dependency style of $depcc],
1010                [am_cv_$1_dependencies_compiler_type],
1011 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1012   # We make a subdir and do the tests there.  Otherwise we can end up
1013   # making bogus files that we don't know about and never remove.  For
1014   # instance it was reported that on HP-UX the gcc test will end up
1015   # making a dummy file named `D' -- because `-MD' means `put the output
1016   # in D'.
1017   mkdir conftest.dir
1018   # Copy depcomp to subdir because otherwise we won't find it if we're
1019   # using a relative directory.
1020   cp "$am_depcomp" conftest.dir
1021   cd conftest.dir
1022   # We will build objects and dependencies in a subdirectory because
1023   # it helps to detect inapplicable dependency modes.  For instance
1024   # both Tru64's cc and ICC support -MD to output dependencies as a
1025   # side effect of compilation, but ICC will put the dependencies in
1026   # the current directory while Tru64 will put them in the object
1027   # directory.
1028   mkdir sub
1030   am_cv_$1_dependencies_compiler_type=none
1031   if test "$am_compiler_list" = ""; then
1032      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1033   fi
1034   for depmode in $am_compiler_list; do
1035     # Setup a source with many dependencies, because some compilers
1036     # like to wrap large dependency lists on column 80 (with \), and
1037     # we should not choose a depcomp mode which is confused by this.
1038     #
1039     # We need to recreate these files for each test, as the compiler may
1040     # overwrite some of them when testing with obscure command lines.
1041     # This happens at least with the AIX C compiler.
1042     : > sub/conftest.c
1043     for i in 1 2 3 4 5 6; do
1044       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1045       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1046       # Solaris 8's {/usr,}/bin/sh.
1047       touch sub/conftst$i.h
1048     done
1049     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1051     case $depmode in
1052     nosideeffect)
1053       # after this tag, mechanisms are not by side-effect, so they'll
1054       # only be used when explicitly requested
1055       if test "x$enable_dependency_tracking" = xyes; then
1056         continue
1057       else
1058         break
1059       fi
1060       ;;
1061     none) break ;;
1062     esac
1063     # We check with `-c' and `-o' for the sake of the "dashmstdout"
1064     # mode.  It turns out that the SunPro C++ compiler does not properly
1065     # handle `-M -o', and we need to detect this.
1066     if depmode=$depmode \
1067        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
1068        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1069        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
1070          >/dev/null 2>conftest.err &&
1071        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1072        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1073        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
1074        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1075       # icc doesn't choke on unknown options, it will just issue warnings
1076       # or remarks (even with -Werror).  So we grep stderr for any message
1077       # that says an option was ignored or not supported.
1078       # When given -MP, icc 7.0 and 7.1 complain thusly:
1079       #   icc: Command line warning: ignoring option '-M'; no argument required
1080       # The diagnosis changed in icc 8.0:
1081       #   icc: Command line remark: option '-MP' not supported
1082       if (grep 'ignoring option' conftest.err ||
1083           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1084         am_cv_$1_dependencies_compiler_type=$depmode
1085         break
1086       fi
1087     fi
1088   done
1090   cd ..
1091   rm -rf conftest.dir
1092 else
1093   am_cv_$1_dependencies_compiler_type=none
1096 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1097 AM_CONDITIONAL([am__fastdep$1], [
1098   test "x$enable_dependency_tracking" != xno \
1099   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1103 # AM_SET_DEPDIR
1104 # -------------
1105 # Choose a directory name for dependency files.
1106 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1107 AC_DEFUN([AM_SET_DEPDIR],
1108 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1109 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1113 # AM_DEP_TRACK
1114 # ------------
1115 AC_DEFUN([AM_DEP_TRACK],
1116 [AC_ARG_ENABLE(dependency-tracking,
1117 [  --disable-dependency-tracking  speeds up one-time build
1118   --enable-dependency-tracking   do not reject slow dependency extractors])
1119 if test "x$enable_dependency_tracking" != xno; then
1120   am_depcomp="$ac_aux_dir/depcomp"
1121   AMDEPBACKSLASH='\'
1123 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1124 AC_SUBST([AMDEPBACKSLASH])dnl
1125 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1128 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1130 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
1131 # Free Software Foundation, Inc.
1133 # This file is free software; the Free Software Foundation
1134 # gives unlimited permission to copy and/or distribute it,
1135 # with or without modifications, as long as this notice is preserved.
1137 #serial 3
1139 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1140 # ------------------------------
1141 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1142 [for mf in $CONFIG_FILES; do
1143   # Strip MF so we end up with the name of the file.
1144   mf=`echo "$mf" | sed -e 's/:.*$//'`
1145   # Check whether this is an Automake generated Makefile or not.
1146   # We used to match only the files named `Makefile.in', but
1147   # some people rename them; so instead we look at the file content.
1148   # Grep'ing the first line is not enough: some people post-process
1149   # each Makefile.in and add a new line on top of each file to say so.
1150   # Grep'ing the whole file is not good either: AIX grep has a line
1151   # limit of 2048, but all sed's we know have understand at least 4000.
1152   if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1153     dirpart=`AS_DIRNAME("$mf")`
1154   else
1155     continue
1156   fi
1157   # Extract the definition of DEPDIR, am__include, and am__quote
1158   # from the Makefile without running `make'.
1159   DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1160   test -z "$DEPDIR" && continue
1161   am__include=`sed -n 's/^am__include = //p' < "$mf"`
1162   test -z "am__include" && continue
1163   am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1164   # When using ansi2knr, U may be empty or an underscore; expand it
1165   U=`sed -n 's/^U = //p' < "$mf"`
1166   # Find all dependency output files, they are included files with
1167   # $(DEPDIR) in their names.  We invoke sed twice because it is the
1168   # simplest approach to changing $(DEPDIR) to its actual value in the
1169   # expansion.
1170   for file in `sed -n "
1171     s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1172        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1173     # Make sure the directory exists.
1174     test -f "$dirpart/$file" && continue
1175     fdir=`AS_DIRNAME(["$file"])`
1176     AS_MKDIR_P([$dirpart/$fdir])
1177     # echo "creating $dirpart/$file"
1178     echo '# dummy' > "$dirpart/$file"
1179   done
1180 done
1181 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1184 # AM_OUTPUT_DEPENDENCY_COMMANDS
1185 # -----------------------------
1186 # This macro should only be invoked once -- use via AC_REQUIRE.
1188 # This code is only required when automatic dependency tracking
1189 # is enabled.  FIXME.  This creates each `.P' file that we will
1190 # need in order to bootstrap the dependency handling code.
1191 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1192 [AC_CONFIG_COMMANDS([depfiles],
1193      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1194      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1197 # Do all the work for Automake.                             -*- Autoconf -*-
1199 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1200 # 2005, 2006, 2008 Free Software Foundation, Inc.
1202 # This file is free software; the Free Software Foundation
1203 # gives unlimited permission to copy and/or distribute it,
1204 # with or without modifications, as long as this notice is preserved.
1206 # serial 13
1208 # This macro actually does too much.  Some checks are only needed if
1209 # your package does certain things.  But this isn't really a big deal.
1211 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1212 # AM_INIT_AUTOMAKE([OPTIONS])
1213 # -----------------------------------------------
1214 # The call with PACKAGE and VERSION arguments is the old style
1215 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1216 # and VERSION should now be passed to AC_INIT and removed from
1217 # the call to AM_INIT_AUTOMAKE.
1218 # We support both call styles for the transition.  After
1219 # the next Automake release, Autoconf can make the AC_INIT
1220 # arguments mandatory, and then we can depend on a new Autoconf
1221 # release and drop the old call support.
1222 AC_DEFUN([AM_INIT_AUTOMAKE],
1223 [AC_PREREQ([2.60])dnl
1224 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1225 dnl the ones we care about.
1226 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1227 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1228 AC_REQUIRE([AC_PROG_INSTALL])dnl
1229 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1230   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1231   # is not polluted with repeated "-I."
1232   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1233   # test to see if srcdir already configured
1234   if test -f $srcdir/config.status; then
1235     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1236   fi
1239 # test whether we have cygpath
1240 if test -z "$CYGPATH_W"; then
1241   if (cygpath --version) >/dev/null 2>/dev/null; then
1242     CYGPATH_W='cygpath -w'
1243   else
1244     CYGPATH_W=echo
1245   fi
1247 AC_SUBST([CYGPATH_W])
1249 # Define the identity of the package.
1250 dnl Distinguish between old-style and new-style calls.
1251 m4_ifval([$2],
1252 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1253  AC_SUBST([PACKAGE], [$1])dnl
1254  AC_SUBST([VERSION], [$2])],
1255 [_AM_SET_OPTIONS([$1])dnl
1256 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1257 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1258   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1259  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1260  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1262 _AM_IF_OPTION([no-define],,
1263 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1264  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1266 # Some tools Automake needs.
1267 AC_REQUIRE([AM_SANITY_CHECK])dnl
1268 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1269 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1270 AM_MISSING_PROG(AUTOCONF, autoconf)
1271 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1272 AM_MISSING_PROG(AUTOHEADER, autoheader)
1273 AM_MISSING_PROG(MAKEINFO, makeinfo)
1274 AM_PROG_INSTALL_SH
1275 AM_PROG_INSTALL_STRIP
1276 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1277 # We need awk for the "check" target.  The system "awk" is bad on
1278 # some platforms.
1279 AC_REQUIRE([AC_PROG_AWK])dnl
1280 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1281 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1282 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1283               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1284                              [_AM_PROG_TAR([v7])])])
1285 _AM_IF_OPTION([no-dependencies],,
1286 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1287                   [_AM_DEPENDENCIES(CC)],
1288                   [define([AC_PROG_CC],
1289                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1290 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1291                   [_AM_DEPENDENCIES(CXX)],
1292                   [define([AC_PROG_CXX],
1293                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1294 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1295                   [_AM_DEPENDENCIES(OBJC)],
1296                   [define([AC_PROG_OBJC],
1297                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1302 # When config.status generates a header, we must update the stamp-h file.
1303 # This file resides in the same directory as the config header
1304 # that is generated.  The stamp files are numbered to have different names.
1306 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1307 # loop where config.status creates the headers, so we can generate
1308 # our stamp files there.
1309 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1310 [# Compute $1's index in $config_headers.
1311 _am_arg=$1
1312 _am_stamp_count=1
1313 for _am_header in $config_headers :; do
1314   case $_am_header in
1315     $_am_arg | $_am_arg:* )
1316       break ;;
1317     * )
1318       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1319   esac
1320 done
1321 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1323 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1325 # This file is free software; the Free Software Foundation
1326 # gives unlimited permission to copy and/or distribute it,
1327 # with or without modifications, as long as this notice is preserved.
1329 # AM_PROG_INSTALL_SH
1330 # ------------------
1331 # Define $install_sh.
1332 AC_DEFUN([AM_PROG_INSTALL_SH],
1333 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1334 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1335 AC_SUBST(install_sh)])
1337 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1339 # This file is free software; the Free Software Foundation
1340 # gives unlimited permission to copy and/or distribute it,
1341 # with or without modifications, as long as this notice is preserved.
1343 # serial 2
1345 # Check whether the underlying file-system supports filenames
1346 # with a leading dot.  For instance MS-DOS doesn't.
1347 AC_DEFUN([AM_SET_LEADING_DOT],
1348 [rm -rf .tst 2>/dev/null
1349 mkdir .tst 2>/dev/null
1350 if test -d .tst; then
1351   am__leading_dot=.
1352 else
1353   am__leading_dot=_
1355 rmdir .tst 2>/dev/null
1356 AC_SUBST([am__leading_dot])])
1358 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1359 # From Jim Meyering
1361 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
1362 # Free Software Foundation, Inc.
1364 # This file is free software; the Free Software Foundation
1365 # gives unlimited permission to copy and/or distribute it,
1366 # with or without modifications, as long as this notice is preserved.
1368 # serial 4
1370 AC_DEFUN([AM_MAINTAINER_MODE],
1371 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1372   dnl maintainer-mode is disabled by default
1373   AC_ARG_ENABLE(maintainer-mode,
1374 [  --enable-maintainer-mode  enable make rules and dependencies not useful
1375                           (and sometimes confusing) to the casual installer],
1376       USE_MAINTAINER_MODE=$enableval,
1377       USE_MAINTAINER_MODE=no)
1378   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1379   AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1380   MAINT=$MAINTAINER_MODE_TRUE
1381   AC_SUBST(MAINT)dnl
1385 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1387 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1389 # Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1391 # This file is free software; the Free Software Foundation
1392 # gives unlimited permission to copy and/or distribute it,
1393 # with or without modifications, as long as this notice is preserved.
1395 # serial 3
1397 # AM_MAKE_INCLUDE()
1398 # -----------------
1399 # Check to see how make treats includes.
1400 AC_DEFUN([AM_MAKE_INCLUDE],
1401 [am_make=${MAKE-make}
1402 cat > confinc << 'END'
1403 am__doit:
1404         @echo done
1405 .PHONY: am__doit
1407 # If we don't find an include directive, just comment out the code.
1408 AC_MSG_CHECKING([for style of include used by $am_make])
1409 am__include="#"
1410 am__quote=
1411 _am_result=none
1412 # First try GNU make style include.
1413 echo "include confinc" > confmf
1414 # We grep out `Entering directory' and `Leaving directory'
1415 # messages which can occur if `w' ends up in MAKEFLAGS.
1416 # In particular we don't look at `^make:' because GNU make might
1417 # be invoked under some other name (usually "gmake"), in which
1418 # case it prints its new name instead of `make'.
1419 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1420    am__include=include
1421    am__quote=
1422    _am_result=GNU
1424 # Now try BSD make style include.
1425 if test "$am__include" = "#"; then
1426    echo '.include "confinc"' > confmf
1427    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1428       am__include=.include
1429       am__quote="\""
1430       _am_result=BSD
1431    fi
1433 AC_SUBST([am__include])
1434 AC_SUBST([am__quote])
1435 AC_MSG_RESULT([$_am_result])
1436 rm -f confinc confmf
1439 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1441 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
1442 # Free Software Foundation, Inc.
1444 # This file is free software; the Free Software Foundation
1445 # gives unlimited permission to copy and/or distribute it,
1446 # with or without modifications, as long as this notice is preserved.
1448 # serial 5
1450 # AM_MISSING_PROG(NAME, PROGRAM)
1451 # ------------------------------
1452 AC_DEFUN([AM_MISSING_PROG],
1453 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1454 $1=${$1-"${am_missing_run}$2"}
1455 AC_SUBST($1)])
1458 # AM_MISSING_HAS_RUN
1459 # ------------------
1460 # Define MISSING if not defined so far and test if it supports --run.
1461 # If it does, set am_missing_run to use it, otherwise, to nothing.
1462 AC_DEFUN([AM_MISSING_HAS_RUN],
1463 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1464 AC_REQUIRE_AUX_FILE([missing])dnl
1465 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1466 # Use eval to expand $SHELL
1467 if eval "$MISSING --run true"; then
1468   am_missing_run="$MISSING --run "
1469 else
1470   am_missing_run=
1471   AC_MSG_WARN([`missing' script is too old or missing])
1475 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1477 # This file is free software; the Free Software Foundation
1478 # gives unlimited permission to copy and/or distribute it,
1479 # with or without modifications, as long as this notice is preserved.
1481 # AM_PROG_MKDIR_P
1482 # ---------------
1483 # Check for `mkdir -p'.
1484 AC_DEFUN([AM_PROG_MKDIR_P],
1485 [AC_PREREQ([2.60])dnl
1486 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1487 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1488 dnl while keeping a definition of mkdir_p for backward compatibility.
1489 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1490 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1491 dnl Makefile.ins that do not define MKDIR_P, so we do our own
1492 dnl adjustment using top_builddir (which is defined more often than
1493 dnl MKDIR_P).
1494 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1495 case $mkdir_p in
1496   [[\\/$]]* | ?:[[\\/]]*) ;;
1497   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1498 esac
1501 # Helper functions for option handling.                     -*- Autoconf -*-
1503 # Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1505 # This file is free software; the Free Software Foundation
1506 # gives unlimited permission to copy and/or distribute it,
1507 # with or without modifications, as long as this notice is preserved.
1509 # serial 3
1511 # _AM_MANGLE_OPTION(NAME)
1512 # -----------------------
1513 AC_DEFUN([_AM_MANGLE_OPTION],
1514 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1516 # _AM_SET_OPTION(NAME)
1517 # ------------------------------
1518 # Set option NAME.  Presently that only means defining a flag for this option.
1519 AC_DEFUN([_AM_SET_OPTION],
1520 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1522 # _AM_SET_OPTIONS(OPTIONS)
1523 # ----------------------------------
1524 # OPTIONS is a space-separated list of Automake options.
1525 AC_DEFUN([_AM_SET_OPTIONS],
1526 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1528 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1529 # -------------------------------------------
1530 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1531 AC_DEFUN([_AM_IF_OPTION],
1532 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1534 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1536 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1537 # Free Software Foundation, Inc.
1539 # This file is free software; the Free Software Foundation
1540 # gives unlimited permission to copy and/or distribute it,
1541 # with or without modifications, as long as this notice is preserved.
1543 # serial 4
1545 # AM_SANITY_CHECK
1546 # ---------------
1547 AC_DEFUN([AM_SANITY_CHECK],
1548 [AC_MSG_CHECKING([whether build environment is sane])
1549 # Just in case
1550 sleep 1
1551 echo timestamp > conftest.file
1552 # Do `set' in a subshell so we don't clobber the current shell's
1553 # arguments.  Must try -L first in case configure is actually a
1554 # symlink; some systems play weird games with the mod time of symlinks
1555 # (eg FreeBSD returns the mod time of the symlink's containing
1556 # directory).
1557 if (
1558    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1559    if test "$[*]" = "X"; then
1560       # -L didn't work.
1561       set X `ls -t $srcdir/configure conftest.file`
1562    fi
1563    rm -f conftest.file
1564    if test "$[*]" != "X $srcdir/configure conftest.file" \
1565       && test "$[*]" != "X conftest.file $srcdir/configure"; then
1567       # If neither matched, then we have a broken ls.  This can happen
1568       # if, for instance, CONFIG_SHELL is bash and it inherits a
1569       # broken ls alias from the environment.  This has actually
1570       # happened.  Such a system could not be considered "sane".
1571       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1572 alias in your environment])
1573    fi
1575    test "$[2]" = conftest.file
1576    )
1577 then
1578    # Ok.
1579    :
1580 else
1581    AC_MSG_ERROR([newly created file is older than distributed files!
1582 Check your system clock])
1584 AC_MSG_RESULT(yes)])
1586 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1588 # This file is free software; the Free Software Foundation
1589 # gives unlimited permission to copy and/or distribute it,
1590 # with or without modifications, as long as this notice is preserved.
1592 # AM_PROG_INSTALL_STRIP
1593 # ---------------------
1594 # One issue with vendor `install' (even GNU) is that you can't
1595 # specify the program used to strip binaries.  This is especially
1596 # annoying in cross-compiling environments, where the build's strip
1597 # is unlikely to handle the host's binaries.
1598 # Fortunately install-sh will honor a STRIPPROG variable, so we
1599 # always use install-sh in `make install-strip', and initialize
1600 # STRIPPROG with the value of the STRIP variable (set by the user).
1601 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1602 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1603 # Installed binaries are usually stripped using `strip' when the user
1604 # run `make install-strip'.  However `strip' might not be the right
1605 # tool to use in cross-compilation environments, therefore Automake
1606 # will honor the `STRIP' environment variable to overrule this program.
1607 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1608 if test "$cross_compiling" != no; then
1609   AC_CHECK_TOOL([STRIP], [strip], :)
1611 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1612 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1614 # Copyright (C) 2006  Free Software Foundation, Inc.
1616 # This file is free software; the Free Software Foundation
1617 # gives unlimited permission to copy and/or distribute it,
1618 # with or without modifications, as long as this notice is preserved.
1620 # _AM_SUBST_NOTMAKE(VARIABLE)
1621 # ---------------------------
1622 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1623 # This macro is traced by Automake.
1624 AC_DEFUN([_AM_SUBST_NOTMAKE])
1626 # Check how to create a tarball.                            -*- Autoconf -*-
1628 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1630 # This file is free software; the Free Software Foundation
1631 # gives unlimited permission to copy and/or distribute it,
1632 # with or without modifications, as long as this notice is preserved.
1634 # serial 2
1636 # _AM_PROG_TAR(FORMAT)
1637 # --------------------
1638 # Check how to create a tarball in format FORMAT.
1639 # FORMAT should be one of `v7', `ustar', or `pax'.
1641 # Substitute a variable $(am__tar) that is a command
1642 # writing to stdout a FORMAT-tarball containing the directory
1643 # $tardir.
1644 #     tardir=directory && $(am__tar) > result.tar
1646 # Substitute a variable $(am__untar) that extract such
1647 # a tarball read from stdin.
1648 #     $(am__untar) < result.tar
1649 AC_DEFUN([_AM_PROG_TAR],
1650 [# Always define AMTAR for backward compatibility.
1651 AM_MISSING_PROG([AMTAR], [tar])
1652 m4_if([$1], [v7],
1653      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1654      [m4_case([$1], [ustar],, [pax],,
1655               [m4_fatal([Unknown tar format])])
1656 AC_MSG_CHECKING([how to create a $1 tar archive])
1657 # Loop over all known methods to create a tar archive until one works.
1658 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1659 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1660 # Do not fold the above two line into one, because Tru64 sh and
1661 # Solaris sh will not grok spaces in the rhs of `-'.
1662 for _am_tool in $_am_tools
1664   case $_am_tool in
1665   gnutar)
1666     for _am_tar in tar gnutar gtar;
1667     do
1668       AM_RUN_LOG([$_am_tar --version]) && break
1669     done
1670     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1671     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1672     am__untar="$_am_tar -xf -"
1673     ;;
1674   plaintar)
1675     # Must skip GNU tar: if it does not support --format= it doesn't create
1676     # ustar tarball either.
1677     (tar --version) >/dev/null 2>&1 && continue
1678     am__tar='tar chf - "$$tardir"'
1679     am__tar_='tar chf - "$tardir"'
1680     am__untar='tar xf -'
1681     ;;
1682   pax)
1683     am__tar='pax -L -x $1 -w "$$tardir"'
1684     am__tar_='pax -L -x $1 -w "$tardir"'
1685     am__untar='pax -r'
1686     ;;
1687   cpio)
1688     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1689     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1690     am__untar='cpio -i -H $1 -d'
1691     ;;
1692   none)
1693     am__tar=false
1694     am__tar_=false
1695     am__untar=false
1696     ;;
1697   esac
1699   # If the value was cached, stop now.  We just wanted to have am__tar
1700   # and am__untar set.
1701   test -n "${am_cv_prog_tar_$1}" && break
1703   # tar/untar a dummy directory, and stop if the command works
1704   rm -rf conftest.dir
1705   mkdir conftest.dir
1706   echo GrepMe > conftest.dir/file
1707   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1708   rm -rf conftest.dir
1709   if test -s conftest.tar; then
1710     AM_RUN_LOG([$am__untar <conftest.tar])
1711     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1712   fi
1713 done
1714 rm -rf conftest.dir
1716 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1717 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1718 AC_SUBST([am__tar])
1719 AC_SUBST([am__untar])
1720 ]) # _AM_PROG_TAR