1 # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
3 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18 [m4_warning([this file was generated for autoconf 2.69.
19 You have another version of autoconf. It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
23 # iconv.m4 serial 19 (gettext-0.18.2)
24 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
25 dnl This file is free software; the Free Software Foundation
26 dnl gives unlimited permission to copy and/or distribute it,
27 dnl with or without modifications, as long as this notice is preserved.
29 dnl From Bruno Haible.
31 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
33 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
34 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
35 AC_REQUIRE([AC_LIB_RPATH])
37 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
39 AC_LIB_LINKFLAGS_BODY([iconv])
42 AC_DEFUN([AM_ICONV_LINK],
44 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
45 dnl those with the standalone portable GNU libiconv installed).
46 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
48 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
50 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
52 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
53 dnl because if the user has installed libiconv and not disabled its use
54 dnl via --without-libiconv-prefix, he wants to use it. The first
55 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
56 am_save_CPPFLAGS="$CPPFLAGS"
57 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
59 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
60 am_cv_func_iconv="no, consider installing GNU libiconv"
68 [[iconv_t cd = iconv_open("","");
69 iconv(cd,NULL,NULL,NULL,NULL);
71 [am_cv_func_iconv=yes])
72 if test "$am_cv_func_iconv" != yes; then
74 LIBS="$LIBS $LIBICONV"
81 [[iconv_t cd = iconv_open("","");
82 iconv(cd,NULL,NULL,NULL,NULL);
85 [am_cv_func_iconv=yes])
89 if test "$am_cv_func_iconv" = yes; then
90 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
91 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
94 if test $am_cv_lib_iconv = yes; then
95 LIBS="$LIBS $LIBICONV"
97 am_cv_func_iconv_works=no
98 for ac_iconv_const in '' 'const'; do
106 # define ICONV_CONST $ac_iconv_const
110 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
113 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
114 if (cd_utf8_to_88591 != (iconv_t)(-1))
116 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
118 ICONV_CONST char *inptr = input;
119 size_t inbytesleft = strlen (input);
121 size_t outbytesleft = sizeof (buf);
122 size_t res = iconv (cd_utf8_to_88591,
123 &inptr, &inbytesleft,
124 &outptr, &outbytesleft);
127 iconv_close (cd_utf8_to_88591);
130 /* Test against Solaris 10 bug: Failures are not distinguishable from
131 successful returns. */
133 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
134 if (cd_ascii_to_88591 != (iconv_t)(-1))
136 static ICONV_CONST char input[] = "\263";
138 ICONV_CONST char *inptr = input;
139 size_t inbytesleft = strlen (input);
141 size_t outbytesleft = sizeof (buf);
142 size_t res = iconv (cd_ascii_to_88591,
143 &inptr, &inbytesleft,
144 &outptr, &outbytesleft);
147 iconv_close (cd_ascii_to_88591);
150 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
152 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
153 if (cd_88591_to_utf8 != (iconv_t)(-1))
155 static ICONV_CONST char input[] = "\304";
156 static char buf[2] = { (char)0xDE, (char)0xAD };
157 ICONV_CONST char *inptr = input;
158 size_t inbytesleft = 1;
160 size_t outbytesleft = 1;
161 size_t res = iconv (cd_88591_to_utf8,
162 &inptr, &inbytesleft,
163 &outptr, &outbytesleft);
164 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
166 iconv_close (cd_88591_to_utf8);
169 #if 0 /* This bug could be worked around by the caller. */
170 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
172 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
173 if (cd_88591_to_utf8 != (iconv_t)(-1))
175 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
177 ICONV_CONST char *inptr = input;
178 size_t inbytesleft = strlen (input);
180 size_t outbytesleft = sizeof (buf);
181 size_t res = iconv (cd_88591_to_utf8,
182 &inptr, &inbytesleft,
183 &outptr, &outbytesleft);
186 iconv_close (cd_88591_to_utf8);
190 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
192 if (/* Try standardized names. */
193 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
194 /* Try IRIX, OSF/1 names. */
195 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
197 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
198 /* Try HP-UX names. */
199 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
203 [am_cv_func_iconv_works=yes], ,
205 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
206 *) am_cv_func_iconv_works="guessing yes" ;;
208 test "$am_cv_func_iconv_works" = no || break
212 case "$am_cv_func_iconv_works" in
213 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
214 *) am_func_iconv=yes ;;
217 am_func_iconv=no am_cv_lib_iconv=no
219 if test "$am_func_iconv" = yes; then
220 AC_DEFINE([HAVE_ICONV], [1],
221 [Define if you have the iconv() function and it works.])
223 if test "$am_cv_lib_iconv" = yes; then
224 AC_MSG_CHECKING([how to link with libiconv])
225 AC_MSG_RESULT([$LIBICONV])
227 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
229 CPPFLAGS="$am_save_CPPFLAGS"
234 AC_SUBST([LTLIBICONV])
237 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
238 dnl avoid warnings like
239 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
240 dnl This is tricky because of the way 'aclocal' is implemented:
241 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
242 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
243 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
244 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
246 m4_define([gl_iconv_AC_DEFUN],
247 m4_version_prereq([2.64],
250 [m4_ifdef([gl_00GNULIB],
255 gl_iconv_AC_DEFUN([AM_ICONV],
258 if test "$am_cv_func_iconv" = yes; then
259 AC_MSG_CHECKING([for iconv declaration])
260 AC_CACHE_VAL([am_cv_proto_iconv], [
270 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
271 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
277 [am_cv_proto_iconv_arg1=""],
278 [am_cv_proto_iconv_arg1="const"])
279 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
280 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
283 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
284 [Define as const if the declaration of iconv() needs const.])
285 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
286 m4_ifdef([gl_ICONV_H_DEFAULTS],
287 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
288 if test -n "$am_cv_proto_iconv_arg1"; then
296 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
297 dnl This file is free software; the Free Software Foundation
298 dnl gives unlimited permission to copy and/or distribute it,
299 dnl with or without modifications, as long as this notice is preserved.
301 dnl Subroutines of libtool.m4,
302 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
303 dnl collision with libtool.m4.
305 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
306 AC_DEFUN([AC_LIB_PROG_LD_GNU],
307 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
308 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
309 case `$LD -v 2>&1 </dev/null` in
310 *GNU* | *'with BFD'*)
311 acl_cv_prog_gnu_ld=yes
314 acl_cv_prog_gnu_ld=no
317 with_gnu_ld=$acl_cv_prog_gnu_ld
320 dnl From libtool-2.4. Sets the variable LD.
321 AC_DEFUN([AC_LIB_PROG_LD],
322 [AC_REQUIRE([AC_PROG_CC])dnl
323 AC_REQUIRE([AC_CANONICAL_HOST])dnl
325 AC_ARG_WITH([gnu-ld],
326 [AS_HELP_STRING([--with-gnu-ld],
327 [assume the C compiler uses GNU ld [default=no]])],
328 [test "$withval" = no || with_gnu_ld=yes],
331 # Prepare PATH_SEPARATOR.
332 # The user is always right.
333 if test "${PATH_SEPARATOR+set}" != set; then
334 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
335 # contains only /bin. Note that ksh looks also at the FPATH variable,
336 # so we have to set that as well for the test.
338 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
339 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
340 || PATH_SEPARATOR=';'
345 if test "$GCC" = yes; then
346 # Check if gcc -print-prog-name=ld gives a path.
347 AC_MSG_CHECKING([for ld used by $CC])
350 # gcc leaves a trailing carriage return which upsets mingw
351 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
353 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
356 # Accept absolute paths.
357 [[\\/]]* | ?:[[\\/]]*)
358 re_direlt='/[[^/]][[^/]]*/\.\./'
359 # Canonicalize the pathname of ld
360 ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
361 while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
362 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
364 test -z "$LD" && LD="$ac_prog"
367 # If it fails, then pretend we aren't using GCC.
371 # If it is relative, then search for the first ld in PATH.
375 elif test "$with_gnu_ld" = yes; then
376 AC_MSG_CHECKING([for GNU ld])
378 AC_MSG_CHECKING([for non-GNU ld])
380 AC_CACHE_VAL([acl_cv_path_LD],
381 [if test -z "$LD"; then
382 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
383 for ac_dir in $PATH; do
385 test -z "$ac_dir" && ac_dir=.
386 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
387 acl_cv_path_LD="$ac_dir/$ac_prog"
388 # Check to see if the program is GNU ld. I'd rather use --version,
389 # but apparently some variants of GNU ld only accept -v.
390 # Break only if it was the GNU/non-GNU ld that we prefer.
391 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
392 *GNU* | *'with BFD'*)
393 test "$with_gnu_ld" != no && break
396 test "$with_gnu_ld" != yes && break
403 acl_cv_path_LD="$LD" # Let the user override the test with a path.
406 if test -n "$LD"; then
411 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
415 # lib-link.m4 serial 26 (gettext-0.18.2)
416 dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
417 dnl This file is free software; the Free Software Foundation
418 dnl gives unlimited permission to copy and/or distribute it,
419 dnl with or without modifications, as long as this notice is preserved.
421 dnl From Bruno Haible.
425 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
426 dnl the libraries corresponding to explicit and implicit dependencies.
427 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
428 dnl augments the CPPFLAGS variable.
429 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
430 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
431 AC_DEFUN([AC_LIB_LINKFLAGS],
433 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
434 AC_REQUIRE([AC_LIB_RPATH])
435 pushdef([Name],[m4_translit([$1],[./+-], [____])])
436 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
437 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
438 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
439 AC_LIB_LINKFLAGS_BODY([$1], [$2])
440 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
441 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
442 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
443 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
445 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
446 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
447 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
448 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
449 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
451 AC_SUBST([LTLIB]NAME)
452 AC_SUBST([LIB]NAME[_PREFIX])
453 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
454 dnl results of this search when this library appears as a dependency.
460 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
461 dnl searches for libname and the libraries corresponding to explicit and
462 dnl implicit dependencies, together with the specified include files and
463 dnl the ability to compile and link the specified testcode. The missing-message
464 dnl defaults to 'no' and may contain additional hints for the user.
465 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
466 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
467 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
468 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
469 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
470 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
471 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
473 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
474 AC_REQUIRE([AC_LIB_RPATH])
475 pushdef([Name],[m4_translit([$1],[./+-], [____])])
476 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
477 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
479 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
481 AC_LIB_LINKFLAGS_BODY([$1], [$2])
483 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
484 dnl because if the user has installed lib[]Name and not disabled its use
485 dnl via --without-lib[]Name-prefix, he wants to use it.
486 ac_save_CPPFLAGS="$CPPFLAGS"
487 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
489 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
491 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
492 dnl because these -l options might require -L options that are present in
493 dnl LIBS. -l options benefit only from the -L options listed before it.
494 dnl Otherwise, add it to the front of LIBS, because it may be a static
495 dnl library that depends on another static library that is present in LIBS.
496 dnl Static libraries benefit only from the static libraries listed after
498 case " $LIB[]NAME" in
499 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
500 *) LIBS="$LIB[]NAME $LIBS" ;;
503 [AC_LANG_PROGRAM([[$3]], [[$4]])],
504 [ac_cv_lib[]Name=yes],
505 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
508 if test "$ac_cv_lib[]Name" = yes; then
510 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
511 AC_MSG_CHECKING([how to link with lib[]$1])
512 AC_MSG_RESULT([$LIB[]NAME])
515 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
516 dnl $INC[]NAME either.
517 CPPFLAGS="$ac_save_CPPFLAGS"
522 AC_SUBST([HAVE_LIB]NAME)
524 AC_SUBST([LTLIB]NAME)
525 AC_SUBST([LIB]NAME[_PREFIX])
530 dnl Determine the platform dependent parameters needed to use rpath:
533 dnl acl_libname_spec,
534 dnl acl_library_names_spec,
535 dnl acl_hardcode_libdir_flag_spec,
536 dnl acl_hardcode_libdir_separator,
537 dnl acl_hardcode_direct,
538 dnl acl_hardcode_minus_L.
539 AC_DEFUN([AC_LIB_RPATH],
541 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
542 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
543 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
544 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
545 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
546 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
547 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
548 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
549 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
555 acl_libext="$acl_cv_libext"
556 acl_shlibext="$acl_cv_shlibext"
557 acl_libname_spec="$acl_cv_libname_spec"
558 acl_library_names_spec="$acl_cv_library_names_spec"
559 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
560 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
561 acl_hardcode_direct="$acl_cv_hardcode_direct"
562 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
563 dnl Determine whether the user wants rpath handling at all.
564 AC_ARG_ENABLE([rpath],
565 [ --disable-rpath do not hardcode runtime library paths],
569 dnl AC_LIB_FROMPACKAGE(name, package)
570 dnl declares that libname comes from the given package. The configure file
571 dnl will then not have a --with-libname-prefix option but a
572 dnl --with-package-prefix option. Several libraries can come from the same
573 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
574 dnl macro call that searches for libname.
575 AC_DEFUN([AC_LIB_FROMPACKAGE],
577 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
578 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
579 define([acl_frompackage_]NAME, [$2])
582 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
583 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
584 define([acl_libsinpackage_]PACKUP,
585 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
590 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
591 dnl the libraries corresponding to explicit and implicit dependencies.
592 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
593 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
594 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
595 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
597 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
598 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
599 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
600 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
601 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
602 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
603 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
604 dnl Autoconf >= 2.61 supports dots in --with options.
605 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
606 dnl By default, look in $includedir and $libdir.
608 AC_LIB_WITH_FINAL_PREFIX([
609 eval additional_includedir=\"$includedir\"
610 eval additional_libdir=\"$libdir\"
612 AC_ARG_WITH(P_A_C_K[-prefix],
613 [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
614 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
616 if test "X$withval" = "Xno"; then
619 if test "X$withval" = "X"; then
620 AC_LIB_WITH_FINAL_PREFIX([
621 eval additional_includedir=\"$includedir\"
622 eval additional_libdir=\"$libdir\"
625 additional_includedir="$withval/include"
626 additional_libdir="$withval/$acl_libdirstem"
627 if test "$acl_libdirstem2" != "$acl_libdirstem" \
628 && ! test -d "$withval/$acl_libdirstem"; then
629 additional_libdir="$withval/$acl_libdirstem2"
634 dnl Search the library and its dependencies in $additional_libdir and
635 dnl $LDFLAGS. Using breadth-first-seach.
640 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
641 dnl computed. So it has to be reset here.
645 names_already_handled=
646 names_next_round='$1 $2'
647 while test -n "$names_next_round"; do
648 names_this_round="$names_next_round"
650 for name in $names_this_round; do
652 for n in $names_already_handled; do
653 if test "$n" = "$name"; then
658 if test -z "$already_handled"; then
659 names_already_handled="$names_already_handled $name"
660 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
661 dnl or AC_LIB_HAVE_LINKFLAGS call.
662 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
663 eval value=\"\$HAVE_LIB$uppername\"
664 if test -n "$value"; then
665 if test "$value" = yes; then
666 eval value=\"\$LIB$uppername\"
667 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
668 eval value=\"\$LTLIB$uppername\"
669 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
671 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
672 dnl that this library doesn't exist. So just drop it.
676 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
677 dnl and the already constructed $LIBNAME/$LTLIBNAME.
682 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
683 if test -n "$acl_shlibext"; then
684 shrext=".$acl_shlibext" # typically: shrext=.so
688 if test $use_additional = yes; then
689 dir="$additional_libdir"
690 dnl The same code as in the loop below:
691 dnl First look for a shared library.
692 if test -n "$acl_shlibext"; then
693 if test -f "$dir/$libname$shrext"; then
695 found_so="$dir/$libname$shrext"
697 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
699 for f in "$libname$shrext".*; do echo "$f"; done \
700 | sed -e "s,^$libname$shrext\\\\.,," \
701 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
702 | sed 1q ) 2>/dev/null`
703 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
705 found_so="$dir/$libname$shrext.$ver"
708 eval library_names=\"$acl_library_names_spec\"
709 for f in $library_names; do
710 if test -f "$dir/$f"; then
719 dnl Then look for a static library.
720 if test "X$found_dir" = "X"; then
721 if test -f "$dir/$libname.$acl_libext"; then
723 found_a="$dir/$libname.$acl_libext"
726 if test "X$found_dir" != "X"; then
727 if test -f "$dir/$libname.la"; then
728 found_la="$dir/$libname.la"
732 if test "X$found_dir" = "X"; then
733 for x in $LDFLAGS $LTLIB[]NAME; do
734 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
737 dir=`echo "X$x" | sed -e 's/^X-L//'`
738 dnl First look for a shared library.
739 if test -n "$acl_shlibext"; then
740 if test -f "$dir/$libname$shrext"; then
742 found_so="$dir/$libname$shrext"
744 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
746 for f in "$libname$shrext".*; do echo "$f"; done \
747 | sed -e "s,^$libname$shrext\\\\.,," \
748 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
749 | sed 1q ) 2>/dev/null`
750 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
752 found_so="$dir/$libname$shrext.$ver"
755 eval library_names=\"$acl_library_names_spec\"
756 for f in $library_names; do
757 if test -f "$dir/$f"; then
766 dnl Then look for a static library.
767 if test "X$found_dir" = "X"; then
768 if test -f "$dir/$libname.$acl_libext"; then
770 found_a="$dir/$libname.$acl_libext"
773 if test "X$found_dir" != "X"; then
774 if test -f "$dir/$libname.la"; then
775 found_la="$dir/$libname.la"
780 if test "X$found_dir" != "X"; then
785 if test "X$found_dir" != "X"; then
786 dnl Found the library.
787 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
788 if test "X$found_so" != "X"; then
789 dnl Linking with a shared library. We attempt to hardcode its
790 dnl directory into the executable's runpath, unless it's the
791 dnl standard /usr/lib.
792 if test "$enable_rpath" = no \
793 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
794 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
795 dnl No hardcoding is needed.
796 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
798 dnl Use an explicit option to hardcode DIR into the resulting
800 dnl Potentially add DIR to ltrpathdirs.
801 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
803 for x in $ltrpathdirs; do
804 if test "X$x" = "X$found_dir"; then
809 if test -z "$haveit"; then
810 ltrpathdirs="$ltrpathdirs $found_dir"
812 dnl The hardcoding into $LIBNAME is system dependent.
813 if test "$acl_hardcode_direct" = yes; then
814 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
815 dnl resulting binary.
816 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
818 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
819 dnl Use an explicit option to hardcode DIR into the resulting
821 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
822 dnl Potentially add DIR to rpathdirs.
823 dnl The rpathdirs will be appended to $LIBNAME at the end.
825 for x in $rpathdirs; do
826 if test "X$x" = "X$found_dir"; then
831 if test -z "$haveit"; then
832 rpathdirs="$rpathdirs $found_dir"
835 dnl Rely on "-L$found_dir".
836 dnl But don't add it if it's already contained in the LDFLAGS
837 dnl or the already constructed $LIBNAME
839 for x in $LDFLAGS $LIB[]NAME; do
840 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
841 if test "X$x" = "X-L$found_dir"; then
846 if test -z "$haveit"; then
847 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
849 if test "$acl_hardcode_minus_L" != no; then
850 dnl FIXME: Not sure whether we should use
851 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
853 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
855 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
856 dnl here, because this doesn't fit in flags passed to the
857 dnl compiler. So give up. No hardcoding. This affects only
858 dnl very old systems.
859 dnl FIXME: Not sure whether we should use
860 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
862 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
868 if test "X$found_a" != "X"; then
869 dnl Linking with a static library.
870 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
872 dnl We shouldn't come here, but anyway it's good to have a
874 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
877 dnl Assume the include files are nearby.
878 additional_includedir=
880 */$acl_libdirstem | */$acl_libdirstem/)
881 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
882 if test "$name" = '$1'; then
883 LIB[]NAME[]_PREFIX="$basedir"
885 additional_includedir="$basedir/include"
887 */$acl_libdirstem2 | */$acl_libdirstem2/)
888 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
889 if test "$name" = '$1'; then
890 LIB[]NAME[]_PREFIX="$basedir"
892 additional_includedir="$basedir/include"
895 if test "X$additional_includedir" != "X"; then
896 dnl Potentially add $additional_includedir to $INCNAME.
898 dnl 1. if it's the standard /usr/include,
899 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
900 dnl 3. if it's already present in $CPPFLAGS or the already
901 dnl constructed $INCNAME,
902 dnl 4. if it doesn't exist as a directory.
903 if test "X$additional_includedir" != "X/usr/include"; then
905 if test "X$additional_includedir" = "X/usr/local/include"; then
906 if test -n "$GCC"; then
908 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
912 if test -z "$haveit"; then
913 for x in $CPPFLAGS $INC[]NAME; do
914 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
915 if test "X$x" = "X-I$additional_includedir"; then
920 if test -z "$haveit"; then
921 if test -d "$additional_includedir"; then
922 dnl Really add $additional_includedir to $INCNAME.
923 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
929 dnl Look for dependencies.
930 if test -n "$found_la"; then
931 dnl Read the .la file. It defines the variables
932 dnl dlname, library_names, old_library, dependency_libs, current,
933 dnl age, revision, installed, dlopen, dlpreopen, libdir.
934 save_libdir="$libdir"
936 */* | *\\*) . "$found_la" ;;
937 *) . "./$found_la" ;;
939 libdir="$save_libdir"
940 dnl We use only dependency_libs.
941 for dep in $dependency_libs; do
944 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
945 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
947 dnl 1. if it's the standard /usr/lib,
948 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
949 dnl 3. if it's already present in $LDFLAGS or the already
950 dnl constructed $LIBNAME,
951 dnl 4. if it doesn't exist as a directory.
952 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
953 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
955 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
956 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
957 if test -n "$GCC"; then
959 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
963 if test -z "$haveit"; then
965 for x in $LDFLAGS $LIB[]NAME; do
966 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
967 if test "X$x" = "X-L$additional_libdir"; then
972 if test -z "$haveit"; then
973 if test -d "$additional_libdir"; then
974 dnl Really add $additional_libdir to $LIBNAME.
975 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
979 for x in $LDFLAGS $LTLIB[]NAME; do
980 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
981 if test "X$x" = "X-L$additional_libdir"; then
986 if test -z "$haveit"; then
987 if test -d "$additional_libdir"; then
988 dnl Really add $additional_libdir to $LTLIBNAME.
989 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
996 dir=`echo "X$dep" | sed -e 's/^X-R//'`
997 if test "$enable_rpath" != no; then
998 dnl Potentially add DIR to rpathdirs.
999 dnl The rpathdirs will be appended to $LIBNAME at the end.
1001 for x in $rpathdirs; do
1002 if test "X$x" = "X$dir"; then
1007 if test -z "$haveit"; then
1008 rpathdirs="$rpathdirs $dir"
1010 dnl Potentially add DIR to ltrpathdirs.
1011 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1013 for x in $ltrpathdirs; do
1014 if test "X$x" = "X$dir"; then
1019 if test -z "$haveit"; then
1020 ltrpathdirs="$ltrpathdirs $dir"
1025 dnl Handle this in the next round.
1026 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1029 dnl Handle this in the next round. Throw away the .la's
1030 dnl directory; it is already contained in a preceding -L
1032 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1035 dnl Most likely an immediate library name.
1036 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1037 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1043 dnl Didn't find the library; assume it is in the system directories
1044 dnl known to the linker and runtime loader. (All the system
1045 dnl directories known to the linker should also be known to the
1046 dnl runtime loader, otherwise the system is severely misconfigured.)
1047 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1048 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1054 if test "X$rpathdirs" != "X"; then
1055 if test -n "$acl_hardcode_libdir_separator"; then
1056 dnl Weird platform: only the last -rpath option counts, the user must
1057 dnl pass all path elements in one option. We can arrange that for a
1058 dnl single library, but not when more than one $LIBNAMEs are used.
1060 for found_dir in $rpathdirs; do
1061 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1063 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1064 acl_save_libdir="$libdir"
1066 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1067 libdir="$acl_save_libdir"
1068 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1070 dnl The -rpath options are cumulative.
1071 for found_dir in $rpathdirs; do
1072 acl_save_libdir="$libdir"
1074 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1075 libdir="$acl_save_libdir"
1076 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1080 if test "X$ltrpathdirs" != "X"; then
1081 dnl When using libtool, the option that works for both libraries and
1082 dnl executables is -R. The -R options are cumulative.
1083 for found_dir in $ltrpathdirs; do
1084 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1094 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1095 dnl unless already present in VAR.
1096 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1097 dnl contains two or three consecutive elements that belong together.
1098 AC_DEFUN([AC_LIB_APPENDTOVAR],
1100 for element in [$2]; do
1103 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1104 if test "X$x" = "X$element"; then
1109 if test -z "$haveit"; then
1110 [$1]="${[$1]}${[$1]:+ }$element"
1115 dnl For those cases where a variable contains several -L and -l options
1116 dnl referring to unknown libraries and directories, this macro determines the
1117 dnl necessary additional linker options for the runtime path.
1118 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1119 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1120 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1121 dnl otherwise linking without libtool is assumed.
1122 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1124 AC_REQUIRE([AC_LIB_RPATH])
1125 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1127 if test "$enable_rpath" != no; then
1128 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1129 dnl Use an explicit option to hardcode directories into the resulting
1134 if test -n "$next"; then
1136 dnl No need to hardcode the standard /usr/lib.
1137 if test "X$dir" != "X/usr/$acl_libdirstem" \
1138 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1139 rpathdirs="$rpathdirs $dir"
1145 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1146 dnl No need to hardcode the standard /usr/lib.
1147 if test "X$dir" != "X/usr/$acl_libdirstem" \
1148 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1149 rpathdirs="$rpathdirs $dir"
1156 if test "X$rpathdirs" != "X"; then
1157 if test -n ""$3""; then
1158 dnl libtool is used for linking. Use -R options.
1159 for dir in $rpathdirs; do
1160 $1="${$1}${$1:+ }-R$dir"
1163 dnl The linker is used for linking directly.
1164 if test -n "$acl_hardcode_libdir_separator"; then
1165 dnl Weird platform: only the last -rpath option counts, the user
1166 dnl must pass all path elements in one option.
1168 for dir in $rpathdirs; do
1169 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1171 acl_save_libdir="$libdir"
1173 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1174 libdir="$acl_save_libdir"
1177 dnl The -rpath options are cumulative.
1178 for dir in $rpathdirs; do
1179 acl_save_libdir="$libdir"
1181 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1182 libdir="$acl_save_libdir"
1183 $1="${$1}${$1:+ }$flag"
1193 # lib-prefix.m4 serial 7 (gettext-0.18)
1194 dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
1195 dnl This file is free software; the Free Software Foundation
1196 dnl gives unlimited permission to copy and/or distribute it,
1197 dnl with or without modifications, as long as this notice is preserved.
1199 dnl From Bruno Haible.
1201 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1202 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1203 dnl require excessive bracketing.
1204 ifdef([AC_HELP_STRING],
1205 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1206 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1208 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1209 dnl to access previously installed libraries. The basic assumption is that
1210 dnl a user will want packages to use other packages he previously installed
1211 dnl with the same --prefix option.
1212 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1213 dnl libraries, but is otherwise very convenient.
1214 AC_DEFUN([AC_LIB_PREFIX],
1216 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1217 AC_REQUIRE([AC_PROG_CC])
1218 AC_REQUIRE([AC_CANONICAL_HOST])
1219 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1220 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1221 dnl By default, look in $includedir and $libdir.
1223 AC_LIB_WITH_FINAL_PREFIX([
1224 eval additional_includedir=\"$includedir\"
1225 eval additional_libdir=\"$libdir\"
1227 AC_LIB_ARG_WITH([lib-prefix],
1228 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1229 --without-lib-prefix don't search for libraries in includedir and libdir],
1231 if test "X$withval" = "Xno"; then
1234 if test "X$withval" = "X"; then
1235 AC_LIB_WITH_FINAL_PREFIX([
1236 eval additional_includedir=\"$includedir\"
1237 eval additional_libdir=\"$libdir\"
1240 additional_includedir="$withval/include"
1241 additional_libdir="$withval/$acl_libdirstem"
1245 if test $use_additional = yes; then
1246 dnl Potentially add $additional_includedir to $CPPFLAGS.
1247 dnl But don't add it
1248 dnl 1. if it's the standard /usr/include,
1249 dnl 2. if it's already present in $CPPFLAGS,
1250 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1251 dnl 4. if it doesn't exist as a directory.
1252 if test "X$additional_includedir" != "X/usr/include"; then
1254 for x in $CPPFLAGS; do
1255 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1256 if test "X$x" = "X-I$additional_includedir"; then
1261 if test -z "$haveit"; then
1262 if test "X$additional_includedir" = "X/usr/local/include"; then
1263 if test -n "$GCC"; then
1265 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1269 if test -z "$haveit"; then
1270 if test -d "$additional_includedir"; then
1271 dnl Really add $additional_includedir to $CPPFLAGS.
1272 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1277 dnl Potentially add $additional_libdir to $LDFLAGS.
1278 dnl But don't add it
1279 dnl 1. if it's the standard /usr/lib,
1280 dnl 2. if it's already present in $LDFLAGS,
1281 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1282 dnl 4. if it doesn't exist as a directory.
1283 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1285 for x in $LDFLAGS; do
1286 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1287 if test "X$x" = "X-L$additional_libdir"; then
1292 if test -z "$haveit"; then
1293 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1294 if test -n "$GCC"; then
1296 linux*) haveit=yes;;
1300 if test -z "$haveit"; then
1301 if test -d "$additional_libdir"; then
1302 dnl Really add $additional_libdir to $LDFLAGS.
1303 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1311 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1312 dnl acl_final_exec_prefix, containing the values to which $prefix and
1313 dnl $exec_prefix will expand at the end of the configure script.
1314 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1316 dnl Unfortunately, prefix and exec_prefix get only finally determined
1317 dnl at the end of configure.
1318 if test "X$prefix" = "XNONE"; then
1319 acl_final_prefix="$ac_default_prefix"
1321 acl_final_prefix="$prefix"
1323 if test "X$exec_prefix" = "XNONE"; then
1324 acl_final_exec_prefix='${prefix}'
1326 acl_final_exec_prefix="$exec_prefix"
1328 acl_save_prefix="$prefix"
1329 prefix="$acl_final_prefix"
1330 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1331 prefix="$acl_save_prefix"
1334 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1335 dnl variables prefix and exec_prefix bound to the values they will have
1336 dnl at the end of the configure script.
1337 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1339 acl_save_prefix="$prefix"
1340 prefix="$acl_final_prefix"
1341 acl_save_exec_prefix="$exec_prefix"
1342 exec_prefix="$acl_final_exec_prefix"
1344 exec_prefix="$acl_save_exec_prefix"
1345 prefix="$acl_save_prefix"
1348 dnl AC_LIB_PREPARE_MULTILIB creates
1349 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1350 dnl "lib" or "lib64" or "lib/64",
1351 dnl - a variable acl_libdirstem2, as a secondary possible value for
1352 dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1354 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1356 dnl There is no formal standard regarding lib and lib64.
1357 dnl On glibc systems, the current practice is that on a system supporting
1358 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1359 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1360 dnl the compiler's default mode by looking at the compiler's library search
1361 dnl path. If at least one of its elements ends in /lib64 or points to a
1362 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1363 dnl Otherwise we use the default, namely "lib".
1364 dnl On Solaris systems, the current practice is that on a system supporting
1365 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1366 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1367 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1368 AC_REQUIRE([AC_CANONICAL_HOST])
1373 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1374 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1375 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1376 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1377 dnl symlink is missing, so we set acl_libdirstem2 too.
1378 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1379 [AC_EGREP_CPP([sixtyfour bits], [
1383 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1385 if test $gl_cv_solaris_64bit = yes; then
1386 acl_libdirstem=lib/64
1388 sparc*) acl_libdirstem2=lib/sparcv9 ;;
1389 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1394 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1395 if test -n "$searchpath"; then
1396 acl_save_IFS="${IFS= }"; IFS=":"
1397 for searchdir in $searchpath; do
1398 if test -d "$searchdir"; then
1399 case "$searchdir" in
1400 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1402 # Better ignore directories of this form. They are misleading.
1404 *) searchdir=`cd "$searchdir" && pwd`
1405 case "$searchdir" in
1406 */lib64 ) acl_libdirstem=lib64 ;;
1415 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1418 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
1420 # This file is free software; the Free Software Foundation
1421 # gives unlimited permission to copy and/or distribute it,
1422 # with or without modifications, as long as this notice is preserved.
1424 # AM_AUTOMAKE_VERSION(VERSION)
1425 # ----------------------------
1426 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1427 # generated from the m4 files accompanying Automake X.Y.
1428 # (This private macro should not be called outside this file.)
1429 AC_DEFUN([AM_AUTOMAKE_VERSION],
1430 [am__api_version='1.16'
1431 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1432 dnl require some minimum version. Point them to the right macro.
1433 m4_if([$1], [1.16.1], [],
1434 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1437 # _AM_AUTOCONF_VERSION(VERSION)
1438 # -----------------------------
1439 # aclocal traces this macro to find the Autoconf version.
1440 # This is a private macro too. Using m4_define simplifies
1441 # the logic in aclocal, which can simply ignore this definition.
1442 m4_define([_AM_AUTOCONF_VERSION], [])
1444 # AM_SET_CURRENT_AUTOMAKE_VERSION
1445 # -------------------------------
1446 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1447 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1448 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1449 [AM_AUTOMAKE_VERSION([1.16.1])dnl
1450 m4_ifndef([AC_AUTOCONF_VERSION],
1451 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1452 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1454 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
1456 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
1458 # This file is free software; the Free Software Foundation
1459 # gives unlimited permission to copy and/or distribute it,
1460 # with or without modifications, as long as this notice is preserved.
1462 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1463 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
1464 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1466 # Of course, Automake must honor this variable whenever it calls a
1467 # tool from the auxiliary directory. The problem is that $srcdir (and
1468 # therefore $ac_aux_dir as well) can be either absolute or relative,
1469 # depending on how configure is run. This is pretty annoying, since
1470 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1471 # source directory, any form will work fine, but in subdirectories a
1472 # relative path needs to be adjusted first.
1474 # $ac_aux_dir/missing
1475 # fails when called from a subdirectory if $ac_aux_dir is relative
1476 # $top_srcdir/$ac_aux_dir/missing
1477 # fails if $ac_aux_dir is absolute,
1478 # fails when called from a subdirectory in a VPATH build with
1479 # a relative $ac_aux_dir
1481 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1482 # are both prefixed by $srcdir. In an in-source build this is usually
1483 # harmless because $srcdir is '.', but things will broke when you
1484 # start a VPATH build or use an absolute $srcdir.
1486 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1487 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
1488 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1489 # and then we would define $MISSING as
1490 # MISSING="\${SHELL} $am_aux_dir/missing"
1491 # This will work as long as MISSING is not called from configure, because
1492 # unfortunately $(top_srcdir) has no meaning in configure.
1493 # However there are other variables, like CC, which are often used in
1494 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1496 # Another solution, used here, is to always expand $ac_aux_dir to an
1497 # absolute PATH. The drawback is that using absolute paths prevent a
1498 # configured tree to be moved without reconfiguration.
1500 AC_DEFUN([AM_AUX_DIR_EXPAND],
1501 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1502 # Expand $ac_aux_dir to an absolute path.
1503 am_aux_dir=`cd "$ac_aux_dir" && pwd`
1506 # AM_CONDITIONAL -*- Autoconf -*-
1508 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
1510 # This file is free software; the Free Software Foundation
1511 # gives unlimited permission to copy and/or distribute it,
1512 # with or without modifications, as long as this notice is preserved.
1514 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1515 # -------------------------------------
1516 # Define a conditional.
1517 AC_DEFUN([AM_CONDITIONAL],
1518 [AC_PREREQ([2.52])dnl
1519 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1520 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1521 AC_SUBST([$1_TRUE])dnl
1522 AC_SUBST([$1_FALSE])dnl
1523 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1524 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1525 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1533 AC_CONFIG_COMMANDS_PRE(
1534 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1535 AC_MSG_ERROR([[conditional "$1" was never defined.
1536 Usually this means the macro was only invoked conditionally.]])
1539 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
1541 # This file is free software; the Free Software Foundation
1542 # gives unlimited permission to copy and/or distribute it,
1543 # with or without modifications, as long as this notice is preserved.
1546 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1547 # written in clear, in which case automake, when reading aclocal.m4,
1548 # will think it sees a *use*, and therefore will trigger all it's
1549 # C support machinery. Also note that it means that autoscan, seeing
1550 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1553 # _AM_DEPENDENCIES(NAME)
1554 # ----------------------
1555 # See how the compiler implements dependency checking.
1556 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1557 # We try a few techniques and use that to set a single cache variable.
1559 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1560 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1561 # dependency, and given that the user is not expected to run this macro,
1562 # just rely on AC_PROG_CC.
1563 AC_DEFUN([_AM_DEPENDENCIES],
1564 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1565 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1566 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1567 AC_REQUIRE([AM_DEP_TRACK])dnl
1569 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
1570 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
1571 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1572 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1573 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
1574 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
1575 [depcc="$$1" am_compiler_list=])
1577 AC_CACHE_CHECK([dependency style of $depcc],
1578 [am_cv_$1_dependencies_compiler_type],
1579 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1580 # We make a subdir and do the tests there. Otherwise we can end up
1581 # making bogus files that we don't know about and never remove. For
1582 # instance it was reported that on HP-UX the gcc test will end up
1583 # making a dummy file named 'D' -- because '-MD' means "put the output
1587 # Copy depcomp to subdir because otherwise we won't find it if we're
1588 # using a relative directory.
1589 cp "$am_depcomp" conftest.dir
1591 # We will build objects and dependencies in a subdirectory because
1592 # it helps to detect inapplicable dependency modes. For instance
1593 # both Tru64's cc and ICC support -MD to output dependencies as a
1594 # side effect of compilation, but ICC will put the dependencies in
1595 # the current directory while Tru64 will put them in the object
1599 am_cv_$1_dependencies_compiler_type=none
1600 if test "$am_compiler_list" = ""; then
1601 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1605 [case " $depcc " in #(
1606 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1609 [case " $depcc " in #(
1610 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1613 for depmode in $am_compiler_list; do
1614 # Setup a source with many dependencies, because some compilers
1615 # like to wrap large dependency lists on column 80 (with \), and
1616 # we should not choose a depcomp mode which is confused by this.
1618 # We need to recreate these files for each test, as the compiler may
1619 # overwrite some of them when testing with obscure command lines.
1620 # This happens at least with the AIX C compiler.
1622 for i in 1 2 3 4 5 6; do
1623 echo '#include "conftst'$i'.h"' >> sub/conftest.c
1624 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1625 # Solaris 10 /bin/sh.
1626 echo '/* dummy */' > sub/conftst$i.h
1628 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1630 # We check with '-c' and '-o' for the sake of the "dashmstdout"
1631 # mode. It turns out that the SunPro C++ compiler does not properly
1632 # handle '-M -o', and we need to detect this. Also, some Intel
1633 # versions had trouble with output in subdirs.
1634 am__obj=sub/conftest.${OBJEXT-o}
1635 am__minus_obj="-o $am__obj"
1638 # This depmode causes a compiler race in universal mode.
1639 test "$am__universal" = false || continue
1642 # After this tag, mechanisms are not by side-effect, so they'll
1643 # only be used when explicitly requested.
1644 if test "x$enable_dependency_tracking" = xyes; then
1650 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1651 # This compiler won't grok '-c -o', but also, the minuso test has
1652 # not run yet. These depmodes are late enough in the game, and
1653 # so weak that their functioning should not be impacted.
1654 am__obj=conftest.${OBJEXT-o}
1659 if depmode=$depmode \
1660 source=sub/conftest.c object=$am__obj \
1661 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1662 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1663 >/dev/null 2>conftest.err &&
1664 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1665 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1666 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1667 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1668 # icc doesn't choke on unknown options, it will just issue warnings
1669 # or remarks (even with -Werror). So we grep stderr for any message
1670 # that says an option was ignored or not supported.
1671 # When given -MP, icc 7.0 and 7.1 complain thusly:
1672 # icc: Command line warning: ignoring option '-M'; no argument required
1673 # The diagnosis changed in icc 8.0:
1674 # icc: Command line remark: option '-MP' not supported
1675 if (grep 'ignoring option' conftest.err ||
1676 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1677 am_cv_$1_dependencies_compiler_type=$depmode
1686 am_cv_$1_dependencies_compiler_type=none
1689 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1690 AM_CONDITIONAL([am__fastdep$1], [
1691 test "x$enable_dependency_tracking" != xno \
1692 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1698 # Choose a directory name for dependency files.
1699 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1700 AC_DEFUN([AM_SET_DEPDIR],
1701 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1702 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1708 AC_DEFUN([AM_DEP_TRACK],
1709 [AC_ARG_ENABLE([dependency-tracking], [dnl
1711 [--enable-dependency-tracking],
1712 [do not reject slow dependency extractors])
1714 [--disable-dependency-tracking],
1715 [speeds up one-time build])])
1716 if test "x$enable_dependency_tracking" != xno; then
1717 am_depcomp="$ac_aux_dir/depcomp"
1721 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1722 AC_SUBST([AMDEPBACKSLASH])dnl
1723 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1724 AC_SUBST([am__nodep])dnl
1725 _AM_SUBST_NOTMAKE([am__nodep])dnl
1728 # Generate code to set up dependency tracking. -*- Autoconf -*-
1730 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
1732 # This file is free software; the Free Software Foundation
1733 # gives unlimited permission to copy and/or distribute it,
1734 # with or without modifications, as long as this notice is preserved.
1736 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1737 # ------------------------------
1738 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1740 # Older Autoconf quotes --file arguments for eval, but not when files
1741 # are listed without --file. Let's play safe and only enable the eval
1742 # if we detect the quoting.
1743 # TODO: see whether this extra hack can be removed once we start
1744 # requiring Autoconf 2.70 or later.
1745 AS_CASE([$CONFIG_FILES],
1746 [*\'*], [eval set x "$CONFIG_FILES"],
1747 [*], [set x $CONFIG_FILES])
1749 # Used to flag and report bootstrapping failures.
1753 # Strip MF so we end up with the name of the file.
1754 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
1755 # Check whether this is an Automake generated Makefile which includes
1756 # dependency-tracking related rules and includes.
1757 # Grep'ing the whole file directly is not great: AIX grep has a line
1758 # limit of 2048, but all sed's we know have understand at least 4000.
1759 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
1761 am_dirpart=`AS_DIRNAME(["$am_mf"])`
1762 am_filepart=`AS_BASENAME(["$am_mf"])`
1763 AM_RUN_LOG([cd "$am_dirpart" \
1764 && sed -e '/# am--include-marker/d' "$am_filepart" \
1765 | $MAKE -f - am--depfiles]) || am_rc=$?
1767 if test $am_rc -ne 0; then
1768 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
1769 for automatic dependency tracking. Try re-running configure with the
1770 '--disable-dependency-tracking' option to at least be able to build
1771 the package (albeit without support for automatic dependency tracking).])
1773 AS_UNSET([am_dirpart])
1774 AS_UNSET([am_filepart])
1777 rm -f conftest-deps.mk
1779 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1782 # AM_OUTPUT_DEPENDENCY_COMMANDS
1783 # -----------------------------
1784 # This macro should only be invoked once -- use via AC_REQUIRE.
1786 # This code is only required when automatic dependency tracking is enabled.
1787 # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
1788 # order to bootstrap the dependency handling code.
1789 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1790 [AC_CONFIG_COMMANDS([depfiles],
1791 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1792 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
1794 # Do all the work for Automake. -*- Autoconf -*-
1796 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
1798 # This file is free software; the Free Software Foundation
1799 # gives unlimited permission to copy and/or distribute it,
1800 # with or without modifications, as long as this notice is preserved.
1802 # This macro actually does too much. Some checks are only needed if
1803 # your package does certain things. But this isn't really a big deal.
1805 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
1806 m4_define([AC_PROG_CC],
1807 m4_defn([AC_PROG_CC])
1811 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1812 # AM_INIT_AUTOMAKE([OPTIONS])
1813 # -----------------------------------------------
1814 # The call with PACKAGE and VERSION arguments is the old style
1815 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1816 # and VERSION should now be passed to AC_INIT and removed from
1817 # the call to AM_INIT_AUTOMAKE.
1818 # We support both call styles for the transition. After
1819 # the next Automake release, Autoconf can make the AC_INIT
1820 # arguments mandatory, and then we can depend on a new Autoconf
1821 # release and drop the old call support.
1822 AC_DEFUN([AM_INIT_AUTOMAKE],
1823 [AC_PREREQ([2.65])dnl
1824 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1825 dnl the ones we care about.
1826 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1827 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1828 AC_REQUIRE([AC_PROG_INSTALL])dnl
1829 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1830 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1831 # is not polluted with repeated "-I."
1832 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1833 # test to see if srcdir already configured
1834 if test -f $srcdir/config.status; then
1835 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1839 # test whether we have cygpath
1840 if test -z "$CYGPATH_W"; then
1841 if (cygpath --version) >/dev/null 2>/dev/null; then
1842 CYGPATH_W='cygpath -w'
1847 AC_SUBST([CYGPATH_W])
1849 # Define the identity of the package.
1850 dnl Distinguish between old-style and new-style calls.
1852 [AC_DIAGNOSE([obsolete],
1853 [$0: two- and three-arguments forms are deprecated.])
1854 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1855 AC_SUBST([PACKAGE], [$1])dnl
1856 AC_SUBST([VERSION], [$2])],
1857 [_AM_SET_OPTIONS([$1])dnl
1858 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1860 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1862 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1863 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1864 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1866 _AM_IF_OPTION([no-define],,
1867 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1868 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1870 # Some tools Automake needs.
1871 AC_REQUIRE([AM_SANITY_CHECK])dnl
1872 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1873 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1874 AM_MISSING_PROG([AUTOCONF], [autoconf])
1875 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1876 AM_MISSING_PROG([AUTOHEADER], [autoheader])
1877 AM_MISSING_PROG([MAKEINFO], [makeinfo])
1878 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1879 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1880 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1881 # For better backward compatibility. To be removed once Automake 1.9.x
1882 # dies out for good. For more background, see:
1883 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1884 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1885 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1886 # We need awk for the "check" target (and possibly the TAP driver). The
1887 # system "awk" is bad on some platforms.
1888 AC_REQUIRE([AC_PROG_AWK])dnl
1889 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1890 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1891 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1892 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1893 [_AM_PROG_TAR([v7])])])
1894 _AM_IF_OPTION([no-dependencies],,
1895 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1896 [_AM_DEPENDENCIES([CC])],
1897 [m4_define([AC_PROG_CC],
1898 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1899 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1900 [_AM_DEPENDENCIES([CXX])],
1901 [m4_define([AC_PROG_CXX],
1902 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1903 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1904 [_AM_DEPENDENCIES([OBJC])],
1905 [m4_define([AC_PROG_OBJC],
1906 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1907 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1908 [_AM_DEPENDENCIES([OBJCXX])],
1909 [m4_define([AC_PROG_OBJCXX],
1910 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1912 AC_REQUIRE([AM_SILENT_RULES])dnl
1913 dnl The testsuite driver may need to know about EXEEXT, so add the
1914 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
1915 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
1916 AC_CONFIG_COMMANDS_PRE(dnl
1917 [m4_provide_if([_AM_COMPILER_EXEEXT],
1918 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1920 # POSIX will say in a future version that running "rm -f" with no argument
1921 # is OK; and we want to be able to make that assumption in our Makefile
1922 # recipes. So use an aggressive probe to check that the usage we want is
1923 # actually supported "in the wild" to an acceptable degree.
1924 # See automake bug#10828.
1925 # To make any issue more visible, cause the running configure to be aborted
1926 # by default if the 'rm' program in use doesn't match our expectations; the
1927 # user can still override this though.
1928 if rm -f && rm -fr && rm -rf; then : OK; else
1932 Your 'rm' program seems unable to run without file operands specified
1933 on the command line, even when the '-f' option is present. This is contrary
1934 to the behaviour of most rm programs out there, and not conforming with
1935 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
1937 Please tell bug-automake@gnu.org about your system, including the value
1938 of your $PATH and any error possibly output before this message. This
1939 can help us improve future automake versions.
1942 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
1943 echo 'Configuration will proceed anyway, since you have set the' >&2
1944 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
1948 Aborting the configuration process, to ensure you take notice of the issue.
1950 You can download and install GNU coreutils to get an 'rm' implementation
1951 that behaves properly: <https://www.gnu.org/software/coreutils/>.
1953 If you want to complete the configuration process using your problematic
1954 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
1955 to "yes", and re-run configure.
1958 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
1961 dnl The trailing newline in this macro's definition is deliberate, for
1962 dnl backward compatibility and to allow trailing 'dnl'-style comments
1963 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1966 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
1967 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1968 dnl mangled by Autoconf and run in a shell conditional statement.
1969 m4_define([_AC_COMPILER_EXEEXT],
1970 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1972 # When config.status generates a header, we must update the stamp-h file.
1973 # This file resides in the same directory as the config header
1974 # that is generated. The stamp files are numbered to have different names.
1976 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1977 # loop where config.status creates the headers, so we can generate
1978 # our stamp files there.
1979 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1980 [# Compute $1's index in $config_headers.
1983 for _am_header in $config_headers :; do
1985 $_am_arg | $_am_arg:* )
1988 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1991 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1993 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
1995 # This file is free software; the Free Software Foundation
1996 # gives unlimited permission to copy and/or distribute it,
1997 # with or without modifications, as long as this notice is preserved.
1999 # AM_PROG_INSTALL_SH
2000 # ------------------
2001 # Define $install_sh.
2002 AC_DEFUN([AM_PROG_INSTALL_SH],
2003 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2004 if test x"${install_sh+set}" != xset; then
2007 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2009 install_sh="\${SHELL} $am_aux_dir/install-sh"
2012 AC_SUBST([install_sh])])
2014 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
2016 # This file is free software; the Free Software Foundation
2017 # gives unlimited permission to copy and/or distribute it,
2018 # with or without modifications, as long as this notice is preserved.
2020 # Check whether the underlying file-system supports filenames
2021 # with a leading dot. For instance MS-DOS doesn't.
2022 AC_DEFUN([AM_SET_LEADING_DOT],
2023 [rm -rf .tst 2>/dev/null
2024 mkdir .tst 2>/dev/null
2025 if test -d .tst; then
2030 rmdir .tst 2>/dev/null
2031 AC_SUBST([am__leading_dot])])
2033 # Check to see how 'make' treats includes. -*- Autoconf -*-
2035 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
2037 # This file is free software; the Free Software Foundation
2038 # gives unlimited permission to copy and/or distribute it,
2039 # with or without modifications, as long as this notice is preserved.
2043 # Check whether make has an 'include' directive that can support all
2044 # the idioms we need for our automatic dependency tracking code.
2045 AC_DEFUN([AM_MAKE_INCLUDE],
2046 [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
2047 cat > confinc.mk << 'END'
2049 @echo this is the am__doit target >confinc.out
2054 # BSD make does it like this.
2055 echo '.include "confinc.mk" # ignored' > confmf.BSD
2056 # Other make implementations (GNU, Solaris 10, AIX) do it like this.
2057 echo 'include confinc.mk # ignored' > confmf.GNU
2059 for s in GNU BSD; do
2060 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
2061 AS_CASE([$?:`cat confinc.out 2>/dev/null`],
2062 ['0:this is the am__doit target'],
2064 [BSD], [am__include='.include' am__quote='"'],
2065 [am__include='include' am__quote=''])])
2066 if test "$am__include" != "#"; then
2067 _am_result="yes ($s style)"
2071 rm -f confinc.* confmf.*
2072 AC_MSG_RESULT([${_am_result}])
2073 AC_SUBST([am__include])])
2074 AC_SUBST([am__quote])])
2076 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
2078 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
2080 # This file is free software; the Free Software Foundation
2081 # gives unlimited permission to copy and/or distribute it,
2082 # with or without modifications, as long as this notice is preserved.
2084 # AM_MISSING_PROG(NAME, PROGRAM)
2085 # ------------------------------
2086 AC_DEFUN([AM_MISSING_PROG],
2087 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2088 $1=${$1-"${am_missing_run}$2"}
2091 # AM_MISSING_HAS_RUN
2092 # ------------------
2093 # Define MISSING if not defined so far and test if it is modern enough.
2094 # If it is, set am_missing_run to use it, otherwise, to nothing.
2095 AC_DEFUN([AM_MISSING_HAS_RUN],
2096 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2097 AC_REQUIRE_AUX_FILE([missing])dnl
2098 if test x"${MISSING+set}" != xset; then
2101 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2103 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2106 # Use eval to expand $SHELL
2107 if eval "$MISSING --is-lightweight"; then
2108 am_missing_run="$MISSING "
2111 AC_MSG_WARN(['missing' script is too old or missing])
2115 # Helper functions for option handling. -*- Autoconf -*-
2117 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
2119 # This file is free software; the Free Software Foundation
2120 # gives unlimited permission to copy and/or distribute it,
2121 # with or without modifications, as long as this notice is preserved.
2123 # _AM_MANGLE_OPTION(NAME)
2124 # -----------------------
2125 AC_DEFUN([_AM_MANGLE_OPTION],
2126 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2128 # _AM_SET_OPTION(NAME)
2129 # --------------------
2130 # Set option NAME. Presently that only means defining a flag for this option.
2131 AC_DEFUN([_AM_SET_OPTION],
2132 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
2134 # _AM_SET_OPTIONS(OPTIONS)
2135 # ------------------------
2136 # OPTIONS is a space-separated list of Automake options.
2137 AC_DEFUN([_AM_SET_OPTIONS],
2138 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2140 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2141 # -------------------------------------------
2142 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2143 AC_DEFUN([_AM_IF_OPTION],
2144 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2146 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
2148 # This file is free software; the Free Software Foundation
2149 # gives unlimited permission to copy and/or distribute it,
2150 # with or without modifications, as long as this notice is preserved.
2154 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
2155 # to automatically call this.
2156 AC_DEFUN([_AM_PROG_CC_C_O],
2157 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2158 AC_REQUIRE_AUX_FILE([compile])dnl
2159 AC_LANG_PUSH([C])dnl
2161 [whether $CC understands -c and -o together],
2162 [am_cv_prog_cc_c_o],
2163 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
2164 # Make sure it works both with $CC and with simple cc.
2165 # Following AC_PROG_CC_C_O, we do the test twice because some
2166 # compilers refuse to overwrite an existing .o file with -o,
2167 # though they will create one.
2168 am_cv_prog_cc_c_o=yes
2170 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
2171 && test -f conftest2.$ac_objext; then
2174 am_cv_prog_cc_c_o=no
2178 rm -f core conftest*
2180 if test "$am_cv_prog_cc_c_o" != yes; then
2181 # Losing compiler, so override with the script.
2182 # FIXME: It is wrong to rewrite CC.
2183 # But if we don't then we get into trouble of one sort or another.
2184 # A longer-term fix would be to have automake use am__CC in this case,
2185 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2186 CC="$am_aux_dir/compile $CC"
2190 # For backward compatibility.
2191 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
2193 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
2195 # This file is free software; the Free Software Foundation
2196 # gives unlimited permission to copy and/or distribute it,
2197 # with or without modifications, as long as this notice is preserved.
2199 # AM_RUN_LOG(COMMAND)
2200 # -------------------
2201 # Run COMMAND, save the exit status in ac_status, and log it.
2202 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
2203 AC_DEFUN([AM_RUN_LOG],
2204 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
2205 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
2207 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2208 (exit $ac_status); }])
2210 # Check to make sure that the build environment is sane. -*- Autoconf -*-
2212 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
2214 # This file is free software; the Free Software Foundation
2215 # gives unlimited permission to copy and/or distribute it,
2216 # with or without modifications, as long as this notice is preserved.
2220 AC_DEFUN([AM_SANITY_CHECK],
2221 [AC_MSG_CHECKING([whether build environment is sane])
2222 # Reject unsafe characters in $srcdir or the absolute working directory
2223 # name. Accept space and tab only in the latter.
2227 *[[\\\"\#\$\&\'\`$am_lf]]*)
2228 AC_MSG_ERROR([unsafe absolute working directory name]);;
2231 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
2232 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
2235 # Do 'set' in a subshell so we don't clobber the current shell's
2236 # arguments. Must try -L first in case configure is actually a
2237 # symlink; some systems play weird games with the mod time of symlinks
2238 # (eg FreeBSD returns the mod time of the symlink's containing
2242 for am_try in 1 2; do
2243 echo "timestamp, slept: $am_has_slept" > conftest.file
2244 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2245 if test "$[*]" = "X"; then
2247 set X `ls -t "$srcdir/configure" conftest.file`
2249 if test "$[*]" != "X $srcdir/configure conftest.file" \
2250 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2252 # If neither matched, then we have a broken ls. This can happen
2253 # if, for instance, CONFIG_SHELL is bash and it inherits a
2254 # broken ls alias from the environment. This has actually
2255 # happened. Such a system could not be considered "sane".
2256 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2257 alias in your environment])
2259 if test "$[2]" = conftest.file || test $am_try -eq 2; then
2266 test "$[2]" = conftest.file
2272 AC_MSG_ERROR([newly created file is older than distributed files!
2273 Check your system clock])
2275 AC_MSG_RESULT([yes])
2276 # If we didn't sleep, we still need to ensure time stamps of config.status and
2277 # generated files are strictly newer.
2279 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
2283 AC_CONFIG_COMMANDS_PRE(
2284 [AC_MSG_CHECKING([that generated files are newer than configure])
2285 if test -n "$am_sleep_pid"; then
2286 # Hide warnings about reused PIDs.
2287 wait $am_sleep_pid 2>/dev/null
2289 AC_MSG_RESULT([done])])
2293 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
2295 # This file is free software; the Free Software Foundation
2296 # gives unlimited permission to copy and/or distribute it,
2297 # with or without modifications, as long as this notice is preserved.
2299 # AM_SILENT_RULES([DEFAULT])
2300 # --------------------------
2301 # Enable less verbose build rules; with the default set to DEFAULT
2302 # ("yes" being less verbose, "no" or empty being verbose).
2303 AC_DEFUN([AM_SILENT_RULES],
2304 [AC_ARG_ENABLE([silent-rules], [dnl
2306 [--enable-silent-rules],
2307 [less verbose build output (undo: "make V=1")])
2309 [--disable-silent-rules],
2310 [verbose build output (undo: "make V=0")])dnl
2312 case $enable_silent_rules in @%:@ (((
2313 yes) AM_DEFAULT_VERBOSITY=0;;
2314 no) AM_DEFAULT_VERBOSITY=1;;
2315 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2318 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
2319 dnl do not support nested variable expansions.
2320 dnl See automake bug#9928 and bug#10237.
2321 am_make=${MAKE-make}
2322 AC_CACHE_CHECK([whether $am_make supports nested variables],
2323 [am_cv_make_support_nested_variables],
2324 [if AS_ECHO([['TRUE=$(BAR$(V))
2330 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
2331 am_cv_make_support_nested_variables=yes
2333 am_cv_make_support_nested_variables=no
2335 if test $am_cv_make_support_nested_variables = yes; then
2336 dnl Using '$V' instead of '$(V)' breaks IRIX make.
2338 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2340 AM_V=$AM_DEFAULT_VERBOSITY
2341 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2344 AM_SUBST_NOTMAKE([AM_V])dnl
2345 AC_SUBST([AM_DEFAULT_V])dnl
2346 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
2347 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2349 AC_SUBST([AM_BACKSLASH])dnl
2350 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2353 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
2355 # This file is free software; the Free Software Foundation
2356 # gives unlimited permission to copy and/or distribute it,
2357 # with or without modifications, as long as this notice is preserved.
2359 # AM_PROG_INSTALL_STRIP
2360 # ---------------------
2361 # One issue with vendor 'install' (even GNU) is that you can't
2362 # specify the program used to strip binaries. This is especially
2363 # annoying in cross-compiling environments, where the build's strip
2364 # is unlikely to handle the host's binaries.
2365 # Fortunately install-sh will honor a STRIPPROG variable, so we
2366 # always use install-sh in "make install-strip", and initialize
2367 # STRIPPROG with the value of the STRIP variable (set by the user).
2368 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2369 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2370 # Installed binaries are usually stripped using 'strip' when the user
2371 # run "make install-strip". However 'strip' might not be the right
2372 # tool to use in cross-compilation environments, therefore Automake
2373 # will honor the 'STRIP' environment variable to overrule this program.
2374 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
2375 if test "$cross_compiling" != no; then
2376 AC_CHECK_TOOL([STRIP], [strip], :)
2378 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2379 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2381 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
2383 # This file is free software; the Free Software Foundation
2384 # gives unlimited permission to copy and/or distribute it,
2385 # with or without modifications, as long as this notice is preserved.
2387 # _AM_SUBST_NOTMAKE(VARIABLE)
2388 # ---------------------------
2389 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2390 # This macro is traced by Automake.
2391 AC_DEFUN([_AM_SUBST_NOTMAKE])
2393 # AM_SUBST_NOTMAKE(VARIABLE)
2394 # --------------------------
2395 # Public sister of _AM_SUBST_NOTMAKE.
2396 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2398 # Check how to create a tarball. -*- Autoconf -*-
2400 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
2402 # This file is free software; the Free Software Foundation
2403 # gives unlimited permission to copy and/or distribute it,
2404 # with or without modifications, as long as this notice is preserved.
2406 # _AM_PROG_TAR(FORMAT)
2407 # --------------------
2408 # Check how to create a tarball in format FORMAT.
2409 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
2411 # Substitute a variable $(am__tar) that is a command
2412 # writing to stdout a FORMAT-tarball containing the directory
2414 # tardir=directory && $(am__tar) > result.tar
2416 # Substitute a variable $(am__untar) that extract such
2417 # a tarball read from stdin.
2418 # $(am__untar) < result.tar
2420 AC_DEFUN([_AM_PROG_TAR],
2421 [# Always define AMTAR for backward compatibility. Yes, it's still used
2422 # in the wild :-( We should find a proper way to deprecate it ...
2423 AC_SUBST([AMTAR], ['$${TAR-tar}'])
2425 # We'll loop over all known methods to create a tar archive until one works.
2426 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2429 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
2433 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
2434 # There is notably a 21 bits limit for the UID and the GID. In fact,
2435 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
2437 am_max_uid=2097151 # 2^21 - 1
2438 am_max_gid=$am_max_uid
2439 # The $UID and $GID variables are not portable, so we need to resort
2440 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
2441 # below are definitely unexpected, so allow the users to see them
2442 # (that is, avoid stderr redirection).
2443 am_uid=`id -u || echo unknown`
2444 am_gid=`id -g || echo unknown`
2445 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
2446 if test $am_uid -le $am_max_uid; then
2447 AC_MSG_RESULT([yes])
2452 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
2453 if test $am_gid -le $am_max_gid; then
2454 AC_MSG_RESULT([yes])
2463 [m4_fatal([Unknown tar format])])
2465 AC_MSG_CHECKING([how to create a $1 tar archive])
2467 # Go ahead even if we have the value already cached. We do so because we
2468 # need to set the values for the 'am__tar' and 'am__untar' variables.
2469 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2471 for _am_tool in $_am_tools; do
2474 for _am_tar in tar gnutar gtar; do
2475 AM_RUN_LOG([$_am_tar --version]) && break
2477 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2478 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2479 am__untar="$_am_tar -xf -"
2482 # Must skip GNU tar: if it does not support --format= it doesn't create
2483 # ustar tarball either.
2484 (tar --version) >/dev/null 2>&1 && continue
2485 am__tar='tar chf - "$$tardir"'
2486 am__tar_='tar chf - "$tardir"'
2487 am__untar='tar xf -'
2490 am__tar='pax -L -x $1 -w "$$tardir"'
2491 am__tar_='pax -L -x $1 -w "$tardir"'
2495 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2496 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2497 am__untar='cpio -i -H $1 -d'
2506 # If the value was cached, stop now. We just wanted to have am__tar
2507 # and am__untar set.
2508 test -n "${am_cv_prog_tar_$1}" && break
2510 # tar/untar a dummy directory, and stop if the command works.
2513 echo GrepMe > conftest.dir/file
2514 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2516 if test -s conftest.tar; then
2517 AM_RUN_LOG([$am__untar <conftest.tar])
2518 AM_RUN_LOG([cat conftest.dir/file])
2519 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2524 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2525 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2528 AC_SUBST([am__untar])