1
1
openmpi/config/mca_configure.ac
Jeff Squyres afb6d28cbf First cut at dramatically decreasing the overhead and increasing the
speed of autogen.sh and configure: find modules that don't need to have
a separate configure script during autogen.sh and set them up to be
part of LAM's build process.  This means that we don't have to run the GNU
tools nearly as much during autogen.sh and that we don't have to run
nearly as many sub-configure scripts during configure.

This works fine for statically-built MCA modules, but doesn't seem to work
properly yet for dynamically-built modules.  More coming soon, but I wanted
to get this in for others to use.

This commit was SVN r756.
2004-02-13 03:58:56 +00:00

245 строки
6.8 KiB
Bash

# -*- shell-script -*-
#
# $HEADER$
#
############################################################################
# Initialization, version number, and other random setup/init stuff
############################################################################
# Init autoconf
AC_INIT(@PARAM_INIT_FILE@)
AC_PREREQ(2.57)
AC_CONFIG_AUX_DIR(@PARAM_CONFIG_AUX_DIR@)
# Establish the top-level LAM directory
top_lam_srcdir='$(top_srcdir)/../../../../..'
top_lam_builddir='$(top_builddir)/../../../../..'
AC_SUBST(top_lam_srcdir)
AC_SUBST(top_lam_builddir)
# Get the version of @MCA_TYPE@ @MCA_MODULE_NAME@ that we are installing.
if test -n "@PARAM_VERSION_FILE@" -a -f "@PARAM_VERSION_FILE@"; then
LAM_GET_VERSION($srcdir/../../../../../config, @PARAM_VERSION_FILE@,
@PARAM_VAR_PREFIX@)
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MAJOR_VERSION,
$@PARAM_VAR_PREFIX@_MAJOR_VERSION,
[Major LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MINOR_VERSION,
$@PARAM_VAR_PREFIX@_MINOR_VERSION,
[Minor LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_RELEASE_VERSION,
$@PARAM_VAR_PREFIX@_RELEASE_VERSION,
[Release LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_ALPHA_VERSION,
$@PARAM_VAR_PREFIX@_ALPHA_VERSION,
[Alpha LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_BETA_VERSION,
$@PARAM_VAR_PREFIX@_BETA_VERSION,
[Beta LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_CVS_VERSION,
$@PARAM_VAR_PREFIX@_CVS_VERSION,
[CVS LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_VERSION,
"$@PARAM_VAR_PREFIX@_VERSION",
[Overall LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version number])
version_string="version $@PARAM_VAR_PREFIX@_VERSION"
else
version_string=""
fi
#
# Start it up
#
LAM_CONFIGURE_SETUP
lam_show_title "Configuring MCA @MCA_TYPE@ @MCA_MODULE_NAME@ module $version_string"
lam_show_subtitle "Initialization, setup"
#
# Init automake
# The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and
# VERSION macors
#
AM_INIT_AUTOMAKE(@PARAM_AM_NAME@, $@PARAM_VAR_PREFIX@_VERSION, 'no')
# Setup the top-level MCA module config.h file
AH_TOP([/* -*- c -*-
*
* $HEADER$
*
* LAM/MPI configuation header file.
* MCA @MCA_TYPE@: @MCA_MODULE_NAME@ module
*/
#ifndef @PARAM_VAR_PREFIX@_CONFIG_H
#define @PARAM_VAR_PREFIX@_CONFIG_H
])
AH_BOTTOM([#endif /* _@PARAM_VAR_PREFIX@_CONFIG_H */])
#
# Do the normal basics of setup:
# - set CLEANFILES
# - figure out the host type
# - set the default prefix
#
LAM_BASIC_SETUP
#
# Check to see if the user wants this @MCA_TYPE@ to be the default
#
AC_MSG_CHECKING([if want the @MCA_MODULE_NAME@ @MCA_TYPE@ to be the default])
want_default=0
result=no
AC_ARG_WITH(@PROCESSED_MCA_TYPE@,
AC_HELP_STRING([--with-@PROCESSED_MCA_TYPE@=name],
[if name is "@MCA_MODULE_NAME@", the @MCA_MODULE_NAME@ @MCA_TYPE@ will be the default]))
if test "$with_@PROCESSED_MCA_TYPE@" = "@MCA_MODULE_NAME@"; then
want_default=1
result=yes
fi
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_DEFAULT, $want_default,
[Whether the @MCA_MODULE_NAME@ @MCA_TYPE@ is the default @PROCESSED_MCA_TYPE@ or not])
AC_MSG_RESULT([$result])
#
# Check and see if the user wants this module built as a run-time
# loadable module. Acceptable combinations:
#
# --with-modules
# --with-modules=[.+,]*MODULE_TYPE[.+,]*
# --with-modules=[.+,]*MODULE_TYPE-MODULE_NAME[.+,]*
# --without-modules
#
AC_MSG_CHECKING([if want module to be run-time loadable])
AC_ARG_WITH(modules,
AC_HELP_STRING([--with-modules=name],
[if name is "@MCA_TYPE@-@MCA_MODULE_NAME@", then @MCA_MODULE_NAME@ will be compiled as a loadable module (if supported on this platform). This directly implies "--enable-shared=@MCA_TYPE@-@MCA_MODULE_NAME@ --disable-static=@MCA_TYPE@-@MCA_MODULE_NAME@"]))
# Manual conversion of $kind to its generic name (e.g., crmpi->cr,
# crlam->cr).
case "@MCA_TYPE@" in
crmpi)
generic_type="cr"
;;
crlam)
generic_type="cr"
;;
*)
generic_type="@MCA_TYPE@"
;;
esac
BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE=0
msg=no
if test "$with_modules" = "yes" -o \
"$with_modules" = "@MCA_TYPE@" -o "$with_modules" = "$generic_type"; then
BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE=1
msg=yes
elif test "$with_modules" != "no"; then
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
for module in $with_modules; do
if test "$module" = "@MCA_TYPE@-@MCA_MODULE_NAME@" -o \
"$module" = "@MCA_TYPE@" -o "$module" = "$generic_type"; then
BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE=1
msg=yes
fi
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
#
# Part one of libtool magic
#
AM_ENABLE_STATIC
AM_DISABLE_SHARED
#
# Now, if we're building the run-time loadable module, bypass those
# defaults and reset them to shared=yes, static=no.
#
if test "$BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE" = "1"; then
enable_shared=yes
enable_static=no
fi
###########################################################################
# Check for compilers and preprocessors
############################################################################
##################################
# Compiler characteristics
##################################
@C_COMPILER_SETUP@
@CXX_COMPILER_SETUP@
##################################
# @MCA_TYPE@ @MCA_MODULE_NAME@ module specific setup
##################################
if test "$LAM_WANT_DIST" = "no"; then
@CONFIGURE_STUB_MACRO@
else
@CONFIGURE_DIST_STUB_MACRO@
fi
#
# This is needed for VPATH builds, so that it will -I the appropriate
# include directory (don't know why automake doesn't do this
# automatically). We delayed doing it until now just so that
# '-I$(top_srcdir)' doesn't show up in any of the configure output --
# purely aesthetic.
#
CPPFLAGS='-I$(top_lam_srcdir)/src/include'" $CPPFLAGS"
#
# Delayed the substitution of these until now because they may have
# been modified throughout the course of this script.
#
AC_SUBST(CPPFLAGS)
############################################################################
# libtool magic
############################################################################
lam_show_subtitle "GNU libtool setup"
AM_PROG_LIBTOOL
AM_CONDITIONAL(LAM_BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE,
test "$BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE" = "1")
############################################################################
# Party on
############################################################################
lam_show_subtitle "Final output"
AM_CONFIG_HEADER([@PARAM_CONFIG_HEADER_FILE@])
AC_CONFIG_FILES([@PARAM_CONFIG_FILES@])
AC_OUTPUT