# Use an existing Open MPI source tree (assuming that is configured
# and built already)
AC_ARG_WITH([openmpi-source],
[AS_HELP_STRING([--with-openmpi-source=DIR],
[Specify the top directory for the Open MPI source tree])],
[
# This works with v1.4 and v1.5, but not with trunk
# because trunk has the new build opal/event stuff. This
# means that there is a variable file to be included that
# is selected by the winning event component. I don't
# know yet how to -I this file properly. In a
# --with-devel-headers, this is easy -- I just slurp all
# flags from the wrapper compiler. But in a source tree
# case, how do I know which component won and what -I's
# to add? In the current trunk, libevent207 provides a
# nice include file that is relative to the root of the
# source tree. That's good. But then that file ends up
# including <event2/event-config.h>, which is most
# definitely *not* relative to the top of the OMPI source
# tree -- it's relative to the libevent207 tree. This is
# handled properly by libevent207's configure.m4 when
# building in-tree, but when we're building
# out-of-the-tree (like here), how the heck are we
# supposed to know what -I's to add? This is the problem
# that needs to be solved. Probably not *too* hard to
# fix, but I'm outta time today...
AC_MSG_CHECKING([for Open MPI source tree])
AS_IF([test -d "$withval" -a -d "$withval/opal" -a -d "$withval/orte" -a -d "$withval/ompi" -a -f "$withval/VERSION" -a -f "$withval/Makefile.man-page-rules" -a -f "$withval/opal/include/opal_config.h" -a -x "$withval/config.status"],