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.m452
1 files changed, 11 insertions, 41 deletions
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index a8684e17..8aff5a9d 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,8 +1,10 @@
1# lib-prefix.m4 serial 5 (gettext-0.15) 1# lib-prefix.m4 serial 3 (gettext-0.13)
2dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software, distributed under the terms of the GNU
4dnl gives unlimited permission to copy and/or distribute it, 4dnl General Public License. As a special exception to the GNU General
5dnl with or without modifications, as long as this notice is preserved. 5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
6 8
7dnl From Bruno Haible. 9dnl From Bruno Haible.
8 10
@@ -24,7 +26,6 @@ AC_DEFUN([AC_LIB_PREFIX],
24 AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) 26 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
25 AC_REQUIRE([AC_PROG_CC]) 27 AC_REQUIRE([AC_PROG_CC])
26 AC_REQUIRE([AC_CANONICAL_HOST]) 28 AC_REQUIRE([AC_CANONICAL_HOST])
27 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
28 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 29 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
29 dnl By default, look in $includedir and $libdir. 30 dnl By default, look in $includedir and $libdir.
30 use_additional=yes 31 use_additional=yes
@@ -46,7 +47,7 @@ AC_DEFUN([AC_LIB_PREFIX],
46 ]) 47 ])
47 else 48 else
48 additional_includedir="$withval/include" 49 additional_includedir="$withval/include"
49 additional_libdir="$withval/$acl_libdirstem" 50 additional_libdir="$withval/lib"
50 fi 51 fi
51 fi 52 fi
52]) 53])
@@ -70,7 +71,7 @@ AC_DEFUN([AC_LIB_PREFIX],
70 if test "X$additional_includedir" = "X/usr/local/include"; then 71 if test "X$additional_includedir" = "X/usr/local/include"; then
71 if test -n "$GCC"; then 72 if test -n "$GCC"; then
72 case $host_os in 73 case $host_os in
73 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 74 linux*) haveit=yes;;
74 esac 75 esac
75 fi 76 fi
76 fi 77 fi
@@ -88,7 +89,7 @@ AC_DEFUN([AC_LIB_PREFIX],
88 dnl 2. if it's already present in $LDFLAGS, 89 dnl 2. if it's already present in $LDFLAGS,
89 dnl 3. if it's /usr/local/lib and we are using GCC on Linux, 90 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
90 dnl 4. if it doesn't exist as a directory. 91 dnl 4. if it doesn't exist as a directory.
91 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then 92 if test "X$additional_libdir" != "X/usr/lib"; then
92 haveit= 93 haveit=
93 for x in $LDFLAGS; do 94 for x in $LDFLAGS; do
94 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 95 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
@@ -98,7 +99,7 @@ AC_DEFUN([AC_LIB_PREFIX],
98 fi 99 fi
99 done 100 done
100 if test -z "$haveit"; then 101 if test -z "$haveit"; then
101 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then 102 if test "X$additional_libdir" = "X/usr/local/lib"; then
102 if test -n "$GCC"; then 103 if test -n "$GCC"; then
103 case $host_os in 104 case $host_os in
104 linux*) haveit=yes;; 105 linux*) haveit=yes;;
@@ -152,34 +153,3 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
152 exec_prefix="$acl_save_exec_prefix" 153 exec_prefix="$acl_save_exec_prefix"
153 prefix="$acl_save_prefix" 154 prefix="$acl_save_prefix"
154]) 155])
155
156dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
157dnl the basename of the libdir, either "lib" or "lib64".
158AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
159[
160 dnl There is no formal standard regarding lib and lib64. The current
161 dnl practice is that on a system supporting 32-bit and 64-bit instruction
162 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
163 dnl libraries go under $prefix/lib. We determine the compiler's default
164 dnl mode by looking at the compiler's library search path. If at least
165 dnl of its elements ends in /lib64 or points to a directory whose absolute
166 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
167 dnl default, namely "lib".
168 acl_libdirstem=lib
169 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
170 if test -n "$searchpath"; then
171 acl_save_IFS="${IFS= }"; IFS=":"
172 for searchdir in $searchpath; do
173 if test -d "$searchdir"; then
174 case "$searchdir" in
175 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
176 *) searchdir=`cd "$searchdir" && pwd`
177 case "$searchdir" in
178 */lib64 ) acl_libdirstem=lib64 ;;
179 esac ;;
180 esac
181 fi
182 done
183 IFS="$acl_save_IFS"
184 fi
185])