| lib-link.m4 | lib-link.m4 | |||
|---|---|---|---|---|
| # lib-link.m4 serial 9 (gettext-0.16) | # lib-link.m4 serial 21 (gettext-0.18) | |||
| dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. | dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. | |||
| dnl This file is free software; the Free Software Foundation | dnl This file is free software; the Free Software Foundation | |||
| dnl gives unlimited permission to copy and/or distribute it, | dnl gives unlimited permission to copy and/or distribute it, | |||
| dnl with or without modifications, as long as this notice is preserved. | dnl with or without modifications, as long as this notice is preserved. | |||
| dnl From Bruno Haible. | dnl From Bruno Haible. | |||
| AC_PREREQ(2.50) | AC_PREREQ([2.54]) | |||
| dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and | dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and | |||
| dnl the libraries corresponding to explicit and implicit dependencies. | dnl the libraries corresponding to explicit and implicit dependencies. | |||
| dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and | dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and | |||
| dnl augments the CPPFLAGS variable. | dnl augments the CPPFLAGS variable. | |||
| dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libnam | ||||
| e | ||||
| dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. | ||||
| AC_DEFUN([AC_LIB_LINKFLAGS], | AC_DEFUN([AC_LIB_LINKFLAGS], | |||
| [ | [ | |||
| AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | |||
| AC_REQUIRE([AC_LIB_RPATH]) | AC_REQUIRE([AC_LIB_RPATH]) | |||
| define([Name],[translit([$1],[./-], [___])]) | pushdef([Name],[translit([$1],[./-], [___])]) | |||
| define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | |||
| [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | |||
| AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ | AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ | |||
| AC_LIB_LINKFLAGS_BODY([$1], [$2]) | AC_LIB_LINKFLAGS_BODY([$1], [$2]) | |||
| ac_cv_lib[]Name[]_libs="$LIB[]NAME" | ac_cv_lib[]Name[]_libs="$LIB[]NAME" | |||
| ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" | ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" | |||
| ac_cv_lib[]Name[]_cppflags="$INC[]NAME" | ac_cv_lib[]Name[]_cppflags="$INC[]NAME" | |||
| ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" | ||||
| ]) | ]) | |||
| LIB[]NAME="$ac_cv_lib[]Name[]_libs" | LIB[]NAME="$ac_cv_lib[]Name[]_libs" | |||
| LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" | LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" | |||
| INC[]NAME="$ac_cv_lib[]Name[]_cppflags" | INC[]NAME="$ac_cv_lib[]Name[]_cppflags" | |||
| LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" | ||||
| AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | |||
| AC_SUBST([LIB]NAME) | AC_SUBST([LIB]NAME) | |||
| AC_SUBST([LTLIB]NAME) | AC_SUBST([LTLIB]NAME) | |||
| AC_SUBST([LIB]NAME[_PREFIX]) | ||||
| dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the | dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the | |||
| dnl results of this search when this library appears as a dependency. | dnl results of this search when this library appears as a dependency. | |||
| HAVE_LIB[]NAME=yes | HAVE_LIB[]NAME=yes | |||
| undefine([Name]) | popdef([NAME]) | |||
| undefine([NAME]) | popdef([Name]) | |||
| ]) | ]) | |||
| dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) | dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing- message]) | |||
| dnl searches for libname and the libraries corresponding to explicit and | dnl searches for libname and the libraries corresponding to explicit and | |||
| dnl implicit dependencies, together with the specified include files and | dnl implicit dependencies, together with the specified include files and | |||
| dnl the ability to compile and link the specified testcode. If found, it | dnl the ability to compile and link the specified testcode. The missing-mes | |||
| dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and | sage | |||
| dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and | dnl 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, and | ||||
| dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs | dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs | |||
| dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. | dnl 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 libnam | ||||
| e | ||||
| dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. | ||||
| AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], | AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], | |||
| [ | [ | |||
| AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | |||
| AC_REQUIRE([AC_LIB_RPATH]) | AC_REQUIRE([AC_LIB_RPATH]) | |||
| define([Name],[translit([$1],[./-], [___])]) | pushdef([Name],[translit([$1],[./-], [___])]) | |||
| define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | |||
| [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | |||
| dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME | dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME | |||
| dnl accordingly. | dnl accordingly. | |||
| AC_LIB_LINKFLAGS_BODY([$1], [$2]) | AC_LIB_LINKFLAGS_BODY([$1], [$2]) | |||
| dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, | dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, | |||
| dnl because if the user has installed lib[]Name and not disabled its use | dnl because if the user has installed lib[]Name and not disabled its use | |||
| dnl via --without-lib[]Name-prefix, he wants to use it. | dnl via --without-lib[]Name-prefix, he wants to use it. | |||
| ac_save_CPPFLAGS="$CPPFLAGS" | ac_save_CPPFLAGS="$CPPFLAGS" | |||
| AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | |||
| AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ | AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ | |||
| ac_save_LIBS="$LIBS" | ac_save_LIBS="$LIBS" | |||
| LIBS="$LIBS $LIB[]NAME" | dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, | |||
| AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) | dnl because these -l options might require -L options that are present | |||
| in | ||||
| dnl 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 static | ||||
| dnl library that depends on another static library that is present in L | ||||
| IBS. | ||||
| dnl Static libraries benefit only from the static libraries listed afte | ||||
| r | ||||
| dnl it. | ||||
| case " $LIB[]NAME" in | ||||
| *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; | ||||
| *) LIBS="$LIB[]NAME $LIBS" ;; | ||||
| esac | ||||
| AC_TRY_LINK([$3], [$4], | ||||
| [ac_cv_lib[]Name=yes], | ||||
| [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) | ||||
| LIBS="$ac_save_LIBS" | LIBS="$ac_save_LIBS" | |||
| ]) | ]) | |||
| if test "$ac_cv_lib[]Name" = yes; then | if test "$ac_cv_lib[]Name" = yes; then | |||
| HAVE_LIB[]NAME=yes | HAVE_LIB[]NAME=yes | |||
| AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) | AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) | |||
| AC_MSG_CHECKING([how to link with lib[]$1]) | AC_MSG_CHECKING([how to link with lib[]$1]) | |||
| AC_MSG_RESULT([$LIB[]NAME]) | AC_MSG_RESULT([$LIB[]NAME]) | |||
| else | else | |||
| HAVE_LIB[]NAME=no | HAVE_LIB[]NAME=no | |||
| dnl If $LIB[]NAME didn't lead to a usable library, we don't need | dnl If $LIB[]NAME didn't lead to a usable library, we don't need | |||
| dnl $INC[]NAME either. | dnl $INC[]NAME either. | |||
| CPPFLAGS="$ac_save_CPPFLAGS" | CPPFLAGS="$ac_save_CPPFLAGS" | |||
| LIB[]NAME= | LIB[]NAME= | |||
| LTLIB[]NAME= | LTLIB[]NAME= | |||
| LIB[]NAME[]_PREFIX= | ||||
| fi | fi | |||
| AC_SUBST([HAVE_LIB]NAME) | AC_SUBST([HAVE_LIB]NAME) | |||
| AC_SUBST([LIB]NAME) | AC_SUBST([LIB]NAME) | |||
| AC_SUBST([LTLIB]NAME) | AC_SUBST([LTLIB]NAME) | |||
| undefine([Name]) | AC_SUBST([LIB]NAME[_PREFIX]) | |||
| undefine([NAME]) | popdef([NAME]) | |||
| popdef([Name]) | ||||
| ]) | ]) | |||
| dnl Determine the platform dependent parameters needed to use rpath: | dnl Determine the platform dependent parameters needed to use rpath: | |||
| dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, | dnl acl_libext, | |||
| dnl hardcode_direct, hardcode_minus_L. | dnl acl_shlibext, | |||
| 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], | AC_DEFUN([AC_LIB_RPATH], | |||
| [ | [ | |||
| dnl Tell automake >= 1.10 to complain if config.rpath is missing. | dnl Tell automake >= 1.10 to complain if config.rpath is missing. | |||
| m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) | m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) | |||
| AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS | AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS | |||
| AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld | AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld | |||
| AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host | AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host | |||
| AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir | AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir | |||
| AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ | AC_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" \ | 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.s h | ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.s h | |||
| . ./conftest.sh | . ./conftest.sh | |||
| rm -f ./conftest.sh | rm -f ./conftest.sh | |||
| acl_cv_rpath=done | acl_cv_rpath=done | |||
| ]) | ]) | |||
| wl="$acl_cv_wl" | wl="$acl_cv_wl" | |||
| libext="$acl_cv_libext" | acl_libext="$acl_cv_libext" | |||
| shlibext="$acl_cv_shlibext" | acl_shlibext="$acl_cv_shlibext" | |||
| hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" | acl_libname_spec="$acl_cv_libname_spec" | |||
| hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" | acl_library_names_spec="$acl_cv_library_names_spec" | |||
| hardcode_direct="$acl_cv_hardcode_direct" | acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" | |||
| hardcode_minus_L="$acl_cv_hardcode_minus_L" | 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. | dnl Determine whether the user wants rpath handling at all. | |||
| AC_ARG_ENABLE(rpath, | AC_ARG_ENABLE([rpath], | |||
| [ --disable-rpath do not hardcode runtime library paths], | [ --disable-rpath do not hardcode runtime library paths], | |||
| :, enable_rpath=yes) | :, enable_rpath=yes) | |||
| ]) | ]) | |||
| dnl AC_LIB_FROMPACKAGE(name, package) | ||||
| dnl declares that libname comes from the given package. The configure file | ||||
| dnl will then not have a --with-libname-prefix option but a | ||||
| dnl --with-package-prefix option. Several libraries can come from the same | ||||
| dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or simi | ||||
| lar | ||||
| dnl macro call that searches for libname. | ||||
| AC_DEFUN([AC_LIB_FROMPACKAGE], | ||||
| [ | ||||
| pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | ||||
| [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | ||||
| define([acl_frompackage_]NAME, [$2]) | ||||
| popdef([NAME]) | ||||
| pushdef([PACK],[$2]) | ||||
| pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], | ||||
| [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | ||||
| define([acl_libsinpackage_]PACKUP, | ||||
| m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],) | ||||
| [lib$1]) | ||||
| popdef([PACKUP]) | ||||
| popdef([PACK]) | ||||
| ]) | ||||
| dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and | dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and | |||
| dnl the libraries corresponding to explicit and implicit dependencies. | dnl the libraries corresponding to explicit and implicit dependencies. | |||
| dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. | dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. | |||
| dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was fo | ||||
| und | ||||
| dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. | ||||
| AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
| [ | [ | |||
| AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | |||
| define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | |||
| [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | |||
| pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, | ||||
| lib[$1])]) | ||||
| pushdef([PACKUP],[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],[translit(PACK,[.],[_])],PACK)]) | ||||
| dnl By default, look in $includedir and $libdir. | dnl By default, look in $includedir and $libdir. | |||
| use_additional=yes | use_additional=yes | |||
| AC_LIB_WITH_FINAL_PREFIX([ | AC_LIB_WITH_FINAL_PREFIX([ | |||
| eval additional_includedir=\"$includedir\" | eval additional_includedir=\"$includedir\" | |||
| eval additional_libdir=\"$libdir\" | eval additional_libdir=\"$libdir\" | |||
| ]) | ]) | |||
| AC_LIB_ARG_WITH([lib$1-prefix], | AC_ARG_WITH(P_A_C_K[-prefix], | |||
| [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib | [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include a | |||
| --without-lib$1-prefix don't search for lib$1 in includedir and libdi | nd DIR/lib | |||
| r], | --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedi | |||
| r and libdir]], | ||||
| [ | [ | |||
| if test "X$withval" = "Xno"; then | if test "X$withval" = "Xno"; then | |||
| use_additional=no | use_additional=no | |||
| else | else | |||
| if test "X$withval" = "X"; then | if test "X$withval" = "X"; then | |||
| AC_LIB_WITH_FINAL_PREFIX([ | AC_LIB_WITH_FINAL_PREFIX([ | |||
| eval additional_includedir=\"$includedir\" | eval additional_includedir=\"$includedir\" | |||
| eval additional_libdir=\"$libdir\" | eval additional_libdir=\"$libdir\" | |||
| ]) | ]) | |||
| else | else | |||
| additional_includedir="$withval/include" | additional_includedir="$withval/include" | |||
| additional_libdir="$withval/$acl_libdirstem" | additional_libdir="$withval/$acl_libdirstem" | |||
| if test "$acl_libdirstem2" != "$acl_libdirstem" \ | ||||
| && ! test -d "$withval/$acl_libdirstem"; then | ||||
| additional_libdir="$withval/$acl_libdirstem2" | ||||
| fi | ||||
| fi | fi | |||
| fi | fi | |||
| ]) | ]) | |||
| dnl Search the library and its dependencies in $additional_libdir and | dnl Search the library and its dependencies in $additional_libdir and | |||
| dnl $LDFLAGS. Using breadth-first-seach. | dnl $LDFLAGS. Using breadth-first-seach. | |||
| LIB[]NAME= | LIB[]NAME= | |||
| LTLIB[]NAME= | LTLIB[]NAME= | |||
| INC[]NAME= | INC[]NAME= | |||
| LIB[]NAME[]_PREFIX= | ||||
| dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have be | ||||
| en | ||||
| dnl computed. So it has to be reset here. | ||||
| HAVE_LIB[]NAME= | ||||
| rpathdirs= | rpathdirs= | |||
| ltrpathdirs= | ltrpathdirs= | |||
| names_already_handled= | names_already_handled= | |||
| names_next_round='$1 $2' | names_next_round='$1 $2' | |||
| while test -n "$names_next_round"; do | while test -n "$names_next_round"; do | |||
| names_this_round="$names_next_round" | names_this_round="$names_next_round" | |||
| names_next_round= | names_next_round= | |||
| for name in $names_this_round; do | for name in $names_this_round; do | |||
| already_handled= | already_handled= | |||
| for n in $names_already_handled; do | for n in $names_already_handled; do | |||
| skipping to change at line 200 | skipping to change at line 265 | |||
| dnl that this library doesn't exist. So just drop it. | dnl that this library doesn't exist. So just drop it. | |||
| : | : | |||
| fi | fi | |||
| else | else | |||
| dnl Search the library lib$name in $additional_libdir and $LDFLAG S | dnl Search the library lib$name in $additional_libdir and $LDFLAG S | |||
| dnl and the already constructed $LIBNAME/$LTLIBNAME. | dnl and the already constructed $LIBNAME/$LTLIBNAME. | |||
| found_dir= | found_dir= | |||
| found_la= | found_la= | |||
| found_so= | found_so= | |||
| found_a= | found_a= | |||
| eval libname=\"$acl_libname_spec\" # typically: libname=lib$na | ||||
| me | ||||
| if test -n "$acl_shlibext"; then | ||||
| shrext=".$acl_shlibext" # typically: shrext=.so | ||||
| else | ||||
| shrext= | ||||
| fi | ||||
| if test $use_additional = yes; then | if test $use_additional = yes; then | |||
| if test -n "$shlibext" \ | dir="$additional_libdir" | |||
| && { test -f "$additional_libdir/lib$name.$shlibext" \ | dnl The same code as in the loop below: | |||
| || { test "$shlibext" = dll \ | dnl First look for a shared library. | |||
| && test -f "$additional_libdir/lib$name.dll.a"; }; | if test -n "$acl_shlibext"; then | |||
| }; then | if test -f "$dir/$libname$shrext"; then | |||
| found_dir="$additional_libdir" | found_dir="$dir" | |||
| if test -f "$additional_libdir/lib$name.$shlibext"; then | found_so="$dir/$libname$shrext" | |||
| found_so="$additional_libdir/lib$name.$shlibext" | ||||
| else | else | |||
| found_so="$additional_libdir/lib$name.dll.a" | if test "$acl_library_names_spec" = '$libname$shrext$versuf | |||
| fix'; then | ||||
| ver=`(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"; | ||||
| then | ||||
| found_dir="$dir" | ||||
| found_so="$dir/$libname$shrext.$ver" | ||||
| fi | ||||
| else | ||||
| eval library_names=\"$acl_library_names_spec\" | ||||
| for f in $library_names; do | ||||
| if test -f "$dir/$f"; then | ||||
| found_dir="$dir" | ||||
| found_so="$dir/$f" | ||||
| break | ||||
| fi | ||||
| done | ||||
| fi | ||||
| fi | fi | |||
| if test -f "$additional_libdir/lib$name.la"; then | fi | |||
| found_la="$additional_libdir/lib$name.la" | dnl Then look for a static library. | |||
| if test "X$found_dir" = "X"; then | ||||
| if test -f "$dir/$libname.$acl_libext"; then | ||||
| found_dir="$dir" | ||||
| found_a="$dir/$libname.$acl_libext" | ||||
| fi | fi | |||
| else | fi | |||
| if test -f "$additional_libdir/lib$name.$libext"; then | if test "X$found_dir" != "X"; then | |||
| found_dir="$additional_libdir" | if test -f "$dir/$libname.la"; then | |||
| found_a="$additional_libdir/lib$name.$libext" | found_la="$dir/$libname.la" | |||
| if test -f "$additional_libdir/lib$name.la"; then | ||||
| found_la="$additional_libdir/lib$name.la" | ||||
| fi | ||||
| fi | fi | |||
| fi | fi | |||
| fi | fi | |||
| if test "X$found_dir" = "X"; then | if test "X$found_dir" = "X"; then | |||
| for x in $LDFLAGS $LTLIB[]NAME; do | for x in $LDFLAGS $LTLIB[]NAME; do | |||
| AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | |||
| case "$x" in | case "$x" in | |||
| -L*) | -L*) | |||
| dir=`echo "X$x" | sed -e 's/^X-L//'` | dir=`echo "X$x" | sed -e 's/^X-L//'` | |||
| if test -n "$shlibext" \ | dnl First look for a shared library. | |||
| && { test -f "$dir/lib$name.$shlibext" \ | if test -n "$acl_shlibext"; then | |||
| || { test "$shlibext" = dll \ | if test -f "$dir/$libname$shrext"; then | |||
| && test -f "$dir/lib$name.dll.a"; }; }; then | found_dir="$dir" | |||
| found_dir="$dir" | found_so="$dir/$libname$shrext" | |||
| if test -f "$dir/lib$name.$shlibext"; then | ||||
| found_so="$dir/lib$name.$shlibext" | ||||
| else | else | |||
| found_so="$dir/lib$name.dll.a" | if test "$acl_library_names_spec" = '$libname$shrext$ | |||
| fi | versuffix'; then | |||
| if test -f "$dir/lib$name.la"; then | ver=`(cd "$dir" && \ | |||
| found_la="$dir/lib$name.la" | for f in "$libname$shrext".*; do echo "$f"; d | |||
| one \ | ||||
| | 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"; then | ||||
| found_dir="$dir" | ||||
| found_so="$dir/$libname$shrext.$ver" | ||||
| fi | ||||
| else | ||||
| eval library_names=\"$acl_library_names_spec\" | ||||
| for f in $library_names; do | ||||
| if test -f "$dir/$f"; then | ||||
| found_dir="$dir" | ||||
| found_so="$dir/$f" | ||||
| break | ||||
| fi | ||||
| done | ||||
| fi | ||||
| fi | fi | |||
| else | fi | |||
| if test -f "$dir/lib$name.$libext"; then | dnl Then look for a static library. | |||
| if test "X$found_dir" = "X"; then | ||||
| if test -f "$dir/$libname.$acl_libext"; then | ||||
| found_dir="$dir" | found_dir="$dir" | |||
| found_a="$dir/lib$name.$libext" | found_a="$dir/$libname.$acl_libext" | |||
| if test -f "$dir/lib$name.la"; then | fi | |||
| found_la="$dir/lib$name.la" | fi | |||
| fi | if test "X$found_dir" != "X"; then | |||
| if test -f "$dir/$libname.la"; then | ||||
| found_la="$dir/$libname.la" | ||||
| fi | fi | |||
| fi | fi | |||
| ;; | ;; | |||
| esac | esac | |||
| if test "X$found_dir" != "X"; then | if test "X$found_dir" != "X"; then | |||
| break | break | |||
| fi | fi | |||
| done | done | |||
| fi | fi | |||
| if test "X$found_dir" != "X"; then | if test "X$found_dir" != "X"; then | |||
| dnl Found the library. | dnl Found the library. | |||
| LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$nam e" | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$nam e" | |||
| if test "X$found_so" != "X"; then | if test "X$found_so" != "X"; then | |||
| dnl Linking with a shared library. We attempt to hardcode its | dnl Linking with a shared library. We attempt to hardcode its | |||
| dnl directory into the executable's runpath, unless it's the | dnl directory into the executable's runpath, unless it's the | |||
| dnl standard /usr/lib. | dnl standard /usr/lib. | |||
| if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$ | if test "$enable_rpath" = no \ | |||
| acl_libdirstem"; then | || test "X$found_dir" = "X/usr/$acl_libdirstem" \ | |||
| || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then | ||||
| dnl No hardcoding is needed. | dnl No hardcoding is needed. | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | |||
| else | else | |||
| dnl Use an explicit option to hardcode DIR into the resulti ng | dnl Use an explicit option to hardcode DIR into the resulti ng | |||
| dnl binary. | dnl binary. | |||
| dnl Potentially add DIR to ltrpathdirs. | dnl Potentially add DIR to ltrpathdirs. | |||
| dnl The ltrpathdirs will be appended to $LTLIBNAME at the e nd. | dnl The ltrpathdirs will be appended to $LTLIBNAME at the e nd. | |||
| haveit= | haveit= | |||
| for x in $ltrpathdirs; do | for x in $ltrpathdirs; do | |||
| if test "X$x" = "X$found_dir"; then | if test "X$x" = "X$found_dir"; then | |||
| haveit=yes | haveit=yes | |||
| break | break | |||
| fi | fi | |||
| done | done | |||
| if test -z "$haveit"; then | if test -z "$haveit"; then | |||
| ltrpathdirs="$ltrpathdirs $found_dir" | ltrpathdirs="$ltrpathdirs $found_dir" | |||
| fi | fi | |||
| dnl The hardcoding into $LIBNAME is system dependent. | dnl The hardcoding into $LIBNAME is system dependent. | |||
| if test "$hardcode_direct" = yes; then | if test "$acl_hardcode_direct" = yes; then | |||
| dnl Using DIR/libNAME.so during linking hardcodes DIR int o the | dnl Using DIR/libNAME.so during linking hardcodes DIR int o the | |||
| dnl resulting binary. | dnl resulting binary. | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | |||
| else | else | |||
| if test -n "$hardcode_libdir_flag_spec" && test "$hardcod e_minus_L" = no; then | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl _hardcode_minus_L" = no; then | |||
| dnl Use an explicit option to hardcode DIR into the res ulting | dnl Use an explicit option to hardcode DIR into the res ulting | |||
| dnl binary. | dnl binary. | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | |||
| dnl Potentially add DIR to rpathdirs. | dnl Potentially add DIR to rpathdirs. | |||
| dnl The rpathdirs will be appended to $LIBNAME at the e nd. | dnl The rpathdirs will be appended to $LIBNAME at the e nd. | |||
| haveit= | haveit= | |||
| for x in $rpathdirs; do | for x in $rpathdirs; do | |||
| if test "X$x" = "X$found_dir"; then | if test "X$x" = "X$found_dir"; then | |||
| haveit=yes | haveit=yes | |||
| break | break | |||
| skipping to change at line 321 | skipping to change at line 432 | |||
| for x in $LDFLAGS $LIB[]NAME; do | for x in $LDFLAGS $LIB[]NAME; do | |||
| AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | |||
| if test "X$x" = "X-L$found_dir"; then | if test "X$x" = "X-L$found_dir"; then | |||
| haveit=yes | haveit=yes | |||
| break | break | |||
| fi | fi | |||
| done | done | |||
| if test -z "$haveit"; then | if test -z "$haveit"; then | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" | |||
| fi | fi | |||
| if test "$hardcode_minus_L" != no; then | if test "$acl_hardcode_minus_L" != no; then | |||
| dnl FIXME: Not sure whether we should use | dnl FIXME: Not sure whether we should use | |||
| dnl "-L$found_dir -l$name" or "-L$found_dir $found_so " | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so " | |||
| dnl here. | dnl here. | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | |||
| else | else | |||
| dnl We cannot use $hardcode_runpath_var and LD_RUN_PA TH | dnl We cannot use $acl_hardcode_runpath_var and LD_RU N_PATH | |||
| dnl here, because this doesn't fit in flags passed to the | dnl here, because this doesn't fit in flags passed to the | |||
| dnl compiler. So give up. No hardcoding. This affects only | dnl compiler. So give up. No hardcoding. This affects only | |||
| dnl very old systems. | dnl very old systems. | |||
| dnl FIXME: Not sure whether we should use | dnl FIXME: Not sure whether we should use | |||
| dnl "-L$found_dir -l$name" or "-L$found_dir $found_so " | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so " | |||
| dnl here. | dnl here. | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" | |||
| fi | fi | |||
| fi | fi | |||
| fi | fi | |||
| skipping to change at line 354 | skipping to change at line 465 | |||
| dnl We shouldn't come here, but anyway it's good to have a | dnl We shouldn't come here, but anyway it's good to have a | |||
| dnl fallback. | dnl fallback. | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" | |||
| fi | fi | |||
| fi | fi | |||
| dnl Assume the include files are nearby. | dnl Assume the include files are nearby. | |||
| additional_includedir= | additional_includedir= | |||
| case "$found_dir" in | case "$found_dir" in | |||
| */$acl_libdirstem | */$acl_libdirstem/) | */$acl_libdirstem | */$acl_libdirstem/) | |||
| basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_l ibdirstem/"'*$,,'` | basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_l ibdirstem/"'*$,,'` | |||
| if test "$name" = '$1'; then | ||||
| LIB[]NAME[]_PREFIX="$basedir" | ||||
| fi | ||||
| additional_includedir="$basedir/include" | ||||
| ;; | ||||
| */$acl_libdirstem2 | */$acl_libdirstem2/) | ||||
| basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_l | ||||
| ibdirstem2/"'*$,,'` | ||||
| if test "$name" = '$1'; then | ||||
| LIB[]NAME[]_PREFIX="$basedir" | ||||
| fi | ||||
| additional_includedir="$basedir/include" | additional_includedir="$basedir/include" | |||
| ;; | ;; | |||
| esac | esac | |||
| if test "X$additional_includedir" != "X"; then | if test "X$additional_includedir" != "X"; then | |||
| dnl Potentially add $additional_includedir to $INCNAME. | dnl Potentially add $additional_includedir to $INCNAME. | |||
| dnl But don't add it | dnl But don't add it | |||
| dnl 1. if it's the standard /usr/include, | dnl 1. if it's the standard /usr/include, | |||
| dnl 2. if it's /usr/local/include and we are using GCC on L inux, | dnl 2. if it's /usr/local/include and we are using GCC on L inux, | |||
| dnl 3. if it's already present in $CPPFLAGS or the already | dnl 3. if it's already present in $CPPFLAGS or the already | |||
| dnl constructed $INCNAME, | dnl constructed $INCNAME, | |||
| skipping to change at line 414 | skipping to change at line 535 | |||
| case "$dep" in | case "$dep" in | |||
| -L*) | -L*) | |||
| additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` | additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` | |||
| dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. | dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. | |||
| dnl But don't add it | dnl But don't add it | |||
| dnl 1. if it's the standard /usr/lib, | dnl 1. if it's the standard /usr/lib, | |||
| dnl 2. if it's /usr/local/lib and we are using GCC on Linux, | 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 alr eady | dnl 3. if it's already present in $LDFLAGS or the alr eady | |||
| dnl constructed $LIBNAME, | dnl constructed $LIBNAME, | |||
| dnl 4. if it doesn't exist as a directory. | dnl 4. if it doesn't exist as a directory. | |||
| if test "X$additional_libdir" != "X/usr/$acl_libdirstem | if test "X$additional_libdir" != "X/usr/$acl_libdirstem | |||
| "; then | " \ | |||
| && test "X$additional_libdir" != "X/usr/$acl_libdirs | ||||
| tem2"; then | ||||
| haveit= | haveit= | |||
| if test "X$additional_libdir" = "X/usr/local/$acl_lib | if test "X$additional_libdir" = "X/usr/local/$acl_lib | |||
| dirstem"; then | dirstem" \ | |||
| || test "X$additional_libdir" = "X/usr/local/$acl_ | ||||
| libdirstem2"; then | ||||
| if test -n "$GCC"; then | if test -n "$GCC"; then | |||
| case $host_os in | case $host_os in | |||
| linux* | gnu* | k*bsd*-gnu) haveit=yes;; | linux* | gnu* | k*bsd*-gnu) haveit=yes;; | |||
| esac | esac | |||
| fi | fi | |||
| fi | fi | |||
| if test -z "$haveit"; then | if test -z "$haveit"; then | |||
| haveit= | haveit= | |||
| for x in $LDFLAGS $LIB[]NAME; do | for x in $LDFLAGS $LIB[]NAME; do | |||
| AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | |||
| skipping to change at line 515 | skipping to change at line 638 | |||
| dnl directories known to the linker should also be known to the | dnl directories known to the linker should also be known to the | |||
| dnl runtime loader, otherwise the system is severely misconfigu red.) | dnl runtime loader, otherwise the system is severely misconfigu red.) | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" | |||
| LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" | |||
| fi | fi | |||
| fi | fi | |||
| fi | fi | |||
| done | done | |||
| done | done | |||
| if test "X$rpathdirs" != "X"; then | if test "X$rpathdirs" != "X"; then | |||
| if test -n "$hardcode_libdir_separator"; then | if test -n "$acl_hardcode_libdir_separator"; then | |||
| dnl Weird platform: only the last -rpath option counts, the user must | dnl Weird platform: only the last -rpath option counts, the user must | |||
| dnl pass all path elements in one option. We can arrange that for a | dnl pass all path elements in one option. We can arrange that for a | |||
| dnl single library, but not when more than one $LIBNAMEs are used. | dnl single library, but not when more than one $LIBNAMEs are used. | |||
| alldirs= | alldirs= | |||
| for found_dir in $rpathdirs; do | for found_dir in $rpathdirs; do | |||
| alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir " | alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found _dir" | |||
| done | done | |||
| dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. | dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. | |||
| acl_save_libdir="$libdir" | acl_save_libdir="$libdir" | |||
| libdir="$alldirs" | libdir="$alldirs" | |||
| eval flag=\"$hardcode_libdir_flag_spec\" | eval flag=\"$acl_hardcode_libdir_flag_spec\" | |||
| libdir="$acl_save_libdir" | libdir="$acl_save_libdir" | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | |||
| else | else | |||
| dnl The -rpath options are cumulative. | dnl The -rpath options are cumulative. | |||
| for found_dir in $rpathdirs; do | for found_dir in $rpathdirs; do | |||
| acl_save_libdir="$libdir" | acl_save_libdir="$libdir" | |||
| libdir="$found_dir" | libdir="$found_dir" | |||
| eval flag=\"$hardcode_libdir_flag_spec\" | eval flag=\"$acl_hardcode_libdir_flag_spec\" | |||
| libdir="$acl_save_libdir" | libdir="$acl_save_libdir" | |||
| LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | |||
| done | done | |||
| fi | fi | |||
| fi | fi | |||
| if test "X$ltrpathdirs" != "X"; then | if test "X$ltrpathdirs" != "X"; then | |||
| dnl When using libtool, the option that works for both libraries and | dnl When using libtool, the option that works for both libraries and | |||
| dnl executables is -R. The -R options are cumulative. | dnl executables is -R. The -R options are cumulative. | |||
| for found_dir in $ltrpathdirs; do | for found_dir in $ltrpathdirs; do | |||
| LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" | |||
| done | done | |||
| fi | fi | |||
| popdef([P_A_C_K]) | ||||
| popdef([PACKLIBS]) | ||||
| popdef([PACKUP]) | ||||
| popdef([PACK]) | ||||
| popdef([NAME]) | ||||
| ]) | ]) | |||
| dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to V AR, | dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to V AR, | |||
| dnl unless already present in VAR. | dnl unless already present in VAR. | |||
| dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes | dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes | |||
| dnl contains two or three consecutive elements that belong together. | dnl contains two or three consecutive elements that belong together. | |||
| AC_DEFUN([AC_LIB_APPENDTOVAR], | AC_DEFUN([AC_LIB_APPENDTOVAR], | |||
| [ | [ | |||
| for element in [$2]; do | for element in [$2]; do | |||
| haveit= | haveit= | |||
| skipping to change at line 583 | skipping to change at line 711 | |||
| dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) | dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) | |||
| dnl sets LDADDVAR to linker options needed together with LIBSVALUE. | dnl sets LDADDVAR to linker options needed together with LIBSVALUE. | |||
| dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, | dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, | |||
| dnl otherwise linking without libtool is assumed. | dnl otherwise linking without libtool is assumed. | |||
| AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], | AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], | |||
| [ | [ | |||
| AC_REQUIRE([AC_LIB_RPATH]) | AC_REQUIRE([AC_LIB_RPATH]) | |||
| AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | |||
| $1= | $1= | |||
| if test "$enable_rpath" != no; then | if test "$enable_rpath" != no; then | |||
| if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = n o; then | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minu s_L" = no; then | |||
| dnl Use an explicit option to hardcode directories into the resulting | dnl Use an explicit option to hardcode directories into the resulting | |||
| dnl binary. | dnl binary. | |||
| rpathdirs= | rpathdirs= | |||
| next= | next= | |||
| for opt in $2; do | for opt in $2; do | |||
| if test -n "$next"; then | if test -n "$next"; then | |||
| dir="$next" | dir="$next" | |||
| dnl No need to hardcode the standard /usr/lib. | dnl No need to hardcode the standard /usr/lib. | |||
| if test "X$dir" != "X/usr/$acl_libdirstem"; then | if test "X$dir" != "X/usr/$acl_libdirstem" \ | |||
| && test "X$dir" != "X/usr/$acl_libdirstem2"; then | ||||
| rpathdirs="$rpathdirs $dir" | rpathdirs="$rpathdirs $dir" | |||
| fi | fi | |||
| next= | next= | |||
| else | else | |||
| case $opt in | case $opt in | |||
| -L) next=yes ;; | -L) next=yes ;; | |||
| -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` | -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` | |||
| dnl No need to hardcode the standard /usr/lib. | dnl No need to hardcode the standard /usr/lib. | |||
| if test "X$dir" != "X/usr/$acl_libdirstem"; then | if test "X$dir" != "X/usr/$acl_libdirstem" \ | |||
| && test "X$dir" != "X/usr/$acl_libdirstem2"; then | ||||
| rpathdirs="$rpathdirs $dir" | rpathdirs="$rpathdirs $dir" | |||
| fi | fi | |||
| next= ;; | next= ;; | |||
| *) next= ;; | *) next= ;; | |||
| esac | esac | |||
| fi | fi | |||
| done | done | |||
| if test "X$rpathdirs" != "X"; then | if test "X$rpathdirs" != "X"; then | |||
| if test -n ""$3""; then | if test -n ""$3""; then | |||
| dnl libtool is used for linking. Use -R options. | dnl libtool is used for linking. Use -R options. | |||
| for dir in $rpathdirs; do | for dir in $rpathdirs; do | |||
| $1="${$1}${$1:+ }-R$dir" | $1="${$1}${$1:+ }-R$dir" | |||
| done | done | |||
| else | else | |||
| dnl The linker is used for linking directly. | dnl The linker is used for linking directly. | |||
| if test -n "$hardcode_libdir_separator"; then | if test -n "$acl_hardcode_libdir_separator"; then | |||
| dnl Weird platform: only the last -rpath option counts, the use r | dnl Weird platform: only the last -rpath option counts, the use r | |||
| dnl must pass all path elements in one option. | dnl must pass all path elements in one option. | |||
| alldirs= | alldirs= | |||
| for dir in $rpathdirs; do | for dir in $rpathdirs; do | |||
| alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir " | alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator} $dir" | |||
| done | done | |||
| acl_save_libdir="$libdir" | acl_save_libdir="$libdir" | |||
| libdir="$alldirs" | libdir="$alldirs" | |||
| eval flag=\"$hardcode_libdir_flag_spec\" | eval flag=\"$acl_hardcode_libdir_flag_spec\" | |||
| libdir="$acl_save_libdir" | libdir="$acl_save_libdir" | |||
| $1="$flag" | $1="$flag" | |||
| else | else | |||
| dnl The -rpath options are cumulative. | dnl The -rpath options are cumulative. | |||
| for dir in $rpathdirs; do | for dir in $rpathdirs; do | |||
| acl_save_libdir="$libdir" | acl_save_libdir="$libdir" | |||
| libdir="$dir" | libdir="$dir" | |||
| eval flag=\"$hardcode_libdir_flag_spec\" | eval flag=\"$acl_hardcode_libdir_flag_spec\" | |||
| libdir="$acl_save_libdir" | libdir="$acl_save_libdir" | |||
| $1="${$1}${$1:+ }$flag" | $1="${$1}${$1:+ }$flag" | |||
| done | done | |||
| fi | fi | |||
| fi | fi | |||
| fi | fi | |||
| fi | fi | |||
| fi | fi | |||
| AC_SUBST([$1]) | AC_SUBST([$1]) | |||
| ]) | ]) | |||
| End of changes. 56 change blocks. | ||||
| 93 lines changed or deleted | 245 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||