1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705
|
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
######################################################################
#
# OMPI_EXT
#
# configure the Interface Extensions [similar to MCA version]. Works hand in
# hand with Open MPI's autogen.sh, requiring it's specially formatted lists
# of frameworks, components, etc.
#
# USAGE:
# OMPI_EXT()
#
######################################################################
AC_DEFUN([OMPI_EXT],[
dnl for OMPI_CONFIGURE_USER env variable
AC_REQUIRE([OMPI_CONFIGURE_SETUP])
# Note that we do not build DSO's here -- we *only* build convenience
# libraries that get slurped into higher-level libraries
#
# [default -- no option given] = No extensions built
# --enable-mpi-ext=[,]*EXTENSION[,]*
#
AC_ARG_ENABLE(mpi-ext,
AC_HELP_STRING([--enable-mpi-ext[=LIST]],
[Comma-separated list of extensions that should be
built (default: none).]))
AC_MSG_CHECKING([which extension components should be enabled])
if test "$enable_mpi_ext" = "yes" -o "$enable_mpi_ext" = "all"; then
msg="All Extensions"
str="`echo ENABLE_EXT_ALL=1`"
eval $str
else
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
msg=
for item in $enable_mpi_ext; do
type="`echo $item | cut -s -f1 -d-`"
if test -z $type ; then
type=$item
fi
str="`echo ENABLE_${type}=1 | sed s/-/_/g`"
eval $str
msg="$item $msg"
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
AC_MSG_CHECKING([for projects containing EXT frameworks])
AC_MSG_RESULT([ext_project_list])
# if there isn't a project list, abort
m4_ifdef([ext_project_list], [],
[m4_fatal([Could not find project list - rerun autogen.sh without -l])])
# now configre all the projects, frameworks, and components. Most
# of the hard stuff is in here
EXT_PROJECT_SUBDIRS=
m4_foreach(ext_project, [ext_project_list],
[EXT_PROJECT_SUBDIRS="$EXT_PROJECT_SUBDIRS ext_project"
EXT_CONFIGURE_PROJECT(ext_project) ])
# make all the config output statements for the no configure
# components
EXT_NO_CONFIG_CONFIG_FILES()
AC_SUBST(EXT_C_HEADERS)
AC_SUBST(EXT_CXX_HEADERS)
AC_SUBST(EXT_F77_HEADERS)
AC_SUBST(EXT_F90_HEADERS)
AC_SUBST(EXT_C_LIBS)
AC_SUBST(EXT_CXX_LIBS)
AC_SUBST(EXT_F77_LIBS)
AC_SUBST(EXT_F90_LIBS)
AC_SUBST(EXT_PROJECT_SUBDIRS)
])
######################################################################
#
# EXT_CONFIGURE_PROJECT
#
# Configure all frameworks inside the given project name. Assumes that
# the frameworks are located in [project_name]/[frameworks] and that
# there is an m4_defined list named ext_[project]_framework_list with
# the list of frameworks.
#
# USAGE:
# EXT_CONFIGURE_PROJECT(project_name)
#
######################################################################
AC_DEFUN([EXT_CONFIGURE_PROJECT],[
# can't use a variable rename here because these need to be evaled
# at auto* time.
ompi_show_subtitle "Configuring EXT for $1"
AC_MSG_CHECKING([for frameworks for $1])
AC_MSG_RESULT([ext_$1_framework_list])
# iterate through the list of frameworks. There is something
# funky with m4 foreach if the list is defined, but empty. It
# will call the 3rd argument once with an empty value for the
# first argument. Protect against calling EXT_CONFIGURE_FRAMEWORK
# with an empty second argument. Grrr....
# if there isn't a project list, abort
#
# Also setup two variables for Makefiles:
# EXT_project_FRAMEWORKS - list of frameworks in that project
# EXT_project_FRAMEWORK_LIBS - list of libraries (or variables pointing
# to more libraries) that must be included
# in the project's main library
m4_ifdef([ext_$1_framework_list],
[_EXT_CONFIGURE_PROJECT($1)],
[echo No EXT frameworks for $1 - skipped])
])dnl
######################################################################
#
# _EXT_CONFIGURE_PROJECT
#
# Back end for EXT_CONFIGURE_PROJECT
#
# USAGE:
# _EXT_CONFIGURE_PROJECT(project_name)
#
######################################################################
AC_DEFUN([_EXT_CONFIGURE_PROJECT],[
EXT_$1_FRAMEWORKS=
EXT_$1_FRAMEWORKS_SUBDIRS=
EXT_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS=
EXT_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS=
EXT_$1_FRAMEWORK_LIBS=
m4_foreach(ext_framework, [ext_$1_framework_list],
[m4_ifval(ext_framework,
[
EXT_$1_FRAMEWORKS="$EXT_$1_FRAMEWORKS ext_framework"
EXT_$1_FRAMEWORKS_SUBDIRS="$EXT_$1_FRAMEWORKS_SUBDIRS ext_framework"
EXT_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS="$EXT_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS [\$(EXT_]ext_framework[_ALL_SUBDIRS)]"
EXT_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS="$EXT_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS [\$(EXT_]ext_framework[_STATIC_SUBDIRS)]"
EXT_$1_FRAMEWORK_LIBS="$EXT_$1_FRAMEWORK_LIBS [\$(EXT_]ext_framework[_STATIC_LTLIBS)]"
m4_ifdef([EXT_]ext_framework[_CONFIG],
[EXT_]ext_framework[_CONFIG]($1, ext_framework),
[EXT_CONFIGURE_FRAMEWORK($1, ext_framework, 1)])])])
AC_SUBST(EXT_$1_FRAMEWORKS)
AC_SUBST(EXT_$1_FRAMEWORKS_SUBDIRS)
AC_SUBST(EXT_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
AC_SUBST(EXT_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS)
AC_SUBST(EXT_$1_FRAMEWORK_LIBS)
])
######################################################################
#
# EXT_CONFIGURE_FRAMEWORK
#
# Configure the given framework and all components inside the
# framework. Assumes that the framework is located in
# [project_name]/[framework], and that all components are
# available under the framework directory. Will configure all
# no-configure and builtin components, then search for components with
# configure scripts. Assumes that no component is marked as builtin
# AND has a configure script.
#
# USAGE:
# EXT_CONFIGURE_PROJECT(project_name, framework_name, allow_succeed)
#
######################################################################
AC_DEFUN([EXT_CONFIGURE_FRAMEWORK],[
ompi_show_subsubtitle "Configuring EXT framework $2"
OMPI_VAR_SCOPE_PUSH([all_components outfile outfile_real])
# setup for framework
all_components=
static_components=
static_ltlibs=
outdir=$1/include
# first create the output include directory
mkdir -p $outdir
# remove any previously generated #include files
mpi_ext_h=$outdir/mpi-ext.h
rm -f $mpi_ext_h
# Create the final mpi-ext.h file.
cat > $mpi_ext_h <<EOF
/*
* \$HEADER\$
*/
#ifndef OMPI_MPI_EXT_H
#define OMPI_MPI_EXT_H 1
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
#define OMPI_HAVE_MPI_EXT 1
EOF
#
# XXX: Left todo: Add header files for other languages
#
# print some nice messages about what we're about to do...
AC_MSG_CHECKING([for no configure components in framework $2])
AC_MSG_RESULT([ext_$2_no_config_component_list])
AC_MSG_CHECKING([for m4 configure components in framework $2])
AC_MSG_RESULT([ext_$2_m4_config_component_list])
# configure components that don't have any component-specific
# configuration. See comment in CONFIGURE_PROJECT about the
# m4_ifval in the m4_foreach. If there isn't a component list,
# abort with a reasonable message. If there are components in the
# list, but we're doing one of the "special" selection logics,
# abort with a reasonable message.
m4_ifdef([ext_$2_no_config_component_list], [],
[m4_fatal([Could not find ext_$2_no_config_component_list - rerun autogen.sh without -l])])
# make sure priority stuff set right
m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST],
[m4_ifval(ext_$2_no_config_component_list,
[m4_fatal([Framework $2 using STOP_AT_FIRST but at least one component has no configure.m4])])])
m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
[m4_ifval(ext_$2_no_config_component_list,
[m4_fatal([Framework $2 using STOP_AT_FIRST_PRIORITY but at least one component has no configure.m4])])])
m4_foreach(ext_component, [ext_$2_no_config_component_list],
[m4_ifval(ext_component,
[EXT_CONFIGURE_NO_CONFIG_COMPONENT($1, $2, ext_component,
[all_components],
[static_components],
[static_ltlibs],
[$3])])])
# configure components that use built-in configuration scripts see
# comment in CONFIGURE_PROJECT about the m4_ifval in the
# m4_foreach. if there isn't a component list, abort
m4_ifdef([ext_$2_m4_config_component_list], [],
[m4_fatal([Could not find ext_$2_m4_config_component_list - rerun autogen.sh without -l])])
best_ext_component_priority=0
components_looking_for_succeed=$3
components_last_result=0
m4_foreach(ext_component, [ext_$2_m4_config_component_list],
[m4_ifval(ext_component,
[m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
[ # get the component's priority...
infile="$srcdir/$1/$2/ext_component/configure.params"
ext_component_priority="`$GREP PARAM_CONFIG_PRIORITY= $infile | cut -d= -f2-`"
AS_IF([test -z "$ext_component_priority"], [ext_component_priority=0])
AS_IF([test $best_ext_component_priority -gt $ext_component_priority], [components_looking_for_succeed=0])])
EXT_CONFIGURE_M4_CONFIG_COMPONENT($1, $2, ext_component,
[all_components],
[static_components],
[static_ltlibs],
[$components_looking_for_succeed],
[components_last_result=1],
[components_last_result=0])
m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST],
[AS_IF([test $components_last_result -eq 1], [components_looking_for_succeed=0])])
m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
[AS_IF([test $components_last_result -eq 1], [best_ext_component_priority=$ext_component_priority])])])])
# configure components that provide their own configure script.
# It would be really hard to run these for "find first that
# works", so we don't :)
m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST], [],
[m4_if(OMPI_EVAL_ARG([EXT_]ext_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [],
[AS_IF([test "$3" != "0"],
[EXT_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
[static_ltlibs])])])])
EXT_$2_ALL_COMPONENTS="$all_components"
EXT_$2_STATIC_COMPONENTS="$static_components"
EXT_$2_STATIC_LTLIBS="$static_ltlibs"
AC_SUBST(EXT_$2_ALL_COMPONENTS)
AC_SUBST(EXT_$2_STATIC_COMPONENTS)
AC_SUBST(EXT_$2_STATIC_LTLIBS)
# Create the final mpi-ext.h file.
cat >> $mpi_ext_h <<EOF
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OMPI_MPI_EXT_H */
EOF
#
# XXX: Left todo: Close header files for other languages
#
OMPI_EXT_MAKE_DIR_LIST(EXT_$2_ALL_SUBDIRS, $2, [$all_components])
OMPI_EXT_MAKE_DIR_LIST(EXT_$2_STATIC_SUBDIRS, $2, [$static_components])
OMPI_VAR_SCOPE_POP
])
######################################################################
#
# EXT_CONFIGURE_NO_CONFIG_COMPONENT
#
# Configure the given framework and all components inside the framework.
# Assumes that the framework is located in [project_name]/[framework],
# and that all components are available under the framework directory.
# Will configure all builtin components, then search for components with
# configure scripts. Assumes that no component is marked as builtin
# AND has a configure script.
#
# USAGE:
# EXT_CONFIGURE_NO_CONFIG_COMPONENT(project_name, framework_name, component_name
# all_components_variable,
# static_components_variable,
# static_ltlibs_variable,
# allowed_to_succeed)
#
######################################################################
AC_DEFUN([EXT_CONFIGURE_NO_CONFIG_COMPONENT],[
ompi_show_subsubsubtitle "EXT component $2:$3 (no configuration)"
EXT_COMPONENT_BUILD_CHECK($1, $2, $3,
[should_build=$7], [should_build=0])
EXT_COMPONENT_COMPILE_MODE($1, $2, $3, compile_mode)
if test "$should_build" = "1" ; then
EXT_PROCESS_COMPONENT($1, $2, $3, $4, $6, $compile_mode)
# add component to static component list
$5="$$5 $3"
else
EXT_PROCESS_DEAD_COMPONENT($1, $2, $3)
# add component to all component list
$4="$$4 $3"
fi
unset compile_mode
])
######################################################################
#
# EXT_CONFIGURE_M4_CONFIG_COMPONENT
#
#
# USAGE:
# EXT_CONFIGURE_PROJECT(project_name, framework_name, component_name
# all_components_variable,
# static_components_variable,
# static_ltlibs_variable,
# allowed_to_succeed,
# [eval if should build],
# [eval if should not build])
#
######################################################################
AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
ompi_show_subsubsubtitle "EXT component $2:$3 (m4 configuration macro)"
EXT_COMPONENT_BUILD_CHECK($1, $2, $3, [should_build=$7], [should_build=0])
# Allow the component to override the build mode if it really wants to.
# It is, of course, free to end up calling EXT_COMPONENT_COMPILE_MODE
m4_ifdef([EXT_$2_$3_COMPILE_MODE],
[EXT_$2_$3_COMPILE_MODE($1, $2, $3, compile_mode)],
[EXT_COMPONENT_COMPILE_MODE($1, $2, $3, compile_mode)])
# try to configure the component. pay no attention to
# --enable-dist, since we'll always have makefiles.
AS_IF([test "$should_build" = "1"],
[m4_ifdef([EXT_]$2[_]$3[_CONFIG],
[EXT_$2_$3_CONFIG([should_build=1],
[should_build=0])],
# If they forgot to define an EXT_<fw>_<comp>_CONFIG
# macro, print a friendly warning and abort.
[AC_MSG_WARN([*** The $2:$3 did not define an])
AC_MSG_WARN([*** EXT_$2_$3_CONFIG macro in the])
AC_MSG_WARN([*** $1/$2/$3/configure.m4 file])
AC_MSG_ERROR([Cannot continue])])
])
AS_IF([test "$should_build" = "1"],
[EXT_PROCESS_COMPONENT($1, $2, $3, $4, $6, $compile_mode)
# add component to static component list
$5="$$5 $3" ],
[EXT_PROCESS_DEAD_COMPONENT($1, $2, $3)
# add component to all component list
$4="$$4 $3"])
m4_ifdef([EXT_$2_$3_POST_CONFIG],
[EXT_$2_$3_POST_CONFIG($should_build)])
AS_IF([test "$should_build" = "1"],[$8], [$9])
unset compile_mode
])
######################################################################
#
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS
#
# configure all components in the given framework that have configure
# scripts and should be configured according to the usual rules...
#
# USAGE:
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
# framework_name,
# all_components_variable,
# static_ltlibs_variable)
#
######################################################################
AC_DEFUN([EXT_CONFIGURE_ALL_CONFIG_COMPONENTS],[
for component_path in $srcdir/$1/$2/* ; do
component="`basename $component_path`"
if test -d $component_path -a -x $component_path/configure ; then
ompi_show_subsubsubtitle "EXT component $2:$component (need to configure)"
EXT_COMPONENT_BUILD_CHECK($1, $2, $component,
[should_build=1], [should_build=0])
EXT_COMPONENT_COMPILE_MODE($1, $2, $component, compile_mode)
if test "$should_build" = "1" ; then
OMPI_CONFIG_SUBDIR([$1/$2/$component],
[$ompi_subdir_args],
[should_build=1], [should_build=2])
fi
if test "$should_build" = "1" ; then
EXT_PROCESS_COMPONENT($1, $2, $component, $3, $4, $compile_mode)
else
EXT_PROCESS_DEAD_COMPONENT($1, $2, $component)
fi
fi
done
])
######################################################################
#
# EXT_COMPONENT_COMPILE_MODE
#
# set compile_mode_variable to the compile mode for the given component
#
# USAGE:
# EXT_COMPONENT_COMPILE_MODE(project_name,
# framework_name, component_name
# compile_mode_variable)
#
# NOTE: component_name may not be determined until runtime....
#
######################################################################
AC_DEFUN([EXT_COMPONENT_COMPILE_MODE],[
project=$1
framework=$2
component=$3
# Extensions are always static, no need for further checks
$4="static"
#AC_MSG_CHECKING([for EXT component $framework:$component compile mode])
#AC_MSG_RESULT([$$4])
])
######################################################################
#
# EXT_PROCESS_COMPONENT
#
# does all setup work for given component. It should be known before
# calling that this component can build properly (and exists)
#
# USAGE:
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
# framework_name, component_name
# all_components_variable (4),
# static_ltlibs_variable (5),
# compile_mode_variable (6))
#
# NOTE: component_name may not be determined until runtime....
#
# M4 directive to disable language support in configure.m4
# Need to build a list of .la for each lang. to pull into final library
# List ext_c_headers, ext_c_libs {same for other lang.}
# C: framework_component_c{.h, .la}
# CXX: framework_component_cxx{.h, .la}
# F77: framework_component_f77{.h, .la}
# F90: framework_component_f90{.h, .la} ???
######################################################################
AC_DEFUN([EXT_PROCESS_COMPONENT],[
AC_REQUIRE([AC_PROG_GREP])
project=$1
framework=$2
component=$3
# Output pretty results
AC_MSG_CHECKING([if EXT component $framework:$component can compile])
AC_MSG_RESULT([yes])
# Save the list of headers and convenience libraries that this component will output
# There *must* be C bindings
EXT_C_HEADERS="$EXT_C_HEADERS $framework/$component/${framework}_${component}_c.h"
EXT_C_LIBS="$EXT_C_LIBS $framework/$component/libext_${framework}_${component}.la"
component_header="${framework}_${component}_c.h"
tmp[=]m4_translit([$3],[a-z],[A-Z])
component_define="OMPI_HAVE_MPI_EXT_${tmp}"
cat >> $mpi_ext_h <<EOF
/* Enabled Extension: $component */
#define $component_define 1
#include "openmpi/ompi/mpiext/$component/$component_header"
EOF
#
# XXX: Need to add conditional logic for components that do not supply
# XXX: some or all of the other 3 interfaces [C++, F77, F90]. If they
# XXX: did provide those bindings, then add the header file to the relevant
# XXX: language binding's header file.
#
EXT_CXX_HEADERS="$EXT_CXX_HEADERS $framework/$component/${framework}_${component}_cxx.h"
EXT_CXX_LIBS="$EXT_CXX_LIBS $framework/$component/libext_${framework}_${component}_cxx.la"
EXT_F77_HEADERS="$EXT_F77_HEADERS $framework/$component/${framework}_${component}_f77.h"
EXT_F77_LIBS="$EXT_F77_LIBS $framework/$component/libext_${framework}_${component}_f77.la"
EXT_F90_HEADERS="$EXT_F90_HEADERS $framework/$component/${framework}_${component}_f90.h"
EXT_F90_LIBS="$EXT_F90_LIBS $framework/$component/libext_${framework}_${component}_f90.la"
# See if it dropped an output file for us to pick up some
# shell variables in.
infile="$srcdir/$project/$framework/$component/post_configure.sh"
# Add this subdir to the mast list of all EXT component subdirs
$4="$$4 $component"
$5="$framework/$component/libext_${framework}_${component}.la $$5"
# If there's an output file, add the values to
# scope_EXTRA_flags.
if test -f $infile; then
# First check for the ABORT tag
line="`$GREP ABORT= $infile | cut -d= -f2-`"
if test -n "$line" -a "$line" != "no"; then
AC_MSG_WARN([EXT component configure script told me to abort])
AC_MSG_ERROR([cannot continue])
fi
# Check for flags passed up from the component. If we're
# compiling statically, then take all flags passed up from the
# component.
m4_foreach(flags, [LDFLAGS, LIBS],
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
eval "line=$line"
if test -n "$line"; then
$1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
fi
])dnl
fi
# now add the flags that were set in the environment variables
# framework_component_FOO (for example, the flags set by
# m4_configure components)
#
# Check for flags passed up from the component. If we're
# compiling statically, then take all flags passed up from the
# component.
m4_foreach(flags, [LDFLAGS, LIBS],
[[str="line=\$${framework}_${component}_WRAPPER_EXTRA_]flags["]
eval "$str"
if test -n "$line" ; then
$1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
fi
])dnl
])
######################################################################
#
# EXT_PROCESS_DEAD_COMPONENT
#
# process a component that can not be built. Do the last minute checks
# to make sure the user isn't doing something stupid.
#
# USAGE:
# EXT_PROCESS_DEAD_COMPONENT(project_name,
# framework_name, component_name)
#
# NOTE: component_name may not be determined until runtime....
#
######################################################################
AC_DEFUN([EXT_PROCESS_DEAD_COMPONENT],[
AC_MSG_CHECKING([if EXT component $2:$3 can compile])
AC_MSG_RESULT([no])
# If this component was requested as the default for this
# type, then abort.
if test "$with_$2" = "$3" ; then
AC_MSG_WARN([EXT component "$3" failed to configure properly])
AC_MSG_WARN([This component was selected as the default])
AC_MSG_ERROR([Cannot continue])
exit 1
fi
])
######################################################################
#
# EXT_COMPONENT_BUILD_CHECK
#
# checks the standard rules of component building to see if the
# given component should be built.
#
# USAGE:
# EXT_COMPONENT_BUILD_CHECK(project, framework, component,
# action-if-build, action-if-not-build)
#
######################################################################
AC_DEFUN([EXT_COMPONENT_BUILD_CHECK],[
AC_REQUIRE([AC_PROG_GREP])
project=$1
framework=$2
component=$3
component_path="$srcdir/$project/$framework/$component"
want_component=0
# build if:
# - the component type is direct and we are that component
# - there is no ompi_ignore file
# - there is an ompi_ignore, but there is an empty ompi_unignore
# - there is an ompi_ignore, but username is in ompi_unignore
if test -d $component_path ; then
# decide if we want the component to be built or not. This
# is spread out because some of the logic is a little complex
# and test's syntax isn't exactly the greatest. We want to
# build the component by default.
want_component=1
if test -f $component_path/.ompi_ignore ; then
# If there is an ompi_ignore file, don't build
# the component. Note that this decision can be
# overridden by the unignore logic below.
want_component=0
fi
if test -f $component_path/.ompi_unignore ; then
# if there is an empty ompi_unignore, that is
# equivalent to having your userid in the unignore file.
# If userid is in the file, unignore the ignore file.
if test ! -s $component_path/.ompi_unignore ; then
want_component=1
elif test ! -z "`$GREP $OMPI_CONFIGURE_USER $component_path/.ompi_unignore`" ; then
want_component=1
fi
fi
fi
# if we asked for everything, then allow it to build if able
str="ENABLED_COMPONENT_CHECK=\$ENABLE_EXT_ALL"
eval $str
if test ! "$ENABLED_COMPONENT_CHECK" = "1" ; then
# if we were explicitly disabled, don't build :)
str="ENABLED_COMPONENT_CHECK=\$ENABLE_${component}"
eval $str
if test ! "$ENABLED_COMPONENT_CHECK" = "1" ; then
want_component=0
fi
fi
AS_IF([test "$want_component" = "1"], [$4], [$5])
])
# OMPI_EXT_MAKE_DIR_LIST(subst'ed variable, framework, shell list)
# -------------------------------------------------------------------------
AC_DEFUN([OMPI_EXT_MAKE_DIR_LIST],[
$1=
for item in $3 ; do
$1="$$1 $2/$item"
done
AC_SUBST($1)
])
|