1# generated automatically by aclocal 1.15.1 -*- Autoconf -*- 2 3# Copyright (C) 1996-2017 Free Software Foundation, Inc. 4 5# This file is free software; the Free Software Foundation 6# gives unlimited permission to copy and/or distribute it, 7# with or without modifications, as long as this notice is preserved. 8 9# This program is distributed in the hope that it will be useful, 10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12# PARTICULAR PURPOSE. 13 14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15m4_ifndef([AC_AUTOCONF_VERSION], 16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18[m4_warning([this file was generated for autoconf 2.69. 19You have another version of autoconf. It may work, but is not guaranteed to. 20If you have problems, you may need to regenerate the build system entirely. 21To do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22 23# iconv.m4 serial 19 (gettext-0.18.2) 24dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. 25dnl This file is free software; the Free Software Foundation 26dnl gives unlimited permission to copy and/or distribute it, 27dnl with or without modifications, as long as this notice is preserved. 28 29dnl From Bruno Haible. 30 31AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], 32[ 33 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. 34 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 35 AC_REQUIRE([AC_LIB_RPATH]) 36 37 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV 38 dnl accordingly. 39 AC_LIB_LINKFLAGS_BODY([iconv]) 40]) 41 42AC_DEFUN([AM_ICONV_LINK], 43[ 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 47 48 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV 49 dnl accordingly. 50 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) 51 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]) 58 59 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ 60 am_cv_func_iconv="no, consider installing GNU libiconv" 61 am_cv_lib_iconv=no 62 AC_LINK_IFELSE( 63 [AC_LANG_PROGRAM( 64 [[ 65#include <stdlib.h> 66#include <iconv.h> 67 ]], 68 [[iconv_t cd = iconv_open("",""); 69 iconv(cd,NULL,NULL,NULL,NULL); 70 iconv_close(cd);]])], 71 [am_cv_func_iconv=yes]) 72 if test "$am_cv_func_iconv" != yes; then 73 am_save_LIBS="$LIBS" 74 LIBS="$LIBS $LIBICONV" 75 AC_LINK_IFELSE( 76 [AC_LANG_PROGRAM( 77 [[ 78#include <stdlib.h> 79#include <iconv.h> 80 ]], 81 [[iconv_t cd = iconv_open("",""); 82 iconv(cd,NULL,NULL,NULL,NULL); 83 iconv_close(cd);]])], 84 [am_cv_lib_iconv=yes] 85 [am_cv_func_iconv=yes]) 86 LIBS="$am_save_LIBS" 87 fi 88 ]) 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, 92 dnl Solaris 10. 93 am_save_LIBS="$LIBS" 94 if test $am_cv_lib_iconv = yes; then 95 LIBS="$LIBS $LIBICONV" 96 fi 97 am_cv_func_iconv_works=no 98 for ac_iconv_const in '' 'const'; do 99 AC_RUN_IFELSE( 100 [AC_LANG_PROGRAM( 101 [[ 102#include <iconv.h> 103#include <string.h> 104 105#ifndef ICONV_CONST 106# define ICONV_CONST $ac_iconv_const 107#endif 108 ]], 109 [[int result = 0; 110 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful 111 returns. */ 112 { 113 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); 114 if (cd_utf8_to_88591 != (iconv_t)(-1)) 115 { 116 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ 117 char buf[10]; 118 ICONV_CONST char *inptr = input; 119 size_t inbytesleft = strlen (input); 120 char *outptr = buf; 121 size_t outbytesleft = sizeof (buf); 122 size_t res = iconv (cd_utf8_to_88591, 123 &inptr, &inbytesleft, 124 &outptr, &outbytesleft); 125 if (res == 0) 126 result |= 1; 127 iconv_close (cd_utf8_to_88591); 128 } 129 } 130 /* Test against Solaris 10 bug: Failures are not distinguishable from 131 successful returns. */ 132 { 133 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); 134 if (cd_ascii_to_88591 != (iconv_t)(-1)) 135 { 136 static ICONV_CONST char input[] = "\263"; 137 char buf[10]; 138 ICONV_CONST char *inptr = input; 139 size_t inbytesleft = strlen (input); 140 char *outptr = buf; 141 size_t outbytesleft = sizeof (buf); 142 size_t res = iconv (cd_ascii_to_88591, 143 &inptr, &inbytesleft, 144 &outptr, &outbytesleft); 145 if (res == 0) 146 result |= 2; 147 iconv_close (cd_ascii_to_88591); 148 } 149 } 150 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ 151 { 152 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); 153 if (cd_88591_to_utf8 != (iconv_t)(-1)) 154 { 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; 159 char *outptr = buf; 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) 165 result |= 4; 166 iconv_close (cd_88591_to_utf8); 167 } 168 } 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. */ 171 { 172 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); 173 if (cd_88591_to_utf8 != (iconv_t)(-1)) 174 { 175 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; 176 char buf[50]; 177 ICONV_CONST char *inptr = input; 178 size_t inbytesleft = strlen (input); 179 char *outptr = buf; 180 size_t outbytesleft = sizeof (buf); 181 size_t res = iconv (cd_88591_to_utf8, 182 &inptr, &inbytesleft, 183 &outptr, &outbytesleft); 184 if ((int)res > 0) 185 result |= 8; 186 iconv_close (cd_88591_to_utf8); 187 } 188 } 189#endif 190 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is 191 provided. */ 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) 196 /* Try AIX names. */ 197 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) 198 /* Try HP-UX names. */ 199 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) 200 result |= 16; 201 return result; 202]])], 203 [am_cv_func_iconv_works=yes], , 204 [case "$host_os" in 205 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; 206 *) am_cv_func_iconv_works="guessing yes" ;; 207 esac]) 208 test "$am_cv_func_iconv_works" = no || break 209 done 210 LIBS="$am_save_LIBS" 211 ]) 212 case "$am_cv_func_iconv_works" in 213 *no) am_func_iconv=no am_cv_lib_iconv=no ;; 214 *) am_func_iconv=yes ;; 215 esac 216 else 217 am_func_iconv=no am_cv_lib_iconv=no 218 fi 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.]) 222 fi 223 if test "$am_cv_lib_iconv" = yes; then 224 AC_MSG_CHECKING([how to link with libiconv]) 225 AC_MSG_RESULT([$LIBICONV]) 226 else 227 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV 228 dnl either. 229 CPPFLAGS="$am_save_CPPFLAGS" 230 LIBICONV= 231 LTLIBICONV= 232 fi 233 AC_SUBST([LIBICONV]) 234 AC_SUBST([LTLIBICONV]) 235]) 236 237dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to 238dnl avoid warnings like 239dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". 240dnl This is tricky because of the way 'aclocal' is implemented: 241dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. 242dnl Otherwise aclocal's initial scan pass would miss the macro definition. 243dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. 244dnl Otherwise aclocal would emit many "Use of uninitialized value $1" 245dnl warnings. 246m4_define([gl_iconv_AC_DEFUN], 247 m4_version_prereq([2.64], 248 [[AC_DEFUN_ONCE( 249 [$1], [$2])]], 250 [m4_ifdef([gl_00GNULIB], 251 [[AC_DEFUN_ONCE( 252 [$1], [$2])]], 253 [[AC_DEFUN( 254 [$1], [$2])]])])) 255gl_iconv_AC_DEFUN([AM_ICONV], 256[ 257 AM_ICONV_LINK 258 if test "$am_cv_func_iconv" = yes; then 259 AC_MSG_CHECKING([for iconv declaration]) 260 AC_CACHE_VAL([am_cv_proto_iconv], [ 261 AC_COMPILE_IFELSE( 262 [AC_LANG_PROGRAM( 263 [[ 264#include <stdlib.h> 265#include <iconv.h> 266extern 267#ifdef __cplusplus 268"C" 269#endif 270#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) 271size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); 272#else 273size_t iconv(); 274#endif 275 ]], 276 [[]])], 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/( /(/'` 281 AC_MSG_RESULT([ 282 $am_cv_proto_iconv]) 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 289 ICONV_CONST="const" 290 fi 291 ]) 292 fi 293]) 294 295# lib-ld.m4 serial 6 296dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc. 297dnl This file is free software; the Free Software Foundation 298dnl gives unlimited permission to copy and/or distribute it, 299dnl with or without modifications, as long as this notice is preserved. 300 301dnl Subroutines of libtool.m4, 302dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid 303dnl collision with libtool.m4. 304 305dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. 306AC_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. 309case `$LD -v 2>&1 </dev/null` in 310*GNU* | *'with BFD'*) 311 acl_cv_prog_gnu_ld=yes 312 ;; 313*) 314 acl_cv_prog_gnu_ld=no 315 ;; 316esac]) 317with_gnu_ld=$acl_cv_prog_gnu_ld 318]) 319 320dnl From libtool-2.4. Sets the variable LD. 321AC_DEFUN([AC_LIB_PROG_LD], 322[AC_REQUIRE([AC_PROG_CC])dnl 323AC_REQUIRE([AC_CANONICAL_HOST])dnl 324 325AC_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], 329 [with_gnu_ld=no])dnl 330 331# Prepare PATH_SEPARATOR. 332# The user is always right. 333if 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. 337 PATH_SEPARATOR=: 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=';' 341 } 342fi 343 344ac_prog=ld 345if test "$GCC" = yes; then 346 # Check if gcc -print-prog-name=ld gives a path. 347 AC_MSG_CHECKING([for ld used by $CC]) 348 case $host in 349 *-*-mingw*) 350 # gcc leaves a trailing carriage return which upsets mingw 351 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 352 *) 353 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 354 esac 355 case $ac_prog in 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%/%"` 363 done 364 test -z "$LD" && LD="$ac_prog" 365 ;; 366 "") 367 # If it fails, then pretend we aren't using GCC. 368 ac_prog=ld 369 ;; 370 *) 371 # If it is relative, then search for the first ld in PATH. 372 with_gnu_ld=unknown 373 ;; 374 esac 375elif test "$with_gnu_ld" = yes; then 376 AC_MSG_CHECKING([for GNU ld]) 377else 378 AC_MSG_CHECKING([for non-GNU ld]) 379fi 380AC_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 384 IFS="$acl_save_ifs" 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 394 ;; 395 *) 396 test "$with_gnu_ld" != yes && break 397 ;; 398 esac 399 fi 400 done 401 IFS="$acl_save_ifs" 402else 403 acl_cv_path_LD="$LD" # Let the user override the test with a path. 404fi]) 405LD="$acl_cv_path_LD" 406if test -n "$LD"; then 407 AC_MSG_RESULT([$LD]) 408else 409 AC_MSG_RESULT([no]) 410fi 411test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 412AC_LIB_PROG_LD_GNU 413]) 414 415# lib-link.m4 serial 26 (gettext-0.18.2) 416dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. 417dnl This file is free software; the Free Software Foundation 418dnl gives unlimited permission to copy and/or distribute it, 419dnl with or without modifications, as long as this notice is preserved. 420 421dnl From Bruno Haible. 422 423AC_PREREQ([2.54]) 424 425dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and 426dnl the libraries corresponding to explicit and implicit dependencies. 427dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and 428dnl augments the CPPFLAGS variable. 429dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 430dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 431AC_DEFUN([AC_LIB_LINKFLAGS], 432[ 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" 444 ]) 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) 450 AC_SUBST([LIB]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. 455 HAVE_LIB[]NAME=yes 456 popdef([NAME]) 457 popdef([Name]) 458]) 459 460dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) 461dnl searches for libname and the libraries corresponding to explicit and 462dnl implicit dependencies, together with the specified include files and 463dnl the ability to compile and link the specified testcode. The missing-message 464dnl defaults to 'no' and may contain additional hints for the user. 465dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} 466dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and 467dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs 468dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. 469dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 470dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 471AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], 472[ 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____])]) 478 479 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME 480 dnl accordingly. 481 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 482 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) 488 489 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ 490 ac_save_LIBS="$LIBS" 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 497 dnl it. 498 case " $LIB[]NAME" in 499 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; 500 *) LIBS="$LIB[]NAME $LIBS" ;; 501 esac 502 AC_LINK_IFELSE( 503 [AC_LANG_PROGRAM([[$3]], [[$4]])], 504 [ac_cv_lib[]Name=yes], 505 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) 506 LIBS="$ac_save_LIBS" 507 ]) 508 if test "$ac_cv_lib[]Name" = yes; then 509 HAVE_LIB[]NAME=yes 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]) 513 else 514 HAVE_LIB[]NAME=no 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" 518 LIB[]NAME= 519 LTLIB[]NAME= 520 LIB[]NAME[]_PREFIX= 521 fi 522 AC_SUBST([HAVE_LIB]NAME) 523 AC_SUBST([LIB]NAME) 524 AC_SUBST([LTLIB]NAME) 525 AC_SUBST([LIB]NAME[_PREFIX]) 526 popdef([NAME]) 527 popdef([Name]) 528]) 529 530dnl Determine the platform dependent parameters needed to use rpath: 531dnl acl_libext, 532dnl acl_shlibext, 533dnl acl_libname_spec, 534dnl acl_library_names_spec, 535dnl acl_hardcode_libdir_flag_spec, 536dnl acl_hardcode_libdir_separator, 537dnl acl_hardcode_direct, 538dnl acl_hardcode_minus_L. 539AC_DEFUN([AC_LIB_RPATH], 540[ 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 550 . ./conftest.sh 551 rm -f ./conftest.sh 552 acl_cv_rpath=done 553 ]) 554 wl="$acl_cv_wl" 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], 566 :, enable_rpath=yes) 567]) 568 569dnl AC_LIB_FROMPACKAGE(name, package) 570dnl declares that libname comes from the given package. The configure file 571dnl will then not have a --with-libname-prefix option but a 572dnl --with-package-prefix option. Several libraries can come from the same 573dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar 574dnl macro call that searches for libname. 575AC_DEFUN([AC_LIB_FROMPACKAGE], 576[ 577 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], 578 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 579 define([acl_frompackage_]NAME, [$2]) 580 popdef([NAME]) 581 pushdef([PACK],[$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]) 586 popdef([PACKUP]) 587 popdef([PACK]) 588]) 589 590dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and 591dnl the libraries corresponding to explicit and implicit dependencies. 592dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. 593dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found 594dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 595AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 596[ 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. 607 use_additional=yes 608 AC_LIB_WITH_FINAL_PREFIX([ 609 eval additional_includedir=\"$includedir\" 610 eval additional_libdir=\"$libdir\" 611 ]) 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]], 615[ 616 if test "X$withval" = "Xno"; then 617 use_additional=no 618 else 619 if test "X$withval" = "X"; then 620 AC_LIB_WITH_FINAL_PREFIX([ 621 eval additional_includedir=\"$includedir\" 622 eval additional_libdir=\"$libdir\" 623 ]) 624 else 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" 630 fi 631 fi 632 fi 633]) 634 dnl Search the library and its dependencies in $additional_libdir and 635 dnl $LDFLAGS. Using breadth-first-seach. 636 LIB[]NAME= 637 LTLIB[]NAME= 638 INC[]NAME= 639 LIB[]NAME[]_PREFIX= 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. 642 HAVE_LIB[]NAME= 643 rpathdirs= 644 ltrpathdirs= 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" 649 names_next_round= 650 for name in $names_this_round; do 651 already_handled= 652 for n in $names_already_handled; do 653 if test "$n" = "$name"; then 654 already_handled=yes 655 break 656 fi 657 done 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" 670 else 671 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined 672 dnl that this library doesn't exist. So just drop it. 673 : 674 fi 675 else 676 dnl Search the library lib$name in $additional_libdir and $LDFLAGS 677 dnl and the already constructed $LIBNAME/$LTLIBNAME. 678 found_dir= 679 found_la= 680 found_so= 681 found_a= 682 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name 683 if test -n "$acl_shlibext"; then 684 shrext=".$acl_shlibext" # typically: shrext=.so 685 else 686 shrext= 687 fi 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 694 found_dir="$dir" 695 found_so="$dir/$libname$shrext" 696 else 697 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then 698 ver=`(cd "$dir" && \ 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 704 found_dir="$dir" 705 found_so="$dir/$libname$shrext.$ver" 706 fi 707 else 708 eval library_names=\"$acl_library_names_spec\" 709 for f in $library_names; do 710 if test -f "$dir/$f"; then 711 found_dir="$dir" 712 found_so="$dir/$f" 713 break 714 fi 715 done 716 fi 717 fi 718 fi 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 722 found_dir="$dir" 723 found_a="$dir/$libname.$acl_libext" 724 fi 725 fi 726 if test "X$found_dir" != "X"; then 727 if test -f "$dir/$libname.la"; then 728 found_la="$dir/$libname.la" 729 fi 730 fi 731 fi 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\"]) 735 case "$x" in 736 -L*) 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 741 found_dir="$dir" 742 found_so="$dir/$libname$shrext" 743 else 744 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then 745 ver=`(cd "$dir" && \ 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 751 found_dir="$dir" 752 found_so="$dir/$libname$shrext.$ver" 753 fi 754 else 755 eval library_names=\"$acl_library_names_spec\" 756 for f in $library_names; do 757 if test -f "$dir/$f"; then 758 found_dir="$dir" 759 found_so="$dir/$f" 760 break 761 fi 762 done 763 fi 764 fi 765 fi 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 769 found_dir="$dir" 770 found_a="$dir/$libname.$acl_libext" 771 fi 772 fi 773 if test "X$found_dir" != "X"; then 774 if test -f "$dir/$libname.la"; then 775 found_la="$dir/$libname.la" 776 fi 777 fi 778 ;; 779 esac 780 if test "X$found_dir" != "X"; then 781 break 782 fi 783 done 784 fi 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" 797 else 798 dnl Use an explicit option to hardcode DIR into the resulting 799 dnl binary. 800 dnl Potentially add DIR to ltrpathdirs. 801 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. 802 haveit= 803 for x in $ltrpathdirs; do 804 if test "X$x" = "X$found_dir"; then 805 haveit=yes 806 break 807 fi 808 done 809 if test -z "$haveit"; then 810 ltrpathdirs="$ltrpathdirs $found_dir" 811 fi 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" 817 else 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 820 dnl binary. 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. 824 haveit= 825 for x in $rpathdirs; do 826 if test "X$x" = "X$found_dir"; then 827 haveit=yes 828 break 829 fi 830 done 831 if test -z "$haveit"; then 832 rpathdirs="$rpathdirs $found_dir" 833 fi 834 else 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 838 haveit= 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 842 haveit=yes 843 break 844 fi 845 done 846 if test -z "$haveit"; then 847 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" 848 fi 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" 852 dnl here. 853 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 854 else 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" 861 dnl here. 862 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" 863 fi 864 fi 865 fi 866 fi 867 else 868 if test "X$found_a" != "X"; then 869 dnl Linking with a static library. 870 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" 871 else 872 dnl We shouldn't come here, but anyway it's good to have a 873 dnl fallback. 874 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" 875 fi 876 fi 877 dnl Assume the include files are nearby. 878 additional_includedir= 879 case "$found_dir" in 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" 884 fi 885 additional_includedir="$basedir/include" 886 ;; 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" 891 fi 892 additional_includedir="$basedir/include" 893 ;; 894 esac 895 if test "X$additional_includedir" != "X"; then 896 dnl Potentially add $additional_includedir to $INCNAME. 897 dnl But don't add it 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 904 haveit= 905 if test "X$additional_includedir" = "X/usr/local/include"; then 906 if test -n "$GCC"; then 907 case $host_os in 908 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 909 esac 910 fi 911 fi 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 916 haveit=yes 917 break 918 fi 919 done 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" 924 fi 925 fi 926 fi 927 fi 928 fi 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" 935 case "$found_la" in 936 */* | *\\*) . "$found_la" ;; 937 *) . "./$found_la" ;; 938 esac 939 libdir="$save_libdir" 940 dnl We use only dependency_libs. 941 for dep in $dependency_libs; do 942 case "$dep" in 943 -L*) 944 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` 945 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. 946 dnl But don't add it 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 954 haveit= 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 958 case $host_os in 959 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 960 esac 961 fi 962 fi 963 if test -z "$haveit"; then 964 haveit= 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 968 haveit=yes 969 break 970 fi 971 done 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" 976 fi 977 fi 978 haveit= 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 982 haveit=yes 983 break 984 fi 985 done 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" 990 fi 991 fi 992 fi 993 fi 994 ;; 995 -R*) 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. 1000 haveit= 1001 for x in $rpathdirs; do 1002 if test "X$x" = "X$dir"; then 1003 haveit=yes 1004 break 1005 fi 1006 done 1007 if test -z "$haveit"; then 1008 rpathdirs="$rpathdirs $dir" 1009 fi 1010 dnl Potentially add DIR to ltrpathdirs. 1011 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. 1012 haveit= 1013 for x in $ltrpathdirs; do 1014 if test "X$x" = "X$dir"; then 1015 haveit=yes 1016 break 1017 fi 1018 done 1019 if test -z "$haveit"; then 1020 ltrpathdirs="$ltrpathdirs $dir" 1021 fi 1022 fi 1023 ;; 1024 -l*) 1025 dnl Handle this in the next round. 1026 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` 1027 ;; 1028 *.la) 1029 dnl Handle this in the next round. Throw away the .la's 1030 dnl directory; it is already contained in a preceding -L 1031 dnl option. 1032 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` 1033 ;; 1034 *) 1035 dnl Most likely an immediate library name. 1036 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" 1037 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" 1038 ;; 1039 esac 1040 done 1041 fi 1042 else 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" 1049 fi 1050 fi 1051 fi 1052 done 1053 done 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. 1059 alldirs= 1060 for found_dir in $rpathdirs; do 1061 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" 1062 done 1063 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. 1064 acl_save_libdir="$libdir" 1065 libdir="$alldirs" 1066 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1067 libdir="$acl_save_libdir" 1068 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" 1069 else 1070 dnl The -rpath options are cumulative. 1071 for found_dir in $rpathdirs; do 1072 acl_save_libdir="$libdir" 1073 libdir="$found_dir" 1074 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1075 libdir="$acl_save_libdir" 1076 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" 1077 done 1078 fi 1079 fi 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" 1085 done 1086 fi 1087 popdef([P_A_C_K]) 1088 popdef([PACKLIBS]) 1089 popdef([PACKUP]) 1090 popdef([PACK]) 1091 popdef([NAME]) 1092]) 1093 1094dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, 1095dnl unless already present in VAR. 1096dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes 1097dnl contains two or three consecutive elements that belong together. 1098AC_DEFUN([AC_LIB_APPENDTOVAR], 1099[ 1100 for element in [$2]; do 1101 haveit= 1102 for x in $[$1]; do 1103 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1104 if test "X$x" = "X$element"; then 1105 haveit=yes 1106 break 1107 fi 1108 done 1109 if test -z "$haveit"; then 1110 [$1]="${[$1]}${[$1]:+ }$element" 1111 fi 1112 done 1113]) 1114 1115dnl For those cases where a variable contains several -L and -l options 1116dnl referring to unknown libraries and directories, this macro determines the 1117dnl necessary additional linker options for the runtime path. 1118dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) 1119dnl sets LDADDVAR to linker options needed together with LIBSVALUE. 1120dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, 1121dnl otherwise linking without libtool is assumed. 1122AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], 1123[ 1124 AC_REQUIRE([AC_LIB_RPATH]) 1125 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1126 $1= 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 1130 dnl binary. 1131 rpathdirs= 1132 next= 1133 for opt in $2; do 1134 if test -n "$next"; then 1135 dir="$next" 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" 1140 fi 1141 next= 1142 else 1143 case $opt in 1144 -L) next=yes ;; 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" 1150 fi 1151 next= ;; 1152 *) next= ;; 1153 esac 1154 fi 1155 done 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" 1161 done 1162 else 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. 1167 alldirs= 1168 for dir in $rpathdirs; do 1169 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" 1170 done 1171 acl_save_libdir="$libdir" 1172 libdir="$alldirs" 1173 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1174 libdir="$acl_save_libdir" 1175 $1="$flag" 1176 else 1177 dnl The -rpath options are cumulative. 1178 for dir in $rpathdirs; do 1179 acl_save_libdir="$libdir" 1180 libdir="$dir" 1181 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1182 libdir="$acl_save_libdir" 1183 $1="${$1}${$1:+ }$flag" 1184 done 1185 fi 1186 fi 1187 fi 1188 fi 1189 fi 1190 AC_SUBST([$1]) 1191]) 1192 1193# lib-prefix.m4 serial 7 (gettext-0.18) 1194dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. 1195dnl This file is free software; the Free Software Foundation 1196dnl gives unlimited permission to copy and/or distribute it, 1197dnl with or without modifications, as long as this notice is preserved. 1198 1199dnl From Bruno Haible. 1200 1201dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and 1202dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't 1203dnl require excessive bracketing. 1204ifdef([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])])]) 1207 1208dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed 1209dnl to access previously installed libraries. The basic assumption is that 1210dnl a user will want packages to use other packages he previously installed 1211dnl with the same --prefix option. 1212dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate 1213dnl libraries, but is otherwise very convenient. 1214AC_DEFUN([AC_LIB_PREFIX], 1215[ 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. 1222 use_additional=yes 1223 AC_LIB_WITH_FINAL_PREFIX([ 1224 eval additional_includedir=\"$includedir\" 1225 eval additional_libdir=\"$libdir\" 1226 ]) 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], 1230[ 1231 if test "X$withval" = "Xno"; then 1232 use_additional=no 1233 else 1234 if test "X$withval" = "X"; then 1235 AC_LIB_WITH_FINAL_PREFIX([ 1236 eval additional_includedir=\"$includedir\" 1237 eval additional_libdir=\"$libdir\" 1238 ]) 1239 else 1240 additional_includedir="$withval/include" 1241 additional_libdir="$withval/$acl_libdirstem" 1242 fi 1243 fi 1244]) 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 1253 haveit= 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 1257 haveit=yes 1258 break 1259 fi 1260 done 1261 if test -z "$haveit"; then 1262 if test "X$additional_includedir" = "X/usr/local/include"; then 1263 if test -n "$GCC"; then 1264 case $host_os in 1265 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1266 esac 1267 fi 1268 fi 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" 1273 fi 1274 fi 1275 fi 1276 fi 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 1284 haveit= 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 1288 haveit=yes 1289 break 1290 fi 1291 done 1292 if test -z "$haveit"; then 1293 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then 1294 if test -n "$GCC"; then 1295 case $host_os in 1296 linux*) haveit=yes;; 1297 esac 1298 fi 1299 fi 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" 1304 fi 1305 fi 1306 fi 1307 fi 1308 fi 1309]) 1310 1311dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, 1312dnl acl_final_exec_prefix, containing the values to which $prefix and 1313dnl $exec_prefix will expand at the end of the configure script. 1314AC_DEFUN([AC_LIB_PREPARE_PREFIX], 1315[ 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" 1320 else 1321 acl_final_prefix="$prefix" 1322 fi 1323 if test "X$exec_prefix" = "XNONE"; then 1324 acl_final_exec_prefix='${prefix}' 1325 else 1326 acl_final_exec_prefix="$exec_prefix" 1327 fi 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" 1332]) 1333 1334dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the 1335dnl variables prefix and exec_prefix bound to the values they will have 1336dnl at the end of the configure script. 1337AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], 1338[ 1339 acl_save_prefix="$prefix" 1340 prefix="$acl_final_prefix" 1341 acl_save_exec_prefix="$exec_prefix" 1342 exec_prefix="$acl_final_exec_prefix" 1343 $1 1344 exec_prefix="$acl_save_exec_prefix" 1345 prefix="$acl_save_prefix" 1346]) 1347 1348dnl AC_LIB_PREPARE_MULTILIB creates 1349dnl - a variable acl_libdirstem, containing the basename of the libdir, either 1350dnl "lib" or "lib64" or "lib/64", 1351dnl - a variable acl_libdirstem2, as a secondary possible value for 1352dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or 1353dnl "lib/amd64". 1354AC_DEFUN([AC_LIB_PREPARE_MULTILIB], 1355[ 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]) 1369 acl_libdirstem=lib 1370 acl_libdirstem2= 1371 case "$host_os" in 1372 solaris*) 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], [ 1380#ifdef _LP64 1381sixtyfour bits 1382#endif 1383 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) 1384 ]) 1385 if test $gl_cv_solaris_64bit = yes; then 1386 acl_libdirstem=lib/64 1387 case "$host_cpu" in 1388 sparc*) acl_libdirstem2=lib/sparcv9 ;; 1389 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; 1390 esac 1391 fi 1392 ;; 1393 *) 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 ;; 1401 */../ | */.. ) 1402 # Better ignore directories of this form. They are misleading. 1403 ;; 1404 *) searchdir=`cd "$searchdir" && pwd` 1405 case "$searchdir" in 1406 */lib64 ) acl_libdirstem=lib64 ;; 1407 esac ;; 1408 esac 1409 fi 1410 done 1411 IFS="$acl_save_IFS" 1412 fi 1413 ;; 1414 esac 1415 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" 1416]) 1417 1418dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1419dnl serial 11 (pkg-config-0.29.1) 1420dnl 1421dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 1422dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> 1423dnl 1424dnl This program is free software; you can redistribute it and/or modify 1425dnl it under the terms of the GNU General Public License as published by 1426dnl the Free Software Foundation; either version 2 of the License, or 1427dnl (at your option) any later version. 1428dnl 1429dnl This program is distributed in the hope that it will be useful, but 1430dnl WITHOUT ANY WARRANTY; without even the implied warranty of 1431dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1432dnl General Public License for more details. 1433dnl 1434dnl You should have received a copy of the GNU General Public License 1435dnl along with this program; if not, write to the Free Software 1436dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 1437dnl 02111-1307, USA. 1438dnl 1439dnl As a special exception to the GNU General Public License, if you 1440dnl distribute this file as part of a program that contains a 1441dnl configuration script generated by Autoconf, you may include it under 1442dnl the same distribution terms that you use for the rest of that 1443dnl program. 1444 1445dnl PKG_PREREQ(MIN-VERSION) 1446dnl ----------------------- 1447dnl Since: 0.29 1448dnl 1449dnl Verify that the version of the pkg-config macros are at least 1450dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's 1451dnl installed version of pkg-config, this checks the developer's version 1452dnl of pkg.m4 when generating configure. 1453dnl 1454dnl To ensure that this macro is defined, also add: 1455dnl m4_ifndef([PKG_PREREQ], 1456dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) 1457dnl 1458dnl See the "Since" comment for each macro you use to see what version 1459dnl of the macros you require. 1460m4_defun([PKG_PREREQ], 1461[m4_define([PKG_MACROS_VERSION], [0.29.1]) 1462m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, 1463 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) 1464])dnl PKG_PREREQ 1465 1466dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) 1467dnl ---------------------------------- 1468dnl Since: 0.16 1469dnl 1470dnl Search for the pkg-config tool and set the PKG_CONFIG variable to 1471dnl first found in the path. Checks that the version of pkg-config found 1472dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is 1473dnl used since that's the first version where most current features of 1474dnl pkg-config existed. 1475AC_DEFUN([PKG_PROG_PKG_CONFIG], 1476[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 1477m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) 1478m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 1479AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 1480AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 1481AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 1482 1483if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 1484 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 1485fi 1486if test -n "$PKG_CONFIG"; then 1487 _pkg_min_version=m4_default([$1], [0.9.0]) 1488 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 1489 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 1490 AC_MSG_RESULT([yes]) 1491 else 1492 AC_MSG_RESULT([no]) 1493 PKG_CONFIG="" 1494 fi 1495fi[]dnl 1496])dnl PKG_PROG_PKG_CONFIG 1497 1498dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1499dnl ------------------------------------------------------------------- 1500dnl Since: 0.18 1501dnl 1502dnl Check to see whether a particular set of modules exists. Similar to 1503dnl PKG_CHECK_MODULES(), but does not set variables or print errors. 1504dnl 1505dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1506dnl only at the first occurence in configure.ac, so if the first place 1507dnl it's called might be skipped (such as if it is within an "if", you 1508dnl have to call PKG_CHECK_EXISTS manually 1509AC_DEFUN([PKG_CHECK_EXISTS], 1510[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1511if test -n "$PKG_CONFIG" && \ 1512 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 1513 m4_default([$2], [:]) 1514m4_ifvaln([$3], [else 1515 $3])dnl 1516fi]) 1517 1518dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 1519dnl --------------------------------------------- 1520dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting 1521dnl pkg_failed based on the result. 1522m4_define([_PKG_CONFIG], 1523[if test -n "$$1"; then 1524 pkg_cv_[]$1="$$1" 1525 elif test -n "$PKG_CONFIG"; then 1526 PKG_CHECK_EXISTS([$3], 1527 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` 1528 test "x$?" != "x0" && pkg_failed=yes ], 1529 [pkg_failed=yes]) 1530 else 1531 pkg_failed=untried 1532fi[]dnl 1533])dnl _PKG_CONFIG 1534 1535dnl _PKG_SHORT_ERRORS_SUPPORTED 1536dnl --------------------------- 1537dnl Internal check to see if pkg-config supports short errors. 1538AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1539[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1540if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1541 _pkg_short_errors_supported=yes 1542else 1543 _pkg_short_errors_supported=no 1544fi[]dnl 1545])dnl _PKG_SHORT_ERRORS_SUPPORTED 1546 1547 1548dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1549dnl [ACTION-IF-NOT-FOUND]) 1550dnl -------------------------------------------------------------- 1551dnl Since: 0.4.0 1552dnl 1553dnl Note that if there is a possibility the first call to 1554dnl PKG_CHECK_MODULES might not happen, you should be sure to include an 1555dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1556AC_DEFUN([PKG_CHECK_MODULES], 1557[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1558AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1559AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1560 1561pkg_failed=no 1562AC_MSG_CHECKING([for $1]) 1563 1564_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1565_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1566 1567m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1568and $1[]_LIBS to avoid the need to call pkg-config. 1569See the pkg-config man page for more details.]) 1570 1571if test $pkg_failed = yes; then 1572 AC_MSG_RESULT([no]) 1573 _PKG_SHORT_ERRORS_SUPPORTED 1574 if test $_pkg_short_errors_supported = yes; then 1575 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` 1576 else 1577 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` 1578 fi 1579 # Put the nasty error message in config.log where it belongs 1580 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1581 1582 m4_default([$4], [AC_MSG_ERROR( 1583[Package requirements ($2) were not met: 1584 1585$$1_PKG_ERRORS 1586 1587Consider adjusting the PKG_CONFIG_PATH environment variable if you 1588installed software in a non-standard prefix. 1589 1590_PKG_TEXT])[]dnl 1591 ]) 1592elif test $pkg_failed = untried; then 1593 AC_MSG_RESULT([no]) 1594 m4_default([$4], [AC_MSG_FAILURE( 1595[The pkg-config script could not be found or is too old. Make sure it 1596is in your PATH or set the PKG_CONFIG environment variable to the full 1597path to pkg-config. 1598 1599_PKG_TEXT 1600 1601To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl 1602 ]) 1603else 1604 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1605 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1606 AC_MSG_RESULT([yes]) 1607 $3 1608fi[]dnl 1609])dnl PKG_CHECK_MODULES 1610 1611 1612dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1613dnl [ACTION-IF-NOT-FOUND]) 1614dnl --------------------------------------------------------------------- 1615dnl Since: 0.29 1616dnl 1617dnl Checks for existence of MODULES and gathers its build flags with 1618dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags 1619dnl and VARIABLE-PREFIX_LIBS from --libs. 1620dnl 1621dnl Note that if there is a possibility the first call to 1622dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to 1623dnl include an explicit call to PKG_PROG_PKG_CONFIG in your 1624dnl configure.ac. 1625AC_DEFUN([PKG_CHECK_MODULES_STATIC], 1626[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1627_save_PKG_CONFIG=$PKG_CONFIG 1628PKG_CONFIG="$PKG_CONFIG --static" 1629PKG_CHECK_MODULES($@) 1630PKG_CONFIG=$_save_PKG_CONFIG[]dnl 1631])dnl PKG_CHECK_MODULES_STATIC 1632 1633 1634dnl PKG_INSTALLDIR([DIRECTORY]) 1635dnl ------------------------- 1636dnl Since: 0.27 1637dnl 1638dnl Substitutes the variable pkgconfigdir as the location where a module 1639dnl should install pkg-config .pc files. By default the directory is 1640dnl $libdir/pkgconfig, but the default can be changed by passing 1641dnl DIRECTORY. The user can override through the --with-pkgconfigdir 1642dnl parameter. 1643AC_DEFUN([PKG_INSTALLDIR], 1644[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 1645m4_pushdef([pkg_description], 1646 [pkg-config installation directory @<:@]pkg_default[@:>@]) 1647AC_ARG_WITH([pkgconfigdir], 1648 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 1649 [with_pkgconfigdir=]pkg_default) 1650AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 1651m4_popdef([pkg_default]) 1652m4_popdef([pkg_description]) 1653])dnl PKG_INSTALLDIR 1654 1655 1656dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) 1657dnl -------------------------------- 1658dnl Since: 0.27 1659dnl 1660dnl Substitutes the variable noarch_pkgconfigdir as the location where a 1661dnl module should install arch-independent pkg-config .pc files. By 1662dnl default the directory is $datadir/pkgconfig, but the default can be 1663dnl changed by passing DIRECTORY. The user can override through the 1664dnl --with-noarch-pkgconfigdir parameter. 1665AC_DEFUN([PKG_NOARCH_INSTALLDIR], 1666[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 1667m4_pushdef([pkg_description], 1668 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 1669AC_ARG_WITH([noarch-pkgconfigdir], 1670 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 1671 [with_noarch_pkgconfigdir=]pkg_default) 1672AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 1673m4_popdef([pkg_default]) 1674m4_popdef([pkg_description]) 1675])dnl PKG_NOARCH_INSTALLDIR 1676 1677 1678dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 1679dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1680dnl ------------------------------------------- 1681dnl Since: 0.28 1682dnl 1683dnl Retrieves the value of the pkg-config variable for the given module. 1684AC_DEFUN([PKG_CHECK_VAR], 1685[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1686AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 1687 1688_PKG_CONFIG([$1], [variable="][$3]["], [$2]) 1689AS_VAR_COPY([$1], [pkg_cv_][$1]) 1690 1691AS_VAR_IF([$1], [""], [$5], [$4])dnl 1692])dnl PKG_CHECK_VAR 1693 1694# Copyright (C) 2002-2017 Free Software Foundation, Inc. 1695# 1696# This file is free software; the Free Software Foundation 1697# gives unlimited permission to copy and/or distribute it, 1698# with or without modifications, as long as this notice is preserved. 1699 1700# AM_AUTOMAKE_VERSION(VERSION) 1701# ---------------------------- 1702# Automake X.Y traces this macro to ensure aclocal.m4 has been 1703# generated from the m4 files accompanying Automake X.Y. 1704# (This private macro should not be called outside this file.) 1705AC_DEFUN([AM_AUTOMAKE_VERSION], 1706[am__api_version='1.15' 1707dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 1708dnl require some minimum version. Point them to the right macro. 1709m4_if([$1], [1.15.1], [], 1710 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 1711]) 1712 1713# _AM_AUTOCONF_VERSION(VERSION) 1714# ----------------------------- 1715# aclocal traces this macro to find the Autoconf version. 1716# This is a private macro too. Using m4_define simplifies 1717# the logic in aclocal, which can simply ignore this definition. 1718m4_define([_AM_AUTOCONF_VERSION], []) 1719 1720# AM_SET_CURRENT_AUTOMAKE_VERSION 1721# ------------------------------- 1722# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 1723# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 1724AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 1725[AM_AUTOMAKE_VERSION([1.15.1])dnl 1726m4_ifndef([AC_AUTOCONF_VERSION], 1727 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 1728_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 1729 1730# Copyright (C) 2011-2017 Free Software Foundation, Inc. 1731# 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. 1735 1736# AM_PROG_AR([ACT-IF-FAIL]) 1737# ------------------------- 1738# Try to determine the archiver interface, and trigger the ar-lib wrapper 1739# if it is needed. If the detection of archiver interface fails, run 1740# ACT-IF-FAIL (default is to abort configure with a proper error message). 1741AC_DEFUN([AM_PROG_AR], 1742[AC_BEFORE([$0], [LT_INIT])dnl 1743AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl 1744AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 1745AC_REQUIRE_AUX_FILE([ar-lib])dnl 1746AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) 1747: ${AR=ar} 1748 1749AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], 1750 [AC_LANG_PUSH([C]) 1751 am_cv_ar_interface=ar 1752 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], 1753 [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' 1754 AC_TRY_EVAL([am_ar_try]) 1755 if test "$ac_status" -eq 0; then 1756 am_cv_ar_interface=ar 1757 else 1758 am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' 1759 AC_TRY_EVAL([am_ar_try]) 1760 if test "$ac_status" -eq 0; then 1761 am_cv_ar_interface=lib 1762 else 1763 am_cv_ar_interface=unknown 1764 fi 1765 fi 1766 rm -f conftest.lib libconftest.a 1767 ]) 1768 AC_LANG_POP([C])]) 1769 1770case $am_cv_ar_interface in 1771ar) 1772 ;; 1773lib) 1774 # Microsoft lib, so override with the ar-lib wrapper script. 1775 # FIXME: It is wrong to rewrite AR. 1776 # But if we don't then we get into trouble of one sort or another. 1777 # A longer-term fix would be to have automake use am__AR in this case, 1778 # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something 1779 # similar. 1780 AR="$am_aux_dir/ar-lib $AR" 1781 ;; 1782unknown) 1783 m4_default([$1], 1784 [AC_MSG_ERROR([could not determine $AR interface])]) 1785 ;; 1786esac 1787AC_SUBST([AR])dnl 1788]) 1789 1790# AM_AUX_DIR_EXPAND -*- Autoconf -*- 1791 1792# Copyright (C) 2001-2017 Free Software Foundation, Inc. 1793# 1794# This file is free software; the Free Software Foundation 1795# gives unlimited permission to copy and/or distribute it, 1796# with or without modifications, as long as this notice is preserved. 1797 1798# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 1799# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 1800# '$srcdir', '$srcdir/..', or '$srcdir/../..'. 1801# 1802# Of course, Automake must honor this variable whenever it calls a 1803# tool from the auxiliary directory. The problem is that $srcdir (and 1804# therefore $ac_aux_dir as well) can be either absolute or relative, 1805# depending on how configure is run. This is pretty annoying, since 1806# it makes $ac_aux_dir quite unusable in subdirectories: in the top 1807# source directory, any form will work fine, but in subdirectories a 1808# relative path needs to be adjusted first. 1809# 1810# $ac_aux_dir/missing 1811# fails when called from a subdirectory if $ac_aux_dir is relative 1812# $top_srcdir/$ac_aux_dir/missing 1813# fails if $ac_aux_dir is absolute, 1814# fails when called from a subdirectory in a VPATH build with 1815# a relative $ac_aux_dir 1816# 1817# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 1818# are both prefixed by $srcdir. In an in-source build this is usually 1819# harmless because $srcdir is '.', but things will broke when you 1820# start a VPATH build or use an absolute $srcdir. 1821# 1822# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 1823# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 1824# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 1825# and then we would define $MISSING as 1826# MISSING="\${SHELL} $am_aux_dir/missing" 1827# This will work as long as MISSING is not called from configure, because 1828# unfortunately $(top_srcdir) has no meaning in configure. 1829# However there are other variables, like CC, which are often used in 1830# configure, and could therefore not use this "fixed" $ac_aux_dir. 1831# 1832# Another solution, used here, is to always expand $ac_aux_dir to an 1833# absolute PATH. The drawback is that using absolute paths prevent a 1834# configured tree to be moved without reconfiguration. 1835 1836AC_DEFUN([AM_AUX_DIR_EXPAND], 1837[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 1838# Expand $ac_aux_dir to an absolute path. 1839am_aux_dir=`cd "$ac_aux_dir" && pwd` 1840]) 1841 1842# AM_CONDITIONAL -*- Autoconf -*- 1843 1844# Copyright (C) 1997-2017 Free Software Foundation, Inc. 1845# 1846# This file is free software; the Free Software Foundation 1847# gives unlimited permission to copy and/or distribute it, 1848# with or without modifications, as long as this notice is preserved. 1849 1850# AM_CONDITIONAL(NAME, SHELL-CONDITION) 1851# ------------------------------------- 1852# Define a conditional. 1853AC_DEFUN([AM_CONDITIONAL], 1854[AC_PREREQ([2.52])dnl 1855 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 1856 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 1857AC_SUBST([$1_TRUE])dnl 1858AC_SUBST([$1_FALSE])dnl 1859_AM_SUBST_NOTMAKE([$1_TRUE])dnl 1860_AM_SUBST_NOTMAKE([$1_FALSE])dnl 1861m4_define([_AM_COND_VALUE_$1], [$2])dnl 1862if $2; then 1863 $1_TRUE= 1864 $1_FALSE='#' 1865else 1866 $1_TRUE='#' 1867 $1_FALSE= 1868fi 1869AC_CONFIG_COMMANDS_PRE( 1870[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 1871 AC_MSG_ERROR([[conditional "$1" was never defined. 1872Usually this means the macro was only invoked conditionally.]]) 1873fi])]) 1874 1875# Copyright (C) 1999-2017 Free Software Foundation, Inc. 1876# 1877# This file is free software; the Free Software Foundation 1878# gives unlimited permission to copy and/or distribute it, 1879# with or without modifications, as long as this notice is preserved. 1880 1881 1882# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 1883# written in clear, in which case automake, when reading aclocal.m4, 1884# will think it sees a *use*, and therefore will trigger all it's 1885# C support machinery. Also note that it means that autoscan, seeing 1886# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1887 1888 1889# _AM_DEPENDENCIES(NAME) 1890# ---------------------- 1891# See how the compiler implements dependency checking. 1892# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 1893# We try a few techniques and use that to set a single cache variable. 1894# 1895# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 1896# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 1897# dependency, and given that the user is not expected to run this macro, 1898# just rely on AC_PROG_CC. 1899AC_DEFUN([_AM_DEPENDENCIES], 1900[AC_REQUIRE([AM_SET_DEPDIR])dnl 1901AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 1902AC_REQUIRE([AM_MAKE_INCLUDE])dnl 1903AC_REQUIRE([AM_DEP_TRACK])dnl 1904 1905m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 1906 [$1], [CXX], [depcc="$CXX" am_compiler_list=], 1907 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 1908 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 1909 [$1], [UPC], [depcc="$UPC" am_compiler_list=], 1910 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 1911 [depcc="$$1" am_compiler_list=]) 1912 1913AC_CACHE_CHECK([dependency style of $depcc], 1914 [am_cv_$1_dependencies_compiler_type], 1915[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 1916 # We make a subdir and do the tests there. Otherwise we can end up 1917 # making bogus files that we don't know about and never remove. For 1918 # instance it was reported that on HP-UX the gcc test will end up 1919 # making a dummy file named 'D' -- because '-MD' means "put the output 1920 # in D". 1921 rm -rf conftest.dir 1922 mkdir conftest.dir 1923 # Copy depcomp to subdir because otherwise we won't find it if we're 1924 # using a relative directory. 1925 cp "$am_depcomp" conftest.dir 1926 cd conftest.dir 1927 # We will build objects and dependencies in a subdirectory because 1928 # it helps to detect inapplicable dependency modes. For instance 1929 # both Tru64's cc and ICC support -MD to output dependencies as a 1930 # side effect of compilation, but ICC will put the dependencies in 1931 # the current directory while Tru64 will put them in the object 1932 # directory. 1933 mkdir sub 1934 1935 am_cv_$1_dependencies_compiler_type=none 1936 if test "$am_compiler_list" = ""; then 1937 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 1938 fi 1939 am__universal=false 1940 m4_case([$1], [CC], 1941 [case " $depcc " in #( 1942 *\ -arch\ *\ -arch\ *) am__universal=true ;; 1943 esac], 1944 [CXX], 1945 [case " $depcc " in #( 1946 *\ -arch\ *\ -arch\ *) am__universal=true ;; 1947 esac]) 1948 1949 for depmode in $am_compiler_list; do 1950 # Setup a source with many dependencies, because some compilers 1951 # like to wrap large dependency lists on column 80 (with \), and 1952 # we should not choose a depcomp mode which is confused by this. 1953 # 1954 # We need to recreate these files for each test, as the compiler may 1955 # overwrite some of them when testing with obscure command lines. 1956 # This happens at least with the AIX C compiler. 1957 : > sub/conftest.c 1958 for i in 1 2 3 4 5 6; do 1959 echo '#include "conftst'$i'.h"' >> sub/conftest.c 1960 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 1961 # Solaris 10 /bin/sh. 1962 echo '/* dummy */' > sub/conftst$i.h 1963 done 1964 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 1965 1966 # We check with '-c' and '-o' for the sake of the "dashmstdout" 1967 # mode. It turns out that the SunPro C++ compiler does not properly 1968 # handle '-M -o', and we need to detect this. Also, some Intel 1969 # versions had trouble with output in subdirs. 1970 am__obj=sub/conftest.${OBJEXT-o} 1971 am__minus_obj="-o $am__obj" 1972 case $depmode in 1973 gcc) 1974 # This depmode causes a compiler race in universal mode. 1975 test "$am__universal" = false || continue 1976 ;; 1977 nosideeffect) 1978 # After this tag, mechanisms are not by side-effect, so they'll 1979 # only be used when explicitly requested. 1980 if test "x$enable_dependency_tracking" = xyes; then 1981 continue 1982 else 1983 break 1984 fi 1985 ;; 1986 msvc7 | msvc7msys | msvisualcpp | msvcmsys) 1987 # This compiler won't grok '-c -o', but also, the minuso test has 1988 # not run yet. These depmodes are late enough in the game, and 1989 # so weak that their functioning should not be impacted. 1990 am__obj=conftest.${OBJEXT-o} 1991 am__minus_obj= 1992 ;; 1993 none) break ;; 1994 esac 1995 if depmode=$depmode \ 1996 source=sub/conftest.c object=$am__obj \ 1997 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 1998 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 1999 >/dev/null 2>conftest.err && 2000 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 2001 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 2002 grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 2003 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 2004 # icc doesn't choke on unknown options, it will just issue warnings 2005 # or remarks (even with -Werror). So we grep stderr for any message 2006 # that says an option was ignored or not supported. 2007 # When given -MP, icc 7.0 and 7.1 complain thusly: 2008 # icc: Command line warning: ignoring option '-M'; no argument required 2009 # The diagnosis changed in icc 8.0: 2010 # icc: Command line remark: option '-MP' not supported 2011 if (grep 'ignoring option' conftest.err || 2012 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2013 am_cv_$1_dependencies_compiler_type=$depmode 2014 break 2015 fi 2016 fi 2017 done 2018 2019 cd .. 2020 rm -rf conftest.dir 2021else 2022 am_cv_$1_dependencies_compiler_type=none 2023fi 2024]) 2025AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2026AM_CONDITIONAL([am__fastdep$1], [ 2027 test "x$enable_dependency_tracking" != xno \ 2028 && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 2029]) 2030 2031 2032# AM_SET_DEPDIR 2033# ------------- 2034# Choose a directory name for dependency files. 2035# This macro is AC_REQUIREd in _AM_DEPENDENCIES. 2036AC_DEFUN([AM_SET_DEPDIR], 2037[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 2038AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 2039]) 2040 2041 2042# AM_DEP_TRACK 2043# ------------ 2044AC_DEFUN([AM_DEP_TRACK], 2045[AC_ARG_ENABLE([dependency-tracking], [dnl 2046AS_HELP_STRING( 2047 [--enable-dependency-tracking], 2048 [do not reject slow dependency extractors]) 2049AS_HELP_STRING( 2050 [--disable-dependency-tracking], 2051 [speeds up one-time build])]) 2052if test "x$enable_dependency_tracking" != xno; then 2053 am_depcomp="$ac_aux_dir/depcomp" 2054 AMDEPBACKSLASH='\' 2055 am__nodep='_no' 2056fi 2057AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 2058AC_SUBST([AMDEPBACKSLASH])dnl 2059_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 2060AC_SUBST([am__nodep])dnl 2061_AM_SUBST_NOTMAKE([am__nodep])dnl 2062]) 2063 2064# Generate code to set up dependency tracking. -*- Autoconf -*- 2065 2066# Copyright (C) 1999-2017 Free Software Foundation, Inc. 2067# 2068# This file is free software; the Free Software Foundation 2069# gives unlimited permission to copy and/or distribute it, 2070# with or without modifications, as long as this notice is preserved. 2071 2072 2073# _AM_OUTPUT_DEPENDENCY_COMMANDS 2074# ------------------------------ 2075AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 2076[{ 2077 # Older Autoconf quotes --file arguments for eval, but not when files 2078 # are listed without --file. Let's play safe and only enable the eval 2079 # if we detect the quoting. 2080 case $CONFIG_FILES in 2081 *\'*) eval set x "$CONFIG_FILES" ;; 2082 *) set x $CONFIG_FILES ;; 2083 esac 2084 shift 2085 for mf 2086 do 2087 # Strip MF so we end up with the name of the file. 2088 mf=`echo "$mf" | sed -e 's/:.*$//'` 2089 # Check whether this is an Automake generated Makefile or not. 2090 # We used to match only the files named 'Makefile.in', but 2091 # some people rename them; so instead we look at the file content. 2092 # Grep'ing the first line is not enough: some people post-process 2093 # each Makefile.in and add a new line on top of each file to say so. 2094 # Grep'ing the whole file is not good either: AIX grep has a line 2095 # limit of 2048, but all sed's we know have understand at least 4000. 2096 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 2097 dirpart=`AS_DIRNAME("$mf")` 2098 else 2099 continue 2100 fi 2101 # Extract the definition of DEPDIR, am__include, and am__quote 2102 # from the Makefile without running 'make'. 2103 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 2104 test -z "$DEPDIR" && continue 2105 am__include=`sed -n 's/^am__include = //p' < "$mf"` 2106 test -z "$am__include" && continue 2107 am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 2108 # Find all dependency output files, they are included files with 2109 # $(DEPDIR) in their names. We invoke sed twice because it is the 2110 # simplest approach to changing $(DEPDIR) to its actual value in the 2111 # expansion. 2112 for file in `sed -n " 2113 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 2114 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do 2115 # Make sure the directory exists. 2116 test -f "$dirpart/$file" && continue 2117 fdir=`AS_DIRNAME(["$file"])` 2118 AS_MKDIR_P([$dirpart/$fdir]) 2119 # echo "creating $dirpart/$file" 2120 echo '# dummy' > "$dirpart/$file" 2121 done 2122 done 2123} 2124])# _AM_OUTPUT_DEPENDENCY_COMMANDS 2125 2126 2127# AM_OUTPUT_DEPENDENCY_COMMANDS 2128# ----------------------------- 2129# This macro should only be invoked once -- use via AC_REQUIRE. 2130# 2131# This code is only required when automatic dependency tracking 2132# is enabled. FIXME. This creates each '.P' file that we will 2133# need in order to bootstrap the dependency handling code. 2134AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 2135[AC_CONFIG_COMMANDS([depfiles], 2136 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 2137 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 2138]) 2139 2140# Do all the work for Automake. -*- Autoconf -*- 2141 2142# Copyright (C) 1996-2017 Free Software Foundation, Inc. 2143# 2144# This file is free software; the Free Software Foundation 2145# gives unlimited permission to copy and/or distribute it, 2146# with or without modifications, as long as this notice is preserved. 2147 2148# This macro actually does too much. Some checks are only needed if 2149# your package does certain things. But this isn't really a big deal. 2150 2151dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 2152m4_define([AC_PROG_CC], 2153m4_defn([AC_PROG_CC]) 2154[_AM_PROG_CC_C_O 2155]) 2156 2157# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 2158# AM_INIT_AUTOMAKE([OPTIONS]) 2159# ----------------------------------------------- 2160# The call with PACKAGE and VERSION arguments is the old style 2161# call (pre autoconf-2.50), which is being phased out. PACKAGE 2162# and VERSION should now be passed to AC_INIT and removed from 2163# the call to AM_INIT_AUTOMAKE. 2164# We support both call styles for the transition. After 2165# the next Automake release, Autoconf can make the AC_INIT 2166# arguments mandatory, and then we can depend on a new Autoconf 2167# release and drop the old call support. 2168AC_DEFUN([AM_INIT_AUTOMAKE], 2169[AC_PREREQ([2.65])dnl 2170dnl Autoconf wants to disallow AM_ names. We explicitly allow 2171dnl the ones we care about. 2172m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 2173AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 2174AC_REQUIRE([AC_PROG_INSTALL])dnl 2175if test "`cd $srcdir && pwd`" != "`pwd`"; then 2176 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 2177 # is not polluted with repeated "-I." 2178 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 2179 # test to see if srcdir already configured 2180 if test -f $srcdir/config.status; then 2181 AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 2182 fi 2183fi 2184 2185# test whether we have cygpath 2186if test -z "$CYGPATH_W"; then 2187 if (cygpath --version) >/dev/null 2>/dev/null; then 2188 CYGPATH_W='cygpath -w' 2189 else 2190 CYGPATH_W=echo 2191 fi 2192fi 2193AC_SUBST([CYGPATH_W]) 2194 2195# Define the identity of the package. 2196dnl Distinguish between old-style and new-style calls. 2197m4_ifval([$2], 2198[AC_DIAGNOSE([obsolete], 2199 [$0: two- and three-arguments forms are deprecated.]) 2200m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 2201 AC_SUBST([PACKAGE], [$1])dnl 2202 AC_SUBST([VERSION], [$2])], 2203[_AM_SET_OPTIONS([$1])dnl 2204dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 2205m4_if( 2206 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), 2207 [ok:ok],, 2208 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 2209 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 2210 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 2211 2212_AM_IF_OPTION([no-define],, 2213[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 2214 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 2215 2216# Some tools Automake needs. 2217AC_REQUIRE([AM_SANITY_CHECK])dnl 2218AC_REQUIRE([AC_ARG_PROGRAM])dnl 2219AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 2220AM_MISSING_PROG([AUTOCONF], [autoconf]) 2221AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 2222AM_MISSING_PROG([AUTOHEADER], [autoheader]) 2223AM_MISSING_PROG([MAKEINFO], [makeinfo]) 2224AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 2225AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 2226AC_REQUIRE([AC_PROG_MKDIR_P])dnl 2227# For better backward compatibility. To be removed once Automake 1.9.x 2228# dies out for good. For more background, see: 2229# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 2230# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 2231AC_SUBST([mkdir_p], ['$(MKDIR_P)']) 2232# We need awk for the "check" target (and possibly the TAP driver). The 2233# system "awk" is bad on some platforms. 2234AC_REQUIRE([AC_PROG_AWK])dnl 2235AC_REQUIRE([AC_PROG_MAKE_SET])dnl 2236AC_REQUIRE([AM_SET_LEADING_DOT])dnl 2237_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 2238 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 2239 [_AM_PROG_TAR([v7])])]) 2240_AM_IF_OPTION([no-dependencies],, 2241[AC_PROVIDE_IFELSE([AC_PROG_CC], 2242 [_AM_DEPENDENCIES([CC])], 2243 [m4_define([AC_PROG_CC], 2244 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 2245AC_PROVIDE_IFELSE([AC_PROG_CXX], 2246 [_AM_DEPENDENCIES([CXX])], 2247 [m4_define([AC_PROG_CXX], 2248 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 2249AC_PROVIDE_IFELSE([AC_PROG_OBJC], 2250 [_AM_DEPENDENCIES([OBJC])], 2251 [m4_define([AC_PROG_OBJC], 2252 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 2253AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 2254 [_AM_DEPENDENCIES([OBJCXX])], 2255 [m4_define([AC_PROG_OBJCXX], 2256 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 2257]) 2258AC_REQUIRE([AM_SILENT_RULES])dnl 2259dnl The testsuite driver may need to know about EXEEXT, so add the 2260dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 2261dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 2262AC_CONFIG_COMMANDS_PRE(dnl 2263[m4_provide_if([_AM_COMPILER_EXEEXT], 2264 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 2265 2266# POSIX will say in a future version that running "rm -f" with no argument 2267# is OK; and we want to be able to make that assumption in our Makefile 2268# recipes. So use an aggressive probe to check that the usage we want is 2269# actually supported "in the wild" to an acceptable degree. 2270# See automake bug#10828. 2271# To make any issue more visible, cause the running configure to be aborted 2272# by default if the 'rm' program in use doesn't match our expectations; the 2273# user can still override this though. 2274if rm -f && rm -fr && rm -rf; then : OK; else 2275 cat >&2 <<'END' 2276Oops! 2277 2278Your 'rm' program seems unable to run without file operands specified 2279on the command line, even when the '-f' option is present. This is contrary 2280to the behaviour of most rm programs out there, and not conforming with 2281the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 2282 2283Please tell bug-automake@gnu.org about your system, including the value 2284of your $PATH and any error possibly output before this message. This 2285can help us improve future automake versions. 2286 2287END 2288 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 2289 echo 'Configuration will proceed anyway, since you have set the' >&2 2290 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 2291 echo >&2 2292 else 2293 cat >&2 <<'END' 2294Aborting the configuration process, to ensure you take notice of the issue. 2295 2296You can download and install GNU coreutils to get an 'rm' implementation 2297that behaves properly: <http://www.gnu.org/software/coreutils/>. 2298 2299If you want to complete the configuration process using your problematic 2300'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 2301to "yes", and re-run configure. 2302 2303END 2304 AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 2305 fi 2306fi 2307dnl The trailing newline in this macro's definition is deliberate, for 2308dnl backward compatibility and to allow trailing 'dnl'-style comments 2309dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. 2310]) 2311 2312dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 2313dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 2314dnl mangled by Autoconf and run in a shell conditional statement. 2315m4_define([_AC_COMPILER_EXEEXT], 2316m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 2317 2318# When config.status generates a header, we must update the stamp-h file. 2319# This file resides in the same directory as the config header 2320# that is generated. The stamp files are numbered to have different names. 2321 2322# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 2323# loop where config.status creates the headers, so we can generate 2324# our stamp files there. 2325AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 2326[# Compute $1's index in $config_headers. 2327_am_arg=$1 2328_am_stamp_count=1 2329for _am_header in $config_headers :; do 2330 case $_am_header in 2331 $_am_arg | $_am_arg:* ) 2332 break ;; 2333 * ) 2334 _am_stamp_count=`expr $_am_stamp_count + 1` ;; 2335 esac 2336done 2337echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 2338 2339# Copyright (C) 2001-2017 Free Software Foundation, Inc. 2340# 2341# This file is free software; the Free Software Foundation 2342# gives unlimited permission to copy and/or distribute it, 2343# with or without modifications, as long as this notice is preserved. 2344 2345# AM_PROG_INSTALL_SH 2346# ------------------ 2347# Define $install_sh. 2348AC_DEFUN([AM_PROG_INSTALL_SH], 2349[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 2350if test x"${install_sh+set}" != xset; then 2351 case $am_aux_dir in 2352 *\ * | *\ *) 2353 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 2354 *) 2355 install_sh="\${SHELL} $am_aux_dir/install-sh" 2356 esac 2357fi 2358AC_SUBST([install_sh])]) 2359 2360# Copyright (C) 2003-2017 Free Software Foundation, Inc. 2361# 2362# This file is free software; the Free Software Foundation 2363# gives unlimited permission to copy and/or distribute it, 2364# with or without modifications, as long as this notice is preserved. 2365 2366# Check whether the underlying file-system supports filenames 2367# with a leading dot. For instance MS-DOS doesn't. 2368AC_DEFUN([AM_SET_LEADING_DOT], 2369[rm -rf .tst 2>/dev/null 2370mkdir .tst 2>/dev/null 2371if test -d .tst; then 2372 am__leading_dot=. 2373else 2374 am__leading_dot=_ 2375fi 2376rmdir .tst 2>/dev/null 2377AC_SUBST([am__leading_dot])]) 2378 2379# Check to see how 'make' treats includes. -*- Autoconf -*- 2380 2381# Copyright (C) 2001-2017 Free Software Foundation, Inc. 2382# 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. 2386 2387# AM_MAKE_INCLUDE() 2388# ----------------- 2389# Check to see how make treats includes. 2390AC_DEFUN([AM_MAKE_INCLUDE], 2391[am_make=${MAKE-make} 2392cat > confinc << 'END' 2393am__doit: 2394 @echo this is the am__doit target 2395.PHONY: am__doit 2396END 2397# If we don't find an include directive, just comment out the code. 2398AC_MSG_CHECKING([for style of include used by $am_make]) 2399am__include="#" 2400am__quote= 2401_am_result=none 2402# First try GNU make style include. 2403echo "include confinc" > confmf 2404# Ignore all kinds of additional output from 'make'. 2405case `$am_make -s -f confmf 2> /dev/null` in #( 2406*the\ am__doit\ target*) 2407 am__include=include 2408 am__quote= 2409 _am_result=GNU 2410 ;; 2411esac 2412# Now try BSD make style include. 2413if test "$am__include" = "#"; then 2414 echo '.include "confinc"' > confmf 2415 case `$am_make -s -f confmf 2> /dev/null` in #( 2416 *the\ am__doit\ target*) 2417 am__include=.include 2418 am__quote="\"" 2419 _am_result=BSD 2420 ;; 2421 esac 2422fi 2423AC_SUBST([am__include]) 2424AC_SUBST([am__quote]) 2425AC_MSG_RESULT([$_am_result]) 2426rm -f confinc confmf 2427]) 2428 2429# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 2430 2431# Copyright (C) 1997-2017 Free Software Foundation, Inc. 2432# 2433# This file is free software; the Free Software Foundation 2434# gives unlimited permission to copy and/or distribute it, 2435# with or without modifications, as long as this notice is preserved. 2436 2437# AM_MISSING_PROG(NAME, PROGRAM) 2438# ------------------------------ 2439AC_DEFUN([AM_MISSING_PROG], 2440[AC_REQUIRE([AM_MISSING_HAS_RUN]) 2441$1=${$1-"${am_missing_run}$2"} 2442AC_SUBST($1)]) 2443 2444# AM_MISSING_HAS_RUN 2445# ------------------ 2446# Define MISSING if not defined so far and test if it is modern enough. 2447# If it is, set am_missing_run to use it, otherwise, to nothing. 2448AC_DEFUN([AM_MISSING_HAS_RUN], 2449[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 2450AC_REQUIRE_AUX_FILE([missing])dnl 2451if test x"${MISSING+set}" != xset; then 2452 case $am_aux_dir in 2453 *\ * | *\ *) 2454 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 2455 *) 2456 MISSING="\${SHELL} $am_aux_dir/missing" ;; 2457 esac 2458fi 2459# Use eval to expand $SHELL 2460if eval "$MISSING --is-lightweight"; then 2461 am_missing_run="$MISSING " 2462else 2463 am_missing_run= 2464 AC_MSG_WARN(['missing' script is too old or missing]) 2465fi 2466]) 2467 2468# Helper functions for option handling. -*- Autoconf -*- 2469 2470# Copyright (C) 2001-2017 Free Software Foundation, Inc. 2471# 2472# This file is free software; the Free Software Foundation 2473# gives unlimited permission to copy and/or distribute it, 2474# with or without modifications, as long as this notice is preserved. 2475 2476# _AM_MANGLE_OPTION(NAME) 2477# ----------------------- 2478AC_DEFUN([_AM_MANGLE_OPTION], 2479[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 2480 2481# _AM_SET_OPTION(NAME) 2482# -------------------- 2483# Set option NAME. Presently that only means defining a flag for this option. 2484AC_DEFUN([_AM_SET_OPTION], 2485[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 2486 2487# _AM_SET_OPTIONS(OPTIONS) 2488# ------------------------ 2489# OPTIONS is a space-separated list of Automake options. 2490AC_DEFUN([_AM_SET_OPTIONS], 2491[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 2492 2493# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 2494# ------------------------------------------- 2495# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 2496AC_DEFUN([_AM_IF_OPTION], 2497[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 2498 2499# Copyright (C) 1999-2017 Free Software Foundation, Inc. 2500# 2501# This file is free software; the Free Software Foundation 2502# gives unlimited permission to copy and/or distribute it, 2503# with or without modifications, as long as this notice is preserved. 2504 2505# _AM_PROG_CC_C_O 2506# --------------- 2507# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 2508# to automatically call this. 2509AC_DEFUN([_AM_PROG_CC_C_O], 2510[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 2511AC_REQUIRE_AUX_FILE([compile])dnl 2512AC_LANG_PUSH([C])dnl 2513AC_CACHE_CHECK( 2514 [whether $CC understands -c and -o together], 2515 [am_cv_prog_cc_c_o], 2516 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 2517 # Make sure it works both with $CC and with simple cc. 2518 # Following AC_PROG_CC_C_O, we do the test twice because some 2519 # compilers refuse to overwrite an existing .o file with -o, 2520 # though they will create one. 2521 am_cv_prog_cc_c_o=yes 2522 for am_i in 1 2; do 2523 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 2524 && test -f conftest2.$ac_objext; then 2525 : OK 2526 else 2527 am_cv_prog_cc_c_o=no 2528 break 2529 fi 2530 done 2531 rm -f core conftest* 2532 unset am_i]) 2533if test "$am_cv_prog_cc_c_o" != yes; then 2534 # Losing compiler, so override with the script. 2535 # FIXME: It is wrong to rewrite CC. 2536 # But if we don't then we get into trouble of one sort or another. 2537 # A longer-term fix would be to have automake use am__CC in this case, 2538 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 2539 CC="$am_aux_dir/compile $CC" 2540fi 2541AC_LANG_POP([C])]) 2542 2543# For backward compatibility. 2544AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 2545 2546# Copyright (C) 2001-2017 Free Software Foundation, Inc. 2547# 2548# This file is free software; the Free Software Foundation 2549# gives unlimited permission to copy and/or distribute it, 2550# with or without modifications, as long as this notice is preserved. 2551 2552# AM_RUN_LOG(COMMAND) 2553# ------------------- 2554# Run COMMAND, save the exit status in ac_status, and log it. 2555# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 2556AC_DEFUN([AM_RUN_LOG], 2557[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 2558 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 2559 ac_status=$? 2560 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 2561 (exit $ac_status); }]) 2562 2563# Check to make sure that the build environment is sane. -*- Autoconf -*- 2564 2565# Copyright (C) 1996-2017 Free Software Foundation, Inc. 2566# 2567# This file is free software; the Free Software Foundation 2568# gives unlimited permission to copy and/or distribute it, 2569# with or without modifications, as long as this notice is preserved. 2570 2571# AM_SANITY_CHECK 2572# --------------- 2573AC_DEFUN([AM_SANITY_CHECK], 2574[AC_MSG_CHECKING([whether build environment is sane]) 2575# Reject unsafe characters in $srcdir or the absolute working directory 2576# name. Accept space and tab only in the latter. 2577am_lf=' 2578' 2579case `pwd` in 2580 *[[\\\"\#\$\&\'\`$am_lf]]*) 2581 AC_MSG_ERROR([unsafe absolute working directory name]);; 2582esac 2583case $srcdir in 2584 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 2585 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 2586esac 2587 2588# Do 'set' in a subshell so we don't clobber the current shell's 2589# arguments. Must try -L first in case configure is actually a 2590# symlink; some systems play weird games with the mod time of symlinks 2591# (eg FreeBSD returns the mod time of the symlink's containing 2592# directory). 2593if ( 2594 am_has_slept=no 2595 for am_try in 1 2; do 2596 echo "timestamp, slept: $am_has_slept" > conftest.file 2597 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 2598 if test "$[*]" = "X"; then 2599 # -L didn't work. 2600 set X `ls -t "$srcdir/configure" conftest.file` 2601 fi 2602 if test "$[*]" != "X $srcdir/configure conftest.file" \ 2603 && test "$[*]" != "X conftest.file $srcdir/configure"; then 2604 2605 # If neither matched, then we have a broken ls. This can happen 2606 # if, for instance, CONFIG_SHELL is bash and it inherits a 2607 # broken ls alias from the environment. This has actually 2608 # happened. Such a system could not be considered "sane". 2609 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 2610 alias in your environment]) 2611 fi 2612 if test "$[2]" = conftest.file || test $am_try -eq 2; then 2613 break 2614 fi 2615 # Just in case. 2616 sleep 1 2617 am_has_slept=yes 2618 done 2619 test "$[2]" = conftest.file 2620 ) 2621then 2622 # Ok. 2623 : 2624else 2625 AC_MSG_ERROR([newly created file is older than distributed files! 2626Check your system clock]) 2627fi 2628AC_MSG_RESULT([yes]) 2629# If we didn't sleep, we still need to ensure time stamps of config.status and 2630# generated files are strictly newer. 2631am_sleep_pid= 2632if grep 'slept: no' conftest.file >/dev/null 2>&1; then 2633 ( sleep 1 ) & 2634 am_sleep_pid=$! 2635fi 2636AC_CONFIG_COMMANDS_PRE( 2637 [AC_MSG_CHECKING([that generated files are newer than configure]) 2638 if test -n "$am_sleep_pid"; then 2639 # Hide warnings about reused PIDs. 2640 wait $am_sleep_pid 2>/dev/null 2641 fi 2642 AC_MSG_RESULT([done])]) 2643rm -f conftest.file 2644]) 2645 2646# Copyright (C) 2009-2017 Free Software Foundation, Inc. 2647# 2648# This file is free software; the Free Software Foundation 2649# gives unlimited permission to copy and/or distribute it, 2650# with or without modifications, as long as this notice is preserved. 2651 2652# AM_SILENT_RULES([DEFAULT]) 2653# -------------------------- 2654# Enable less verbose build rules; with the default set to DEFAULT 2655# ("yes" being less verbose, "no" or empty being verbose). 2656AC_DEFUN([AM_SILENT_RULES], 2657[AC_ARG_ENABLE([silent-rules], [dnl 2658AS_HELP_STRING( 2659 [--enable-silent-rules], 2660 [less verbose build output (undo: "make V=1")]) 2661AS_HELP_STRING( 2662 [--disable-silent-rules], 2663 [verbose build output (undo: "make V=0")])dnl 2664]) 2665case $enable_silent_rules in @%:@ ((( 2666 yes) AM_DEFAULT_VERBOSITY=0;; 2667 no) AM_DEFAULT_VERBOSITY=1;; 2668 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 2669esac 2670dnl 2671dnl A few 'make' implementations (e.g., NonStop OS and NextStep) 2672dnl do not support nested variable expansions. 2673dnl See automake bug#9928 and bug#10237. 2674am_make=${MAKE-make} 2675AC_CACHE_CHECK([whether $am_make supports nested variables], 2676 [am_cv_make_support_nested_variables], 2677 [if AS_ECHO([['TRUE=$(BAR$(V)) 2678BAR0=false 2679BAR1=true 2680V=1 2681am__doit: 2682 @$(TRUE) 2683.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 2684 am_cv_make_support_nested_variables=yes 2685else 2686 am_cv_make_support_nested_variables=no 2687fi]) 2688if test $am_cv_make_support_nested_variables = yes; then 2689 dnl Using '$V' instead of '$(V)' breaks IRIX make. 2690 AM_V='$(V)' 2691 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 2692else 2693 AM_V=$AM_DEFAULT_VERBOSITY 2694 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 2695fi 2696AC_SUBST([AM_V])dnl 2697AM_SUBST_NOTMAKE([AM_V])dnl 2698AC_SUBST([AM_DEFAULT_V])dnl 2699AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 2700AC_SUBST([AM_DEFAULT_VERBOSITY])dnl 2701AM_BACKSLASH='\' 2702AC_SUBST([AM_BACKSLASH])dnl 2703_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 2704]) 2705 2706# Copyright (C) 2001-2017 Free Software Foundation, Inc. 2707# 2708# This file is free software; the Free Software Foundation 2709# gives unlimited permission to copy and/or distribute it, 2710# with or without modifications, as long as this notice is preserved. 2711 2712# AM_PROG_INSTALL_STRIP 2713# --------------------- 2714# One issue with vendor 'install' (even GNU) is that you can't 2715# specify the program used to strip binaries. This is especially 2716# annoying in cross-compiling environments, where the build's strip 2717# is unlikely to handle the host's binaries. 2718# Fortunately install-sh will honor a STRIPPROG variable, so we 2719# always use install-sh in "make install-strip", and initialize 2720# STRIPPROG with the value of the STRIP variable (set by the user). 2721AC_DEFUN([AM_PROG_INSTALL_STRIP], 2722[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 2723# Installed binaries are usually stripped using 'strip' when the user 2724# run "make install-strip". However 'strip' might not be the right 2725# tool to use in cross-compilation environments, therefore Automake 2726# will honor the 'STRIP' environment variable to overrule this program. 2727dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 2728if test "$cross_compiling" != no; then 2729 AC_CHECK_TOOL([STRIP], [strip], :) 2730fi 2731INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 2732AC_SUBST([INSTALL_STRIP_PROGRAM])]) 2733 2734# Copyright (C) 2006-2017 Free Software Foundation, Inc. 2735# 2736# This file is free software; the Free Software Foundation 2737# gives unlimited permission to copy and/or distribute it, 2738# with or without modifications, as long as this notice is preserved. 2739 2740# _AM_SUBST_NOTMAKE(VARIABLE) 2741# --------------------------- 2742# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 2743# This macro is traced by Automake. 2744AC_DEFUN([_AM_SUBST_NOTMAKE]) 2745 2746# AM_SUBST_NOTMAKE(VARIABLE) 2747# -------------------------- 2748# Public sister of _AM_SUBST_NOTMAKE. 2749AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 2750 2751# Check how to create a tarball. -*- Autoconf -*- 2752 2753# Copyright (C) 2004-2017 Free Software Foundation, Inc. 2754# 2755# This file is free software; the Free Software Foundation 2756# gives unlimited permission to copy and/or distribute it, 2757# with or without modifications, as long as this notice is preserved. 2758 2759# _AM_PROG_TAR(FORMAT) 2760# -------------------- 2761# Check how to create a tarball in format FORMAT. 2762# FORMAT should be one of 'v7', 'ustar', or 'pax'. 2763# 2764# Substitute a variable $(am__tar) that is a command 2765# writing to stdout a FORMAT-tarball containing the directory 2766# $tardir. 2767# tardir=directory && $(am__tar) > result.tar 2768# 2769# Substitute a variable $(am__untar) that extract such 2770# a tarball read from stdin. 2771# $(am__untar) < result.tar 2772# 2773AC_DEFUN([_AM_PROG_TAR], 2774[# Always define AMTAR for backward compatibility. Yes, it's still used 2775# in the wild :-( We should find a proper way to deprecate it ... 2776AC_SUBST([AMTAR], ['$${TAR-tar}']) 2777 2778# We'll loop over all known methods to create a tar archive until one works. 2779_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 2780 2781m4_if([$1], [v7], 2782 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 2783 2784 [m4_case([$1], 2785 [ustar], 2786 [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 2787 # There is notably a 21 bits limit for the UID and the GID. In fact, 2788 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 2789 # and bug#13588). 2790 am_max_uid=2097151 # 2^21 - 1 2791 am_max_gid=$am_max_uid 2792 # The $UID and $GID variables are not portable, so we need to resort 2793 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 2794 # below are definitely unexpected, so allow the users to see them 2795 # (that is, avoid stderr redirection). 2796 am_uid=`id -u || echo unknown` 2797 am_gid=`id -g || echo unknown` 2798 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 2799 if test $am_uid -le $am_max_uid; then 2800 AC_MSG_RESULT([yes]) 2801 else 2802 AC_MSG_RESULT([no]) 2803 _am_tools=none 2804 fi 2805 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 2806 if test $am_gid -le $am_max_gid; then 2807 AC_MSG_RESULT([yes]) 2808 else 2809 AC_MSG_RESULT([no]) 2810 _am_tools=none 2811 fi], 2812 2813 [pax], 2814 [], 2815 2816 [m4_fatal([Unknown tar format])]) 2817 2818 AC_MSG_CHECKING([how to create a $1 tar archive]) 2819 2820 # Go ahead even if we have the value already cached. We do so because we 2821 # need to set the values for the 'am__tar' and 'am__untar' variables. 2822 _am_tools=${am_cv_prog_tar_$1-$_am_tools} 2823 2824 for _am_tool in $_am_tools; do 2825 case $_am_tool in 2826 gnutar) 2827 for _am_tar in tar gnutar gtar; do 2828 AM_RUN_LOG([$_am_tar --version]) && break 2829 done 2830 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 2831 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 2832 am__untar="$_am_tar -xf -" 2833 ;; 2834 plaintar) 2835 # Must skip GNU tar: if it does not support --format= it doesn't create 2836 # ustar tarball either. 2837 (tar --version) >/dev/null 2>&1 && continue 2838 am__tar='tar chf - "$$tardir"' 2839 am__tar_='tar chf - "$tardir"' 2840 am__untar='tar xf -' 2841 ;; 2842 pax) 2843 am__tar='pax -L -x $1 -w "$$tardir"' 2844 am__tar_='pax -L -x $1 -w "$tardir"' 2845 am__untar='pax -r' 2846 ;; 2847 cpio) 2848 am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 2849 am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 2850 am__untar='cpio -i -H $1 -d' 2851 ;; 2852 none) 2853 am__tar=false 2854 am__tar_=false 2855 am__untar=false 2856 ;; 2857 esac 2858 2859 # If the value was cached, stop now. We just wanted to have am__tar 2860 # and am__untar set. 2861 test -n "${am_cv_prog_tar_$1}" && break 2862 2863 # tar/untar a dummy directory, and stop if the command works. 2864 rm -rf conftest.dir 2865 mkdir conftest.dir 2866 echo GrepMe > conftest.dir/file 2867 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 2868 rm -rf conftest.dir 2869 if test -s conftest.tar; then 2870 AM_RUN_LOG([$am__untar <conftest.tar]) 2871 AM_RUN_LOG([cat conftest.dir/file]) 2872 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 2873 fi 2874 done 2875 rm -rf conftest.dir 2876 2877 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 2878 AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 2879 2880AC_SUBST([am__tar]) 2881AC_SUBST([am__untar]) 2882]) # _AM_PROG_TAR 2883 2884m4_include([acinclude.m4]) 2885