Blame configure.d/config_project_with_enable

Packit fcad23
# -*- autoconf -*-
Packit fcad23
#########################################
Packit fcad23
##
Packit fcad23
#   Command-line processing - --with/--enable
Packit fcad23
##
Packit fcad23
#########################################
Packit fcad23
Packit fcad23
##
Packit fcad23
#   System: Compiler settings
Packit fcad23
##
Packit fcad23
Packit fcad23
AC_ARG_WITH(cc, [
Packit fcad23
Compiler Options:
Packit fcad23
  --with-cc=CC                    use CC to compile (default=gcc).],
Packit fcad23
    [CC=$with_cc;export CC])
Packit fcad23
Packit fcad23
AC_ARG_WITH(linkcc, [
Packit fcad23
  --with-linkcc=CC                use CC to link (default=gcc).],
Packit fcad23
    [LINKCC=$with_linkcc;export LINKCC])
Packit fcad23
Packit fcad23
AC_ARG_WITH(ar,
Packit fcad23
[  --with-ar=AR                    use AR as the archiver.],
Packit fcad23
    [AR=$with_ar; export AR])
Packit fcad23
Packit fcad23
AC_ARG_WITH(endianness,
Packit fcad23
[  --with-endianness=big|little    define endianness of target platform when
Packit fcad23
                                  cross-compiling.],
Packit fcad23
    [if test $with_endianness != "big" -a $with_endianness != "little" ; then
Packit fcad23
       AC_MSG_ERROR([Endianness must be big or little, not "$with_endianness".]);
Packit fcad23
     fi
Packit fcad23
])
Packit fcad23
Packit fcad23
AC_ARG_WITH(cflags,
Packit fcad23
[  --with-cflags=CFLAGS            use CFLAGS as compile time arguments.],
Packit fcad23
    [CFLAGS=$with_cflags; export CFLAGS])
Packit fcad23
Packit fcad23
AC_ARG_WITH(ldflags,
Packit fcad23
[  --with-ldflags=LDFLAGS          use LDFLAGS as link time arguments to ld.],
Packit fcad23
    [LDFLAGS=$with_ldflags; export LDFLAGS])
