forked from mesos/mesos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
206 lines (187 loc) · 6.66 KB
/
configure.ac
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# Generated with autoscan, then modified appropriately.
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT
if test -z "$PYTHON"; then
PYTHON=python2.6
fi
# Update CFLAGS and CXXFLAGS with environment args.
CFLAGS="-O2 -fno-strict-aliasing -fPIC ${CFLAGS}"
CXXFLAGS="-O2 -fno-strict-aliasing -fPIC ${CXXFLAGS}"
export CFLAGS
export CXXFLAGS
# Update CFLAGS and CXXFLAGS in configure args.
# TODO(benh): Don't send args just for us (e.g., --with-webui).
ac_configure_args=`echo $ac_configure_args | \
sed -e "s/CFLAGS=/CFLAGS=-O2 -fno-strict-aliasing /"`
ac_configure_args=`echo $ac_configure_args | \
sed -e "s/CXXFLAGS=/CXXFLAGS=-O2 -fno-strict-aliasing /"`
ac_configure_args="$ac_configure_args --enable-shared=no --with-pic"
AC_CONFIG_FILES([Makefile
src/Makefile
src/examples/Makefile
src/examples/java/Makefile
src/examples/python/Makefile
src/tests/Makefile
src/config/config.hpp])
AC_CONFIG_SUBDIRS([third_party/libprocess])
AC_CONFIG_SUBDIRS([third_party/glog-0.3.1])
AC_CONFIG_SUBDIRS([third_party/gmock-1.5.0])
AC_CONFIG_SUBDIRS([third_party/zookeeper-3.3.1/src/c])
AC_CANONICAL_SYSTEM
UNSUPPORTED_OS="Mesos is currently unsupported on your platform."
case "${target_os}" in
linux*)
echo ===========================================================
echo Setting up build environment for ${target_cpu} ${target_os}
echo ===========================================================
OS_NAME=linux
;;
darwin*)
echo ===========================================================
echo Setting up build environment for ${target_cpu} ${target_os}
echo ===========================================================
OS_NAME=darwin
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE"
CXXFLAGS="${CXXFLAGS} -D_XOPEN_SOURCE"
;;
solaris*)
echo ===========================================================
echo Setting up build environment for ${target_cpu} ${target_os}
echo ===========================================================
CC=gcc-4.3.2
CXX=g++-4.3.2
export CC
export CXX
CFLAGS="${CFLAGS} -pthreads -march=i586"
CXXFLAGS="${CXXFLAGS} -pthreads -march=i586"
LIBS="-lsocket -lnsl -lproject -lproc"
OS_NAME=solaris
;;
*)
AC_MSG_ERROR($UNSUPPORTED_OS)
esac
# Export OS name to Makefiles
AC_SUBST(OS_NAME)
JAVA_HEADERS=""
AC_ARG_WITH([java-headers],
AC_HELP_STRING([--with-java-headers=DIR],
[find Java headers in DIR (if different from JAVA_HOME/include)]),
[case "$with_java_headers" in
yes)
AC_MSG_ERROR([
*** --with-java-headers requires an argument]) ;;
*)
JAVA_HEADERS="$withval"
;;
esac],
[])
AC_SUBST(JAVA_HEADERS)
JAVA_HOME=""
HAS_JAVA="0"
AC_ARG_WITH([java-home],
AC_HELP_STRING([--with-java-home=DIR],
[find Java Development Kit in DIR]),
[case "$with_java_home" in
yes)
AC_MSG_ERROR([
*** --with-java-home requires an argument]) ;;
*)
JAVA_HOME="$withval"
HAS_JAVA="1"
if test -z "$JAVA_HEADERS"; then
JAVA_HEADERS="$JAVA_HOME/include/$OS_NAME"
fi
;;
esac],
[])
AC_SUBST(JAVA_HOME)
AC_SUBST(HAS_JAVA)
PYTHON_HEADERS=""
PYTHON_LDFLAGS=""
HAS_PYTHON="0"
AC_ARG_WITH([python-headers],
AC_HELP_STRING([--with-python-headers=DIR],
[find Python headers in DIR]),
[case "$with_python_headers" in
yes)
AC_MSG_ERROR([
*** --with-python-headers requires an argument]) ;;
*)
PYTHON_HEADERS="$withval"
echo running $PYTHON to find compiler flags for creating the Mesos Python library...
PYTHON_LDFLAGS=`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var("LINKFORSHARED") + " -lpython" + sysconfig.get_config_var("VERSION")'`
HAS_PYTHON="1"
;;
esac],
[])
AC_SUBST(PYTHON_HEADERS)
AC_SUBST(PYTHON_LDFLAGS)
AC_SUBST(HAS_PYTHON)
WITH_WEBUI="0"
WEBUI_CFLAGS=""
WEBUI_CXXFLAGS=""
WEBUI_LDFLAGS=""
AC_ARG_WITH([webui],
AC_HELP_STRING([--with-webui],
[enable web UI (requires Python)]),
[case "$with_webui" in
yes) WITH_WEBUI="1"
echo running $PYTHON to find compiler flags for embedding it...
WEBUI_CFLAGS=`$PYTHON -c 'from distutils import sysconfig; print "-I" + sysconfig.get_config_var("INCLUDEPY")'`
WEBUI_CXXFLAGS=$WEBUI_CFLAGS
WEBUI_LDFLAGS=`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var("LINKFORSHARED") + " -lpython" + sysconfig.get_config_var("VERSION")'`
if [[ "$?" -ne "0" ]]; then
AC_MSG_ERROR([
*** Failed to determine compiler flags for embedding Python, needed by web UI.
*** Check that you have Python 2.6 development packages installed.])
fi ;;
no) WITH_WEBUI="0" ;;
*) AC_MSG_ERROR([
*** --with-webui does not take arguments]) ;;
esac],
[])
AC_SUBST(WITH_WEBUI)
AC_SUBST(WEBUI_CFLAGS)
AC_SUBST(WEBUI_CXXFLAGS)
AC_SUBST(WEBUI_LDFLAGS)
SWIG="swig"
AC_ARG_WITH([swig],
AC_HELP_STRING([--with-swig=PATH],
[use the SWIG binary at PATH]),
[case "$with_swig" in
yes) AC_MSG_ERROR([
*** --with-swig requires an argument]) ;;
*) SWIG="$withval" ;;
esac],
[])
AC_SUBST(SWIG)
WITH_ZOOKEEPER="0"
AC_ARG_WITH([zookeeper],
AC_HELP_STRING([--with-zookeeper],
[use ZooKeeper support]),
[case "$with_zookeeper" in
yes) WITH_ZOOKEEPER="1" ;;
no) WITH_ZOOKEEPER="0" ;;
*) AC_MSG_ERROR([
*** --with-zookeeper does not take arguments]) ;;
esac],
[])
AC_SUBST(WITH_ZOOKEEPER)
WITH_INCLUDED_ZOOKEEPER="0"
AC_ARG_WITH([included-zookeeper],
AC_HELP_STRING([--with-included-zookeeper],
[build with included ZooKeeper]),
[case "$with_included_zookeeper" in
yes) WITH_ZOOKEEPER="1"
WITH_INCLUDED_ZOOKEEPER="1" ;;
no) WITH_INCLUDED_ZOOKEEPER="0" ;;
*) AC_MSG_ERROR([
*** --with-included-zookeeper does not take arguments]) ;;
esac],
[])
AC_SUBST(WITH_INCLUDED_ZOOKEEPER)
# Checks for programs.
AC_PROG_CXX([g++])
AC_PROG_CC([gcc])
AC_OUTPUT