root/configure.in

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

builds out of the box on Illumos with gcc now

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