-
Notifications
You must be signed in to change notification settings - Fork 0
/
extracc.m4
69 lines (55 loc) · 1.92 KB
/
extracc.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
#
# Configure path for the EXTRACC library.
# Denis Arnaud <[email protected]>, July 2008
#
# Note: as the EXTRACC library depends upon BOOST to build,
# your configure.ac must define appropriately the BOOST_CFLAGS
# variable.
#
AC_DEFUN([AM_PATH_EXTRACC],
[
AC_LANG_SAVE
AC_LANG([C++])
AC_ARG_WITH(extracc,
[ --with-extracc=PFX Prefix where EXTRACC is installed (optional, default /usr/local)],
extracc_dir_check="$withval",
extracc_dir_check="/usr/local /usr")
AC_MSG_CHECKING([for Extracc configuration script])
extracc_dir=
for m in $extracc_dir_check
do
echo "test $m"
if test -x "$m/bin/extracc-config"
then
extracc_dir=$m
break
fi
done
EXTRACC_CONFIG="$extracc_dir/bin/extracc-config"
AS_IF([test -x "$EXTRACC_CONFIG"],
[],
[AC_MSG_FAILURE([--with-extracc must be a valid directory where EXTRACC is installed (default /usr/local /usr)])])
EXTRACC_VERSION=`$EXTRACC_CONFIG --version`
EXTRACC_CFLAGS=`$EXTRACC_CONFIG --cflags`
EXTRACC_LIBS=`$EXTRACC_CONFIG --libs`
AC_SUBST([EXTRACC_VERSION])
AC_SUBST([EXTRACC_CFLAGS])
AC_SUBST([EXTRACC_LIBS])
EXTRACC_EXTRACPPUNIT_INCLUDE=`$EXTRACC_CONFIG --extracppunit-makefile-include`
AC_SUBST([EXTRACC_EXTRACPPUNIT_INCLUDE])
extracc_major_version=`echo $EXTRACC_VERSION | sed 's/^\([[0-9]]*\).*/\1/'`
if test "x${extracc_major_version}" = "x" ; then
extracc_major_version=0
fi
extracc_minor_version=`echo $EXTRACC_VERSION | \
sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'`
if test "x${extracc_minor_version}" = "x" ; then
extracc_minor_version=0
fi
extracc_micro_version=`echo $EXTRACC_VERSION | \
sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'`
if test "x${extracc_micro_version}" = "x" ; then
extracc_micro_version=0
fi
AC_LANG_RESTORE
])