version 1.1.1.1, 2017/01/24 14:48:55
|
version 1.1.1.2, 2021/03/17 00:49:17
|
Line 1
|
Line 1
|
# lib-link.m4 serial 9 (gettext-0.16) | # lib-link.m4 serial 26 (gettext-0.18.2) |
dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. | dnl Copyright (C) 2001-2013 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 libname |
|
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],[m4_translit([$1],[./+-], [____])]) |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | pushdef([NAME],[m4_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-message |
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and | dnl defaults to 'no' and may contain additional hints for the user. |
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and | 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 libname |
|
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],[m4_translit([$1],[./+-], [____])]) |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | pushdef([NAME],[m4_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. |
Line 66 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
Line 74 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
|
|
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 LIBS. |
| dnl Static libraries benefit only from the static libraries listed after |
| dnl it. |
| case " $LIB[]NAME" in |
| *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; |
| *) LIBS="$LIB[]NAME $LIBS" ;; |
| esac |
| AC_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" |
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 |
Line 82 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
Line 103 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
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_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], |
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. |
Line 101 AC_DEFUN([AC_LIB_RPATH],
|
Line 130 AC_DEFUN([AC_LIB_RPATH],
|
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.sh |
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
. ./conftest.sh |
. ./conftest.sh |
Line 109 AC_DEFUN([AC_LIB_RPATH],
|
Line 138 AC_DEFUN([AC_LIB_RPATH],
|
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 similar |
|
dnl 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 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 found |
|
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],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], |
[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. |
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 and DIR/lib |
--without-lib$1-prefix don't search for lib$1 in includedir and libdir], | --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], |
[ |
[ |
if test "X$withval" = "Xno"; then |
if test "X$withval" = "Xno"; then |
use_additional=no |
use_additional=no |
Line 150 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 210 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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 |
]) |
]) |
Line 158 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 222 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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 been |
|
dnl computed. So it has to be reset here. |
|
HAVE_LIB[]NAME= |
rpathdirs= |
rpathdirs= |
ltrpathdirs= |
ltrpathdirs= |
names_already_handled= |
names_already_handled= |
Line 177 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 245 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
names_already_handled="$names_already_handled $name" |
names_already_handled="$names_already_handled $name" |
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS |
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS |
dnl or AC_LIB_HAVE_LINKFLAGS call. |
dnl or AC_LIB_HAVE_LINKFLAGS call. |
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` | uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` |
eval value=\"\$HAVE_LIB$uppername\" |
eval value=\"\$HAVE_LIB$uppername\" |
if test -n "$value"; then |
if test -n "$value"; then |
if test "$value" = yes; then |
if test "$value" = yes; then |
Line 197 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 265 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
found_la= |
found_la= |
found_so= |
found_so= |
found_a= |
found_a= |
|
eval libname=\"$acl_libname_spec\" # typically: libname=lib$name |
|
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"; }; }; then | if test -n "$acl_shlibext"; then |
found_dir="$additional_libdir" | if test -f "$dir/$libname$shrext"; then |
if test -f "$additional_libdir/lib$name.$shlibext"; then | found_dir="$dir" |
found_so="$additional_libdir/lib$name.$shlibext" | found_so="$dir/$libname$shrext" |
else |
else |
found_so="$additional_libdir/lib$name.dll.a" | if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; 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 |
Line 227 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 321 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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$versuffix'; 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 "$dir/lib$name.la"; then | fi |
found_la="$dir/lib$name.la" | dnl Then look for a static library. |
fi | if test "X$found_dir" = "X"; then |
else | if test -f "$dir/$libname.$acl_libext"; then |
if test -f "$dir/lib$name.$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 | |
found_la="$dir/lib$name.la" | |
fi | |
fi |
fi |
fi |
fi |
|
if test "X$found_dir" != "X"; then |
|
if test -f "$dir/$libname.la"; then |
|
found_la="$dir/$libname.la" |
|
fi |
|
fi |
;; |
;; |
esac |
esac |
if test "X$found_dir" != "X"; then |
if test "X$found_dir" != "X"; then |
Line 263 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 375 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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/$acl_libdirstem"; then | if test "$enable_rpath" = no \ |
| || 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 |
Line 282 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 396 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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 into the |
dnl Using DIR/libNAME.so during linking hardcodes DIR into 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 "$hardcode_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 resulting |
dnl Use an explicit option to hardcode DIR into the resulting |
dnl binary. |
dnl binary. |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
Line 318 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 432 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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_PATH | dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_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. |
Line 351 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 465 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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_libdirstem/"'*$,,'` |
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` |
|
if test "$name" = '$1'; then |
|
LIB[]NAME[]_PREFIX="$basedir" |
|
fi |
additional_includedir="$basedir/include" |
additional_includedir="$basedir/include" |
;; |
;; |
|
*/$acl_libdirstem2 | */$acl_libdirstem2/) |
|
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` |
|
if test "$name" = '$1'; then |
|
LIB[]NAME[]_PREFIX="$basedir" |
|
fi |
|
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. |
Line 411 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 535 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
dnl 3. if it's already present in $LDFLAGS or the already |
dnl 3. if it's already present in $LDFLAGS or the already |
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"; then | if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ |
| && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then |
haveit= |
haveit= |
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then | if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ |
| || 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;; |
Line 512 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 638 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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 |
Line 531 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 657 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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 |
Line 544 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
Line 670 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
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 VAR, |
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, |
Line 580 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
Line 711 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
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" = no; then | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_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= |
Line 589 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
Line 720 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
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= |
Line 598 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
Line 730 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
-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= ;; |
Line 614 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
Line 747 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
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 user |
dnl Weird platform: only the last -rpath option counts, the user |
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 |
Line 631 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
Line 764 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
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 |