[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Detect the default libpath on aix (to fix MPI support!)
From: |
Erik Lindahl |
Subject: |
Re: [PATCH] Detect the default libpath on aix (to fix MPI support!) |
Date: |
Mon, 23 Jul 2001 18:58:48 +0200 |
Hi again,
I've had to live without my normal mail connection for a couple of days,
but submitting the patch
through pine was apparently a bad idea with those long lines...
Sorry about that - here's (hopefully) a MIME-attached version without
the line breaks!
Cheers,
Erik
--- libtool.m4.vanilla Sun Jul 22 22:25:58 2001
+++ libtool.m4 Mon Jul 23 14:00:47 2001
@@ -1997,10 +1997,26 @@
;;
esac
])# AC_CHECK_LIBM
+# AC_CHECK_AIX_LIBPATH()
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([AC_CHECK_AIX_LIBPATH],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | ${AWK-awk} '/Import File
Strings/ { getline; getline; if ($[2] ~ /^\//) print $[2] }'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext
2>/dev/null | ${AWK-awk} '/Import File Strings/ { getline; getline; if ($[2] ~
/^\//) print $[2] }'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])
+
+
# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
# -----------------------------------
# sets LIBLTDL to the link flags for the libltdl convenience library and
# INCLTDL to the include flags for the libltdl header and adds
# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
@@ -2407,19 +2423,24 @@
_LT_AC_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Determine the default libpath from the value encoded in an empty
executable.
+ AC_CHECK_AIX_LIBPATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname
$libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x";
then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag
\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R
$libdir:/usr/lib:/lib'
_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o
$output_objdir/$soname $libobjs $deplibs $compiler_flags
${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag
\${wl}$exp_sym_flag:\$export_symbols"
else
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Determine the default libpath from the value encoded in an empty
executable.
+ AC_CHECK_AIX_LIBPATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bnoerok'
_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
# -bexpall does not export symbols beginning with underscore (_)
@@ -4245,19 +4266,23 @@
_LT_AC_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Determine the default libpath from the value encoded in an empty
executable.
+ AC_CHECK_AIX_LIBPATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname
$libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x";
then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag
\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R
$libdir:/usr/lib:/lib'
_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o
$output_objdir/$soname $libobjs $deplibs $compiler_flags
${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag
\${wl}$exp_sym_flag:\$export_symbols"
else
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Determine the default libpath from the value encoded in an empty
executable.
+ AC_CHECK_AIX_LIBPATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec,
$1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bnoerok'
_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
# -bexpall does not export symbols beginning with underscore (_)