dnl $Id: configure.in,v 1.8.2.1 2006/08/19 22:51:37 marius Exp $ AC_INIT(include/nylon.h) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(nylon, 1.21) AM_CONFIG_HEADER(include/config.h) AC_PROG_MAKE_SET dnl intitialization if test "x$prefix" = "xNONE"; then prefix="/usr/local" fi dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB AC_PROG_INSTALL dnl Platform specific stuff case "$host" in *-*-hpux*) AC_DEFINE(SPT_TYPE,SPT_PSTAT) LIBS="$LIBS -lxnet -lsec" ;; esac dnl Checks for standard libraries. Solaris sucks ... AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(resolv, hstrerror) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT dnl Check for __progname; from OpenSSHp AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ AC_TRY_LINK([], [ extern char *__progname; printf("%s", __progname); ], [ ac_cv_libc_defines___progname="yes" ], [ ac_cv_libc_defines___progname="no" ] ) ]) if test "x$ac_cv_libc_defines___progname" = "xyes" ; then AC_DEFINE(HAVE___PROGNAME) fi AC_CHECK_HEADERS(sys/ioctl.h sys/time.h unistd.h sys/queue.h) if test "x$ac_cv_header_sys_queue_h" = "xyes"; then AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h) AC_EGREP_CPP(yes, [ #include #ifdef TAILQ_FOREACH yes #endif ], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TAILQFOREACH) ], AC_MSG_RESULT(no) ) fi if test "x$ac_cv_header_sys_queue_h" = "xyes"; then AC_MSG_CHECKING(for LIST_FIRST sys/queue.h) AC_EGREP_CPP(yes, [ #include #ifdef LIST_FIRST yes #endif ], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LISTFIRST) ], AC_MSG_RESULT(no) ) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_CHECK_TYPE(u_int64_t, unsigned long long) AC_CHECK_TYPE(u_int32_t, unsigned int) AC_CHECK_TYPE(u_int16_t, unsigned short) AC_CHECK_TYPE(u_int8_t, unsigned char) AC_CHECK_TYPE(in_addr_t, unsigned long) AC_CHECK_TYPE(socklen_t, unsigned int) dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_FUNCS(socket) dnl XXX - this is kind of hacky; we don't incorporate 'err' here since if it dnl is needed, that symbol will already by in libevent. FIX THIS, though. AC_REPLACE_FUNCS(strlcpy strlcat strsep setproctitle daemon) dnl Checks for libevent AC_MSG_CHECKING(for libevent) AC_ARG_WITH(libevent, [ --with-libevent=DIR use libevent in DIR], [ case "$withval" in yes|no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT($withval) if test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi EVENTINC="-I$withval/include" EVENTLIB="-L$withval/lib -levent" elif test -f $withval/event.h -a -f $withval/libevent.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi EVENTINC="-I$withval" EVENTLIB="-L$withval -levent" else AC_ERROR(event.h or libevent.a not found in $withval) fi ;; esac ], [ if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.a; then EVENTINC="-I${prefix}/include" EVENTLIB="-L${prefix}/lib -levent" elif test -f /usr/include/event.h; then EVENTLIB="-levent" else AC_MSG_RESULT(no) AC_ERROR(libevent not found) fi AC_MSG_RESULT(yes) ] ) AC_SUBST(EVENTINC) AC_SUBST(EVENTLIB) if test "x${sysconfdir}" = 'x${prefix}/etc'; then csysconfdir="${prefix}/etc" else csysconfdir="${sysconfdir}" fi AC_DEFINE_UNQUOTED(SYSCONFDIR, "${csysconfdir}") AC_OUTPUT(Makefile src/Makefile man/Makefile include/Makefile)