root/configure.in

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

this was causing utils to always rebuild

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