root/configure.in

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

only use -errwarn=%all if the compiler reports as 'Sun C'

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