root/configure.in

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

if we're using gcc on Solaris we want -fPIC

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