-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·46 lines (41 loc) · 1.45 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
#!/bin/sh
if test -z "$CMAKE"; then CMAKE="`which cmake`"; fi
if test -z "$CMAKE"; then CMAKE=/Applications/CMake.app/Contents/bin/cmake; fi
if ! test -f "$CMAKE"; then echo "no ‘cmake’ command found"; exit 1; fi
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
RCC=`"${R_HOME}/bin/R" CMD config CC`
CC=${RCC%% *}
RCC=${RCC#$CC}
EXTRACFLAGS=$(echo "$RCC"| sed -e "s/-std=[^ ]\{0,\}//")
RCXX=`"${R_HOME}/bin/R" CMD config CXX`
CXX=${RCXX%% *}
RCXX=${RCXX#$CXX}
EXTRACXXFLAGS=$(echo "$RCXX"| sed -e "s/-std=[^ ]\{0,\}//")
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
R_LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`
R_SHLDFLAGS=`"${R_HOME}/bin/R" CMD config SHLIB_LDFLAGS`
FC=`"${R_HOME}/bin/R" CMD config FC`
FLIBS=`"${R_HOME}/bin/R" CMD config FLIBS`
R_SHLIB_EXT=`"${R_HOME}/bin/R" CMD config SHLIB_EXT`
CFLAGS="$CPPFLAGS $CFLAGS $EXTRACFLAGS"
CXXFLAGS="$CPPFLAGS $CXXFLAGS $EXTRACXXFLAGS"
#LDFLAGS="$R_LDFLAGS $R_SHLDFLAGS"
cd src
$CMAKE ../tools \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS_INIT="" \
-DCMAKE_CXX_FLAGS_INIT="" \
-DCMAKE_POSITION_INDEPENDENT_CODE:bool=ON \
-DCMAKE_C_COMPILER="$CC" \
-DCMAKE_CXX_COMPILER="$CXX" \
-DR_HOME="$R_HOME" \
-DR_SHLIB_EXT="$R_SHLIB_EXT" \
-DPASSTHROUGH_CONFIGURE_ARGS="$*" \
${CMAKE_ARGS}
echo "" >> _deps/highfive-src/include/highfive/bits/H5Friends.hpp