153
153
prefix="$acl_save_prefix"
156
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
157
dnl the basename of the libdir, either "lib" or "lib64".
156
dnl AC_LIB_PREPARE_MULTILIB creates
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
158
162
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
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".
164
dnl There is no formal standard regarding lib and lib64.
165
dnl On glibc systems, the current practice is that on a system supporting
166
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
167
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
168
dnl the compiler's default mode by looking at the compiler's library search
169
dnl path. If at least one of its elements ends in /lib64 or points to a
170
dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
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
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,^=,,'`
170
if test -n "$searchpath"; then
171
acl_save_IFS="${IFS= }"; IFS=":"
172
for searchdir in $searchpath; do
173
if test -d "$searchdir"; then
175
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
176
*) searchdir=`cd "$searchdir" && pwd`
178
*/lib64 ) acl_libdirstem=lib64 ;;
181
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
182
dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
183
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
184
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
185
dnl symlink is missing, so we set acl_libdirstem2 too.
186
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
188
AC_LANG_PROGRAM([], [[
189
return sizeof(void*) == 8 ? 0 : 1;
191
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
193
if test $gl_cv_solaris_64bit = yes; then
194
acl_libdirstem=lib/64
196
sparc*) acl_libdirstem2=lib/sparcv9 ;;
197
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
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
208
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
209
*) searchdir=`cd "$searchdir" && pwd`
211
*/lib64 ) acl_libdirstem=lib64 ;;
220
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"