-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfigure.in
77 lines (66 loc) · 1.9 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gdal_rcpp.cpp)
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
CC=`"${R_HOME}/bin/R" CMD config CC`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
CPP=`"${R_HOME}/bin/R" CMD config CPP`
CXX=`"${R_HOME}/bin/R" CMD config CXX`
CXXCPP=`"${R_HOME}/bin/R" CMD config CXXCPP`
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
CXXPICFLAGS=`"${R_HOME}/bin/R" CMD config CXXPICFLAGS`
if test `gdal-config --version`
then
GDAL_CPPFLAGS=`gdal-config --cflags`
GDAL_LIBS=`gdal-config --libs`
else
echo ''
echo 'I was unable to find the gdal-config script distributed with'
echo 'GDAL. If you have not installed the GDAL libraries, you can'
echo 'download the source from http://www.remotesensing.org/gdal/'
echo 'If you have installed the GDAL libraries, then make sure that'
echo 'gdal-config is in your path. Try typing gdal-config at a'
echo 'shell prompt and see if it runs. If not, find it and add its'
echo 'path to your shell path.'
echo ''
exit 1
fi
#if test ! -e src/RcppExports.cpp
#then
${R_HOME}/bin/Rscript -e "Rcpp:::compileAttributes()"
#fi
if test ! -e src/RcppExports.cpp
then
echo ''
echo 'For some reason Rcpp is not working.'
echo 'Is it installed?'
echo ''
exit 1
fi
if test ! -e man/rgdal2-package.Rd
then
${R_HOME}/bin/Rscript -e "roxygen2:::roxygenize()"
fi
if test ! -e man/rgdal2-package.Rd
then
echo ''
echo 'For some reason roxygen2 is not working.'
echo 'Is it installed?'
echo ''
exit 1
fi
RCPP_LIBS=`${R_HOME}/bin/Rscript -e "Rcpp:::LdFlags()"`
PKG_CPPFLAGS=$GDAL_CPPFLAGS
PKG_LIBS="$RCPP_LIBS $GDAL_LIBS"
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(double)
AC_SUBST(PKG_CPPFLAGS)
AC_SUBST(PKG_LIBS)
AC_SUBST(SIZEOF_INT)
AC_SUBST(SIZEOF_DOUBLE)
AC_CONFIG_HEADERS(src/pkg_config.h)
AC_OUTPUT(src/Makevars)