root/configure.in

Revision 6131ae87f1f4d61b94dfd16f280384290a3e65f8, 16.3 kB (checked in by Piotr Sikora <piotr.sikora@frickle.com>, 4 years ago)

Correctly detect availability of openpty().

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