Rev 36861 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
## concatentation of files in gettext-0.14.5/autoconf-lib-link/m4# lib-ld.m4 serial 3 (gettext-0.13)dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.dnl This file is free software; the Free Software Foundationdnl gives unlimited permission to copy and/or distribute it,dnl with or without modifications, as long as this notice is preserved.dnl Subroutines of libtool.m4,dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collisiondnl with libtool.m4.dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.AC_DEFUN([AC_LIB_PROG_LD_GNU],[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,[# I'd rather use --version here, but apparently some GNU ld's only accept -v.case `$LD -v 2>&1 </dev/null` in*GNU* | *'with BFD'*)acl_cv_prog_gnu_ld=yes ;;*)acl_cv_prog_gnu_ld=no ;;esac])with_gnu_ld=$acl_cv_prog_gnu_ld])dnl From libtool-1.4. Sets the variable LD.AC_DEFUN([AC_LIB_PROG_LD],[AC_ARG_WITH(gnu-ld,[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)AC_REQUIRE([AC_PROG_CC])dnlAC_REQUIRE([AC_CANONICAL_HOST])dnl# Prepare PATH_SEPARATOR.# The user is always right.if test "${PATH_SEPARATOR+set}" != set; thenecho "#! /bin/sh" >conf$$.shecho "exit 0" >>conf$$.shchmod +x conf$$.shif (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; thenPATH_SEPARATOR=';'elsePATH_SEPARATOR=:firm -f conf$$.shfiac_prog=ldif test "$GCC" = yes; then# Check if gcc -print-prog-name=ld gives a path.AC_MSG_CHECKING([for ld used by GCC])case $host in*-*-mingw*)# gcc leaves a trailing carriage return which upsets mingwac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;*)ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;esaccase $ac_prog in# Accept absolute paths.[[\\/]* | [A-Za-z]:[\\/]*)][re_direlt='/[^/][^/]*/\.\./']# Canonicalize the path of ldac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; doac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`donetest -z "$LD" && LD="$ac_prog";;"")# If it fails, then pretend we aren't using GCC.ac_prog=ld;;*)# If it is relative, then search for the first ld in PATH.with_gnu_ld=unknown;;esacelif test "$with_gnu_ld" = yes; thenAC_MSG_CHECKING([for GNU ld])elseAC_MSG_CHECKING([for non-GNU ld])fiAC_CACHE_VAL(acl_cv_path_LD,[if test -z "$LD"; thenIFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"for ac_dir in $PATH; dotest -z "$ac_dir" && ac_dir=.if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; thenacl_cv_path_LD="$ac_dir/$ac_prog"# Check to see if the program is GNU ld. I'd rather use --version,# but apparently some GNU ld's only accept -v.# Break only if it was the GNU/non-GNU ld that we prefer.case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in*GNU* | *'with BFD'*)test "$with_gnu_ld" != no && break ;;*)test "$with_gnu_ld" != yes && break ;;esacfidoneIFS="$ac_save_ifs"elseacl_cv_path_LD="$LD" # Let the user override the test with a path.fi])LD="$acl_cv_path_LD"if test -n "$LD"; thenAC_MSG_RESULT($LD)elseAC_MSG_RESULT(no)fitest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])AC_LIB_PROG_LD_GNU])# lib-link.m4 serial 6 (gettext-0.14.3)dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.dnl This file is free software; the Free Software Foundationdnl gives unlimited permission to copy and/or distribute it,dnl with or without modifications, as long as this notice is preserved.dnl From Bruno Haible.AC_PREREQ(2.50)dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname anddnl the libraries corresponding to explicit and implicit dependencies.dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables anddnl augments the CPPFLAGS variable.AC_DEFUN([AC_LIB_LINKFLAGS],[AC_REQUIRE([AC_LIB_PREPARE_PREFIX])AC_REQUIRE([AC_LIB_RPATH])define([Name],[translit([$1],[./-], [___])])define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [AC_LIB_LINKFLAGS_BODY([$1], [$2])ac_cv_lib[]Name[]_libs="$LIB[]NAME"ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"ac_cv_lib[]Name[]_cppflags="$INC[]NAME"])LIB[]NAME="$ac_cv_lib[]Name[]_libs"LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"INC[]NAME="$ac_cv_lib[]Name[]_cppflags"AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)AC_SUBST([LIB]NAME)AC_SUBST([LTLIB]NAME)dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse thednl results of this search when this library appears as a dependency.HAVE_LIB[]NAME=yesundefine([Name])undefine([NAME])])dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)dnl searches for libname and the libraries corresponding to explicit anddnl implicit dependencies, together with the specified include files anddnl the ability to compile and link the specified testcode. If found, itdnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} anddnl LTLIB${NAME} variables and augments the CPPFLAGS variable, anddnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTsdnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],[AC_REQUIRE([AC_LIB_PREPARE_PREFIX])AC_REQUIRE([AC_LIB_RPATH])define([Name],[translit([$1],[./-], [___])])define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAMEdnl accordingly.AC_LIB_LINKFLAGS_BODY([$1], [$2])dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,dnl because if the user has installed lib[]Name and not disabled its usednl via --without-lib[]Name-prefix, he wants to use it.ac_save_CPPFLAGS="$CPPFLAGS"AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ac_save_LIBS="$LIBS"LIBS="$LIBS $LIB[]NAME"AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])LIBS="$ac_save_LIBS"])if test "$ac_cv_lib[]Name" = yes; thenHAVE_LIB[]NAME=yesAC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])AC_MSG_CHECKING([how to link with lib[]$1])AC_MSG_RESULT([$LIB[]NAME])elseHAVE_LIB[]NAME=nodnl If $LIB[]NAME didn't lead to a usable library, we don't needdnl $INC[]NAME either.CPPFLAGS="$ac_save_CPPFLAGS"LIB[]NAME=LTLIB[]NAME=fiAC_SUBST([HAVE_LIB]NAME)AC_SUBST([LIB]NAME)AC_SUBST([LTLIB]NAME)undefine([Name])undefine([NAME])])dnl Determine the platform dependent parameters needed to use rpath:dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,dnl hardcode_direct, hardcode_minus_L.AC_DEFUN([AC_LIB_RPATH],[dnl Tell automake >= 1.10 to complain if config.rpath is missing.m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGSAC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ldAC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $hostAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dirAC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh. ./conftest.shrm -f ./conftest.shacl_cv_rpath=done])wl="$acl_cv_wl"libext="$acl_cv_libext"shlibext="$acl_cv_shlibext"hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"hardcode_direct="$acl_cv_hardcode_direct"hardcode_minus_L="$acl_cv_hardcode_minus_L"dnl Determine whether the user wants rpath handling at all.AC_ARG_ENABLE(rpath,[ --disable-rpath do not hardcode runtime library paths],:, enable_rpath=yes)])dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname anddnl the libraries corresponding to explicit and implicit dependencies.dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.AC_DEFUN([AC_LIB_LINKFLAGS_BODY],[define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])dnl By default, look in $includedir and $libdir.use_additional=yesAC_LIB_WITH_FINAL_PREFIX([eval additional_includedir=\"$includedir\"eval additional_libdir=\"$libdir\"])AC_LIB_ARG_WITH([lib$1-prefix],[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib--without-lib$1-prefix don't search for lib$1 in includedir and libdir],[if test "X$withval" = "Xno"; thenuse_additional=noelseif test "X$withval" = "X"; thenAC_LIB_WITH_FINAL_PREFIX([eval additional_includedir=\"$includedir\"eval additional_libdir=\"$libdir\"])elseadditional_includedir="$withval/include"additional_libdir="$withval/lib"fifi])dnl Search the library and its dependencies in $additional_libdir anddnl $LDFLAGS. Using breadth-first-seach.LIB[]NAME=LTLIB[]NAME=INC[]NAME=rpathdirs=ltrpathdirs=names_already_handled=names_next_round='$1 $2'while test -n "$names_next_round"; donames_this_round="$names_next_round"names_next_round=for name in $names_this_round; doalready_handled=for n in $names_already_handled; doif test "$n" = "$name"; thenalready_handled=yesbreakfidoneif test -z "$already_handled"; thennames_already_handled="$names_already_handled $name"dnl See if it was already located by an earlier AC_LIB_LINKFLAGSdnl or AC_LIB_HAVE_LINKFLAGS call.uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`eval value=\"\$HAVE_LIB$uppername\"if test -n "$value"; thenif test "$value" = yes; theneval value=\"\$LIB$uppername\"test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"eval value=\"\$LTLIB$uppername\"test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"elsednl An earlier call to AC_LIB_HAVE_LINKFLAGS has determineddnl that this library doesn't exist. So just drop it.:fielsednl Search the library lib$name in $additional_libdir and $LDFLAGSdnl and the already constructed $LIBNAME/$LTLIBNAME.found_dir=found_la=found_so=found_a=if test $use_additional = yes; thenif test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; thenfound_dir="$additional_libdir"found_so="$additional_libdir/lib$name.$shlibext"if test -f "$additional_libdir/lib$name.la"; thenfound_la="$additional_libdir/lib$name.la"fielseif test -f "$additional_libdir/lib$name.$libext"; thenfound_dir="$additional_libdir"found_a="$additional_libdir/lib$name.$libext"if test -f "$additional_libdir/lib$name.la"; thenfound_la="$additional_libdir/lib$name.la"fifififiif test "X$found_dir" = "X"; thenfor x in $LDFLAGS $LTLIB[]NAME; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])case "$x" in-L*)dir=`echo "X$x" | sed -e 's/^X-L//'`if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; thenfound_dir="$dir"found_so="$dir/lib$name.$shlibext"if test -f "$dir/lib$name.la"; thenfound_la="$dir/lib$name.la"fielseif test -f "$dir/lib$name.$libext"; thenfound_dir="$dir"found_a="$dir/lib$name.$libext"if test -f "$dir/lib$name.la"; thenfound_la="$dir/lib$name.la"fififi;;esacif test "X$found_dir" != "X"; thenbreakfidonefiif test "X$found_dir" != "X"; thendnl Found the library.LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"if test "X$found_so" != "X"; thendnl Linking with a shared library. We attempt to hardcode itsdnl directory into the executable's runpath, unless it's thednl standard /usr/lib.if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; thendnl No hardcoding is needed.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"elsednl Use an explicit option to hardcode DIR into the resultingdnl binary.dnl Potentially add DIR to ltrpathdirs.dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.haveit=for x in $ltrpathdirs; doif test "X$x" = "X$found_dir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenltrpathdirs="$ltrpathdirs $found_dir"fidnl The hardcoding into $LIBNAME is system dependent.if test "$hardcode_direct" = yes; thendnl Using DIR/libNAME.so during linking hardcodes DIR into thednl resulting binary.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"elseif test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; thendnl Use an explicit option to hardcode DIR into the resultingdnl binary.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"dnl Potentially add DIR to rpathdirs.dnl The rpathdirs will be appended to $LIBNAME at the end.haveit=for x in $rpathdirs; doif test "X$x" = "X$found_dir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenrpathdirs="$rpathdirs $found_dir"fielsednl Rely on "-L$found_dir".dnl But don't add it if it's already contained in the LDFLAGSdnl or the already constructed $LIBNAMEhaveit=for x in $LDFLAGS $LIB[]NAME; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X-L$found_dir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenLIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"fiif test "$hardcode_minus_L" != no; thendnl FIXME: Not sure whether we should usednl "-L$found_dir -l$name" or "-L$found_dir $found_so"dnl here.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"elsednl We cannot use $hardcode_runpath_var and LD_RUN_PATHdnl here, because this doesn't fit in flags passed to thednl compiler. So give up. No hardcoding. This affects onlydnl very old systems.dnl FIXME: Not sure whether we should usednl "-L$found_dir -l$name" or "-L$found_dir $found_so"dnl here.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"fifififielseif test "X$found_a" != "X"; thendnl Linking with a static library.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"elsednl We shouldn't come here, but anyway it's good to have adnl fallback.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"fifidnl Assume the include files are nearby.additional_includedir=case "$found_dir" in*/lib | */lib/)basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`additional_includedir="$basedir/include";;esacif test "X$additional_includedir" != "X"; thendnl Potentially add $additional_includedir to $INCNAME.dnl But don't add itdnl 1. if it's the standard /usr/include,dnl 2. if it's /usr/local/include and we are using GCC on Linux,dnl 3. if it's already present in $CPPFLAGS or the alreadydnl constructed $INCNAME,dnl 4. if it doesn't exist as a directory.if test "X$additional_includedir" != "X/usr/include"; thenhaveit=if test "X$additional_includedir" = "X/usr/local/include"; thenif test -n "$GCC"; thencase $host_os inlinux* | gnu* | k*bsd*-gnu) haveit=yes;;esacfifiif test -z "$haveit"; thenfor x in $CPPFLAGS $INC[]NAME; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X-I$additional_includedir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenif test -d "$additional_includedir"; thendnl Really add $additional_includedir to $INCNAME.INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"fififififidnl Look for dependencies.if test -n "$found_la"; thendnl Read the .la file. It defines the variablesdnl dlname, library_names, old_library, dependency_libs, current,dnl age, revision, installed, dlopen, dlpreopen, libdir.save_libdir="$libdir"case "$found_la" in*/* | *\\*) . "$found_la" ;;*) . "./$found_la" ;;esaclibdir="$save_libdir"dnl We use only dependency_libs.for dep in $dependency_libs; docase "$dep" in-L*)additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.dnl But don't add itdnl 1. if it's the standard /usr/lib,dnl 2. if it's /usr/local/lib and we are using GCC on Linux,dnl 3. if it's already present in $LDFLAGS or the alreadydnl constructed $LIBNAME,dnl 4. if it doesn't exist as a directory.if test "X$additional_libdir" != "X/usr/lib"; thenhaveit=if test "X$additional_libdir" = "X/usr/local/lib"; thenif test -n "$GCC"; thencase $host_os inlinux* | gnu* | k*bsd*-gnu) haveit=yes;;esacfifiif test -z "$haveit"; thenhaveit=for x in $LDFLAGS $LIB[]NAME; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X-L$additional_libdir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenif test -d "$additional_libdir"; thendnl Really add $additional_libdir to $LIBNAME.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"fifihaveit=for x in $LDFLAGS $LTLIB[]NAME; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X-L$additional_libdir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenif test -d "$additional_libdir"; thendnl Really add $additional_libdir to $LTLIBNAME.LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"fifififi;;-R*)dir=`echo "X$dep" | sed -e 's/^X-R//'`if test "$enable_rpath" != no; thendnl Potentially add DIR to rpathdirs.dnl The rpathdirs will be appended to $LIBNAME at the end.haveit=for x in $rpathdirs; doif test "X$x" = "X$dir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenrpathdirs="$rpathdirs $dir"fidnl Potentially add DIR to ltrpathdirs.dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.haveit=for x in $ltrpathdirs; doif test "X$x" = "X$dir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenltrpathdirs="$ltrpathdirs $dir"fifi;;-l*)dnl Handle this in the next round.names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`;;*.la)dnl Handle this in the next round. Throw away the .la'sdnl directory; it is already contained in a preceding -Ldnl option.names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`;;*)dnl Most likely an immediate library name.LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep";;esacdonefielsednl Didn't find the library; assume it is in the system directoriesdnl known to the linker and runtime loader. (All the systemdnl directories known to the linker should also be known to thednl runtime loader, otherwise the system is severely misconfigured.)LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"fififidonedoneif test "X$rpathdirs" != "X"; thenif test -n "$hardcode_libdir_separator"; thendnl Weird platform: only the last -rpath option counts, the user mustdnl pass all path elements in one option. We can arrange that for adnl single library, but not when more than one $LIBNAMEs are used.alldirs=for found_dir in $rpathdirs; doalldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"donednl Note: hardcode_libdir_flag_spec uses $libdir and $wl.acl_save_libdir="$libdir"libdir="$alldirs"eval flag=\"$hardcode_libdir_flag_spec\"libdir="$acl_save_libdir"LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"elsednl The -rpath options are cumulative.for found_dir in $rpathdirs; doacl_save_libdir="$libdir"libdir="$found_dir"eval flag=\"$hardcode_libdir_flag_spec\"libdir="$acl_save_libdir"LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"donefifiif test "X$ltrpathdirs" != "X"; thendnl When using libtool, the option that works for both libraries anddnl executables is -R. The -R options are cumulative.for found_dir in $ltrpathdirs; doLTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"donefi])dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,dnl unless already present in VAR.dnl Works only for CPPFLAGS, not for LIB* variables because that sometimesdnl contains two or three consecutive elements that belong together.AC_DEFUN([AC_LIB_APPENDTOVAR],[for element in [$2]; dohaveit=for x in $[$1]; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X$element"; thenhaveit=yesbreakfidoneif test -z "$haveit"; then[$1]="${[$1]}${[$1]:+ }$element"fidone])# lib-prefix.m4 serial 4 (gettext-0.14.2)dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.dnl This file is free software; the Free Software Foundationdnl gives unlimited permission to copy and/or distribute it,dnl with or without modifications, as long as this notice is preserved.dnl From Bruno Haible.dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, anddnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn'tdnl require excessive bracketing.ifdef([AC_HELP_STRING],[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are neededdnl to access previously installed libraries. The basic assumption is thatdnl a user will want packages to use other packages he previously installeddnl with the same --prefix option.dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locatednl libraries, but is otherwise very convenient.AC_DEFUN([AC_LIB_PREFIX],[AC_BEFORE([$0], [AC_LIB_LINKFLAGS])AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_LIB_PREPARE_PREFIX])dnl By default, look in $includedir and $libdir.use_additional=yesAC_LIB_WITH_FINAL_PREFIX([eval additional_includedir=\"$includedir\"eval additional_libdir=\"$libdir\"])AC_LIB_ARG_WITH([lib-prefix],[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib--without-lib-prefix don't search for libraries in includedir and libdir],[if test "X$withval" = "Xno"; thenuse_additional=noelseif test "X$withval" = "X"; thenAC_LIB_WITH_FINAL_PREFIX([eval additional_includedir=\"$includedir\"eval additional_libdir=\"$libdir\"])elseadditional_includedir="$withval/include"additional_libdir="$withval/lib"fifi])if test $use_additional = yes; thendnl Potentially add $additional_includedir to $CPPFLAGS.dnl But don't add itdnl 1. if it's the standard /usr/include,dnl 2. if it's already present in $CPPFLAGS,dnl 3. if it's /usr/local/include and we are using GCC on Linux,dnl 4. if it doesn't exist as a directory.if test "X$additional_includedir" != "X/usr/include"; thenhaveit=for x in $CPPFLAGS; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X-I$additional_includedir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenif test "X$additional_includedir" = "X/usr/local/include"; thenif test -n "$GCC"; thencase $host_os inlinux* | gnu* | k*bsd*-gnu) haveit=yes;;esacfifiif test -z "$haveit"; thenif test -d "$additional_includedir"; thendnl Really add $additional_includedir to $CPPFLAGS.CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"fifififidnl Potentially add $additional_libdir to $LDFLAGS.dnl But don't add itdnl 1. if it's the standard /usr/lib,dnl 2. if it's already present in $LDFLAGS,dnl 3. if it's /usr/local/lib and we are using GCC on Linux,dnl 4. if it doesn't exist as a directory.if test "X$additional_libdir" != "X/usr/lib"; thenhaveit=for x in $LDFLAGS; doAC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])if test "X$x" = "X-L$additional_libdir"; thenhaveit=yesbreakfidoneif test -z "$haveit"; thenif test "X$additional_libdir" = "X/usr/local/lib"; thenif test -n "$GCC"; thencase $host_os inlinux*) haveit=yes;;esacfifiif test -z "$haveit"; thenif test -d "$additional_libdir"; thendnl Really add $additional_libdir to $LDFLAGS.LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"fififififi])dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,dnl acl_final_exec_prefix, containing the values to which $prefix anddnl $exec_prefix will expand at the end of the configure script.AC_DEFUN([AC_LIB_PREPARE_PREFIX],[dnl Unfortunately, prefix and exec_prefix get only finally determineddnl at the end of configure.if test "X$prefix" = "XNONE"; thenacl_final_prefix="$ac_default_prefix"elseacl_final_prefix="$prefix"fiif test "X$exec_prefix" = "XNONE"; thenacl_final_exec_prefix='${prefix}'elseacl_final_exec_prefix="$exec_prefix"fiacl_save_prefix="$prefix"prefix="$acl_final_prefix"eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"prefix="$acl_save_prefix"])dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with thednl variables prefix and exec_prefix bound to the values they will havednl at the end of the configure script.AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],[acl_save_prefix="$prefix"prefix="$acl_final_prefix"acl_save_exec_prefix="$exec_prefix"exec_prefix="$acl_final_exec_prefix"$1exec_prefix="$acl_save_exec_prefix"prefix="$acl_save_prefix"])