1
1
openmpi/config/ompi_config_subdir.m4

157 строки
3.7 KiB
Plaintext
Исходник Обычный вид История

dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CONFIG_SUBDIR],[
#
# Invoke configure in a specific subdirectory.
#
# $1 is the directory to invoke in
# $2 is the list of arguments to pass
# $3 is actions to execute upon success
# $4 is actions to execute upon failure
#
subdir_dir="$1"
subdir_args="$2"
subdir_success="$3"
subdir_failure="$4"
#
# Sanity checks
#
if test "$subdir_dir" != ":" -a -d $srcdir/$subdir_dir; then
AC_MSG_NOTICE([OMPI configuring in $subdir_dir])
#
# Gotta check where srcdir is for VPATH builds. If srcdir is not
# ., then we need to mkdir the subdir. Otherwise, we can just cd
# into it.
#
case $srcdir in
.)
;;
*)
{ case $subdir_dir in
[[\\/]]* | ?:[[\\/]]* ) total_dir=;;
*) total_dir=.;;
esac
temp=$subdir_dir
for dir_part in `IFS='/\\'; set X $temp; shift; echo "$[@]"`; do
case $dir_part in
# Skip DOS drivespec
?:) total_dir=$dir_part ;;
*) total_dir=$total_dir/$dir_part
test -d "$total_dir" ||
mkdir "$total_dir" ||
AC_MSG_ERROR([cannot create $subdir_dir])
;;
esac
done; }
if test -d ./$subdir_dir; then :;
else
AC_MSG_ERROR([cannot create `pwd`/$subdir_dir])
fi
;;
esac
#
# Move into the target directory
#
subdir_parent=`pwd`
cd $subdir_dir
#
# Make a "../" for each directory in $subdir_dir.
#
subdir_dots=`[echo $subdir_dir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g]'`
#
# Construct the --srcdir argument
#
case $srcdir in
.)
# In place
subdir_srcdir="$srcdir"
;;
[[\\/]* | ?:[\\/]*] )
# Absolute path
subdir_srcdir="$srcdir/$subdir_dir"
;;
*)
# Relative path
subdir_srcdir="$subdir_dots$srcdir/$subdir_dir"
;;
esac
#
# Construct the --cache-file argument
#
* Rewrite ompi_mca.m4 to use m4_defined lists of projects (ompi, orte, etc.), frameworks, and components without configure scripts instead of hard-coded shell variables (for projects and frameworks) and shell variable building (for components). * Add 3rd category of component configuration (in addition to configure scripts and no-configured components): configure.m4 components. These components can only be built as part of OMPI (like no-configure), but can provide an m4 file that is run as part of the main configure script. These macros can set whether the component should be built, along with just about any other configuration wanted. More care must be taken compared to configure components, as doing things like setting variables or calling AC_MSG_ERROR now affects the top-level configure script (so calling AC_MSG_ERROR if your component can't configure probably isn't what you want) * Added support to autogen.sh for the configure.m4-style components, as well as building up the m4_define lists ompi_mca.m4 now expects * Updated a number of macros to be more config.cache friendly (both so that config.cache can be used and so the test can be quickly run multiple times in the same configrue script): - ompi_config_asm - c_weak_symbols - c_get_alignment * Added new macros to be shared when configuring components: - ompi_objc.m4 (this actually provides AC_PROG_OBJC - don't ask...) - ompi_check_xgrid - ompi_check_tm - ompi_check_bproc * Updated a number of components to use configure.m4 instead of configure.stub - btl portals - io romio - tm ras and pls - bjs, lsf_bproc ras and bproc_seed pls - xgrid ras and pls - null iof (used by tm) This commit was SVN r6412.
2005-07-09 22:52:53 +04:00
dnl case $cache_file in
dnl [[\\/]* | ?:[\\/]*] )
dnl # Absolute path
dnl subdir_cache_file="$cache_file"
dnl ;;
dnl *)
dnl # Relative path
dnl subdir_cache_file="$subdir_dots$cache_file"
dnl ;;
dnl esac
# BWB - subdir caching is a pain since we change CFLAGS and all that.
# Just disable it for now
subdir_cache_file="/dev/null"
#
# Invoke the configure script in the subdirectory
#
export CFLAGS CPPFLAGS
export CXXFLAGS CXXCPPFLAGS
export FFLAGS
export LDFLAGS LIBS
sub_configure="$SHELL '$subdir_srcdir/configure'"
AC_MSG_NOTICE([running $sub_configure $subdir_args --cache-file=$subdir_cache_file --srcdir=$subdir_srcdir])
eval $sub_configure $subdir_args \
--cache-file=$subdir_cache_file --srcdir=$subdir_srcdir
if test "$?" = "0"; then
eval $subdir_success
AC_MSG_NOTICE([$sub_configure succeeded for $subdir_dir])
else
eval $subdir_failure
AC_MSG_NOTICE([$sub_configure *failed* for $subdir_dir])
fi
#
# Go back to the topdir
#
cd $subdir_parent
fi
#
# Clean up
#
unset subdir_parent sub_configure subdir_dir subdir_srcdir subdir_cache_file
unset subdir_args subdir_dots total_dir dir_part temp])dnl