Rev 84031 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
## concatentation of files in gettext-0.19.5.1/gettext-runtime/gnulib-m4## cat lib-ld.m4 lib-link.m4 lib-prefix.m4 > gettext-lib.m4# lib-ld.m4 serial 6dnl Copyright (C) 1996-2003, 2009-2015 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/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoiddnl collision with libtool.m4.dnl From libtool-2.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 lds 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-2.4. Sets the variable LD.AC_DEFUN([AC_LIB_PROG_LD],[AC_REQUIRE([AC_PROG_CC])dnlAC_REQUIRE([AC_CANONICAL_HOST])dnlAC_ARG_WITH([gnu-ld],[AS_HELP_STRING([--with-gnu-ld],[assume the C compiler uses GNU ld [default=no]])],[test "$withval" = no || with_gnu_ld=yes],[with_gnu_ld=no])dnl# Prepare PATH_SEPARATOR.# The user is always right.if test "${PATH_SEPARATOR+set}" != set; then# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which# contains only /bin. Note that ksh looks also at the FPATH variable,# so we have to set that as well for the test.PATH_SEPARATOR=:(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \|| PATH_SEPARATOR=';'}fiac_prog=ldif test "$GCC" = yes; then# Check if gcc -print-prog-name=ld gives a path.AC_MSG_CHECKING([for ld used by $CC])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.[[\\/]]* | ?:[[\\/]]*)re_direlt='/[[^/]][[^/]]*/\.\./'# Canonicalize the pathname 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"; thenacl_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor ac_dir in $PATH; doIFS="$acl_save_ifs"test -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 variants of GNU ld 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="$acl_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 26 (gettext-0.18.2)dnl Copyright (C) 2001-2015 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.54])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.dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libnamednl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.AC_DEFUN([AC_LIB_LINKFLAGS],[AC_REQUIRE([AC_LIB_PREPARE_PREFIX])AC_REQUIRE([AC_LIB_RPATH])pushdef([Name],[m4_translit([$1],[./+-], [____])])pushdef([NAME],[m4_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"ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"])LIB[]NAME="$ac_cv_lib[]Name[]_libs"LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"INC[]NAME="$ac_cv_lib[]Name[]_cppflags"LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)AC_SUBST([LIB]NAME)AC_SUBST([LTLIB]NAME)AC_SUBST([LIB]NAME[_PREFIX])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=yespopdef([NAME])popdef([Name])])dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])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. The missing-messagednl defaults to 'no' and may contain additional hints for the user.dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}dnl and 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.dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libnamednl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],[AC_REQUIRE([AC_LIB_PREPARE_PREFIX])AC_REQUIRE([AC_LIB_RPATH])pushdef([Name],[m4_translit([$1],[./+-], [____])])pushdef([NAME],[m4_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"dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,dnl because these -l options might require -L options that are present indnl LIBS. -l options benefit only from the -L options listed before it.dnl Otherwise, add it to the front of LIBS, because it may be a staticdnl library that depends on another static library that is present in LIBS.dnl Static libraries benefit only from the static libraries listed afterdnl it.case " $LIB[]NAME" in*" -l"*) LIBS="$LIBS $LIB[]NAME" ;;*) LIBS="$LIB[]NAME $LIBS" ;;esacAC_LINK_IFELSE([AC_LANG_PROGRAM([[$3]], [[$4]])],[ac_cv_lib[]Name=yes],[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])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 lib][$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=LIB[]NAME[]_PREFIX=fiAC_SUBST([HAVE_LIB]NAME)AC_SUBST([LIB]NAME)AC_SUBST([LTLIB]NAME)AC_SUBST([LIB]NAME[_PREFIX])popdef([NAME])popdef([Name])])dnl Determine the platform dependent parameters needed to use rpath:dnl acl_libext,dnl acl_shlibext,dnl acl_libname_spec,dnl acl_library_names_spec,dnl acl_hardcode_libdir_flag_spec,dnl acl_hardcode_libdir_separator,dnl acl_hardcode_direct,dnl acl_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"acl_libext="$acl_cv_libext"acl_shlibext="$acl_cv_shlibext"acl_libname_spec="$acl_cv_libname_spec"acl_library_names_spec="$acl_cv_library_names_spec"acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"acl_hardcode_direct="$acl_cv_hardcode_direct"acl_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_FROMPACKAGE(name, package)dnl declares that libname comes from the given package. The configure filednl will then not have a --with-libname-prefix option but adnl --with-package-prefix option. Several libraries can come from the samednl package. This declaration must occur before an AC_LIB_LINKFLAGS or similardnl macro call that searches for libname.AC_DEFUN([AC_LIB_FROMPACKAGE],[pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])define([acl_frompackage_]NAME, [$2])popdef([NAME])pushdef([PACK],[$2])pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])define([acl_libsinpackage_]PACKUP,m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])popdef([PACKUP])popdef([PACK])])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.dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was founddnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.AC_DEFUN([AC_LIB_LINKFLAGS_BODY],[AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])dnl Autoconf >= 2.61 supports dots in --with options.pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])dnl By default, look in $includedir and $libdir.use_additional=yesAC_LIB_WITH_FINAL_PREFIX([eval additional_includedir=\"$includedir\"eval additional_libdir=\"$libdir\"])AC_ARG_WITH(P_A_C_K[-prefix],[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib--without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ 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/$acl_libdirstem"if test "$acl_libdirstem2" != "$acl_libdirstem" \&& ! test -d "$withval/$acl_libdirstem"; thenadditional_libdir="$withval/$acl_libdirstem2"fififi])dnl Search the library and its dependencies in $additional_libdir anddnl $LDFLAGS. Using breadth-first-seach.LIB[]NAME=LTLIB[]NAME=INC[]NAME=LIB[]NAME[]_PREFIX=dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have beendnl computed. So it has to be reset here.HAVE_LIB[]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=eval libname=\"$acl_libname_spec\" # typically: libname=lib$nameif test -n "$acl_shlibext"; thenshrext=".$acl_shlibext" # typically: shrext=.soelseshrext=fiif test $use_additional = yes; thendir="$additional_libdir"dnl The same code as in the loop below:dnl First look for a shared library.if test -n "$acl_shlibext"; thenif test -f "$dir/$libname$shrext"; thenfound_dir="$dir"found_so="$dir/$libname$shrext"elseif test "$acl_library_names_spec" = '$libname$shrext$versuffix'; thenver=`(cd "$dir" && \for f in "$libname$shrext".*; do echo "$f"; done \| sed -e "s,^$libname$shrext\\\\.,," \| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \| sed 1q ) 2>/dev/null`if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; thenfound_dir="$dir"found_so="$dir/$libname$shrext.$ver"fielseeval library_names=\"$acl_library_names_spec\"for f in $library_names; doif test -f "$dir/$f"; thenfound_dir="$dir"found_so="$dir/$f"breakfidonefififidnl Then look for a static library.if test "X$found_dir" = "X"; thenif test -f "$dir/$libname.$acl_libext"; thenfound_dir="$dir"found_a="$dir/$libname.$acl_libext"fifiif test "X$found_dir" != "X"; thenif test -f "$dir/$libname.la"; thenfound_la="$dir/$libname.la"fififiif 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//'`dnl First look for a shared library.if test -n "$acl_shlibext"; thenif test -f "$dir/$libname$shrext"; thenfound_dir="$dir"found_so="$dir/$libname$shrext"elseif test "$acl_library_names_spec" = '$libname$shrext$versuffix'; thenver=`(cd "$dir" && \for f in "$libname$shrext".*; do echo "$f"; done \| sed -e "s,^$libname$shrext\\\\.,," \| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \| sed 1q ) 2>/dev/null`if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; thenfound_dir="$dir"found_so="$dir/$libname$shrext.$ver"fielseeval library_names=\"$acl_library_names_spec\"for f in $library_names; doif test -f "$dir/$f"; thenfound_dir="$dir"found_so="$dir/$f"breakfidonefififidnl Then look for a static library.if test "X$found_dir" = "X"; thenif test -f "$dir/$libname.$acl_libext"; thenfound_dir="$dir"found_a="$dir/$libname.$acl_libext"fifiif test "X$found_dir" != "X"; thenif test -f "$dir/$libname.la"; thenfound_la="$dir/$libname.la"fifi;;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/$acl_libdirstem" \|| test "X$found_dir" = "X/usr/$acl_libdirstem2"; 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 "$acl_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 "$acl_hardcode_libdir_flag_spec" && test "$acl_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 "$acl_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 $acl_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*/$acl_libdirstem | */$acl_libdirstem/)basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`if test "$name" = '$1'; thenLIB[]NAME[]_PREFIX="$basedir"fiadditional_includedir="$basedir/include";;*/$acl_libdirstem2 | */$acl_libdirstem2/)basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`if test "$name" = '$1'; thenLIB[]NAME[]_PREFIX="$basedir"fiadditional_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/$acl_libdirstem" \&& test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; thenhaveit=if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \|| test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; 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 "$acl_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:+$acl_hardcode_libdir_separator}$found_dir"donednl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.acl_save_libdir="$libdir"libdir="$alldirs"eval flag=\"$acl_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=\"$acl_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"donefipopdef([P_A_C_K])popdef([PACKLIBS])popdef([PACKUP])popdef([PACK])popdef([NAME])])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])dnl For those cases where a variable contains several -L and -l optionsdnl referring to unknown libraries and directories, this macro determines thednl necessary additional linker options for the runtime path.dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])dnl sets LDADDVAR to linker options needed together with LIBSVALUE.dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,dnl otherwise linking without libtool is assumed.AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],[AC_REQUIRE([AC_LIB_RPATH])AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])$1=if test "$enable_rpath" != no; thenif test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; thendnl Use an explicit option to hardcode directories into the resultingdnl binary.rpathdirs=next=for opt in $2; doif test -n "$next"; thendir="$next"dnl No need to hardcode the standard /usr/lib.if test "X$dir" != "X/usr/$acl_libdirstem" \&& test "X$dir" != "X/usr/$acl_libdirstem2"; thenrpathdirs="$rpathdirs $dir"finext=elsecase $opt in-L) next=yes ;;-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`dnl No need to hardcode the standard /usr/lib.if test "X$dir" != "X/usr/$acl_libdirstem" \&& test "X$dir" != "X/usr/$acl_libdirstem2"; thenrpathdirs="$rpathdirs $dir"finext= ;;*) next= ;;esacfidoneif test "X$rpathdirs" != "X"; thenif test -n ""$3""; thendnl libtool is used for linking. Use -R options.for dir in $rpathdirs; do$1="${$1}${$1:+ }-R$dir"doneelsednl The linker is used for linking directly.if test -n "$acl_hardcode_libdir_separator"; thendnl Weird platform: only the last -rpath option counts, the userdnl must pass all path elements in one option.alldirs=for dir in $rpathdirs; doalldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"doneacl_save_libdir="$libdir"libdir="$alldirs"eval flag=\"$acl_hardcode_libdir_flag_spec\"libdir="$acl_save_libdir"$1="$flag"elsednl The -rpath options are cumulative.for dir in $rpathdirs; doacl_save_libdir="$libdir"libdir="$dir"eval flag=\"$acl_hardcode_libdir_flag_spec\"libdir="$acl_save_libdir"$1="${$1}${$1:+ }$flag"donefififififiAC_SUBST([$1])])# lib-prefix.m4 serial 7 (gettext-0.18)dnl Copyright (C) 2001-2005, 2008-2015 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_MULTILIB])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/$acl_libdirstem"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/$acl_libdirstem"; 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/$acl_libdirstem"; 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"])dnl AC_LIB_PREPARE_MULTILIB createsdnl - a variable acl_libdirstem, containing the basename of the libdir, eitherdnl "lib" or "lib64" or "lib/64",dnl - a variable acl_libdirstem2, as a secondary possible value fordnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" ordnl "lib/amd64".AC_DEFUN([AC_LIB_PREPARE_MULTILIB],[dnl There is no formal standard regarding lib and lib64.dnl On glibc systems, the current practice is that on a system supportingdnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go underdnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determinednl the compiler's default mode by looking at the compiler's library searchdnl path. If at least one of its elements ends in /lib64 or points to adnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.dnl Otherwise we use the default, namely "lib".dnl On Solaris systems, the current practice is that on a system supportingdnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go underdnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 ordnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.AC_REQUIRE([AC_CANONICAL_HOST])acl_libdirstem=libacl_libdirstem2=case "$host_os" insolaris*)dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environmentdnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."dnl But we want to recognize the sparcv9 or amd64 subdirectory also if thednl symlink is missing, so we set acl_libdirstem2 too.AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],[AC_EGREP_CPP([sixtyfour bits], [#ifdef _LP64sixtyfour bits#endif], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])])if test $gl_cv_solaris_64bit = yes; thenacl_libdirstem=lib/64case "$host_cpu" insparc*) acl_libdirstem2=lib/sparcv9 ;;i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;esacfi;;*)searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`if test -n "$searchpath"; thenacl_save_IFS="${IFS= }"; IFS=":"for searchdir in $searchpath; doif test -d "$searchdir"; thencase "$searchdir" in*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;*/../ | */.. )# Better ignore directories of this form. They are misleading.;;*) searchdir=`cd "$searchdir" && pwd`case "$searchdir" in*/lib64 ) acl_libdirstem=lib64 ;;esac ;;esacfidoneIFS="$acl_save_IFS"fi;;esactest -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"])