root/configure.in

Revision 360c4e69486a75ae673ac8f9c2370b64326280a5, 16.6 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

uuid fix for OpenBSD: Paul Mackiewicz

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