Packit fcad23
Packit fcad23
AC_ARG_ENABLE(as-needed,
Packit fcad23
[  --disable-as-needed             Link libperl against applications rather
Packit fcad23
                                  than Net-SNMP libraries. Use only if the other
Packit fcad23
                                  way doesn't work.])
Packit fcad23
Packit fcad23
AC_ARG_WITH(libs,
Packit fcad23
[  --with-libs=LIBS                use LIBS as link time arguments to ld.],
Packit fcad23
    [LIBS=$with_libs; export LIBS])
Packit fcad23
Packit fcad23
AC_ARG_ENABLE(silent-libtool,
Packit fcad23
[  --enable-silent-libtool         Pass --silent to libtool.],
Packit fcad23
	LIBTOOLFLAGS=--silent)
Packit fcad23
AC_SUBST(LIBTOOLFLAGS)
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   System: Library settings
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(dmalloc,
Packit fcad23
        AS_HELP_STRING([--with-dmalloc=PATH],
Packit fcad23
                [Use dmalloc library (www.dmalloc.com)]))
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(efence,
Packit fcad23
[  --with-efence                   Look for and use libefence (malloc).],
Packit fcad23
      use_efence="$withval")
Packit fcad23
Packit fcad23
tryrsaref=no
Packit fcad23
NETSNMP_ARG_WITH(rsaref,
Packit fcad23
[  --with-rsaref=PATH              Look for librsaref in PATH/lib.],
Packit fcad23
    if test "x$withval" = "xyes"; then
Packit fcad23
      tryrsaref=yes
Packit fcad23
    elif test "x$withval" = "xno"; then
Packit fcad23
      tryrsaref=no
Packit fcad23
    elif test -d "$withval"; then
Packit fcad23
      AC_ADD_SEARCH_PATH($withval)
Packit fcad23
      tryrsaref=yes
Packit fcad23
    fi,
Packit fcad23
)
Packit fcad23
Packit fcad23
tryopenssl=defaultyes
Packit fcad23
askedopenssl=no
Packit fcad23
aes_capable=no
Packit fcad23
NETSNMP_ARG_WITH(openssl,
Packit fcad23
[  --with-openssl=PATH             Look for openssl in PATH/lib,
Packit fcad23
                                  or PATH may be "internal" to build with
Packit fcad23
                                  minimal copied OpenSSL code for USM only.],
Packit fcad23
    if test "x$withval" = "xyes"; then
Packit fcad23
      tryopenssl=yes
Packit fcad23
      askedopenssl=yes
Packit fcad23
    elif test "x$withval" = "xinternal"; then
Packit fcad23
      tryopenssl=internal
Packit fcad23
      askedopenssl=internal
Packit fcad23
    elif test "x$withval" = "xno"; then
Packit fcad23
      tryopenssl=no
Packit fcad23
    elif test -d "$withval"; then
Packit fcad23
      if test -d "$withval/lib/MinGW"; then
Packit fcad23
        LDFLAGS="-L$withval/lib/MinGW $LDFLAGS"
Packit fcad23
        CPPFLAGS="-I$withval/include $CPPFLAGS"
Packit fcad23
      else
Packit fcad23
        AC_ADD_SEARCH_PATH($withval)
Packit fcad23
      fi
Packit fcad23
      tryopenssl=yes
Packit fcad23
      askedopenssl=yes
Packit fcad23
    fi,
Packit fcad23
)
Packit fcad23
if test "x$tryopenssl" = "xdefaultyes"; then
Packit fcad23
      AC_ADD_SEARCH_PATH(/usr/local/ssl)
Packit fcad23
      tryopenssl=yes
Packit fcad23
fi
Packit fcad23
if test "x$tryopenssl" = "xyes"; then
Packit fcad23
    AC_CHECK_HEADERS(
Packit fcad23
        [openssl/aes.h openssl/evp.h],
Packit fcad23
        [aes_capable=yes],
Packit fcad23
        []
Packit fcad23
    )
Packit fcad23
fi
Packit fcad23
Packit fcad23
AC_ARG_WITH([ssl],,NETSNMP_INVALID_WITH([openssl]))
Packit fcad23
AC_ARG_ENABLE([ssl],,NETSNMP_INVALID_WITH([openssl]))
Packit fcad23
Packit fcad23
askedpkcs=no
Packit fcad23
NETSNMP_ARG_WITH(pkcs,
Packit fcad23
[  --with-pkcs=PATH                Look for pkcs11 in PATH/lib.],
Packit fcad23
    if test "x$withval" = "xyes"; then
Packit fcad23
      askedpkcs=yes
Packit fcad23
    elif test "x$withval" = "xno"; then
Packit fcad23
      askedpkcs=no
Packit fcad23
    elif test -d "$withval"; then
Packit fcad23
      AC_ADD_SEARCH_PATH($withval)
Packit fcad23
      askedpkcs=yes
Packit fcad23
    fi,
Packit fcad23
)
Packit fcad23
Packit fcad23
trykrb5=defaultyes
Packit fcad23
askedkrb5=no
Packit fcad23
NETSNMP_ARG_WITH(krb5,
Packit fcad23
[  --with-krb5=PATH                Look for krb5 in PATH/lib.],
Packit fcad23
    if test "x$withval" = "xyes"; then
Packit fcad23
      trykrb5=yes
Packit fcad23
      askedkrb5=yes
Packit fcad23
      krb5path=undef
Packit fcad23
    elif test "x$withval" = "xno"; then
Packit fcad23
      trykrb5=no
Packit fcad23
      krb5path=undef
Packit fcad23
    elif test -d "$withval"; then
Packit fcad23
      trykrb5=yes
Packit fcad23
      askedkrb5=yes
Packit fcad23
      krb5path=$withval
Packit fcad23
    fi,
Packit fcad23
)
Packit fcad23
if test "x$trykrb5" = "xdefaultyes"; then
Packit fcad23
      trykrb5=yes
Packit fcad23
      krb5path=/usr/kerberos
Packit fcad23
fi
Packit fcad23
Packit fcad23
AC_ARG_WITH(dnssec-local-validation,
Packit fcad23
        [  --with-dnssec-local-validation Enable local DNSSEC validation using libval (no)], want_dnssec=$withval, want_dnssec=no)
Packit fcad23
AC_ARG_ENABLE([dnssec-local-validation],,
Packit fcad23
              NETSNMP_INVALID_WITH([dnssec-local-validation]))
Packit fcad23
AC_ARG_WITH([dnssec],,NETSNMP_INVALID_WITH([dnssec-local-validation]))
Packit fcad23
AC_ARG_ENABLE([dnssec],,NETSNMP_INVALID_WITH([dnssec-local-validation]))
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(rpm,
Packit fcad23
[  --without-rpm                   Don't include support for the RPM package
Packit fcad23
                                  management system when building the host MIB
Packit fcad23
                                  module.])
Packit fcad23
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(pcre,
Packit fcad23
[  --without-pcre                  Don't include pcre process searching
Packit fcad23
                                  support in the agent.],
Packit fcad23
      with_pcre="$withval", with_pcre="maybe")
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Build configuration settings
Packit fcad23
##
Packit fcad23
Packit fcad23
#       Install prefix
Packit fcad23
#
Packit fcad23
AC_ARG_WITH(install-prefix,
Packit fcad23
[  --with-install-prefix=PATH      Just for installing, prefix all 
Packit fcad23
                                  directories with PATH.  This is known not
Packit fcad23
                                  to work on some systems with shared
Packit fcad23
                                  libraries (eg, HPUX)],
Packit fcad23
      INSTALL_PREFIX="$withval")
Packit fcad23
Packit fcad23
if test "x$INSTALL_PREFIX" = "xyes" ; then
Packit fcad23
  AC_MSG_ERROR([--with-install-prefix requires an argument])
Packit fcad23
fi
Packit fcad23
if test "x$INSTALL_PREFIX" = "xno" ; then
Packit fcad23
  INSTALL_PREFIX=""
Packit fcad23
fi
Packit fcad23
AC_SUBST(INSTALL_PREFIX)
Packit fcad23
Packit fcad23
Packit fcad23
#
Packit fcad23
#   Subsystems to build:
Packit fcad23
#       Library
Packit fcad23
#
Packit fcad23
FEATUREHEADERS="library/features.h"
Packit fcad23
FTMAINSUBS=""
Packit fcad23
Packit fcad23
#
Packit fcad23
#       Agent
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_ENABLE(agent,
Packit fcad23
[  --disable-agent                 Do not build the agent (snmpd).])
Packit fcad23
if test "x$enable_agent" != "xno"; then
Packit fcad23
   SNMPD='snmpd$(EXEEXT)'
Packit fcad23
   MAINSUBS="$MAINSUBS agent"
Packit fcad23
   FEATUREHEADERS="$FEATUREHEADERS agent/features-mibgroups.h agent/features.h"
Packit fcad23
   FTMAINSUBS="agent $FTMAINSUBS"
Packit fcad23
   TRAPLIBS='$(TRAPDWITHAGENT)'
Packit fcad23
   USETRAPLIBS='$(USEAGENTLIBS)'
Packit fcad23
else
Packit fcad23
   SNMPD=""
Packit fcad23
   # we still need/want the agentlibs (for subagents, e.g. snmptrapd)
Packit fcad23
   MAINSUBS="$MAINSUBS agent"
Packit fcad23
   # building snmptrapd w/o agentlibs doesn't work atm
Packit fcad23
   #TRAPLIBS='$(TRAPDWITHOUTAGENT)'
Packit fcad23
   #USETRAPLIBS='$(USELIBS)'
Packit fcad23
   TRAPLIBS='$(TRAPDWITHAGENT)'
Packit fcad23
   USETRAPLIBS='$(USEAGENTLIBS)'
Packit fcad23
   AC_DEFINE([NETSNMP_DISABLE_AGENT], 1, [Define if no agent is built])
Packit fcad23
fi
Packit fcad23
Packit fcad23
AC_SUBST(SNMPD)
Packit fcad23
AC_SUBST(TRAPLIBS)
Packit fcad23
AC_SUBST(USETRAPLIBS)
Packit fcad23
Packit fcad23
#       Applications
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_ENABLE(applications,
Packit fcad23
[  --disable-applications          Do not build the apps (snmpget, ...).])
Packit fcad23
if test "x$enable_applications" != "xno"; then
Packit fcad23
   MAINSUBS="$MAINSUBS apps"
Packit fcad23
   FEATUREHEADERS="$FEATUREHEADERS features-snmpnetstat.h features-apps.h"
Packit fcad23
   FTMAINSUBS="apps $FTMAINSUBS"
Packit fcad23
else
Packit fcad23
   AC_DEFINE([NETSNMP_DISABLE_APPS], 1, [Define if no apps are built])
Packit fcad23
fi
Packit fcad23
Packit fcad23
#       Manual pages
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_ENABLE(manuals,
Packit fcad23
[  --disable-manuals               Do not install the manuals.])
Packit fcad23
if test "x$enable_manuals" != "xno"; then
Packit fcad23
   MAINSUBS="$MAINSUBS man"
Packit fcad23
fi
Packit fcad23
Packit fcad23
#       Supporting scripts
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_ENABLE(scripts,
Packit fcad23
[  --disable-scripts               Do not install the scripts (mib2c, ...).])
Packit fcad23
if test "x$enable_scripts" != "xno"; then
Packit fcad23
   MAINSUBS="$MAINSUBS local"
Packit fcad23
fi
Packit fcad23
Packit fcad23
#       MIB files
Packit fcad23
#
Packit fcad23
AC_ARG_ENABLE(mibs,
Packit fcad23
[  --disable-mibs                  Do not install the mib files.])
Packit fcad23
if test "x$enable_mibs" != "xno"; then
Packit fcad23
   MAINSUBS="$MAINSUBS mibs"
Packit fcad23
fi
Packit fcad23
# with-mibs is valid too, but means something else
Packit fcad23
Packit fcad23
AC_SUBST(MAINSUBS)
Packit fcad23
AC_SUBST(FTMAINSUBS)
Packit fcad23
AC_MSG_CHECKING([what to build and install])
Packit fcad23
AC_MSG_RESULT([$MAINSUBS])
Packit fcad23
Packit fcad23
Packit fcad23
#       MIB module validation (during "configure")
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_ENABLE(mib-config-checking,
Packit fcad23
[  --enable-mib-config-checking    Turns on extra checks during configuration
Packit fcad23
                                  of mib modules. Any conflicts will cause
Packit fcad23
                                  configure to abort (default is to issue a
Packit fcad23
                                  warning and continue.)],
Packit fcad23
  [if test "$enableval" = yes -o "$enableval" = no ; then
Packit fcad23
     with_mib_cfg_checks="$enableval"
Packit fcad23
   else
Packit fcad23
     AC_MSG_ERROR([Please use --enable/--disable-mib-config-checking])
Packit fcad23
   fi],
Packit fcad23
  [with_mib_cfg_checks="no"])
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(mib-config-debug,
Packit fcad23
[  --enable-mib-config-debug       Turns on verbose output during mib module
Packit fcad23
                                  configure processing.],
Packit fcad23
  [if test "$enableval" = yes -o "$enableval" = no ; then
Packit fcad23
     with_mib_cfg_debug="$enableval"
Packit fcad23
   else
Packit fcad23
     AC_MSG_ERROR([Please use --enable/--disable-mib-config-debug])
Packit fcad23
   fi],
Packit fcad23
  [with_mib_cfg_debug="no"])
Packit fcad23
Packit fcad23
Packit fcad23
#       Version-specific features
Packit fcad23
#
Packit fcad23
AC_ARG_ENABLE([new-features],
Packit fcad23
        [AS_HELP_STRING([--enable-new-features],
Packit fcad23
                [Compile in new MIB modules and other experimental features
Packit fcad23
                 which are due to be included in future releases.])])
Packit fcad23
Packit fcad23
AC_ARG_ENABLE([old-features],
Packit fcad23
        [AS_HELP_STRING([--enable-old-features],
Packit fcad23
                [Compile in old MIB modules and other deprecated features
Packit fcad23
                 which were replaced in the default build of this release.])])
Packit fcad23
Packit fcad23
AC_ARG_WITH([features-of],
Packit fcad23
        [AS_HELP_STRING([--with-features-of=version],
Packit fcad23
                [Compile in MIB modules and other features as if this was
Packit fcad23
                 release "version" (default is ]AC_PACKAGE_VERSION[).])],,
Packit fcad23
        [with_features_of=$PACKAGE_VERSION])
Packit fcad23
   
Packit fcad23
Packit fcad23
#       Manual prompting during "configure"
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_WITH(defaults,
Packit fcad23
[
Packit fcad23
Miscellaneous:
Packit fcad23
  --with-defaults         Use defaults for prompted values.],
Packit fcad23
  [if test "$withval" = yes -o "$withval" = no ; then
Packit fcad23
     defaults="$withval"
Packit fcad23
   else
Packit fcad23
     AC_MSG_ERROR([Please use --with/--without-defaults])
Packit fcad23
   fi],
Packit fcad23
  [defaults="no"])
Packit fcad23
Packit fcad23
Packit fcad23
#       UCD compatability
Packit fcad23
#
Packit fcad23
NETSNMP_ARG_ENABLE(ucd-snmp-compatibility,
Packit fcad23
[  --enable-ucd-snmp-compatibility Install ucd-snmp look-alike headers and libs.
Packit fcad23
])
Packit fcad23
Packit fcad23
if test "x$enable_ucd_snmp_compatibility" = "xyes" ; then	
Packit fcad23
  installucdheaders=installucdheaders
Packit fcad23
  installucdlibs=installucdlibs
Packit fcad23
  AC_MSG_CACHE_ADD(UCD-SNMP compatability:     enabled)
Packit fcad23
fi
Packit fcad23
AC_SUBST(installucdheaders)
Packit fcad23
AC_SUBST(installucdlibs)
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: MIB configuration settings
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(mib-loading,
Packit fcad23
[  --disable-mib-loading           Do not include code that parses and 
Packit fcad23
                                  manipulates the mib files.])
Packit fcad23
if test "x$enable_mib_loading" = "xno"; then
Packit fcad23
  AC_DEFINE([NETSNMP_DISABLE_MIB_LOADING], 1, 
Packit fcad23
            [Define if mib loading and parsing code should not be included])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(mibdirs,
Packit fcad23
[  --with-mibdirs="dir1:dir2:"   Default directories to look for mibs.
Packit fcad23
                                  (Default: \$HOME/.snmp/mibs:DATADIR/snmp/mibs)],
Packit fcad23
    [NETSNMP_DEFAULT_MIBDIRS="$with_mibdirs"
Packit fcad23
    AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBDIRS,"$with_mibdirs",
Packit fcad23
        [default location to look for mibs to load using the above tokens
Packit fcad23
         and/or those in the MIBS envrionment variable])])
Packit fcad23
Packit fcad23
AC_ARG_WITH(mibs,
Packit fcad23
[  --with-mibs="item1:item2:"    Default mib IDs to read.
Packit fcad23
                                  (The default list is
Packit fcad23
                                   "SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB"
Packit fcad23
                                  with the addition of any mibs used
Packit fcad23
                                  by the mib modules the agent is
Packit fcad23
                                  configured with)],
Packit fcad23
    NETSNMP_DEFAULT_MIBS="$with_mibs")
Packit fcad23
# enable-mibs is valid too, but means something else
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(mibfiles,
Packit fcad23
[  --with-mibfiles="file1:file2" Default mib files to load.
Packit fcad23
                                  (Default:  none.  uses IDs above instead.)],
Packit fcad23
    AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBFILES,"$with_mibfiles",
Packit fcad23
        [default mib files to load, specified by path.]))
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: Security configuration
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(des,
Packit fcad23
[  --disable-des                   Do not support DES encryption.])
Packit fcad23
if test "x$enable_des" = "xno"; then
Packit fcad23
  AC_DEFINE([NETSNMP_DISABLE_DES], 1, 
Packit fcad23
            [Define if DES encryption should not be supported])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(privacy,
Packit fcad23
[  --disable-privacy               Don't compile in support for privacy (encryption).])
Packit fcad23
if test "x$enable_privacy" != "xno"; then
Packit fcad23
  AC_DEFINE(NETSNMP_ENABLE_SCAPI_AUTHPRIV, 1,
Packit fcad23
    [define if you want to compile support for both authentication and
Packit fcad23
     privacy support.])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(md5,
Packit fcad23
[  --disable-md5                   Do not support MD5 authentication.])
Packit fcad23
if test "x$enable_md5" = "xno"; then
Packit fcad23
  AC_DEFINE([NETSNMP_DISABLE_MD5], 1, 
Packit fcad23
            [Define if MD5 authentication should not be supported])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(internal-md5,
Packit fcad23
[  --enable-internal-md5           Use the internal MD5 support.])
Packit fcad23
if test "x$enable_internal_md5" = "xyes"; then
Packit fcad23
  if test "x$enable_md5" = "xno"; then
Packit fcad23
    AC_MSG_ERROR(You can not specify both --enable-internal-md5 and --disable-md5)
Packit fcad23
  else
Packit fcad23
    AC_DEFINE(NETSNMP_USE_INTERNAL_MD5, 1,
Packit fcad23
      [define if you are using the MD5 code ...])
Packit fcad23
  fi
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(blumenthal-aes,
Packit fcad23
[  --enable-blumenthal-aes         Enable AES-192/AES-256 (Blumenthal draft)])
Packit fcad23
if test "x$enable_blumenthal_aes" = "xyes"; then
Packit fcad23
    if test "x$aes_capable" = "xyes"; then
Packit fcad23
        AC_DEFINE([NETSNMP_DRAFT_BLUMENTHAL_AES_04], 1,
Packit fcad23
            [Define if AES-192/AES-256 encryption should be supported])
Packit fcad23
    else
Packit fcad23
        AC_MSG_ERROR([Blumenthal draft requires OpenSSL with AES functions enabled])
Packit fcad23
    fi
Packit fcad23
fi
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: Misc configuration
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(opaque-special-types,
Packit fcad23
[  --without-opaque-special-types  Don't use special opaque encodings.
Packit fcad23
                                  SNMP normally cannot handle
Packit fcad23
                                  floating numbers, nor large 64 bit
Packit fcad23
                                  integers well.  By default, the
Packit fcad23
                                  net-snmp package compiles in
Packit fcad23
                                  support for these extra datatypes
Packit fcad23
                                  (in a legal way)])
Packit fcad23
# Only define if specifically chosen as --without (i.e., default to true).
Packit fcad23
if test "x$with_opaque_special_types" != "xno"; then
Packit fcad23
  AC_DEFINE(NETSNMP_WITH_OPAQUE_SPECIAL_TYPES, 1,
Packit fcad23
    [Should we compile to use special opaque types: float, double, counter64,
Packit fcad23
     i64, ui64, union?])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(ipv6,
Packit fcad23
[  --disable-ipv6                  Disable IPv6 support.],
Packit fcad23
    [],dnl default to "yes"
Packit fcad23
    [enable_ipv6="yes"])
Packit fcad23
if test "x$enable_ipv6" != "xno"; then
Packit fcad23
  AC_DEFINE(NETSNMP_ENABLE_IPV6, 1,
Packit fcad23
      [define if you want to enable IPv6 support])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(logfile,
Packit fcad23
[  --with-logfile="location"       Default log file location for snmpd.],
Packit fcad23
    ac_cv_user_prompt_NETSNMP_LOGFILE="$with_logfile")
Packit fcad23
if test "$ac_cv_user_prompt_NETSNMP_LOGFILE" = "no"; then
Packit fcad23
    ac_cv_user_prompt_NETSNMP_LOGFILE="none"
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(usmUser-uses-default-auth-priv,
Packit fcad23
[  --enable-usmUser-uses-default-auth-priv Use default auth/priv protocols; createUser
Packit fcad23
                                          only needs auth/priv passphrases.],
Packit fcad23
    [if test "x$enable_usmUser_uses_default_auth_priv" = "xyes"; then
Packit fcad23
      AC_DEFINE(NETSNMP_FORCE_SYSTEM_V3_AUTHPRIV, 1,
Packit fcad23
        [if defined always use default auth/priv protocol when creating usmUsers])
Packit fcad23
    fi])
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(daemons-syslog-as-default,
Packit fcad23
[  --enable-daemons-syslog-as-default Use syslog when no other log destination defined.],
Packit fcad23
    [if test "x$enable_daemons_syslog_as_default" = "xyes"; then
Packit fcad23
      AC_DEFINE(NETSNMP_DAEMONS_DEFAULT_LOG_SYSLOG, 1,
Packit fcad23
        [if defined daemons will use syslog when no log destination is defined])
Packit fcad23
    fi])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(persistent-directory,
Packit fcad23
[  --with-persistent-directory="directory"
Packit fcad23
                                  Default directory for persistent data storage.],ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY="$with_persistent_directory")
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(persistent-mask,
Packit fcad23
[  --with-persistent-mask="mask"  Default mask for persistent data storage.
Packit fcad23
                                  (Default: 077)],
Packit fcad23
  [if test [`expr "X$withval" : 'X[0-7]*$'`] -eq 4 ; then
Packit fcad23
     AC_MSG_RESULT([using persistent mask $withval])
Packit fcad23
     withval="0$withval"
Packit fcad23
   else
Packit fcad23
     AC_MSG_ERROR([Please provide a three digit octal persistent mask value])
Packit fcad23
   fi],
Packit fcad23
  [withval=077
Packit fcad23
   AC_MSG_RESULT([using default persistent mask $withval])])
Packit fcad23
AC_DEFINE_UNQUOTED(NETSNMP_PERSISTENT_MASK,$withval,
Packit fcad23
   [umask permissions to set up persistent files with])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(copy_persistent_files,
Packit fcad23
[  --with-copy-persistent-files="no" Don't copy persistent files
Packit fcad23
                                     (or use "yes" to copy them).
Packit fcad23
                                     (Default: yes)],
Packit fcad23
    ac_cv_user_prompt_COPY_PERSISTENT_FILES="$with_copy_persistent_files")
Packit fcad23
Packit fcad23
default_temp_file_pattern="/tmp/snmpdXXXXXX"
Packit fcad23
NETSNMP_ARG_WITH(temp-file-pattern,
Packit fcad23
[  --with-temp-file-pattern=PATTERN  Pattern of temporary files (Default: /tmp/snmpdXXXXXX)],
Packit fcad23
  [if test `expr "X$withval" : ".*XXXXXX$"` -ne 0 ; then
Packit fcad23
     AC_MSG_RESULT(using temporary file pattern $withval)
Packit fcad23
   else
Packit fcad23
     AC_MSG_ERROR([temporary file pattens must end with 6 X's])
Packit fcad23
   fi],
Packit fcad23
  [withval="$default_temp_file_pattern"
Packit fcad23
   AC_MSG_RESULT(using default temporary file pattern $withval)])
Packit fcad23
AC_DEFINE_UNQUOTED(NETSNMP_TEMP_FILE_PATTERN,"$withval",
Packit fcad23
  [Pattern of temporary files])
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: Version configuration
Packit fcad23
##
Packit fcad23
Packit fcad23
SNMP_VERSIONS=""
Packit fcad23
NETSNMP_ARG_ENABLE(snmpv1,
Packit fcad23
[  --disable-snmpv1                Do not include code that implements SNMPv1.])
Packit fcad23
if test "x$enable_snmpv1" = "xno"; then
Packit fcad23
  AC_DEFINE([NETSNMP_DISABLE_SNMPV1], 1, 
Packit fcad23
            [Define if SNMPv1 code should not be included])
Packit fcad23
else
Packit fcad23
  SNMP_VERSIONS="$SNMP_VERSIONS 1"
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(snmpv2c,
Packit fcad23
[  --disable-snmpv2c               Do not include code that implements SNMPv2c.])
Packit fcad23
if test "x$enable_snmpv2c" = "xno"; then
Packit fcad23
  AC_DEFINE([NETSNMP_DISABLE_SNMPV2C], 1, 
Packit fcad23
            [Define if SNMPv2c code should not be included])
Packit fcad23
else
Packit fcad23
  SNMP_VERSIONS="$SNMP_VERSIONS 2c"
Packit fcad23
fi
Packit fcad23
Packit fcad23
SNMP_VERSIONS="$SNMP_VERSIONS 3"
Packit fcad23
AC_MSG_CACHE_ADD(SNMP Versions Supported:   $SNMP_VERSIONS)
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(default-snmp-version,
Packit fcad23
[  --with-default-snmp-version="3" Default version of SNMP to use.
Packit fcad23
                                    (Default: 3)
Packit fcad23
                                    Legal values: 1, 2 (for SNMPv2c) or 3.],
Packit fcad23
    ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="$with_default_snmp_version")
Packit fcad23
Packit fcad23
# we test this now and later as well.  we test it now so configure can die
Packit fcad23
# early on with an error rather than waiting till the end of the script.
Packit fcad23
case "${ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION-3}" in
Packit fcad23
  [[123]]) ;;
Packit fcad23
  2c) ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION=2 ;;
Packit fcad23
  *)
Packit fcad23
    AC_MSG_ERROR([Illegal version number.  Only 1, 2 (for SNMPv2c) and 3 are supported.])
Packit fcad23
    ;;
Packit fcad23
esac
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: Transport modules
Packit fcad23
##
Packit fcad23
Packit fcad23
AC_ARG_WITH(transports,
Packit fcad23
[  --with-transports="t1 t2 ..."   Compile in the given SNMP transport
Packit fcad23
                                    modules (space or comma separated list).])
Packit fcad23
AC_ARG_WITH(out_transports,
Packit fcad23
[  --with-out-transports="t1 ..."  Exclude listed SNMP transports
Packit fcad23
                                    (space or comma separated list).
Packit fcad23
Packit fcad23
  Available SNMP transport modules are:
Packit fcad23
Packit fcad23
    UDP         support for SNMP over UDP/IP.
Packit fcad23
                This transport is always compiled in.
Packit fcad23
    UDPIPv6     support for SNMP over UDP/IPv6.
Packit fcad23
                This transport is available for Linux, Solaris and
Packit fcad23
                FreeBSD at least.
Packit fcad23
                This transport is compiled in by default if IPv6 support is enabled.
Packit fcad23
    UDPshared   Allows a UDP port to be shared with multiple transports. It
Packit fcad23
                enables multiple notification destinations to share a single
Packit fcad23
                source address/port.
Packit fcad23
    TCPIPv6     support for SNMP over UDP/IPv6.
Packit fcad23
                This transport is available for Linux, Solaris and
Packit fcad23
                FreeBSD at least.
Packit fcad23
                This transport is compiled in by default if IPv6 support is enabled.
Packit fcad23
    TCP         support for SNMP over TCP/IP.
Packit fcad23
                This transport is compiled in by default, but may be omitted.
Packit fcad23
    Unix        support for SNMP over Unix domain protocols.
Packit fcad23
                This transport is compiled in by default except on Win32
Packit fcad23
                platforms, and may be omitted.
Packit fcad23
    Callback    support for SNMP over an internal locally connected pair
Packit fcad23
                of snmp_sessions.
Packit fcad23
    Alias       The alias transport simply lets you define more complex
Packit fcad23
                transport strings and alias them to simple names in
Packit fcad23
                the snmp.conf file.
Packit fcad23
    AAL5PVC     support for SNMP over AAL5 PVCs.
Packit fcad23
                This transport is presently only available for Linux,
Packit fcad23
                is never compiled in by default and may be omitted.
Packit fcad23
    IPX         support for SNMP over IPX per RFC 1420.
Packit fcad23
                This transport is presently only available for Linux,
Packit fcad23
                is never compiled in by default and may be omitted.
Packit fcad23
    DTLSUDP     support for tunneling SNMP over DTLS/UDP
Packit fcad23
    TLSTCP      support for tunneling SNMP over TLS/TCP
Packit fcad23
    SSH         (alpha) support for tunneling SNMP over SSH
Packit fcad23
])
Packit fcad23
Packit fcad23
#
Packit fcad23
# Catch common mistakes in transport options
Packit fcad23
#
Packit fcad23
AC_ARG_WITH(transport,, NETSNMP_INVALID_WITH([transports]))
Packit fcad23
AC_ARG_WITH(out-transport,, NETSNMP_INVALID_WITH([out-transports]))
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: Security modules
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(security-modules,
Packit fcad23
[  --with-security-modules="s1 s2 ..."   Compile in the given SNMP security
Packit fcad23
                                    module services (space separated list).
Packit fcad23
Packit fcad23
  Available SNMP security services:
Packit fcad23
Packit fcad23
        usm                support for user based SNMP security
Packit fcad23
        ksm                support for kerberos based SNMP security
Packit fcad23
        tsm                support for the Transport-based security
Packit fcad23
                           (for use with the SSH, DTLSUDP and TLSTCP transports)
Packit fcad23
])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(out-security-modules,
Packit fcad23
[  --with-out-security-modules="s1 s2 ..."   Removes the given SNMP security
Packit fcad23
                                    module services from the default list.
Packit fcad23
])
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library: Developer-related settings
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(debugging,
Packit fcad23
[  --enable-debugging              Outputs extra debugging information at all
Packit fcad23
                                  times.  Normally, you should not enable this,
Packit fcad23
                                  but instead use the -D flag of the commands,
Packit fcad23
                                  which toggles debuging output at runtime.
Packit fcad23
  --disable-debugging             Disallows debugging code to be built in.
Packit fcad23
                                  This might provide some speed benefits.],
Packit fcad23
    AC_DEFINE(NETSNMP_ALWAYS_DEBUG))
Packit fcad23
if test "x$enable_debugging" = "xno"; then
Packit fcad23
    AC_DEFINE(NETSNMP_NO_DEBUGGING)
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(developer,
Packit fcad23
[  --enable-developer              Turns on super-duper-extra-compile-warnings
Packit fcad23
                                  when using gcc.],
Packit fcad23
  [if test "$enableval" = yes ; then
Packit fcad23
     developer="yes"
Packit fcad23
   elif test "$enableval" != no ; then
Packit fcad23
     AC_MSG_ERROR([Please use --enable/--disable-developer])
Packit fcad23
   else
Packit fcad23
     developer="no"
Packit fcad23
   fi])
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(testing-code,
Packit fcad23
[  --enable-testing-code           Enables some code sections that should 
Packit fcad23
                                  only be used for testing of certain
Packit fcad23
                                  SNMP functionalities.  This should *not* 
Packit fcad23
                                  be turned on for production use.  Ever.],
Packit fcad23
  [if test "$enableval" = yes ; then
Packit fcad23
     AC_DEFINE(NETSNMP_ENABLE_TESTING_CODE, 1, [testing code sections.])
Packit fcad23
   elif test "$enableval" != no ; then
Packit fcad23
     AC_MSG_ERROR([Please use --enable/--disable-testing-code])
Packit fcad23
   fi])
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(reentrant,
Packit fcad23
[  --enable-reentrant              Enables locking functions that protect
Packit fcad23
                                  library resources in some multi-threading
Packit fcad23
                                  environments.  This does not guarantee
Packit fcad23
                                  thread-safe operation.
Packit fcad23
                                  Currently an experimental setting.],
Packit fcad23
  [if test "$enableval" = yes -o "$enableval" = no ; then
Packit fcad23
     with_res_locks="$enableval"
Packit fcad23
   else
Packit fcad23
     AC_MSG_ERROR([Please use --enable/--disable-reentrant])
Packit fcad23
   fi],
Packit fcad23
  [with_res_locks="no"])
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(deprecated,
Packit fcad23
[  --disable-deprecated            Don't compile in deprecated functions.])
Packit fcad23
if test "$enable_deprecated" = no ; then
Packit fcad23
   AC_DEFINE([NETSNMP_NO_DEPRECATED_FUNCTIONS], 1,
Packit fcad23
             [Define to suppress inclusion of deprecated functions])
Packit fcad23
fi
Packit fcad23
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Agent configuration settings
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(root-access,
Packit fcad23
[
Packit fcad23
Configuring the agent:
Packit fcad23
  --without-root-access           The snmpd agent won't require root access to
Packit fcad23
                                  run it.  The information it returns in the
Packit fcad23
                                  mib-II tree may not be correct, however.])
Packit fcad23
# Only define if specifically chosen as --without (i.e., default to true).
Packit fcad23
if test "x$with_root_access" = "xno"; then
Packit fcad23
  AC_DEFINE(NETSNMP_NO_ROOT_ACCESS, 1,
Packit fcad23
    [If you don't have root access don't exit upon kmem errors])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(kmem-usage,
Packit fcad23
[  --without-kmem-usage            Do not include any code related to the use
Packit fcad23
                                  of kmem.])
Packit fcad23
# Only define if specifically chosen as --without (i.e., default to true).
Packit fcad23
if test "x$with_kmem_usage" = "xno"; then
Packit fcad23
  AC_DEFINE(NETSNMP_NO_KMEM_USAGE, 1, [If we don't want to use kmem.])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(dummy-values,
Packit fcad23
[  --with-dummy-values             Provide 'placeholder' dummy values where
Packit fcad23
                                  the necessary information is not available.
Packit fcad23
                                  This is technically not compliant with the
Packit fcad23
                                  SNMP specifications, but was how the agent
Packit fcad23
                                  operated for versions < 4.0.])
Packit fcad23
# Define unless specifically suppressed (i.e., option defaults to false).
Packit fcad23
if test "x$with_dummy_values" != "xyes"; then
Packit fcad23
  AC_DEFINE(NETSNMP_NO_DUMMY_VALUES, 1,
Packit fcad23
    [If you don't want the agent to report on variables it doesn't have
Packit fcad23
     data for])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(systemd,
Packit fcad23
[  --with-systemd                 Provide systemd support. See README.systemd
Packit fcad23
                                  for details.])
Packit fcad23
# Define unless specifically suppressed (i.e., option defaults to false).
Packit fcad23
if test "x$with_systemd" != "xyes"; then
Packit fcad23
  AC_DEFINE(NETSNMP_NO_SYSTEMD, 1,
Packit fcad23
    [If you don't want to integrate with systemd.])
Packit fcad23
fi
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(set-support,
Packit fcad23
[  --disable-set-support           Do not allow SNMP set requests.])
Packit fcad23
if test "x$enable_set_support" = "xno"; then
Packit fcad23
  AC_DEFINE([NETSNMP_DISABLE_SET_SUPPORT], 1, 
Packit fcad23
            [Define if SNMP SET support should be disabled])
Packit fcad23
fi
Packit fcad23
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(sys_contact,
Packit fcad23
[  --with-sys-contact="who@where"  Default system contact.
Packit fcad23
                                    (Default: LOGIN@DOMAINNAME)],
Packit fcad23
    ac_cv_user_prompt_NETSNMP_SYS_CONTACT="$with_sys_contact")
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(sys_location,
Packit fcad23
[  --with-sys-location="location"  Default system location.
Packit fcad23
                                    (Default: Unknown)],
Packit fcad23
    ac_cv_user_prompt_NETSNMP_SYS_LOC="$with_sys_location")
Packit fcad23
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Agent: Extensibility configuration
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(local-smux,
Packit fcad23
[  --enable-local-smux             Restrict SMUX connections to localhost (by default).],
Packit fcad23
    [if test "x$enable_local_smux" = "xyes"; then
Packit fcad23
      AC_DEFINE(NETSNMP_ENABLE_LOCAL_SMUX, 1,
Packit fcad23
          [define if you want to restrict SMUX connections to localhost
Packit fcad23
           by default])
Packit fcad23
    fi])
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(agentx-dom-sock-only,
Packit fcad23
[  --enable-agentx-dom-sock-only   Disable UDP/TCP transports for agentx.],
Packit fcad23
AC_DEFINE(NETSNMP_AGENTX_DOM_SOCK_ONLY, 1,
Packit fcad23
    [define if agentx transport is to use domain sockets only]))
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(snmptrapd-subagent,
Packit fcad23
[  --disable-snmptrapd-subagent    Disable agentx subagent code in snmptrapd.])
Packit fcad23
if test "x$enable_snmptrapd_subagent" = "xno"; then
Packit fcad23
  AC_DEFINE(NETSNMP_SNMPTRAPD_DISABLE_AGENTX, 1,
Packit fcad23
    [define if you do not want snmptrapd to register as an AgentX subagent])
Packit fcad23
fi
Packit fcad23
Packit fcad23
default_agentx_socket="/var/agentx/master"
Packit fcad23
NETSNMP_ARG_WITH(agentx-socket,
Packit fcad23
[  --with-agentx-socket=FILE         AgentX socket (Default: /var/agentx/master as specified in RFC2741)],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a full path ]);
Packit fcad23
  fi
Packit fcad23
  AC_MSG_RESULT(using AgentX socket $withval)
Packit fcad23
],[
Packit fcad23
  withval=$default_agentx_socket
Packit fcad23
  AC_MSG_RESULT(using default AgentX socket $default_agentx_socket)
Packit fcad23
])
Packit fcad23
AC_DEFINE_UNQUOTED(NETSNMP_AGENTX_SOCKET,"$withval",
Packit fcad23
        [Unix domain socket for AgentX master-subagent communication])
Packit fcad23
Packit fcad23
#
Packit fcad23
# feature addition/removal and minimialist support
Packit fcad23
#
Packit fcad23
FEATURE_ADD_FLAGS=""
Packit fcad23
NETSNMP_ARG_WITH(features,
Packit fcad23
[  --with-features="feat1 feat2"   Request extra features to be turned on.
Packit fcad23
                                   (only useful with --enable-minimalist)],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a list of features ]);
Packit fcad23
  fi
Packit fcad23
  FEATURE_ADD_FLAGS="--add $withval"
Packit fcad23
  AC_MSG_RESULT(adding in features: $withval)
Packit fcad23
])
Packit fcad23
AC_SUBST(FEATURE_ADD_FLAGS)
Packit fcad23
Packit fcad23
Packit fcad23
FEATURE_REMOVE_FLAGS=""
Packit fcad23
NETSNMP_ARG_WITH(out-features,
Packit fcad23
[  --with-out-features="feat1..."  Remove specific features.
Packit fcad23
                                   (implies --enable-minimalist)],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a list of features ]);
