1
# lib-prefix.m4 serial 4 (gettext-0.14.2)
2
dnl Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
1
# lib-prefix.m4 serial 5 (gettext-0.15)
2
dnl Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software
4
4
dnl This file is free software; the Free Software Foundation
5
5
dnl gives unlimited permission to copy and/or distribute it,
25
25
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
26
26
AC_REQUIRE([AC_PROG_CC])
27
27
AC_REQUIRE([AC_CANONICAL_HOST])
28
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
28
29
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
29
30
dnl By default, look in $includedir and $libdir.
88
89
dnl 2. if it's already present in $LDFLAGS,
89
90
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
90
91
dnl 4. if it doesn't exist as a directory.
91
if test "X$additional_libdir" != "X/usr/lib"; then
92
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
93
94
for x in $LDFLAGS; do
94
95
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
152
153
exec_prefix="$acl_save_exec_prefix"
153
154
prefix="$acl_save_prefix"
157
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
158
dnl the basename of the libdir, either "lib" or "lib64".
159
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
161
dnl There is no formal standard regarding lib and lib64. The current
162
dnl practice is that on a system supporting 32-bit and 64-bit instruction
163
dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
164
dnl libraries go under $prefix/lib. We determine the compiler's default
165
dnl mode by looking at the compiler's library search path. If at least
166
dnl of its elements ends in /lib64 or points to a directory whose absolute
167
dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
168
dnl default, namely "lib".
170
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
171
if test -n "$searchpath"; then
172
acl_save_IFS="${IFS= }"; IFS=":"
173
for searchdir in $searchpath; do
174
if test -d "$searchdir"; then
176
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
177
*) searchdir=`cd "$searchdir" && pwd`
179
*/lib64 ) acl_libdirstem=lib64 ;;