root/configure.in

Revision 520106c37dca8dd9921431f0385fa4a74fecf4d5, 16.3 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

support versioning from git

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