root/configure.in

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

refs #294 resmon no support arbitrary json objects

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