Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 765 lines (699 sloc) 18.593 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765
AC_INIT(src/noitd.c)

node=`hostname | cut -f1 -d '.' | tr '[A-Z]' '[a-z]'`
if test -f ".configure.$node"; then
echo "***********************************************************"
        echo "* Loading node specific configure settings for $node."
echo "***********************************************************"
. ./.configure.$node
fi

AC_CANONICAL_HOST
AC_CONFIG_HEADER(src/noit_config.h)
AC_CONFIG_HEADER(src/jlog/jlog_config.h)

AC_ARG_ENABLE(strict,
    [AC_HELP_STRING([--enable-strict],
                    [Compile with warnings treated as errors])],
                    enable_strict="$enableval",
                    enable_strict=no)

AC_PROG_CC
AC_C_INLINE
AC_C_BIGENDIAN
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(AR, ar)
AC_PATH_PROGS(PERL, perl)
AC_PATH_PROGS(XSLTPROC, xsltproc)
AC_PATH_PROGS(XMLLINT, xmllint)
AC_PATH_PROGS(JAVA, java)
AC_PATH_PROGS(JAVA, java, , $JAVA_HOME/bin)
AC_PATH_PROGS(JAVAC, javac)
AC_PATH_PROGS(JAVAC, javac, , $JAVA_HOME/bin)
AC_PATH_PROGS(JAR, jar)
AC_PATH_PROGS(JAR, jar, , $JAVA_HOME/bin)
AC_PATH_PROG(NROFF, nroff)
AC_SUBST(PERL)

if test "x$GCC" = "xyes" ; then
  CFLAGS="$CFLAGS -g -std=c99"
  DEPFLAGS="-MM"
else
  CFLAGS="$CFLAGS -g -xc99=all"
  DEPFLAGS="-xM1"
fi

CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200112L "'-I$(top_srcdir)/src'
DTRACEHDR=dtrace_probes.h

case $host in
*-*-darwin*)
DTRACE=/usr/sbin/dtrace
DTRACE_ENABLED=1
PICFLAGS="-fPIC"
CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE"
MODULELD="$CC -bundle -flat_namespace -undefined suppress"
SHLD="$CC -dynamiclib -flat_namespace -undefined suppress"
MODULEEXT=bundle
RLDFLAG="-Wl,--rpath="
;;
*-*-solaris*)
DTRACE=/usr/sbin/dtrace
DTRACE_ENABLED=1
DTRACEOBJ=dtrace_stub.o
CPPFLAGS="$CPPFLAGS -D_XPG6 -D__EXTENSIONS__"
if test "x$GCC" != "xyes" ; then
AC_MSG_CHECKING([32 or 64 bit Solaris assembly])
if test -n "`echo $CFLAGS | grep m64`" ; then
DTRACEFLAGS=-64
if test -n "`isalist | grep sparc`"; then
AC_MSG_RESULT([sparc 64])
ATOMIC_OBJS="noit_atomic_sol_sparcv9.o"
else
AC_MSG_RESULT([intel 64])
ATOMIC_OBJS="noit_atomic_sol_x86_64.o"
fi
else
if test -n "`isalist | grep sparc`"; then
AC_MSG_RESULT([sparc 32])
ATOMIC_OBJS="noit_atomic_sol_sparcv8plus.o"
else
AC_MSG_RESULT([intel 32])
ATOMIC_OBJS="noit_atomic_sol_x86_32.o"
fi
fi
fi
if test "x$GCC" != "xyes" ; then
CFLAGS="$CFLAGS -mt"
PICFLAGS="-Kpic"
MODULELD="$CC -G"
SHLD="$CC -G"
else
PICFLAGS="-fPIC"
MODULELD="$CC -shared"
SHLD="$CC -shared"
fi
MODULEEXT=so
RLDFLAG="-R"
WHOLE_ARCHIVE="-Wl,-z -Wl,allextract"
NOWHOLE_ARCHIVE="-Wl,-z -Wl,defaultextract"
;;
*-*-openbsd*)
PICFLAGS="-fpic"
LDFLAGS="$LDFLAGS -Wl,-E"
MODULELD="$CC -shared"
SHLD="$CC -shared"
MODULEEXT=so
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CFLAGS="$CFLAGS -I/usr/local/include"
RLDFLAG="-Wl,--rpath="
WHOLE_ARCHIVE="-Wl,--whole-archive"
NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
;;
*-*-linux*)
LDFLAGS="$LDFLAGS -Wl,-E"
CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE -D_BSD_SOURCE"
PICFLAGS="-fpic"
MODULELD="$CC -shared"
SHLD="$CC -shared"
MODULEEXT=so
RLDFLAG="-Wl,--rpath="
WHOLE_ARCHIVE="-Wl,--whole-archive"
NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
;;
*-*-freebsd*)
PICFLAGS="-fpic"
MODULELD="$CC -shared"
LDFLAGS="$LDFLAGS -export-dynamic -L/usr/local/lib"
CFLAGS="$CFLAGS -DCOMPAT_43TTY -I/usr/local/include"
MODULEEXT=so
RLDFLAG="-Wl,--rpath="
;;
*)
PICFLAGS="-fpic"
MODULELD="$CC -shared"
MODULEEXT=so
RLDFLAG="-Wl,--rpath="
;;
esac
AC_SUBST(DTRACE)
AC_SUBST(DTRACE_ENABLED)
if test "x$DTRACE_ENABLED" = "x1" ; then
AC_DEFINE(DTRACE_ENABLED)
fi
AC_SUBST(DTRACEOBJ)
AC_SUBST(DTRACEHDR)
AC_SUBST(DTRACEFLAGS)
AC_SUBST(SHLD)
AC_SUBST(RLDFLAG)
AC_SUBST(DEPFLAGS)
AC_SUBST(MODULELD)
AC_SUBST(MODULEEXT)
AC_SUBST(WHOLE_ARCHIVE)
AC_SUBST(NOWHOLE_ARCHIVE)
AC_SUBST(ATOMIC_OBJS)
AC_DEFINE_UNQUOTED(MODULEEXT, "$MODULEEXT", [module extension])
AC_MSG_CHECKING([enable build/install of the Java IEP and Jezebel bits])

