-
Notifications
You must be signed in to change notification settings - Fork 30
/
configure.ac
212 lines (189 loc) · 4.9 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
207
208
209
210
211
212
AC_INIT(config, version-0.1)
# Check for cc
AC_PROG_CC
AC_LANG(C)
AC_DISABLE_OPTION_CHECKING
# Check for scheduling
AC_CHECK_HEADER(linux/sched.h,,,)
AC_CHECK_HEADER(pcap/pcap.h,,,)
AC_CHECK_HEADER(pthread.h,,,)
AC_CHECK_LIB(m, cos)
# Check if libreadline exists
a=1
AC_CHECK_LIB(readline, readline,,[a=0],)
if test $a == 1
then
AC_SUBST(USEREADLINE, 1)
fi
# Check if libbroker exists
#a=1
#AC_CHECK_LIB(broker,broker_init,,[a=0],)
#if test $a == 1
#then
# AC_SUBST(USEBROKER, 1)
#fi
# Check lua-5.1 path (lib & inc)
AC_ARG_WITH(stuff, [ --with-lua-lib path to the liblua5.1 install root])
if test "$with_lua_lib" != ""
then
AC_SUBST(LUALIBPATH, $with_lua_lib)
else
if echo `uname` | grep -q "FreeBSD"
then
AC_SUBST(LUALIBPATH, /usr/local/lib)
fi
if echo `uname` | grep -q "Linux"
then
AC_SUBST(LUALIBPATH, /usr/lib)
fi
fi
a=1
AC_CHECK_LIB(lua-5.1,lua_close,,[a=0],)
if test $a == 1
then
AC_SUBST(LIBLUANAME, -llua-5.1)
else
b=1
AC_CHECK_LIB(lua5.1,lua_close,,[b=0],)
if test $b == 1
then
AC_SUBST(LIBLUANAME, -llua5.1)
fi
fi
#AC_CHECK_LIB(lua5.1,lua_close,,[a=0],)
#if test $a == 1
#then
# AC_SUBST(LIBLUANAME, -llua5.1)
#fi
AC_ARG_WITH(stuff, [ --with-lua-include path to the lua5.1 header install root])
if test "$with_lua_include" != ""
then
AC_SUBST(LUAINCPATH, $with_lua_include)
else
if echo `uname` | grep -q "FreeBSD"
then
AC_SUBST(LUAINCPATH, /usr/local/include/lua51)
fi
if echo `uname` | grep -q "Linux"
then
AC_SUBST(LUAINCPATH, /usr/include/lua5.1)
fi
fi
AC_ARG_WITH(stuff, [ --with-broker-include path to the broker header install root])
if test "$with_broker_include" != ""
then
AC_SUBST(BROKERINCPATH, $with_broker_include)
AC_SUBST(USEBROKER, 1)
fi
AC_ARG_WITH(stuff, [ --with-broker-lib path to the broker library install root])
if test "$with_broker_lib" != ""
then
AC_SUBST(BROKERLIBPATH, $with_broker_lib)
AC_SUBST(USEBROKER, 1)
fi
a=1
# Check whether lua-5.1 exists
AC_CHECK_HEADER($LUAINCPATH/lua.h,[AC_DEFINE(HAVE_LUA_H, 1)],[a=0],
[[
#if HAVE_LUA_H
#include <lua5.1/lua.h>
#endif
]])
if test $a == 0
then
AC_MSG_ERROR([lua.h is missing. Please install lua-5.1 development library.])
fi
# Check if the user wants to use libjemalloc
AC_ARG_WITH(stuff, [ --with-jemalloc-include path to the jemalloc header install root])
if test "$with_jemalloc_include" != ""
then
AC_SUBST(JEINCPATH, $with_jemalloc_include)
fi
# Check if the path to to libjemalloc is valid
a=1
# Check whether lua-5.1 exists
AC_CHECK_HEADER($JEINCPATH/jemalloc.h,[AC_DEFINE(HAVE_JEMALLOC_H, 1)],[a=0],
[[
#if HAVE_JEMALLOC_H
#include <jemalloc/jemalloc.h>
#endif
]])
if test $a == 0
then
AC_MSG_WARN([jemalloc.h not found.])
fi
# Check if `install' exists
AC_CHECK_PROG(INSTALL_CHECK,install,yes)
if test x"$INSTALL_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `install'.])
else
AC_SUBST(INSTALL, "install -c")
AC_SUBST(INSTALL_PROGRAM, "install -c")
AC_SUBST(INSTALL_DATA, "install -m 644")
fi
# Check if gzip exists
AC_CHECK_PROG(GZIP_CHECK,gzip,yes)
if test x"$GZIP_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `gzip'.])
fi
# Check if gunzip exists
AC_CHECK_PROG(GUNZIP_CHECK,gunzip,yes)
if test x"$GUNZIP_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `gunzip'.])
fi
# Check if bash exists
AC_CHECK_PROG(BASH_CHECK,bash,yes)
if test x"$BASH_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `bash'.])
fi
# Check if env exists
AC_CHECK_PROG(ENV_CHECK,env,yes)
if test x"$ENV_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `env'.])
fi
AC_OUTPUT(Makefile)
AC_OUTPUT(src/Makefile)
if echo `uname` | grep -q "FreeBSD"
then
# Check if `gmake' exists
AC_CHECK_PROG(GMAKE_CHECK,gmake,yes)
if test x"$GMAKE_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `gmake'.])
fi
# Check if `makewhatis' exists
AC_CHECK_PROG(MAKEWHATIS_CHECK,makewhatis,yes)
if test x"$MAKEWHATIS_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `makewhatis'.])
fi
# Check if `gmake' exists
AC_CHECK_PROG(GMAKE_CHECK,gmake,yes)
if test x"$GMAKE_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `gmake'.])
fi
AC_OUTPUT(src/FreeBSD/Makefile)
fi
if echo `uname` | grep -q "Linux"
then
# Check if `make' exists
AC_CHECK_PROG(MAKE_CHECK,make,yes)
if test x"$MAKE_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `make'.])
fi
# Check if `mandb' exists
AC_CHECK_PROG(MANDB_CHECK,mandb,yes)
if test x"$MANDB_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `mandb'.])
fi
# Check if `make' exists
AC_CHECK_PROG(MAKE_CHECK,make,yes)
if test x"$MAKE_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install `make'.])
fi
AC_OUTPUT(src/Linux/Makefile)
fi
AC_OUTPUT(src/bricks/Makefile)
AC_OUTPUT(scripts/load-balance.lua)
AC_OUTPUT(scripts/duplicate.lua)
AC_OUTPUT(scripts/startup-one-thread.lua)
AC_OUTPUT(scripts/startup-multi-threads.lua)
AC_MSG_NOTICE([Type 'gmake' to compile and 'gmake install' to install the tool. Send feedback to [email protected].])