dnl Process this file with autoconf to produce a configure script. dnl configure.in for sys-mon created by torbjorn-sysmon@EU.net dnl modified by jared mauch (jared@puck.nether.net) dnl initialize AC_INIT(src/config.h) AC_CONFIG_HEADER(src/defines.h:autoconf/defines.h.in) AC_PREREQ(2.10) AC_PREFIX_DEFAULT(/usr/local) AC_CONFIG_AUX_DIR(autoconf) AC_PROG_MAKE_SET dnl some new options to configure AC_ARG_ENABLE(ssl, [ --disable-ssl don't support ssl], , enable_ssl=yes) AC_ARG_ENABLE(mail, [ --disable-mail don't support mail], , enable_mail=yes) AC_ARG_ENABLE(clients, [ --disable-clients no clients], , enable_clients=yes) AC_ARG_ENABLE(daemon, [ --disable-daemon no daemon], , enable_daemon=yes) AC_ARG_ENABLE(ipv6, [ --enable-ipv6 enable ipv6 support], , enable_v6=yes) dnl search /usr/local/ AC_ADD_SEARCH_PATH(/usr/local/) dnl find some programs AC_PROG_CC AC_PROG_RANLIB AC_PROG_INSTALL AC_PATH_PROGS(SENDMAIL, sendmail, no, $PATH:/usr/sbin:/usr/lib) AC_PATH_PROGS(LEX, flex, no, $PATH:/usr/ccs/bin) AC_PATH_PROGS(LEX, lex, no, $PATH:/usr/ccs/bin) if test "$LEX" = no; then AC_MSG_WARN(without lex or flex sysmon may not compile but give it a try) fi dnl find some headers AC_CHECK_HEADERS(paths.h) dnl find some libraries AC_CHECK_LIB(curses, refresh) AC_CHECK_LIB(ncurses, refresh) AC_CHECK_LIB(nsl, inet_ntoa) AC_CHECK_LIB(fl, yywrap) AC_CHECK_LIB(l, yywrap) AC_CHECK_LIB(pthread, pthread_create) if test "$ac_cv_lib_fl_yywrap" = no; then if test "$ac_cv_lib_l_yywrap" = no; then AC_MSG_WARN(We may not compile as we did not find yywrap. I suggest installing flex. ftp://ftp.gnu.org/gnu/non-gnu/flex/) fi fi AC_CHECK_LIB(socket, getpeername) AC_CHECK_LIB(resolv, gethostname) AC_CHECK_FUNC(gethostbyname, GETHOSTBYNAME=true) if test "$GETHOSTBYNAME" = "true"; then AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [if exists]) fi AC_CHECK_FUNC(gethostbyname2, GETHOSTBYNAME2=true) if test "$GETHOSTBYNAME2" = "true"; then AC_DEFINE(HAVE_GETHOSTBYNAME2, 1, [if exists]) fi AC_CHECK_LIB(c, snprintf, SNP="-DHAVE_SNPRINTF") AC_CHECK_FUNC(snprintf, SNP="-DHAVE_SNPRINTF") AC_CHECK_FUNC(_snprintf, SNP="-DHAVE_SNPRINTF") AC_CHECK_LIB(bsd, revoke) dnl net-snmp requires kstat on solaris usually AC_CHECK_LIB(kstat, main, KSTAT="true") dnl ssl related checks - plus snmp AC_ADD_SEARCH_PATH(/usr/local/ssl) AC_CHECK_LIB(ssl, main, SSL="-DHAVE_SSL") AC_CHECK_LIB(crypto, main, CRYPTO_LIBS="-lcrypto") if test -z "$SSL" ; then AC_MSG_WARN(without openssl SNMP may not work) else SSL_LIBS="-lssl" if test "$KSTAT" = true; then LIBS="$LIBS -lkstat" fi fi AC_CHECK_LIB(wrap, hosts_ctl) dnl idea from NewsCache's libwrap check dnl libwrap dnl AC_MSG_CHECKING([for hosts_ctl in -lwrap]) dnl ac_save_LIBS="$LIBS" dnl LIBS="-lwrap $LIBS" dnl AC_TRY_LINK([#include dnl int allow_severity; int deny_severity;], [hosts_ctl();], dnl AC_MSG_RESULT([yes]) dnl AC_DEFINE(HAVE_LIBWRAP) dnl ac_cv_lib_wrap_hosts_ctl=yes, dnl LIBS="$ac_save_LIBS" dnl AC_MSG_RESULT([no]) dnl ac_cv_lib_wrap_hosts_ctl=no) AC_CHECK_HEADERS(tcpd.h) #AC_CHECK_HEADERS(netinet/icmp6.h,IPV6="ENABLE_IPV6") AC_CHECK_HEADERS([sys/socket.h]) AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS([netinet/icmp6.h], [], [], [#if HAVE_SYS_TYPES_H #include # endif #if HAVE_SYS_SOCKET_H #include # endif #if HAVE_NETINET_IN_H #include #endif ]) # need SSL_LIBS/CRYOPTO_LIBS for linking in snmp LIBS_SAVE="$LIBS" LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS" AC_CHECK_HEADERS(net-snmp/version.h,IS_NET_SNMP="yes") if test "$IS_NET_SNMP" = "yes"; then AC_CHECK_LIB(snmp,snmp_open,USABLE_SNMP="yes") AC_CHECK_LIB(snmp,NetSnmpVersionInfo,USABLE_SNMP="yes") AC_CHECK_LIB(netsnmp,snmp_open,USABLE_NET_SNMP="yes") else AC_CHECK_HEADERS(ucd-snmp/version.h,IS_UCD_SNMP="yes") if test "$IS_UCD_SNMP" = "yes"; then AC_CHECK_LIB(snmp,snmp_open,USABLE_SNMP="yes") AC_CHECK_LIB(snmp,NetSnmpVersionInfo,USABLE_SNMP="yes") AC_CHECK_LIB(netsnmp,snmp_open,USABLE_NET_SNMP="yes") fi fi LIBS="$LIBS_SAVE" if test "$USABLE_SNMP" = "yes"; then SNMP="-DENABLE_SNMP" LIBS="$LIBS -lsnmp" fi if test "$USABLE_NET_SNMP" = "yes"; then SNMP="-DENABLE_SNMP" LIBS="$LIBS -lnetsnmp" fi dnl ssl libs need to come after netsnmp in linkpath LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS" dnl some checks if test "$SENDMAIL" = no; then AC_MSG_WARN(without sendmail there is no support for alert messages) SENDMAIL=-DMAIL='' else SENDMAIL=-DMAIL='"'$SENDMAIL'"' fi #if test "$IPV6" = "ENABLE_IPV6"; then # IPV6=-DENABLE_IPV6 #else # IPV6='' #fi if test "$enable_v6" = yes; then IPV6='IPV6=-DENABLE_IPV6' else IPV6='' fi if test "$enable_daemon" = yes; then PROGS="$PROGS sysmond" else AC_MSG_WARN(daemon not compiled on user request) fi if test "$enable_clients" = yes; then PROGS="$PROGS sysmon" else AC_MSG_WARN(clients not compiled on user request) fi dnl need these AC_SUBST(SSL) AC_SUBST(SENDMAIL) AC_SUBST(PROGS) AC_SUBST(IPV6) AC_SUBST(SNMP) AC_SUBST(SNP) #AC_SUBST(LDFLAGS) dnl write out the Makefile AC_OUTPUT(src/Makefile:autoconf/Makefile.in) dnl write out some helpful text cat <