Packit fcad23
  fi
Packit fcad23
  FEATURE_REMOVE_FLAGS="--remove $withval"
Packit fcad23
  FEATURETARGS="features"
Packit fcad23
  AC_DEFINE(NETSNMP_MINIMAL_CODE, 1,
Packit fcad23
    [Define if you want to remove all non-essential code features.])
Packit fcad23
  AC_MSG_RESULT(removing features: $withval)
Packit fcad23
])
Packit fcad23
AC_SUBST(FEATURE_REMOVE_FLAGS)
Packit fcad23
Packit fcad23
Packit fcad23
# Catch common mistakes
Packit fcad23
AC_ARG_WITH(feature,, NETSNMP_INVALID_WITH([features]))
Packit fcad23
AC_ARG_WITH(out-feature,, NETSNMP_INVALID_WITH([out-features]))
Packit fcad23
Packit fcad23
FEATURETARGS=""
Packit fcad23
NETSNMP_ARG_ENABLE(minimalist,
Packit fcad23
[  --enable-minimalist             Remove all non-essential code features.])
Packit fcad23
if test "x$enable_minimalist" = "xyes"; then
Packit fcad23
   # we'll assume the mini agent is desired here as well
Packit fcad23
   mini_agent="yes"
Packit fcad23
   FEATURETARGS="features"
