-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrmol.m4
79 lines (61 loc) · 1.8 KB
/
rmol.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Configure path for the RMOL library.
# Denis Arnaud <denis_arnaud@users.sourceforge.net>, May 2007
AC_DEFUN([AM_PATH_RMOL],
[
AC_ARG_WITH(rmol,
[ --with-rmol=PFX Prefix where RMOL is installed (optional)],
rmol_dir="$withval",
rmol_dir="")
if test "x${RMOL_CONFIG+set}" != xset ; then
if test "x$rmol_dir" != x ; then
RMOL_CONFIG="$rmol_dir/bin/rmol-config"
fi
fi
AC_PATH_PROG(RMOL_CONFIG, rmol-config, no)
min_rmol_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for RMOL - version >= $min_rmol_version)
no_rmol=""
if test "$RMOL_CONFIG" = "no" ; then
no_rmol=yes
AC_MSG_RESULT([no])
else
RMOL_VERSION=`$RMOL_CONFIG --version`
RMOL_CFLAGS=`$RMOL_CONFIG --cflags`
RMOL_LIBS=`$RMOL_CONFIG --libs`
AC_SUBST([RMOL_VERSION])
AC_SUBST([RMOL_CFLAGS])
AC_SUBST([RMOL_LIBS])
rmol_major_version=`echo $RMOL_VERSION | sed 's/^\([[0-9]]*\).*/\1/'`
if test "x${rmol_major_version}" = "x" ; then
rmol_major_version=0
fi
rmol_minor_version=`echo $RMOL_VERSION | \
sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'`
if test "x${rmol_minor_version}" = "x" ; then
rmol_minor_version=0
fi
rmol_micro_version=`echo $RMOL_VERSION | \
sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'`
if test "x${rmol_micro_version}" = "x" ; then
rmol_micro_version=0
fi
SAVED_CPPFLAGS="$CPPFLAGS"
SAVED_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $RMOL_CFLAGS"
LDFLAGS="$LDFLAGS $RMOL_LIBS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <rmol/RMOL_Service.hpp>
]],
[[int i=0;]]
)]
,
[AC_MSG_RESULT([yes ($RMOL_VERSION)])],
[
AC_MSG_ERROR([We could not compile a simple RMOL example. See config.log.])
]
)
CPPFLAGS="$SAVED_CPPFLAGS"
LDFLAGS="$SAVED_LDFLAGS"
fi
])