forked from sstsimulator/sst-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst_check_otf.m4
49 lines (39 loc) · 1.52 KB
/
sst_check_otf.m4
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
AC_DEFUN([SST_CHECK_OTF],
[
sst_check_otf_happy="yes"
AC_ARG_WITH([otf],
[AS_HELP_STRING([--with-otf@<:@=DIR@:>@],
[Use OTF package installed in optionally specified DIR])])
AS_IF([test "$with_otf" = "no"], [sst_check_otf_happy="no"])
CXXFLAGS_saved="$CXXFLAGS"
CPPFLAGS_saved="$CPPFLAGS"
LDFLAGS_saved="$LDFLAGS"
LIBS_saved="$LIBS"
AS_IF([test "$sst_check_otf_happy" = "yes"], [
AS_IF([test ! -z "$with_otf" -a "$with_otf" != "yes"],
[OTF_PATH="$with_otf/bin/:$PATH"
OTF_CPPFLAGS="-I$with_otf/include"
CPPFLAGS="$OTF_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
OTF_LDFLAGS="-L$with_otf/lib"
LDFLAGS="$OTF_LDFLAGS $AM_LDFLAGS $LDFLAGS"],
[OTF_CPPFLAGS=
OTF_LDFLAGS=])])
AC_PATH_PROG([OTF_CONFIG_TOOL],[otfconfig],[],[$OTF_PATH])
AS_IF([test "x$OTF_CONFIG_TOOL" = "x"],
[sst_check_otf_happy="no"])
CXXFLAGS="$CXXFLAGS_saved"
CPPFLAGS="$CPPFLAGS_saved"
LDFLAGS="$LDFLAGS_saved"
LIBS="$LIBS_saved"
AC_SUBST([OTF_CPPFLAGS])
AC_SUBST([OTF_LDFLAGS])
AC_SUBST([OTF_CONFIG_TOOL])
AC_SUBST([OTF_PATH])
AM_CONDITIONAL([USE_OTF], [test "x$sst_check_otf_happy" = "xyes"])
AS_IF([test "$sst_check_otf_happy" = "yes"], [AC_DEFINE([HAVE_OTF],[1],[Defines whether we have the OFT library])])
AC_MSG_CHECKING([for OTF library])
AC_MSG_RESULT([$sst_check_otf_happy])
AS_IF([test "$sst_check_otf_happy" = "no" -a ! -z "$with_otf" -a "$with_otf" != "no"], [$3])
AS_IF([test "$sst_check_otf_happy" = "yes"], [$1], [$2])
])