Packit fcad23
Packit fcad23
   # needed to bootstrap later checks
Packit fcad23
   echo "" > include/net-snmp/feature-details.h
Packit fcad23
   AC_DEFINE(NETSNMP_MINIMAL_CODE, 1,
Packit fcad23
     [Define if you want to remove all non-essential code features.])
Packit fcad23
else
Packit fcad23
   FEATUREHEADERS=""
Packit fcad23
fi
Packit fcad23
AC_ARG_WITH([minimalist],,NETSNMP_INVALID_ENABLE([minimalist]))
Packit fcad23
AC_SUBST(FEATURETARGS)
Packit fcad23
AC_SUBST(FEATUREHEADERS)
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(notify-only,
Packit fcad23
[  --enable-notify-only            Build tools that can only send notifications.])
Packit fcad23
if test "x$enable_notify_only" = "xyes"; then
Packit fcad23
   AC_DEFINE(NETSNMP_NOTIFY_ONLY, 1,
Packit fcad23
     [Define if you want to only support sending notifications])
Packit fcad23
fi
Packit fcad23
AC_ARG_WITH([notify-only],,NETSNMP_INVALID_ENABLE([notify-only]))
Packit fcad23
AC_ARG_ENABLE([notifyonly],,NETSNMP_INVALID_ENABLE([notify-only]))
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(no-listen,
Packit fcad23
[  --enable-no-listen              Build tools that can't listen to ports.])
Packit fcad23
if test "x$enable_no_listen" = "xyes" -o "x$enable_notify_only" = "xyes"; then
Packit fcad23
   enable_no_listen="yes"
Packit fcad23
   AC_DEFINE(NETSNMP_NO_LISTEN_SUPPORT, 1,
Packit fcad23
     [Define if you want to remove all listening support from the code])
Packit fcad23
fi
Packit fcad23
AC_ARG_WITH([no-listen],,NETSNMP_INVALID_ENABLE([no-listen]))
Packit fcad23
AC_ARG_ENABLE([nolisten],,NETSNMP_INVALID_ENABLE([no-listen]))
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(read-only,
Packit fcad23
[  --enable-read-only              Remove all SET support from the code.])
Packit fcad23
if test "x$enable_read_only" = "xyes" -o "x$enable_notify_only" = "xyes" ; then
Packit fcad23
   enable_read_only="yes"
Packit fcad23
   AC_DEFINE(NETSNMP_NO_WRITE_SUPPORT, 1,
Packit fcad23
     [Define if you want to remove all SET/write access from the code])
Packit fcad23
fi
Packit fcad23
AC_ARG_WITH([read-only],,NETSNMP_INVALID_ENABLE([read-only]))
Packit fcad23
AC_ARG_ENABLE([readonly],,NETSNMP_INVALID_ENABLE([read-only]))
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Agent: MIB module configuration
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(mini_agent,
Packit fcad23
[  --enable-mini-agent             Build a minimal agent.])
Packit fcad23
if test "x$enable_mini_agent" = "xyes"; then
Packit fcad23
    mini_agent="yes"
Packit fcad23
else
Packit fcad23
    mini_agent="no"
Packit fcad23
fi
Packit fcad23
AC_ARG_WITH([miniagent],,NETSNMP_INVALID_ENABLE([mini-agent]))
Packit fcad23
AC_ARG_ENABLE([miniagent],,NETSNMP_INVALID_ENABLE([mini-agent]))
Packit fcad23
Packit fcad23
Packit fcad23
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(mfd-rewrites,
Packit fcad23
[  --enable-mfd-rewrites           Use new MFD rewrites of mib modules,
Packit fcad23
                                  where available. (default is to use
Packit fcad23
                                  original mib module code).])
Packit fcad23
if test "x$enable_mfd_rewrites" = "xyes"; then
Packit fcad23
   AC_DEFINE(NETSNMP_ENABLE_MFD_REWRITES, 1,
Packit fcad23
     [Define if you want to build MFD module rewrites])
Packit fcad23
fi
Packit fcad23
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(mib_modules,
Packit fcad23
[  --with-mib-modules="item1 ..."  Compile with additional mib modules
Packit fcad23
                                    (Space separated list).])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(out_mib_modules,
Packit fcad23
[  --with-out-mib-modules="list"   Compile without these mib modules.
Packit fcad23
Packit fcad23
  Default mib modules compiled into the agent (which can be removed):
Packit fcad23
  
Packit fcad23
    mibII                  support for the mib-II tree.
Packit fcad23
    snmpv3mibs             support for the snmpv3 mib modules.
Packit fcad23
    ucd_snmp               UCD-SNMP-MIB specific extensions.
Packit fcad23
    agent_mibs             NET-SNMP-AGENT-MIB extensions
Packit fcad23
    agentx                 AgentX support (see below)
Packit fcad23
    notification           mibs supporting specification of trap destinations.
Packit fcad23
    target                 Support for the SNMP WGs TARGET-MIB.
Packit fcad23
    utilities              general agent configuration utilities.
Packit fcad23
    disman/event           support for the DISMAN-EVENT-MIB
Packit fcad23
                             (supports self monitoring and notification 
Packit fcad23
                              delivery when error conditions are found)
Packit fcad23
    disman/schedule        support for the DISMAN-SCHEDULE-MIB
Packit fcad23
                             (trigger SET requests at specified times)
Packit fcad23
    host                   host resources mib support.
Packit fcad23
                             (only on major supported platforms)
Packit fcad23
Packit fcad23
  Optional mib modules that can be built into the agent include:
Packit fcad23
    smux                   smux support to allow subagents to attach to snmpd.
Packit fcad23
    mibII/mta_sendmail     Sendmail statistics monitoring (MTA-MIB)
Packit fcad23
    ucd-snmp/diskio        Table of io-devices and how much data they have
Packit fcad23
                           read/written.  (only tested on Solaris, Linux)
Packit fcad23
    disman/old-event-mib   previous implementation of the DISMAN-EVENT-MIB
Packit fcad23
Packit fcad23
  Optional modules for specific platforms
Packit fcad23
    Linux
Packit fcad23
      ucd-snmp/lmSensors   hardware monitoring (LM-SENSORS-MIB)
Packit fcad23
      ip-mib/ipv4InterfaceTable  (experimental)
Packit fcad23
      ip-mib/ipv6InterfaceTable  (experimental)
Packit fcad23
      tunnel               Linux TUNNEL-MIB support (ifTable extension)
Packit fcad23
      mibII/interfaces     (old ifTable implementation)
Packit fcad23
      misc/ipfwacc         accounting rules IP firewall information
Packit fcad23
      ipfwchains/ipfwchains  firewall chains under ipfw
Packit fcad23
                             (See agent/mibgroup/ipfwchains/README)
Packit fcad23
      sctp-mib             support for the SCTP-MIB
Packit fcad23
      etherlike-mib        support for the EtherLike-MIB
Packit fcad23
Packit fcad23
    Solaris
Packit fcad23
      ucd-snmp/lmSensors   hardware monitoring (LM-SENSORS-MIB)
Packit fcad23
      if-mib               IF-MIB rewrite (add --enable-mfd-rewrites)
Packit fcad23
      tcp-mib              TCP-MIB rewrite (tcpConnectionTable and
Packit fcad23
                             tcpListenerTable; add --enable-mfd-rewrites)
Packit fcad23
      udp-mib              UDP-MIB rewrite (udpEndpointTable;
Packit fcad23
                             add --enable-mfd-rewrites)
Packit fcad23
Packit fcad23
    FreeBSD/OpenBSD
Packit fcad23
      if-mib               IF-MIB rewrite (add --enable-mfd-rewrites)
Packit fcad23
Packit fcad23
  AgentX support:
Packit fcad23
    agentx/subagent        allows the agent to run as either a snmp agent
Packit fcad23
                           or as an agentX sub-agent.
Packit fcad23
    agentx/master          makes the agent run as an agentX master agent
Packit fcad23
                           as well as a normal snmp agent.
Packit fcad23
    agentx                 includes both agentx/master and agentx/client.
Packit fcad23
Packit fcad23
  Optional modules for C coders to look at and/or include as extension examples:
Packit fcad23
  
Packit fcad23
    examples/ucdDemoPublic  SNMPv3 interoperability testing mib.
Packit fcad23
    examples/example        example C code extension.])
Packit fcad23
Packit fcad23
Packit fcad23
#
Packit fcad23
# Catch common mistakes in configure options
Packit fcad23
#
Packit fcad23
AC_ARG_WITH(mib-module,, NETSNMP_INVALID_WITH([mib-modules]))
Packit fcad23
AC_ARG_WITH(module,, NETSNMP_INVALID_WITH([mib-modules]))
Packit fcad23
AC_ARG_WITH(modules,, NETSNMP_INVALID_WITH([mib-modules]))
Packit fcad23
Packit fcad23
AC_ARG_WITH(out-mib-module,, NETSNMP_INVALID_WITH([out-mib-modules]))
Packit fcad23
AC_ARG_WITH(out-module,, NETSNMP_INVALID_WITH([out-mib-modules]))
Packit fcad23
AC_ARG_WITH(out-modules,, NETSNMP_INVALID_WITH([out-mib-modules]))
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Enterprise settings	(? Agent/Library/Both?)
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(enterprise-oid,
Packit fcad23
[Enterprise OIDs:  (warning: this should be used with caution.)
Packit fcad23
Packit fcad23
  --with-enterprise-oid              The enterprise number assigned to the
Packit fcad23
                                     vendor by IANA.  See
Packit fcad23
                                     http://www.iana.org/cgi-bin/enterprise.pl
Packit fcad23
                                     to get one, though using the default is
Packit fcad23
                                     probably the right choice is most cases.
Packit fcad23
                                     (default 8072 = "enterprise.net-snmp")],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a value for the enterprise number ]);
Packit fcad23
  fi
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_OID, $withval)
Packit fcad23
  ent_oid="1,3,6,1,4,1,$withval"
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_MIB, $ent_oid)
Packit fcad23
  ent_dot_oid="1.3.6.1.4.1.$withval"
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_DOT_MIB, $ent_dot_oid)
Packit fcad23
  AC_MSG_RESULT(using enterprise number $withval)
