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
|
dnl
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during installation
dnl to configure the system for the local environment.
dnl
AC_INIT(mib.txt)
dnl default installation path:
ac_default_prefix=/usr
AC_ARG_WITH(gcc, [ --with-gcc try to use gcc], trygcc=1)
if test "$trygcc" = 1 ; then
AC_PROG_CC
else
CC=${CC-cc}
fi
AC_SUBST(CC)
AC_PROG_CPP
AC_PROG_INSTALL
##
## --with-debug: debug version wanted ?
##
AC_ARG_WITH(debug, [ --with-debug compile with debug set], DEBUG='-DDEBUG -g', DEBUG='-O2')
AC_ARG_WITH(optdebug, [ --with-optdebug compile with debug and optimisation], DEBUG='-Wall -DDEBUG -O2 -g')
AC_SUBST(DEBUG)
#-------------------------------------------------------------------------
# Check to use dbmalloc (optional and only recommended for debugging)
# --with-dbmalloc
#-------------------------------------------------------------------------
AC_ARG_WITH(dbmalloc, [ --with-dbmalloc compile with dbmalloc package], dm=1, dm=0)
if test $dm = 1 ; then
AC_DEFINE(DBMALLOC)
DBMALLOC_LIB="-ldbmalloc"
DBMALLOC_INC="-I/usr/local/include/dbmalloc"
AC_MSG_RESULT([setting DBMALLOC_LIB to $DBMALLOC_LIB])
fi
AC_SUBST(DBMALLOC_LIB)
AC_SUBST(DBMALLOC_INC)
##
## --with-liba: normal library wanted ?
##
AC_ARG_WITH(liba, [ --with-liba build a libsnmp.a instead of a shared lib (eg. for SunOS and Solaris)], ba=1, ba=0)
if test $ba = 1 ; then
PIC=''
SNMPLIB=libsnmp.a
else
PIC='-fPIC'
SNMPLIB='libsnmp.so'
fi
AC_SUBST(SNMPLIB)
AC_SUBST(PIC)
##
## --with-noagent: only apps wanted ?
##
AC_ARG_WITH(noagent, [ --with-noagent build only the management applications (eg. for Solaris)], na=1, na=0)
if test $na = 1 ; then
AGENTTARGET=''
AGENTINSTALL=''
else
AGENTTARGET='snmpd'
AGENTINSTALL='install-agent'
fi
AC_SUBST(AGENTTARGET)
AC_SUBST(AGENTINSTALL)
#----------------------------------------------------------------------------
# Check for the existence of various libraries.
#----------------------------------------------------------------------------
AC_CHECK_LIB(ieee, main, [XLIBS="$XLIBS -lieee"])
AC_CHECK_LIB(socket, main, [XLIBS="$XLIBS -lsocket"])
AC_CHECK_LIB(nsl, main, [XLIBS="$XLIBS -lnsl"])
AC_CHECK_LIB(elf, main, [XLIBS="$XLIBS -lelf"])
AC_SUBST(XLIBS)
##
## --with-ipx: ipx support wanted ?
##
AC_ARG_WITH(ipx, [ --with-ipx build with SNMP over IPX support (Linux only)], na=1, na=0)
if test $na = 1 ; then
AC_MSG_CHECKING(for ipx support)
AC_TRY_COMPILE([#include <linux/ipx.h>],
[struct sockaddr_ipx ipx;],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_IPX), AC_MSG_RESULT(no))
else
HAVE_IPX=''
fi
AC_SUBST(HAVE_IPX)
AC_OUTPUT(Makefile snmplib/Makefile apps/Makefile apps/snmpnetstat/Makefile
etc/Makefile nstat/Makefile)
|