xref: /minix/external/bsd/file/dist/aclocal.m4 (revision 0a6a1f1d)
1*0a6a1f1dSLionel Sambuc# generated automatically by aclocal 1.14 -*- Autoconf -*-
2ef01931fSBen Gras
3*0a6a1f1dSLionel Sambuc# Copyright (C) 1996-2013 Free Software Foundation, Inc.
484d9c625SLionel Sambuc
5ef01931fSBen Gras# This file is free software; the Free Software Foundation
6ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
7ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
8ef01931fSBen Gras
9ef01931fSBen Gras# This program is distributed in the hope that it will be useful,
10ef01931fSBen Gras# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ef01931fSBen Gras# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ef01931fSBen Gras# PARTICULAR PURPOSE.
13ef01931fSBen Gras
14*0a6a1f1dSLionel Sambucm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15835f6802SDirk Vogtm4_ifndef([AC_AUTOCONF_VERSION],
16835f6802SDirk Vogt  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1784d9c625SLionel Sambucm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1884d9c625SLionel Sambuc[m4_warning([this file was generated for autoconf 2.69.
19835f6802SDirk VogtYou have another version of autoconf.  It may work, but is not guaranteed to.
20835f6802SDirk VogtIf you have problems, you may need to regenerate the build system entirely.
2184d9c625SLionel SambucTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ef01931fSBen Gras
23*0a6a1f1dSLionel Sambuc# visibility.m4 serial 5 (gettext-0.18.2)
24*0a6a1f1dSLionel Sambucdnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
2584d9c625SLionel Sambucdnl This file is free software; the Free Software Foundation
2684d9c625SLionel Sambucdnl gives unlimited permission to copy and/or distribute it,
2784d9c625SLionel Sambucdnl with or without modifications, as long as this notice is preserved.
2884d9c625SLionel Sambuc
2984d9c625SLionel Sambucdnl From Bruno Haible.
3084d9c625SLionel Sambuc
3184d9c625SLionel Sambucdnl Tests whether the compiler supports the command-line option
3284d9c625SLionel Sambucdnl -fvisibility=hidden and the function and variable attributes
3384d9c625SLionel Sambucdnl __attribute__((__visibility__("hidden"))) and
3484d9c625SLionel Sambucdnl __attribute__((__visibility__("default"))).
3584d9c625SLionel Sambucdnl Does *not* test for __visibility__("protected") - which has tricky
3684d9c625SLionel Sambucdnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
3784d9c625SLionel Sambucdnl Mac OS X.
3884d9c625SLionel Sambucdnl Does *not* test for __visibility__("internal") - which has processor
3984d9c625SLionel Sambucdnl dependent semantics.
4084d9c625SLionel Sambucdnl Does *not* test for #pragma GCC visibility push(hidden) - which is
4184d9c625SLionel Sambucdnl "really only recommended for legacy code".
4284d9c625SLionel Sambucdnl Set the variable CFLAG_VISIBILITY.
4384d9c625SLionel Sambucdnl Defines and sets the variable HAVE_VISIBILITY.
4484d9c625SLionel Sambuc
4584d9c625SLionel SambucAC_DEFUN([gl_VISIBILITY],
4684d9c625SLionel Sambuc[
4784d9c625SLionel Sambuc  AC_REQUIRE([AC_PROG_CC])
4884d9c625SLionel Sambuc  CFLAG_VISIBILITY=
4984d9c625SLionel Sambuc  HAVE_VISIBILITY=0
5084d9c625SLionel Sambuc  if test -n "$GCC"; then
5184d9c625SLionel Sambuc    dnl First, check whether -Werror can be added to the command line, or
5284d9c625SLionel Sambuc    dnl whether it leads to an error because of some other option that the
5384d9c625SLionel Sambuc    dnl user has put into $CC $CFLAGS $CPPFLAGS.
5484d9c625SLionel Sambuc    AC_MSG_CHECKING([whether the -Werror option is usable])
5584d9c625SLionel Sambuc    AC_CACHE_VAL([gl_cv_cc_vis_werror], [
5684d9c625SLionel Sambuc      gl_save_CFLAGS="$CFLAGS"
5784d9c625SLionel Sambuc      CFLAGS="$CFLAGS -Werror"
58*0a6a1f1dSLionel Sambuc      AC_COMPILE_IFELSE(
59*0a6a1f1dSLionel Sambuc        [AC_LANG_PROGRAM([[]], [[]])],
6084d9c625SLionel Sambuc        [gl_cv_cc_vis_werror=yes],
6184d9c625SLionel Sambuc        [gl_cv_cc_vis_werror=no])
6284d9c625SLionel Sambuc      CFLAGS="$gl_save_CFLAGS"])
6384d9c625SLionel Sambuc    AC_MSG_RESULT([$gl_cv_cc_vis_werror])
6484d9c625SLionel Sambuc    dnl Now check whether visibility declarations are supported.
6584d9c625SLionel Sambuc    AC_MSG_CHECKING([for simple visibility declarations])
6684d9c625SLionel Sambuc    AC_CACHE_VAL([gl_cv_cc_visibility], [
6784d9c625SLionel Sambuc      gl_save_CFLAGS="$CFLAGS"
6884d9c625SLionel Sambuc      CFLAGS="$CFLAGS -fvisibility=hidden"
6984d9c625SLionel Sambuc      dnl We use the option -Werror and a function dummyfunc, because on some
7084d9c625SLionel Sambuc      dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
7184d9c625SLionel Sambuc      dnl "visibility attribute not supported in this configuration; ignored"
7284d9c625SLionel Sambuc      dnl at the first function definition in every compilation unit, and we
7384d9c625SLionel Sambuc      dnl don't want to use the option in this case.
7484d9c625SLionel Sambuc      if test $gl_cv_cc_vis_werror = yes; then
7584d9c625SLionel Sambuc        CFLAGS="$CFLAGS -Werror"
7684d9c625SLionel Sambuc      fi
77*0a6a1f1dSLionel Sambuc      AC_COMPILE_IFELSE(
78*0a6a1f1dSLionel Sambuc        [AC_LANG_PROGRAM(
79*0a6a1f1dSLionel Sambuc           [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
8084d9c625SLionel Sambuc             extern __attribute__((__visibility__("default"))) int exportedvar;
8184d9c625SLionel Sambuc             extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
8284d9c625SLionel Sambuc             extern __attribute__((__visibility__("default"))) int exportedfunc (void);
83*0a6a1f1dSLionel Sambuc             void dummyfunc (void) {}
84*0a6a1f1dSLionel Sambuc           ]],
85*0a6a1f1dSLionel Sambuc           [[]])],
8684d9c625SLionel Sambuc        [gl_cv_cc_visibility=yes],
8784d9c625SLionel Sambuc        [gl_cv_cc_visibility=no])
8884d9c625SLionel Sambuc      CFLAGS="$gl_save_CFLAGS"])
8984d9c625SLionel Sambuc    AC_MSG_RESULT([$gl_cv_cc_visibility])
9084d9c625SLionel Sambuc    if test $gl_cv_cc_visibility = yes; then
9184d9c625SLionel Sambuc      CFLAG_VISIBILITY="-fvisibility=hidden"
9284d9c625SLionel Sambuc      HAVE_VISIBILITY=1
9384d9c625SLionel Sambuc    fi
9484d9c625SLionel Sambuc  fi
9584d9c625SLionel Sambuc  AC_SUBST([CFLAG_VISIBILITY])
9684d9c625SLionel Sambuc  AC_SUBST([HAVE_VISIBILITY])
9784d9c625SLionel Sambuc  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
9884d9c625SLionel Sambuc    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
9984d9c625SLionel Sambuc])
10084d9c625SLionel Sambuc
101*0a6a1f1dSLionel Sambuc# Copyright (C) 2002-2013 Free Software Foundation, Inc.
102ef01931fSBen Gras#
103ef01931fSBen Gras# This file is free software; the Free Software Foundation
104ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
105ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
106ef01931fSBen Gras
107ef01931fSBen Gras# AM_AUTOMAKE_VERSION(VERSION)
108ef01931fSBen Gras# ----------------------------
109ef01931fSBen Gras# Automake X.Y traces this macro to ensure aclocal.m4 has been
110ef01931fSBen Gras# generated from the m4 files accompanying Automake X.Y.
111ef01931fSBen Gras# (This private macro should not be called outside this file.)
112ef01931fSBen GrasAC_DEFUN([AM_AUTOMAKE_VERSION],
113*0a6a1f1dSLionel Sambuc[am__api_version='1.14'
114ef01931fSBen Grasdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
115ef01931fSBen Grasdnl require some minimum version.  Point them to the right macro.
116*0a6a1f1dSLionel Sambucm4_if([$1], [1.14], [],
117ef01931fSBen Gras      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
118ef01931fSBen Gras])
119ef01931fSBen Gras
120ef01931fSBen Gras# _AM_AUTOCONF_VERSION(VERSION)
121ef01931fSBen Gras# -----------------------------
122ef01931fSBen Gras# aclocal traces this macro to find the Autoconf version.
123ef01931fSBen Gras# This is a private macro too.  Using m4_define simplifies
124ef01931fSBen Gras# the logic in aclocal, which can simply ignore this definition.
125ef01931fSBen Grasm4_define([_AM_AUTOCONF_VERSION], [])
126ef01931fSBen Gras
127ef01931fSBen Gras# AM_SET_CURRENT_AUTOMAKE_VERSION
128ef01931fSBen Gras# -------------------------------
129ef01931fSBen Gras# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
130835f6802SDirk Vogt# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
131ef01931fSBen GrasAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
132*0a6a1f1dSLionel Sambuc[AM_AUTOMAKE_VERSION([1.14])dnl
133835f6802SDirk Vogtm4_ifndef([AC_AUTOCONF_VERSION],
134835f6802SDirk Vogt  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
135835f6802SDirk Vogt_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
136ef01931fSBen Gras
137ef01931fSBen Gras# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
138ef01931fSBen Gras
139*0a6a1f1dSLionel Sambuc# Copyright (C) 2001-2013 Free Software Foundation, Inc.
140ef01931fSBen Gras#
141ef01931fSBen Gras# This file is free software; the Free Software Foundation
142ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
143ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
144ef01931fSBen Gras
145ef01931fSBen Gras# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
14684d9c625SLionel Sambuc# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
14784d9c625SLionel Sambuc# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
148ef01931fSBen Gras#
149ef01931fSBen Gras# Of course, Automake must honor this variable whenever it calls a
150ef01931fSBen Gras# tool from the auxiliary directory.  The problem is that $srcdir (and
151ef01931fSBen Gras# therefore $ac_aux_dir as well) can be either absolute or relative,
152ef01931fSBen Gras# depending on how configure is run.  This is pretty annoying, since
153ef01931fSBen Gras# it makes $ac_aux_dir quite unusable in subdirectories: in the top
154ef01931fSBen Gras# source directory, any form will work fine, but in subdirectories a
155ef01931fSBen Gras# relative path needs to be adjusted first.
156ef01931fSBen Gras#
157ef01931fSBen Gras# $ac_aux_dir/missing
158ef01931fSBen Gras#    fails when called from a subdirectory if $ac_aux_dir is relative
159ef01931fSBen Gras# $top_srcdir/$ac_aux_dir/missing
160ef01931fSBen Gras#    fails if $ac_aux_dir is absolute,
161ef01931fSBen Gras#    fails when called from a subdirectory in a VPATH build with
162ef01931fSBen Gras#          a relative $ac_aux_dir
163ef01931fSBen Gras#
164ef01931fSBen Gras# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
165ef01931fSBen Gras# are both prefixed by $srcdir.  In an in-source build this is usually
16684d9c625SLionel Sambuc# harmless because $srcdir is '.', but things will broke when you
167ef01931fSBen Gras# start a VPATH build or use an absolute $srcdir.
168ef01931fSBen Gras#
169ef01931fSBen Gras# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
170ef01931fSBen Gras# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
171ef01931fSBen Gras#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
172ef01931fSBen Gras# and then we would define $MISSING as
173ef01931fSBen Gras#   MISSING="\${SHELL} $am_aux_dir/missing"
174ef01931fSBen Gras# This will work as long as MISSING is not called from configure, because
175ef01931fSBen Gras# unfortunately $(top_srcdir) has no meaning in configure.
176ef01931fSBen Gras# However there are other variables, like CC, which are often used in
177ef01931fSBen Gras# configure, and could therefore not use this "fixed" $ac_aux_dir.
178ef01931fSBen Gras#
179ef01931fSBen Gras# Another solution, used here, is to always expand $ac_aux_dir to an
180ef01931fSBen Gras# absolute PATH.  The drawback is that using absolute paths prevent a
181ef01931fSBen Gras# configured tree to be moved without reconfiguration.
182ef01931fSBen Gras
183ef01931fSBen GrasAC_DEFUN([AM_AUX_DIR_EXPAND],
184ef01931fSBen Gras[dnl Rely on autoconf to set up CDPATH properly.
185ef01931fSBen GrasAC_PREREQ([2.50])dnl
186ef01931fSBen Gras# expand $ac_aux_dir to an absolute path
187ef01931fSBen Grasam_aux_dir=`cd $ac_aux_dir && pwd`
188ef01931fSBen Gras])
189ef01931fSBen Gras
190ef01931fSBen Gras# AM_CONDITIONAL                                            -*- Autoconf -*-
191ef01931fSBen Gras
192*0a6a1f1dSLionel Sambuc# Copyright (C) 1997-2013 Free Software Foundation, Inc.
193ef01931fSBen Gras#
194ef01931fSBen Gras# This file is free software; the Free Software Foundation
195ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
196ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
197ef01931fSBen Gras
198ef01931fSBen Gras# AM_CONDITIONAL(NAME, SHELL-CONDITION)
199ef01931fSBen Gras# -------------------------------------
200ef01931fSBen Gras# Define a conditional.
201ef01931fSBen GrasAC_DEFUN([AM_CONDITIONAL],
20284d9c625SLionel Sambuc[AC_PREREQ([2.52])dnl
20384d9c625SLionel Sambuc m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
204ef01931fSBen Gras       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
205ef01931fSBen GrasAC_SUBST([$1_TRUE])dnl
206ef01931fSBen GrasAC_SUBST([$1_FALSE])dnl
207ef01931fSBen Gras_AM_SUBST_NOTMAKE([$1_TRUE])dnl
208ef01931fSBen Gras_AM_SUBST_NOTMAKE([$1_FALSE])dnl
209835f6802SDirk Vogtm4_define([_AM_COND_VALUE_$1], [$2])dnl
210ef01931fSBen Grasif $2; then
211ef01931fSBen Gras  $1_TRUE=
212ef01931fSBen Gras  $1_FALSE='#'
213ef01931fSBen Graselse
214ef01931fSBen Gras  $1_TRUE='#'
215ef01931fSBen Gras  $1_FALSE=
216ef01931fSBen Grasfi
217ef01931fSBen GrasAC_CONFIG_COMMANDS_PRE(
218ef01931fSBen Gras[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
219ef01931fSBen Gras  AC_MSG_ERROR([[conditional "$1" was never defined.
220ef01931fSBen GrasUsually this means the macro was only invoked conditionally.]])
221ef01931fSBen Grasfi])])
222ef01931fSBen Gras
223*0a6a1f1dSLionel Sambuc# Copyright (C) 1999-2013 Free Software Foundation, Inc.
224ef01931fSBen Gras#
225ef01931fSBen Gras# This file is free software; the Free Software Foundation
226ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
227ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
228ef01931fSBen Gras
229ef01931fSBen Gras
23084d9c625SLionel Sambuc# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
231ef01931fSBen Gras# written in clear, in which case automake, when reading aclocal.m4,
232ef01931fSBen Gras# will think it sees a *use*, and therefore will trigger all it's
233ef01931fSBen Gras# C support machinery.  Also note that it means that autoscan, seeing
234ef01931fSBen Gras# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
235ef01931fSBen Gras
236ef01931fSBen Gras
237ef01931fSBen Gras# _AM_DEPENDENCIES(NAME)
238ef01931fSBen Gras# ----------------------
239ef01931fSBen Gras# See how the compiler implements dependency checking.
24084d9c625SLionel Sambuc# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
241ef01931fSBen Gras# We try a few techniques and use that to set a single cache variable.
242ef01931fSBen Gras#
243ef01931fSBen Gras# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
244ef01931fSBen Gras# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
245ef01931fSBen Gras# dependency, and given that the user is not expected to run this macro,
246ef01931fSBen Gras# just rely on AC_PROG_CC.
247ef01931fSBen GrasAC_DEFUN([_AM_DEPENDENCIES],
248ef01931fSBen Gras[AC_REQUIRE([AM_SET_DEPDIR])dnl
249ef01931fSBen GrasAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
250ef01931fSBen GrasAC_REQUIRE([AM_MAKE_INCLUDE])dnl
251ef01931fSBen GrasAC_REQUIRE([AM_DEP_TRACK])dnl
252ef01931fSBen Gras
25384d9c625SLionel Sambucm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
25484d9c625SLionel Sambuc      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
25584d9c625SLionel Sambuc      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
25684d9c625SLionel Sambuc      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
25784d9c625SLionel Sambuc      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
25884d9c625SLionel Sambuc      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
259ef01931fSBen Gras                    [depcc="$$1"   am_compiler_list=])
260ef01931fSBen Gras
261ef01931fSBen GrasAC_CACHE_CHECK([dependency style of $depcc],
262ef01931fSBen Gras               [am_cv_$1_dependencies_compiler_type],
263ef01931fSBen Gras[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
264ef01931fSBen Gras  # We make a subdir and do the tests there.  Otherwise we can end up
265ef01931fSBen Gras  # making bogus files that we don't know about and never remove.  For
266ef01931fSBen Gras  # instance it was reported that on HP-UX the gcc test will end up
26784d9c625SLionel Sambuc  # making a dummy file named 'D' -- because '-MD' means "put the output
26884d9c625SLionel Sambuc  # in D".
26984d9c625SLionel Sambuc  rm -rf conftest.dir
270ef01931fSBen Gras  mkdir conftest.dir
271ef01931fSBen Gras  # Copy depcomp to subdir because otherwise we won't find it if we're
272ef01931fSBen Gras  # using a relative directory.
273ef01931fSBen Gras  cp "$am_depcomp" conftest.dir
274ef01931fSBen Gras  cd conftest.dir
275ef01931fSBen Gras  # We will build objects and dependencies in a subdirectory because
276ef01931fSBen Gras  # it helps to detect inapplicable dependency modes.  For instance
277ef01931fSBen Gras  # both Tru64's cc and ICC support -MD to output dependencies as a
278ef01931fSBen Gras  # side effect of compilation, but ICC will put the dependencies in
279ef01931fSBen Gras  # the current directory while Tru64 will put them in the object
280ef01931fSBen Gras  # directory.
281ef01931fSBen Gras  mkdir sub
282ef01931fSBen Gras
283ef01931fSBen Gras  am_cv_$1_dependencies_compiler_type=none
284ef01931fSBen Gras  if test "$am_compiler_list" = ""; then
285ef01931fSBen Gras     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
286ef01931fSBen Gras  fi
287835f6802SDirk Vogt  am__universal=false
288835f6802SDirk Vogt  m4_case([$1], [CC],
289835f6802SDirk Vogt    [case " $depcc " in #(
290835f6802SDirk Vogt     *\ -arch\ *\ -arch\ *) am__universal=true ;;
291835f6802SDirk Vogt     esac],
292835f6802SDirk Vogt    [CXX],
293835f6802SDirk Vogt    [case " $depcc " in #(
294835f6802SDirk Vogt     *\ -arch\ *\ -arch\ *) am__universal=true ;;
295835f6802SDirk Vogt     esac])
296835f6802SDirk Vogt
297ef01931fSBen Gras  for depmode in $am_compiler_list; do
298ef01931fSBen Gras    # Setup a source with many dependencies, because some compilers
299ef01931fSBen Gras    # like to wrap large dependency lists on column 80 (with \), and
300ef01931fSBen Gras    # we should not choose a depcomp mode which is confused by this.
301ef01931fSBen Gras    #
302ef01931fSBen Gras    # We need to recreate these files for each test, as the compiler may
303ef01931fSBen Gras    # overwrite some of them when testing with obscure command lines.
304ef01931fSBen Gras    # This happens at least with the AIX C compiler.
305ef01931fSBen Gras    : > sub/conftest.c
306ef01931fSBen Gras    for i in 1 2 3 4 5 6; do
307ef01931fSBen Gras      echo '#include "conftst'$i'.h"' >> sub/conftest.c
30884d9c625SLionel Sambuc      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
30984d9c625SLionel Sambuc      # Solaris 10 /bin/sh.
31084d9c625SLionel Sambuc      echo '/* dummy */' > sub/conftst$i.h
311ef01931fSBen Gras    done
312ef01931fSBen Gras    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
313ef01931fSBen Gras
31484d9c625SLionel Sambuc    # We check with '-c' and '-o' for the sake of the "dashmstdout"
315835f6802SDirk Vogt    # mode.  It turns out that the SunPro C++ compiler does not properly
31684d9c625SLionel Sambuc    # handle '-M -o', and we need to detect this.  Also, some Intel
31784d9c625SLionel Sambuc    # versions had trouble with output in subdirs.
318835f6802SDirk Vogt    am__obj=sub/conftest.${OBJEXT-o}
319835f6802SDirk Vogt    am__minus_obj="-o $am__obj"
320ef01931fSBen Gras    case $depmode in
321835f6802SDirk Vogt    gcc)
322835f6802SDirk Vogt      # This depmode causes a compiler race in universal mode.
323835f6802SDirk Vogt      test "$am__universal" = false || continue
324835f6802SDirk Vogt      ;;
325ef01931fSBen Gras    nosideeffect)
32684d9c625SLionel Sambuc      # After this tag, mechanisms are not by side-effect, so they'll
32784d9c625SLionel Sambuc      # only be used when explicitly requested.
328ef01931fSBen Gras      if test "x$enable_dependency_tracking" = xyes; then
329ef01931fSBen Gras	continue
330ef01931fSBen Gras      else
331ef01931fSBen Gras	break
332ef01931fSBen Gras      fi
333ef01931fSBen Gras      ;;
33484d9c625SLionel Sambuc    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
33584d9c625SLionel Sambuc      # This compiler won't grok '-c -o', but also, the minuso test has
336835f6802SDirk Vogt      # not run yet.  These depmodes are late enough in the game, and
337835f6802SDirk Vogt      # so weak that their functioning should not be impacted.
338835f6802SDirk Vogt      am__obj=conftest.${OBJEXT-o}
339835f6802SDirk Vogt      am__minus_obj=
340835f6802SDirk Vogt      ;;
341ef01931fSBen Gras    none) break ;;
342ef01931fSBen Gras    esac
343ef01931fSBen Gras    if depmode=$depmode \
344835f6802SDirk Vogt       source=sub/conftest.c object=$am__obj \
345ef01931fSBen Gras       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
346835f6802SDirk Vogt       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
347ef01931fSBen Gras         >/dev/null 2>conftest.err &&
348ef01931fSBen Gras       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
349ef01931fSBen Gras       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
350835f6802SDirk Vogt       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
351ef01931fSBen Gras       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
352ef01931fSBen Gras      # icc doesn't choke on unknown options, it will just issue warnings
353ef01931fSBen Gras      # or remarks (even with -Werror).  So we grep stderr for any message
354ef01931fSBen Gras      # that says an option was ignored or not supported.
355ef01931fSBen Gras      # When given -MP, icc 7.0 and 7.1 complain thusly:
356ef01931fSBen Gras      #   icc: Command line warning: ignoring option '-M'; no argument required
357ef01931fSBen Gras      # The diagnosis changed in icc 8.0:
358ef01931fSBen Gras      #   icc: Command line remark: option '-MP' not supported
359ef01931fSBen Gras      if (grep 'ignoring option' conftest.err ||
360ef01931fSBen Gras          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
361ef01931fSBen Gras        am_cv_$1_dependencies_compiler_type=$depmode
362ef01931fSBen Gras        break
363ef01931fSBen Gras      fi
364ef01931fSBen Gras    fi
365ef01931fSBen Gras  done
366ef01931fSBen Gras
367ef01931fSBen Gras  cd ..
368ef01931fSBen Gras  rm -rf conftest.dir
369ef01931fSBen Graselse
370ef01931fSBen Gras  am_cv_$1_dependencies_compiler_type=none
371ef01931fSBen Grasfi
372ef01931fSBen Gras])
373ef01931fSBen GrasAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
374ef01931fSBen GrasAM_CONDITIONAL([am__fastdep$1], [
375ef01931fSBen Gras  test "x$enable_dependency_tracking" != xno \
376ef01931fSBen Gras  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
377ef01931fSBen Gras])
378ef01931fSBen Gras
379ef01931fSBen Gras
380ef01931fSBen Gras# AM_SET_DEPDIR
381ef01931fSBen Gras# -------------
382ef01931fSBen Gras# Choose a directory name for dependency files.
38384d9c625SLionel Sambuc# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
384ef01931fSBen GrasAC_DEFUN([AM_SET_DEPDIR],
385ef01931fSBen Gras[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
386ef01931fSBen GrasAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
387ef01931fSBen Gras])
388ef01931fSBen Gras
389ef01931fSBen Gras
390ef01931fSBen Gras# AM_DEP_TRACK
391ef01931fSBen Gras# ------------
392ef01931fSBen GrasAC_DEFUN([AM_DEP_TRACK],
39384d9c625SLionel Sambuc[AC_ARG_ENABLE([dependency-tracking], [dnl
39484d9c625SLionel SambucAS_HELP_STRING(
39584d9c625SLionel Sambuc  [--enable-dependency-tracking],
39684d9c625SLionel Sambuc  [do not reject slow dependency extractors])
39784d9c625SLionel SambucAS_HELP_STRING(
39884d9c625SLionel Sambuc  [--disable-dependency-tracking],
39984d9c625SLionel Sambuc  [speeds up one-time build])])
400ef01931fSBen Grasif test "x$enable_dependency_tracking" != xno; then
401ef01931fSBen Gras  am_depcomp="$ac_aux_dir/depcomp"
402ef01931fSBen Gras  AMDEPBACKSLASH='\'
40384d9c625SLionel Sambuc  am__nodep='_no'
404ef01931fSBen Grasfi
405ef01931fSBen GrasAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
406ef01931fSBen GrasAC_SUBST([AMDEPBACKSLASH])dnl
407ef01931fSBen Gras_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
40884d9c625SLionel SambucAC_SUBST([am__nodep])dnl
40984d9c625SLionel Sambuc_AM_SUBST_NOTMAKE([am__nodep])dnl
410ef01931fSBen Gras])
411ef01931fSBen Gras
412ef01931fSBen Gras# Generate code to set up dependency tracking.              -*- Autoconf -*-
413ef01931fSBen Gras
414*0a6a1f1dSLionel Sambuc# Copyright (C) 1999-2013 Free Software Foundation, Inc.
415ef01931fSBen Gras#
416ef01931fSBen Gras# This file is free software; the Free Software Foundation
417ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
418ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
419ef01931fSBen Gras
420ef01931fSBen Gras
421ef01931fSBen Gras# _AM_OUTPUT_DEPENDENCY_COMMANDS
422ef01931fSBen Gras# ------------------------------
423ef01931fSBen GrasAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
424835f6802SDirk Vogt[{
425*0a6a1f1dSLionel Sambuc  # Older Autoconf quotes --file arguments for eval, but not when files
426835f6802SDirk Vogt  # are listed without --file.  Let's play safe and only enable the eval
427835f6802SDirk Vogt  # if we detect the quoting.
428835f6802SDirk Vogt  case $CONFIG_FILES in
429835f6802SDirk Vogt  *\'*) eval set x "$CONFIG_FILES" ;;
430835f6802SDirk Vogt  *)   set x $CONFIG_FILES ;;
431835f6802SDirk Vogt  esac
432835f6802SDirk Vogt  shift
433835f6802SDirk Vogt  for mf
434835f6802SDirk Vogt  do
435ef01931fSBen Gras    # Strip MF so we end up with the name of the file.
436ef01931fSBen Gras    mf=`echo "$mf" | sed -e 's/:.*$//'`
437ef01931fSBen Gras    # Check whether this is an Automake generated Makefile or not.
43884d9c625SLionel Sambuc    # We used to match only the files named 'Makefile.in', but
439ef01931fSBen Gras    # some people rename them; so instead we look at the file content.
440ef01931fSBen Gras    # Grep'ing the first line is not enough: some people post-process
441ef01931fSBen Gras    # each Makefile.in and add a new line on top of each file to say so.
442ef01931fSBen Gras    # Grep'ing the whole file is not good either: AIX grep has a line
443ef01931fSBen Gras    # limit of 2048, but all sed's we know have understand at least 4000.
444835f6802SDirk Vogt    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
445ef01931fSBen Gras      dirpart=`AS_DIRNAME("$mf")`
446ef01931fSBen Gras    else
447ef01931fSBen Gras      continue
448ef01931fSBen Gras    fi
449ef01931fSBen Gras    # Extract the definition of DEPDIR, am__include, and am__quote
45084d9c625SLionel Sambuc    # from the Makefile without running 'make'.
451ef01931fSBen Gras    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
452ef01931fSBen Gras    test -z "$DEPDIR" && continue
453ef01931fSBen Gras    am__include=`sed -n 's/^am__include = //p' < "$mf"`
454*0a6a1f1dSLionel Sambuc    test -z "$am__include" && continue
455ef01931fSBen Gras    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
456ef01931fSBen Gras    # Find all dependency output files, they are included files with
457ef01931fSBen Gras    # $(DEPDIR) in their names.  We invoke sed twice because it is the
458ef01931fSBen Gras    # simplest approach to changing $(DEPDIR) to its actual value in the
459ef01931fSBen Gras    # expansion.
460ef01931fSBen Gras    for file in `sed -n "
461ef01931fSBen Gras      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
46284d9c625SLionel Sambuc	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
463ef01931fSBen Gras      # Make sure the directory exists.
464ef01931fSBen Gras      test -f "$dirpart/$file" && continue
465ef01931fSBen Gras      fdir=`AS_DIRNAME(["$file"])`
466ef01931fSBen Gras      AS_MKDIR_P([$dirpart/$fdir])
467ef01931fSBen Gras      # echo "creating $dirpart/$file"
468ef01931fSBen Gras      echo '# dummy' > "$dirpart/$file"
469ef01931fSBen Gras    done
470ef01931fSBen Gras  done
471835f6802SDirk Vogt}
472ef01931fSBen Gras])# _AM_OUTPUT_DEPENDENCY_COMMANDS
473ef01931fSBen Gras
474ef01931fSBen Gras
475ef01931fSBen Gras# AM_OUTPUT_DEPENDENCY_COMMANDS
476ef01931fSBen Gras# -----------------------------
477ef01931fSBen Gras# This macro should only be invoked once -- use via AC_REQUIRE.
478ef01931fSBen Gras#
479ef01931fSBen Gras# This code is only required when automatic dependency tracking
48084d9c625SLionel Sambuc# is enabled.  FIXME.  This creates each '.P' file that we will
481ef01931fSBen Gras# need in order to bootstrap the dependency handling code.
482ef01931fSBen GrasAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
483ef01931fSBen Gras[AC_CONFIG_COMMANDS([depfiles],
484ef01931fSBen Gras     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
485ef01931fSBen Gras     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
486ef01931fSBen Gras])
487ef01931fSBen Gras
488ef01931fSBen Gras# Do all the work for Automake.                             -*- Autoconf -*-
489ef01931fSBen Gras
490*0a6a1f1dSLionel Sambuc# Copyright (C) 1996-2013 Free Software Foundation, Inc.
491ef01931fSBen Gras#
492ef01931fSBen Gras# This file is free software; the Free Software Foundation
493ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
494ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
495ef01931fSBen Gras
496ef01931fSBen Gras# This macro actually does too much.  Some checks are only needed if
497ef01931fSBen Gras# your package does certain things.  But this isn't really a big deal.
498ef01931fSBen Gras
499*0a6a1f1dSLionel Sambucdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
500*0a6a1f1dSLionel Sambucm4_define([AC_PROG_CC],
501*0a6a1f1dSLionel Sambucm4_defn([AC_PROG_CC])
502*0a6a1f1dSLionel Sambuc[_AM_PROG_CC_C_O
503*0a6a1f1dSLionel Sambuc])
504*0a6a1f1dSLionel Sambuc
505ef01931fSBen Gras# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
506ef01931fSBen Gras# AM_INIT_AUTOMAKE([OPTIONS])
507ef01931fSBen Gras# -----------------------------------------------
508ef01931fSBen Gras# The call with PACKAGE and VERSION arguments is the old style
509ef01931fSBen Gras# call (pre autoconf-2.50), which is being phased out.  PACKAGE
510ef01931fSBen Gras# and VERSION should now be passed to AC_INIT and removed from
511ef01931fSBen Gras# the call to AM_INIT_AUTOMAKE.
512ef01931fSBen Gras# We support both call styles for the transition.  After
513ef01931fSBen Gras# the next Automake release, Autoconf can make the AC_INIT
514ef01931fSBen Gras# arguments mandatory, and then we can depend on a new Autoconf
515ef01931fSBen Gras# release and drop the old call support.
516ef01931fSBen GrasAC_DEFUN([AM_INIT_AUTOMAKE],
517*0a6a1f1dSLionel Sambuc[AC_PREREQ([2.65])dnl
518ef01931fSBen Grasdnl Autoconf wants to disallow AM_ names.  We explicitly allow
519ef01931fSBen Grasdnl the ones we care about.
520ef01931fSBen Grasm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
521ef01931fSBen GrasAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
522ef01931fSBen GrasAC_REQUIRE([AC_PROG_INSTALL])dnl
523ef01931fSBen Grasif test "`cd $srcdir && pwd`" != "`pwd`"; then
524ef01931fSBen Gras  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
525ef01931fSBen Gras  # is not polluted with repeated "-I."
526ef01931fSBen Gras  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
527ef01931fSBen Gras  # test to see if srcdir already configured
528ef01931fSBen Gras  if test -f $srcdir/config.status; then
529ef01931fSBen Gras    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
530ef01931fSBen Gras  fi
531ef01931fSBen Grasfi
532ef01931fSBen Gras
533ef01931fSBen Gras# test whether we have cygpath
534ef01931fSBen Grasif test -z "$CYGPATH_W"; then
535ef01931fSBen Gras  if (cygpath --version) >/dev/null 2>/dev/null; then
536ef01931fSBen Gras    CYGPATH_W='cygpath -w'
537ef01931fSBen Gras  else
538ef01931fSBen Gras    CYGPATH_W=echo
539ef01931fSBen Gras  fi
540ef01931fSBen Grasfi
541ef01931fSBen GrasAC_SUBST([CYGPATH_W])
542ef01931fSBen Gras
543ef01931fSBen Gras# Define the identity of the package.
544ef01931fSBen Grasdnl Distinguish between old-style and new-style calls.
545ef01931fSBen Grasm4_ifval([$2],
54684d9c625SLionel Sambuc[AC_DIAGNOSE([obsolete],
547*0a6a1f1dSLionel Sambuc             [$0: two- and three-arguments forms are deprecated.])
54884d9c625SLionel Sambucm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
549ef01931fSBen Gras AC_SUBST([PACKAGE], [$1])dnl
550ef01931fSBen Gras AC_SUBST([VERSION], [$2])],
551ef01931fSBen Gras[_AM_SET_OPTIONS([$1])dnl
552ef01931fSBen Grasdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
55384d9c625SLionel Sambucm4_if(
55484d9c625SLionel Sambuc  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
55584d9c625SLionel Sambuc  [ok:ok],,
556ef01931fSBen Gras  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
557ef01931fSBen Gras AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
558ef01931fSBen Gras AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
559ef01931fSBen Gras
560ef01931fSBen Gras_AM_IF_OPTION([no-define],,
56184d9c625SLionel Sambuc[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
56284d9c625SLionel Sambuc AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
563ef01931fSBen Gras
564ef01931fSBen Gras# Some tools Automake needs.
565ef01931fSBen GrasAC_REQUIRE([AM_SANITY_CHECK])dnl
566ef01931fSBen GrasAC_REQUIRE([AC_ARG_PROGRAM])dnl
56784d9c625SLionel SambucAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
56884d9c625SLionel SambucAM_MISSING_PROG([AUTOCONF], [autoconf])
56984d9c625SLionel SambucAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
57084d9c625SLionel SambucAM_MISSING_PROG([AUTOHEADER], [autoheader])
57184d9c625SLionel SambucAM_MISSING_PROG([MAKEINFO], [makeinfo])
572835f6802SDirk VogtAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
573835f6802SDirk VogtAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
57484d9c625SLionel SambucAC_REQUIRE([AC_PROG_MKDIR_P])dnl
57584d9c625SLionel Sambuc# For better backward compatibility.  To be removed once Automake 1.9.x
57684d9c625SLionel Sambuc# dies out for good.  For more background, see:
57784d9c625SLionel Sambuc# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
57884d9c625SLionel Sambuc# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
57984d9c625SLionel SambucAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
580ef01931fSBen Gras# We need awk for the "check" target.  The system "awk" is bad on
581ef01931fSBen Gras# some platforms.
582ef01931fSBen GrasAC_REQUIRE([AC_PROG_AWK])dnl
583ef01931fSBen GrasAC_REQUIRE([AC_PROG_MAKE_SET])dnl
584ef01931fSBen GrasAC_REQUIRE([AM_SET_LEADING_DOT])dnl
585ef01931fSBen Gras_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
586ef01931fSBen Gras	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
587ef01931fSBen Gras			     [_AM_PROG_TAR([v7])])])
588ef01931fSBen Gras_AM_IF_OPTION([no-dependencies],,
589ef01931fSBen Gras[AC_PROVIDE_IFELSE([AC_PROG_CC],
59084d9c625SLionel Sambuc		  [_AM_DEPENDENCIES([CC])],
59184d9c625SLionel Sambuc		  [m4_define([AC_PROG_CC],
59284d9c625SLionel Sambuc			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
593ef01931fSBen GrasAC_PROVIDE_IFELSE([AC_PROG_CXX],
59484d9c625SLionel Sambuc		  [_AM_DEPENDENCIES([CXX])],
59584d9c625SLionel Sambuc		  [m4_define([AC_PROG_CXX],
59684d9c625SLionel Sambuc			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
597ef01931fSBen GrasAC_PROVIDE_IFELSE([AC_PROG_OBJC],
59884d9c625SLionel Sambuc		  [_AM_DEPENDENCIES([OBJC])],
59984d9c625SLionel Sambuc		  [m4_define([AC_PROG_OBJC],
60084d9c625SLionel Sambuc			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
601*0a6a1f1dSLionel SambucAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
60284d9c625SLionel Sambuc		  [_AM_DEPENDENCIES([OBJCXX])],
60384d9c625SLionel Sambuc		  [m4_define([AC_PROG_OBJCXX],
604*0a6a1f1dSLionel Sambuc			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
605ef01931fSBen Gras])
606*0a6a1f1dSLionel SambucAC_REQUIRE([AM_SILENT_RULES])dnl
607*0a6a1f1dSLionel Sambucdnl The testsuite driver may need to know about EXEEXT, so add the
608*0a6a1f1dSLionel Sambucdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
609*0a6a1f1dSLionel Sambucdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
610835f6802SDirk VogtAC_CONFIG_COMMANDS_PRE(dnl
611835f6802SDirk Vogt[m4_provide_if([_AM_COMPILER_EXEEXT],
612835f6802SDirk Vogt  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
613*0a6a1f1dSLionel Sambuc
614*0a6a1f1dSLionel Sambuc# POSIX will say in a future version that running "rm -f" with no argument
615*0a6a1f1dSLionel Sambuc# is OK; and we want to be able to make that assumption in our Makefile
616*0a6a1f1dSLionel Sambuc# recipes.  So use an aggressive probe to check that the usage we want is
617*0a6a1f1dSLionel Sambuc# actually supported "in the wild" to an acceptable degree.
618*0a6a1f1dSLionel Sambuc# See automake bug#10828.
619*0a6a1f1dSLionel Sambuc# To make any issue more visible, cause the running configure to be aborted
620*0a6a1f1dSLionel Sambuc# by default if the 'rm' program in use doesn't match our expectations; the
621*0a6a1f1dSLionel Sambuc# user can still override this though.
622*0a6a1f1dSLionel Sambucif rm -f && rm -fr && rm -rf; then : OK; else
623*0a6a1f1dSLionel Sambuc  cat >&2 <<'END'
624*0a6a1f1dSLionel SambucOops!
625*0a6a1f1dSLionel Sambuc
626*0a6a1f1dSLionel SambucYour 'rm' program seems unable to run without file operands specified
627*0a6a1f1dSLionel Sambucon the command line, even when the '-f' option is present.  This is contrary
628*0a6a1f1dSLionel Sambucto the behaviour of most rm programs out there, and not conforming with
629*0a6a1f1dSLionel Sambucthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
630*0a6a1f1dSLionel Sambuc
631*0a6a1f1dSLionel SambucPlease tell bug-automake@gnu.org about your system, including the value
632*0a6a1f1dSLionel Sambucof your $PATH and any error possibly output before this message.  This
633*0a6a1f1dSLionel Sambuccan help us improve future automake versions.
634*0a6a1f1dSLionel Sambuc
635*0a6a1f1dSLionel SambucEND
636*0a6a1f1dSLionel Sambuc  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
637*0a6a1f1dSLionel Sambuc    echo 'Configuration will proceed anyway, since you have set the' >&2
638*0a6a1f1dSLionel Sambuc    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
639*0a6a1f1dSLionel Sambuc    echo >&2
640*0a6a1f1dSLionel Sambuc  else
641*0a6a1f1dSLionel Sambuc    cat >&2 <<'END'
642*0a6a1f1dSLionel SambucAborting the configuration process, to ensure you take notice of the issue.
643*0a6a1f1dSLionel Sambuc
644*0a6a1f1dSLionel SambucYou can download and install GNU coreutils to get an 'rm' implementation
645*0a6a1f1dSLionel Sambucthat behaves properly: <http://www.gnu.org/software/coreutils/>.
646*0a6a1f1dSLionel Sambuc
647*0a6a1f1dSLionel SambucIf you want to complete the configuration process using your problematic
648*0a6a1f1dSLionel Sambuc'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
649*0a6a1f1dSLionel Sambucto "yes", and re-run configure.
650*0a6a1f1dSLionel Sambuc
651*0a6a1f1dSLionel SambucEND
652*0a6a1f1dSLionel Sambuc    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
653*0a6a1f1dSLionel Sambuc  fi
654*0a6a1f1dSLionel Sambucfi])
655ef01931fSBen Gras
65684d9c625SLionel Sambucdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
657835f6802SDirk Vogtdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
658835f6802SDirk Vogtdnl mangled by Autoconf and run in a shell conditional statement.
659835f6802SDirk Vogtm4_define([_AC_COMPILER_EXEEXT],
660835f6802SDirk Vogtm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
661835f6802SDirk Vogt
662ef01931fSBen Gras# When config.status generates a header, we must update the stamp-h file.
663ef01931fSBen Gras# This file resides in the same directory as the config header
664ef01931fSBen Gras# that is generated.  The stamp files are numbered to have different names.
665ef01931fSBen Gras
666ef01931fSBen Gras# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
667ef01931fSBen Gras# loop where config.status creates the headers, so we can generate
668ef01931fSBen Gras# our stamp files there.
669ef01931fSBen GrasAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
670ef01931fSBen Gras[# Compute $1's index in $config_headers.
671835f6802SDirk Vogt_am_arg=$1
672ef01931fSBen Gras_am_stamp_count=1
673ef01931fSBen Grasfor _am_header in $config_headers :; do
674ef01931fSBen Gras  case $_am_header in
675835f6802SDirk Vogt    $_am_arg | $_am_arg:* )
676ef01931fSBen Gras      break ;;
677ef01931fSBen Gras    * )
678ef01931fSBen Gras      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
679ef01931fSBen Gras  esac
680ef01931fSBen Grasdone
681835f6802SDirk Vogtecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
682ef01931fSBen Gras
683*0a6a1f1dSLionel Sambuc# Copyright (C) 2001-2013 Free Software Foundation, Inc.
684ef01931fSBen Gras#
685ef01931fSBen Gras# This file is free software; the Free Software Foundation
686ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
687ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
688ef01931fSBen Gras
689ef01931fSBen Gras# AM_PROG_INSTALL_SH
690ef01931fSBen Gras# ------------------
691ef01931fSBen Gras# Define $install_sh.
692ef01931fSBen GrasAC_DEFUN([AM_PROG_INSTALL_SH],
693ef01931fSBen Gras[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
694835f6802SDirk Vogtif test x"${install_sh}" != xset; then
695835f6802SDirk Vogt  case $am_aux_dir in
696835f6802SDirk Vogt  *\ * | *\	*)
697835f6802SDirk Vogt    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
698835f6802SDirk Vogt  *)
699835f6802SDirk Vogt    install_sh="\${SHELL} $am_aux_dir/install-sh"
700835f6802SDirk Vogt  esac
701835f6802SDirk Vogtfi
70284d9c625SLionel SambucAC_SUBST([install_sh])])
703ef01931fSBen Gras
704*0a6a1f1dSLionel Sambuc# Copyright (C) 2003-2013 Free Software Foundation, Inc.
705ef01931fSBen Gras#
706ef01931fSBen Gras# This file is free software; the Free Software Foundation
707ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
708ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
709ef01931fSBen Gras
710ef01931fSBen Gras# Check whether the underlying file-system supports filenames
711ef01931fSBen Gras# with a leading dot.  For instance MS-DOS doesn't.
712ef01931fSBen GrasAC_DEFUN([AM_SET_LEADING_DOT],
713ef01931fSBen Gras[rm -rf .tst 2>/dev/null
714ef01931fSBen Grasmkdir .tst 2>/dev/null
715ef01931fSBen Grasif test -d .tst; then
716ef01931fSBen Gras  am__leading_dot=.
717ef01931fSBen Graselse
718ef01931fSBen Gras  am__leading_dot=_
719ef01931fSBen Grasfi
720ef01931fSBen Grasrmdir .tst 2>/dev/null
721ef01931fSBen GrasAC_SUBST([am__leading_dot])])
722ef01931fSBen Gras
723835f6802SDirk Vogt# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
724835f6802SDirk Vogt# From Jim Meyering
725ef01931fSBen Gras
726*0a6a1f1dSLionel Sambuc# Copyright (C) 1996-2013 Free Software Foundation, Inc.
727ef01931fSBen Gras#
728ef01931fSBen Gras# This file is free software; the Free Software Foundation
729ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
730ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
731ef01931fSBen Gras
732835f6802SDirk Vogt# AM_MAINTAINER_MODE([DEFAULT-MODE])
733835f6802SDirk Vogt# ----------------------------------
734835f6802SDirk Vogt# Control maintainer-specific portions of Makefiles.
73584d9c625SLionel Sambuc# Default is to disable them, unless 'enable' is passed literally.
73684d9c625SLionel Sambuc# For symmetry, 'disable' may be passed as well.  Anyway, the user
737835f6802SDirk Vogt# can override the default with the --enable/--disable switch.
738835f6802SDirk VogtAC_DEFUN([AM_MAINTAINER_MODE],
739835f6802SDirk Vogt[m4_case(m4_default([$1], [disable]),
740835f6802SDirk Vogt       [enable], [m4_define([am_maintainer_other], [disable])],
741835f6802SDirk Vogt       [disable], [m4_define([am_maintainer_other], [enable])],
742835f6802SDirk Vogt       [m4_define([am_maintainer_other], [enable])
743835f6802SDirk Vogt        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
74484d9c625SLionel SambucAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
745835f6802SDirk Vogt  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
746835f6802SDirk Vogt  AC_ARG_ENABLE([maintainer-mode],
74784d9c625SLionel Sambuc    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
74884d9c625SLionel Sambuc      am_maintainer_other[ make rules and dependencies not useful
74984d9c625SLionel Sambuc      (and sometimes confusing) to the casual installer])],
750835f6802SDirk Vogt    [USE_MAINTAINER_MODE=$enableval],
751835f6802SDirk Vogt    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
752835f6802SDirk Vogt  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
753835f6802SDirk Vogt  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
754835f6802SDirk Vogt  MAINT=$MAINTAINER_MODE_TRUE
755835f6802SDirk Vogt  AC_SUBST([MAINT])dnl
756835f6802SDirk Vogt]
757835f6802SDirk Vogt)
758835f6802SDirk Vogt
759835f6802SDirk Vogt# Check to see how 'make' treats includes.	            -*- Autoconf -*-
760835f6802SDirk Vogt
761*0a6a1f1dSLionel Sambuc# Copyright (C) 2001-2013 Free Software Foundation, Inc.
762835f6802SDirk Vogt#
763835f6802SDirk Vogt# This file is free software; the Free Software Foundation
764835f6802SDirk Vogt# gives unlimited permission to copy and/or distribute it,
765835f6802SDirk Vogt# with or without modifications, as long as this notice is preserved.
766835f6802SDirk Vogt
767ef01931fSBen Gras# AM_MAKE_INCLUDE()
768ef01931fSBen Gras# -----------------
769ef01931fSBen Gras# Check to see how make treats includes.
770ef01931fSBen GrasAC_DEFUN([AM_MAKE_INCLUDE],
771ef01931fSBen Gras[am_make=${MAKE-make}
772ef01931fSBen Grascat > confinc << 'END'
773ef01931fSBen Grasam__doit:
774835f6802SDirk Vogt	@echo this is the am__doit target
775ef01931fSBen Gras.PHONY: am__doit
776ef01931fSBen GrasEND
777ef01931fSBen Gras# If we don't find an include directive, just comment out the code.
778ef01931fSBen GrasAC_MSG_CHECKING([for style of include used by $am_make])
779ef01931fSBen Grasam__include="#"
780ef01931fSBen Grasam__quote=
781ef01931fSBen Gras_am_result=none
782ef01931fSBen Gras# First try GNU make style include.
783ef01931fSBen Grasecho "include confinc" > confmf
78484d9c625SLionel Sambuc# Ignore all kinds of additional output from 'make'.
785835f6802SDirk Vogtcase `$am_make -s -f confmf 2> /dev/null` in #(
786835f6802SDirk Vogt*the\ am__doit\ target*)
787ef01931fSBen Gras  am__include=include
788ef01931fSBen Gras  am__quote=
789ef01931fSBen Gras  _am_result=GNU
790835f6802SDirk Vogt  ;;
791835f6802SDirk Vogtesac
792ef01931fSBen Gras# Now try BSD make style include.
793ef01931fSBen Grasif test "$am__include" = "#"; then
794ef01931fSBen Gras   echo '.include "confinc"' > confmf
795835f6802SDirk Vogt   case `$am_make -s -f confmf 2> /dev/null` in #(
796835f6802SDirk Vogt   *the\ am__doit\ target*)
797ef01931fSBen Gras     am__include=.include
798ef01931fSBen Gras     am__quote="\""
799ef01931fSBen Gras     _am_result=BSD
800835f6802SDirk Vogt     ;;
801835f6802SDirk Vogt   esac
802ef01931fSBen Grasfi
803ef01931fSBen GrasAC_SUBST([am__include])
804ef01931fSBen GrasAC_SUBST([am__quote])
805ef01931fSBen GrasAC_MSG_RESULT([$_am_result])
806ef01931fSBen Grasrm -f confinc confmf
807ef01931fSBen Gras])
808ef01931fSBen Gras
809ef01931fSBen Gras# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
810ef01931fSBen Gras
811*0a6a1f1dSLionel Sambuc# Copyright (C) 1997-2013 Free Software Foundation, Inc.
812ef01931fSBen Gras#
813ef01931fSBen Gras# This file is free software; the Free Software Foundation
814ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
815ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
816ef01931fSBen Gras
817ef01931fSBen Gras# AM_MISSING_PROG(NAME, PROGRAM)
818ef01931fSBen Gras# ------------------------------
819ef01931fSBen GrasAC_DEFUN([AM_MISSING_PROG],
820ef01931fSBen Gras[AC_REQUIRE([AM_MISSING_HAS_RUN])
821ef01931fSBen Gras$1=${$1-"${am_missing_run}$2"}
822ef01931fSBen GrasAC_SUBST($1)])
823ef01931fSBen Gras
824ef01931fSBen Gras# AM_MISSING_HAS_RUN
825ef01931fSBen Gras# ------------------
826*0a6a1f1dSLionel Sambuc# Define MISSING if not defined so far and test if it is modern enough.
827*0a6a1f1dSLionel Sambuc# If it is, set am_missing_run to use it, otherwise, to nothing.
828ef01931fSBen GrasAC_DEFUN([AM_MISSING_HAS_RUN],
829ef01931fSBen Gras[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
830ef01931fSBen GrasAC_REQUIRE_AUX_FILE([missing])dnl
831835f6802SDirk Vogtif test x"${MISSING+set}" != xset; then
832835f6802SDirk Vogt  case $am_aux_dir in
833835f6802SDirk Vogt  *\ * | *\	*)
834835f6802SDirk Vogt    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
835835f6802SDirk Vogt  *)
836835f6802SDirk Vogt    MISSING="\${SHELL} $am_aux_dir/missing" ;;
837835f6802SDirk Vogt  esac
838835f6802SDirk Vogtfi
839ef01931fSBen Gras# Use eval to expand $SHELL
840*0a6a1f1dSLionel Sambucif eval "$MISSING --is-lightweight"; then
841*0a6a1f1dSLionel Sambuc  am_missing_run="$MISSING "
842ef01931fSBen Graselse
843ef01931fSBen Gras  am_missing_run=
84484d9c625SLionel Sambuc  AC_MSG_WARN(['missing' script is too old or missing])
845ef01931fSBen Grasfi
846ef01931fSBen Gras])
847ef01931fSBen Gras
848ef01931fSBen Gras# Helper functions for option handling.                     -*- Autoconf -*-
849ef01931fSBen Gras
850*0a6a1f1dSLionel Sambuc# Copyright (C) 2001-2013 Free Software Foundation, Inc.
851ef01931fSBen Gras#
852ef01931fSBen Gras# This file is free software; the Free Software Foundation
853ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
854ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
855ef01931fSBen Gras
856ef01931fSBen Gras# _AM_MANGLE_OPTION(NAME)
857ef01931fSBen Gras# -----------------------
858ef01931fSBen GrasAC_DEFUN([_AM_MANGLE_OPTION],
859ef01931fSBen Gras[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
860ef01931fSBen Gras
861ef01931fSBen Gras# _AM_SET_OPTION(NAME)
86284d9c625SLionel Sambuc# --------------------
863ef01931fSBen Gras# Set option NAME.  Presently that only means defining a flag for this option.
864ef01931fSBen GrasAC_DEFUN([_AM_SET_OPTION],
86584d9c625SLionel Sambuc[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
866ef01931fSBen Gras
867ef01931fSBen Gras# _AM_SET_OPTIONS(OPTIONS)
86884d9c625SLionel Sambuc# ------------------------
869ef01931fSBen Gras# OPTIONS is a space-separated list of Automake options.
870ef01931fSBen GrasAC_DEFUN([_AM_SET_OPTIONS],
871835f6802SDirk Vogt[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
872ef01931fSBen Gras
873ef01931fSBen Gras# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
874ef01931fSBen Gras# -------------------------------------------
875ef01931fSBen Gras# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
876ef01931fSBen GrasAC_DEFUN([_AM_IF_OPTION],
877ef01931fSBen Gras[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
878ef01931fSBen Gras
879*0a6a1f1dSLionel Sambuc# Copyright (C) 1999-2013 Free Software Foundation, Inc.
880*0a6a1f1dSLionel Sambuc#
881*0a6a1f1dSLionel Sambuc# This file is free software; the Free Software Foundation
882*0a6a1f1dSLionel Sambuc# gives unlimited permission to copy and/or distribute it,
883*0a6a1f1dSLionel Sambuc# with or without modifications, as long as this notice is preserved.
884*0a6a1f1dSLionel Sambuc
885*0a6a1f1dSLionel Sambuc# _AM_PROG_CC_C_O
886*0a6a1f1dSLionel Sambuc# ---------------
887*0a6a1f1dSLionel Sambuc# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
888*0a6a1f1dSLionel Sambuc# to automatically call this.
889*0a6a1f1dSLionel SambucAC_DEFUN([_AM_PROG_CC_C_O],
890*0a6a1f1dSLionel Sambuc[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
891*0a6a1f1dSLionel SambucAC_REQUIRE_AUX_FILE([compile])dnl
892*0a6a1f1dSLionel SambucAC_LANG_PUSH([C])dnl
893*0a6a1f1dSLionel SambucAC_CACHE_CHECK(
894*0a6a1f1dSLionel Sambuc  [whether $CC understands -c and -o together],
895*0a6a1f1dSLionel Sambuc  [am_cv_prog_cc_c_o],
896*0a6a1f1dSLionel Sambuc  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
897*0a6a1f1dSLionel Sambuc  # Make sure it works both with $CC and with simple cc.
898*0a6a1f1dSLionel Sambuc  # Following AC_PROG_CC_C_O, we do the test twice because some
899*0a6a1f1dSLionel Sambuc  # compilers refuse to overwrite an existing .o file with -o,
900*0a6a1f1dSLionel Sambuc  # though they will create one.
901*0a6a1f1dSLionel Sambuc  am_cv_prog_cc_c_o=yes
902*0a6a1f1dSLionel Sambuc  for am_i in 1 2; do
903*0a6a1f1dSLionel Sambuc    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
904*0a6a1f1dSLionel Sambuc         && test -f conftest2.$ac_objext; then
905*0a6a1f1dSLionel Sambuc      : OK
906*0a6a1f1dSLionel Sambuc    else
907*0a6a1f1dSLionel Sambuc      am_cv_prog_cc_c_o=no
908*0a6a1f1dSLionel Sambuc      break
909*0a6a1f1dSLionel Sambuc    fi
910*0a6a1f1dSLionel Sambuc  done
911*0a6a1f1dSLionel Sambuc  rm -f core conftest*
912*0a6a1f1dSLionel Sambuc  unset am_i])
913*0a6a1f1dSLionel Sambucif test "$am_cv_prog_cc_c_o" != yes; then
914*0a6a1f1dSLionel Sambuc   # Losing compiler, so override with the script.
915*0a6a1f1dSLionel Sambuc   # FIXME: It is wrong to rewrite CC.
916*0a6a1f1dSLionel Sambuc   # But if we don't then we get into trouble of one sort or another.
917*0a6a1f1dSLionel Sambuc   # A longer-term fix would be to have automake use am__CC in this case,
918*0a6a1f1dSLionel Sambuc   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
919*0a6a1f1dSLionel Sambuc   CC="$am_aux_dir/compile $CC"
920*0a6a1f1dSLionel Sambucfi
921*0a6a1f1dSLionel SambucAC_LANG_POP([C])])
922*0a6a1f1dSLionel Sambuc
923*0a6a1f1dSLionel Sambuc# For backward compatibility.
924*0a6a1f1dSLionel SambucAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
925*0a6a1f1dSLionel Sambuc
926*0a6a1f1dSLionel Sambuc# Copyright (C) 2001-2013 Free Software Foundation, Inc.
927*0a6a1f1dSLionel Sambuc#
928*0a6a1f1dSLionel Sambuc# This file is free software; the Free Software Foundation
929*0a6a1f1dSLionel Sambuc# gives unlimited permission to copy and/or distribute it,
930*0a6a1f1dSLionel Sambuc# with or without modifications, as long as this notice is preserved.
931*0a6a1f1dSLionel Sambuc
932*0a6a1f1dSLionel Sambuc# AM_RUN_LOG(COMMAND)
933*0a6a1f1dSLionel Sambuc# -------------------
934*0a6a1f1dSLionel Sambuc# Run COMMAND, save the exit status in ac_status, and log it.
935*0a6a1f1dSLionel Sambuc# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
936*0a6a1f1dSLionel SambucAC_DEFUN([AM_RUN_LOG],
937*0a6a1f1dSLionel Sambuc[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
938*0a6a1f1dSLionel Sambuc   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
939*0a6a1f1dSLionel Sambuc   ac_status=$?
940*0a6a1f1dSLionel Sambuc   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
941*0a6a1f1dSLionel Sambuc   (exit $ac_status); }])
942*0a6a1f1dSLionel Sambuc
943ef01931fSBen Gras# Check to make sure that the build environment is sane.    -*- Autoconf -*-
944ef01931fSBen Gras
945*0a6a1f1dSLionel Sambuc# Copyright (C) 1996-2013 Free Software Foundation, Inc.
946ef01931fSBen Gras#
947ef01931fSBen Gras# This file is free software; the Free Software Foundation
948ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
949ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
950ef01931fSBen Gras
951ef01931fSBen Gras# AM_SANITY_CHECK
952ef01931fSBen Gras# ---------------
953ef01931fSBen GrasAC_DEFUN([AM_SANITY_CHECK],
954ef01931fSBen Gras[AC_MSG_CHECKING([whether build environment is sane])
955835f6802SDirk Vogt# Reject unsafe characters in $srcdir or the absolute working directory
956835f6802SDirk Vogt# name.  Accept space and tab only in the latter.
957835f6802SDirk Vogtam_lf='
958835f6802SDirk Vogt'
959835f6802SDirk Vogtcase `pwd` in
960835f6802SDirk Vogt  *[[\\\"\#\$\&\'\`$am_lf]]*)
961835f6802SDirk Vogt    AC_MSG_ERROR([unsafe absolute working directory name]);;
962835f6802SDirk Vogtesac
963835f6802SDirk Vogtcase $srcdir in
964835f6802SDirk Vogt  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
96584d9c625SLionel Sambuc    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
966835f6802SDirk Vogtesac
967835f6802SDirk Vogt
96884d9c625SLionel Sambuc# Do 'set' in a subshell so we don't clobber the current shell's
969ef01931fSBen Gras# arguments.  Must try -L first in case configure is actually a
970ef01931fSBen Gras# symlink; some systems play weird games with the mod time of symlinks
971ef01931fSBen Gras# (eg FreeBSD returns the mod time of the symlink's containing
972ef01931fSBen Gras# directory).
973ef01931fSBen Grasif (
97484d9c625SLionel Sambuc   am_has_slept=no
97584d9c625SLionel Sambuc   for am_try in 1 2; do
97684d9c625SLionel Sambuc     echo "timestamp, slept: $am_has_slept" > conftest.file
977835f6802SDirk Vogt     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
978ef01931fSBen Gras     if test "$[*]" = "X"; then
979ef01931fSBen Gras	# -L didn't work.
980835f6802SDirk Vogt	set X `ls -t "$srcdir/configure" conftest.file`
981ef01931fSBen Gras     fi
982ef01931fSBen Gras     if test "$[*]" != "X $srcdir/configure conftest.file" \
983ef01931fSBen Gras	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
984ef01931fSBen Gras
985ef01931fSBen Gras	# If neither matched, then we have a broken ls.  This can happen
986ef01931fSBen Gras	# if, for instance, CONFIG_SHELL is bash and it inherits a
987ef01931fSBen Gras	# broken ls alias from the environment.  This has actually
988ef01931fSBen Gras	# happened.  Such a system could not be considered "sane".
989ef01931fSBen Gras	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
990ef01931fSBen Gras  alias in your environment])
991ef01931fSBen Gras     fi
99284d9c625SLionel Sambuc     if test "$[2]" = conftest.file || test $am_try -eq 2; then
99384d9c625SLionel Sambuc       break
99484d9c625SLionel Sambuc     fi
99584d9c625SLionel Sambuc     # Just in case.
99684d9c625SLionel Sambuc     sleep 1
99784d9c625SLionel Sambuc     am_has_slept=yes
99884d9c625SLionel Sambuc   done
999ef01931fSBen Gras   test "$[2]" = conftest.file
1000ef01931fSBen Gras   )
1001ef01931fSBen Grasthen
1002ef01931fSBen Gras   # Ok.
1003ef01931fSBen Gras   :
1004ef01931fSBen Graselse
1005ef01931fSBen Gras   AC_MSG_ERROR([newly created file is older than distributed files!
1006ef01931fSBen GrasCheck your system clock])
1007ef01931fSBen Grasfi
100884d9c625SLionel SambucAC_MSG_RESULT([yes])
100984d9c625SLionel Sambuc# If we didn't sleep, we still need to ensure time stamps of config.status and
101084d9c625SLionel Sambuc# generated files are strictly newer.
101184d9c625SLionel Sambucam_sleep_pid=
101284d9c625SLionel Sambucif grep 'slept: no' conftest.file >/dev/null 2>&1; then
101384d9c625SLionel Sambuc  ( sleep 1 ) &
101484d9c625SLionel Sambuc  am_sleep_pid=$!
101584d9c625SLionel Sambucfi
101684d9c625SLionel SambucAC_CONFIG_COMMANDS_PRE(
101784d9c625SLionel Sambuc  [AC_MSG_CHECKING([that generated files are newer than configure])
101884d9c625SLionel Sambuc   if test -n "$am_sleep_pid"; then
101984d9c625SLionel Sambuc     # Hide warnings about reused PIDs.
102084d9c625SLionel Sambuc     wait $am_sleep_pid 2>/dev/null
102184d9c625SLionel Sambuc   fi
102284d9c625SLionel Sambuc   AC_MSG_RESULT([done])])
102384d9c625SLionel Sambucrm -f conftest.file
102484d9c625SLionel Sambuc])
1025ef01931fSBen Gras
1026*0a6a1f1dSLionel Sambuc# Copyright (C) 2009-2013 Free Software Foundation, Inc.
1027835f6802SDirk Vogt#
1028835f6802SDirk Vogt# This file is free software; the Free Software Foundation
1029835f6802SDirk Vogt# gives unlimited permission to copy and/or distribute it,
1030835f6802SDirk Vogt# with or without modifications, as long as this notice is preserved.
1031835f6802SDirk Vogt
1032835f6802SDirk Vogt# AM_SILENT_RULES([DEFAULT])
1033835f6802SDirk Vogt# --------------------------
1034835f6802SDirk Vogt# Enable less verbose build rules; with the default set to DEFAULT
103584d9c625SLionel Sambuc# ("yes" being less verbose, "no" or empty being verbose).
1036835f6802SDirk VogtAC_DEFUN([AM_SILENT_RULES],
103784d9c625SLionel Sambuc[AC_ARG_ENABLE([silent-rules], [dnl
103884d9c625SLionel SambucAS_HELP_STRING(
103984d9c625SLionel Sambuc  [--enable-silent-rules],
104084d9c625SLionel Sambuc  [less verbose build output (undo: "make V=1")])
104184d9c625SLionel SambucAS_HELP_STRING(
104284d9c625SLionel Sambuc  [--disable-silent-rules],
104384d9c625SLionel Sambuc  [verbose build output (undo: "make V=0")])dnl
104484d9c625SLionel Sambuc])
104584d9c625SLionel Sambuccase $enable_silent_rules in @%:@ (((
1046835f6802SDirk Vogt  yes) AM_DEFAULT_VERBOSITY=0;;
1047835f6802SDirk Vogt   no) AM_DEFAULT_VERBOSITY=1;;
1048835f6802SDirk Vogt    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1049835f6802SDirk Vogtesac
105084d9c625SLionel Sambucdnl
105184d9c625SLionel Sambucdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
105284d9c625SLionel Sambucdnl do not support nested variable expansions.
105384d9c625SLionel Sambucdnl See automake bug#9928 and bug#10237.
105484d9c625SLionel Sambucam_make=${MAKE-make}
105584d9c625SLionel SambucAC_CACHE_CHECK([whether $am_make supports nested variables],
105684d9c625SLionel Sambuc   [am_cv_make_support_nested_variables],
105784d9c625SLionel Sambuc   [if AS_ECHO([['TRUE=$(BAR$(V))
105884d9c625SLionel SambucBAR0=false
105984d9c625SLionel SambucBAR1=true
106084d9c625SLionel SambucV=1
106184d9c625SLionel Sambucam__doit:
106284d9c625SLionel Sambuc	@$(TRUE)
106384d9c625SLionel Sambuc.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
106484d9c625SLionel Sambuc  am_cv_make_support_nested_variables=yes
106584d9c625SLionel Sambucelse
106684d9c625SLionel Sambuc  am_cv_make_support_nested_variables=no
106784d9c625SLionel Sambucfi])
106884d9c625SLionel Sambucif test $am_cv_make_support_nested_variables = yes; then
106984d9c625SLionel Sambuc  dnl Using '$V' instead of '$(V)' breaks IRIX make.
107084d9c625SLionel Sambuc  AM_V='$(V)'
107184d9c625SLionel Sambuc  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
107284d9c625SLionel Sambucelse
107384d9c625SLionel Sambuc  AM_V=$AM_DEFAULT_VERBOSITY
107484d9c625SLionel Sambuc  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
107584d9c625SLionel Sambucfi
107684d9c625SLionel SambucAC_SUBST([AM_V])dnl
107784d9c625SLionel SambucAM_SUBST_NOTMAKE([AM_V])dnl
107884d9c625SLionel SambucAC_SUBST([AM_DEFAULT_V])dnl
107984d9c625SLionel SambucAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1080835f6802SDirk VogtAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1081835f6802SDirk VogtAM_BACKSLASH='\'
1082835f6802SDirk VogtAC_SUBST([AM_BACKSLASH])dnl
1083835f6802SDirk Vogt_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1084835f6802SDirk Vogt])
1085835f6802SDirk Vogt
1086*0a6a1f1dSLionel Sambuc# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1087ef01931fSBen Gras#
1088ef01931fSBen Gras# This file is free software; the Free Software Foundation
1089ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
1090ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
1091ef01931fSBen Gras
1092ef01931fSBen Gras# AM_PROG_INSTALL_STRIP
1093ef01931fSBen Gras# ---------------------
109484d9c625SLionel Sambuc# One issue with vendor 'install' (even GNU) is that you can't
1095ef01931fSBen Gras# specify the program used to strip binaries.  This is especially
1096ef01931fSBen Gras# annoying in cross-compiling environments, where the build's strip
1097ef01931fSBen Gras# is unlikely to handle the host's binaries.
1098ef01931fSBen Gras# Fortunately install-sh will honor a STRIPPROG variable, so we
109984d9c625SLionel Sambuc# always use install-sh in "make install-strip", and initialize
1100ef01931fSBen Gras# STRIPPROG with the value of the STRIP variable (set by the user).
1101ef01931fSBen GrasAC_DEFUN([AM_PROG_INSTALL_STRIP],
1102ef01931fSBen Gras[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
110384d9c625SLionel Sambuc# Installed binaries are usually stripped using 'strip' when the user
110484d9c625SLionel Sambuc# run "make install-strip".  However 'strip' might not be the right
1105ef01931fSBen Gras# tool to use in cross-compilation environments, therefore Automake
110684d9c625SLionel Sambuc# will honor the 'STRIP' environment variable to overrule this program.
110784d9c625SLionel Sambucdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1108ef01931fSBen Grasif test "$cross_compiling" != no; then
1109ef01931fSBen Gras  AC_CHECK_TOOL([STRIP], [strip], :)
1110ef01931fSBen Grasfi
1111ef01931fSBen GrasINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1112ef01931fSBen GrasAC_SUBST([INSTALL_STRIP_PROGRAM])])
1113ef01931fSBen Gras
1114*0a6a1f1dSLionel Sambuc# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1115ef01931fSBen Gras#
1116ef01931fSBen Gras# This file is free software; the Free Software Foundation
1117ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
1118ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
1119ef01931fSBen Gras
1120ef01931fSBen Gras# _AM_SUBST_NOTMAKE(VARIABLE)
1121ef01931fSBen Gras# ---------------------------
1122835f6802SDirk Vogt# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1123ef01931fSBen Gras# This macro is traced by Automake.
1124ef01931fSBen GrasAC_DEFUN([_AM_SUBST_NOTMAKE])
1125ef01931fSBen Gras
1126835f6802SDirk Vogt# AM_SUBST_NOTMAKE(VARIABLE)
112784d9c625SLionel Sambuc# --------------------------
1128835f6802SDirk Vogt# Public sister of _AM_SUBST_NOTMAKE.
1129835f6802SDirk VogtAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1130835f6802SDirk Vogt
1131ef01931fSBen Gras# Check how to create a tarball.                            -*- Autoconf -*-
1132ef01931fSBen Gras
1133*0a6a1f1dSLionel Sambuc# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1134ef01931fSBen Gras#
1135ef01931fSBen Gras# This file is free software; the Free Software Foundation
1136ef01931fSBen Gras# gives unlimited permission to copy and/or distribute it,
1137ef01931fSBen Gras# with or without modifications, as long as this notice is preserved.
1138ef01931fSBen Gras
1139ef01931fSBen Gras# _AM_PROG_TAR(FORMAT)
1140ef01931fSBen Gras# --------------------
1141ef01931fSBen Gras# Check how to create a tarball in format FORMAT.
114284d9c625SLionel Sambuc# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1143ef01931fSBen Gras#
1144ef01931fSBen Gras# Substitute a variable $(am__tar) that is a command
1145ef01931fSBen Gras# writing to stdout a FORMAT-tarball containing the directory
1146ef01931fSBen Gras# $tardir.
1147ef01931fSBen Gras#     tardir=directory && $(am__tar) > result.tar
1148ef01931fSBen Gras#
1149ef01931fSBen Gras# Substitute a variable $(am__untar) that extract such
1150ef01931fSBen Gras# a tarball read from stdin.
1151ef01931fSBen Gras#     $(am__untar) < result.tar
1152*0a6a1f1dSLionel Sambuc#
1153ef01931fSBen GrasAC_DEFUN([_AM_PROG_TAR],
115484d9c625SLionel Sambuc[# Always define AMTAR for backward compatibility.  Yes, it's still used
115584d9c625SLionel Sambuc# in the wild :-(  We should find a proper way to deprecate it ...
115684d9c625SLionel SambucAC_SUBST([AMTAR], ['$${TAR-tar}'])
1157*0a6a1f1dSLionel Sambuc
1158*0a6a1f1dSLionel Sambuc# We'll loop over all known methods to create a tar archive until one works.
1159*0a6a1f1dSLionel Sambuc_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1160*0a6a1f1dSLionel Sambuc
1161ef01931fSBen Grasm4_if([$1], [v7],
116284d9c625SLionel Sambuc  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1163*0a6a1f1dSLionel Sambuc
1164*0a6a1f1dSLionel Sambuc  [m4_case([$1],
1165*0a6a1f1dSLionel Sambuc    [ustar],
1166*0a6a1f1dSLionel Sambuc     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1167*0a6a1f1dSLionel Sambuc      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1168*0a6a1f1dSLionel Sambuc      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1169*0a6a1f1dSLionel Sambuc      # and bug#13588).
1170*0a6a1f1dSLionel Sambuc      am_max_uid=2097151 # 2^21 - 1
1171*0a6a1f1dSLionel Sambuc      am_max_gid=$am_max_uid
1172*0a6a1f1dSLionel Sambuc      # The $UID and $GID variables are not portable, so we need to resort
1173*0a6a1f1dSLionel Sambuc      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1174*0a6a1f1dSLionel Sambuc      # below are definitely unexpected, so allow the users to see them
1175*0a6a1f1dSLionel Sambuc      # (that is, avoid stderr redirection).
1176*0a6a1f1dSLionel Sambuc      am_uid=`id -u || echo unknown`
1177*0a6a1f1dSLionel Sambuc      am_gid=`id -g || echo unknown`
1178*0a6a1f1dSLionel Sambuc      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1179*0a6a1f1dSLionel Sambuc      if test $am_uid -le $am_max_uid; then
1180*0a6a1f1dSLionel Sambuc         AC_MSG_RESULT([yes])
1181*0a6a1f1dSLionel Sambuc      else
1182*0a6a1f1dSLionel Sambuc         AC_MSG_RESULT([no])
1183*0a6a1f1dSLionel Sambuc         _am_tools=none
1184*0a6a1f1dSLionel Sambuc      fi
1185*0a6a1f1dSLionel Sambuc      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1186*0a6a1f1dSLionel Sambuc      if test $am_gid -le $am_max_gid; then
1187*0a6a1f1dSLionel Sambuc         AC_MSG_RESULT([yes])
1188*0a6a1f1dSLionel Sambuc      else
1189*0a6a1f1dSLionel Sambuc        AC_MSG_RESULT([no])
1190*0a6a1f1dSLionel Sambuc        _am_tools=none
1191*0a6a1f1dSLionel Sambuc      fi],
1192*0a6a1f1dSLionel Sambuc
1193*0a6a1f1dSLionel Sambuc  [pax],
1194*0a6a1f1dSLionel Sambuc    [],
1195*0a6a1f1dSLionel Sambuc
1196ef01931fSBen Gras  [m4_fatal([Unknown tar format])])
1197*0a6a1f1dSLionel Sambuc
1198ef01931fSBen Gras  AC_MSG_CHECKING([how to create a $1 tar archive])
1199*0a6a1f1dSLionel Sambuc
1200*0a6a1f1dSLionel Sambuc  # Go ahead even if we have the value already cached.  We do so because we
1201*0a6a1f1dSLionel Sambuc  # need to set the values for the 'am__tar' and 'am__untar' variables.
1202ef01931fSBen Gras  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1203*0a6a1f1dSLionel Sambuc
1204*0a6a1f1dSLionel Sambuc  for _am_tool in $_am_tools; do
1205ef01931fSBen Gras    case $_am_tool in
1206ef01931fSBen Gras    gnutar)
1207*0a6a1f1dSLionel Sambuc      for _am_tar in tar gnutar gtar; do
1208ef01931fSBen Gras        AM_RUN_LOG([$_am_tar --version]) && break
1209ef01931fSBen Gras      done
1210ef01931fSBen Gras      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1211ef01931fSBen Gras      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1212ef01931fSBen Gras      am__untar="$_am_tar -xf -"
1213ef01931fSBen Gras      ;;
1214ef01931fSBen Gras    plaintar)
1215ef01931fSBen Gras      # Must skip GNU tar: if it does not support --format= it doesn't create
1216ef01931fSBen Gras      # ustar tarball either.
1217ef01931fSBen Gras      (tar --version) >/dev/null 2>&1 && continue
1218ef01931fSBen Gras      am__tar='tar chf - "$$tardir"'
1219ef01931fSBen Gras      am__tar_='tar chf - "$tardir"'
1220ef01931fSBen Gras      am__untar='tar xf -'
1221ef01931fSBen Gras      ;;
1222ef01931fSBen Gras    pax)
1223ef01931fSBen Gras      am__tar='pax -L -x $1 -w "$$tardir"'
1224ef01931fSBen Gras      am__tar_='pax -L -x $1 -w "$tardir"'
1225ef01931fSBen Gras      am__untar='pax -r'
1226ef01931fSBen Gras      ;;
1227ef01931fSBen Gras    cpio)
1228ef01931fSBen Gras      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1229ef01931fSBen Gras      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1230ef01931fSBen Gras      am__untar='cpio -i -H $1 -d'
1231ef01931fSBen Gras      ;;
1232ef01931fSBen Gras    none)
1233ef01931fSBen Gras      am__tar=false
1234ef01931fSBen Gras      am__tar_=false
1235ef01931fSBen Gras      am__untar=false
1236ef01931fSBen Gras      ;;
1237ef01931fSBen Gras    esac
1238ef01931fSBen Gras
1239ef01931fSBen Gras    # If the value was cached, stop now.  We just wanted to have am__tar
1240ef01931fSBen Gras    # and am__untar set.
1241ef01931fSBen Gras    test -n "${am_cv_prog_tar_$1}" && break
1242ef01931fSBen Gras
1243*0a6a1f1dSLionel Sambuc    # tar/untar a dummy directory, and stop if the command works.
1244ef01931fSBen Gras    rm -rf conftest.dir
1245ef01931fSBen Gras    mkdir conftest.dir
1246ef01931fSBen Gras    echo GrepMe > conftest.dir/file
1247ef01931fSBen Gras    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1248ef01931fSBen Gras    rm -rf conftest.dir
1249ef01931fSBen Gras    if test -s conftest.tar; then
1250ef01931fSBen Gras      AM_RUN_LOG([$am__untar <conftest.tar])
1251*0a6a1f1dSLionel Sambuc      AM_RUN_LOG([cat conftest.dir/file])
1252ef01931fSBen Gras      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1253ef01931fSBen Gras    fi
1254ef01931fSBen Gras  done
1255ef01931fSBen Gras  rm -rf conftest.dir
1256ef01931fSBen Gras
1257ef01931fSBen Gras  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1258ef01931fSBen Gras  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1259*0a6a1f1dSLionel Sambuc
1260ef01931fSBen GrasAC_SUBST([am__tar])
1261ef01931fSBen GrasAC_SUBST([am__untar])
1262ef01931fSBen Gras]) # _AM_PROG_TAR
1263ef01931fSBen Gras
1264835f6802SDirk Vogtm4_include([m4/libtool.m4])
1265835f6802SDirk Vogtm4_include([m4/ltoptions.m4])
1266835f6802SDirk Vogtm4_include([m4/ltsugar.m4])
1267835f6802SDirk Vogtm4_include([m4/ltversion.m4])
1268835f6802SDirk Vogtm4_include([m4/lt~obsolete.m4])
1269ef01931fSBen Grasm4_include([acinclude.m4])
1270