root/configure.in

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

Sol10 doesn't define this, so we need to

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