xref: /potrace-1.14/aclocal.m4 (revision 275def9c)
1*275def9cSCristian Pallarés# generated automatically by aclocal 1.15 -*- Autoconf -*-
2189777a2SCristian Pallares
3*275def9cSCristian Pallarés# Copyright (C) 1996-2014 Free Software Foundation, Inc.
41f13f311SSkyrpex
5189777a2SCristian Pallares# This file is free software; the Free Software Foundation
6189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
7189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
8189777a2SCristian Pallares
9189777a2SCristian Pallares# This program is distributed in the hope that it will be useful,
10189777a2SCristian Pallares# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11189777a2SCristian Pallares# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12189777a2SCristian Pallares# PARTICULAR PURPOSE.
13189777a2SCristian Pallares
141f13f311SSkyrpexm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15189777a2SCristian Pallaresm4_ifndef([AC_AUTOCONF_VERSION],
16189777a2SCristian Pallares  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17189777a2SCristian Pallaresm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18189777a2SCristian Pallares[m4_warning([this file was generated for autoconf 2.69.
19189777a2SCristian PallaresYou have another version of autoconf.  It may work, but is not guaranteed to.
20189777a2SCristian PallaresIf you have problems, you may need to regenerate the build system entirely.
211f13f311SSkyrpexTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22189777a2SCristian Pallares
23*275def9cSCristian Pallarés# Copyright (C) 2002-2014 Free Software Foundation, Inc.
24189777a2SCristian Pallares#
25189777a2SCristian Pallares# This file is free software; the Free Software Foundation
26189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
27189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
28189777a2SCristian Pallares
29189777a2SCristian Pallares# AM_AUTOMAKE_VERSION(VERSION)
30189777a2SCristian Pallares# ----------------------------
31189777a2SCristian Pallares# Automake X.Y traces this macro to ensure aclocal.m4 has been
32189777a2SCristian Pallares# generated from the m4 files accompanying Automake X.Y.
33189777a2SCristian Pallares# (This private macro should not be called outside this file.)
34189777a2SCristian PallaresAC_DEFUN([AM_AUTOMAKE_VERSION],
35*275def9cSCristian Pallarés[am__api_version='1.15'
36189777a2SCristian Pallaresdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37189777a2SCristian Pallaresdnl require some minimum version.  Point them to the right macro.
38*275def9cSCristian Pallarésm4_if([$1], [1.15], [],
39189777a2SCristian Pallares      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40189777a2SCristian Pallares])
41189777a2SCristian Pallares
42189777a2SCristian Pallares# _AM_AUTOCONF_VERSION(VERSION)
43189777a2SCristian Pallares# -----------------------------
44189777a2SCristian Pallares# aclocal traces this macro to find the Autoconf version.
45189777a2SCristian Pallares# This is a private macro too.  Using m4_define simplifies
46189777a2SCristian Pallares# the logic in aclocal, which can simply ignore this definition.
47189777a2SCristian Pallaresm4_define([_AM_AUTOCONF_VERSION], [])
48189777a2SCristian Pallares
49189777a2SCristian Pallares# AM_SET_CURRENT_AUTOMAKE_VERSION
50189777a2SCristian Pallares# -------------------------------
51189777a2SCristian Pallares# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52189777a2SCristian Pallares# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53189777a2SCristian PallaresAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54*275def9cSCristian Pallarés[AM_AUTOMAKE_VERSION([1.15])dnl
55189777a2SCristian Pallaresm4_ifndef([AC_AUTOCONF_VERSION],
56189777a2SCristian Pallares  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57189777a2SCristian Pallares_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58189777a2SCristian Pallares
59189777a2SCristian Pallares# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60189777a2SCristian Pallares
61*275def9cSCristian Pallarés# Copyright (C) 2001-2014 Free Software Foundation, Inc.
62189777a2SCristian Pallares#
63189777a2SCristian Pallares# This file is free software; the Free Software Foundation
64189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
65189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
66189777a2SCristian Pallares
67189777a2SCristian Pallares# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
681f13f311SSkyrpex# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
691f13f311SSkyrpex# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70189777a2SCristian Pallares#
71189777a2SCristian Pallares# Of course, Automake must honor this variable whenever it calls a
72189777a2SCristian Pallares# tool from the auxiliary directory.  The problem is that $srcdir (and
73189777a2SCristian Pallares# therefore $ac_aux_dir as well) can be either absolute or relative,
74189777a2SCristian Pallares# depending on how configure is run.  This is pretty annoying, since
75189777a2SCristian Pallares# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76189777a2SCristian Pallares# source directory, any form will work fine, but in subdirectories a
77189777a2SCristian Pallares# relative path needs to be adjusted first.
78189777a2SCristian Pallares#
79189777a2SCristian Pallares# $ac_aux_dir/missing
80189777a2SCristian Pallares#    fails when called from a subdirectory if $ac_aux_dir is relative
81189777a2SCristian Pallares# $top_srcdir/$ac_aux_dir/missing
82189777a2SCristian Pallares#    fails if $ac_aux_dir is absolute,
83189777a2SCristian Pallares#    fails when called from a subdirectory in a VPATH build with
84189777a2SCristian Pallares#          a relative $ac_aux_dir
85189777a2SCristian Pallares#
86189777a2SCristian Pallares# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87189777a2SCristian Pallares# are both prefixed by $srcdir.  In an in-source build this is usually
881f13f311SSkyrpex# harmless because $srcdir is '.', but things will broke when you
89189777a2SCristian Pallares# start a VPATH build or use an absolute $srcdir.
90189777a2SCristian Pallares#
91189777a2SCristian Pallares# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92189777a2SCristian Pallares# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93189777a2SCristian Pallares#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94189777a2SCristian Pallares# and then we would define $MISSING as
95189777a2SCristian Pallares#   MISSING="\${SHELL} $am_aux_dir/missing"
96189777a2SCristian Pallares# This will work as long as MISSING is not called from configure, because
97189777a2SCristian Pallares# unfortunately $(top_srcdir) has no meaning in configure.
98189777a2SCristian Pallares# However there are other variables, like CC, which are often used in
99189777a2SCristian Pallares# configure, and could therefore not use this "fixed" $ac_aux_dir.
100189777a2SCristian Pallares#
101189777a2SCristian Pallares# Another solution, used here, is to always expand $ac_aux_dir to an
102189777a2SCristian Pallares# absolute PATH.  The drawback is that using absolute paths prevent a
103189777a2SCristian Pallares# configured tree to be moved without reconfiguration.
104189777a2SCristian Pallares
105189777a2SCristian PallaresAC_DEFUN([AM_AUX_DIR_EXPAND],
106*275def9cSCristian Pallarés[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107*275def9cSCristian Pallarés# Expand $ac_aux_dir to an absolute path.
108*275def9cSCristian Pallarésam_aux_dir=`cd "$ac_aux_dir" && pwd`
109189777a2SCristian Pallares])
110189777a2SCristian Pallares
111189777a2SCristian Pallares# AM_CONDITIONAL                                            -*- Autoconf -*-
112189777a2SCristian Pallares
113*275def9cSCristian Pallarés# Copyright (C) 1997-2014 Free Software Foundation, Inc.
114189777a2SCristian Pallares#
115189777a2SCristian Pallares# This file is free software; the Free Software Foundation
116189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
117189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
118189777a2SCristian Pallares
119189777a2SCristian Pallares# AM_CONDITIONAL(NAME, SHELL-CONDITION)
120189777a2SCristian Pallares# -------------------------------------
121189777a2SCristian Pallares# Define a conditional.
122189777a2SCristian PallaresAC_DEFUN([AM_CONDITIONAL],
1231f13f311SSkyrpex[AC_PREREQ([2.52])dnl
1241f13f311SSkyrpex m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
125189777a2SCristian Pallares       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126189777a2SCristian PallaresAC_SUBST([$1_TRUE])dnl
127189777a2SCristian PallaresAC_SUBST([$1_FALSE])dnl
128189777a2SCristian Pallares_AM_SUBST_NOTMAKE([$1_TRUE])dnl
129189777a2SCristian Pallares_AM_SUBST_NOTMAKE([$1_FALSE])dnl
130189777a2SCristian Pallaresm4_define([_AM_COND_VALUE_$1], [$2])dnl
131189777a2SCristian Pallaresif $2; then
132189777a2SCristian Pallares  $1_TRUE=
133189777a2SCristian Pallares  $1_FALSE='#'
134189777a2SCristian Pallareselse
135189777a2SCristian Pallares  $1_TRUE='#'
136189777a2SCristian Pallares  $1_FALSE=
137189777a2SCristian Pallaresfi
138189777a2SCristian PallaresAC_CONFIG_COMMANDS_PRE(
139189777a2SCristian Pallares[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140189777a2SCristian Pallares  AC_MSG_ERROR([[conditional "$1" was never defined.
141189777a2SCristian PallaresUsually this means the macro was only invoked conditionally.]])
142189777a2SCristian Pallaresfi])])
143189777a2SCristian Pallares
144*275def9cSCristian Pallarés# Copyright (C) 1999-2014 Free Software Foundation, Inc.
145189777a2SCristian Pallares#
146189777a2SCristian Pallares# This file is free software; the Free Software Foundation
147189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
148189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
149189777a2SCristian Pallares
150189777a2SCristian Pallares
1511f13f311SSkyrpex# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
152189777a2SCristian Pallares# written in clear, in which case automake, when reading aclocal.m4,
153189777a2SCristian Pallares# will think it sees a *use*, and therefore will trigger all it's
154189777a2SCristian Pallares# C support machinery.  Also note that it means that autoscan, seeing
155189777a2SCristian Pallares# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
156189777a2SCristian Pallares
157189777a2SCristian Pallares
158189777a2SCristian Pallares# _AM_DEPENDENCIES(NAME)
159189777a2SCristian Pallares# ----------------------
160189777a2SCristian Pallares# See how the compiler implements dependency checking.
1611f13f311SSkyrpex# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
162189777a2SCristian Pallares# We try a few techniques and use that to set a single cache variable.
163189777a2SCristian Pallares#
164189777a2SCristian Pallares# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
165189777a2SCristian Pallares# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
166189777a2SCristian Pallares# dependency, and given that the user is not expected to run this macro,
167189777a2SCristian Pallares# just rely on AC_PROG_CC.
168189777a2SCristian PallaresAC_DEFUN([_AM_DEPENDENCIES],
169189777a2SCristian Pallares[AC_REQUIRE([AM_SET_DEPDIR])dnl
170189777a2SCristian PallaresAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
171189777a2SCristian PallaresAC_REQUIRE([AM_MAKE_INCLUDE])dnl
172189777a2SCristian PallaresAC_REQUIRE([AM_DEP_TRACK])dnl
173189777a2SCristian Pallares
1741f13f311SSkyrpexm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1751f13f311SSkyrpex      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1761f13f311SSkyrpex      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1771f13f311SSkyrpex      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1781f13f311SSkyrpex      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1791f13f311SSkyrpex      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
180189777a2SCristian Pallares                    [depcc="$$1"   am_compiler_list=])
181189777a2SCristian Pallares
182189777a2SCristian PallaresAC_CACHE_CHECK([dependency style of $depcc],
183189777a2SCristian Pallares               [am_cv_$1_dependencies_compiler_type],
184189777a2SCristian Pallares[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
185189777a2SCristian Pallares  # We make a subdir and do the tests there.  Otherwise we can end up
186189777a2SCristian Pallares  # making bogus files that we don't know about and never remove.  For
187189777a2SCristian Pallares  # instance it was reported that on HP-UX the gcc test will end up
1881f13f311SSkyrpex  # making a dummy file named 'D' -- because '-MD' means "put the output
1891f13f311SSkyrpex  # in D".
190189777a2SCristian Pallares  rm -rf conftest.dir
191189777a2SCristian Pallares  mkdir conftest.dir
192189777a2SCristian Pallares  # Copy depcomp to subdir because otherwise we won't find it if we're
193189777a2SCristian Pallares  # using a relative directory.
194189777a2SCristian Pallares  cp "$am_depcomp" conftest.dir
195189777a2SCristian Pallares  cd conftest.dir
196189777a2SCristian Pallares  # We will build objects and dependencies in a subdirectory because
197189777a2SCristian Pallares  # it helps to detect inapplicable dependency modes.  For instance
198189777a2SCristian Pallares  # both Tru64's cc and ICC support -MD to output dependencies as a
199189777a2SCristian Pallares  # side effect of compilation, but ICC will put the dependencies in
200189777a2SCristian Pallares  # the current directory while Tru64 will put them in the object
201189777a2SCristian Pallares  # directory.
202189777a2SCristian Pallares  mkdir sub
203189777a2SCristian Pallares
204189777a2SCristian Pallares  am_cv_$1_dependencies_compiler_type=none
205189777a2SCristian Pallares  if test "$am_compiler_list" = ""; then
206189777a2SCristian Pallares     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
207189777a2SCristian Pallares  fi
208189777a2SCristian Pallares  am__universal=false
209189777a2SCristian Pallares  m4_case([$1], [CC],
210189777a2SCristian Pallares    [case " $depcc " in #(
211189777a2SCristian Pallares     *\ -arch\ *\ -arch\ *) am__universal=true ;;
212189777a2SCristian Pallares     esac],
213189777a2SCristian Pallares    [CXX],
214189777a2SCristian Pallares    [case " $depcc " in #(
215189777a2SCristian Pallares     *\ -arch\ *\ -arch\ *) am__universal=true ;;
216189777a2SCristian Pallares     esac])
217189777a2SCristian Pallares
218189777a2SCristian Pallares  for depmode in $am_compiler_list; do
219189777a2SCristian Pallares    # Setup a source with many dependencies, because some compilers
220189777a2SCristian Pallares    # like to wrap large dependency lists on column 80 (with \), and
221189777a2SCristian Pallares    # we should not choose a depcomp mode which is confused by this.
222189777a2SCristian Pallares    #
223189777a2SCristian Pallares    # We need to recreate these files for each test, as the compiler may
224189777a2SCristian Pallares    # overwrite some of them when testing with obscure command lines.
225189777a2SCristian Pallares    # This happens at least with the AIX C compiler.
226189777a2SCristian Pallares    : > sub/conftest.c
227189777a2SCristian Pallares    for i in 1 2 3 4 5 6; do
228189777a2SCristian Pallares      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2291f13f311SSkyrpex      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2301f13f311SSkyrpex      # Solaris 10 /bin/sh.
2311f13f311SSkyrpex      echo '/* dummy */' > sub/conftst$i.h
232189777a2SCristian Pallares    done
233189777a2SCristian Pallares    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
234189777a2SCristian Pallares
2351f13f311SSkyrpex    # We check with '-c' and '-o' for the sake of the "dashmstdout"
236189777a2SCristian Pallares    # mode.  It turns out that the SunPro C++ compiler does not properly
2371f13f311SSkyrpex    # handle '-M -o', and we need to detect this.  Also, some Intel
2381f13f311SSkyrpex    # versions had trouble with output in subdirs.
239189777a2SCristian Pallares    am__obj=sub/conftest.${OBJEXT-o}
240189777a2SCristian Pallares    am__minus_obj="-o $am__obj"
241189777a2SCristian Pallares    case $depmode in
242189777a2SCristian Pallares    gcc)
243189777a2SCristian Pallares      # This depmode causes a compiler race in universal mode.
244189777a2SCristian Pallares      test "$am__universal" = false || continue
245189777a2SCristian Pallares      ;;
246189777a2SCristian Pallares    nosideeffect)
2471f13f311SSkyrpex      # After this tag, mechanisms are not by side-effect, so they'll
2481f13f311SSkyrpex      # only be used when explicitly requested.
249189777a2SCristian Pallares      if test "x$enable_dependency_tracking" = xyes; then
250189777a2SCristian Pallares	continue
251189777a2SCristian Pallares      else
252189777a2SCristian Pallares	break
253189777a2SCristian Pallares      fi
254189777a2SCristian Pallares      ;;
255189777a2SCristian Pallares    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2561f13f311SSkyrpex      # This compiler won't grok '-c -o', but also, the minuso test has
257189777a2SCristian Pallares      # not run yet.  These depmodes are late enough in the game, and
258189777a2SCristian Pallares      # so weak that their functioning should not be impacted.
259189777a2SCristian Pallares      am__obj=conftest.${OBJEXT-o}
260189777a2SCristian Pallares      am__minus_obj=
261189777a2SCristian Pallares      ;;
262189777a2SCristian Pallares    none) break ;;
263189777a2SCristian Pallares    esac
264189777a2SCristian Pallares    if depmode=$depmode \
265189777a2SCristian Pallares       source=sub/conftest.c object=$am__obj \
266189777a2SCristian Pallares       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
267189777a2SCristian Pallares       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
268189777a2SCristian Pallares         >/dev/null 2>conftest.err &&
269189777a2SCristian Pallares       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
270189777a2SCristian Pallares       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
271189777a2SCristian Pallares       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
272189777a2SCristian Pallares       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
273189777a2SCristian Pallares      # icc doesn't choke on unknown options, it will just issue warnings
274189777a2SCristian Pallares      # or remarks (even with -Werror).  So we grep stderr for any message
275189777a2SCristian Pallares      # that says an option was ignored or not supported.
276189777a2SCristian Pallares      # When given -MP, icc 7.0 and 7.1 complain thusly:
277189777a2SCristian Pallares      #   icc: Command line warning: ignoring option '-M'; no argument required
278189777a2SCristian Pallares      # The diagnosis changed in icc 8.0:
279189777a2SCristian Pallares      #   icc: Command line remark: option '-MP' not supported
280189777a2SCristian Pallares      if (grep 'ignoring option' conftest.err ||
281189777a2SCristian Pallares          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
282189777a2SCristian Pallares        am_cv_$1_dependencies_compiler_type=$depmode
283189777a2SCristian Pallares        break
284189777a2SCristian Pallares      fi
285189777a2SCristian Pallares    fi
286189777a2SCristian Pallares  done
287189777a2SCristian Pallares
288189777a2SCristian Pallares  cd ..
289189777a2SCristian Pallares  rm -rf conftest.dir
290189777a2SCristian Pallareselse
291189777a2SCristian Pallares  am_cv_$1_dependencies_compiler_type=none
292189777a2SCristian Pallaresfi
293189777a2SCristian Pallares])
294189777a2SCristian PallaresAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
295189777a2SCristian PallaresAM_CONDITIONAL([am__fastdep$1], [
296189777a2SCristian Pallares  test "x$enable_dependency_tracking" != xno \
297189777a2SCristian Pallares  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
298189777a2SCristian Pallares])
299189777a2SCristian Pallares
300189777a2SCristian Pallares
301189777a2SCristian Pallares# AM_SET_DEPDIR
302189777a2SCristian Pallares# -------------
303189777a2SCristian Pallares# Choose a directory name for dependency files.
3041f13f311SSkyrpex# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
305189777a2SCristian PallaresAC_DEFUN([AM_SET_DEPDIR],
306189777a2SCristian Pallares[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
307189777a2SCristian PallaresAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
308189777a2SCristian Pallares])
309189777a2SCristian Pallares
310189777a2SCristian Pallares
311189777a2SCristian Pallares# AM_DEP_TRACK
312189777a2SCristian Pallares# ------------
313189777a2SCristian PallaresAC_DEFUN([AM_DEP_TRACK],
3141f13f311SSkyrpex[AC_ARG_ENABLE([dependency-tracking], [dnl
3151f13f311SSkyrpexAS_HELP_STRING(
3161f13f311SSkyrpex  [--enable-dependency-tracking],
3171f13f311SSkyrpex  [do not reject slow dependency extractors])
3181f13f311SSkyrpexAS_HELP_STRING(
3191f13f311SSkyrpex  [--disable-dependency-tracking],
3201f13f311SSkyrpex  [speeds up one-time build])])
321189777a2SCristian Pallaresif test "x$enable_dependency_tracking" != xno; then
322189777a2SCristian Pallares  am_depcomp="$ac_aux_dir/depcomp"
323189777a2SCristian Pallares  AMDEPBACKSLASH='\'
324189777a2SCristian Pallares  am__nodep='_no'
325189777a2SCristian Pallaresfi
326189777a2SCristian PallaresAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
327189777a2SCristian PallaresAC_SUBST([AMDEPBACKSLASH])dnl
328189777a2SCristian Pallares_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
329189777a2SCristian PallaresAC_SUBST([am__nodep])dnl
330189777a2SCristian Pallares_AM_SUBST_NOTMAKE([am__nodep])dnl
331189777a2SCristian Pallares])
332189777a2SCristian Pallares
333189777a2SCristian Pallares# Generate code to set up dependency tracking.              -*- Autoconf -*-
334189777a2SCristian Pallares
335*275def9cSCristian Pallarés# Copyright (C) 1999-2014 Free Software Foundation, Inc.
336189777a2SCristian Pallares#
337189777a2SCristian Pallares# This file is free software; the Free Software Foundation
338189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
339189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
340189777a2SCristian Pallares
341189777a2SCristian Pallares
342189777a2SCristian Pallares# _AM_OUTPUT_DEPENDENCY_COMMANDS
343189777a2SCristian Pallares# ------------------------------
344189777a2SCristian PallaresAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
345189777a2SCristian Pallares[{
3461f13f311SSkyrpex  # Older Autoconf quotes --file arguments for eval, but not when files
347189777a2SCristian Pallares  # are listed without --file.  Let's play safe and only enable the eval
348189777a2SCristian Pallares  # if we detect the quoting.
349189777a2SCristian Pallares  case $CONFIG_FILES in
350189777a2SCristian Pallares  *\'*) eval set x "$CONFIG_FILES" ;;
351189777a2SCristian Pallares  *)   set x $CONFIG_FILES ;;
352189777a2SCristian Pallares  esac
353189777a2SCristian Pallares  shift
354189777a2SCristian Pallares  for mf
355189777a2SCristian Pallares  do
356189777a2SCristian Pallares    # Strip MF so we end up with the name of the file.
357189777a2SCristian Pallares    mf=`echo "$mf" | sed -e 's/:.*$//'`
358189777a2SCristian Pallares    # Check whether this is an Automake generated Makefile or not.
3591f13f311SSkyrpex    # We used to match only the files named 'Makefile.in', but
360189777a2SCristian Pallares    # some people rename them; so instead we look at the file content.
361189777a2SCristian Pallares    # Grep'ing the first line is not enough: some people post-process
362189777a2SCristian Pallares    # each Makefile.in and add a new line on top of each file to say so.
363189777a2SCristian Pallares    # Grep'ing the whole file is not good either: AIX grep has a line
364189777a2SCristian Pallares    # limit of 2048, but all sed's we know have understand at least 4000.
365189777a2SCristian Pallares    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
366189777a2SCristian Pallares      dirpart=`AS_DIRNAME("$mf")`
367189777a2SCristian Pallares    else
368189777a2SCristian Pallares      continue
369189777a2SCristian Pallares    fi
370189777a2SCristian Pallares    # Extract the definition of DEPDIR, am__include, and am__quote
3711f13f311SSkyrpex    # from the Makefile without running 'make'.
372189777a2SCristian Pallares    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
373189777a2SCristian Pallares    test -z "$DEPDIR" && continue
374189777a2SCristian Pallares    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3751f13f311SSkyrpex    test -z "$am__include" && continue
376189777a2SCristian Pallares    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
377189777a2SCristian Pallares    # Find all dependency output files, they are included files with
378189777a2SCristian Pallares    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379189777a2SCristian Pallares    # simplest approach to changing $(DEPDIR) to its actual value in the
380189777a2SCristian Pallares    # expansion.
381189777a2SCristian Pallares    for file in `sed -n "
382189777a2SCristian Pallares      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3831f13f311SSkyrpex	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
384189777a2SCristian Pallares      # Make sure the directory exists.
385189777a2SCristian Pallares      test -f "$dirpart/$file" && continue
386189777a2SCristian Pallares      fdir=`AS_DIRNAME(["$file"])`
387189777a2SCristian Pallares      AS_MKDIR_P([$dirpart/$fdir])
388189777a2SCristian Pallares      # echo "creating $dirpart/$file"
389189777a2SCristian Pallares      echo '# dummy' > "$dirpart/$file"
390189777a2SCristian Pallares    done
391189777a2SCristian Pallares  done
392189777a2SCristian Pallares}
393189777a2SCristian Pallares])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394189777a2SCristian Pallares
395189777a2SCristian Pallares
396189777a2SCristian Pallares# AM_OUTPUT_DEPENDENCY_COMMANDS
397189777a2SCristian Pallares# -----------------------------
398189777a2SCristian Pallares# This macro should only be invoked once -- use via AC_REQUIRE.
399189777a2SCristian Pallares#
400189777a2SCristian Pallares# This code is only required when automatic dependency tracking
4011f13f311SSkyrpex# is enabled.  FIXME.  This creates each '.P' file that we will
402189777a2SCristian Pallares# need in order to bootstrap the dependency handling code.
403189777a2SCristian PallaresAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404189777a2SCristian Pallares[AC_CONFIG_COMMANDS([depfiles],
405189777a2SCristian Pallares     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406189777a2SCristian Pallares     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407189777a2SCristian Pallares])
408189777a2SCristian Pallares
409189777a2SCristian Pallares# Do all the work for Automake.                             -*- Autoconf -*-
410189777a2SCristian Pallares
411*275def9cSCristian Pallarés# Copyright (C) 1996-2014 Free Software Foundation, Inc.
412189777a2SCristian Pallares#
413189777a2SCristian Pallares# This file is free software; the Free Software Foundation
414189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
415189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
416189777a2SCristian Pallares
417189777a2SCristian Pallares# This macro actually does too much.  Some checks are only needed if
418189777a2SCristian Pallares# your package does certain things.  But this isn't really a big deal.
419189777a2SCristian Pallares
4201f13f311SSkyrpexdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4211f13f311SSkyrpexm4_define([AC_PROG_CC],
4221f13f311SSkyrpexm4_defn([AC_PROG_CC])
4231f13f311SSkyrpex[_AM_PROG_CC_C_O
4241f13f311SSkyrpex])
4251f13f311SSkyrpex
426189777a2SCristian Pallares# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
427189777a2SCristian Pallares# AM_INIT_AUTOMAKE([OPTIONS])
428189777a2SCristian Pallares# -----------------------------------------------
429189777a2SCristian Pallares# The call with PACKAGE and VERSION arguments is the old style
430189777a2SCristian Pallares# call (pre autoconf-2.50), which is being phased out.  PACKAGE
431189777a2SCristian Pallares# and VERSION should now be passed to AC_INIT and removed from
432189777a2SCristian Pallares# the call to AM_INIT_AUTOMAKE.
433189777a2SCristian Pallares# We support both call styles for the transition.  After
434189777a2SCristian Pallares# the next Automake release, Autoconf can make the AC_INIT
435189777a2SCristian Pallares# arguments mandatory, and then we can depend on a new Autoconf
436189777a2SCristian Pallares# release and drop the old call support.
437189777a2SCristian PallaresAC_DEFUN([AM_INIT_AUTOMAKE],
4381f13f311SSkyrpex[AC_PREREQ([2.65])dnl
439189777a2SCristian Pallaresdnl Autoconf wants to disallow AM_ names.  We explicitly allow
440189777a2SCristian Pallaresdnl the ones we care about.
441189777a2SCristian Pallaresm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
442189777a2SCristian PallaresAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
443189777a2SCristian PallaresAC_REQUIRE([AC_PROG_INSTALL])dnl
444189777a2SCristian Pallaresif test "`cd $srcdir && pwd`" != "`pwd`"; then
445189777a2SCristian Pallares  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
446189777a2SCristian Pallares  # is not polluted with repeated "-I."
447189777a2SCristian Pallares  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
448189777a2SCristian Pallares  # test to see if srcdir already configured
449189777a2SCristian Pallares  if test -f $srcdir/config.status; then
450189777a2SCristian Pallares    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
451189777a2SCristian Pallares  fi
452189777a2SCristian Pallaresfi
453189777a2SCristian Pallares
454189777a2SCristian Pallares# test whether we have cygpath
455189777a2SCristian Pallaresif test -z "$CYGPATH_W"; then
456189777a2SCristian Pallares  if (cygpath --version) >/dev/null 2>/dev/null; then
457189777a2SCristian Pallares    CYGPATH_W='cygpath -w'
458189777a2SCristian Pallares  else
459189777a2SCristian Pallares    CYGPATH_W=echo
460189777a2SCristian Pallares  fi
461189777a2SCristian Pallaresfi
462189777a2SCristian PallaresAC_SUBST([CYGPATH_W])
463189777a2SCristian Pallares
464189777a2SCristian Pallares# Define the identity of the package.
465189777a2SCristian Pallaresdnl Distinguish between old-style and new-style calls.
466189777a2SCristian Pallaresm4_ifval([$2],
4671f13f311SSkyrpex[AC_DIAGNOSE([obsolete],
4681f13f311SSkyrpex             [$0: two- and three-arguments forms are deprecated.])
4691f13f311SSkyrpexm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
470189777a2SCristian Pallares AC_SUBST([PACKAGE], [$1])dnl
471189777a2SCristian Pallares AC_SUBST([VERSION], [$2])],
472189777a2SCristian Pallares[_AM_SET_OPTIONS([$1])dnl
473189777a2SCristian Pallaresdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4741f13f311SSkyrpexm4_if(
4751f13f311SSkyrpex  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
4761f13f311SSkyrpex  [ok:ok],,
477189777a2SCristian Pallares  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
478189777a2SCristian Pallares AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
479189777a2SCristian Pallares AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
480189777a2SCristian Pallares
481189777a2SCristian Pallares_AM_IF_OPTION([no-define],,
4821f13f311SSkyrpex[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4831f13f311SSkyrpex AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
484189777a2SCristian Pallares
485189777a2SCristian Pallares# Some tools Automake needs.
486189777a2SCristian PallaresAC_REQUIRE([AM_SANITY_CHECK])dnl
487189777a2SCristian PallaresAC_REQUIRE([AC_ARG_PROGRAM])dnl
4881f13f311SSkyrpexAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4891f13f311SSkyrpexAM_MISSING_PROG([AUTOCONF], [autoconf])
4901f13f311SSkyrpexAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4911f13f311SSkyrpexAM_MISSING_PROG([AUTOHEADER], [autoheader])
4921f13f311SSkyrpexAM_MISSING_PROG([MAKEINFO], [makeinfo])
493189777a2SCristian PallaresAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
494189777a2SCristian PallaresAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4951f13f311SSkyrpexAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4961f13f311SSkyrpex# For better backward compatibility.  To be removed once Automake 1.9.x
4971f13f311SSkyrpex# dies out for good.  For more background, see:
4981f13f311SSkyrpex# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4991f13f311SSkyrpex# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
5001f13f311SSkyrpexAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
501*275def9cSCristian Pallarés# We need awk for the "check" target (and possibly the TAP driver).  The
502*275def9cSCristian Pallarés# system "awk" is bad on some platforms.
503189777a2SCristian PallaresAC_REQUIRE([AC_PROG_AWK])dnl
504189777a2SCristian PallaresAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505189777a2SCristian PallaresAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506189777a2SCristian Pallares_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507189777a2SCristian Pallares	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508189777a2SCristian Pallares			     [_AM_PROG_TAR([v7])])])
509189777a2SCristian Pallares_AM_IF_OPTION([no-dependencies],,
510189777a2SCristian Pallares[AC_PROVIDE_IFELSE([AC_PROG_CC],
5111f13f311SSkyrpex		  [_AM_DEPENDENCIES([CC])],
5121f13f311SSkyrpex		  [m4_define([AC_PROG_CC],
5131f13f311SSkyrpex			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
514189777a2SCristian PallaresAC_PROVIDE_IFELSE([AC_PROG_CXX],
5151f13f311SSkyrpex		  [_AM_DEPENDENCIES([CXX])],
5161f13f311SSkyrpex		  [m4_define([AC_PROG_CXX],
5171f13f311SSkyrpex			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
518189777a2SCristian PallaresAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5191f13f311SSkyrpex		  [_AM_DEPENDENCIES([OBJC])],
5201f13f311SSkyrpex		  [m4_define([AC_PROG_OBJC],
5211f13f311SSkyrpex			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5221f13f311SSkyrpexAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5231f13f311SSkyrpex		  [_AM_DEPENDENCIES([OBJCXX])],
5241f13f311SSkyrpex		  [m4_define([AC_PROG_OBJCXX],
5251f13f311SSkyrpex			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
526189777a2SCristian Pallares])
5271f13f311SSkyrpexAC_REQUIRE([AM_SILENT_RULES])dnl
5281f13f311SSkyrpexdnl The testsuite driver may need to know about EXEEXT, so add the
5291f13f311SSkyrpexdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5301f13f311SSkyrpexdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
531189777a2SCristian PallaresAC_CONFIG_COMMANDS_PRE(dnl
532189777a2SCristian Pallares[m4_provide_if([_AM_COMPILER_EXEEXT],
533189777a2SCristian Pallares  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5341f13f311SSkyrpex
5351f13f311SSkyrpex# POSIX will say in a future version that running "rm -f" with no argument
5361f13f311SSkyrpex# is OK; and we want to be able to make that assumption in our Makefile
5371f13f311SSkyrpex# recipes.  So use an aggressive probe to check that the usage we want is
5381f13f311SSkyrpex# actually supported "in the wild" to an acceptable degree.
5391f13f311SSkyrpex# See automake bug#10828.
5401f13f311SSkyrpex# To make any issue more visible, cause the running configure to be aborted
5411f13f311SSkyrpex# by default if the 'rm' program in use doesn't match our expectations; the
5421f13f311SSkyrpex# user can still override this though.
5431f13f311SSkyrpexif rm -f && rm -fr && rm -rf; then : OK; else
5441f13f311SSkyrpex  cat >&2 <<'END'
5451f13f311SSkyrpexOops!
5461f13f311SSkyrpex
5471f13f311SSkyrpexYour 'rm' program seems unable to run without file operands specified
5481f13f311SSkyrpexon the command line, even when the '-f' option is present.  This is contrary
5491f13f311SSkyrpexto the behaviour of most rm programs out there, and not conforming with
5501f13f311SSkyrpexthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
5511f13f311SSkyrpex
5521f13f311SSkyrpexPlease tell [email protected] about your system, including the value
5531f13f311SSkyrpexof your $PATH and any error possibly output before this message.  This
5541f13f311SSkyrpexcan help us improve future automake versions.
5551f13f311SSkyrpex
5561f13f311SSkyrpexEND
5571f13f311SSkyrpex  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
5581f13f311SSkyrpex    echo 'Configuration will proceed anyway, since you have set the' >&2
5591f13f311SSkyrpex    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
5601f13f311SSkyrpex    echo >&2
5611f13f311SSkyrpex  else
5621f13f311SSkyrpex    cat >&2 <<'END'
5631f13f311SSkyrpexAborting the configuration process, to ensure you take notice of the issue.
5641f13f311SSkyrpex
5651f13f311SSkyrpexYou can download and install GNU coreutils to get an 'rm' implementation
5661f13f311SSkyrpexthat behaves properly: <http://www.gnu.org/software/coreutils/>.
5671f13f311SSkyrpex
5681f13f311SSkyrpexIf you want to complete the configuration process using your problematic
5691f13f311SSkyrpex'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
5701f13f311SSkyrpexto "yes", and re-run configure.
5711f13f311SSkyrpex
5721f13f311SSkyrpexEND
5731f13f311SSkyrpex    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
5741f13f311SSkyrpex  fi
5751f13f311SSkyrpexfi
576*275def9cSCristian Pallarésdnl The trailing newline in this macro's definition is deliberate, for
577*275def9cSCristian Pallarésdnl backward compatibility and to allow trailing 'dnl'-style comments
578*275def9cSCristian Pallarésdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
579189777a2SCristian Pallares])
580189777a2SCristian Pallares
5811f13f311SSkyrpexdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
582189777a2SCristian Pallaresdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
583189777a2SCristian Pallaresdnl mangled by Autoconf and run in a shell conditional statement.
584189777a2SCristian Pallaresm4_define([_AC_COMPILER_EXEEXT],
585189777a2SCristian Pallaresm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
586189777a2SCristian Pallares
587189777a2SCristian Pallares# When config.status generates a header, we must update the stamp-h file.
588189777a2SCristian Pallares# This file resides in the same directory as the config header
589189777a2SCristian Pallares# that is generated.  The stamp files are numbered to have different names.
590189777a2SCristian Pallares
591189777a2SCristian Pallares# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
592189777a2SCristian Pallares# loop where config.status creates the headers, so we can generate
593189777a2SCristian Pallares# our stamp files there.
594189777a2SCristian PallaresAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
595189777a2SCristian Pallares[# Compute $1's index in $config_headers.
596189777a2SCristian Pallares_am_arg=$1
597189777a2SCristian Pallares_am_stamp_count=1
598189777a2SCristian Pallaresfor _am_header in $config_headers :; do
599189777a2SCristian Pallares  case $_am_header in
600189777a2SCristian Pallares    $_am_arg | $_am_arg:* )
601189777a2SCristian Pallares      break ;;
602189777a2SCristian Pallares    * )
603189777a2SCristian Pallares      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
604189777a2SCristian Pallares  esac
605189777a2SCristian Pallaresdone
606189777a2SCristian Pallaresecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
607189777a2SCristian Pallares
608*275def9cSCristian Pallarés# Copyright (C) 2001-2014 Free Software Foundation, Inc.
609189777a2SCristian Pallares#
610189777a2SCristian Pallares# This file is free software; the Free Software Foundation
611189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
612189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
613189777a2SCristian Pallares
614189777a2SCristian Pallares# AM_PROG_INSTALL_SH
615189777a2SCristian Pallares# ------------------
616189777a2SCristian Pallares# Define $install_sh.
617189777a2SCristian PallaresAC_DEFUN([AM_PROG_INSTALL_SH],
618189777a2SCristian Pallares[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
619*275def9cSCristian Pallarésif test x"${install_sh+set}" != xset; then
620189777a2SCristian Pallares  case $am_aux_dir in
621189777a2SCristian Pallares  *\ * | *\	*)
622189777a2SCristian Pallares    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
623189777a2SCristian Pallares  *)
624189777a2SCristian Pallares    install_sh="\${SHELL} $am_aux_dir/install-sh"
625189777a2SCristian Pallares  esac
626189777a2SCristian Pallaresfi
6271f13f311SSkyrpexAC_SUBST([install_sh])])
628189777a2SCristian Pallares
629*275def9cSCristian Pallarés# Copyright (C) 2003-2014 Free Software Foundation, Inc.
630189777a2SCristian Pallares#
631189777a2SCristian Pallares# This file is free software; the Free Software Foundation
632189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
633189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
634189777a2SCristian Pallares
635189777a2SCristian Pallares# Check whether the underlying file-system supports filenames
636189777a2SCristian Pallares# with a leading dot.  For instance MS-DOS doesn't.
637189777a2SCristian PallaresAC_DEFUN([AM_SET_LEADING_DOT],
638189777a2SCristian Pallares[rm -rf .tst 2>/dev/null
639189777a2SCristian Pallaresmkdir .tst 2>/dev/null
640189777a2SCristian Pallaresif test -d .tst; then
641189777a2SCristian Pallares  am__leading_dot=.
642189777a2SCristian Pallareselse
643189777a2SCristian Pallares  am__leading_dot=_
644189777a2SCristian Pallaresfi
645189777a2SCristian Pallaresrmdir .tst 2>/dev/null
646189777a2SCristian PallaresAC_SUBST([am__leading_dot])])
647189777a2SCristian Pallares
648189777a2SCristian Pallares# Check to see how 'make' treats includes.	            -*- Autoconf -*-
649189777a2SCristian Pallares
650*275def9cSCristian Pallarés# Copyright (C) 2001-2014 Free Software Foundation, Inc.
651189777a2SCristian Pallares#
652189777a2SCristian Pallares# This file is free software; the Free Software Foundation
653189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
654189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
655189777a2SCristian Pallares
656189777a2SCristian Pallares# AM_MAKE_INCLUDE()
657189777a2SCristian Pallares# -----------------
658189777a2SCristian Pallares# Check to see how make treats includes.
659189777a2SCristian PallaresAC_DEFUN([AM_MAKE_INCLUDE],
660189777a2SCristian Pallares[am_make=${MAKE-make}
661189777a2SCristian Pallarescat > confinc << 'END'
662189777a2SCristian Pallaresam__doit:
663189777a2SCristian Pallares	@echo this is the am__doit target
664189777a2SCristian Pallares.PHONY: am__doit
665189777a2SCristian PallaresEND
666189777a2SCristian Pallares# If we don't find an include directive, just comment out the code.
667189777a2SCristian PallaresAC_MSG_CHECKING([for style of include used by $am_make])
668189777a2SCristian Pallaresam__include="#"
669189777a2SCristian Pallaresam__quote=
670189777a2SCristian Pallares_am_result=none
671189777a2SCristian Pallares# First try GNU make style include.
672189777a2SCristian Pallaresecho "include confinc" > confmf
6731f13f311SSkyrpex# Ignore all kinds of additional output from 'make'.
674189777a2SCristian Pallarescase `$am_make -s -f confmf 2> /dev/null` in #(
675189777a2SCristian Pallares*the\ am__doit\ target*)
676189777a2SCristian Pallares  am__include=include
677189777a2SCristian Pallares  am__quote=
678189777a2SCristian Pallares  _am_result=GNU
679189777a2SCristian Pallares  ;;
680189777a2SCristian Pallaresesac
681189777a2SCristian Pallares# Now try BSD make style include.
682189777a2SCristian Pallaresif test "$am__include" = "#"; then
683189777a2SCristian Pallares   echo '.include "confinc"' > confmf
684189777a2SCristian Pallares   case `$am_make -s -f confmf 2> /dev/null` in #(
685189777a2SCristian Pallares   *the\ am__doit\ target*)
686189777a2SCristian Pallares     am__include=.include
687189777a2SCristian Pallares     am__quote="\""
688189777a2SCristian Pallares     _am_result=BSD
689189777a2SCristian Pallares     ;;
690189777a2SCristian Pallares   esac
691189777a2SCristian Pallaresfi
692189777a2SCristian PallaresAC_SUBST([am__include])
693189777a2SCristian PallaresAC_SUBST([am__quote])
694189777a2SCristian PallaresAC_MSG_RESULT([$_am_result])
695189777a2SCristian Pallaresrm -f confinc confmf
696189777a2SCristian Pallares])
697189777a2SCristian Pallares
698189777a2SCristian Pallares# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
699189777a2SCristian Pallares
700*275def9cSCristian Pallarés# Copyright (C) 1997-2014 Free Software Foundation, Inc.
701189777a2SCristian Pallares#
702189777a2SCristian Pallares# This file is free software; the Free Software Foundation
703189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
704189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
705189777a2SCristian Pallares
706189777a2SCristian Pallares# AM_MISSING_PROG(NAME, PROGRAM)
707189777a2SCristian Pallares# ------------------------------
708189777a2SCristian PallaresAC_DEFUN([AM_MISSING_PROG],
709189777a2SCristian Pallares[AC_REQUIRE([AM_MISSING_HAS_RUN])
710189777a2SCristian Pallares$1=${$1-"${am_missing_run}$2"}
711189777a2SCristian PallaresAC_SUBST($1)])
712189777a2SCristian Pallares
713189777a2SCristian Pallares# AM_MISSING_HAS_RUN
714189777a2SCristian Pallares# ------------------
7151f13f311SSkyrpex# Define MISSING if not defined so far and test if it is modern enough.
7161f13f311SSkyrpex# If it is, set am_missing_run to use it, otherwise, to nothing.
717189777a2SCristian PallaresAC_DEFUN([AM_MISSING_HAS_RUN],
718189777a2SCristian Pallares[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719189777a2SCristian PallaresAC_REQUIRE_AUX_FILE([missing])dnl
720189777a2SCristian Pallaresif test x"${MISSING+set}" != xset; then
721189777a2SCristian Pallares  case $am_aux_dir in
722189777a2SCristian Pallares  *\ * | *\	*)
723189777a2SCristian Pallares    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724189777a2SCristian Pallares  *)
725189777a2SCristian Pallares    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726189777a2SCristian Pallares  esac
727189777a2SCristian Pallaresfi
728189777a2SCristian Pallares# Use eval to expand $SHELL
7291f13f311SSkyrpexif eval "$MISSING --is-lightweight"; then
7301f13f311SSkyrpex  am_missing_run="$MISSING "
731189777a2SCristian Pallareselse
732189777a2SCristian Pallares  am_missing_run=
7331f13f311SSkyrpex  AC_MSG_WARN(['missing' script is too old or missing])
734189777a2SCristian Pallaresfi
735189777a2SCristian Pallares])
736189777a2SCristian Pallares
737189777a2SCristian Pallares# Helper functions for option handling.                     -*- Autoconf -*-
738189777a2SCristian Pallares
739*275def9cSCristian Pallarés# Copyright (C) 2001-2014 Free Software Foundation, Inc.
740189777a2SCristian Pallares#
741189777a2SCristian Pallares# This file is free software; the Free Software Foundation
742189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
743189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
744189777a2SCristian Pallares
745189777a2SCristian Pallares# _AM_MANGLE_OPTION(NAME)
746189777a2SCristian Pallares# -----------------------
747189777a2SCristian PallaresAC_DEFUN([_AM_MANGLE_OPTION],
748189777a2SCristian Pallares[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
749189777a2SCristian Pallares
750189777a2SCristian Pallares# _AM_SET_OPTION(NAME)
751189777a2SCristian Pallares# --------------------
752189777a2SCristian Pallares# Set option NAME.  Presently that only means defining a flag for this option.
753189777a2SCristian PallaresAC_DEFUN([_AM_SET_OPTION],
7541f13f311SSkyrpex[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
755189777a2SCristian Pallares
756189777a2SCristian Pallares# _AM_SET_OPTIONS(OPTIONS)
757189777a2SCristian Pallares# ------------------------
758189777a2SCristian Pallares# OPTIONS is a space-separated list of Automake options.
759189777a2SCristian PallaresAC_DEFUN([_AM_SET_OPTIONS],
760189777a2SCristian Pallares[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
761189777a2SCristian Pallares
762189777a2SCristian Pallares# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
763189777a2SCristian Pallares# -------------------------------------------
764189777a2SCristian Pallares# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
765189777a2SCristian PallaresAC_DEFUN([_AM_IF_OPTION],
766189777a2SCristian Pallares[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
767189777a2SCristian Pallares
768*275def9cSCristian Pallarés# Copyright (C) 1999-2014 Free Software Foundation, Inc.
769189777a2SCristian Pallares#
770189777a2SCristian Pallares# This file is free software; the Free Software Foundation
771189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
772189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
773189777a2SCristian Pallares
7741f13f311SSkyrpex# _AM_PROG_CC_C_O
7751f13f311SSkyrpex# ---------------
7761f13f311SSkyrpex# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
7771f13f311SSkyrpex# to automatically call this.
7781f13f311SSkyrpexAC_DEFUN([_AM_PROG_CC_C_O],
7791f13f311SSkyrpex[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7801f13f311SSkyrpexAC_REQUIRE_AUX_FILE([compile])dnl
7811f13f311SSkyrpexAC_LANG_PUSH([C])dnl
7821f13f311SSkyrpexAC_CACHE_CHECK(
7831f13f311SSkyrpex  [whether $CC understands -c and -o together],
7841f13f311SSkyrpex  [am_cv_prog_cc_c_o],
7851f13f311SSkyrpex  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
7861f13f311SSkyrpex  # Make sure it works both with $CC and with simple cc.
7871f13f311SSkyrpex  # Following AC_PROG_CC_C_O, we do the test twice because some
7881f13f311SSkyrpex  # compilers refuse to overwrite an existing .o file with -o,
7891f13f311SSkyrpex  # though they will create one.
7901f13f311SSkyrpex  am_cv_prog_cc_c_o=yes
7911f13f311SSkyrpex  for am_i in 1 2; do
7921f13f311SSkyrpex    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
7931f13f311SSkyrpex         && test -f conftest2.$ac_objext; then
7941f13f311SSkyrpex      : OK
7951f13f311SSkyrpex    else
7961f13f311SSkyrpex      am_cv_prog_cc_c_o=no
7971f13f311SSkyrpex      break
7981f13f311SSkyrpex    fi
7991f13f311SSkyrpex  done
8001f13f311SSkyrpex  rm -f core conftest*
8011f13f311SSkyrpex  unset am_i])
8021f13f311SSkyrpexif test "$am_cv_prog_cc_c_o" != yes; then
8031f13f311SSkyrpex   # Losing compiler, so override with the script.
8041f13f311SSkyrpex   # FIXME: It is wrong to rewrite CC.
8051f13f311SSkyrpex   # But if we don't then we get into trouble of one sort or another.
8061f13f311SSkyrpex   # A longer-term fix would be to have automake use am__CC in this case,
8071f13f311SSkyrpex   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
8081f13f311SSkyrpex   CC="$am_aux_dir/compile $CC"
8091f13f311SSkyrpexfi
8101f13f311SSkyrpexAC_LANG_POP([C])])
8111f13f311SSkyrpex
8121f13f311SSkyrpex# For backward compatibility.
8131f13f311SSkyrpexAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
8141f13f311SSkyrpex
815*275def9cSCristian Pallarés# Copyright (C) 2001-2014 Free Software Foundation, Inc.
8161f13f311SSkyrpex#
8171f13f311SSkyrpex# This file is free software; the Free Software Foundation
8181f13f311SSkyrpex# gives unlimited permission to copy and/or distribute it,
8191f13f311SSkyrpex# with or without modifications, as long as this notice is preserved.
8201f13f311SSkyrpex
8211f13f311SSkyrpex# AM_RUN_LOG(COMMAND)
8221f13f311SSkyrpex# -------------------
8231f13f311SSkyrpex# Run COMMAND, save the exit status in ac_status, and log it.
8241f13f311SSkyrpex# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
8251f13f311SSkyrpexAC_DEFUN([AM_RUN_LOG],
8261f13f311SSkyrpex[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
8271f13f311SSkyrpex   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
8281f13f311SSkyrpex   ac_status=$?
8291f13f311SSkyrpex   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
8301f13f311SSkyrpex   (exit $ac_status); }])
8311f13f311SSkyrpex
8321f13f311SSkyrpex# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8331f13f311SSkyrpex
834*275def9cSCristian Pallarés# Copyright (C) 1996-2014 Free Software Foundation, Inc.
8351f13f311SSkyrpex#
8361f13f311SSkyrpex# This file is free software; the Free Software Foundation
8371f13f311SSkyrpex# gives unlimited permission to copy and/or distribute it,
8381f13f311SSkyrpex# with or without modifications, as long as this notice is preserved.
839189777a2SCristian Pallares
840189777a2SCristian Pallares# AM_SANITY_CHECK
841189777a2SCristian Pallares# ---------------
842189777a2SCristian PallaresAC_DEFUN([AM_SANITY_CHECK],
843189777a2SCristian Pallares[AC_MSG_CHECKING([whether build environment is sane])
844189777a2SCristian Pallares# Reject unsafe characters in $srcdir or the absolute working directory
845189777a2SCristian Pallares# name.  Accept space and tab only in the latter.
846189777a2SCristian Pallaresam_lf='
847189777a2SCristian Pallares'
848189777a2SCristian Pallarescase `pwd` in
849189777a2SCristian Pallares  *[[\\\"\#\$\&\'\`$am_lf]]*)
850189777a2SCristian Pallares    AC_MSG_ERROR([unsafe absolute working directory name]);;
851189777a2SCristian Pallaresesac
852189777a2SCristian Pallarescase $srcdir in
853189777a2SCristian Pallares  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8541f13f311SSkyrpex    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
855189777a2SCristian Pallaresesac
856189777a2SCristian Pallares
8571f13f311SSkyrpex# Do 'set' in a subshell so we don't clobber the current shell's
858189777a2SCristian Pallares# arguments.  Must try -L first in case configure is actually a
859189777a2SCristian Pallares# symlink; some systems play weird games with the mod time of symlinks
860189777a2SCristian Pallares# (eg FreeBSD returns the mod time of the symlink's containing
861189777a2SCristian Pallares# directory).
862189777a2SCristian Pallaresif (
8631f13f311SSkyrpex   am_has_slept=no
8641f13f311SSkyrpex   for am_try in 1 2; do
8651f13f311SSkyrpex     echo "timestamp, slept: $am_has_slept" > conftest.file
866189777a2SCristian Pallares     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
867189777a2SCristian Pallares     if test "$[*]" = "X"; then
868189777a2SCristian Pallares	# -L didn't work.
869189777a2SCristian Pallares	set X `ls -t "$srcdir/configure" conftest.file`
870189777a2SCristian Pallares     fi
871189777a2SCristian Pallares     if test "$[*]" != "X $srcdir/configure conftest.file" \
872189777a2SCristian Pallares	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
873189777a2SCristian Pallares
874189777a2SCristian Pallares	# If neither matched, then we have a broken ls.  This can happen
875189777a2SCristian Pallares	# if, for instance, CONFIG_SHELL is bash and it inherits a
876189777a2SCristian Pallares	# broken ls alias from the environment.  This has actually
877189777a2SCristian Pallares	# happened.  Such a system could not be considered "sane".
878189777a2SCristian Pallares	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
879189777a2SCristian Pallares  alias in your environment])
880189777a2SCristian Pallares     fi
8811f13f311SSkyrpex     if test "$[2]" = conftest.file || test $am_try -eq 2; then
8821f13f311SSkyrpex       break
8831f13f311SSkyrpex     fi
8841f13f311SSkyrpex     # Just in case.
8851f13f311SSkyrpex     sleep 1
8861f13f311SSkyrpex     am_has_slept=yes
8871f13f311SSkyrpex   done
888189777a2SCristian Pallares   test "$[2]" = conftest.file
889189777a2SCristian Pallares   )
890189777a2SCristian Pallaresthen
891189777a2SCristian Pallares   # Ok.
892189777a2SCristian Pallares   :
893189777a2SCristian Pallareselse
894189777a2SCristian Pallares   AC_MSG_ERROR([newly created file is older than distributed files!
895189777a2SCristian PallaresCheck your system clock])
896189777a2SCristian Pallaresfi
8971f13f311SSkyrpexAC_MSG_RESULT([yes])
8981f13f311SSkyrpex# If we didn't sleep, we still need to ensure time stamps of config.status and
8991f13f311SSkyrpex# generated files are strictly newer.
9001f13f311SSkyrpexam_sleep_pid=
9011f13f311SSkyrpexif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9021f13f311SSkyrpex  ( sleep 1 ) &
9031f13f311SSkyrpex  am_sleep_pid=$!
9041f13f311SSkyrpexfi
9051f13f311SSkyrpexAC_CONFIG_COMMANDS_PRE(
9061f13f311SSkyrpex  [AC_MSG_CHECKING([that generated files are newer than configure])
9071f13f311SSkyrpex   if test -n "$am_sleep_pid"; then
9081f13f311SSkyrpex     # Hide warnings about reused PIDs.
9091f13f311SSkyrpex     wait $am_sleep_pid 2>/dev/null
9101f13f311SSkyrpex   fi
9111f13f311SSkyrpex   AC_MSG_RESULT([done])])
9121f13f311SSkyrpexrm -f conftest.file
9131f13f311SSkyrpex])
914189777a2SCristian Pallares
915*275def9cSCristian Pallarés# Copyright (C) 2009-2014 Free Software Foundation, Inc.
916189777a2SCristian Pallares#
917189777a2SCristian Pallares# This file is free software; the Free Software Foundation
918189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
919189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
920189777a2SCristian Pallares
9211f13f311SSkyrpex# AM_SILENT_RULES([DEFAULT])
9221f13f311SSkyrpex# --------------------------
9231f13f311SSkyrpex# Enable less verbose build rules; with the default set to DEFAULT
9241f13f311SSkyrpex# ("yes" being less verbose, "no" or empty being verbose).
9251f13f311SSkyrpexAC_DEFUN([AM_SILENT_RULES],
9261f13f311SSkyrpex[AC_ARG_ENABLE([silent-rules], [dnl
9271f13f311SSkyrpexAS_HELP_STRING(
9281f13f311SSkyrpex  [--enable-silent-rules],
9291f13f311SSkyrpex  [less verbose build output (undo: "make V=1")])
9301f13f311SSkyrpexAS_HELP_STRING(
9311f13f311SSkyrpex  [--disable-silent-rules],
9321f13f311SSkyrpex  [verbose build output (undo: "make V=0")])dnl
9331f13f311SSkyrpex])
9341f13f311SSkyrpexcase $enable_silent_rules in @%:@ (((
9351f13f311SSkyrpex  yes) AM_DEFAULT_VERBOSITY=0;;
9361f13f311SSkyrpex   no) AM_DEFAULT_VERBOSITY=1;;
9371f13f311SSkyrpex    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9381f13f311SSkyrpexesac
9391f13f311SSkyrpexdnl
9401f13f311SSkyrpexdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9411f13f311SSkyrpexdnl do not support nested variable expansions.
9421f13f311SSkyrpexdnl See automake bug#9928 and bug#10237.
9431f13f311SSkyrpexam_make=${MAKE-make}
9441f13f311SSkyrpexAC_CACHE_CHECK([whether $am_make supports nested variables],
9451f13f311SSkyrpex   [am_cv_make_support_nested_variables],
9461f13f311SSkyrpex   [if AS_ECHO([['TRUE=$(BAR$(V))
9471f13f311SSkyrpexBAR0=false
9481f13f311SSkyrpexBAR1=true
9491f13f311SSkyrpexV=1
9501f13f311SSkyrpexam__doit:
9511f13f311SSkyrpex	@$(TRUE)
9521f13f311SSkyrpex.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9531f13f311SSkyrpex  am_cv_make_support_nested_variables=yes
9541f13f311SSkyrpexelse
9551f13f311SSkyrpex  am_cv_make_support_nested_variables=no
9561f13f311SSkyrpexfi])
9571f13f311SSkyrpexif test $am_cv_make_support_nested_variables = yes; then
9581f13f311SSkyrpex  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9591f13f311SSkyrpex  AM_V='$(V)'
9601f13f311SSkyrpex  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9611f13f311SSkyrpexelse
9621f13f311SSkyrpex  AM_V=$AM_DEFAULT_VERBOSITY
9631f13f311SSkyrpex  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9641f13f311SSkyrpexfi
9651f13f311SSkyrpexAC_SUBST([AM_V])dnl
9661f13f311SSkyrpexAM_SUBST_NOTMAKE([AM_V])dnl
9671f13f311SSkyrpexAC_SUBST([AM_DEFAULT_V])dnl
9681f13f311SSkyrpexAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
9691f13f311SSkyrpexAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9701f13f311SSkyrpexAM_BACKSLASH='\'
9711f13f311SSkyrpexAC_SUBST([AM_BACKSLASH])dnl
9721f13f311SSkyrpex_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9731f13f311SSkyrpex])
9741f13f311SSkyrpex
975*275def9cSCristian Pallarés# Copyright (C) 2001-2014 Free Software Foundation, Inc.
9761f13f311SSkyrpex#
9771f13f311SSkyrpex# This file is free software; the Free Software Foundation
9781f13f311SSkyrpex# gives unlimited permission to copy and/or distribute it,
9791f13f311SSkyrpex# with or without modifications, as long as this notice is preserved.
980189777a2SCristian Pallares
981189777a2SCristian Pallares# AM_PROG_INSTALL_STRIP
982189777a2SCristian Pallares# ---------------------
9831f13f311SSkyrpex# One issue with vendor 'install' (even GNU) is that you can't
984189777a2SCristian Pallares# specify the program used to strip binaries.  This is especially
985189777a2SCristian Pallares# annoying in cross-compiling environments, where the build's strip
986189777a2SCristian Pallares# is unlikely to handle the host's binaries.
987189777a2SCristian Pallares# Fortunately install-sh will honor a STRIPPROG variable, so we
9881f13f311SSkyrpex# always use install-sh in "make install-strip", and initialize
989189777a2SCristian Pallares# STRIPPROG with the value of the STRIP variable (set by the user).
990189777a2SCristian PallaresAC_DEFUN([AM_PROG_INSTALL_STRIP],
991189777a2SCristian Pallares[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9921f13f311SSkyrpex# Installed binaries are usually stripped using 'strip' when the user
9931f13f311SSkyrpex# run "make install-strip".  However 'strip' might not be the right
994189777a2SCristian Pallares# tool to use in cross-compilation environments, therefore Automake
9951f13f311SSkyrpex# will honor the 'STRIP' environment variable to overrule this program.
9961f13f311SSkyrpexdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
997189777a2SCristian Pallaresif test "$cross_compiling" != no; then
998189777a2SCristian Pallares  AC_CHECK_TOOL([STRIP], [strip], :)
999189777a2SCristian Pallaresfi
1000189777a2SCristian PallaresINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1001189777a2SCristian PallaresAC_SUBST([INSTALL_STRIP_PROGRAM])])
1002189777a2SCristian Pallares
1003*275def9cSCristian Pallarés# Copyright (C) 2006-2014 Free Software Foundation, Inc.
1004189777a2SCristian Pallares#
1005189777a2SCristian Pallares# This file is free software; the Free Software Foundation
1006189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
1007189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
1008189777a2SCristian Pallares
1009189777a2SCristian Pallares# _AM_SUBST_NOTMAKE(VARIABLE)
1010189777a2SCristian Pallares# ---------------------------
1011189777a2SCristian Pallares# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1012189777a2SCristian Pallares# This macro is traced by Automake.
1013189777a2SCristian PallaresAC_DEFUN([_AM_SUBST_NOTMAKE])
1014189777a2SCristian Pallares
1015189777a2SCristian Pallares# AM_SUBST_NOTMAKE(VARIABLE)
1016189777a2SCristian Pallares# --------------------------
1017189777a2SCristian Pallares# Public sister of _AM_SUBST_NOTMAKE.
1018189777a2SCristian PallaresAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1019189777a2SCristian Pallares
1020189777a2SCristian Pallares# Check how to create a tarball.                            -*- Autoconf -*-
1021189777a2SCristian Pallares
1022*275def9cSCristian Pallarés# Copyright (C) 2004-2014 Free Software Foundation, Inc.
1023189777a2SCristian Pallares#
1024189777a2SCristian Pallares# This file is free software; the Free Software Foundation
1025189777a2SCristian Pallares# gives unlimited permission to copy and/or distribute it,
1026189777a2SCristian Pallares# with or without modifications, as long as this notice is preserved.
1027189777a2SCristian Pallares
1028189777a2SCristian Pallares# _AM_PROG_TAR(FORMAT)
1029189777a2SCristian Pallares# --------------------
1030189777a2SCristian Pallares# Check how to create a tarball in format FORMAT.
10311f13f311SSkyrpex# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1032189777a2SCristian Pallares#
1033189777a2SCristian Pallares# Substitute a variable $(am__tar) that is a command
1034189777a2SCristian Pallares# writing to stdout a FORMAT-tarball containing the directory
1035189777a2SCristian Pallares# $tardir.
1036189777a2SCristian Pallares#     tardir=directory && $(am__tar) > result.tar
1037189777a2SCristian Pallares#
1038189777a2SCristian Pallares# Substitute a variable $(am__untar) that extract such
1039189777a2SCristian Pallares# a tarball read from stdin.
1040189777a2SCristian Pallares#     $(am__untar) < result.tar
10411f13f311SSkyrpex#
1042189777a2SCristian PallaresAC_DEFUN([_AM_PROG_TAR],
1043189777a2SCristian Pallares[# Always define AMTAR for backward compatibility.  Yes, it's still used
1044189777a2SCristian Pallares# in the wild :-(  We should find a proper way to deprecate it ...
1045189777a2SCristian PallaresAC_SUBST([AMTAR], ['$${TAR-tar}'])
10461f13f311SSkyrpex
10471f13f311SSkyrpex# We'll loop over all known methods to create a tar archive until one works.
10481f13f311SSkyrpex_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10491f13f311SSkyrpex
1050189777a2SCristian Pallaresm4_if([$1], [v7],
1051189777a2SCristian Pallares  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10521f13f311SSkyrpex
10531f13f311SSkyrpex  [m4_case([$1],
10541f13f311SSkyrpex    [ustar],
10551f13f311SSkyrpex     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
10561f13f311SSkyrpex      # There is notably a 21 bits limit for the UID and the GID.  In fact,
10571f13f311SSkyrpex      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
10581f13f311SSkyrpex      # and bug#13588).
10591f13f311SSkyrpex      am_max_uid=2097151 # 2^21 - 1
10601f13f311SSkyrpex      am_max_gid=$am_max_uid
10611f13f311SSkyrpex      # The $UID and $GID variables are not portable, so we need to resort
10621f13f311SSkyrpex      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
10631f13f311SSkyrpex      # below are definitely unexpected, so allow the users to see them
10641f13f311SSkyrpex      # (that is, avoid stderr redirection).
10651f13f311SSkyrpex      am_uid=`id -u || echo unknown`
10661f13f311SSkyrpex      am_gid=`id -g || echo unknown`
10671f13f311SSkyrpex      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
10681f13f311SSkyrpex      if test $am_uid -le $am_max_uid; then
10691f13f311SSkyrpex         AC_MSG_RESULT([yes])
10701f13f311SSkyrpex      else
10711f13f311SSkyrpex         AC_MSG_RESULT([no])
10721f13f311SSkyrpex         _am_tools=none
10731f13f311SSkyrpex      fi
10741f13f311SSkyrpex      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
10751f13f311SSkyrpex      if test $am_gid -le $am_max_gid; then
10761f13f311SSkyrpex         AC_MSG_RESULT([yes])
10771f13f311SSkyrpex      else
10781f13f311SSkyrpex        AC_MSG_RESULT([no])
10791f13f311SSkyrpex        _am_tools=none
10801f13f311SSkyrpex      fi],
10811f13f311SSkyrpex
10821f13f311SSkyrpex  [pax],
10831f13f311SSkyrpex    [],
10841f13f311SSkyrpex
1085189777a2SCristian Pallares  [m4_fatal([Unknown tar format])])
10861f13f311SSkyrpex
1087189777a2SCristian Pallares  AC_MSG_CHECKING([how to create a $1 tar archive])
10881f13f311SSkyrpex
10891f13f311SSkyrpex  # Go ahead even if we have the value already cached.  We do so because we
10901f13f311SSkyrpex  # need to set the values for the 'am__tar' and 'am__untar' variables.
1091189777a2SCristian Pallares  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
10921f13f311SSkyrpex
10931f13f311SSkyrpex  for _am_tool in $_am_tools; do
1094189777a2SCristian Pallares    case $_am_tool in
1095189777a2SCristian Pallares    gnutar)
10961f13f311SSkyrpex      for _am_tar in tar gnutar gtar; do
1097189777a2SCristian Pallares        AM_RUN_LOG([$_am_tar --version]) && break
1098189777a2SCristian Pallares      done
1099189777a2SCristian Pallares      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1100189777a2SCristian Pallares      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1101189777a2SCristian Pallares      am__untar="$_am_tar -xf -"
1102189777a2SCristian Pallares      ;;
1103189777a2SCristian Pallares    plaintar)
1104189777a2SCristian Pallares      # Must skip GNU tar: if it does not support --format= it doesn't create
1105189777a2SCristian Pallares      # ustar tarball either.
1106189777a2SCristian Pallares      (tar --version) >/dev/null 2>&1 && continue
1107189777a2SCristian Pallares      am__tar='tar chf - "$$tardir"'
1108189777a2SCristian Pallares      am__tar_='tar chf - "$tardir"'
1109189777a2SCristian Pallares      am__untar='tar xf -'
1110189777a2SCristian Pallares      ;;
1111189777a2SCristian Pallares    pax)
1112189777a2SCristian Pallares      am__tar='pax -L -x $1 -w "$$tardir"'
1113189777a2SCristian Pallares      am__tar_='pax -L -x $1 -w "$tardir"'
1114189777a2SCristian Pallares      am__untar='pax -r'
1115189777a2SCristian Pallares      ;;
1116189777a2SCristian Pallares    cpio)
1117189777a2SCristian Pallares      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1118189777a2SCristian Pallares      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1119189777a2SCristian Pallares      am__untar='cpio -i -H $1 -d'
1120189777a2SCristian Pallares      ;;
1121189777a2SCristian Pallares    none)
1122189777a2SCristian Pallares      am__tar=false
1123189777a2SCristian Pallares      am__tar_=false
1124189777a2SCristian Pallares      am__untar=false
1125189777a2SCristian Pallares      ;;
1126189777a2SCristian Pallares    esac
1127189777a2SCristian Pallares
1128189777a2SCristian Pallares    # If the value was cached, stop now.  We just wanted to have am__tar
1129189777a2SCristian Pallares    # and am__untar set.
1130189777a2SCristian Pallares    test -n "${am_cv_prog_tar_$1}" && break
1131189777a2SCristian Pallares
11321f13f311SSkyrpex    # tar/untar a dummy directory, and stop if the command works.
1133189777a2SCristian Pallares    rm -rf conftest.dir
1134189777a2SCristian Pallares    mkdir conftest.dir
1135189777a2SCristian Pallares    echo GrepMe > conftest.dir/file
1136189777a2SCristian Pallares    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1137189777a2SCristian Pallares    rm -rf conftest.dir
1138189777a2SCristian Pallares    if test -s conftest.tar; then
1139189777a2SCristian Pallares      AM_RUN_LOG([$am__untar <conftest.tar])
11401f13f311SSkyrpex      AM_RUN_LOG([cat conftest.dir/file])
1141189777a2SCristian Pallares      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1142189777a2SCristian Pallares    fi
1143189777a2SCristian Pallares  done
1144189777a2SCristian Pallares  rm -rf conftest.dir
1145189777a2SCristian Pallares
1146189777a2SCristian Pallares  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1147189777a2SCristian Pallares  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
11481f13f311SSkyrpex
1149189777a2SCristian PallaresAC_SUBST([am__tar])
1150189777a2SCristian PallaresAC_SUBST([am__untar])
1151189777a2SCristian Pallares]) # _AM_PROG_TAR
1152189777a2SCristian Pallares
1153189777a2SCristian Pallaresm4_include([m4/libtool.m4])
1154189777a2SCristian Pallaresm4_include([m4/ltoptions.m4])
1155189777a2SCristian Pallaresm4_include([m4/ltsugar.m4])
1156189777a2SCristian Pallaresm4_include([m4/ltversion.m4])
1157189777a2SCristian Pallaresm4_include([m4/lt~obsolete.m4])
1158