Packit fcad23
],[
Packit fcad23
  AC_MSG_RESULT(using default "enterprise.net-snmp")
Packit fcad23
])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(enterprise-sysoid,
Packit fcad23
[
Packit fcad23
  --with-enterprise-sysoid           The base OID for the sysObjectID
Packit fcad23
                                     of the system group
Packit fcad23
                                     (default .1.3.6.1.4.1.8072.3.2... = 
Packit fcad23
                                      "netSnmpAgentOIDs...")],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a base OID value ]);
Packit fcad23
  fi
Packit fcad23
  sys_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_MIB, $sys_oid)
Packit fcad23
  sys_dot_oid=`echo "$withval" | sed 's/^\.//'`
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_DOT_MIB, $sys_dot_oid)
Packit fcad23
  sysoid_len=`echo "$withval" | sed 's/[^\.]//g' | awk -F\. '{ print NF }'`
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_DOT_MIB_LENGTH, $sysoid_len)
Packit fcad23
  AC_MSG_RESULT(using enterprise sysOID $withval ....)
Packit fcad23
],[
Packit fcad23
  AC_MSG_RESULT(using default enterprise sysOID "NET-SNMP-MIB::netSnmpAgentOIDs...")
Packit fcad23
])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(enterprise-notification-oid,
Packit fcad23
[
Packit fcad23
  --with-enterprise-notification-oid The OID used for the root of
Packit fcad23
				     enterprise specific notifications.
Packit fcad23
                                     (default .1.3.6.1.4.1.8072.4 = 
Packit fcad23
                                      "netSnmpNotificationPrefix")],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a base OID value ]);
