root/configure.in

Revision 23fe7441617a97549cfaf6892f7f76c83c419fbd, 21.7 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 days ago)

fix old lib name to corrected lib name

  • Property mode set to 100755
Line 
1 AC_INIT(src/noitd.c)
2
3 node=`hostname | cut -f1 -d '.' | tr '[A-Z]' '[a-z]'`
4 if test -f ".configure.$node"; then
5         echo "***********************************************************"
6         echo "* Loading node specific configure settings for $node."
7         echo "***********************************************************"
8         . ./.configure.$node
9 fi
10
11 AC_CANONICAL_HOST
12 AC_CONFIG_HEADER(src/noit_config.h)
13 AC_CONFIG_HEADER(src/jlog/jlog_config.h)
14
15 AC_ARG_ENABLE(strict,
16         [AC_HELP_STRING([--enable-strict],
17                 [Compile with warnings treated as errors])],
18         enable_strict="$enableval",
19         enable_strict=no)
20
21 AC_ARG_ENABLE(lua,
22         [AC_HELP_STRING([--enable-lua],
23                 [Choose a lua implementation: (no, lua52, LuaJIT)])],
24         enable_lua="$enableval",
25         enable_lua=LuaJIT)
26
27 if (test "$enable_lua" != "LuaJIT" && \
28         test "$enable_lua" != "lua52" && \
29         test "$enable_lua" != "no") ; then
30         AC_MSG_ERROR(Invalid value '$enable_lua' for --enable-lua)
31 fi
32
33 AC_PROG_CC
34 AC_C_INLINE
35 AC_C_BIGENDIAN
36 AC_PROG_CPP
37 AC_PROG_RANLIB
38 AC_PROG_INSTALL
39 AC_PROG_LN_S
40 AC_PATH_PROG(AR, ar)
41 AC_PATH_PROGS(PERL, perl)
42 AC_PATH_PROGS(XSLTPROC, xsltproc)
43 AC_PATH_PROGS(XMLLINT, xmllint)
44 AC_PATH_PROGS(MAVEN, mvn)
45 AC_PATH_PROGS(JAVA, java)
46 AC_PATH_PROGS(JAVA, java, , $JAVA_HOME/bin)
47 AC_PATH_PROGS(JAVAC, javac)
48 AC_PATH_PROGS(JAVAC, javac, , $JAVA_HOME/bin)
49 AC_PATH_PROGS(JAR, jar)
50 AC_PATH_PROGS(JAR, jar, , $JAVA_HOME/bin)
51 AC_PATH_PROG(NROFF, nroff)
52 AC_PATH_PROG(CTFCONVERT, ctfconvert)
53 AC_PATH_PROG(CTFMERGE, ctfmerge)
54 AC_SUBST(PERL)
55
56 ENABLE_LUA=$enable_lua
57 AC_SUBST(ENABLE_LUA)
58
59 MAPFLAGS=""
60 if test "x$GCC" = "xyes" ; then
61         C99FLAG="-std=c99"
62         CFLAGS="$CFLAGS -g $C99FLAG"
63         DEPFLAGS="-MM"
64 else
65         C99FLAG="-xc99=all"
66         CFLAGS="$CFLAGS -g $C99FLAG"
67         DEPFLAGS="-xM1"
68 fi
69 SHLDFLAGS="$LDFLAGS"
70
71 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200112L "'-I$(top_srcdir)/src'
72 DTRACEHDR=dtrace_probes.h
73
74 case $host in
75 *-*-darwin*)
76         DTRACE=/usr/sbin/dtrace
77         DTRACE_ENABLED=1
78         PICFLAGS="-fPIC"
79         CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_6 -Wno-deprecated-declarations"
80         MODULELD="$CC -bundle -flat_namespace -undefined suppress"
81         SHLD="$CC -dynamiclib -flat_namespace -undefined suppress"
82         MODULEEXT=bundle
83         RLDFLAG="-Wl,--rpath="
84         # This is needed for luajit on Mac OS X
85         if test "x$ENABLE_LUA" = "xLuaJIT"; then
86                 LDFLAGS="$LDFLAGS -pagezero_size 10000 -image_base 100000000"
87                 SHLDFLAGS="$SHLDFLAGS -image_base 100000000"
88         fi
89         ;;
90 *-*-solaris*)
91         DTRACE=/usr/sbin/dtrace
92         DTRACE_ENABLED=1
93         DTRACEOBJ=dtrace_stub.o
94         CFLAGS="$CFLAGS"
95         CPPFLAGS="$CPPFLAGS -D_XPG6 -D__EXTENSIONS__"
96         if test "x$GCC" != "xyes" ; then
97         AC_MSG_CHECKING([32 or 64 bit Solaris assembly])
98         if test -n "`echo $CFLAGS | grep m64`" ; then
99                 DTRACEFLAGS=-64
100                 MAPFLAGS="-Wl,-M -Wl,map64bit"
101                 if test -n "`isalist | grep sparc`"; then
102                         AC_MSG_RESULT([sparc 64])
103                         ATOMIC_OBJS="noit_atomic_sol_sparcv9.o"
104                 else
105                         AC_MSG_RESULT([intel 64])
106                         ATOMIC_OBJS="noit_atomic_sol_x86_64.o"
107                 fi
108         else
109                 if test -n "`isalist | grep sparc`"; then
110                         AC_MSG_RESULT([sparc 32])
111                         ATOMIC_OBJS="noit_atomic_sol_sparcv8plus.o"
112                 else
113                         AC_MSG_RESULT([intel 32])
114                         ATOMIC_OBJS="noit_atomic_sol_x86_32.o"
115                 fi
116         fi
117         fi
118         if test "x$GCC" != "xyes" ; then
119                 CFLAGS="$CFLAGS -mt"
120                 PICFLAGS="-Kpic"
121                 MODULELD="$CC -G"
122                 SHLD="$CC -G"
123         else
124                 if test -n "`echo $CFLAGS | grep m64`" ; then
125                         DTRACEFLAGS=-64
126                         MAPFLAGS="-Wl,-M -Wl,map64bit"
127                 fi
128                 PICFLAGS="-fPIC"
129                 MODULELD="$CC -shared"
130                 SHLD="$CC -shared"
131                 CLINKFLAGS="-shared-libgcc"
132         fi
133         MODULEEXT=so
134         RLDFLAG="-R"
135         WHOLE_ARCHIVE="-Wl,-z -Wl,allextract"
136         NOWHOLE_ARCHIVE="-Wl,-z -Wl,defaultextract"
137         ;;
138 *-*-openbsd*)
139         PICFLAGS="-fpic"
140         LDFLAGS="$LDFLAGS -Wl,-E"
141         MODULELD="$CC -shared"
142         SHLD="$CC -shared"
143         MODULEEXT=so
144         LDFLAGS="$LDFLAGS -L/usr/local/lib"
145         CFLAGS="$CFLAGS -I/usr/local/include"
146         RLDFLAG="-Wl,--rpath="
147         WHOLE_ARCHIVE="-Wl,--whole-archive"
148         NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
149         ;;
150 *-*-linux*)
151         LDFLAGS="$LDFLAGS -Wl,-E"
152         CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE -D_BSD_SOURCE"
153         PICFLAGS="-fpic"
154         MODULELD="$CC -shared"
155         SHLD="$CC -shared"
156         MODULEEXT=so
157         RLDFLAG="-Wl,--rpath="
158         WHOLE_ARCHIVE="-Wl,--whole-archive"
159         NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
160         ;;
161 *-*-freebsd*)
162         PICFLAGS="-fpic"
163         MODULELD="$CC -shared"
164         LDFLAGS="$LDFLAGS -export-dynamic -L/usr/local/lib"
165         CFLAGS="$CFLAGS -DCOMPAT_43TTY -I/usr/local/include"
166         MODULEEXT=so
167         RLDFLAG="-Wl,--rpath="
168         ;;
169 *)
170         PICFLAGS="-fpic"
171         MODULELD="$CC -shared"
172         MODULEEXT=so
173         RLDFLAG="-Wl,--rpath="
174         ;;
175 esac
176 AC_SUBST(DTRACE)
177 AC_SUBST(DTRACE_ENABLED)
178 if test "x$DTRACE_ENABLED" = "x1" ; then
179         AC_DEFINE(DTRACE_ENABLED)
180 fi
181 AC_SUBST(DTRACEOBJ)
182 AC_SUBST(DTRACEHDR)
183 AC_SUBST(DTRACEFLAGS)
184 AC_SUBST(CLINKFLAGS)
185 AC_SUBST(SHLD)
186 AC_SUBST(RLDFLAG)
187 AC_SUBST(DEPFLAGS)
188 AC_SUBST(MODULELD)
189 AC_SUBST(MODULEEXT)
190 AC_SUBST(WHOLE_ARCHIVE)
191 AC_SUBST(NOWHOLE_ARCHIVE)
192 AC_SUBST(ATOMIC_OBJS)
193 AC_SUBST(MAPFLAGS)
194 AC_DEFINE_UNQUOTED(MODULEEXT, "$MODULEEXT", [module extension])
195 AC_MSG_CHECKING([enable build/install of the Java IEP and Jezebel bits])
196
197 LUA_MODULE=lua.$MODULEEXT
198 if test "$enable_lua" = "no"; then
199         LUA_MODULE=
200 fi
201
202 INSTALL_IEP=install-iep
203 SKIP_IEP=
204 RIEMANN_IEP_ENABLE="no"
205 if test -z "$ac_cv_path_MAVEN" ; then
206         INSTALL_IEP=
207         SKIP_IEP=_SKIP_
208 else
209         RIEMANN_IEP_ENABLE="yes"
210 fi
211 AC_SUBST(INSTALL_IEP)
212 AC_SUBST(SKIP_IEP)
213
214 JEZEBEL_JAR_ENABLE="no"
215 RECONNOITER_JAR_ENABLE="no"
216 if test -z "$ac_cv_path_JAVA" \
217         -o -z "$ac_cv_path_JAVAC" \
218         -o -z "$ac_cv_path_JAR" ; then
219         AC_MSG_RESULT([no])
220 else
221         if $ac_cv_path_JAVA -cp buildtools version 1.6 ; then
222                 JAVAPARTS=java
223                 AC_MSG_RESULT([yes])
224                 JEZEBEL_JAR_ENABLE="yes"
225                 RECONNOITER_JAR_ENABLE="yes"
226         else
227                 JVERSION=`$ac_cv_path_JAVA -cp buildtools version 1.6`
228                 AC_MSG_RESULT([too old: $JVERSION]);
229         fi
230 fi
231 AC_SUBST(JAVAPARTS)
232
233 # Checks for data types
234 AC_CHECK_SIZEOF(char, 1)
235 AC_CHECK_SIZEOF(short int, 2)
236 AC_CHECK_SIZEOF(int, 4)
237 AC_CHECK_SIZEOF(long int, 4)
238 AC_CHECK_SIZEOF(long long int, 8)
239 AC_CHECK_SIZEOF(void *, 1)
240
241 AC_CHECK_LIB(umem, umem_cache_create, , )
242 AC_CHECK_LIB(z, compress2, , [AC_MSG_ERROR(*** zlib is required ***)])
243 AC_CHECK_LIB(rt, sem_init, , [
244   AC_CHECK_LIB(rt, clock_gettime, , )
245 ])
246 AC_CHECK_LIB(posix4, sem_wait, , )
247 AC_CHECK_LIB(pthread, pthread_create, , )
248 AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, ,
249         [AC_MSG_ERROR(libprotobuf-c required)])
250
251 AC_CHECK_FUNC(uuid_generate, , [
252         AC_MSG_WARN([uuid_generate not available])
253         AC_SEARCH_LIBS(uuid_generate, uuid e2fs-uuid, , [AC_MSG_ERROR(*** uuid is required ***)])])
254
255 # Some libraries provide an unparse_lower command
256 # we use that, so if it isn't present, we'll need
257 # to implement it.
258 AC_CHECK_FUNC(fdwalk, [AC_DEFINE(HAVE_FDWALK)], )
259 AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE(HAVE_UUID_UNPARSE_LOWER)], )
260 AC_CHECK_LIB(util, openpty, , )
261 AC_CHECK_LIB(termcap, tputs, , )
262 AC_CHECK_LIB(curses, clear, , [AC_MSG_ERROR([curses not found, but required])])
263
264 CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
265 LDFLAGS="$LDFLAGS `pcre-config --libs`"
266 SHLDFLAGS="$SHLDFLAGS `pcre-config --libs`"
267 AC_CHECK_LIB(pcre, pcre_compile, ,
268         [
269                 AC_MSG_ERROR([libpcre not found, but required])
270         ]
271 )
272 AC_CHECK_LIB(crypto, ERR_load_CRYPTO_strings, ,
273         [
274                 AC_MSG_ERROR([libcrypto not found, but required])
275         ]
276 )
277 AC_CHECK_LIB(ssl, SSL_library_init, ,
278         [
279                 AC_MSG_ERROR([libssl not found, but required])
280         ]
281 )
282
283 old_LIBS="$LIBS"
284 old_CFLAGS="$CFLAGS"
285 AC_CHECK_LIB(pq, PQconnectdb,
286         [
287                 LIBS="$LIBS -lpq"
288                 PGLIBS="$LIBS"
289                 AC_SUBST(PGLIBS)
290         ],
291         [
292                 AC_MSG_WARN([libpq is highly recommended and needed for the test suite])
293                 AC_SUBST(PGLIBS)
294         ]
295 )
296
297 AC_MSG_CHECKING([libpq includes])
298 PQICFLAGS=`pg_config --includedir`
299 if test -n "$PQICFLAGS" ; then
300         CFLAGS="$CFLAGS -I$PQICFLAGS"
301 fi
302
303 POSTGRES_MODULE="no"
304 POSTGRES_INGESTOR_MODULE="no"
305 AC_TRY_LINK([
306         #include <libpq-fe.h>
307         ],
308         [ PGconn *dbh = PQconnectdb(""); ],
309         [
310                 BUILD_MODULES="$BUILD_MODULES postgres.$MODULEEXT"
311                 BUILD_SMODULES="$BUILD_SMODULES postgres_ingestor.$MODULEEXT"
312                 AC_SUBST(PGCFLAGS)
313                 POSTGRES_MODULE="yes"
314                 POSTGRES_INGESTOR_MODULE="yes"
315   ],
316         [
317                 AC_SUBST(PGCFLAGS)
318                 AC_MSG_WARN([Cannot compile/link against libpq])
319         ]
320 )
321 PGCFLAGS=$CFLAGS
322 AC_SUBST(PGCFLAGS)
323 LIBS=$old_LIBS
324 CFLAGS=$old_CFLAGS
325
326 AC_CHECK_HEADERS(gcrypt.h)
327
328 AC_CHECK_HEADERS(mysql.h mysql/mysql.h)
329
330 MYSQL_MODULE="no"
331 if test "$ac_cv_header_mysql_h" = "no" -a "$ac_cv_header_mysql_mysql_h" = "no" ; then
332         AC_MSG_WARN([No libmysqlclient, skipping mysql module])
333         AC_SUBST(MYCFLAGS)
334         AC_SUBST(MYLIBS)
335 else
336         LIBS=$old_LIBS
337         CFLAGS=$old_CFLAGS
338        
339         if test -z "$MYLIBS" ; then
340           MYLIBS="-lmysqlclient_r -lz -lssl -lcrypto"
341         fi
342        
343         old_CFLAGS=$CFLAGS
344         old_LIBS=$LIBS
345         CFLAGS="$CFLAGS $MYCFLAGS"
346         LIBS="$MYLIBS"
347        
348         AC_CHECK_FUNC(mysql_real_connect,
349                 [
350                         BUILD_MODULES="$BUILD_MODULES mysql.$MODULEEXT"
351                         MYCFLAGS="$CFLAGS"
352                         MYLIBS="$LIBS"
353                         AC_SUBST(MYCFLAGS)
354                         AC_SUBST(MYLIBS)
355                         MYSQL_MODULE="yes"
356                 ],
357                 [
358                         AC_MSG_WARN([No libmysqlclient, skipping mysql module])
359                         AC_SUBST(MYCFLAGS)
360                         AC_SUBST(MYLIBS)
361                 ]
362         )
363        
364        
365         LIBS=$old_LIBS
366         CFLAGS=$old_CFLAGS
367 fi
368
369 ########
370 #
371 # CHECK FOR VARIOUS MODULE CRITERIA
372 # We don't track the libs themselves, as we'll just explictly link
373 # against the in the makefile if we enable them to build (by adding
374 # them to the BUILD_MODULES list).
375 #
376 ########
377
378 # Should we build snmp checks?
379 SNMP_MODULE="no"
380 HAS_NETSNMP="no"
381 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
382 if test "$ac_cv_header_net_snmp_net_snmp_config_h" = "yes" ; then
383 SAVELIBS="$LIBS"
384 AC_CHECK_LIB(netsnmp-c, snmp_sess_open_C1,
385         [
386                 BUILD_MODULES="$BUILD_MODULES snmp.$MODULEEXT"
387                 HAS_NETSNMP="yes"
388                 SNMP_MODULE="yes"
389                 LIBNETSNMP="netsnmp-c"
390         ],
391   [
392                 AC_CHECK_LIB(netsnmp, snmp_sess_open,
393                         [
394                                 HAS_NETSNMP="yes"
395                                 SNMP_MODULE="no"
396                                 AC_MSG_WARN([*** snmp C implementation requires libnetsnmp-c ***])
397                                 LIBNETSNMP="netsnmp"
398                         ]
399                 )
400         ]
401 )
402 LIBS="$SAVELIBS"
403 fi
404
405 FQ_DRIVER_MODULE="no"
406 SAVELIBS="$LIBS"
407 HAS_LIBFQ="no"
408 AC_CHECK_LIB(fq, fq_client_init,
409         [
410                 BUILD_SMODULES="$BUILD_SMODULES fq_driver.$MODULEEXT"
411                 HAS_LIBFQ="yes"
412                 FQ_DRIVER_MODULE="yes"
413         ]
414 )
415 LIBS="$SAVELIBS"
416
417 if test "x$HAS_NETSNMP" = "xno"; then
418         AC_MSG_WARN([No libnetsnmp, skipping snmp module])
419         if test -n "$LUA_MODULE"; then
420                 AC_MSG_ERROR([*** lua specified, but no SNMP ***])
421         fi
422 fi
423
424 AC_SUBST(LIBNETSNMP)
425
426 # Should we build ssh2 checks?
427 SSH2_MODULE="no"
428 SAVELIBS="$LIBS"
429 AC_CHECK_LIB(ssh2, libssh2_session_init_ex,
430         [
431                 BUILD_MODULES="$BUILD_MODULES ssh2.$MODULEEXT"
432                 SSH2_MODULE="yes"
433         ],
434         [
435                 AC_MSG_WARN([No libssh2, skipping ssh2 module])
436         ]
437 )
438 LIBS="$SAVELIBS"
439
440 AC_MSG_CHECKING([libxml2 cflags])
441 XML2CFLAGS=`xml2-config --cflags`
442 CFLAGS="$CFLAGS $XML2CFLAGS"
443 AC_MSG_RESULT([$XML2CFLAGS])
444
445 AC_MSG_CHECKING([libxml2 libs])
446 XML2LIBS=`xml2-config --libs`
447 LIBS="$LIBS $XML2LIBS"
448 AC_MSG_RESULT([$XML2LIBS])
449
450 AC_CHECK_FUNC(xmlParseDocument, , [AC_MSG_ERROR(*** libxml2 is required ***)])
451
452 AC_MSG_CHECKING([libxslt cflags])
453 XSLTCFLAGS=`xslt-config --cflags`
454 CFLAGS="$CFLAGS $XSLTCFLAGS"
455 AC_MSG_RESULT([$XSLTCFLAGS])
456
457 AC_MSG_CHECKING([libxslt libs])
458 XSLTLIBS=`xslt-config --libs`
459 LIBS="$LIBS $XSLTLIBS"
460 AC_MSG_RESULT([$XSLTLIBS])
461
462 AC_CHECK_FUNC(xsltParseStylesheetDoc, , [AC_MSG_ERROR(*** libxslt is required ***)])
463
464 STOMP_DRIVER_MODULE="no"
465 AC_MSG_CHECKING([apr-1-config for needed for stomp support])
466 APRPREFIX=`apr-1-config --prefix`
467 if test $? -eq "0"; then
468         BUILD_SMODULES="$BUILD_SMODULES stomp_driver.$MODULEEXT"
469         STOMP_DRIVER_MODULE="yes"
470 fi
471 AC_SUBST(APRPREFIX)
472 AC_MSG_RESULT([$APRPREFIX])
473
474 AC_MSG_CHECKING([libapr cflags])
475 APRCFLAGS="`apr-1-config --cflags --cppflags --includes`"
476 AC_SUBST(APRCFLAGS)
477 AC_MSG_RESULT([$APRCFLAGS])
478
479 AC_MSG_CHECKING([libapr libs])
480 APRLIBS="`apr-1-config --link-ld --ldflags --libs`"
481 AC_SUBST(APRLIBS)
482 AC_MSG_RESULT([$APRLIBS])
483
484 AC_TRY_LINK([],
485         [ issetugid(); ],
486         [ ac_cv_libc_defines_issetugid="yes" ],
487         [ ac_cv_libc_defines_issetugid="no" ]
488 )
489 if test "x$ac_cv_libc_defines_issetugid" = "xyes" ; then
490         AC_DEFINE(HAVE_ISSETUGID)
491 fi
492
493 AC_MSG_CHECKING([whether sem_init works])
494 AC_TRY_RUN(
495         [
496 #include <semaphore.h>
497 int main(void){sem_t s;return (0 != sem_init(&s,0,0));}
498         ],
499         [
500                 AC_MSG_RESULT(yes)
501                 AC_DEFINE(WORKING_SEM_INIT)
502         ],
503         [
504                 AC_MSG_RESULT(no)
505                 AC_MSG_WARN([****** sem_init() is broken, I'll implement one myself.])
506         ]
507 )
508
509 AC_FUNC_STRFTIME
510 AC_CHECK_FUNCS(ssetugid strlcpy strnstrn openpty inet_pton inet_ntop getopt \
511         poll vasprintf strlcat)
512
513 # Checks for header files.
514 AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \
515         sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \
516         ctype.h unistd.h time.h pty.h sys/stat.h sys/event.h libkern/OSAtomic.h \
517         termio.h termios.h curses.h sys/cdefs.h grp.h netinet/in_systm.h \
518         sys/ioctl_compat.h sys/filio.h util.h sys/time.h sys/mman.h \
519         sys/ioctl.h stropts.h sys/stream.h alloca.h sys/wait.h bsd/libutil.h libutil.h)
520
521 AC_CHECK_HEADERS([term.h], [], [],
522         [[
523 #ifdef HAVE_CURSES_H
524 # include <curses.h>
525 #endif
526         ]])
527
528 AC_CHECK_DECLS([openpty], [], [],
529         [
530 #if defined(HAVE_SYS_TYPES_H)
531 # include <sys/types.h>
532 #endif
533 #if defined(HAVE_SYS_IOCTL_H)
534 # include <sys/ioctl.h>
535 #endif
536 #if defined(HAVE_TERMIOS_H)
537 # include <termios.h>
538 #endif
539 #if defined(HAVE_BSD_LIBUTIL_H)
540 # include <bsd/libutil.h>
541 #elif defined(HAVE_LIBUTIL_H)
542 # include <libutil.h>
543 #endif
544 #if defined(HAVE_UTIL_H)
545 # include <util.h>
546 #endif
547 #if defined(HAVE_PTY_H)
548 # include <pty.h>
549 #endif
550         ])
551
552 AC_CHECK_FUNCS(getpwnam_r)
553 GETPWNAM_R_POSIX
554 AC_CHECK_FUNCS(getgrnam_r)
555 GETGRNAM_R_POSIX
556
557 AC_MSG_CHECKING(for tputs() function final argument type)
558 AC_EGREP_CPP([tputs.*[(][       ]*char[         ]*[)]],
559                 [#if defined(HAVE_TERM_H)
560                  #include <term.h>
561                  #endif
562                  #if defined(HAVE_CURSES_H)
563                  #include <curses.h>
564                  #endif],
565                 [AC_MSG_RESULT(char)
566                  AC_DEFINE(TPUTS_TAKES_CHAR)],
567                 [AC_MSG_RESULT(not char)])
568
569 AC_MSG_CHECKING(for tgoto() function final argument type)
570 AC_EGREP_CPP([tgoto.*[(][       ]*char[         ]*],
571                 [#if defined(HAVE_TERM_H)
572                  #include <term.h>
573                  #endif
574                  #if defined(HAVE_CURSES_H)
575                  #include <curses.h>
576                  #endif],
577                 [AC_MSG_RESULT(char)
578                  AC_DEFINE(TGOTO_TAKES_CHAR)],
579                 [AC_MSG_RESULT(not char)])
580
581 AC_CACHE_CHECK([for epoll support], ac_cv_have_epoll, [
582         AC_TRY_LINK(
583                 [ #include <sys/types.h> ],
584                 [ int a; a = epoll_create(); ],
585                 [ ac_cv_have_epoll="yes" ],
586                 [ ac_cv_have_epoll="no" ]
587         )
588 ])
589 if test "x$ac_cv_have_epoll" = "xyes" ; then
590         AC_DEFINE(HAVE_EPOLL)
591         EVENTER_OBJS="$EVENTER_OBJS eventer_epoll_impl.o"
592         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "epoll")
593         have_epoll=1
594 fi
595
596 AC_CACHE_CHECK([for kqueue support], ac_cv_have_kqueue, [
597         AC_TRY_LINK(
598                 [ #include <sys/types.h> ],
599                 [ u_int a; a = kqueue(); ],
600                 [ ac_cv_have_kqueue="yes" ],
601                 [ ac_cv_have_kqueue="no" ]
602         )
603 ])
604 if test "x$ac_cv_have_kqueue" = "xyes" ; then
605         AC_DEFINE(HAVE_KQUEUE)
606         EVENTER_OBJS="$EVENTER_OBJS eventer_kqueue_impl.o"
607         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "kqueue")
608         have_kqueue=1
609 fi
610
611 AC_CACHE_CHECK([for Solaris ports support], ac_cv_have_ports, [
612         AC_TRY_LINK(
613                 [ #include <port.h> ],
614                 [ u_int a; a = port_create(); ],
615                 [ ac_cv_have_ports="yes" ],
616                 [ ac_cv_have_ports="no" ]
617         )
618 ])
619 if test "x$ac_cv_have_ports" = "xyes" ; then
620         AC_DEFINE(HAVE_PORTS)
621         EVENTER_OBJS="$EVENTER_OBJS eventer_ports_impl.o"
622         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "ports")
623         have_ports=1
624 fi
625
626 AC_SUBST(EVENTER_OBJS)
627
628 AC_CACHE_CHECK([for posix_readdir_r], ac_cv_have_posix_readdir_r, [
629         AC_TRY_COMPILE(
630                 [ #include <dirent.h> ],
631                 [ struct dirent *dep, de; readdir_r("/", &de, &dep); ],
632                 [ ac_cv_have_posix_readdir_r="yes" ],
633                 [ ac_cv_have_posix_readdir_r="no" ]
634         )
635 ])
636 if test "x$ac_cv_have_posix_readdir_r" = "xyes" ; then
637         AC_DEFINE(HAVE_POSIX_READDIR_R)
638         have_posix_readdir_r=1
639 fi
640
641 AC_CACHE_CHECK([for sig_t type], ac_cv_have_sig_t, [
642         AC_TRY_COMPILE(
643                 [ #include <signal.h> ],
644                 [ sig_t a; (void)a;],
645                 [ ac_cv_have_sig_t="yes" ],
646                 [ ac_cv_have_sig_t="no" ]
647         )
648 ])
649 if test "x$ac_cv_have_sig_t" = "xyes" ; then
650         AC_DEFINE(HAVE_SIG_T)
651         have_sig_t=1
652 fi
653
654 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
655         AC_TRY_COMPILE(
656                 [ #include <sys/types.h> ],
657                 [ u_int a; a = 1;],
658                 [ ac_cv_have_u_int="yes" ],
659                 [ ac_cv_have_u_int="no" ]
660         )
661 ])
662 if test "x$ac_cv_have_u_int" = "xyes" ; then
663         AC_DEFINE(HAVE_U_INT)
664         have_u_int=1
665 fi
666
667 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
668         AC_TRY_COMPILE(
669                 [ #include <sys/types.h> ],
670                 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
671                 [ ac_cv_have_intxx_t="yes" ],
672                 [ ac_cv_have_intxx_t="no" ]
673         )
674 ])
675 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
676         AC_DEFINE(HAVE_INTXX_T)
677         have_intxx_t=1
678 fi
679        
680 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
681         AC_TRY_COMPILE(
682                 [ #include <sys/types.h> ],
683                 [ int64_t a; a = 1;],
684                 [ ac_cv_have_int64_t="yes" ],
685                 [ ac_cv_have_int64_t="no" ]
686         )
687 ])
688 if test "x$ac_cv_have_int64_t" = "xyes" ; then
689         AC_DEFINE(HAVE_INT64_T)
690         have_int64_t=1
691 fi
692        
693 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
694         AC_TRY_COMPILE(
695                 [ #include <sys/types.h> ],
696                 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
697                 [ ac_cv_have_u_intxx_t="yes" ],
698                 [ ac_cv_have_u_intxx_t="no" ]
699         )
700 ])
701 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
702         AC_DEFINE(HAVE_U_INTXX_T)
703         have_u_intxx_t=1
704 fi
705
706 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
707         AC_TRY_COMPILE(
708                 [ #include <sys/types.h> ],
709                 [ u_int64_t a; a = 1;],
710                 [ ac_cv_have_u_int64_t="yes" ],
711                 [ ac_cv_have_u_int64_t="no" ]
712         )
713 ])
714 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
715         AC_DEFINE(HAVE_U_INT64_T)
716         have_u_int64_t=1
717 fi
718
719 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
720         test "x$ac_cv_header_sys_bitypes_h" = "xyes")
721 then
722         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
723         AC_TRY_COMPILE(
724                 [
725 #include <sys/bitypes.h>
726                 ],
727                 [
728                         int8_t a; int16_t b; int32_t c;
729                         u_int8_t e; u_int16_t f; u_int32_t g;
730                         a = b = c = e = f = g = 1;
731                 ],
732                 [
733                         AC_DEFINE(HAVE_U_INTXX_T)
734                         AC_DEFINE(HAVE_INTXX_T)
735                         AC_MSG_RESULT(yes)
736                 ],
737                 [AC_MSG_RESULT(no)]
738         )
739 fi
740
741 if test -z "$have_u_intxx_t" ; then
742         AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
743                 AC_TRY_COMPILE(
744                         [
745 #include <sys/types.h>
746                         ],
747                         [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
748                         [ ac_cv_have_uintxx_t="yes" ],
749                         [ ac_cv_have_uintxx_t="no" ]
750                 )
751         ])
752         if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
753                 AC_DEFINE(HAVE_UINTXX_T)
754         fi
755 fi
756
757 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
758         AC_TRY_COMPILE(
759                 [
760 #include <sys/types.h>
761 #include <sys/socket.h>
762                 ],
763                 [socklen_t foo; foo = 1235;],
764                 [ ac_cv_have_socklen_t="yes" ],
765                 [ ac_cv_have_socklen_t="no" ]
766         )
767 ])
768 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
769         AC_DEFINE(HAVE_SOCKLEN_T)
770 fi
771
772 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
773         AC_TRY_COMPILE(
774                 [
775 #include <sys/types.h>
776                 ],
777                 [ size_t foo; foo = 1235; ],
778                 [ ac_cv_have_size_t="yes" ],
779                 [ ac_cv_have_size_t="no" ]
780         )
781 ])
782 if test "x$ac_cv_have_size_t" = "xyes" ; then
783         AC_DEFINE(HAVE_SIZE_T)
784 fi
785
786 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
787         AC_TRY_COMPILE(
788                 [
789 #include <sys/types.h>
790                 ],
791                 [ ssize_t foo; foo = 1235; ],
792                 [ ac_cv_have_ssize_t="yes" ],
793                 [ ac_cv_have_ssize_t="no" ]
794         )
795 ])
796 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
797         AC_DEFINE(HAVE_SSIZE_T)
798 fi
799
800 BUILD_MODULES="$BUILD_MODULES $LUA_MODULE"
801
802 AC_SUBST(BUILD_MODULES)
803 AC_SUBST(BUILD_SMODULES)
804
805 docdir="docs"
806 mansubdir="man"
807 AC_SUBST(docdir)
808 AC_SUBST(mansubdir)
809 SHCFLAGS="$PICFLAGS $CFLAGS"
810 AC_SUBST(SHCFLAGS)
811 AC_SUBST(LD)
812 AC_SUBST(SHLDFLAGS)
813
814 SUBPREFIX="$prefix"
815 if test "x$prefix" = "xNONE"; then
816         SUBPREFIX="$ac_default_prefix"
817 fi
818 AC_MSG_CHECKING([Resolving libexec path...])
819 fullpath=$libexecdir
820 while test "x$temppath" != "x$fullpath" ; do
821         temppath=$fullpath
822         fullpath=`eval echo ${fullpath}`
823 done
824 fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
825 AC_MSG_RESULT([$fullpath/noit])
826 AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}/noit")
827 MODULES_DIR=${fullpath}/noit
828 AC_SUBST(MODULES_DIR)
829
830 JAVA_LIB_DIR="$prefix/java"
831 AC_ARG_WITH(java-libdir,
832         [--with-javalibdir=PFX  prefix to install java libs (optional)],
833         [JAVA_LIB_DIR=$withval],)
834 AC_MSG_CHECKING([Resolving javalibdir path...])
835 fullpath=$JAVA_LIB_DIR
836 while test "x$temppath" != "x$fullpath" ; do
837         temppath=$fullpath
838         fullpath=`eval echo ${fullpath}`
839 done
840 fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
841 JAVA_LIB_DIR=$fullpath
842 AC_MSG_RESULT([$fullpath])
843 AC_SUBST(JAVA_LIB_DIR)
844
845 AC_MSG_CHECKING([Resolving sysconfdir path...])
846 fullpath=$sysconfdir
847 while test "x$temppath" != "x$fullpath" ; do
848         temppath=$fullpath
849         fullpath=`eval echo ${fullpath}`
850 done
851 fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
852 AC_MSG_RESULT([$fullpath])
853 AC_DEFINE_UNQUOTED(ETC_DIR, "${fullpath}")
854 ETC_DIR=${fullpath}
855 AC_SUBST(ETC_DIR)
856
857 if test -n "`$CC -V 2>&1 | grep 'Sun C'`"; then
858         if test "$enable_string" != "no"; then
859                 CFLAGS="$CFLAGS -errwarn=%all"
860         fi
861 else
862         CFLAGS="$CFLAGS -Wall"
863         if test "$enable_strict" != "no"; then
864                 CFLAGS="$CFLAGS -Werror"
865         fi
866 fi
867
868 LUACFLAGS=`echo $CFLAGS | sed -e "s#${C99FLAG}##g; s#-mt##g; s#-errwarn=%all##g;"`
869 AC_SUBST(LUACFLAGS)
870
871 UNAME_V=`uname -v`
872 UNAME_R=`uname -r`
873 UNAME_S=`uname -s`
874 UNAME_M=`uname -m`
875 UNAME_N=`uname -n`
876 UNAME_P=`uname -p`
877 AC_DEFINE_UNQUOTED(UNAME_V, "$UNAME_V")
878 AC_DEFINE_UNQUOTED(UNAME_R, "$UNAME_R")
879 AC_DEFINE_UNQUOTED(UNAME_S, "$UNAME_S")
880 AC_DEFINE_UNQUOTED(UNAME_M, "$UNAME_M")
881 AC_DEFINE_UNQUOTED(UNAME_N, "$UNAME_N")
882 AC_DEFINE_UNQUOTED(UNAME_P, "$UNAME_P")
883
884
885 AC_OUTPUT([
886 Makefile
887 src/Makefile
888 src/Makefile.objs
889 src/eventer/Makefile
890 src/jlog/Makefile
891 src/jlog/perl/Makefile.PL
892 src/lua/Makefile
893 src/udns/Makefile
894 src/json-lib/Makefile
895 src/yajl-lib/Makefile
896 src/man/Makefile
897 src/modules/Makefile
898 src/modules-lua/Makefile
899 src/utils/Makefile
900 src/noitedit/Makefile
901 src/java/Makefile
902 src/java/reconnoiter-riemann/run-iep.sh
903 src/java/jezebel
904 src/scripts/noit-config
905 sql/Makefile
906 test/Makefile
907 ])
908
909 AC_MSG_RESULT([
910
911 === Compile-time Configuration ===
912   Lua Implementation: $ENABLE_LUA
913
914   == optional noit modules ==
915   Postgres module:    $POSTGRES_MODULE
916   MySQL module:       $MYSQL_MODULE
917   SNMP module:        $SNMP_MODULE
918   SSH2 module:        $SSH2_MODULE
919
920   == optional stratcon modules ==
921   Postgres ingestor:  $POSTGRES_INGESTOR_MODULE
922   STOMP iep driver:   $STOMP_DRIVER_MODULE
923   FQ iep driver:      $FQ_DRIVER_MODULE
924
925   == Java bits ==
926   Jezebel:            $JEZEBEL_JAR_ENABLE
927   Reconnoiter:        $RECONNOITER_JAR_ENABLE
928   Riemann IEP:        $RIEMANN_IEP_ENABLE
929 ])
Note: See TracBrowser for help on using the browser.