diff --git a/ompi/mca/ptl/mx/Makefile.am b/ompi/mca/ptl/mx/Makefile.am index eda5ba47ba..478de264e8 100644 --- a/ompi/mca/ptl/mx/Makefile.am +++ b/ompi/mca/ptl/mx/Makefile.am @@ -18,6 +18,8 @@ include $(top_ompi_srcdir)/config/Makefile.options +AM_CPPFLAGS = $(ptl_mx_CPPFLAGS) + # Make the output library in this directory, and name it either # mca__.la (for DSO builds) or libmca__.la # (for static builds). @@ -30,17 +32,17 @@ component_noinst = libmca_ptl_mx.la component_install = endif -mx_SOURCES = ptl_mx.c ptl_mx.h ptl_mx_component.c ptl_mx_module.c ptl_mx_module.h \ +ptl_mx_SOURCES = ptl_mx.c ptl_mx.h ptl_mx_component.c ptl_mx_module.c ptl_mx_module.h \ ptl_mx_peer.c ptl_mx_peer.h ptl_mx_proc.c ptl_mx_proc.h \ ptl_mx_recvfrag.c ptl_mx_recvfrag.h ptl_mx_sendfrag.c ptl_mx_sendfrag.h mcacomponentdir = $(libdir)/openmpi mcacomponent_LTLIBRARIES = $(component_install) mca_ptl_mx_la_SOURCES = $(mx_SOURCES) -mca_ptl_mx_la_LIBADD = -mca_ptl_mx_la_LDFLAGS = -module -avoid-version +mca_ptl_mx_la_LIBADD = $(ptl_mx_LIBX) +mca_ptl_mx_la_LDFLAGS = -module -avoid-version $(ptl_mx_LDFLAGS) noinst_LTLIBRARIES = $(component_noinst) -libmca_ptl_mx_la_SOURCES = $(mx_SOURCES) -libmca_ptl_mx_la_LIBADD = -libmca_ptl_mx_la_LDFLAGS = -module -avoid-version +libmca_ptl_mx_la_SOURCES = $(ptl_mx_SOURCES) +libmca_ptl_mx_la_LIBADD = $(ptl_mx_LIBS) +libmca_ptl_mx_la_LDFLAGS = -module -avoid-version $(ptl_mx_LDFLAGS) diff --git a/ompi/mca/ptl/mx/configure.m4 b/ompi/mca/ptl/mx/configure.m4 new file mode 100644 index 0000000000..562bf7ffbc --- /dev/null +++ b/ompi/mca/ptl/mx/configure.m4 @@ -0,0 +1,39 @@ +# -*- shell-script -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# MCA_ptl_mx_CONFIG([action-if-can-compile], +# [action-if-cant-compile]) +# ------------------------------------------------ +AC_DEFUN([MCA_ptl_mx_CONFIG],[ + OMPI_CHECK_MX([ptl_mx], + [ptl_mx_happy="yes"], + [ptl_mx_happy="no"]) + + AS_IF([test "$ptl_mx_happy" = "yes"], + [ptl_mx_WRAPPER_EXTRA_LDFLAGS="$ptl_mx_LDFLAGS" + ptl_mx_WRAPPER_EXTRA_LIBS="$ptl_mx_LIBS" + $1], + [$2]) + + # substitute in the things needed to build mx + AC_SUBST([ptl_mx_CFLAGS]) + AC_SUBST([ptl_mx_CPPFLAGS]) + AC_SUBST([ptl_mx_LDFLAGS]) + AC_SUBST([ptl_mx_LIBS]) +])dnl + diff --git a/ompi/mca/ptl/mx/configure.params b/ompi/mca/ptl/mx/configure.params index 095d583f39..d9deeed9df 100644 --- a/ompi/mca/ptl/mx/configure.params +++ b/ompi/mca/ptl/mx/configure.params @@ -18,5 +18,4 @@ # Specific to this module PARAM_INIT_FILE=ptl_mx.c -PARAM_CONFIG_HEADER_FILE="mx_config.h" PARAM_CONFIG_FILES="Makefile" diff --git a/ompi/mca/ptl/mx/configure.stub b/ompi/mca/ptl/mx/configure.stub deleted file mode 100644 index c1de5a57d8..0000000000 --- a/ompi/mca/ptl/mx/configure.stub +++ /dev/null @@ -1,86 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2004-2005 The Trustees of Indiana University. -# All rights reserved. -# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. -# All rights reserved. -# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2004-2005 The Regents of the University of California. -# All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# -# Main function. This will be invoked in the middle of the templated -# configure script. -# -AC_DEFUN([MCA_CONFIGURE_STUB],[ - - # Additional --with flags that can be specified - - AC_ARG_WITH(ptl-mx, - AC_HELP_STRING([--with-ptl-mx=DIR], - [Specify the installation directory of MX])) - AC_ARG_WITH(ptl-mx-libdir, - AC_HELP_STRING([--with-ptl-mx-libdir=DIR], - [directory where the MX library can be found, if it is not in \$MXDIR/lib or \$MXDIR/binary/lib])) - - # Add to CPPFLAGS if necessary - - EXTRA_CPPFLAGS= - if test -n "$with_ptl_mx"; then - if test -d "$with_ptl_mx/include"; then - EXTRA_CPPFLAGS="-I$with_ptl_mx/include" - else - AC_MSG_WARN([*** Warning: cannot find $with_ptl_mx/include]) - AC_MSG_WARN([*** Will still try to configure mx ptl anyway...]) - fi - fi - - # See if we can find mx.h - - CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS" - AC_CHECK_HEADERS(myriexpress.h,, - AC_MSG_ERROR([*** Cannot find working myriexpress.h.])) - - # Add to LDFLAGS if necessary - - EXTRA_LDFLAGS= - if test -n "$with_ptl_mx_libdir"; then - if test -d "$with_ptl_mx_libdir"; then - EXTRA_LDFLAGS="-L$with_ptl_mx_libdir" - else - AC_MSG_WARN([*** Warning: cannot find $with_ptl_mx_libdir]) - AC_MSG_WARN([*** Will still try to configure mx ptl anyway...]) - fi - elif test -n "$with_ptl_mx"; then - if test -d "$with_ptl_mx/lib"; then - EXTRA_LDFLAGS="-L$with_ptl_mx/lib" - elif test -d "$with_ptl_mx/binary/lib"; then - EXTRA_LDFLAGS="-L$with_ptl_mx/binary/lib" - else - AC_MSG_WARN([*** Warning: cannot find $with_ptl_mx/lib]) - AC_MSG_WARN([*** or $with_ptl_mx/binary/lib]) - AC_MSG_WARN([*** Will still try to configure mx ptl anyway...]) - fi - fi - - # Try to find libmyriexpress - - LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -lpthread" - AC_CHECK_LIB([myriexpress], [main], [], - AC_MSG_ERROR([*** Cannot find libmyriexpress])) - - # - # Save extra compiler/linker flags so that they can be added in - # the wrapper compilers, if necessary - # - - WRAPPER_EXTRA_LDFLAGS="$EXTRA_LDFLAGS" - WRAPPER_EXTRA_LIBS="-lmyriexpress -lpthread" -])dnl