Packit fcad23
  fi
Packit fcad23
  notification_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_MIB, $notification_oid)
Packit fcad23
  notification_dot_oid=`echo "$withval" | sed 's/^\.//'`
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_DOT_MIB, $notification_dot_oid)
Packit fcad23
  notificationoid_len=`echo "$withval" | sed 's/[^\.]//g' | awk -F\. '{ print NF }'`
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_DOT_MIB_LENGTH, $notificationoid_len)
Packit fcad23
  AC_MSG_RESULT(using enterprise notifications $withval)
Packit fcad23
],[
Packit fcad23
  AC_MSG_RESULT(using default notifications "NET-SNMP-MIB::netSnmpNotifications")
Packit fcad23
])
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Perl settings
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(perl-modules,
Packit fcad23
[
Packit fcad23
Perl:
Packit fcad23
  --with-perl-modules[=ARGS]      Install the Perl modules along with the rest
Packit fcad23
                                  of the net-snmp toolkit. If ARGS is specified,
Packit fcad23
                                  they're passed to the Makefile.PL script. Use
Packit fcad23
                                  --with-perl-modules=verbose while debugging
Packit fcad23
                                  the Makefile.PL files],[
Packit fcad23
    if test "$withval" = "no"; then
Packit fcad23
      install_perl="no"
Packit fcad23
    else
Packit fcad23
      install_perl="yes"
Packit fcad23
      if test "$withval" != "yes"; then
Packit fcad23
        PERLARGS="$withval"
Packit fcad23
      fi
Packit fcad23
    fi
Packit fcad23
], install_perl="try")
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(embedded-perl,
Packit fcad23
[  --disable-embedded-perl         Disable embedded Perl in the SNMP agent and
Packit fcad23
                                  snmptrapd. [enabled by default]],
Packit fcad23
    embed_perl="$enableval", embed_perl="try")
