root/configure.in

Revision 1afc481c967d050a3b31e85890ecba5b6fc80c67, 15.8 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 years ago)

fixes #360

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