aboutsummaryrefslogtreecommitdiff
path: root/m4/lib-prefix.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/lib-prefix.m4')
-rw-r--r--m4/lib-prefix.m4109
1 files changed, 46 insertions, 63 deletions
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index a5d56c8d..6851031d 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
1# lib-prefix.m4 serial 8 1# lib-prefix.m4 serial 7 (gettext-0.18)
2dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -174,68 +174,51 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
174 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or 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. 175 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
176 AC_REQUIRE([AC_CANONICAL_HOST]) 176 AC_REQUIRE([AC_CANONICAL_HOST])
177 dnl Allow the user to override the result by setting acl_cv_libdirstems. 177 acl_libdirstem=lib
178 AC_CACHE_CHECK([for the common suffixes of directories in the library search path], 178 acl_libdirstem2=
179 [acl_cv_libdirstems], 179 case "$host_os" in
180 [acl_libdirstem=lib 180 solaris*)
181 acl_libdirstem2= 181 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
182 case "$host_os" in 182 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
183 solaris*) 183 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
184 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment 184 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
185 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. 185 dnl symlink is missing, so we set acl_libdirstem2 too.
186 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." 186 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
187 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the 187 [AC_EGREP_CPP([sixtyfour bits], [
188 dnl symlink is missing, so we set acl_libdirstem2 too.
189 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
190 [AC_EGREP_CPP([sixtyfour bits], [
191#ifdef _LP64 188#ifdef _LP64
192sixtyfour bits 189sixtyfour bits
193#endif 190#endif
194 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) 191 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
195 ]) 192 ])
196 if test $gl_cv_solaris_64bit = yes; then 193 if test $gl_cv_solaris_64bit = yes; then
197 acl_libdirstem=lib/64 194 acl_libdirstem=lib/64
198 case "$host_cpu" in 195 case "$host_cpu" in
199 sparc*) acl_libdirstem2=lib/sparcv9 ;; 196 sparc*) acl_libdirstem2=lib/sparcv9 ;;
200 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; 197 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
201 esac 198 esac
202 fi 199 fi
203 ;; 200 ;;
204 *) 201 *)
205 dnl The result is a property of the system. However, non-system 202 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
206 dnl compilers sometimes have odd library search paths. Therefore 203 if test -n "$searchpath"; then
207 dnl prefer asking /usr/bin/gcc, if available, rather than $CC. 204 acl_save_IFS="${IFS= }"; IFS=":"
208 searchpath=`(if test -f /usr/bin/gcc \ 205 for searchdir in $searchpath; do
209 && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ 206 if test -d "$searchdir"; then
210 LC_ALL=C /usr/bin/gcc -print-search-dirs; \ 207 case "$searchdir" in
211 else \ 208 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
212 LC_ALL=C $CC -print-search-dirs; \ 209 */../ | */.. )
213 fi) 2>/dev/null \ 210 # Better ignore directories of this form. They are misleading.
214 | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` 211 ;;
215 if test -n "$searchpath"; then 212 *) searchdir=`cd "$searchdir" && pwd`
216 acl_save_IFS="${IFS= }"; IFS=":" 213 case "$searchdir" in
217 for searchdir in $searchpath; do 214 */lib64 ) acl_libdirstem=lib64 ;;
218 if test -d "$searchdir"; then 215 esac ;;
219 case "$searchdir" in 216 esac
220 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; 217 fi
221 */../ | */.. ) 218 done
222 # Better ignore directories of this form. They are misleading. 219 IFS="$acl_save_IFS"
223 ;; 220 fi
224 *) searchdir=`cd "$searchdir" && pwd` 221 ;;
225 case "$searchdir" in 222 esac
226 */lib64 ) acl_libdirstem=lib64 ;; 223 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
227 esac ;;
228 esac
229 fi
230 done
231 IFS="$acl_save_IFS"
232 fi
233 ;;
234 esac
235 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
236 acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
237 ])
238 # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
239 acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
240 acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
241]) 224])