Packit fcad23
Packit fcad23
NETSNMP_ARG_ENABLE(perl-cc-checks,
Packit fcad23
[  --disable-perl-cc-checks        Disable configure checks for whether Perl's
Packit fcad23
                                  C Compiler is compatible with ours when
Packit fcad23
                                  embedded Perl is enabled.])
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Python settings
Packit fcad23
##
Packit fcad23
Packit fcad23
AC_ARG_WITH(python-modules,
Packit fcad23
[
Packit fcad23
Python:
Packit fcad23
  --with-python-modules[=ARGS]    Install the python bindings along with the
Packit fcad23
                                  rest of the net-snmp toolkit.  If ARGS is
Packit fcad23
                                  specified, they're passed to the
Packit fcad23
                                  setup.py script as arguments.],[
Packit fcad23
    install_python="yes"
Packit fcad23
    if test "$withval" = "yes"; then
Packit fcad23
      PYTHONARGS=""
Packit fcad23
    elif test "$withval" = "no"; then
Packit fcad23
      PYTHONARGS=""
Packit fcad23
      install_python="no"
Packit fcad23
    else
Packit fcad23
      PYTHONARGS="$withval"
Packit fcad23
    fi
Packit fcad23
], install_python="no")
Packit fcad23
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: Library settings
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(server-send-buf,
Packit fcad23
[
Packit fcad23
Network Buffers:
Packit fcad23
  --with-server-send-buf[=ARG]    Use ARG for the default UDP/TCP send buffer instead
Packit fcad23
                                  of the OS buffer for server sockets that are
Packit fcad23
                                  created (snmpd, snmptrapd).  
Packit fcad23
                                  This default can be overridden in the runtime 
Packit fcad23
                                  configuration files.
Packit fcad23
                                  The ARG should be the size in bytes],[
Packit fcad23
   if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a positive number for the server send buffer ])
