root/configure.in

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

Make sure we compile with clang (trunk) on Ubuntu 11.10

This is a good milestone, so let's do an intermediate commit:
At this point we are able to compile with Clang (trunk, no less;)
on Ubuntu 11.10. I was careful with the introduced changes not to
introduce any regressions:

* bsd/libutil.h is prefered, otherwise we fallback to libutil.h
* replaced isinteger()'s guts with a call to strtod()

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