-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.win
62 lines (43 loc) · 2.06 KB
/
configure.win
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
#!/bin/sh +x
#cp inst/CppCode/*.cpp src
cp inst/CppCode/dists.cpp src
cp inst/CppCode/RcppUtils.cpp src
cp inst/CppCode/nimbleGraph.cpp src
cp inst/CppCode/eigenUsingClasses.cpp src
if test -r src/Makevars.win ; then
cp src/Makevars.win src/Makevars
fi
echo "R_PACKAGE_DIR: $R_PACKAGE_DIR"
sed -e "s!@NIMBLE_HOME@!${R_PACKAGE_DIR}!" inst/make/Makevars.win.in > inst/make/Makevars.win
sed -e "s!@EIGEN_INC@!!" inst/CppCode/Makevars.in > inst/CppCode/Makevars
sed -e 's!@NEED_MAKEVARS_FILE@!TRUE!' R/config.R.in |
sed -e 's|@R_ENABLE_LIB@|FALSE|' |
sed -e 's|@EIGEN_INC@||' |
sed -e "s|@R_PACKAGE_DIR@|${R_PACKAGE_DIR}|" |
sed -e 's|@RPATH@||' |
sed -e 's|@USE_REGISTRATION@|.NimbleUseRegistration = TRUE|' > R/config.R
## These sed lines aren't really needed because there is no longer anything
## dynamic we do here. But it remains in place here in case we make it dynamic in the future.
sed -e "s|@EIGEN_INC@||" inst/make/Makevars.win.in |
sed -e "s|@CPPAD_INC@||" inst/make/Makevars.win.in |
sed -e "s|@NIMBLE_INC_DIR@|TO_BE_FILLED_IN_BY_LOCAL_MAKEVARS|" |
sed -e "s|@NIMBLE_LIB_DIR@|TO_BE_FILLED_IN_BY_LOCAL_MAKEVARS|" > inst/Make/Makevars.win
# sed -e "s|@EIGEN_INC@|$R_PACKAGE_DIR/include|" inst/make/Makevars.win.in |
# sed -e "s|@NIMBLE_INC_DIR@|$R_PACKAGE_DIR/include|" |
# sed -e "s|@NIMBLE_LIB_DIR@|$R_PACKAGE_DIR/CppCode|" > inst/Make/Makevars.win
echo "R_HOME = $R_HOME, R_ARCH=$R_ARCH"
ARCH_SUFFIX=`echo ${R_ARCH} | sed -e s!/!_!`
#if test "$R_ARCH" = "/x64" ; then
# ARCH_SUFFIX="64"
#elif test "$R_ARCH" = "/i386" ; then
# ARCH_SUFFIX="32"
#fi
echo "Creating inst/CppCode/libnimble${ARCH_SUFFIX}.a"
(cd inst/CppCode ; make -f "${R_HOME}/etc${R_ARCH}/Makeconf" -f GNUmakefile libnimble${ARCH_SUFFIX}.a ARCH_SUFFIX=${ARCH_SUFFIX} OS=Windows R_ARCH=$R_ARCH)
if test -d "$R_PACKAGE_DIR/CppCode" ; then
echo "Package CppCode directory exists"
ls "$R_PACKAGE_DIR"
cp inst/CppCode/libnimble${ARCH_SUFFIX}.a "$R_PACKAGE_DIR/CppCode/"
else
echo "The R package directory has not been created yet"
fi