forked from sstsimulator/sst-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst_check_hybridsim.m4
56 lines (46 loc) · 1.85 KB
/
sst_check_hybridsim.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
50
51
52
53
54
55
56
AC_DEFUN([SST_CHECK_HYBRIDSIM], [
AC_ARG_WITH([hybridsim],
[AS_HELP_STRING([--with-hybridsim@<:@=DIR@:>@],
[Use HybridSim package installed in optionally specified DIR])])
sst_check_hybridsim_happy="yes"
AS_IF([test "$with_hybridsim" = "no"], [sst_check_hybridsim_happy="no"])
CPPFLAGS_saved="$CPPFLAGS"
LDFLAGS_saved="$LDFLAGS"
LIBS_saved="$LIBS"
AS_IF([test ! -z "$with_hybridsim" -a "$with_hybridsim" != "yes"],
[HYBRIDSIM_CPPFLAGS="-I$with_hybridsim"
CPPFLAGS="$HYBRIDSIM_CPPFLAGS $CPPFLAGS"
HYBRIDSIM_LDFLAGS="-L$with_hybridsim"
LDFLAGS="$HYBRIDSIM_LDFLAGS $LDFLAGS"
HYBRIDSIM_LIBDIR="$with_hybridsim"],
[HYRBRIDSIM_CPPFLAGS=
HYBRIDSIM_LDFLAGS=
HYBRIDSIM_LIBDIR=])
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS([HybridSim.h], [], [sst_check_hybridsim_happy="no"])
AC_CHECK_LIB([hybridsim], [libhybridsim_is_present],
[HYBRIDSIM_LIB="-lhybridsim"], [sst_check_hybridsim_happy="no"])
AC_LANG_POP(C++)
CPPFLAGS="$CPPFLAGS_saved"
LDFLAGS="$LDFLAGS_saved"
LIBS="$LIBS_saved"
AC_REQUIRE([SST_CHECK_NVDIMMSIM])
AC_REQUIRE([SST_CHECK_DRAMSIM])
AS_IF([test "$sst_check_hybridsim_happy" = "no"],
[],
[
AS_IF([test "$sst_check_nvdimmsim_happy" = "no"],
[AC_MSG_ERROR([NVDIMMSim required for HybridSim])])
AS_IF([test "$sst_check_dramsim_happy" = "no"],
[AC_MSG_ERROR([DRAMSim required for HybridSim])])
])
AC_SUBST([HYBRIDSIM_CPPFLAGS])
AC_SUBST([HYBRIDSIM_LDFLAGS])
AC_SUBST([HYBRIDSIM_LIB])
AC_SUBST([HYBRIDSIM_LIBDIR])
AM_CONDITIONAL([HAVE_HYBRIDSIM], [test "$sst_check_hybridsim_happy" = "yes"])
AS_IF([test "$sst_check_hybridsim_happy" = "yes"],
[AC_DEFINE([HAVE_HYBRIDSIM], [1], [Set to 1 if HybridSim was found])])
AC_DEFINE_UNQUOTED([HYBRIDSIM_LIBDIR], ["$HYBRIDSIM_LIBDIR"], [Path to HybridSim library])
AS_IF([test "$sst_check_hybridsim_happy" = "yes"], [$1], [$2])
])