-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure
executable file
·93 lines (70 loc) · 2.58 KB
/
configure
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
echo ==== Configuring rbedrock R package ====
#### R CONFIGURATION ####
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo >&2 "Could not determine R_HOME"
exit 1
fi
CC=`"${R_HOME}/bin/R" CMD config CC` ; echo set CC=$CC ; export CC
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPICFLAGS=`"${R_HOME}/bin/R" CMD config CPICFLAGS`
CFLAGS="$CPPFLAGS $CPICFLAGS $CFLAGS"; echo set CFLAGS=$CFLAGS; export CFLAGS
CXX=`"${R_HOME}/bin/R" CMD config CXX` ; echo set CXX=$CXX ; export CXX
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
CXXPICFLAGS=`"${R_HOME}/bin/R" CMD config CXXPICFLAGS`
CXXFLAGS="$CPPFLAGS $CXXPICFLAGS $CXXFLAGS"; echo set CXXFLAGS=$CXXFLAGS; export CXXFLAGS
LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`; echo set LDFLAGS=$LDFLAGS; export LDFLAGS
if test -z "$CXX"; then
echo >&2 "Could not detect C++ compiler with R CMD config."
fi
AR=`"${R_HOME}/bin/R" CMD config AR`
AR=`which $AR`
RANLIB=`"${R_HOME}/bin/R" CMD config RANLIB`
RANLIB=`which $RANLIB`
#### CMAKE CONFIGURATION ####
if test -z "$CMAKE_BIN"; then
# Look for a cmake binary in the current path
CMAKE_BIN=`which cmake 2>/dev/null`
fi
if test -z "$CMAKE_BIN"; then
# Check for a MacOS specific path
CMAKE_BIN=`which /Applications/CMake.app/Contents/bin/cmake 2>/dev/null`
fi
if test -z "$CMAKE_BIN"; then
echo ""
echo "------------------ CMAKE NOT FOUND --------------------"
echo ""
echo "CMake was not found on the PATH. Please install CMake:"
echo ""
echo " - yum install cmake (Fedora/CentOS; inside a terminal)"
echo " - apt install cmake (Debian/Ubuntu; inside a terminal)."
echo " - pacman -S cmake (Arch Linux; inside a terminal)."
echo " - brew install cmake (MacOS; inside a terminal with Homebrew)"
echo " - port install cmake (MacOS; inside a terminal with MacPorts)"
echo ""
echo "Alternatively install CMake from: <https://cmake.org/>"
echo ""
echo "-------------------------------------------------------"
echo ""
exit 1
fi
echo set CMAKE_BIN=$CMAKE_BIN
echo ==== Configuring src/leveldb-mcpe via CMake ====
build_dir=src/leveldb-mcpe/build
(mkdir -p "${build_dir}" &&
cd "${build_dir}" &&
"${CMAKE_BIN}" -G "Unix Makefiles" .. \
"-DCMAKE_AR=${AR}" \
"-DCMAKE_RANLIB=${RANLIB}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:bool=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE:bool=ON \
-DCMAKE_VERBOSE_MAKEFILE:bool=ON \
-DLEVELDB_BUILD_TESTS:BOOL=OFF \
-DLEVELDB_INSTALL:BOOL=OFF \
-Wno-dev
)
if test $? -ne 0 ; then
exit 1
fi