1# generated automatically by aclocal 1.10 -*- Autoconf -*- 2 3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4# 2005, 2006 Free Software Foundation, Inc. 5# This file is free software; the Free Software Foundation 6# gives unlimited permission to copy and/or distribute it, 7# with or without modifications, as long as this notice is preserved. 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 14 15# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. 16# 17# This file is free software; the Free Software Foundation 18# gives unlimited permission to copy and/or distribute it, 19# with or without modifications, as long as this notice is preserved. 20 21# AM_AUTOMAKE_VERSION(VERSION) 22# ---------------------------- 23# Automake X.Y traces this macro to ensure aclocal.m4 has been 24# generated from the m4 files accompanying Automake X.Y. 25# (This private macro should not be called outside this file.) 26AC_DEFUN([AM_AUTOMAKE_VERSION], 27[am__api_version='1.10' 28dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 29dnl require some minimum version. Point them to the right macro. 30m4_if([$1], [1.10], [], 31 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 32]) 33 34# _AM_AUTOCONF_VERSION(VERSION) 35# ----------------------------- 36# aclocal traces this macro to find the Autoconf version. 37# This is a private macro too. Using m4_define simplifies 38# the logic in aclocal, which can simply ignore this definition. 39m4_define([_AM_AUTOCONF_VERSION], []) 40 41# AM_SET_CURRENT_AUTOMAKE_VERSION 42# ------------------------------- 43# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 44# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 45AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 46[AM_AUTOMAKE_VERSION([1.10])dnl 47_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) 48 49# AM_AUX_DIR_EXPAND -*- Autoconf -*- 50 51# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 52# 53# This file is free software; the Free Software Foundation 54# gives unlimited permission to copy and/or distribute it, 55# with or without modifications, as long as this notice is preserved. 56 57# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 58# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 59# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 60# 61# Of course, Automake must honor this variable whenever it calls a 62# tool from the auxiliary directory. The problem is that $srcdir (and 63# therefore $ac_aux_dir as well) can be either absolute or relative, 64# depending on how configure is run. This is pretty annoying, since 65# it makes $ac_aux_dir quite unusable in subdirectories: in the top 66# source directory, any form will work fine, but in subdirectories a 67# relative path needs to be adjusted first. 68# 69# $ac_aux_dir/missing 70# fails when called from a subdirectory if $ac_aux_dir is relative 71# $top_srcdir/$ac_aux_dir/missing 72# fails if $ac_aux_dir is absolute, 73# fails when called from a subdirectory in a VPATH build with 74# a relative $ac_aux_dir 75# 76# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 77# are both prefixed by $srcdir. In an in-source build this is usually 78# harmless because $srcdir is `.', but things will broke when you 79# start a VPATH build or use an absolute $srcdir. 80# 81# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 82# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 83# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 84# and then we would define $MISSING as 85# MISSING="\${SHELL} $am_aux_dir/missing" 86# This will work as long as MISSING is not called from configure, because 87# unfortunately $(top_srcdir) has no meaning in configure. 88# However there are other variables, like CC, which are often used in 89# configure, and could therefore not use this "fixed" $ac_aux_dir. 90# 91# Another solution, used here, is to always expand $ac_aux_dir to an 92# absolute PATH. The drawback is that using absolute paths prevent a 93# configured tree to be moved without reconfiguration. 94 95AC_DEFUN([AM_AUX_DIR_EXPAND], 96[dnl Rely on autoconf to set up CDPATH properly. 97AC_PREREQ([2.50])dnl 98# expand $ac_aux_dir to an absolute path 99am_aux_dir=`cd $ac_aux_dir && pwd` 100]) 101 102# AM_CONDITIONAL -*- Autoconf -*- 103 104# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 105# Free Software Foundation, Inc. 106# 107# This file is free software; the Free Software Foundation 108# gives unlimited permission to copy and/or distribute it, 109# with or without modifications, as long as this notice is preserved. 110 111# serial 8 112 113# AM_CONDITIONAL(NAME, SHELL-CONDITION) 114# ------------------------------------- 115# Define a conditional. 116AC_DEFUN([AM_CONDITIONAL], 117[AC_PREREQ(2.52)dnl 118 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 119 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 120AC_SUBST([$1_TRUE])dnl 121AC_SUBST([$1_FALSE])dnl 122_AM_SUBST_NOTMAKE([$1_TRUE])dnl 123_AM_SUBST_NOTMAKE([$1_FALSE])dnl 124if $2; then 125 $1_TRUE= 126 $1_FALSE='#' 127else 128 $1_TRUE='#' 129 $1_FALSE= 130fi 131AC_CONFIG_COMMANDS_PRE( 132[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 133 AC_MSG_ERROR([[conditional "$1" was never defined. 134Usually this means the macro was only invoked conditionally.]]) 135fi])]) 136 137# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 138# Free Software Foundation, Inc. 139# 140# This file is free software; the Free Software Foundation 141# gives unlimited permission to copy and/or distribute it, 142# with or without modifications, as long as this notice is preserved. 143 144# serial 9 145 146# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 147# written in clear, in which case automake, when reading aclocal.m4, 148# will think it sees a *use*, and therefore will trigger all it's 149# C support machinery. Also note that it means that autoscan, seeing 150# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 151 152 153# _AM_DEPENDENCIES(NAME) 154# ---------------------- 155# See how the compiler implements dependency checking. 156# NAME is "CC", "CXX", "GCJ", or "OBJC". 157# We try a few techniques and use that to set a single cache variable. 158# 159# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 160# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 161# dependency, and given that the user is not expected to run this macro, 162# just rely on AC_PROG_CC. 163AC_DEFUN([_AM_DEPENDENCIES], 164[AC_REQUIRE([AM_SET_DEPDIR])dnl 165AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 166AC_REQUIRE([AM_MAKE_INCLUDE])dnl 167AC_REQUIRE([AM_DEP_TRACK])dnl 168 169ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 170 [$1], CXX, [depcc="$CXX" am_compiler_list=], 171 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 172 [$1], UPC, [depcc="$UPC" am_compiler_list=], 173 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 174 [depcc="$$1" am_compiler_list=]) 175 176AC_CACHE_CHECK([dependency style of $depcc], 177 [am_cv_$1_dependencies_compiler_type], 178[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 179 # We make a subdir and do the tests there. Otherwise we can end up 180 # making bogus files that we don't know about and never remove. For 181 # instance it was reported that on HP-UX the gcc test will end up 182 # making a dummy file named `D' -- because `-MD' means `put the output 183 # in D'. 184 mkdir conftest.dir 185 # Copy depcomp to subdir because otherwise we won't find it if we're 186 # using a relative directory. 187 cp "$am_depcomp" conftest.dir 188 cd conftest.dir 189 # We will build objects and dependencies in a subdirectory because 190 # it helps to detect inapplicable dependency modes. For instance 191 # both Tru64's cc and ICC support -MD to output dependencies as a 192 # side effect of compilation, but ICC will put the dependencies in 193 # the current directory while Tru64 will put them in the object 194 # directory. 195 mkdir sub 196 197 am_cv_$1_dependencies_compiler_type=none 198 if test "$am_compiler_list" = ""; then 199 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 200 fi 201 for depmode in $am_compiler_list; do 202 # Setup a source with many dependencies, because some compilers 203 # like to wrap large dependency lists on column 80 (with \), and 204 # we should not choose a depcomp mode which is confused by this. 205 # 206 # We need to recreate these files for each test, as the compiler may 207 # overwrite some of them when testing with obscure command lines. 208 # This happens at least with the AIX C compiler. 209 : > sub/conftest.c 210 for i in 1 2 3 4 5 6; do 211 echo '#include "conftst'$i'.h"' >> sub/conftest.c 212 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 213 # Solaris 8's {/usr,}/bin/sh. 214 touch sub/conftst$i.h 215 done 216 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 217 218 case $depmode in 219 nosideeffect) 220 # after this tag, mechanisms are not by side-effect, so they'll 221 # only be used when explicitly requested 222 if test "x$enable_dependency_tracking" = xyes; then 223 continue 224 else 225 break 226 fi 227 ;; 228 none) break ;; 229 esac 230 # We check with `-c' and `-o' for the sake of the "dashmstdout" 231 # mode. It turns out that the SunPro C++ compiler does not properly 232 # handle `-M -o', and we need to detect this. 233 if depmode=$depmode \ 234 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 235 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 236 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 237 >/dev/null 2>conftest.err && 238 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 239 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 240 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 241 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 242 # icc doesn't choke on unknown options, it will just issue warnings 243 # or remarks (even with -Werror). So we grep stderr for any message 244 # that says an option was ignored or not supported. 245 # When given -MP, icc 7.0 and 7.1 complain thusly: 246 # icc: Command line warning: ignoring option '-M'; no argument required 247 # The diagnosis changed in icc 8.0: 248 # icc: Command line remark: option '-MP' not supported 249 if (grep 'ignoring option' conftest.err || 250 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 251 am_cv_$1_dependencies_compiler_type=$depmode 252 break 253 fi 254 fi 255 done 256 257 cd .. 258 rm -rf conftest.dir 259else 260 am_cv_$1_dependencies_compiler_type=none 261fi 262]) 263AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 264AM_CONDITIONAL([am__fastdep$1], [ 265 test "x$enable_dependency_tracking" != xno \ 266 && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 267]) 268 269 270# AM_SET_DEPDIR 271# ------------- 272# Choose a directory name for dependency files. 273# This macro is AC_REQUIREd in _AM_DEPENDENCIES 274AC_DEFUN([AM_SET_DEPDIR], 275[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 276AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 277]) 278 279 280# AM_DEP_TRACK 281# ------------ 282AC_DEFUN([AM_DEP_TRACK], 283[AC_ARG_ENABLE(dependency-tracking, 284[ --disable-dependency-tracking speeds up one-time build 285 --enable-dependency-tracking do not reject slow dependency extractors]) 286if test "x$enable_dependency_tracking" != xno; then 287 am_depcomp="$ac_aux_dir/depcomp" 288 AMDEPBACKSLASH='\' 289fi 290AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 291AC_SUBST([AMDEPBACKSLASH])dnl 292_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 293]) 294 295# Generate code to set up dependency tracking. -*- Autoconf -*- 296 297# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 298# Free Software Foundation, Inc. 299# 300# This file is free software; the Free Software Foundation 301# gives unlimited permission to copy and/or distribute it, 302# with or without modifications, as long as this notice is preserved. 303 304#serial 3 305 306# _AM_OUTPUT_DEPENDENCY_COMMANDS 307# ------------------------------ 308AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 309[for mf in $CONFIG_FILES; do 310 # Strip MF so we end up with the name of the file. 311 mf=`echo "$mf" | sed -e 's/:.*$//'` 312 # Check whether this is an Automake generated Makefile or not. 313 # We used to match only the files named `Makefile.in', but 314 # some people rename them; so instead we look at the file content. 315 # Grep'ing the first line is not enough: some people post-process 316 # each Makefile.in and add a new line on top of each file to say so. 317 # Grep'ing the whole file is not good either: AIX grep has a line 318 # limit of 2048, but all sed's we know have understand at least 4000. 319 if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then 320 dirpart=`AS_DIRNAME("$mf")` 321 else 322 continue 323 fi 324 # Extract the definition of DEPDIR, am__include, and am__quote 325 # from the Makefile without running `make'. 326 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 327 test -z "$DEPDIR" && continue 328 am__include=`sed -n 's/^am__include = //p' < "$mf"` 329 test -z "am__include" && continue 330 am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 331 # When using ansi2knr, U may be empty or an underscore; expand it 332 U=`sed -n 's/^U = //p' < "$mf"` 333 # Find all dependency output files, they are included files with 334 # $(DEPDIR) in their names. We invoke sed twice because it is the 335 # simplest approach to changing $(DEPDIR) to its actual value in the 336 # expansion. 337 for file in `sed -n " 338 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 339 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 340 # Make sure the directory exists. 341 test -f "$dirpart/$file" && continue 342 fdir=`AS_DIRNAME(["$file"])` 343 AS_MKDIR_P([$dirpart/$fdir]) 344 # echo "creating $dirpart/$file" 345 echo '# dummy' > "$dirpart/$file" 346 done 347done 348])# _AM_OUTPUT_DEPENDENCY_COMMANDS 349 350 351# AM_OUTPUT_DEPENDENCY_COMMANDS 352# ----------------------------- 353# This macro should only be invoked once -- use via AC_REQUIRE. 354# 355# This code is only required when automatic dependency tracking 356# is enabled. FIXME. This creates each `.P' file that we will 357# need in order to bootstrap the dependency handling code. 358AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 359[AC_CONFIG_COMMANDS([depfiles], 360 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 361 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 362]) 363 364# Do all the work for Automake. -*- Autoconf -*- 365 366# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 367# 2005, 2006 Free Software Foundation, Inc. 368# 369# This file is free software; the Free Software Foundation 370# gives unlimited permission to copy and/or distribute it, 371# with or without modifications, as long as this notice is preserved. 372 373# serial 12 374 375# This macro actually does too much. Some checks are only needed if 376# your package does certain things. But this isn't really a big deal. 377 378# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 379# AM_INIT_AUTOMAKE([OPTIONS]) 380# ----------------------------------------------- 381# The call with PACKAGE and VERSION arguments is the old style 382# call (pre autoconf-2.50), which is being phased out. PACKAGE 383# and VERSION should now be passed to AC_INIT and removed from 384# the call to AM_INIT_AUTOMAKE. 385# We support both call styles for the transition. After 386# the next Automake release, Autoconf can make the AC_INIT 387# arguments mandatory, and then we can depend on a new Autoconf 388# release and drop the old call support. 389AC_DEFUN([AM_INIT_AUTOMAKE], 390[AC_PREREQ([2.60])dnl 391dnl Autoconf wants to disallow AM_ names. We explicitly allow 392dnl the ones we care about. 393m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 394AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 395AC_REQUIRE([AC_PROG_INSTALL])dnl 396if test "`cd $srcdir && pwd`" != "`pwd`"; then 397 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 398 # is not polluted with repeated "-I." 399 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 400 # test to see if srcdir already configured 401 if test -f $srcdir/config.status; then 402 AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 403 fi 404fi 405 406# test whether we have cygpath 407if test -z "$CYGPATH_W"; then 408 if (cygpath --version) >/dev/null 2>/dev/null; then 409 CYGPATH_W='cygpath -w' 410 else 411 CYGPATH_W=echo 412 fi 413fi 414AC_SUBST([CYGPATH_W]) 415 416# Define the identity of the package. 417dnl Distinguish between old-style and new-style calls. 418m4_ifval([$2], 419[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 420 AC_SUBST([PACKAGE], [$1])dnl 421 AC_SUBST([VERSION], [$2])], 422[_AM_SET_OPTIONS([$1])dnl 423dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 424m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 425 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 426 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 427 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 428 429_AM_IF_OPTION([no-define],, 430[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 431 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 432 433# Some tools Automake needs. 434AC_REQUIRE([AM_SANITY_CHECK])dnl 435AC_REQUIRE([AC_ARG_PROGRAM])dnl 436AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 437AM_MISSING_PROG(AUTOCONF, autoconf) 438AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 439AM_MISSING_PROG(AUTOHEADER, autoheader) 440AM_MISSING_PROG(MAKEINFO, makeinfo) 441AM_PROG_INSTALL_SH 442AM_PROG_INSTALL_STRIP 443AC_REQUIRE([AM_PROG_MKDIR_P])dnl 444# We need awk for the "check" target. The system "awk" is bad on 445# some platforms. 446AC_REQUIRE([AC_PROG_AWK])dnl 447AC_REQUIRE([AC_PROG_MAKE_SET])dnl 448AC_REQUIRE([AM_SET_LEADING_DOT])dnl 449_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 450 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 451 [_AM_PROG_TAR([v7])])]) 452_AM_IF_OPTION([no-dependencies],, 453[AC_PROVIDE_IFELSE([AC_PROG_CC], 454 [_AM_DEPENDENCIES(CC)], 455 [define([AC_PROG_CC], 456 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 457AC_PROVIDE_IFELSE([AC_PROG_CXX], 458 [_AM_DEPENDENCIES(CXX)], 459 [define([AC_PROG_CXX], 460 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 461AC_PROVIDE_IFELSE([AC_PROG_OBJC], 462 [_AM_DEPENDENCIES(OBJC)], 463 [define([AC_PROG_OBJC], 464 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 465]) 466]) 467 468 469# When config.status generates a header, we must update the stamp-h file. 470# This file resides in the same directory as the config header 471# that is generated. The stamp files are numbered to have different names. 472 473# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 474# loop where config.status creates the headers, so we can generate 475# our stamp files there. 476AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 477[# Compute $1's index in $config_headers. 478_am_stamp_count=1 479for _am_header in $config_headers :; do 480 case $_am_header in 481 $1 | $1:* ) 482 break ;; 483 * ) 484 _am_stamp_count=`expr $_am_stamp_count + 1` ;; 485 esac 486done 487echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 488 489# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 490# 491# This file is free software; the Free Software Foundation 492# gives unlimited permission to copy and/or distribute it, 493# with or without modifications, as long as this notice is preserved. 494 495# AM_PROG_INSTALL_SH 496# ------------------ 497# Define $install_sh. 498AC_DEFUN([AM_PROG_INSTALL_SH], 499[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 500install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} 501AC_SUBST(install_sh)]) 502 503# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 504# 505# This file is free software; the Free Software Foundation 506# gives unlimited permission to copy and/or distribute it, 507# with or without modifications, as long as this notice is preserved. 508 509# serial 2 510 511# Check whether the underlying file-system supports filenames 512# with a leading dot. For instance MS-DOS doesn't. 513AC_DEFUN([AM_SET_LEADING_DOT], 514[rm -rf .tst 2>/dev/null 515mkdir .tst 2>/dev/null 516if test -d .tst; then 517 am__leading_dot=. 518else 519 am__leading_dot=_ 520fi 521rmdir .tst 2>/dev/null 522AC_SUBST([am__leading_dot])]) 523 524# Check to see how 'make' treats includes. -*- Autoconf -*- 525 526# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 527# 528# This file is free software; the Free Software Foundation 529# gives unlimited permission to copy and/or distribute it, 530# with or without modifications, as long as this notice is preserved. 531 532# serial 3 533 534# AM_MAKE_INCLUDE() 535# ----------------- 536# Check to see how make treats includes. 537AC_DEFUN([AM_MAKE_INCLUDE], 538[am_make=${MAKE-make} 539cat > confinc << 'END' 540am__doit: 541 @echo done 542.PHONY: am__doit 543END 544# If we don't find an include directive, just comment out the code. 545AC_MSG_CHECKING([for style of include used by $am_make]) 546am__include="#" 547am__quote= 548_am_result=none 549# First try GNU make style include. 550echo "include confinc" > confmf 551# We grep out `Entering directory' and `Leaving directory' 552# messages which can occur if `w' ends up in MAKEFLAGS. 553# In particular we don't look at `^make:' because GNU make might 554# be invoked under some other name (usually "gmake"), in which 555# case it prints its new name instead of `make'. 556if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 557 am__include=include 558 am__quote= 559 _am_result=GNU 560fi 561# Now try BSD make style include. 562if test "$am__include" = "#"; then 563 echo '.include "confinc"' > confmf 564 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 565 am__include=.include 566 am__quote="\"" 567 _am_result=BSD 568 fi 569fi 570AC_SUBST([am__include]) 571AC_SUBST([am__quote]) 572AC_MSG_RESULT([$_am_result]) 573rm -f confinc confmf 574]) 575 576# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 577 578# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 579# Free Software Foundation, Inc. 580# 581# This file is free software; the Free Software Foundation 582# gives unlimited permission to copy and/or distribute it, 583# with or without modifications, as long as this notice is preserved. 584 585# serial 5 586 587# AM_MISSING_PROG(NAME, PROGRAM) 588# ------------------------------ 589AC_DEFUN([AM_MISSING_PROG], 590[AC_REQUIRE([AM_MISSING_HAS_RUN]) 591$1=${$1-"${am_missing_run}$2"} 592AC_SUBST($1)]) 593 594 595# AM_MISSING_HAS_RUN 596# ------------------ 597# Define MISSING if not defined so far and test if it supports --run. 598# If it does, set am_missing_run to use it, otherwise, to nothing. 599AC_DEFUN([AM_MISSING_HAS_RUN], 600[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 601AC_REQUIRE_AUX_FILE([missing])dnl 602test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 603# Use eval to expand $SHELL 604if eval "$MISSING --run true"; then 605 am_missing_run="$MISSING --run " 606else 607 am_missing_run= 608 AC_MSG_WARN([`missing' script is too old or missing]) 609fi 610]) 611 612# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 613# 614# This file is free software; the Free Software Foundation 615# gives unlimited permission to copy and/or distribute it, 616# with or without modifications, as long as this notice is preserved. 617 618# AM_PROG_MKDIR_P 619# --------------- 620# Check for `mkdir -p'. 621AC_DEFUN([AM_PROG_MKDIR_P], 622[AC_PREREQ([2.60])dnl 623AC_REQUIRE([AC_PROG_MKDIR_P])dnl 624dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 625dnl while keeping a definition of mkdir_p for backward compatibility. 626dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 627dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 628dnl Makefile.ins that do not define MKDIR_P, so we do our own 629dnl adjustment using top_builddir (which is defined more often than 630dnl MKDIR_P). 631AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 632case $mkdir_p in 633 [[\\/$]]* | ?:[[\\/]]*) ;; 634 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 635esac 636]) 637 638# Helper functions for option handling. -*- Autoconf -*- 639 640# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 641# 642# This file is free software; the Free Software Foundation 643# gives unlimited permission to copy and/or distribute it, 644# with or without modifications, as long as this notice is preserved. 645 646# serial 3 647 648# _AM_MANGLE_OPTION(NAME) 649# ----------------------- 650AC_DEFUN([_AM_MANGLE_OPTION], 651[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 652 653# _AM_SET_OPTION(NAME) 654# ------------------------------ 655# Set option NAME. Presently that only means defining a flag for this option. 656AC_DEFUN([_AM_SET_OPTION], 657[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 658 659# _AM_SET_OPTIONS(OPTIONS) 660# ---------------------------------- 661# OPTIONS is a space-separated list of Automake options. 662AC_DEFUN([_AM_SET_OPTIONS], 663[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 664 665# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 666# ------------------------------------------- 667# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 668AC_DEFUN([_AM_IF_OPTION], 669[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 670 671# Check to make sure that the build environment is sane. -*- Autoconf -*- 672 673# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 674# Free Software Foundation, Inc. 675# 676# This file is free software; the Free Software Foundation 677# gives unlimited permission to copy and/or distribute it, 678# with or without modifications, as long as this notice is preserved. 679 680# serial 4 681 682# AM_SANITY_CHECK 683# --------------- 684AC_DEFUN([AM_SANITY_CHECK], 685[AC_MSG_CHECKING([whether build environment is sane]) 686# Just in case 687sleep 1 688echo timestamp > conftest.file 689# Do `set' in a subshell so we don't clobber the current shell's 690# arguments. Must try -L first in case configure is actually a 691# symlink; some systems play weird games with the mod time of symlinks 692# (eg FreeBSD returns the mod time of the symlink's containing 693# directory). 694if ( 695 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 696 if test "$[*]" = "X"; then 697 # -L didn't work. 698 set X `ls -t $srcdir/configure conftest.file` 699 fi 700 rm -f conftest.file 701 if test "$[*]" != "X $srcdir/configure conftest.file" \ 702 && test "$[*]" != "X conftest.file $srcdir/configure"; then 703 704 # If neither matched, then we have a broken ls. This can happen 705 # if, for instance, CONFIG_SHELL is bash and it inherits a 706 # broken ls alias from the environment. This has actually 707 # happened. Such a system could not be considered "sane". 708 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 709alias in your environment]) 710 fi 711 712 test "$[2]" = conftest.file 713 ) 714then 715 # Ok. 716 : 717else 718 AC_MSG_ERROR([newly created file is older than distributed files! 719Check your system clock]) 720fi 721AC_MSG_RESULT(yes)]) 722 723# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 724# 725# This file is free software; the Free Software Foundation 726# gives unlimited permission to copy and/or distribute it, 727# with or without modifications, as long as this notice is preserved. 728 729# AM_PROG_INSTALL_STRIP 730# --------------------- 731# One issue with vendor `install' (even GNU) is that you can't 732# specify the program used to strip binaries. This is especially 733# annoying in cross-compiling environments, where the build's strip 734# is unlikely to handle the host's binaries. 735# Fortunately install-sh will honor a STRIPPROG variable, so we 736# always use install-sh in `make install-strip', and initialize 737# STRIPPROG with the value of the STRIP variable (set by the user). 738AC_DEFUN([AM_PROG_INSTALL_STRIP], 739[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 740# Installed binaries are usually stripped using `strip' when the user 741# run `make install-strip'. However `strip' might not be the right 742# tool to use in cross-compilation environments, therefore Automake 743# will honor the `STRIP' environment variable to overrule this program. 744dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 745if test "$cross_compiling" != no; then 746 AC_CHECK_TOOL([STRIP], [strip], :) 747fi 748INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 749AC_SUBST([INSTALL_STRIP_PROGRAM])]) 750 751# Copyright (C) 2006 Free Software Foundation, Inc. 752# 753# This file is free software; the Free Software Foundation 754# gives unlimited permission to copy and/or distribute it, 755# with or without modifications, as long as this notice is preserved. 756 757# _AM_SUBST_NOTMAKE(VARIABLE) 758# --------------------------- 759# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. 760# This macro is traced by Automake. 761AC_DEFUN([_AM_SUBST_NOTMAKE]) 762 763# Check how to create a tarball. -*- Autoconf -*- 764 765# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 766# 767# This file is free software; the Free Software Foundation 768# gives unlimited permission to copy and/or distribute it, 769# with or without modifications, as long as this notice is preserved. 770 771# serial 2 772 773# _AM_PROG_TAR(FORMAT) 774# -------------------- 775# Check how to create a tarball in format FORMAT. 776# FORMAT should be one of `v7', `ustar', or `pax'. 777# 778# Substitute a variable $(am__tar) that is a command 779# writing to stdout a FORMAT-tarball containing the directory 780# $tardir. 781# tardir=directory && $(am__tar) > result.tar 782# 783# Substitute a variable $(am__untar) that extract such 784# a tarball read from stdin. 785# $(am__untar) < result.tar 786AC_DEFUN([_AM_PROG_TAR], 787[# Always define AMTAR for backward compatibility. 788AM_MISSING_PROG([AMTAR], [tar]) 789m4_if([$1], [v7], 790 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 791 [m4_case([$1], [ustar],, [pax],, 792 [m4_fatal([Unknown tar format])]) 793AC_MSG_CHECKING([how to create a $1 tar archive]) 794# Loop over all known methods to create a tar archive until one works. 795_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 796_am_tools=${am_cv_prog_tar_$1-$_am_tools} 797# Do not fold the above two line into one, because Tru64 sh and 798# Solaris sh will not grok spaces in the rhs of `-'. 799for _am_tool in $_am_tools 800do 801 case $_am_tool in 802 gnutar) 803 for _am_tar in tar gnutar gtar; 804 do 805 AM_RUN_LOG([$_am_tar --version]) && break 806 done 807 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 808 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 809 am__untar="$_am_tar -xf -" 810 ;; 811 plaintar) 812 # Must skip GNU tar: if it does not support --format= it doesn't create 813 # ustar tarball either. 814 (tar --version) >/dev/null 2>&1 && continue 815 am__tar='tar chf - "$$tardir"' 816 am__tar_='tar chf - "$tardir"' 817 am__untar='tar xf -' 818 ;; 819 pax) 820 am__tar='pax -L -x $1 -w "$$tardir"' 821 am__tar_='pax -L -x $1 -w "$tardir"' 822 am__untar='pax -r' 823 ;; 824 cpio) 825 am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 826 am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 827 am__untar='cpio -i -H $1 -d' 828 ;; 829 none) 830 am__tar=false 831 am__tar_=false 832 am__untar=false 833 ;; 834 esac 835 836 # If the value was cached, stop now. We just wanted to have am__tar 837 # and am__untar set. 838 test -n "${am_cv_prog_tar_$1}" && break 839 840 # tar/untar a dummy directory, and stop if the command works 841 rm -rf conftest.dir 842 mkdir conftest.dir 843 echo GrepMe > conftest.dir/file 844 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 845 rm -rf conftest.dir 846 if test -s conftest.tar; then 847 AM_RUN_LOG([$am__untar <conftest.tar]) 848 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 849 fi 850done 851rm -rf conftest.dir 852 853AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 854AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 855AC_SUBST([am__tar]) 856AC_SUBST([am__untar]) 857]) # _AM_PROG_TAR 858 859# lib-ld.m4 serial 3 (gettext-0.13) 860dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. 861dnl This file is free software; the Free Software Foundation 862dnl gives unlimited permission to copy and/or distribute it, 863dnl with or without modifications, as long as this notice is preserved. 864 865dnl Subroutines of libtool.m4, 866dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision 867dnl with libtool.m4. 868 869dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. 870AC_DEFUN([AC_LIB_PROG_LD_GNU], 871[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, 872[# I'd rather use --version here, but apparently some GNU ld's only accept -v. 873case `$LD -v 2>&1 </dev/null` in 874*GNU* | *'with BFD'*) 875 acl_cv_prog_gnu_ld=yes ;; 876*) 877 acl_cv_prog_gnu_ld=no ;; 878esac]) 879with_gnu_ld=$acl_cv_prog_gnu_ld 880]) 881 882dnl From libtool-1.4. Sets the variable LD. 883AC_DEFUN([AC_LIB_PROG_LD], 884[AC_ARG_WITH(gnu-ld, 885[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], 886test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) 887AC_REQUIRE([AC_PROG_CC])dnl 888AC_REQUIRE([AC_CANONICAL_HOST])dnl 889# Prepare PATH_SEPARATOR. 890# The user is always right. 891if test "${PATH_SEPARATOR+set}" != set; then 892 echo "#! /bin/sh" >conf$$.sh 893 echo "exit 0" >>conf$$.sh 894 chmod +x conf$$.sh 895 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 896 PATH_SEPARATOR=';' 897 else 898 PATH_SEPARATOR=: 899 fi 900 rm -f conf$$.sh 901fi 902ac_prog=ld 903if test "$GCC" = yes; then 904 # Check if gcc -print-prog-name=ld gives a path. 905 AC_MSG_CHECKING([for ld used by GCC]) 906 case $host in 907 *-*-mingw*) 908 # gcc leaves a trailing carriage return which upsets mingw 909 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 910 *) 911 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 912 esac 913 case $ac_prog in 914 # Accept absolute paths. 915 [[\\/]* | [A-Za-z]:[\\/]*)] 916 [re_direlt='/[^/][^/]*/\.\./'] 917 # Canonicalize the path of ld 918 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 919 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 920 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 921 done 922 test -z "$LD" && LD="$ac_prog" 923 ;; 924 "") 925 # If it fails, then pretend we aren't using GCC. 926 ac_prog=ld 927 ;; 928 *) 929 # If it is relative, then search for the first ld in PATH. 930 with_gnu_ld=unknown 931 ;; 932 esac 933elif test "$with_gnu_ld" = yes; then 934 AC_MSG_CHECKING([for GNU ld]) 935else 936 AC_MSG_CHECKING([for non-GNU ld]) 937fi 938AC_CACHE_VAL(acl_cv_path_LD, 939[if test -z "$LD"; then 940 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" 941 for ac_dir in $PATH; do 942 test -z "$ac_dir" && ac_dir=. 943 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 944 acl_cv_path_LD="$ac_dir/$ac_prog" 945 # Check to see if the program is GNU ld. I'd rather use --version, 946 # but apparently some GNU ld's only accept -v. 947 # Break only if it was the GNU/non-GNU ld that we prefer. 948 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in 949 *GNU* | *'with BFD'*) 950 test "$with_gnu_ld" != no && break ;; 951 *) 952 test "$with_gnu_ld" != yes && break ;; 953 esac 954 fi 955 done 956 IFS="$ac_save_ifs" 957else 958 acl_cv_path_LD="$LD" # Let the user override the test with a path. 959fi]) 960LD="$acl_cv_path_LD" 961if test -n "$LD"; then 962 AC_MSG_RESULT($LD) 963else 964 AC_MSG_RESULT(no) 965fi 966test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 967AC_LIB_PROG_LD_GNU 968]) 969 970# lib-link.m4 serial 13 (gettext-0.17) 971dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. 972dnl This file is free software; the Free Software Foundation 973dnl gives unlimited permission to copy and/or distribute it, 974dnl with or without modifications, as long as this notice is preserved. 975 976dnl From Bruno Haible. 977 978AC_PREREQ(2.54) 979 980dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and 981dnl the libraries corresponding to explicit and implicit dependencies. 982dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and 983dnl augments the CPPFLAGS variable. 984dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 985dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 986AC_DEFUN([AC_LIB_LINKFLAGS], 987[ 988 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 989 AC_REQUIRE([AC_LIB_RPATH]) 990 define([Name],[translit([$1],[./-], [___])]) 991 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 992 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 993 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ 994 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 995 ac_cv_lib[]Name[]_libs="$LIB[]NAME" 996 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" 997 ac_cv_lib[]Name[]_cppflags="$INC[]NAME" 998 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" 999 ]) 1000 LIB[]NAME="$ac_cv_lib[]Name[]_libs" 1001 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" 1002 INC[]NAME="$ac_cv_lib[]Name[]_cppflags" 1003 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" 1004 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) 1005 AC_SUBST([LIB]NAME) 1006 AC_SUBST([LTLIB]NAME) 1007 AC_SUBST([LIB]NAME[_PREFIX]) 1008 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the 1009 dnl results of this search when this library appears as a dependency. 1010 HAVE_LIB[]NAME=yes 1011 undefine([Name]) 1012 undefine([NAME]) 1013]) 1014 1015dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) 1016dnl searches for libname and the libraries corresponding to explicit and 1017dnl implicit dependencies, together with the specified include files and 1018dnl the ability to compile and link the specified testcode. If found, it 1019dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and 1020dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and 1021dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs 1022dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. 1023dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 1024dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 1025AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], 1026[ 1027 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 1028 AC_REQUIRE([AC_LIB_RPATH]) 1029 define([Name],[translit([$1],[./-], [___])]) 1030 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 1031 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 1032 1033 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME 1034 dnl accordingly. 1035 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 1036 1037 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, 1038 dnl because if the user has installed lib[]Name and not disabled its use 1039 dnl via --without-lib[]Name-prefix, he wants to use it. 1040 ac_save_CPPFLAGS="$CPPFLAGS" 1041 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) 1042 1043 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ 1044 ac_save_LIBS="$LIBS" 1045 LIBS="$LIBS $LIB[]NAME" 1046 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) 1047 LIBS="$ac_save_LIBS" 1048 ]) 1049 if test "$ac_cv_lib[]Name" = yes; then 1050 HAVE_LIB[]NAME=yes 1051 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) 1052 AC_MSG_CHECKING([how to link with lib[]$1]) 1053 AC_MSG_RESULT([$LIB[]NAME]) 1054 else 1055 HAVE_LIB[]NAME=no 1056 dnl If $LIB[]NAME didn't lead to a usable library, we don't need 1057 dnl $INC[]NAME either. 1058 CPPFLAGS="$ac_save_CPPFLAGS" 1059 LIB[]NAME= 1060 LTLIB[]NAME= 1061 LIB[]NAME[]_PREFIX= 1062 fi 1063 AC_SUBST([HAVE_LIB]NAME) 1064 AC_SUBST([LIB]NAME) 1065 AC_SUBST([LTLIB]NAME) 1066 AC_SUBST([LIB]NAME[_PREFIX]) 1067 undefine([Name]) 1068 undefine([NAME]) 1069]) 1070 1071dnl Determine the platform dependent parameters needed to use rpath: 1072dnl acl_libext, 1073dnl acl_shlibext, 1074dnl acl_hardcode_libdir_flag_spec, 1075dnl acl_hardcode_libdir_separator, 1076dnl acl_hardcode_direct, 1077dnl acl_hardcode_minus_L. 1078AC_DEFUN([AC_LIB_RPATH], 1079[ 1080 dnl Tell automake >= 1.10 to complain if config.rpath is missing. 1081 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) 1082 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS 1083 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld 1084 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host 1085 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir 1086 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ 1087 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ 1088 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh 1089 . ./conftest.sh 1090 rm -f ./conftest.sh 1091 acl_cv_rpath=done 1092 ]) 1093 wl="$acl_cv_wl" 1094 acl_libext="$acl_cv_libext" 1095 acl_shlibext="$acl_cv_shlibext" 1096 acl_libname_spec="$acl_cv_libname_spec" 1097 acl_library_names_spec="$acl_cv_library_names_spec" 1098 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" 1099 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" 1100 acl_hardcode_direct="$acl_cv_hardcode_direct" 1101 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" 1102 dnl Determine whether the user wants rpath handling at all. 1103 AC_ARG_ENABLE(rpath, 1104 [ --disable-rpath do not hardcode runtime library paths], 1105 :, enable_rpath=yes) 1106]) 1107 1108dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and 1109dnl the libraries corresponding to explicit and implicit dependencies. 1110dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. 1111dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found 1112dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 1113AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 1114[ 1115 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1116 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 1117 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 1118 dnl Autoconf >= 2.61 supports dots in --with options. 1119 define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) 1120 dnl By default, look in $includedir and $libdir. 1121 use_additional=yes 1122 AC_LIB_WITH_FINAL_PREFIX([ 1123 eval additional_includedir=\"$includedir\" 1124 eval additional_libdir=\"$libdir\" 1125 ]) 1126 AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], 1127[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib 1128 --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], 1129[ 1130 if test "X$withval" = "Xno"; then 1131 use_additional=no 1132 else 1133 if test "X$withval" = "X"; then 1134 AC_LIB_WITH_FINAL_PREFIX([ 1135 eval additional_includedir=\"$includedir\" 1136 eval additional_libdir=\"$libdir\" 1137 ]) 1138 else 1139 additional_includedir="$withval/include" 1140 additional_libdir="$withval/$acl_libdirstem" 1141 fi 1142 fi 1143]) 1144 dnl Search the library and its dependencies in $additional_libdir and 1145 dnl $LDFLAGS. Using breadth-first-seach. 1146 LIB[]NAME= 1147 LTLIB[]NAME= 1148 INC[]NAME= 1149 LIB[]NAME[]_PREFIX= 1150 rpathdirs= 1151 ltrpathdirs= 1152 names_already_handled= 1153 names_next_round='$1 $2' 1154 while test -n "$names_next_round"; do 1155 names_this_round="$names_next_round" 1156 names_next_round= 1157 for name in $names_this_round; do 1158 already_handled= 1159 for n in $names_already_handled; do 1160 if test "$n" = "$name"; then 1161 already_handled=yes 1162 break 1163 fi 1164 done 1165 if test -z "$already_handled"; then 1166 names_already_handled="$names_already_handled $name" 1167 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS 1168 dnl or AC_LIB_HAVE_LINKFLAGS call. 1169 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` 1170 eval value=\"\$HAVE_LIB$uppername\" 1171 if test -n "$value"; then 1172 if test "$value" = yes; then 1173 eval value=\"\$LIB$uppername\" 1174 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" 1175 eval value=\"\$LTLIB$uppername\" 1176 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" 1177 else 1178 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined 1179 dnl that this library doesn't exist. So just drop it. 1180 : 1181 fi 1182 else 1183 dnl Search the library lib$name in $additional_libdir and $LDFLAGS 1184 dnl and the already constructed $LIBNAME/$LTLIBNAME. 1185 found_dir= 1186 found_la= 1187 found_so= 1188 found_a= 1189 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name 1190 if test -n "$acl_shlibext"; then 1191 shrext=".$acl_shlibext" # typically: shrext=.so 1192 else 1193 shrext= 1194 fi 1195 if test $use_additional = yes; then 1196 dir="$additional_libdir" 1197 dnl The same code as in the loop below: 1198 dnl First look for a shared library. 1199 if test -n "$acl_shlibext"; then 1200 if test -f "$dir/$libname$shrext"; then 1201 found_dir="$dir" 1202 found_so="$dir/$libname$shrext" 1203 else 1204 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then 1205 ver=`(cd "$dir" && \ 1206 for f in "$libname$shrext".*; do echo "$f"; done \ 1207 | sed -e "s,^$libname$shrext\\\\.,," \ 1208 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ 1209 | sed 1q ) 2>/dev/null` 1210 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then 1211 found_dir="$dir" 1212 found_so="$dir/$libname$shrext.$ver" 1213 fi 1214 else 1215 eval library_names=\"$acl_library_names_spec\" 1216 for f in $library_names; do 1217 if test -f "$dir/$f"; then 1218 found_dir="$dir" 1219 found_so="$dir/$f" 1220 break 1221 fi 1222 done 1223 fi 1224 fi 1225 fi 1226 dnl Then look for a static library. 1227 if test "X$found_dir" = "X"; then 1228 if test -f "$dir/$libname.$acl_libext"; then 1229 found_dir="$dir" 1230 found_a="$dir/$libname.$acl_libext" 1231 fi 1232 fi 1233 if test "X$found_dir" != "X"; then 1234 if test -f "$dir/$libname.la"; then 1235 found_la="$dir/$libname.la" 1236 fi 1237 fi 1238 fi 1239 if test "X$found_dir" = "X"; then 1240 for x in $LDFLAGS $LTLIB[]NAME; do 1241 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1242 case "$x" in 1243 -L*) 1244 dir=`echo "X$x" | sed -e 's/^X-L//'` 1245 dnl First look for a shared library. 1246 if test -n "$acl_shlibext"; then 1247 if test -f "$dir/$libname$shrext"; then 1248 found_dir="$dir" 1249 found_so="$dir/$libname$shrext" 1250 else 1251 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then 1252 ver=`(cd "$dir" && \ 1253 for f in "$libname$shrext".*; do echo "$f"; done \ 1254 | sed -e "s,^$libname$shrext\\\\.,," \ 1255 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ 1256 | sed 1q ) 2>/dev/null` 1257 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then 1258 found_dir="$dir" 1259 found_so="$dir/$libname$shrext.$ver" 1260 fi 1261 else 1262 eval library_names=\"$acl_library_names_spec\" 1263 for f in $library_names; do 1264 if test -f "$dir/$f"; then 1265 found_dir="$dir" 1266 found_so="$dir/$f" 1267 break 1268 fi 1269 done 1270 fi 1271 fi 1272 fi 1273 dnl Then look for a static library. 1274 if test "X$found_dir" = "X"; then 1275 if test -f "$dir/$libname.$acl_libext"; then 1276 found_dir="$dir" 1277 found_a="$dir/$libname.$acl_libext" 1278 fi 1279 fi 1280 if test "X$found_dir" != "X"; then 1281 if test -f "$dir/$libname.la"; then 1282 found_la="$dir/$libname.la" 1283 fi 1284 fi 1285 ;; 1286 esac 1287 if test "X$found_dir" != "X"; then 1288 break 1289 fi 1290 done 1291 fi 1292 if test "X$found_dir" != "X"; then 1293 dnl Found the library. 1294 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" 1295 if test "X$found_so" != "X"; then 1296 dnl Linking with a shared library. We attempt to hardcode its 1297 dnl directory into the executable's runpath, unless it's the 1298 dnl standard /usr/lib. 1299 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then 1300 dnl No hardcoding is needed. 1301 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1302 else 1303 dnl Use an explicit option to hardcode DIR into the resulting 1304 dnl binary. 1305 dnl Potentially add DIR to ltrpathdirs. 1306 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. 1307 haveit= 1308 for x in $ltrpathdirs; do 1309 if test "X$x" = "X$found_dir"; then 1310 haveit=yes 1311 break 1312 fi 1313 done 1314 if test -z "$haveit"; then 1315 ltrpathdirs="$ltrpathdirs $found_dir" 1316 fi 1317 dnl The hardcoding into $LIBNAME is system dependent. 1318 if test "$acl_hardcode_direct" = yes; then 1319 dnl Using DIR/libNAME.so during linking hardcodes DIR into the 1320 dnl resulting binary. 1321 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1322 else 1323 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then 1324 dnl Use an explicit option to hardcode DIR into the resulting 1325 dnl binary. 1326 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1327 dnl Potentially add DIR to rpathdirs. 1328 dnl The rpathdirs will be appended to $LIBNAME at the end. 1329 haveit= 1330 for x in $rpathdirs; do 1331 if test "X$x" = "X$found_dir"; then 1332 haveit=yes 1333 break 1334 fi 1335 done 1336 if test -z "$haveit"; then 1337 rpathdirs="$rpathdirs $found_dir" 1338 fi 1339 else 1340 dnl Rely on "-L$found_dir". 1341 dnl But don't add it if it's already contained in the LDFLAGS 1342 dnl or the already constructed $LIBNAME 1343 haveit= 1344 for x in $LDFLAGS $LIB[]NAME; do 1345 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1346 if test "X$x" = "X-L$found_dir"; then 1347 haveit=yes 1348 break 1349 fi 1350 done 1351 if test -z "$haveit"; then 1352 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" 1353 fi 1354 if test "$acl_hardcode_minus_L" != no; then 1355 dnl FIXME: Not sure whether we should use 1356 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" 1357 dnl here. 1358 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1359 else 1360 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH 1361 dnl here, because this doesn't fit in flags passed to the 1362 dnl compiler. So give up. No hardcoding. This affects only 1363 dnl very old systems. 1364 dnl FIXME: Not sure whether we should use 1365 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" 1366 dnl here. 1367 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" 1368 fi 1369 fi 1370 fi 1371 fi 1372 else 1373 if test "X$found_a" != "X"; then 1374 dnl Linking with a static library. 1375 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" 1376 else 1377 dnl We shouldn't come here, but anyway it's good to have a 1378 dnl fallback. 1379 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" 1380 fi 1381 fi 1382 dnl Assume the include files are nearby. 1383 additional_includedir= 1384 case "$found_dir" in 1385 */$acl_libdirstem | */$acl_libdirstem/) 1386 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` 1387 LIB[]NAME[]_PREFIX="$basedir" 1388 additional_includedir="$basedir/include" 1389 ;; 1390 esac 1391 if test "X$additional_includedir" != "X"; then 1392 dnl Potentially add $additional_includedir to $INCNAME. 1393 dnl But don't add it 1394 dnl 1. if it's the standard /usr/include, 1395 dnl 2. if it's /usr/local/include and we are using GCC on Linux, 1396 dnl 3. if it's already present in $CPPFLAGS or the already 1397 dnl constructed $INCNAME, 1398 dnl 4. if it doesn't exist as a directory. 1399 if test "X$additional_includedir" != "X/usr/include"; then 1400 haveit= 1401 if test "X$additional_includedir" = "X/usr/local/include"; then 1402 if test -n "$GCC"; then 1403 case $host_os in 1404 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1405 esac 1406 fi 1407 fi 1408 if test -z "$haveit"; then 1409 for x in $CPPFLAGS $INC[]NAME; do 1410 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1411 if test "X$x" = "X-I$additional_includedir"; then 1412 haveit=yes 1413 break 1414 fi 1415 done 1416 if test -z "$haveit"; then 1417 if test -d "$additional_includedir"; then 1418 dnl Really add $additional_includedir to $INCNAME. 1419 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" 1420 fi 1421 fi 1422 fi 1423 fi 1424 fi 1425 dnl Look for dependencies. 1426 if test -n "$found_la"; then 1427 dnl Read the .la file. It defines the variables 1428 dnl dlname, library_names, old_library, dependency_libs, current, 1429 dnl age, revision, installed, dlopen, dlpreopen, libdir. 1430 save_libdir="$libdir" 1431 case "$found_la" in 1432 */* | *\\*) . "$found_la" ;; 1433 *) . "./$found_la" ;; 1434 esac 1435 libdir="$save_libdir" 1436 dnl We use only dependency_libs. 1437 for dep in $dependency_libs; do 1438 case "$dep" in 1439 -L*) 1440 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` 1441 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. 1442 dnl But don't add it 1443 dnl 1. if it's the standard /usr/lib, 1444 dnl 2. if it's /usr/local/lib and we are using GCC on Linux, 1445 dnl 3. if it's already present in $LDFLAGS or the already 1446 dnl constructed $LIBNAME, 1447 dnl 4. if it doesn't exist as a directory. 1448 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then 1449 haveit= 1450 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then 1451 if test -n "$GCC"; then 1452 case $host_os in 1453 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1454 esac 1455 fi 1456 fi 1457 if test -z "$haveit"; then 1458 haveit= 1459 for x in $LDFLAGS $LIB[]NAME; do 1460 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1461 if test "X$x" = "X-L$additional_libdir"; then 1462 haveit=yes 1463 break 1464 fi 1465 done 1466 if test -z "$haveit"; then 1467 if test -d "$additional_libdir"; then 1468 dnl Really add $additional_libdir to $LIBNAME. 1469 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" 1470 fi 1471 fi 1472 haveit= 1473 for x in $LDFLAGS $LTLIB[]NAME; do 1474 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1475 if test "X$x" = "X-L$additional_libdir"; then 1476 haveit=yes 1477 break 1478 fi 1479 done 1480 if test -z "$haveit"; then 1481 if test -d "$additional_libdir"; then 1482 dnl Really add $additional_libdir to $LTLIBNAME. 1483 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" 1484 fi 1485 fi 1486 fi 1487 fi 1488 ;; 1489 -R*) 1490 dir=`echo "X$dep" | sed -e 's/^X-R//'` 1491 if test "$enable_rpath" != no; then 1492 dnl Potentially add DIR to rpathdirs. 1493 dnl The rpathdirs will be appended to $LIBNAME at the end. 1494 haveit= 1495 for x in $rpathdirs; do 1496 if test "X$x" = "X$dir"; then 1497 haveit=yes 1498 break 1499 fi 1500 done 1501 if test -z "$haveit"; then 1502 rpathdirs="$rpathdirs $dir" 1503 fi 1504 dnl Potentially add DIR to ltrpathdirs. 1505 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. 1506 haveit= 1507 for x in $ltrpathdirs; do 1508 if test "X$x" = "X$dir"; then 1509 haveit=yes 1510 break 1511 fi 1512 done 1513 if test -z "$haveit"; then 1514 ltrpathdirs="$ltrpathdirs $dir" 1515 fi 1516 fi 1517 ;; 1518 -l*) 1519 dnl Handle this in the next round. 1520 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` 1521 ;; 1522 *.la) 1523 dnl Handle this in the next round. Throw away the .la's 1524 dnl directory; it is already contained in a preceding -L 1525 dnl option. 1526 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` 1527 ;; 1528 *) 1529 dnl Most likely an immediate library name. 1530 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" 1531 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" 1532 ;; 1533 esac 1534 done 1535 fi 1536 else 1537 dnl Didn't find the library; assume it is in the system directories 1538 dnl known to the linker and runtime loader. (All the system 1539 dnl directories known to the linker should also be known to the 1540 dnl runtime loader, otherwise the system is severely misconfigured.) 1541 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" 1542 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" 1543 fi 1544 fi 1545 fi 1546 done 1547 done 1548 if test "X$rpathdirs" != "X"; then 1549 if test -n "$acl_hardcode_libdir_separator"; then 1550 dnl Weird platform: only the last -rpath option counts, the user must 1551 dnl pass all path elements in one option. We can arrange that for a 1552 dnl single library, but not when more than one $LIBNAMEs are used. 1553 alldirs= 1554 for found_dir in $rpathdirs; do 1555 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" 1556 done 1557 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. 1558 acl_save_libdir="$libdir" 1559 libdir="$alldirs" 1560 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1561 libdir="$acl_save_libdir" 1562 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" 1563 else 1564 dnl The -rpath options are cumulative. 1565 for found_dir in $rpathdirs; do 1566 acl_save_libdir="$libdir" 1567 libdir="$found_dir" 1568 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1569 libdir="$acl_save_libdir" 1570 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" 1571 done 1572 fi 1573 fi 1574 if test "X$ltrpathdirs" != "X"; then 1575 dnl When using libtool, the option that works for both libraries and 1576 dnl executables is -R. The -R options are cumulative. 1577 for found_dir in $ltrpathdirs; do 1578 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" 1579 done 1580 fi 1581]) 1582 1583dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, 1584dnl unless already present in VAR. 1585dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes 1586dnl contains two or three consecutive elements that belong together. 1587AC_DEFUN([AC_LIB_APPENDTOVAR], 1588[ 1589 for element in [$2]; do 1590 haveit= 1591 for x in $[$1]; do 1592 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1593 if test "X$x" = "X$element"; then 1594 haveit=yes 1595 break 1596 fi 1597 done 1598 if test -z "$haveit"; then 1599 [$1]="${[$1]}${[$1]:+ }$element" 1600 fi 1601 done 1602]) 1603 1604dnl For those cases where a variable contains several -L and -l options 1605dnl referring to unknown libraries and directories, this macro determines the 1606dnl necessary additional linker options for the runtime path. 1607dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) 1608dnl sets LDADDVAR to linker options needed together with LIBSVALUE. 1609dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, 1610dnl otherwise linking without libtool is assumed. 1611AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], 1612[ 1613 AC_REQUIRE([AC_LIB_RPATH]) 1614 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1615 $1= 1616 if test "$enable_rpath" != no; then 1617 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then 1618 dnl Use an explicit option to hardcode directories into the resulting 1619 dnl binary. 1620 rpathdirs= 1621 next= 1622 for opt in $2; do 1623 if test -n "$next"; then 1624 dir="$next" 1625 dnl No need to hardcode the standard /usr/lib. 1626 if test "X$dir" != "X/usr/$acl_libdirstem"; then 1627 rpathdirs="$rpathdirs $dir" 1628 fi 1629 next= 1630 else 1631 case $opt in 1632 -L) next=yes ;; 1633 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` 1634 dnl No need to hardcode the standard /usr/lib. 1635 if test "X$dir" != "X/usr/$acl_libdirstem"; then 1636 rpathdirs="$rpathdirs $dir" 1637 fi 1638 next= ;; 1639 *) next= ;; 1640 esac 1641 fi 1642 done 1643 if test "X$rpathdirs" != "X"; then 1644 if test -n ""$3""; then 1645 dnl libtool is used for linking. Use -R options. 1646 for dir in $rpathdirs; do 1647 $1="${$1}${$1:+ }-R$dir" 1648 done 1649 else 1650 dnl The linker is used for linking directly. 1651 if test -n "$acl_hardcode_libdir_separator"; then 1652 dnl Weird platform: only the last -rpath option counts, the user 1653 dnl must pass all path elements in one option. 1654 alldirs= 1655 for dir in $rpathdirs; do 1656 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" 1657 done 1658 acl_save_libdir="$libdir" 1659 libdir="$alldirs" 1660 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1661 libdir="$acl_save_libdir" 1662 $1="$flag" 1663 else 1664 dnl The -rpath options are cumulative. 1665 for dir in $rpathdirs; do 1666 acl_save_libdir="$libdir" 1667 libdir="$dir" 1668 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1669 libdir="$acl_save_libdir" 1670 $1="${$1}${$1:+ }$flag" 1671 done 1672 fi 1673 fi 1674 fi 1675 fi 1676 fi 1677 AC_SUBST([$1]) 1678]) 1679 1680# lib-prefix.m4 serial 5 (gettext-0.15) 1681dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. 1682dnl This file is free software; the Free Software Foundation 1683dnl gives unlimited permission to copy and/or distribute it, 1684dnl with or without modifications, as long as this notice is preserved. 1685 1686dnl From Bruno Haible. 1687 1688dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and 1689dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't 1690dnl require excessive bracketing. 1691ifdef([AC_HELP_STRING], 1692[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], 1693[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) 1694 1695dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed 1696dnl to access previously installed libraries. The basic assumption is that 1697dnl a user will want packages to use other packages he previously installed 1698dnl with the same --prefix option. 1699dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate 1700dnl libraries, but is otherwise very convenient. 1701AC_DEFUN([AC_LIB_PREFIX], 1702[ 1703 AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) 1704 AC_REQUIRE([AC_PROG_CC]) 1705 AC_REQUIRE([AC_CANONICAL_HOST]) 1706 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1707 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 1708 dnl By default, look in $includedir and $libdir. 1709 use_additional=yes 1710 AC_LIB_WITH_FINAL_PREFIX([ 1711 eval additional_includedir=\"$includedir\" 1712 eval additional_libdir=\"$libdir\" 1713 ]) 1714 AC_LIB_ARG_WITH([lib-prefix], 1715[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib 1716 --without-lib-prefix don't search for libraries in includedir and libdir], 1717[ 1718 if test "X$withval" = "Xno"; then 1719 use_additional=no 1720 else 1721 if test "X$withval" = "X"; then 1722 AC_LIB_WITH_FINAL_PREFIX([ 1723 eval additional_includedir=\"$includedir\" 1724 eval additional_libdir=\"$libdir\" 1725 ]) 1726 else 1727 additional_includedir="$withval/include" 1728 additional_libdir="$withval/$acl_libdirstem" 1729 fi 1730 fi 1731]) 1732 if test $use_additional = yes; then 1733 dnl Potentially add $additional_includedir to $CPPFLAGS. 1734 dnl But don't add it 1735 dnl 1. if it's the standard /usr/include, 1736 dnl 2. if it's already present in $CPPFLAGS, 1737 dnl 3. if it's /usr/local/include and we are using GCC on Linux, 1738 dnl 4. if it doesn't exist as a directory. 1739 if test "X$additional_includedir" != "X/usr/include"; then 1740 haveit= 1741 for x in $CPPFLAGS; do 1742 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1743 if test "X$x" = "X-I$additional_includedir"; then 1744 haveit=yes 1745 break 1746 fi 1747 done 1748 if test -z "$haveit"; then 1749 if test "X$additional_includedir" = "X/usr/local/include"; then 1750 if test -n "$GCC"; then 1751 case $host_os in 1752 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1753 esac 1754 fi 1755 fi 1756 if test -z "$haveit"; then 1757 if test -d "$additional_includedir"; then 1758 dnl Really add $additional_includedir to $CPPFLAGS. 1759 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" 1760 fi 1761 fi 1762 fi 1763 fi 1764 dnl Potentially add $additional_libdir to $LDFLAGS. 1765 dnl But don't add it 1766 dnl 1. if it's the standard /usr/lib, 1767 dnl 2. if it's already present in $LDFLAGS, 1768 dnl 3. if it's /usr/local/lib and we are using GCC on Linux, 1769 dnl 4. if it doesn't exist as a directory. 1770 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then 1771 haveit= 1772 for x in $LDFLAGS; do 1773 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1774 if test "X$x" = "X-L$additional_libdir"; then 1775 haveit=yes 1776 break 1777 fi 1778 done 1779 if test -z "$haveit"; then 1780 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then 1781 if test -n "$GCC"; then 1782 case $host_os in 1783 linux*) haveit=yes;; 1784 esac 1785 fi 1786 fi 1787 if test -z "$haveit"; then 1788 if test -d "$additional_libdir"; then 1789 dnl Really add $additional_libdir to $LDFLAGS. 1790 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" 1791 fi 1792 fi 1793 fi 1794 fi 1795 fi 1796]) 1797 1798dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, 1799dnl acl_final_exec_prefix, containing the values to which $prefix and 1800dnl $exec_prefix will expand at the end of the configure script. 1801AC_DEFUN([AC_LIB_PREPARE_PREFIX], 1802[ 1803 dnl Unfortunately, prefix and exec_prefix get only finally determined 1804 dnl at the end of configure. 1805 if test "X$prefix" = "XNONE"; then 1806 acl_final_prefix="$ac_default_prefix" 1807 else 1808 acl_final_prefix="$prefix" 1809 fi 1810 if test "X$exec_prefix" = "XNONE"; then 1811 acl_final_exec_prefix='${prefix}' 1812 else 1813 acl_final_exec_prefix="$exec_prefix" 1814 fi 1815 acl_save_prefix="$prefix" 1816 prefix="$acl_final_prefix" 1817 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" 1818 prefix="$acl_save_prefix" 1819]) 1820 1821dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the 1822dnl variables prefix and exec_prefix bound to the values they will have 1823dnl at the end of the configure script. 1824AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], 1825[ 1826 acl_save_prefix="$prefix" 1827 prefix="$acl_final_prefix" 1828 acl_save_exec_prefix="$exec_prefix" 1829 exec_prefix="$acl_final_exec_prefix" 1830 $1 1831 exec_prefix="$acl_save_exec_prefix" 1832 prefix="$acl_save_prefix" 1833]) 1834 1835dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing 1836dnl the basename of the libdir, either "lib" or "lib64". 1837AC_DEFUN([AC_LIB_PREPARE_MULTILIB], 1838[ 1839 dnl There is no formal standard regarding lib and lib64. The current 1840 dnl practice is that on a system supporting 32-bit and 64-bit instruction 1841 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit 1842 dnl libraries go under $prefix/lib. We determine the compiler's default 1843 dnl mode by looking at the compiler's library search path. If at least 1844 dnl of its elements ends in /lib64 or points to a directory whose absolute 1845 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the 1846 dnl default, namely "lib". 1847 acl_libdirstem=lib 1848 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` 1849 if test -n "$searchpath"; then 1850 acl_save_IFS="${IFS= }"; IFS=":" 1851 for searchdir in $searchpath; do 1852 if test -d "$searchdir"; then 1853 case "$searchdir" in 1854 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; 1855 *) searchdir=`cd "$searchdir" && pwd` 1856 case "$searchdir" in 1857 */lib64 ) acl_libdirstem=lib64 ;; 1858 esac ;; 1859 esac 1860 fi 1861 done 1862 IFS="$acl_save_IFS" 1863 fi 1864]) 1865 1866