if test -z "$ac_cv_path_JAVA" \
-o -z "$ac_cv_path_JAVAC" \
-o -z "$ac_cv_path_JAR" ; then
AC_MSG_RESULT([no])
else
if $ac_cv_path_JAVA -cp buildtools version 1.6 ; then
JAVAPARTS=java
AC_MSG_RESULT([yes])
else
JVERSION=`$ac_cv_path_JAVA -cp buildtools version 1.6`
AC_MSG_RESULT([too old: $JVERSION]);
fi
fi
AC_SUBST(JAVAPARTS)

# Checks for data types
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short int, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long int, 4)
AC_CHECK_SIZEOF(long long int, 8)
AC_CHECK_SIZEOF(void *, 1)

AC_CHECK_LIB(umem, umem_cache_create, , )
AC_CHECK_LIB(z, compress2, , [AC_MSG_ERROR(*** zlib is required ***)])
AC_CHECK_LIB(rt, sem_init, , )
AC_CHECK_LIB(posix4, sem_wait, , )
AC_CHECK_LIB(pthread, pthread_create, , )
AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, ,
             [AC_MSG_ERROR(libprotobuf-c required)])

AC_CHECK_FUNC(uuid_generate, , [
  AC_MSG_WARN([uuid_generate not available])
  AC_SEARCH_LIBS(uuid_generate, uuid e2fs-uuid, , [AC_MSG_ERROR(*** uuid is required ***)])])

# Some libraries provide an unparse_lower command
# we use that, so if it isn't present, we'll need
# to implement it.
AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE(HAVE_UUID_UNPARSE_LOWER)], )
AC_CHECK_LIB(util, openpty, , )
AC_CHECK_LIB(termcap, tputs, , )
AC_CHECK_LIB(curses, clear, , [AC_MSG_ERROR([curses not found, but required])])

CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
LDFLAGS="$LDFLAGS `pcre-config --libs`"
AC_CHECK_LIB(pcre, pcre_compile, ,
[
AC_MSG_ERROR([libpcre not found, but required])
]
)
AC_CHECK_LIB(crypto, ERR_load_CRYPTO_strings, ,
[
AC_MSG_ERROR([libcrypto not found, but required])
]
)
AC_CHECK_LIB(ssl, SSL_library_init, ,
[
AC_MSG_ERROR([libssl not found, but required])
]
)

