-
Notifications
You must be signed in to change notification settings - Fork 27
/
configure
executable file
·61 lines (54 loc) · 1.91 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
#!/bin/sh
CC=$(${R_HOME}/bin/R CMD config CC)
CXX=$(${R_HOME}/bin/R CMD config CXX)
CXXFLAGS=$(${R_HOME}/bin/R CMD config CXXFLAGS)
CPPFLAGS=$(${R_HOME}/bin/R CMD config CPPFLAGS)
if [ -z "$CLUSTERMQ_USE_SYSTEM_LIBZMQ" ]; then
if $($CC -o test_libzmq src/util/test_libzmq.c $(pkg-config --cflags --libs libzmq) >/dev/null 2>&1); then
echo "* system has libzmq -> linking system library"
if $(./test_libzmq 2>/dev/null); then
echo "* libzmq has DRAFT API -> enabling crash monitor feature"
CLUSTERMQ_USE_SYSTEM_LIBZMQ=1
else
echo "* libzmq without DRAFT API found -> disabling crash monitor feature"
CLUSTERMQ_USE_SYSTEM_LIBZMQ=1
fi
else
echo "* no system libzmq>=4.3.0 found -> using bundled libzmq"
CLUSTERMQ_USE_SYSTEM_LIBZMQ=0
fi
rm -f test_libzmq
fi
if ! $($CXX -o test_cpp11 src/util/test_cpp11.cpp >/dev/null 2>&1); then
echo "ERROR: compiler needs full c++11 support (gcc>=5, clang>=3.3) -> check 'cc --version'"
exit 1
fi
rm -f test_cpp11
if [ "$CLUSTERMQ_USE_SYSTEM_LIBZMQ" -eq "0" ]; then
PKG_CFLAGS="-DZMQ_STATIC -DZMQ_BUILD_DRAFT_API=1 -fPIC -Ilibzmq/include -Icppzmq"
PKG_LIBS="libzmq/src/.libs/libzmq.a"
./src/util/patch_libzmq.sh
if [ ! -f src/libzmq/src/.libs/libzmq.a ]; then
cd src/libzmq
CXX="$CXX" CXXFLAGS="$CXXFLAGS -fPIC" CPPFLAGS="$CPPFLAGS" ./configure \
--enable-drafts \
--enable-static \
--disable-shared \
--disable-maintainer-mode \
--disable-Werror \
--disable-libbsd \
--disable-libunwind \
--disable-perf \
--disable-curve \
--disable-curve-keygen \
--disable-ws \
--disable-radix-tree \
--without-docs
make || exit 1
cd -
fi
else
PKG_CFLAGS="$(pkg-config --cflags libzmq) -fPIC -Icppzmq"
PKG_LIBS="$(pkg-config --libs libzmq)"
fi
sed -e "s|@cflags@|$PKG_CFLAGS|" -e "s|@libs@|$PKG_LIBS|" src/Makevars.in > src/Makevars