Add libltdl into the build process.
This commit was SVN r383.
Этот коммит содержится в:
родитель
e3973285fd
Коммит
ae93b4fffb
@ -23,6 +23,7 @@ sinclude(config/lam_config_subdir_args.m4)
|
|||||||
sinclude(config/lam_configure_options.m4)
|
sinclude(config/lam_configure_options.m4)
|
||||||
sinclude(config/lam_functions.m4)
|
sinclude(config/lam_functions.m4)
|
||||||
sinclude(config/lam_get_version.m4)
|
sinclude(config/lam_get_version.m4)
|
||||||
|
sinclude(config/lam_get_libtool_linker_flags.m4)
|
||||||
sinclude(config/lam_mca.m4)
|
sinclude(config/lam_mca.m4)
|
||||||
sinclude(config/lam_setup_cc.m4)
|
sinclude(config/lam_setup_cc.m4)
|
||||||
sinclude(config/lam_setup_cxx.m4)
|
sinclude(config/lam_setup_cxx.m4)
|
||||||
|
@ -352,9 +352,9 @@ EOF
|
|||||||
run_and_check $lam_autoconf
|
run_and_check $lam_autoconf
|
||||||
|
|
||||||
# We only need the libltdl stuff for the top-level
|
# We only need the libltdl stuff for the top-level
|
||||||
# configure, not any of the SSI modules.
|
# configure, not any of the MCA modules.
|
||||||
|
|
||||||
if test -d src/include/mpi.h; then
|
if test -f src/include/mpi.h; then
|
||||||
rm -rf libltdl src/mca/libltdl src/mca/ltdl.h
|
rm -rf libltdl src/mca/libltdl src/mca/ltdl.h
|
||||||
run_and_check $lam_libtoolize --automake --copy --ltdl
|
run_and_check $lam_libtoolize --automake --copy --ltdl
|
||||||
mv libltdl src/mca
|
mv libltdl src/mca
|
||||||
|
91
config/lam_get_libtool_linker_flags.m4
Обычный файл
91
config/lam_get_libtool_linker_flags.m4
Обычный файл
@ -0,0 +1,91 @@
|
|||||||
|
dnl -*- shell-script -*-
|
||||||
|
dnl
|
||||||
|
dnl $HEADER
|
||||||
|
denl
|
||||||
|
|
||||||
|
AC_DEFUN([LAM_CHECK_LINKER_FLAGS],[
|
||||||
|
#
|
||||||
|
# libtool has been created by this point
|
||||||
|
# Try to see if it will add any additional flags for dependant libraries
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for libtool-supplied linker flags])
|
||||||
|
|
||||||
|
libtool="$1"
|
||||||
|
extra_flags="$2"
|
||||||
|
|
||||||
|
# Get the directory where libtool lives
|
||||||
|
|
||||||
|
start="`pwd`"
|
||||||
|
d="`dirname $libtool`"
|
||||||
|
cd "$d"
|
||||||
|
libtool="`pwd`/libtool"
|
||||||
|
cd "$start"
|
||||||
|
unset d start
|
||||||
|
|
||||||
|
# Make a playground to work in
|
||||||
|
|
||||||
|
mkdir conftest.$$
|
||||||
|
cd conftest.$$
|
||||||
|
|
||||||
|
cat > foo.c <<EOF
|
||||||
|
int foo(void) { return 0; }
|
||||||
|
EOF
|
||||||
|
|
||||||
|
lam_check_linker_flags_work() {
|
||||||
|
LAM_LOG_MSG([$cmd], [yes])
|
||||||
|
eval $cmd >&5 2>&5
|
||||||
|
if test -n "[$]1"; then
|
||||||
|
output="`eval $cmd 2>/dev/null`"
|
||||||
|
fi
|
||||||
|
status="$?"
|
||||||
|
LAM_LOG_MSG([\$? = $status], [yes])
|
||||||
|
if test "$status" != "0"; then
|
||||||
|
AC_MSG_RESULT([libtool error!])
|
||||||
|
AC_MSG_ERROR([Cannot continue])
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# First make a sample library with the current LDFLAGS and LIBS
|
||||||
|
#
|
||||||
|
|
||||||
|
cmd="$libtool --mode=compile $CC $CFLAGS foo.c -c -o foo.o"
|
||||||
|
lam_check_linker_flags_work
|
||||||
|
cmd="$libtool --mode=link $CC $CFLAGS foo.lo $LDFLAGS $LIBS -o libfoo.la"
|
||||||
|
lam_check_linker_flags_work
|
||||||
|
|
||||||
|
#
|
||||||
|
# Now fake linking to it and capture the output from libtool
|
||||||
|
#
|
||||||
|
|
||||||
|
cmd="$libtool --dry-run --mode=link $CC bar.lo libfoo.la -o bar $extra_flags"
|
||||||
|
lam_check_linker_flags_work yes
|
||||||
|
|
||||||
|
eval "set $output"
|
||||||
|
extra_ldflags=
|
||||||
|
while test -n "[$]1"; do
|
||||||
|
case "[$]1" in
|
||||||
|
$CC) ;;
|
||||||
|
bar*) ;;
|
||||||
|
-I*) ;;
|
||||||
|
-L*) ;;
|
||||||
|
-lfoo) ;;
|
||||||
|
-o) ;;
|
||||||
|
*.so) ;;
|
||||||
|
*.a) ;;
|
||||||
|
*)
|
||||||
|
extra_ldflags="$extra_ldflags [$]1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$extra_ldflags"; then
|
||||||
|
AC_MSG_RESULT([$extra_ldflags])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no extra flags])
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
rm -rf conftest.$$])dnl
|
66
configure.ac
66
configure.ac
@ -306,10 +306,74 @@ LAM_MCA
|
|||||||
# (after C compiler setup)
|
# (after C compiler setup)
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
lam_show_title "Libtool configuration"
|
lam_show_title "Libtool / libltdl configuration"
|
||||||
|
|
||||||
|
# Use convenience libltdl for the moment, because we need to force the
|
||||||
|
# use of the newest libltdl (i.e., the one that ships with libtool
|
||||||
|
# 1.5) because it has support for a lot more things than older
|
||||||
|
# versions of libtool (which are generally installed by default).
|
||||||
|
|
||||||
|
AC_LIBLTDL_CONVENIENCE(src/mca/libltdl)
|
||||||
|
AC_SUBST(LTDLINCL)
|
||||||
|
AC_SUBST(LIBLTDL)
|
||||||
|
AC_LIBTOOL_DLOPEN
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
|
# AC_CONFIG_SUBDIRS appears to be broken for non-gcc compilers (i.e.,
|
||||||
|
# passing precious variables down to the sub-configure).
|
||||||
|
#
|
||||||
|
# Note that we also did some magic scripty-foo in autogen.sh to rename
|
||||||
|
# the output libtool library "liblamltdl", so add -llamltdl here.
|
||||||
|
# This is because so many systems have older versions of libltdl
|
||||||
|
# installed very early in ld.so's search path; if we installed our own
|
||||||
|
# libltdl in some non-standard path (e.g., $HOME/local or even
|
||||||
|
# /usr/local), the libltdl in /usr/lib might get found first. And if
|
||||||
|
# it's older -- or just not matching the version that we need, Bad
|
||||||
|
# Things happen. [sigh]
|
||||||
|
#
|
||||||
|
# Finally, make liblamltdl follow the same shared/static convention
|
||||||
|
# that was user for the main LAM libraries. So manually examine
|
||||||
|
# $enable_shared and $enable_static and pass down the corresponding
|
||||||
|
# flags.
|
||||||
|
|
||||||
|
lam_show_subtitle "GNU libltdl setup"
|
||||||
|
|
||||||
|
lam_subdir_args="$lam_subdir_args --enable-ltdl-convenience --disable-ltdl-install"
|
||||||
|
if test "$enable_shared" = "yes"; then
|
||||||
|
lam_subdir_args="$lam_subdir_args --enable-shared"
|
||||||
|
else
|
||||||
|
lam_subdir_args="$lam_subdir_args --disable-shared"
|
||||||
|
fi
|
||||||
|
if test "$enable_static" = "yes"; then
|
||||||
|
lam_subdir_args="$lam_subdir_args --enable-static"
|
||||||
|
else
|
||||||
|
lam_subdir_args="$lam_subdir_args --disable-static"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LAM_CONFIG_SUBDIR(src/mca/libltdl, [$lam_subdir_args], [HAPPY=1], [HAPPY=0])
|
||||||
|
if test "$HAPPY" = "1"; then
|
||||||
|
LIBLTDL_SUBDIR=libltdl
|
||||||
|
LIBLTDL_LTLIB=libltdl/libltdlc.la
|
||||||
|
WANT_LIBLTDL=1
|
||||||
|
|
||||||
|
# Arrgh. This is gross. But I can't think of any other way to do
|
||||||
|
# it. :-(
|
||||||
|
|
||||||
|
flags="`egrep ^LIBADD_DL src/mca/libltdl/Makefile | cut -d= -f2-`"
|
||||||
|
LAM_CHECK_LINKER_FLAGS([src/mca/libltdl/libtool], [-export-dynamic $flags])
|
||||||
|
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags"
|
||||||
|
LDFLAGS="-export-dynamic $LDFLAGS"
|
||||||
|
else
|
||||||
|
LIBLTDL_SUBDIR=
|
||||||
|
LIBLTDL_LTLIB=
|
||||||
|
WANT_LIBLTDL=0
|
||||||
|
fi
|
||||||
|
AC_SUBST(LIBLTDL_SUBDIR)
|
||||||
|
AC_SUBST(LIBLTDL_LTLIB)
|
||||||
|
AM_CONDITIONAL(WANT_LIBLTDL, test "$WANT_LIBLTDL" = "1")
|
||||||
|
AC_DEFINE_UNQUOTED(LAM_WANT_LIBLTDL, $WANT_LIBLTDL,
|
||||||
|
[Whether to include support for libltdl or not])
|
||||||
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# final wrapper compiler config
|
# final wrapper compiler config
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
include $(top_srcdir)/config/Makefile.options
|
include $(top_srcdir)/config/Makefile.options
|
||||||
|
|
||||||
SUBDIRS = lam mpi
|
SUBDIRS = $(LIBLTDL_SUBDIR) lam mpi
|
||||||
|
|
||||||
# Source code files
|
# Source code files
|
||||||
|
|
||||||
@ -19,7 +19,8 @@ libmca_mpi_la_LIBADD = mpi/libmca_mpi_convenience.la
|
|||||||
libmca_mpi_la_DEPENDENCIES = $(libmca_mpi_la_LIBADD)
|
libmca_mpi_la_DEPENDENCIES = $(libmca_mpi_la_LIBADD)
|
||||||
|
|
||||||
libmca_lam_la_SOURCES =
|
libmca_lam_la_SOURCES =
|
||||||
libmca_lam_la_LIBADD = lam/libmca_lam_convenience.la
|
libmca_lam_la_LIBADD = $(LIBLTDL_LTLIB) \
|
||||||
|
lam/libmca_lam_convenience.la
|
||||||
libmca_lam_la_DEPENDENCIES = $(libmca_lam_la_LIBADD)
|
libmca_lam_la_DEPENDENCIES = $(libmca_lam_la_LIBADD)
|
||||||
|
|
||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user