~ubuntu-branches/ubuntu/utopic/adios/utopic

« back to all changes in this revision

Viewing changes to config/ac_dart.m4

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2013-12-09 15:21:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131209152131-jtd4fpmdv3xnunnm
Tags: 1.5.0-1
* New upstream.
* Standards-Version: 3.9.5
* Include latest config.{sub,guess} 
* New watch file.
* Create libadios-bin for binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
#
3
 
# AC_PROG_DART
4
 
#
5
 
# Test for DART installation
6
 
# and set $DART to the correct value.
7
 
#
8
 
#
9
 
dnl @synopsis AC_PROG_DART
10
 
dnl
11
 
dnl This macro test if DART is installed. If DART
12
 
dnl is installed, it set $DART to the right value
13
 
dnl
14
 
dnl @version 1.0
15
 
dnl @author Norbert Podhorszki, pnorbert@ornl.gov
16
 
dnl
17
 
AC_DEFUN([AC_PROG_DART],[
18
 
 
19
 
AM_CONDITIONAL(HAVE_DART,true)
20
 
 
21
 
AC_ARG_WITH(dart,
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";],
26
 
        [with_dart=check])
27
 
 
28
 
dnl If --without-dart was given set HAVE_DART to false and do nothing more
29
 
if test "x$with_dart" == "xno"; then
30
 
 
31
 
   AM_CONDITIONAL(HAVE_DART,false)
32
 
 
33
 
else
34
 
 
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>],
38
 
                [DART_INCDIR=$withval
39
 
                 with_dart=detailed])
40
 
    
41
 
    AC_ARG_WITH(dart-libdir,
42
 
                [  --with-dart-libdir=<location of dart library>],
43
 
                [DART_LIBDIR=$withval
44
 
                 with_dart=detailed])
45
 
    
46
 
    
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"
54
 
    fi
55
 
 
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"
63
 
    fi
64
 
 
65
 
    dnl Add "-I" to DART_INCDIR.
66
 
    if test -n "${DART_INCDIR}"; then
67
 
            DART_CPPFLAGS="-I${DART_INCDIR}"
68
 
    else
69
 
            ac_dart_ok=no
70
 
    fi
71
 
 
72
 
    dnl Add "-L" to DART_LIBDIR.
73
 
    if test -n "${DART_LIBDIR}"; then
74
 
            DART_LDFLAGS="-L${DART_LIBDIR}"
75
 
    else
76
 
            ac_dart_ok=no
77
 
    fi
78
 
 
79
 
    save_CPPFLAGS="$CPPFLAGS"
80
 
    save_LIBS="$LIBS"
81
 
    save_LDFLAGS="$LDFLAGS"
82
 
    LIBS="$LIBS -ldart2 -lspaces"
83
 
    LDFLAGS="$LDFLAGS $DART_LDFLAGS"
84
 
    CPPFLAGS="$CPPFLAGS $DART_CPPFLAGS"
85
 
    
86
 
    if test -z "${HAVE_DART_TRUE}"; then
87
 
            AC_CHECK_HEADERS(dart.h,
88
 
                    ,
89
 
                    [AM_CONDITIONAL(HAVE_DART,false)])
90
 
    fi
91
 
    
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)])
97
 
    
98
 
    LIBS="$save_LIBS"
99
 
    LDFLAGS="$save_LDFLAGS"
100
 
    CPPFLAGS="$save_CPPFLAGS"
101
 
    
102
 
    AC_SUBST(DART_LIBS)
103
 
    AC_SUBST(DART_LDFLAGS)
104
 
    AC_SUBST(DART_CPPFLAGS)
105
 
    
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])
109
 
            :
110
 
    else
111
 
            $2
112
 
            :
113
 
    fi
114
 
 
115
 
fi
116
 
])dnl AC_DART