root/configure.in

Revision b4d23c1d9802dc66bab89a6df86434ed6a94d72a, 17.2 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 2 years ago)

treat warnings as errors only with --enable-strict

  • 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_PROG_CC
22 AC_C_INLINE
23 AC_C_BIGENDIAN
24 AC_PROG_CPP
25 AC_PROG_RANLIB
26 AC_PROG_INSTALL
27 AC_PROG_LN_S
28 AC_PATH_PROG(AR, ar)
29 AC_PATH_PROGS(PERL, perl)
30 AC_PATH_PROGS(XSLTPROC, xsltproc)
31 AC_PATH_PROGS(XMLLINT, xmllint)
32 AC_PATH_PROGS(JAVA, java)
33 AC_PATH_PROGS(JAVA, java, , $JAVA_HOME/bin)
34 AC_PATH_PROGS(JAVAC, javac)
35 AC_PATH_PROGS(JAVAC, javac, , $JAVA_HOME/bin)
36 AC_PATH_PROGS(JAR, jar)
37 AC_PATH_PROGS(JAR, jar, , $JAVA_HOME/bin)
38 AC_PATH_PROG(NROFF, nroff)
39 AC_SUBST(PERL)
40
41 if test "x$CC" = "xgcc" ; then
42   CFLAGS="$CFLAGS -g"
43   DEPFLAGS="-MM"
44 else
45   CFLAGS="$CFLAGS -g"
46   DEPFLAGS="-xM1"
47 fi
48
49 CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)/src'
50 DTRACEHDR=dtrace_probes.h
51
52 case $host in
53 *-*-darwin*)
54         DTRACE=/usr/sbin/dtrace
55         DTRACE_ENABLED=1
56         PICFLAGS="-fPIC"
57         MODULELD="$CC -bundle -flat_namespace -undefined suppress"
58         SHLD="$CC -dynamiclib -flat_namespace -undefined suppress"
59         MODULEEXT=bundle
60         RLDFLAG="-Wl,--rpath="
61         ;;
62 *-*-solaris*)
63         DTRACE=/usr/sbin/dtrace
64         DTRACE_ENABLED=1
65         DTRACEOBJ=dtrace_stub.o
66         AC_MSG_CHECKING([32 or 64 bit Solaris assembly])
67         if test -n "`echo $CFLAGS | grep m64`"; then
68                 DTRACEFLAGS=-64
69                 if test -n "`isalist | grep sparc`"; then
70                         AC_MSG_RESULT([sparc 64])
71                         ATOMIC_OBJS="noit_atomic_sol_sparcv9.o"
72                 else
73                         AC_MSG_RESULT([intel 64])
74                         ATOMIC_OBJS="noit_atomic_sol_x86_64.o"
75                 fi
76         else
77                 if test -n "`isalist | grep sparc`"; then
78                         AC_MSG_RESULT([sparc 32])
79                         ATOMIC_OBJS="noit_atomic_sol_sparcv8plus.o"
80                 else
81                         AC_MSG_RESULT([intel 32])
82                         ATOMIC_OBJS="noit_atomic_sol_x86_32.o"
83                 fi
84         fi
85         if test "x$CC" != "xgcc" ; then
86                 CFLAGS="$CFLAGS -mt"
87         fi
88         PICFLAGS="-Kpic"
89         MODULELD="$CC -G"
90         SHLD="$CC -G"
91         MODULEEXT=so
92         RLDFLAG="-R"
93         WHOLE_ARCHIVE="-Wl,-z -Wl,allextract"
94         NOWHOLE_ARCHIVE="-Wl,-z -Wl,defaultextract"
95         ;;
96 *-*-openbsd*)
97         PICFLAGS="-fpic"
98         LDFLAGS="$LDFLAGS -Wl,-E"
99         MODULELD="$CC -shared"
100         SHLD="$CC -shared"
101         MODULEEXT=so
102         LDFLAGS="$LDFLAGS -L/usr/local/lib"
103         CFLAGS="$CFLAGS -I/usr/local/include"
104         RLDFLAG="-Wl,--rpath="
105         WHOLE_ARCHIVE="-Wl,--whole-archive"
106         NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
107         ;;
108 *-*-linux*)
109         LDFLAGS="$LDFLAGS -Wl,-E"
110         CPPFLAGS="$CPPFLAGS"
111         PICFLAGS="-fpic"
112         MODULELD="$CC -shared"
113         SHLD="$CC -shared"
114         MODULEEXT=so
115         RLDFLAG="-Wl,--rpath="
116         WHOLE_ARCHIVE="-Wl,--whole-archive"
117         NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
118         ;;
119 *-*-freebsd*)
120         PICFLAGS="-fpic"
121         MODULELD="$CC -shared"
122         LDFLAGS="$LDFLAGS -export-dynamic -L/usr/local/lib"
123         CFLAGS="$CFLAGS -DCOMPAT_43TTY -I/usr/local/include"
124         MODULEEXT=so
125         RLDFLAG="-Wl,--rpath="
126         ;;
127 *)
128         PICFLAGS="-fpic"
129         MODULELD="$CC -shared"
130         MODULEEXT=so
131         RLDFLAG="-Wl,--rpath="
132         ;;
133 esac
134 AC_SUBST(DTRACE)
135 AC_SUBST(DTRACE_ENABLED)
136 if test "x$DTRACE_ENABLED" = "x1" ; then
137         AC_DEFINE(DTRACE_ENABLED)
138 fi
139 AC_SUBST(DTRACEOBJ)
140 AC_SUBST(DTRACEHDR)
141 AC_SUBST(DTRACEFLAGS)
142 AC_SUBST(SHLD)
143 AC_SUBST(RLDFLAG)
144 AC_SUBST(DEPFLAGS)
145 AC_SUBST(MODULELD)
146 AC_SUBST(MODULEEXT)
147 AC_SUBST(WHOLE_ARCHIVE)
148 AC_SUBST(NOWHOLE_ARCHIVE)
149 AC_SUBST(ATOMIC_OBJS)
150 AC_DEFINE_UNQUOTED(MODULEEXT, "$MODULEEXT", [module extension])
151 AC_MSG_CHECKING([enable build/install of the Java IEP and Jezebel bits])
152
153 if test -z "$ac_cv_path_JAVA" \
154         -o -z "$ac_cv_path_JAVAC" \
155         -o -z "$ac_cv_path_JAR" ; then
156         AC_MSG_RESULT([no])
157 else
158         if $ac_cv_path_JAVA -cp buildtools version 1.6 ; then
159                 JAVAPARTS=java
160                 AC_MSG_RESULT([yes])
161         else
162                 JVERSION=`$ac_cv_path_JAVA -cp buildtools version 1.6`
163                 AC_MSG_RESULT([too old: $JVERSION]);
164         fi
165 fi
166 AC_SUBST(JAVAPARTS)
167
168 # Checks for data types
169 AC_CHECK_SIZEOF(char, 1)
170 AC_CHECK_SIZEOF(short int, 2)
171 AC_CHECK_SIZEOF(int, 4)
172 AC_CHECK_SIZEOF(long int, 4)
173 AC_CHECK_SIZEOF(long long int, 8)
174 AC_CHECK_SIZEOF(void *, 1)
175
176 AC_CHECK_LIB(umem, umem_cache_create, , )
177 AC_CHECK_LIB(z, compress2, , [AC_MSG_ERROR(*** zlib is required ***)])
178 AC_CHECK_LIB(rt, sem_init, , )
179 AC_CHECK_LIB(posix4, sem_wait, , )
180 AC_CHECK_LIB(pthread, pthread_create, , )
181 AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, ,
182              [AC_MSG_ERROR(libprotobuf-c required)])
183
184 AC_CHECK_FUNC(uuid_generate, , [
185   AC_MSG_WARN([uuid_generate not available])
186   AC_SEARCH_LIBS(uuid_generate, uuid e2fs-uuid, , [AC_MSG_ERROR(*** uuid is required ***)])])
187
188 # Some libraries provide an unparse_lower command
189 # we use that, so if it isn't present, we'll need
190 # to implement it.
191 AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE(HAVE_UUID_UNPARSE_LOWER)], )
192 AC_CHECK_LIB(util, openpty, , )
193 AC_CHECK_LIB(termcap, tputs, , )
194 AC_CHECK_LIB(curses, clear, , [AC_MSG_ERROR([curses not found, but required])])
195
196 CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
197 LDFLAGS="$LDFLAGS `pcre-config --libs`"
198 AC_CHECK_LIB(pcre, pcre_compile, ,
199         [
200                 AC_MSG_ERROR([libpcre not found, but required])
201         ]
202 )
203 AC_CHECK_LIB(crypto, ERR_load_CRYPTO_strings, ,
204         [
205                 AC_MSG_ERROR([libcrypto not found, but required])
206         ]
207 )
208 AC_CHECK_LIB(ssl, SSL_library_init, ,
209         [
210                 AC_MSG_ERROR([libssl not found, but required])
211         ]
212 )
213
214 old_LIBS="$LIBS"
215 old_CFLAGS="$CFLAGS"
216 AC_CHECK_LIB(pq, PQconnectdb,
217         [
218                 LIBS="$LIBS -lpq"
219                 PGLIBS="$LIBS"
220                 AC_SUBST(PGLIBS)
221         ],
222         [
223                 AC_MSG_ERROR([libpq required])
224         ]
225 )
226
227 AC_MSG_CHECKING([libpq includes])
228 PQICFLAGS=`pg_config --includedir`
229 if test -n "$PQICFLAGS" ; then
230   CFLAGS="$CFLAGS -I$PQICFLAGS"
231 fi
232
233 AC_TRY_LINK([
234         #include <libpq-fe.h>
235         ],
236         [ PGconn *dbh = PQconnectdb(""); ],
237         [],
238         [ AC_MSG_ERROR([Cannot compile/link against libpq]) ]
239 )
240 PGCFLAGS=$CFLAGS
241 AC_SUBST(PGCFLAGS)
242 LIBS=$old_LIBS
243 CFLAGS=$old_CFLAGS
244
245 AC_CHECK_HEADERS(mysql.h mysql/mysql.h)
246
247 if test "$ac_cv_header_mysql_h" = "no" -a "$ac_cv_header_mysql_mysql_h" = "no" ; then
248         AC_MSG_WARN([No libmysqlclient, skipping mysql module])
249         AC_SUBST(MYCFLAGS)
250         AC_SUBST(MYLIBS)
251 else
252         LIBS=$old_LIBS
253         CFLAGS=$old_CFLAGS
254        
255         if test -z "$MYLIBS" ; then
256           MYLIBS="-lmysqlclient_r -lz -lssl -lcrypto"
257         fi
258        
259         old_CFLAGS=$CFLAGS
260         old_LIBS=$LIBS
261         CFLAGS="$CFLAGS $MYCFLAGS"
262         LIBS="$MYLIBS"
263        
264         AC_CHECK_FUNC(mysql_real_connect,
265                 [
266                         BUILD_MODULES="$BUILD_MODULES mysql.$MODULEEXT"
267                         MYCFLAGS="$CFLAGS"
268                         MYLIBS="$LIBS"
269                         AC_SUBST(MYCFLAGS)
270                         AC_SUBST(MYLIBS)
271                 ],
272                 [
273                         AC_MSG_WARN([No libmysqlclient, skipping mysql module])
274                         AC_SUBST(MYCFLAGS)
275                         AC_SUBST(MYLIBS)
276                 ]
277         )
278        
279        
280         LIBS=$old_LIBS
281         CFLAGS=$old_CFLAGS
282 fi
283
284 ########
285 #
286 # CHECK FOR VARIOUS MODULE CRITERIA
287 # We don't track the libs themselves, as we'll just explictly link
288 # against the in the makefile if we enable them to build (by adding
289 # them to the BUILD_MODULES list).
290 #
291 ########
292
293 # Should we build snmp checks?
294 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
295 if test "$ac_cv_header_net_snmp_net_snmp_config_h" = "yes" ; then
296 SAVELIBS="$LIBS"
297 AC_CHECK_LIB(netsnmp, snmp_sess_open,
298         [
299                 BUILD_MODULES="$BUILD_MODULES snmp.$MODULEEXT"
300         ],
301         [
302                 AC_MSG_WARN([No libnetsnmp, skipping snmp module])
303         ]
304 )
305 LIBS="$SAVELIBS"
306 else
307         AC_MSG_WARN([No libnetsnmp, skipping snmp module])
308 fi
309
310 # Should we build ssh2 checks?
311 SAVELIBS="$LIBS"
312 AC_CHECK_LIB(ssh2, libssh2_session_init_ex,
313         [
314                 BUILD_MODULES="$BUILD_MODULES ssh2.$MODULEEXT"
315         ],
316         [
317                 AC_MSG_WARN([No libssh2, skipping ssh2 module])
318         ]
319 )
320 LIBS="$SAVELIBS"
321
322 AC_MSG_CHECKING([libxml2 cflags])
323 XML2CFLAGS=`xml2-config --cflags`
324 CFLAGS="$CFLAGS $XML2CFLAGS"
325 AC_MSG_RESULT([$XML2CFLAGS])
326
327 AC_MSG_CHECKING([libxml2 libs])
328 XML2LIBS=`xml2-config --libs`
329 LIBS="$LIBS $XML2LIBS"
330 AC_MSG_RESULT([$XML2LIBS])
331
332 AC_CHECK_FUNC(xmlParseDocument, , [AC_MSG_ERROR(*** libxml2 is required ***)])
333
334 AC_MSG_CHECKING([libxslt cflags])
335 XSLTCFLAGS=`xslt-config --cflags`
336 CFLAGS="$CFLAGS $XSLTCFLAGS"
337 AC_MSG_RESULT([$XSLTCFLAGS])
338
339 AC_MSG_CHECKING([libxslt libs])
340 XSLTLIBS=`xslt-config --libs`
341 LIBS="$LIBS $XSLTLIBS"
342 AC_MSG_RESULT([$XSLTLIBS])
343
344 AC_CHECK_FUNC(xsltParseStylesheetDoc, , [AC_MSG_ERROR(*** libxslt is required ***)])
345
346 APRPREFIX="`apr-1-config --prefix`"
347 AC_SUBST(APRPREFIX)
348 AC_MSG_RESULT([$APRPREFIX])
349
350 AC_MSG_CHECKING([libapr cflags])
351 APRCFLAGS="`apr-1-config --cflags --cppflags --includes`"
352 AC_SUBST(APRCFLAGS)
353 AC_MSG_RESULT([$APRCFLAGS])
354
355 AC_MSG_CHECKING([libapr libs])
356 APRLIBS="`apr-1-config --link-ld --ldflags --libs`"
357 AC_SUBST(APRLIBS)
358 AC_MSG_RESULT([$APRLIBS])
359
360 AC_TRY_LINK([],
361         [ issetugid(); ],
362         [ ac_cv_libc_defines_issetugid="yes" ],
363         [ ac_cv_libc_defines_issetugid="no" ]
364 )
365 if test "x$ac_cv_libc_defines_issetugid" = "xyes" ; then
366         AC_DEFINE(HAVE_ISSETUGID)
367 fi
368
369 AC_MSG_CHECKING([whether sem_init works])
370 AC_TRY_RUN(
371         [
372 #include <semaphore.h>
373 int main(void){sem_t s;return (0 != sem_init(&s,0,0));}
374         ],
375         [
376                 AC_MSG_RESULT(yes)
377                 AC_DEFINE(WORKING_SEM_INIT)
378         ],
379         [
380                 AC_MSG_RESULT(no)
381                 AC_MSG_WARN([****** sem_init() is broken, I'll implement one myself.])
382         ]
383 )
384
385 AC_FUNC_STRFTIME
386 AC_CHECK_FUNCS(ssetugid strlcpy strnstrn openpty inet_pton inet_ntop getopt \
387                poll vasprintf)
388
389 # Checks for header files.
390 AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \
391                  sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \
392                  ctype.h unistd.h time.h pty.h sys/stat.h sys/event.h libkern/OSAtomic.h \
393                  termio.h termios.h curses.h sys/cdefs.h grp.h netinet/in_systm.h \
394                  sys/ioctl_compat.h sys/filio.h util.h sys/time.h sys/mman.h \
395                  sys/ioctl.h stropts.h sys/stream.h alloca.h sys/wait.h bsd/libutil.h libutil.h)
396 AC_CHECK_HEADERS([term.h], [], [],
397      [[#ifdef HAVE_CURSES_H
398      # include <curses.h>
399      #endif
400      ]])
401
402 AC_CHECK_DECLS([openpty], [], [],
403                 [#if defined(HAVE_SYS_TYPES_H)
404                  # include <sys/types.h>
405                  #endif
406                  #if defined(HAVE_SYS_IOCTL_H)
407                  # include <sys/ioctl.h>
408                  #endif
409                  #if defined(HAVE_TERMIOS_H)
410                  # include <termios.h>
411                  #endif
412                  #if defined(HAVE_BSD_LIBUTIL_H)
413                  # include <bsd/libutil.h>
414                  #elif defined(HAVE_LIBUTIL_H)
415                  # include <libutil.h>
416                  #endif
417                  #if defined(HAVE_UTIL_H)
418                  # include <util.h>
419                  #endif
420                  #if defined(HAVE_PTY_H)
421                  # include <pty.h>
422                  #endif
423                 ])
424
425 AC_CHECK_FUNCS(getpwnam_r)
426 GETPWNAM_R_POSIX
427 AC_CHECK_FUNCS(getgrnam_r)
428 GETGRNAM_R_POSIX
429
430 AC_MSG_CHECKING(for tputs() function final argument type)
431 AC_EGREP_CPP([tputs.*[(][       ]*char[         ]*[)]],
432                 [#if defined(HAVE_TERM_H)
433                  #include <term.h>
434                  #endif
435                  #if defined(HAVE_CURSES_H)
436                  #include <curses.h>
437                  #endif],
438                 [AC_MSG_RESULT(char)
439                  AC_DEFINE(TPUTS_TAKES_CHAR)],
440                 [AC_MSG_RESULT(not char)])
441
442 AC_CACHE_CHECK([for epoll support], ac_cv_have_epoll, [
443         AC_TRY_LINK(
444                 [ #include <sys/types.h> ],
445                 [ u_int a; a = epoll_create(); ],
446                 [ ac_cv_have_epoll="yes" ],
447                 [ ac_cv_have_epoll="no" ]
448         )
449 ])
450 if test "x$ac_cv_have_epoll" = "xyes" ; then
451         AC_DEFINE(HAVE_EPOLL)
452         EVENTER_OBJS="$EVENTER_OBJS eventer_epoll_impl.o"
453         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "epoll")
454         have_epoll=1
455 fi
456
457 AC_CACHE_CHECK([for kqueue support], ac_cv_have_kqueue, [
458         AC_TRY_LINK(
459                 [ #include <sys/types.h> ],
460                 [ u_int a; a = kqueue(); ],
461                 [ ac_cv_have_kqueue="yes" ],
462                 [ ac_cv_have_kqueue="no" ]
463         )
464 ])
465 if test "x$ac_cv_have_kqueue" = "xyes" ; then
466         AC_DEFINE(HAVE_KQUEUE)
467         EVENTER_OBJS="$EVENTER_OBJS eventer_kqueue_impl.o"
468         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "kqueue")
469         have_kqueue=1
470 fi
471
472 AC_CACHE_CHECK([for Solaris ports support], ac_cv_have_ports, [
473         AC_TRY_LINK(
474                 [ #include <port.h> ],
475                 [ u_int a; a = port_create(); ],
476                 [ ac_cv_have_ports="yes" ],
477                 [ ac_cv_have_ports="no" ]
478         )
479 ])
480 if test "x$ac_cv_have_ports" = "xyes" ; then
481         AC_DEFINE(HAVE_PORTS)
482         EVENTER_OBJS="$EVENTER_OBJS eventer_ports_impl.o"
483         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "ports")
484         have_ports=1
485 fi
486
487 AC_SUBST(EVENTER_OBJS)
488
489 AC_CACHE_CHECK([for posix_readdir_r], ac_cv_have_posix_readdir_r, [
490         AC_TRY_COMPILE(
491                 [ #include <dirent.h> ],
492                 [ struct dirent *dep, de; readdir_r("/", &de, &dep); ],
493                 [ ac_cv_have_posix_readdir_r="yes" ],
494                 [ ac_cv_have_posix_readdir_r="no" ]
495         )
496 ])
497 if test "x$ac_cv_have_posix_readdir_r" = "xyes" ; then
498         AC_DEFINE(HAVE_POSIX_READDIR_R)
499         have_posix_readdir_r=1
500 fi
501
502 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
503         AC_TRY_COMPILE(
504                 [ #include <sys/types.h> ],
505                 [ u_int a; a = 1;],
506                 [ ac_cv_have_u_int="yes" ],
507                 [ ac_cv_have_u_int="no" ]
508         )
509 ])
510 if test "x$ac_cv_have_u_int" = "xyes" ; then
511         AC_DEFINE(HAVE_U_INT)
512         have_u_int=1
513 fi
514
515 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
516         AC_TRY_COMPILE(
517                 [ #include <sys/types.h> ],
518                 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
519                 [ ac_cv_have_intxx_t="yes" ],
520                 [ ac_cv_have_intxx_t="no" ]
521         )
522 ])
523 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
524         AC_DEFINE(HAVE_INTXX_T)
525         have_intxx_t=1
526 fi
527        
528 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
529         AC_TRY_COMPILE(
530                 [ #include <sys/types.h> ],
531                 [ int64_t a; a = 1;],
532                 [ ac_cv_have_int64_t="yes" ],
533                 [ ac_cv_have_int64_t="no" ]
534         )
535 ])
536 if test "x$ac_cv_have_int64_t" = "xyes" ; then
537         AC_DEFINE(HAVE_INT64_T)
538         have_int64_t=1
539 fi
540        
541 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
542         AC_TRY_COMPILE(
543                 [ #include <sys/types.h> ],
544                 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
545                 [ ac_cv_have_u_intxx_t="yes" ],
546                 [ ac_cv_have_u_intxx_t="no" ]
547         )
548 ])
549 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
550         AC_DEFINE(HAVE_U_INTXX_T)
551         have_u_intxx_t=1
552 fi
553
554 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
555         AC_TRY_COMPILE(
556                 [ #include <sys/types.h> ],
557                 [ u_int64_t a; a = 1;],
558                 [ ac_cv_have_u_int64_t="yes" ],
559                 [ ac_cv_have_u_int64_t="no" ]
560         )
561 ])
562 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
563         AC_DEFINE(HAVE_U_INT64_T)
564         have_u_int64_t=1
565 fi
566
567 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
568            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
569 then
570         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
571         AC_TRY_COMPILE(
572                 [
573 #include <sys/bitypes.h>
574                 ],
575                 [
576                         int8_t a; int16_t b; int32_t c;
577                         u_int8_t e; u_int16_t f; u_int32_t g;
578                         a = b = c = e = f = g = 1;
579                 ],
580                 [
581                         AC_DEFINE(HAVE_U_INTXX_T)
582                         AC_DEFINE(HAVE_INTXX_T)
583                         AC_MSG_RESULT(yes)
584                 ],
585                 [AC_MSG_RESULT(no)]
586         )
587 fi
588
589 if test -z "$have_u_intxx_t" ; then
590         AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
591                 AC_TRY_COMPILE(
592                         [
593 #include <sys/types.h>
594                         ],
595                         [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
596                         [ ac_cv_have_uintxx_t="yes" ],
597                         [ ac_cv_have_uintxx_t="no" ]
598                 )
599         ])
600         if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
601                 AC_DEFINE(HAVE_UINTXX_T)
602         fi
603 fi
604
605 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
606         AC_TRY_COMPILE(
607                 [
608 #include <sys/types.h>
609 #include <sys/socket.h>
610                 ],
611                 [socklen_t foo; foo = 1235;],
612                 [ ac_cv_have_socklen_t="yes" ],
613                 [ ac_cv_have_socklen_t="no" ]
614         )
615 ])
616 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
617         AC_DEFINE(HAVE_SOCKLEN_T)
618 fi
619
620 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
621         AC_TRY_COMPILE(
622                 [
623 #include <sys/types.h>
624                 ],
625                 [ size_t foo; foo = 1235; ],
626                 [ ac_cv_have_size_t="yes" ],
627                 [ ac_cv_have_size_t="no" ]
628         )
629 ])
630 if test "x$ac_cv_have_size_t" = "xyes" ; then
631         AC_DEFINE(HAVE_SIZE_T)
632 fi
633
634 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
635         AC_TRY_COMPILE(
636                 [
637 #include <sys/types.h>
638                 ],
639                 [ ssize_t foo; foo = 1235; ],
640                 [ ac_cv_have_ssize_t="yes" ],
641                 [ ac_cv_have_ssize_t="no" ]
642         )
643 ])
644 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
645         AC_DEFINE(HAVE_SSIZE_T)
646 fi
647
648 AC_SUBST(BUILD_MODULES)
649
650 docdir="docs"
651 mansubdir="man"
652 AC_SUBST(docdir)
653 AC_SUBST(mansubdir)
654 SHCFLAGS="$PICFLAGS $CFLAGS"
655 AC_SUBST(SHCFLAGS)
656
657 SUBPREFIX="$prefix"
658 if test "x$prefix" = "xNONE"; then
659   SUBPREFIX="$ac_default_prefix"
660 fi
661 AC_MSG_CHECKING([Resolving libexec path...])
662 fullpath=$libexecdir
663 while test "x$temppath" != "x$fullpath" ; do
664   temppath=$fullpath
665   fullpath=`eval echo ${fullpath}`
666 done
667 fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
668 AC_MSG_RESULT([$fullpath/noit])
669 AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}/noit")
670 MODULES_DIR=${fullpath}/noit
671 AC_SUBST(MODULES_DIR)
672
673 JAVA_LIB_DIR="$prefix/java"
674 AC_ARG_WITH(java-libdir,
675         [--with-javalibdir=PFX  prefix to install java libs (optional)],
676         [JAVA_LIB_DIR=$withval],)
677 AC_MSG_CHECKING([Resolving javalibdir path...])
678 fullpath=$JAVA_LIB_DIR
679 while test "x$temppath" != "x$fullpath" ; do
680   temppath=$fullpath
681   fullpath=`eval echo ${fullpath}`
682 done
683 fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
684 JAVA_LIB_DIR=$fullpath
685 AC_MSG_RESULT([$fullpath])
686 AC_SUBST(JAVA_LIB_DIR)
687
688 AC_MSG_CHECKING([Resolving sysconfdir path...])
689 fullpath=$sysconfdir
690 while test "x$temppath" != "x$fullpath" ; do
691   temppath=$fullpath
692   fullpath=`eval echo ${fullpath}`
693 done
694 fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
695 AC_MSG_RESULT([$fullpath])
696 AC_DEFINE_UNQUOTED(ETC_DIR, "${fullpath}")
697 ETC_DIR=${fullpath}
698 AC_SUBST(ETC_DIR)
699
700 if test -n "`$CC -V 2>&1 | grep 'Sun C'`"; then
701   if test "$enable_string" != "no"; then
702     CFLAGS="$CFLAGS -errwarn=%all"
703   fi
704 else
705   CFLAGS="$CFLAGS -Wall"
706   if test "$enable_strict" != "no"; then
707     CFLAGS="$CFLAGS -Werror"
708   fi
709 fi
710
711 AC_OUTPUT([
712 Makefile
713 src/Makefile
714 src/eventer/Makefile
715 src/jlog/Makefile
716 src/jlog/perl/Makefile.PL
717 src/udns/Makefile
718 src/json-lib/Makefile
719 src/man/Makefile
720 src/modules/Makefile
721 src/modules-lua/Makefile
722 src/utils/Makefile
723 src/noitedit/Makefile
724 src/lua/Makefile
725 src/java/Makefile
726 src/java/run-iep.sh
727 src/java/jezebel
728 src/scripts/noit-config
729 sql/Makefile
730 test/Makefile
731 ])
Note: See TracBrowser for help on using the browser.