5
# Test for DART installation
6
# and set $DART to the correct value.
9
dnl @synopsis AC_PROG_DART
11
dnl This macro test if DART is installed. If DART
12
dnl is installed, it set $DART to the right value
15
dnl @author Norbert Podhorszki, pnorbert@ornl.gov
17
AC_DEFUN([AC_PROG_DART],[
19
AM_CONDITIONAL(HAVE_DART,true)
22
[AS_HELP_STRING([--with-dart=DIR],
23
[Build the DART transport method. Point to the DART installation.])],
24
[DART_LDFLAGS="-L$withval/lib";
25
DART_CPPFLAGS="-I$withval/include";],
28
dnl If --without-dart was given set HAVE_DART to false and do nothing more
29
if test "x$with_dart" == "xno"; then
31
AM_CONDITIONAL(HAVE_DART,false)
35
dnl allow args --with-dart incdir and --with-dart-libdir
36
AC_ARG_WITH(dart-incdir,
37
[ --with-dart-incdir=<location of dart includes>],
41
AC_ARG_WITH(dart-libdir,
42
[ --with-dart-libdir=<location of dart library>],
47
dnl If we know DART_DIR, then we can know DART_INCDIR.
48
dnl We don't overwrite DART_INCDIR.
49
if test -n "${DART_DIR}" -a -z "${DART_INCDIR}"; then
50
DART_INCDIR="${DART_DIR}/include";
51
dnl We may have DART denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
52
elif test -n "${DART}" -a -d "${DART}"; then
53
DART_INCDIR="${DART}/include"
56
dnl If we know DART_DIR, then we can know DART_LIBDIR.
57
dnl We don't overwrite DART_LIBDIR.
58
if test -n "${DART_DIR}" -a -z "${DART_LIBDIR}"; then
59
DART_LIBDIR="${DART_DIR}/lib";
60
dnl We may have DART denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
61
elif test -n "${DART}" -a -d "${DART}"; then
62
DART_LIBDIR="${DART}/lib"
65
dnl Add "-I" to DART_INCDIR.
66
if test -n "${DART_INCDIR}"; then
67
DART_CPPFLAGS="-I${DART_INCDIR}"
72
dnl Add "-L" to DART_LIBDIR.
73
if test -n "${DART_LIBDIR}"; then
74
DART_LDFLAGS="-L${DART_LIBDIR}"
79
save_CPPFLAGS="$CPPFLAGS"
81
save_LDFLAGS="$LDFLAGS"
82
LIBS="$LIBS -ldart2 -lspaces"
83
LDFLAGS="$LDFLAGS $DART_LDFLAGS"
84
CPPFLAGS="$CPPFLAGS $DART_CPPFLAGS"
86
if test -z "${HAVE_DART_TRUE}"; then
87
AC_CHECK_HEADERS(dart.h,
89
[AM_CONDITIONAL(HAVE_DART,false)])
92
# Check for the Mini-XML library and headers
93
AC_TRY_COMPILE([#include "dart.h"],
94
[int err; err = dart_init(1,1);],
95
[DART_LIBS="-ldart2 -lspaces"],
96
[AM_CONDITIONAL(HAVE_DART,false)])
99
LDFLAGS="$save_LDFLAGS"
100
CPPFLAGS="$save_CPPFLAGS"
103
AC_SUBST(DART_LDFLAGS)
104
AC_SUBST(DART_CPPFLAGS)
106
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
107
if test -z "${HAVE_DART_TRUE}"; then
108
ifelse([$1],,[AC_DEFINE(HAVE_DART,1,[Define if you have the DART.])],[$1])