version 1.1.1.2, 2012/05/29 09:29:44
|
version 1.1.1.3, 2021/03/17 13:38:46
|
Line 1
|
Line 1
|
# lib-prefix.m4 serial 7 (gettext-0.18) | # lib-prefix.m4 serial 14 |
dnl Copyright (C) 2001-2005, 2008-2011 Free Software Foundation, Inc. | dnl Copyright (C) 2001-2005, 2008-2019 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. |
|
|
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and |
|
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't |
|
dnl 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 needed |
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed |
dnl to access previously installed libraries. The basic assumption is that |
dnl to access previously installed libraries. The basic assumption is that |
dnl a user will want packages to use other packages he previously installed |
dnl a user will want packages to use other packages he previously installed |
Line 32 AC_DEFUN([AC_LIB_PREFIX],
|
Line 25 AC_DEFUN([AC_LIB_PREFIX],
|
eval additional_includedir=\"$includedir\" |
eval additional_includedir=\"$includedir\" |
eval additional_libdir=\"$libdir\" |
eval additional_libdir=\"$libdir\" |
]) |
]) |
AC_LIB_ARG_WITH([lib-prefix], | AC_ARG_WITH([lib-prefix], |
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib | [[ --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], | --without-lib-prefix don't search for libraries in includedir and libdir]], |
[ |
[ |
if test "X$withval" = "Xno"; then |
if test "X$withval" = "Xno"; then |
use_additional=no |
use_additional=no |
Line 174 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
|
Line 167 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
|
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or |
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or |
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. |
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. |
AC_REQUIRE([AC_CANONICAL_HOST]) |
AC_REQUIRE([AC_CANONICAL_HOST]) |
acl_libdirstem=lib | AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) |
acl_libdirstem2= | |
case "$host_os" in |
case "$host_os" in |
solaris*) |
solaris*) |
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment |
|
dnl <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 the |
|
dnl symlink is missing, so we set acl_libdirstem2 too. |
|
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], |
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], |
[AC_EGREP_CPP([sixtyfour bits], [ | [AC_COMPILE_IFELSE( |
#ifdef _LP64 | [AC_LANG_SOURCE( |
sixtyfour bits | [[#ifdef _LP64 |
#endif | int ok; |
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) | #else |
]) | error fail |
if test $gl_cv_solaris_64bit = yes; then | #endif |
acl_libdirstem=lib/64 | ]])], |
case "$host_cpu" in | [gl_cv_solaris_64bit=yes], |
sparc*) acl_libdirstem2=lib/sparcv9 ;; | [gl_cv_solaris_64bit=no]) |
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; | ]);; |
esac | |
fi | |
;; | |
*) | |
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` | |
if test -n "$searchpath"; then | |
acl_save_IFS="${IFS= }"; IFS=":" | |
for searchdir in $searchpath; do | |
if test -d "$searchdir"; then | |
case "$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 ;; | |
esac | |
fi | |
done | |
IFS="$acl_save_IFS" | |
fi | |
;; | |
esac |
esac |
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" | |
| dnl Allow the user to override the result by setting acl_cv_libdirstems. |
| AC_CACHE_CHECK([for the common suffixes of directories in the library search path], |
| [acl_cv_libdirstems], |
| [acl_libdirstem=lib |
| acl_libdirstem2= |
| case "$host_os" in |
| solaris*) |
| dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment |
| dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>. |
| 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 the |
| dnl symlink is missing, so we set acl_libdirstem2 too. |
| if test $gl_cv_solaris_64bit = yes; then |
| acl_libdirstem=lib/64 |
| case "$host_cpu" in |
| sparc*) acl_libdirstem2=lib/sparcv9 ;; |
| i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; |
| esac |
| fi |
| ;; |
| *) |
| dnl If $CC generates code for a 32-bit ABI, the libraries are |
| dnl surely under $prefix/lib, not $prefix/lib64. |
| if test "$HOST_CPU_C_ABI_32BIT" != yes; then |
| dnl The result is a property of the system. However, non-system |
| dnl compilers sometimes have odd library search paths. Therefore |
| dnl prefer asking /usr/bin/gcc, if available, rather than $CC. |
| searchpath=`(if test -f /usr/bin/gcc \ |
| && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ |
| LC_ALL=C /usr/bin/gcc -print-search-dirs; \ |
| else \ |
| LC_ALL=C $CC -print-search-dirs; \ |
| fi) 2>/dev/null \ |
| | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` |
| if test -n "$searchpath"; then |
| acl_save_IFS="${IFS= }"; IFS=":" |
| for searchdir in $searchpath; do |
| if test -d "$searchdir"; then |
| case "$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 ;; |
| esac |
| fi |
| done |
| IFS="$acl_save_IFS" |
| fi |
| fi |
| ;; |
| esac |
| test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" |
| acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" |
| ]) |
| # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. |
| acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` |
| acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` |
]) |
]) |