old_LIBS="$LIBS"
old_CFLAGS="$CFLAGS"
AC_CHECK_LIB(pq, PQconnectdb,
[
LIBS="$LIBS -lpq"
PGLIBS="$LIBS"
AC_SUBST(PGLIBS)
],
[
AC_MSG_ERROR([libpq required])
]
)

AC_MSG_CHECKING([libpq includes])
PQICFLAGS=`pg_config --includedir`
if test -n "$PQICFLAGS" ; then
  CFLAGS="$CFLAGS -I$PQICFLAGS"
fi

AC_TRY_LINK([
#include <libpq-fe.h>
],
[ PGconn *dbh = PQconnectdb(""); ],
[],
[ AC_MSG_ERROR([Cannot compile/link against libpq]) ]
)
PGCFLAGS=$CFLAGS
AC_SUBST(PGCFLAGS)
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS

AC_CHECK_HEADERS(mysql.h mysql/mysql.h)

if test "$ac_cv_header_mysql_h" = "no" -a "$ac_cv_header_mysql_mysql_h" = "no" ; then
AC_MSG_WARN([No libmysqlclient, skipping mysql module])
AC_SUBST(MYCFLAGS)
AC_SUBST(MYLIBS)
else
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS

if test -z "$MYLIBS" ; then
MYLIBS="-lmysqlclient_r -lz -lssl -lcrypto"
fi

old_CFLAGS=$CFLAGS
old_LIBS=$LIBS
CFLAGS="$CFLAGS $MYCFLAGS"
LIBS="$MYLIBS"

AC_CHECK_FUNC(mysql_real_connect,
[
BUILD_MODULES="$BUILD_MODULES mysql.$MODULEEXT"
MYCFLAGS="$CFLAGS"
MYLIBS="$LIBS"
AC_SUBST(MYCFLAGS)
AC_SUBST(MYLIBS)
],
[
AC_MSG_WARN([No libmysqlclient, skipping mysql module])
AC_SUBST(MYCFLAGS)
AC_SUBST(MYLIBS)
]
)


LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
fi

########
#
# CHECK FOR VARIOUS MODULE CRITERIA
# We don't track the libs themselves, as we'll just explictly link
# against the in the makefile if we enable them to build (by adding
# them to the BUILD_MODULES list).
#
########

# Should we build snmp checks?
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
if test "$ac_cv_header_net_snmp_net_snmp_config_h" = "yes" ; then
SAVELIBS="$LIBS"
AC_CHECK_LIB(netsnmp, snmp_sess_open,
[
BUILD_MODULES="$BUILD_MODULES snmp.$MODULEEXT"
],
[
AC_MSG_WARN([No libnetsnmp, skipping snmp module])
]
)
LIBS="$SAVELIBS"
else
AC_MSG_WARN([No libnetsnmp, skipping snmp module])
fi

# Should we build ssh2 checks?
SAVELIBS="$LIBS"
AC_CHECK_LIB(ssh2, libssh2_session_init_ex,
[
BUILD_MODULES="$BUILD_MODULES ssh2.$MODULEEXT"
],
[
AC_MSG_WARN([No libssh2, skipping ssh2 module])
]
)
LIBS="$SAVELIBS"

AC_MSG_CHECKING([libxml2 cflags])
XML2CFLAGS=`xml2-config --cflags`
CFLAGS="$CFLAGS $XML2CFLAGS"
AC_MSG_RESULT([$XML2CFLAGS])

AC_MSG_CHECKING([libxml2 libs])
XML2LIBS=`xml2-config --libs`
LIBS="$LIBS $XML2LIBS"
AC_MSG_RESULT([$XML2LIBS])

AC_CHECK_FUNC(xmlParseDocument, , [AC_MSG_ERROR(*** libxml2 is required ***)])

AC_MSG_CHECKING([libxslt cflags])
XSLTCFLAGS=`xslt-config --cflags`
CFLAGS="$CFLAGS $XSLTCFLAGS"
AC_MSG_RESULT([$XSLTCFLAGS])

AC_MSG_CHECKING([libxslt libs])
XSLTLIBS=`xslt-config --libs`
LIBS="$LIBS $XSLTLIBS"
AC_MSG_RESULT([$XSLTLIBS])

