diff options
Diffstat (limited to 'gl/m4/lib-prefix.m4')
| -rw-r--r-- | gl/m4/lib-prefix.m4 | 88 |
1 files changed, 62 insertions, 26 deletions
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4 index a8684e17..3bdc0fc5 100644 --- a/gl/m4/lib-prefix.m4 +++ b/gl/m4/lib-prefix.m4 | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # lib-prefix.m4 serial 5 (gettext-0.15) | 1 | # lib-prefix.m4 serial 6 (gettext-0.18) |
| 2 | dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| 5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
| @@ -153,33 +153,69 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], | |||
| 153 | prefix="$acl_save_prefix" | 153 | prefix="$acl_save_prefix" |
| 154 | ]) | 154 | ]) |
| 155 | 155 | ||
| 156 | dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing | 156 | dnl AC_LIB_PREPARE_MULTILIB creates |
| 157 | dnl the basename of the libdir, either "lib" or "lib64". | 157 | dnl - a variable acl_libdirstem, containing the basename of the libdir, either |
| 158 | dnl "lib" or "lib64" or "lib/64", | ||
| 159 | dnl - a variable acl_libdirstem2, as a secondary possible value for | ||
| 160 | dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or | ||
| 161 | dnl "lib/amd64". | ||
| 158 | AC_DEFUN([AC_LIB_PREPARE_MULTILIB], | 162 | AC_DEFUN([AC_LIB_PREPARE_MULTILIB], |
| 159 | [ | 163 | [ |
| 160 | dnl There is no formal standard regarding lib and lib64. The current | 164 | dnl There is no formal standard regarding lib and lib64. |
| 161 | dnl practice is that on a system supporting 32-bit and 64-bit instruction | 165 | dnl On glibc systems, the current practice is that on a system supporting |
| 162 | dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit | 166 | dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under |
| 163 | dnl libraries go under $prefix/lib. We determine the compiler's default | 167 | dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine |
| 164 | dnl mode by looking at the compiler's library search path. If at least | 168 | dnl the compiler's default mode by looking at the compiler's library search |
| 165 | dnl of its elements ends in /lib64 or points to a directory whose absolute | 169 | dnl path. If at least one of its elements ends in /lib64 or points to a |
| 166 | dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the | 170 | dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. |
| 167 | dnl default, namely "lib". | 171 | dnl Otherwise we use the default, namely "lib". |
| 172 | dnl On Solaris systems, the current practice is that on a system supporting | ||
| 173 | dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under | ||
| 174 | dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or | ||
| 175 | dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. | ||
| 176 | AC_REQUIRE([AC_CANONICAL_HOST]) | ||
| 168 | acl_libdirstem=lib | 177 | acl_libdirstem=lib |
| 169 | searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` | 178 | acl_libdirstem2= |
| 170 | if test -n "$searchpath"; then | 179 | case "$host_os" in |
| 171 | acl_save_IFS="${IFS= }"; IFS=":" | 180 | solaris*) |
| 172 | for searchdir in $searchpath; do | 181 | dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment |
| 173 | if test -d "$searchdir"; then | 182 | dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. |
| 174 | case "$searchdir" in | 183 | dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." |
| 175 | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; | 184 | dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the |
| 176 | *) searchdir=`cd "$searchdir" && pwd` | 185 | dnl symlink is missing, so we set acl_libdirstem2 too. |
| 177 | case "$searchdir" in | 186 | AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], |
| 178 | */lib64 ) acl_libdirstem=lib64 ;; | 187 | [AC_EGREP_CPP([sixtyfour bits], [ |
| 179 | esac ;; | 188 | #ifdef _LP64 |
| 189 | sixtyfour bits | ||
| 190 | #endif | ||
| 191 | ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) | ||
| 192 | ]) | ||
| 193 | if test $gl_cv_solaris_64bit = yes; then | ||
| 194 | acl_libdirstem=lib/64 | ||
| 195 | case "$host_cpu" in | ||
| 196 | sparc*) acl_libdirstem2=lib/sparcv9 ;; | ||
| 197 | i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; | ||
| 180 | esac | 198 | esac |
| 181 | fi | 199 | fi |
| 182 | done | 200 | ;; |
| 183 | IFS="$acl_save_IFS" | 201 | *) |
| 184 | fi | 202 | searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` |
| 203 | if test -n "$searchpath"; then | ||
| 204 | acl_save_IFS="${IFS= }"; IFS=":" | ||
| 205 | for searchdir in $searchpath; do | ||
| 206 | if test -d "$searchdir"; then | ||
| 207 | case "$searchdir" in | ||
| 208 | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; | ||
| 209 | *) searchdir=`cd "$searchdir" && pwd` | ||
| 210 | case "$searchdir" in | ||
| 211 | */lib64 ) acl_libdirstem=lib64 ;; | ||
| 212 | esac ;; | ||
| 213 | esac | ||
| 214 | fi | ||
| 215 | done | ||
| 216 | IFS="$acl_save_IFS" | ||
| 217 | fi | ||
| 218 | ;; | ||
| 219 | esac | ||
| 220 | test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" | ||
| 185 | ]) | 221 | ]) |
