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