AC_CHECK_FUNC(xsltParseStylesheetDoc, , [AC_MSG_ERROR(*** libxslt is required ***)])

APRPREFIX="`apr-1-config --prefix`"
AC_SUBST(APRPREFIX)
AC_MSG_RESULT([$APRPREFIX])

AC_MSG_CHECKING([libapr cflags])
APRCFLAGS="`apr-1-config --cflags --cppflags --includes`"
AC_SUBST(APRCFLAGS)
AC_MSG_RESULT([$APRCFLAGS])

AC_MSG_CHECKING([libapr libs])
APRLIBS="`apr-1-config --link-ld --ldflags --libs`"
AC_SUBST(APRLIBS)
AC_MSG_RESULT([$APRLIBS])

AC_TRY_LINK([],
[ issetugid(); ],
[ ac_cv_libc_defines_issetugid="yes" ],
[ ac_cv_libc_defines_issetugid="no" ]
)
if test "x$ac_cv_libc_defines_issetugid" = "xyes" ; then
AC_DEFINE(HAVE_ISSETUGID)
fi

AC_MSG_CHECKING([whether sem_init works])
AC_TRY_RUN(
[
#include <semaphore.h>
int main(void){sem_t s;return (0 != sem_init(&s,0,0));}
],
[
AC_MSG_RESULT(yes)
AC_DEFINE(WORKING_SEM_INIT)
],
[
AC_MSG_RESULT(no)
AC_MSG_WARN([****** sem_init() is broken, I'll implement one myself.])
]
)

AC_FUNC_STRFTIME
AC_CHECK_FUNCS(ssetugid strlcpy strnstrn openpty inet_pton inet_ntop getopt \
               poll vasprintf)

# Checks for header files.
AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \
                 sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \
                 ctype.h unistd.h time.h pty.h sys/stat.h sys/event.h libkern/OSAtomic.h \
                 termio.h termios.h curses.h sys/cdefs.h grp.h netinet/in_systm.h \
                 sys/ioctl_compat.h sys/filio.h util.h sys/time.h sys/mman.h \
                 sys/ioctl.h stropts.h sys/stream.h alloca.h sys/wait.h bsd/libutil.h libutil.h)
AC_CHECK_HEADERS([term.h], [], [],
     [[#ifdef HAVE_CURSES_H
     # include <curses.h>
     #endif
     ]])

AC_CHECK_DECLS([openpty], [], [],
[#if defined(HAVE_SYS_TYPES_H)
# include <sys/types.h>
#endif
#if defined(HAVE_SYS_IOCTL_H)
# include <sys/ioctl.h>
#endif
#if defined(HAVE_TERMIOS_H)
# include <termios.h>
#endif
#if defined(HAVE_BSD_LIBUTIL_H)
# include <bsd/libutil.h>
#elif defined(HAVE_LIBUTIL_H)
# include <libutil.h>
#endif
#if defined(HAVE_UTIL_H)
# include <util.h>
#endif
#if defined(HAVE_PTY_H)
# include <pty.h>
#endif
])

AC_CHECK_FUNCS(getpwnam_r)
GETPWNAM_R_POSIX
AC_CHECK_FUNCS(getgrnam_r)
GETGRNAM_R_POSIX

AC_MSG_CHECKING(for tputs() function final argument type)
AC_EGREP_CPP([tputs.*[(][ ]*char[ ]*[)]],
[#if defined(HAVE_TERM_H)
#include <term.h>
#endif
#if defined(HAVE_CURSES_H)
#include <curses.h>
#endif],
[AC_MSG_RESULT(char)
AC_DEFINE(TPUTS_TAKES_CHAR)],
[AC_MSG_RESULT(not char)])

AC_MSG_CHECKING(for tgoto() function final argument type)
AC_EGREP_CPP([tgoto.*[(][ ]*char[ ]*],
[#if defined(HAVE_TERM_H)
#include <term.h>
#endif
#if defined(HAVE_CURSES_H)
#include <curses.h>
#endif],
[AC_MSG_RESULT(char)
AC_DEFINE(TGOTO_TAKES_CHAR)],
[AC_MSG_RESULT(not char)])

AC_CACHE_CHECK([for epoll support], ac_cv_have_epoll, [
AC_TRY_LINK(
[ #include <sys/types.h> ],
[ int a; a = epoll_create(); ],
[ ac_cv_have_epoll="yes" ],
[ ac_cv_have_epoll="no" ]
)
])
if test "x$ac_cv_have_epoll" = "xyes" ; then
AC_DEFINE(HAVE_EPOLL)
EVENTER_OBJS="$EVENTER_OBJS eventer_epoll_impl.o"
AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "epoll")
have_epoll=1
fi

AC_CACHE_CHECK([for kqueue support], ac_cv_have_kqueue, [
AC_TRY_LINK(
[ #include <sys/types.h> ],
[ u_int a; a = kqueue(); ],
[ ac_cv_have_kqueue="yes" ],
[ ac_cv_have_kqueue="no" ]
)
])
if test "x$ac_cv_have_kqueue" = "xyes" ; then
AC_DEFINE(HAVE_KQUEUE)
EVENTER_OBJS="$EVENTER_OBJS eventer_kqueue_impl.o"
AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "kqueue")
have_kqueue=1
fi

AC_CACHE_CHECK([for Solaris ports support], ac_cv_have_ports, [
AC_TRY_LINK(
[ #include <port.h> ],
[ u_int a; a = port_create(); ],
[ ac_cv_have_ports="yes" ],
[ ac_cv_have_ports="no" ]
)
])
if test "x$ac_cv_have_ports" = "xyes" ; then
AC_DEFINE(HAVE_PORTS)
EVENTER_OBJS="$EVENTER_OBJS eventer_ports_impl.o"
AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "ports")
have_ports=1
fi

AC_SUBST(EVENTER_OBJS)

AC_CACHE_CHECK([for posix_readdir_r], ac_cv_have_posix_readdir_r, [
AC_TRY_COMPILE(
[ #include <dirent.h> ],
[ struct dirent *dep, de; readdir_r("/", &de, &dep); ],
[ ac_cv_have_posix_readdir_r="yes" ],
[ ac_cv_have_posix_readdir_r="no" ]
)
])
if test "x$ac_cv_have_posix_readdir_r" = "xyes" ; then
AC_DEFINE(HAVE_POSIX_READDIR_R)
have_posix_readdir_r=1
fi

AC_CACHE_CHECK([for sig_t type], ac_cv_have_sig_t, [
AC_TRY_COMPILE(
[ #include <signal.h> ],
[ sig_t a; (void)a;],
[ ac_cv_have_sig_t="yes" ],
[ ac_cv_have_sig_t="no" ]
)
])
if test "x$ac_cv_have_sig_t" = "xyes" ; then
AC_DEFINE(HAVE_SIG_T)
have_sig_t=1
fi

AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int a; a = 1;],
[ ac_cv_have_u_int="yes" ],
[ ac_cv_have_u_int="no" ]
)
])
if test "x$ac_cv_have_u_int" = "xyes" ; then
AC_DEFINE(HAVE_U_INT)
have_u_int=1
fi

AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
[ ac_cv_have_intxx_t="yes" ],
[ ac_cv_have_intxx_t="no" ]
)
])
if test "x$ac_cv_have_intxx_t" = "xyes" ; then
AC_DEFINE(HAVE_INTXX_T)
have_intxx_t=1
fi

AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ int64_t a; a = 1;],
[ ac_cv_have_int64_t="yes" ],
[ ac_cv_have_int64_t="no" ]
)
])
if test "x$ac_cv_have_int64_t" = "xyes" ; then
AC_DEFINE(HAVE_INT64_T)
have_int64_t=1
fi

AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
[ ac_cv_have_u_intxx_t="yes" ],
[ ac_cv_have_u_intxx_t="no" ]
)
])
if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
AC_DEFINE(HAVE_U_INTXX_T)
have_u_intxx_t=1
fi

AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int64_t a; a = 1;],
[ ac_cv_have_u_int64_t="yes" ],
[ ac_cv_have_u_int64_t="no" ]
)
])
if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
AC_DEFINE(HAVE_U_INT64_T)
have_u_int64_t=1
fi

if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
then
AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
AC_TRY_COMPILE(
[
#include <sys/bitypes.h>
],
[
int8_t a; int16_t b; int32_t c;
u_int8_t e; u_int16_t f; u_int32_t g;
a = b = c = e = f = g = 1;
],
[
AC_DEFINE(HAVE_U_INTXX_T)
AC_DEFINE(HAVE_INTXX_T)
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)]
)
fi

if test -z "$have_u_intxx_t" ; then
AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
],
[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
[ ac_cv_have_uintxx_t="yes" ],
[ ac_cv_have_uintxx_t="no" ]
)
])
if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
AC_DEFINE(HAVE_UINTXX_T)
fi
fi

AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
],
[socklen_t foo; foo = 1235;],
[ ac_cv_have_socklen_t="yes" ],
[ ac_cv_have_socklen_t="no" ]
)
])
if test "x$ac_cv_have_socklen_t" = "xyes" ; then
AC_DEFINE(HAVE_SOCKLEN_T)
fi

AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
],
[ size_t foo; foo = 1235; ],
[ ac_cv_have_size_t="yes" ],
[ ac_cv_have_size_t="no" ]
)
])
if test "x$ac_cv_have_size_t" = "xyes" ; then
AC_DEFINE(HAVE_SIZE_T)
fi

AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
],
[ ssize_t foo; foo = 1235; ],
[ ac_cv_have_ssize_t="yes" ],
[ ac_cv_have_ssize_t="no" ]
)
])
if test "x$ac_cv_have_ssize_t" = "xyes" ; then
AC_DEFINE(HAVE_SSIZE_T)
fi

AC_SUBST(BUILD_MODULES)

docdir="docs"
mansubdir="man"
AC_SUBST(docdir)
AC_SUBST(mansubdir)
SHCFLAGS="$PICFLAGS $CFLAGS"
AC_SUBST(SHCFLAGS)

SUBPREFIX="$prefix"
if test "x$prefix" = "xNONE"; then
  SUBPREFIX="$ac_default_prefix"
fi
AC_MSG_CHECKING([Resolving libexec path...])
fullpath=$libexecdir
while test "x$temppath" != "x$fullpath" ; do
  temppath=$fullpath
  fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
AC_MSG_RESULT([$fullpath/noit])
AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}/noit")
MODULES_DIR=${fullpath}/noit
AC_SUBST(MODULES_DIR)

JAVA_LIB_DIR="$prefix/java"
AC_ARG_WITH(java-libdir,
[--with-javalibdir=PFX prefix to install java libs (optional)],
[JAVA_LIB_DIR=$withval],)
AC_MSG_CHECKING([Resolving javalibdir path...])
fullpath=$JAVA_LIB_DIR
while test "x$temppath" != "x$fullpath" ; do
  temppath=$fullpath
  fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
JAVA_LIB_DIR=$fullpath
AC_MSG_RESULT([$fullpath])
AC_SUBST(JAVA_LIB_DIR)

AC_MSG_CHECKING([Resolving sysconfdir path...])
fullpath=$sysconfdir
while test "x$temppath" != "x$fullpath" ; do
  temppath=$fullpath
  fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
AC_MSG_RESULT([$fullpath])
AC_DEFINE_UNQUOTED(ETC_DIR, "${fullpath}")
ETC_DIR=${fullpath}
AC_SUBST(ETC_DIR)

if test -n "`$CC -V 2>&1 | grep 'Sun C'`"; then
  if test "$enable_string" != "no"; then
    CFLAGS="$CFLAGS -errwarn=%all"
  fi
else
  CFLAGS="$CFLAGS -Wall"
  if test "$enable_strict" != "no"; then
    CFLAGS="$CFLAGS -Werror"
  fi
fi

AC_OUTPUT([
Makefile
src/Makefile
src/eventer/Makefile
src/jlog/Makefile
src/jlog/perl/Makefile.PL
src/udns/Makefile
src/json-lib/Makefile
src/yajl-lib/Makefile
src/man/Makefile
src/modules/Makefile
src/modules-lua/Makefile
src/utils/Makefile
src/noitedit/Makefile
src/lua/Makefile
src/java/Makefile
src/java/run-iep.sh
src/java/jezebel
src/scripts/noit-config
sql/Makefile
test/Makefile
])
Something went wrong with that request. Please try again.