-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
385 lines (339 loc) · 10.8 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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
dnl Process this file with autoconf to produce a configure script.
AC_INIT([clearsilver], [0.10.6])
AC_CONFIG_MACRO_DIR([m4])
dnl get info on host
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_CANONICAL_TARGET
dnl init automake
AM_INIT_AUTOMAKE([foreign])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_CHECK_PROGS(AR, ar aal, ar)
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
dnl Checks for Neotonic Paths
AC_MSG_CHECKING(for Neotonic Paths)
if test -d /neo/opt/include; then
AC_MSG_RESULT(found)
CPPFLAGS="$CPPFLAGS -I/neo/opt/include"
LDFLAGS="$LDFLAGS -L/neo/opt/lib"
else
AC_MSG_RESULT(not found)
fi
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h stdarg.h varargs.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h features.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_CHECK_FUNCS(gettimeofday mktime putenv strerror strspn strtod strtol strtoul)
AC_CHECK_FUNCS(random rand drand48)
dnl Check for locks and pthread
cs_cv_have_lockf=no
AC_CHECK_FUNC(lockf, [
cs_cv_have_lockf=yes
AC_DEFINE(HAVE_LOCKF, 1, [Define to 1 if system have lockf function])
])
cs_cv_have_pthread=no
AC_CHECK_HEADER(pthread.h, [
cs_cv_have_pthread=yes
AC_DEFINE(HAVE_PTHREADS, 1, [Define to 1 if system have pthreads])
])
dnl Check build platform
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
os_win32=yes
;;
*)
os_win32=no
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
dnl Check for snprintf and vsnprintf
cs_cv_have_snprintf=no
AC_CHECK_FUNC(snprintf, [
cs_cv_have_snprintf=yes
AC_DEFINE(HAVE_SNPRINTF, 1, [Define to 1 if system have snprintf function])
])
cs_cv_have_vsnprintf=no
AC_CHECK_FUNC(vsnprintf, [
cs_cv_have_vsnprintf=yes
AC_DEFINE(HAVE_VSNPRINTF, 1, [Define to 1 if system have vsnprintf function])
])
dnl Check for missing re-entrant functions
cs_cv_missing=no
cs_cv_need_reentrant=no
cs_cv_have_localtime_r=no
AC_CHECK_FUNCS(localtime_r, [
AC_MSG_CHECKING(whether localtime_r is declared)
AC_EGREP_CPP(localtime_r,[
#include <time.h>],[
cs_cv_have_localtime_r=yes
AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define to 1 if system have localtime_r function])
AC_MSG_RESULT(yes)],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared)
AC_EGREP_CPP(localtime_r,[
#define _REENTRANT
#include <time.h>],[
cs_cv_need_reentrant=yes
AC_MSG_RESULT(yes)],[
cs_cv_missing=yes
AC_MSG_RESULT(no)])])], [cs_cv_missing=yes])
cs_cv_have_gmtime_r=no
AC_CHECK_FUNCS(gmtime_r, [
AC_MSG_CHECKING(whether gmtime_r is declared)
AC_EGREP_CPP(gmtime_r,[
#include <time.h>],[
cs_cv_have_gmtime_r=yes
AC_DEFINE(HAVE_GMTIME_R, 1, [Define to 1 if system have gmtime_r function])
AC_MSG_RESULT(yes)],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether gmtime_r with -D_REENTRANT is declared)
AC_EGREP_CPP(gmtime_r,[
#define _REENTRANT
#include <time.h>],[
cs_cv_need_reentrant=yes
AC_MSG_RESULT(yes)],[
cs_cv_missing=yes
AC_MSG_RESULT(no)])])], [cs_cv_missing=yes])
cs_cv_have_strtok_r=no
AC_CHECK_FUNCS(strtok_r, [
AC_MSG_CHECKING(whether strtok_r is declared)
AC_EGREP_CPP(strtok_r,[
#include <string.h>],[
cs_cv_have_strtok_r=yes
AC_DEFINE(HAVE_STRTOK_R, 1, [Define to 1 if system have strtok_r function])
AC_MSG_RESULT(yes)],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether strtok_r with -D_REENTRANT is declared)
AC_EGREP_CPP(strtok_r,[
#define _REENTRANT
#include <string.h>],[
cs_cv_need_reentrant=yes
AC_MSG_RESULT(yes)],[
cs_cv_missing=yes
AC_MSG_RESULT(no)])])], [cs_cv_missing=yes])
cs_cv_have_mkstemp=no
AC_CHECK_FUNC(mkstemp, [
cs_cv_have_mkstemp=yes
AC_DEFINE(HAVE_MKSTEMP, 1, [Define to 1 if system have mkstemp function])
], [cs_cv_missing=yes])
cs_cv_have_regexec=no
AC_CHECK_FUNC(regexec, [
cs_cv_have_regexec=yes
AC_DEFINE(HAVE_REGEX, 1, [Define to 1 if system have regexec function])
CPPFLAGS="$CPPFLAGS -I\$(NEOTONIC_ROOT)/util/regex"
])
if test "x$cs_cv_need_reentrant" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
fi
dnl wdb option
AC_ARG_ENABLE(wdb, [ --enable-wdb Enables building of wdb])
if test "$enable_wdb" = "yes"; then
AC_SEARCH_LIBS([db_open], [db db2], [], [AC_MSG_ERROR([No found db_open() in lib db])])
AC_MSG_RESULT(Enabling WDB support)
AC_DEFINE(ENABLE_WDB, 1, [Define to 1 to enable wdb support])
fi
dnl html compression option
AC_ARG_ENABLE(compression, [ --enable-compression Enables HTML Compression support])
if test "$enable_compression" = "yes"; then
AC_SEARCH_LIBS([deflate], [z], [], [AC_MSG_ERROR([Unable to find deflate() in lib z])])
AC_MSG_RESULT(Enabling HTML Compression support)
AC_DEFINE(ENABLE_COMPRESSION, 1, [Define to 1 to enable html compression])
LIBS="$LIBS -lz"
fi
dnl remote debug option
AC_ARG_ENABLE(remote-debugger, [ --enable-remote-debugger Enables remote X CGI debugging])
if test "$enable_remote_debugger" = "yes"; then
AC_MSG_RESULT(Enabling CGI X Remote debugger)
AC_DEFINE(ENABLE_REMOTE_DEBUGGER, 1, [Define to 1 to enable remote debug])
fi
dnl gettext option
AC_ARG_ENABLE(gettext, [ --enable-gettext Enables gettext message translation])
if test "$enable_gettext" = "yes"; then
AC_CHECK_FUNC(gettext, [], [AC_MSG_ERROR([No found gettext()])])
AC_CHECK_HEADER(libintl.h, [], [AC_MSG_ERROR([No found libintl.h])])
AC_DEFINE(ENABLE_GETTEXT, 1, [Define to 1 to enable gettext support])
fi
dnl apache options
AC_ARG_ENABLE(apache, [ --enable-apache Enables building of apache 1.3.x module])
if test "x$enable_apache" = "xyes"; then
CHECK_APACHE([1.3.0],,:,:, AC_MSG_ERROR([No found Apache >= 1.3.0]))
fi
dnl python options
AC_ARG_ENABLE(python, [ --enable-python Enables building of python module])
if test "x$enable_python" = "xyes"; then
AM_PATH_PYTHON(2.2)
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
fi
dnl perl options
AC_ARG_ENABLE(perl, [ --enable-perl Enables building of perl module])
AC_ARG_WITH(perl, [ --with-perl=path Set location of Perl binary], [cs_cv_perl_path="$withval"], [cs_cv_perl_path=no])
if test "x$enable_perl" = "xyes"; then
AC_MSG_RESULT(Enabling perl module)
AC_MSG_CHECKING(for perl >= 5.006)
perl_path=no
perl_search_path="/neo/opt /usr/local /usr"
if test $cs_cv_perl_path != "no" -a -x $cs_cv_perl_path; then
perl_path=$cs_cv_perl_path
else
for path in $perl_search_path; do
if test -x $path/bin/perl; then
require_error=`$path/bin/perl -e 'require 5.006' 2>&1`
if test "x$require_error" = "x"; then
perl_path=$path/bin/perl
break
fi
fi
done
fi
if test "x$perl_path" = "xno"; then
AC_MSG_RESULT(not found)
PERL=
else
AC_MSG_RESULT(found $perl_path)
PERL="$perl_path"
BUILD_WRAPPERS="$BUILD_WRAPPERS perl"
fi
fi
dnl ruby options
AC_ARG_ENABLE(ruby, [ --enable-ruby Enables building of ruby module])
AC_ARG_WITH(ruby, [ --with-ruby=path Set location of Ruby binary], [cs_cv_ruby_path="$withval"], [cs_cv_ruby_path=no])
if test "x$enable_ruby" = "xyes"; then
AC_MSG_RESULT(Enabling ruby module)
AC_MSG_CHECKING(for ruby)
ruby_path=no
ruby_search_path="/neo/opt /usr/local /usr"
if test $cs_cv_ruby_path != "no" -a -x $cs_cv_ruby_path; then
ruby_path=$cs_cv_ruby_path
else
for path in $ruby_search_path; do
if test -x $path/bin/ruby; then
ruby_path=$path/bin/ruby
break
fi
done
fi
if test "x$ruby_path" = "xno"; then
AC_MSG_RESULT(not found)
RUBY=
else
AC_MSG_RESULT(found $ruby_path)
RUBY="$ruby_path"
BUILD_WRAPPERS="$BUILD_WRAPPERS ruby"
fi
fi
dnl java options
AC_ARG_ENABLE(java, [ --enable-java Enables building of java module])
AC_ARG_WITH(java, [ --with-java=path Set location of J2SDK], [cs_cv_java_path="$withval"], [cs_cv_java_path=no])
if test "x$enable_java" = "xyes"; then
AC_MSG_RESULT(Enabling java module)
AC_MSG_CHECKING(for j2sdk path)
java_path=no
if test $cs_cv_java_path != "no" -a -d $cs_cv_java_path; then
java_path=$cs_cv_java_path
else
java_search_path="/neo/opt /usr/local /usr /usr/lib"
for path in $java_search_path; do
if test -d $path/java/j2sdk; then
java_path=$path/java/j2sdk
break
fi
if test -d $path/j2sdk; then
java_path=$path/j2sdk
break
fi
possible="$path/java/j2sdk*"
for pos_path in $possible; do
if test -d $pos_path; then
java_path=$pos_path
break 2
fi
done
possible="$path/j2sdk*"
for pos_path in $possible; do
if test -d $pos_path; then
java_path=$pos_path
break 2
fi
done
done
fi
if test "x$java_path" = "xno"; then
AC_MSG_RESULT(not found)
JAVA_PATH=
JAVA_INCLUDE_PATH=
else
AC_MSG_RESULT(found $java_path)
JAVA_PATH="$java_path"
JAVAC="$java_path/bin/javac"
_ACJNI_JAVAC=$JAVAC
AC_JNI_INCLUDE_DIR
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do
JAVA_INCLUDE_PATH="$JAVA_INCLUDE_PATH -I$JNI_INCLUDE_DIR"
done
BUILD_WRAPPERS="$BUILD_WRAPPERS java-jni"
fi
fi
dnl C# options
AC_ARG_ENABLE(csharp, [ --enable-csharp Enables building of csharp module])
if test "x$enable_csharp" = "xyes"; then
AX_PROG_CSC(2.0)
fi
# Export
AC_SUBST(RANLIB)
AC_SUBST(AR)
AC_SUBST(PERL)
AC_SUBST(RUBY)
AC_SUBST(JAVA_PATH)
AC_SUBST(JAVA_INCLUDE_PATH)
AM_CONDITIONAL(ON_MINGW32, [test "x$MINGW32" = "xyes"])
AM_CONDITIONAL(USE_WDB, [test "x$enable_wdb" = "xyes"])
AM_CONDITIONAL(USE_LOCKF, [test "x$cs_cv_have_lockf" = "xyes"])
AM_CONDITIONAL(USE_PTHREAD, [test "x$cs_cv_have_pthread" = "xyes" -a "x$cs_cv_have_lockf" = "xyes"])
AM_CONDITIONAL(USE_BUILTIN_SNPRINTF, [test "x$cs_cv_have_snprintf" = "xno"])
AM_CONDITIONAL(USE_BUILTIN_REGEXEC, [test "x$cs_cv_have_regexec" = "xno"])
AM_CONDITIONAL(USE_BUILTIN_MISSING_FUNC, [test "x$cs_cv_missing" = "xyes"])
AM_CONDITIONAL(BUILD_APACHE_MODULE, [test "x$enable_apache" = "xyes"])
AM_CONDITIONAL(BUILD_PYTHON_MODULE, [test "x$enable_python" = "xyes"])
AM_CONDITIONAL(BUILD_PERL_MODULE, [test "x$enable_perl" = "xyes"])
AM_CONDITIONAL(BUILD_RUBY_MODULE, [test "x$enable_ruby" = "xyes"])
AM_CONDITIONAL(BUILD_JAVA_MODULE, [test "x$enable_java" = "xyes"])
AM_CONDITIONAL(BUILD_CSHARP_MODULE, [test "x$enable_csharp" = "xyes"])
# the generated files
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([clearsilver.pc Makefile cs/Makefile cgi/Makefile util/Makefile python/Makefile mod_ecs/Makefile csharp/Makefile])
AC_OUTPUT