-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
292 lines (245 loc) · 6.22 KB
/
configure.in
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
dnl configure script for the stormav project
dnl Copyright (C) 2007 The StormAV Project
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
AC_INIT(src/iyelld/main.c)
PACKAGE_NAME=iyell
PACKAGE_VERSION=0.7.3
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
AC_CONFIG_HEADERS(src/include/config.h)
AC_PROG_CC
AM_PROG_CC_C_O
AC_C_INLINE
AC_DEFUN([AC_PROG_CXX], [])
AC_DEFUN([AC_PROG_F77], [])
dnl
dnl flags
dnl Add -Wall and friends if we are using GCC.
dnl
AC_SUBST(AM_CFLAGS)
AC_SUBST(CPPFLAGS)
AC_C_CONST
dnl
dnl types check
dnl
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT8_T
AC_CHECK_TYPE(u_char, unsigned char)
AC_CHECK_TYPE(u_short, unsigned short)
AC_CHECK_TYPE(u_long, unsigned long)
dnl
dnl headers check
dnl
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([inttypes.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([strings.h])
AC_CHECK_HEADERS([syslog.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([unistd.h])
dnl
dnl fonctions check
dnl
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_VPRINTF
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([asprintf])
AC_CHECK_FUNCS([bzero])
AC_CHECK_FUNCS([dup2])
AC_CHECK_FUNCS([gethostbyname])
AC_CHECK_FUNCS([inet_ntoa])
AC_CHECK_FUNCS([localtime_r])
AC_CHECK_FUNCS([memchr])
AC_CHECK_FUNCS([memmove])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([mkfifo])
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNCS([strsep])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([strtol])
AC_CHECK_FUNCS([uname])
dnl
dnl paths
dnl
libexecdir='${exec_prefix}/libexec/iyell'
dnl strtok_r specific checks
AC_CHECK_FUNC(strtok_r, [
AC_DEFINE(HAVE_STRTOK_R, [], ["Define to 1 if you have the `strtok_r' function."])
ac_found_strtok_r=yes
], [
HAVE_STRTOK_R="# "
])
AC_SUBST(HAVE_STRTOK_R)
if test "$ac_found_strtok_r" = "yes"; then
AC_MSG_CHECKING(if strtok_r declaration requires -D__EXTENSIONS__)
AC_EGREP_HEADER(strtok_r, string.h, [
AC_MSG_RESULT(no)
], [
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$ac_save_cppflags -D__EXTENSIONS__"
AC_EGREP_HEADER(strtok_r, string.h, [
ac_save_cppflags=
AC_MSG_RESULT(yes)
], [
CPPFLAGS="$ac_save_cppflags"
AC_MSG_RESULT(still can't find it)
])
])
fi
dnl
dnl structures checks
dnl
AC_STRUCT_TM
dnl
dnl enable / disable debug
dnl
AC_ARG_ENABLE(debug,
[ --enable-debug specify you are building with debugging on],
AM_CFLAGS="-W -Wall -std=c99 -pedantic -g3" ,
AM_CFLAGS="-W -Wall -std=c99 -pedantic -DNDEBUG"
)
AC_SUBST(AM_CFLAGS)
AC_ARG_ENABLE(quotes,
[ --enable-quotes enable quotes hook],
enable_quotes=yes, enable_quotes=no
)
dnl solaris needs -lsocket -lnsl
AC_SEARCH_LIBS(socket,socket)
AC_SEARCH_LIBS(getnameinfo,nsl socket)
AC_SEARCH_LIBS(inet_ntoa,nsl socket)
dnl
dnl Check for OpenSSL
dnl
AC_ARG_WITH(crypto,
[ --with-crypto=PATH Use libcrypto in PATH],
[
if test -d "$withval"; then
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
]
)
AC_CHECK_HEADER(openssl/rc4.h,
AC_CHECK_LIB(crypto, RC4, ,
AC_MSG_ERROR([*** libcrypto not found - cannot continue ***])
)
AC_CHECK_LIB(crypto, AES_encrypt,
AC_DEFINE(HAVE_AES_ENCRYPT,[],[having AES_encrypt()])
),
AC_MSG_ERROR([*** libcrypto not found - cannot continue ***])
)
AC_ARG_WITH(openssl,
[ --with-openssl=PATH Use openssl in PATH],
[
if test -d "$withval"; then
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
]
)
AC_CHECK_HEADER(openssl/ssl.h,
AC_CHECK_LIB(ssl, SSL_library_init, ,
AC_MSG_WARN([*** OpenSSL not found - ssl support disabled ***])
),
AC_MSG_WARN([*** OpenSSL not found - ssl support disabled ***])
)
dnl
dnl libevent
dnl
AC_ARG_WITH(libevent,
[ --with-libevent=PATH Use libevent in PATH],
[
if test -d "$withval"; then
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
]
)
AC_CHECK_HEADER(event.h,
AC_CHECK_LIB(event, event_init, ,
AC_MSG_ERROR([*** libevent not found - cannot continue ***])
)
AC_CHECK_LIB(event, event_loopbreak,
AC_DEFINE(HAVE_EVENT_LOOPBREAK,[],[having event_loopbreak()]))
AC_CHECK_LIB(event, evbuffer_add_vprintf, ,
AC_MSG_ERROR([*** libevent >= 1.3 not found - cannot continue ***])
),
AC_MSG_ERROR([*** libevent not found - cannot continue ***])
)
dnl
dnl sqlite3
dnl
if test "$enable_quotes" = yes; then
AC_ARG_WITH(libsqlite3,
[ --with-libsqlite3=PATH Use libsqlite3 in PATH],
[
if test -d "$withval"; then
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
]
)
AC_CHECK_HEADER(sqlite3.h,
AC_CHECK_LIB(sqlite3, sqlite3_open, ,
AC_MSG_WARN([*** sqlite3 not found - quotes hook disabled ***])
),
AC_MSG_WARN([*** sqlite3 not found - quotes hook disabled ***])
)
fi
dnl
dnl Set PACKAGE_SYSCONF_DIR in config.h.
dnl
if test "x${prefix}" = "xNONE"; then
PACKAGE_SYSCONF_DIR="${ac_default_prefix}/etc/"
else
PACKAGE_SYSCONF_DIR="${prefix}/etc/"
fi
AC_DEFINE_UNQUOTED(PACKAGE_SYSCONF_DIR, "$PACKAGE_SYSCONF_DIR",
[The directory in which the configuration will be stored])
dnl
dnl Create Makefiles
dnl
if test "$enable_quotes" = yes; then
QUOTES=quotes
else
QUOTES=
fi
AC_SUBST([QUOTES])
AC_OUTPUT([Makefile\
etc/Makefile\
src/include/Makefile\
src/iyell/Makefile\
src/iyelld/Makefile\
src/quotes/Makefile\
src/Makefile]
)