forked from duncantl/SVGAnnotation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
60 lines (48 loc) · 1.79 KB
/
configure.in
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
AC_INIT(R/svg.R)
AC_ARG_WITH(cairo-package, [--with-cairo-package use the Cairo package rather than the svg() function in grDevices, regardless of whether svg() is available],[ FORCE_CAIRO_PKG=true; echo "Forcing the use of the Cairo package"])
AC_ARG_WITH(libcairo, [--with-libcairo force the use of the libcairo device and not the Cairo package],[ FORCE_CAIRO_PKG=true; echo "Forcing the use of the Cairo package"])
if ! test "${FORCE_CAIRO_PKG}" = "true" ; then
echo 'q(status = capabilities()[["cairo"]] == FALSE)' | $R_HOME/bin/R --vanilla --no-save --silent
OK="$?"
else
OK="1"
fi
if test "$OK" = 0 ; then
echo "***** Using R's own built-in svg() function (rather than the Cairo package)."
SYSTEM="libcairo"
PKG_DEPS="grDevices, "
USE_CAIRO_PKG="FALSE"
SVG_FUNCTION="svg"
AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_PATH_PROG(R_SCRIPT, Rscript, , [$R_HOME:$R_HOME/bin:$PATH])
if test -z "$PKG_CONFIG" ; then
# echo "Cannot test the version of libcairo as we cannot find pkg-config."
if test `uname` = "Darwin" ; then
CAIRO_VERSION=`$R_SCRIPT -e 'source("cairoVersion.R"); cat(determineCairoVersion(), "\\\\n", sep = "");q(status = 0)'`
if ! test "$?" = 0 ; then
CAIRO_VERSION="NA"
fi
CAIRO_VERSION_10=NA
else
CAIRO_VERSION="NA"
CAIRO_VERSION_10="NA"
fi
else
CAIRO_VERSION=`${PKG_CONFIG} --modversion cairo`
$PKG_CONFIG --atleast-version=1.10.0 cair0
CAIRO_VERSION_10=$?
fi
else
echo "***** Using the Cairo package."
PKG_DEPS="Cairo,"
SYSTEM=""
SVG_FUNCTION="CairoSVG"
USE_CAIRO_PKG="TRUE"
fi
AC_SUBST(SYSTEM)
AC_SUBST(PKG_DEPS)
AC_SUBST(USE_CAIRO_PKG)
AC_SUBST(SVG_FUNCTION)
AC_SUBST(CAIRO_VERSION)
AC_SUBST(CAIRO_VERSION_10)
AC_OUTPUT(DESCRIPTION R/config.R)