Packit fcad23
   fi
Packit fcad23
   AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_SERVER_SEND_BUF, $withval)],
Packit fcad23
   AC_MSG_RESULT([using OS default send buffer size for server sockets]) )
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(server-recv-buf,
Packit fcad23
[  --with-server-recv-buf[=ARG]    Similar as previous option, but for receive buffer],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a positive number for the server recv buffer ])
Packit fcad23
  fi
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_SERVER_RECV_BUF, $withval)],
Packit fcad23
  AC_MSG_RESULT([using OS default recv buffer size for server sockets]) )
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(client-send-buf,
Packit fcad23
[  --with-client-send-buf[=ARG]    Similar as previous options, but for the
Packit fcad23
                                  receive buffer of client sockets],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a positive number for the client send buffer ])
Packit fcad23
  fi
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_CLIENT_SEND_BUF, $withval)],
Packit fcad23
  AC_MSG_RESULT([using OS default send buffer size for client sockets]) )
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(client-recv-buf,
Packit fcad23
[  --with-client-recv-buf[=ARG]    Similar as previous options, but for the send buffer],[
Packit fcad23
  if test "$withval" = yes; then
Packit fcad23
    AC_MSG_ERROR([ Please provide a positive number for the client recv buffer ])
Packit fcad23
  fi
Packit fcad23
  AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_CLIENT_RECV_BUF, $withval)],
Packit fcad23
  AC_MSG_RESULT([using OS default recv buffer size for client sockets]) )
Packit fcad23
Packit fcad23
##
Packit fcad23
#   System: library settings  (more)
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(elf,
Packit fcad23
  [AS_HELP_STRING([--without-elf],[use elf libraries])])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(nl,
Packit fcad23
  [AS_HELP_STRING([--with-nl],[use libnl to get netlink data (linux only).])])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(libwrap,
Packit fcad23
  [  --with-libwrap[=LIBPATH]  Compile in libwrap (tcp_wrappers) support.],
Packit fcad23
  [],
Packit fcad23
  [with_libwrap="no"])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(zlib,
Packit fcad23
  [  --with-zlib[=DIR]         use libz in DIR],
Packit fcad23
  [],
Packit fcad23
  [with_zlib="no"])
Packit fcad23
Packit fcad23
AC_ARG_WITH(bzip2,
Packit fcad23
  [  --with-bzip2[=DIR]        use libbz2 in DIR],
Packit fcad23
  [],
Packit fcad23
  [with_bzip2="no"])
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(
Packit fcad23
 [mnttab],
Packit fcad23
 AS_HELP_STRING(
Packit fcad23
   [--with-mnttab="/etc/mnttab"],
Packit fcad23
   [Mount table location. The default is to autodetect this.]))
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Project: mysql
Packit fcad23
##
Packit fcad23
Packit fcad23
NETSNMP_ARG_WITH(mysql,
Packit fcad23
  [  --with-mysql            Include support for MySQL.])
Packit fcad23
if test "x$with_mysql" = "xyes"; then
Packit fcad23
  AC_DEFINE(NETSNMP_USE_MYSQL, 1,
Packit fcad23
    [define if you are using the mysql code for snmptrapd ...])
Packit fcad23
fi