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

« back to all changes in this revision

Viewing changes to config/ac_dataspaces.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_DATASPACES
 
4
#
 
5
# Test for DATASPACES installation
 
6
# and set $DATASPACES to the correct value.
 
7
#
 
8
#
 
9
dnl @synopsis AC_PROG_DATASPACES
 
10
dnl
 
11
dnl This macro test if DATASPACES is installed. If DATASPACES
 
12
dnl is installed, it set $DATASPACES 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_DATASPACES],[
 
18
 
 
19
AC_REQUIRE([AC_INFINIBAND])
 
20
dnl AC_REQUIRE([AC_PORTALS])
 
21
dnl AC_REQUIRE([AC_GNI])
 
22
 
 
23
 
 
24
AM_CONDITIONAL(HAVE_DATASPACES,true)
 
25
 
 
26
AC_ARG_WITH(dataspaces,
 
27
        [AS_HELP_STRING([--with-dataspaces=DIR],
 
28
           [Build the DATASPACES transport method. Point to the DATASPACES installation.])],
 
29
        [DATASPACES_LDFLAGS="-L$withval/lib";
 
30
         DATASPACES_CPPFLAGS="-I$withval/include";],
 
31
        [with_dataspaces=check])
 
32
 
 
33
dnl If --without-dataspaces was given set HAVE_DATASPACES to false and do nothing more
 
34
if test "x$with_dataspaces" == "xno"; then
 
35
 
 
36
   AM_CONDITIONAL(HAVE_DATASPACES,false)
 
37
 
 
38
else
 
39
 
 
40
    dnl allow args --with-dataspaces incdir and --with-dataspaces-libdir
 
41
    AC_ARG_WITH(dataspaces-incdir,
 
42
                [  --with-dataspaces-incdir=<location of dataspaces includes>],
 
43
                [DATASPACES_INCDIR=$withval
 
44
                 with_dataspaces=detailed])
 
45
    
 
46
    AC_ARG_WITH(dataspaces-libdir,
 
47
                [  --with-dataspaces-libdir=<location of dataspaces library>],
 
48
                [DATASPACES_LIBDIR=$withval
 
49
                 with_dataspaces=detailed])
 
50
    
 
51
    
 
52
    dnl If we know DATASPACES_DIR, then we can know DATASPACES_INCDIR.
 
53
    dnl We don't overwrite DATASPACES_INCDIR.
 
54
    if test -n "${DATASPACES_DIR}" -a -z "${DATASPACES_INCDIR}"; then
 
55
            DATASPACES_INCDIR="${DATASPACES_DIR}/include";
 
56
    dnl We may have DATASPACES denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
 
57
    elif test -n "${DATASPACES}" -a -d "${DATASPACES}"; then
 
58
            DATASPACES_INCDIR="${DATASPACES}/include"
 
59
    fi
 
60
 
 
61
    dnl If we know DATASPACES_DIR, then we can know DATASPACES_LIBDIR.
 
62
    dnl We don't overwrite DATASPACES_LIBDIR.
 
63
    if test -n "${DATASPACES_DIR}" -a -z "${DATASPACES_LIBDIR}"; then
 
64
            DATASPACES_LIBDIR="${DATASPACES_DIR}/lib";
 
65
    dnl We may have DATASPACES denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
 
66
    elif test -n "${DATASPACES}" -a -d "${DATASPACES}"; then
 
67
            DATASPACES_LIBDIR="${DATASPACES}/lib"
 
68
    fi
 
69
 
 
70
    dnl Add "-I" to DATASPACES_INCDIR.
 
71
    if test -n "${DATASPACES_INCDIR}"; then
 
72
            DATASPACES_CPPFLAGS="-I${DATASPACES_INCDIR}"
 
73
    else
 
74
            ac_dataspaces_ok=no
 
75
    fi
 
76
 
 
77
    dnl Add "-L" to DATASPACES_LIBDIR.
 
78
    if test -n "${DATASPACES_LIBDIR}"; then
 
79
            DATASPACES_LDFLAGS="-L${DATASPACES_LIBDIR}"
 
80
    else
 
81
            ac_dataspaces_ok=no
 
82
    fi
 
83
 
 
84
    save_CPPFLAGS="$CPPFLAGS"
 
85
    save_LIBS="$LIBS"
 
86
    save_LDFLAGS="$LDFLAGS"
 
87
    if test "x${ac_infiniband_lib_ok}" == "xyes"; then 
 
88
        dnl LIBS="$LIBS -ldart -ldataspaces"
 
89
        LIBS="$LIBS -ldspaces -ldscommon -ldart"
 
90
    elif test "x${ac_portals_lib_ok}" == "xyes"; then 
 
91
        LIBS="$LIBS -ldart2 -lspaces"
 
92
    elif test "x${ac_dmcf_lib_ok}" == "xyes"; then
 
93
        LIBS="$LIBS -ldspaces -ldscommon -ldart"
 
94
    else
 
95
        LIBS="$LIBS -ldspaces -ldscommon -ldart"
 
96
    fi
 
97
    dnl LIBS="$LIBS -ldspaces -ldscommon -ldart"
 
98
    LDFLAGS="$LDFLAGS $DATASPACES_LDFLAGS"
 
99
    CPPFLAGS="$CPPFLAGS $DATASPACES_CPPFLAGS"
 
100
    
 
101
    if test -z "${HAVE_DATASPACES_TRUE}"; then
 
102
            AC_CHECK_HEADERS(dataspaces.h,
 
103
                    ,
 
104
                    [AM_CONDITIONAL(HAVE_DATASPACES,false)])
 
105
    fi
 
106
    
 
107
    if test -z "${HAVE_DATASPACES_TRUE}"; then
 
108
        # Check for the DataSpaces library and headers
 
109
        if test "x${ac_portals_lib_ok}" == "xyes"; then 
 
110
            AC_TRY_COMPILE([#include "dataspaces.h"],
 
111
                    [int err; err = dspaces_init(1,1);],
 
112
                    [DATASPACES_LIBS="-ldart2 -lspaces"],
 
113
                    [AM_CONDITIONAL(HAVE_DATASPACES,false)])
 
114
        elif test "x${ac_infiniband_lib_ok}" == "xyes"; then 
 
115
            AC_TRY_COMPILE([#include "dataspaces.h"],
 
116
                    [int err; err = dspaces_init(1,1);],
 
117
                    [DATASPACES_LIBS="-ldspaces -ldscommon -ldart -lrdmacm"],
 
118
                    [AM_CONDITIONAL(HAVE_DATASPACES,false)])
 
119
        elif test -z "${HAVE_CRAY_PMI_TRUE}" -a -z "${HAVE_CRAY_UGNI_TRUE}"; then 
 
120
            AC_TRY_COMPILE([#include "dataspaces.h"],
 
121
                    [int err; err = dspaces_init(1,1);],
 
122
                    [DATASPACES_LIBS="-ldspaces -ldscommon -ldart"],
 
123
                    [AM_CONDITIONAL(HAVE_DATASPACES,false)])
 
124
        elif test "x${ac_dcmf_lib_ok}" == "xyes"; then
 
125
            AC_TRY_COMPILE([#include "dataspaces.h"],
 
126
                    [int err; err = dspaces_init(1,1);],
 
127
                    [DATASPACES_LIBS="-ldspaces -ldscommon -ldart"],
 
128
                    [AM_CONDITIONAL(HAVE_DATASPACES,false)])
 
129
        else
 
130
            AM_CONDITIONAL(HAVE_DATASPACES,false)
 
131
        fi
 
132
    fi
 
133
 
 
134
    LIBS="$save_LIBS"
 
135
    LDFLAGS="$save_LDFLAGS"
 
136
    CPPFLAGS="$save_CPPFLAGS"
 
137
    
 
138
    AC_SUBST(DATASPACES_LIBS)
 
139
    AC_SUBST(DATASPACES_LDFLAGS)
 
140
    AC_SUBST(DATASPACES_CPPFLAGS)
 
141
    
 
142
    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
 
143
    if test -z "${HAVE_DATASPACES_TRUE}"; then
 
144
            ifelse([$1],,[AC_DEFINE(HAVE_DATASPACES,1,[Define if you have the DATASPACES.])],[$1])
 
145
            :
 
146
    else
 
147
            $2
 
148
            :
 
149
    fi
 
150
 
 
151
fi
 
152
])dnl AC_DATASPACES