On 11/16/16 13:15, Robert Story wrote:
How are you running configure? I ran configure with defaults plus
--enable-perl-modules and did not have any test failures.

Hello Robert,

I have attached the scripts I use to configure and build Net-SNMP to this e-mail. These scripts should be stored in a directory outside the Net-SNMP source tree. The net-snmp-rebuild script is the main script and invokes the other scripts.

Bart.

#!/usr/bin/env bash

# Necessary software packages for building Net-SNMP:
# autoconf automake libtool m4
# glibc glibc-devel libssh2 libssh2-devel openssl openssl-devel rpm-devel
# perl-ExtUtils-MakeMaker perl-ExtUtils-Embed perl-Test-Harness
# python python-devel python-setuptools

scriptdir="$(dirname "$0")"

branch_name="$("$scriptdir/branch-name")"

is_5_3_or_above="true"
is_5_4_or_above="false"
is_5_5_or_above="false"
is_5_6_or_above="false"
is_5_7_or_above="false"
if [ ${branch_name} = trunk -o ${branch_name} = master ]
then
  is_5_7_or_above="true"
  is_5_6_or_above="true"
  is_5_5_or_above="true"
  is_5_4_or_above="true"
elif [ ${branch_name#V5-7-} != ${branch_name} ]
then
  is_5_7_or_above="true"
  is_5_6_or_above="true"
  is_5_5_or_above="true"
  is_5_4_or_above="true"
elif [ ${branch_name#V5-6-} != ${branch_name} ]
then
  is_5_6_or_above="true"
  is_5_5_or_above="true"
  is_5_4_or_above="true"
elif [ ${branch_name#V5-5-} != ${branch_name} ]
then
  is_5_5_or_above="true"
  is_5_4_or_above="true"
elif [ ${branch_name#V5-4-} != ${branch_name} \
       -o ${branch_name%-5.4.2.1} != ${branch_name} ]
then
  is_5_4_or_above="true"
fi
have_rtnetlink=true
#srcdir=${1:-.}; shift
opensslver="$(if [ "${OSTYPE#linux}" != "${OSTYPE}" ]; then { rpm -q 
openssl-devel 2>/dev/null; rpm -q libopenssl-devel 2>/dev/null; } | sed -n 
's/.*openssl-devel-\([0-9a-z.]*\)-.*/\1/p'; dpkg-query --show libssl-dev 
2>/dev/null | { read a b; echo $b; } 2>&1; pacman -Q openssl 2>&1 | sed -n 
's/^openssl[[:blank:]]*//p'; elif [ "${OSTYPE#freebsd}" != "${OSTYPE}" -o 
"${OSTYPE#netbsd}" != "${OSTYPE}" -o "${OSTYPE#AIX}" != "${OSTYPE}" ]; then 
echo 1.0; fi)"
if grep -q 'CentOS release 4' /etc/issue 2>/dev/null; then
  opensslver=""
  have_rtnetlink=false
fi
if [ "${opensslver#0.9}" = "${opensslver}" ]; then
  is_openssl_1_0="true"
else
  is_openssl_1_0="false"
fi
opensshver="$({ rpm -q openssh-devel; rpm -q libssh-devel; } 2>/dev/null | sed 
-n 's/^.*ssh-devel-\([0-9a-z.]*\)-.*$/\1/p')"
srcdir=.
cflags="-g -O0 -pipe -DNETSNMP_USE_ASSERT"
if true; then
  # Disable inlining to make debugging easier
  cflags="$cflags -fno-strict-aliasing -fno-inline -fno-inline-functions 
-fno-inline-functions-called-once -fno-early-inlining -Wno-inline"
  if gcc -fno-inline-small-functions -xc -c - </dev/null >/dev/null 2>&1; then
    cflags="$cflags -fno-inline-small-functions"
  fi
fi

case "$(uname)" in
  Linux*)
    ${srcdir}/configure \
      --enable-developer \
      --enable-ipv6 \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="\
disman/event \
disman/expression \
disman/mteObjectsTable \
disman/mteTriggerBooleanTable \
disman/mteTriggerDeltaTable \
disman/mteTriggerExistenceTable \
disman/mteTriggerTable \
disman/mteTriggerThresholdTable \
disman/nslookup-mib \
disman/ping-mib \
disman/schedule \
disman/traceroute-mib \
examples/data_set \
examples/delayed_instance \
examples/example \
examples/netSnmpHostsTable \
examples/notification \
examples/scalar_int \
examples/ucdDemoPublic \
examples/watched \
$($is_5_5_or_above && echo hardware/sensors) \
host \
ip-forward-mib \
ip-mib/inetNetToMediaTable \
$($is_5_5_or_above && echo ip-mib/ipDefaultRouterTable) \
ip-mib/ipv4InterfaceTable \
ip-mib/ipv6InterfaceTable \
$($is_5_5_or_above && echo ip-mib/ipv6ScopeZoneIndexTable) \
mibII/ipAddr \
mibII/mta_sendmail \
misc/ipfwacc \
smux \
snmp-notification-mib \
snmp-usm-dh-objects-mib \
$($is_5_6_or_above && echo tlstm-mib tsm-mib) \
testhandler \
tunnel \
ucd-snmp/diskio \
$($is_5_5_or_above && echo ucd-snmp/lmsensorsMib) \
ucd-snmp/extensible \
$($is_5_4_or_above && echo sctp-mib) \
$($is_5_5_or_above && $have_rtnetlink && echo etherlike-mib rmon-mib || echo 
Rmon)" \
      --with-mysql \
      --with-transports="$([ "$opensshver" != "" ] && $is_5_5_or_above && echo 
SSH) $([ "$opensslver" != "" ] && $is_5_6_or_above && echo TLSTCP) 
$($is_5_6_or_above && $is_openssl_1_0 && [ "$opensslver" != "" ] && echo 
DTLSUDP)" \
      $(if [ "$opensslver" = "" ]; then if $is_5_6_or_above; then if false; 
then echo --with-openssl=internal; fi; else echo --without-openssl 
--with-default-snmp-version="2"; fi; fi) \
      $({ rpm -q python-setuptools >/dev/null 2>&1 || rpm -q python-devel 
>/dev/null 2>&1 || dpkg-query -l python-setuptools >/dev/null 2>&1; } && echo 
--with-python-modules) \
      $(if [ $HOSTNAME = cell-user ]; then echo --disable-embedded-perl 
--without-perl-modules; fi) \
      "$@"
# Disabled modules because troublesome: Rmon ipfwchains/ipfwchains 
ucd-snmp/lmSensors
    ;;
  AIX*)
    mkdir -p $HOME/.net-snmp
    ${srcdir}/configure \
      --enable-developer \
      --enable-ipv6 \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="examples/data_set examples/delayed_instance 
examples/netSnmpHostsTable examples/example examples/notification 
examples/scalar_int examples/ucdDemoPublic examples/watched host misc/ipfwacc 
smux snmp-notification-mib snmp-usm-dh-objects-mib tcp-mib ucd-snmp/diskio 
ucd-snmp/extensible udp-mib $($is_5_5_or_above && $have_rtnetlink && echo 
etherlike-mib rmon-mib || echo Rmon)" \
      --with-persistent-directory=$HOME/.net-snmp \
      --with-transports="$([ "$opensshver" != "" ] && $is_5_5_or_above && echo 
SSH) $([ "$opensslver" != "" ] && $is_5_6_or_above && echo TLSTCP) 
$($is_5_6_or_above && $is_openssl_1_0 && [ "$opensslver" != "" ] && echo 
DTLSUDP)" \
      $(if [ "$opensslver" = "" ]; then if $is_5_6_or_above; then if false; 
then echo --with-openssl=internal; fi; else echo --without-openssl 
--with-default-snmp-version="2"; fi; fi) \
      "$@"
    ;;
  FreeBSD*)
    ${srcdir}/configure \
      --enable-developer \
      --enable-ipv6 \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="disman/nslookup-mib examples/data_set 
examples/delayed_instance examples/netSnmpHostsTable examples/example 
examples/notification examples/scalar_int examples/ucdDemoPublic 
examples/watched host if-mib mibII/mta_sendmail misc/ipfwacc smux 
snmp-notification-mib snmp-usm-dh-objects-mib tcp-mib ucd-snmp/diskio 
ucd-snmp/extensible udp-mib $($is_5_4_or_above && echo sctp-mib) 
$($is_5_5_or_above && $have_rtnetlink && echo etherlike-mib rmon-mib || echo 
Rmon)" \
      --with-transports="$([ "$opensshver" != "" ] && $is_5_5_or_above && echo 
SSH) $([ "$opensslver" != "" ] && $is_5_6_or_above && echo TLSTCP) 
$($is_5_6_or_above && $is_openssl_1_0 && [ "$opensslver" != "" ] && echo 
DTLSUDP)" \
      $(if [ "$opensslver" = "" ]; then if $is_5_6_or_above; then if false; 
then echo --with-openssl=internal; fi; else echo --without-openssl 
--with-default-snmp-version="2"; fi; fi) \
      --with-python-modules \
      $(if [ $HOSTNAME = cell-user ]; then echo --disable-embedded-perl 
--without-perl-modules; fi) \
      "$@"
# Disabled modules because troublesome: Rmon ipfwchains/ipfwchains 
ucd-snmp/lmSensors
    ;;
  NetBSD*)
    ${srcdir}/configure \
      --enable-developer \
      --enable-ipv6 \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="disman/nslookup-mib examples/data_set 
examples/delayed_instance examples/netSnmpHostsTable examples/example 
examples/notification examples/scalar_int examples/ucdDemoPublic 
examples/watched host if-mib mibII/mta_sendmail misc/ipfwacc smux 
snmp-notification-mib snmp-usm-dh-objects-mib tcp-mib ucd-snmp/diskio 
ucd-snmp/extensible udp-mib $($is_5_5_or_above && $have_rtnetlink && echo 
etherlike-mib rmon-mib || echo Rmon)" \
      --with-transports="$([ "$opensshver" != "" ] && $is_5_5_or_above && echo 
SSH)" \
      $(if [ "$opensslver" = "" ]; then if $is_5_6_or_above; then if false; 
then echo --with-openssl=internal; fi; else echo --without-openssl 
--with-default-snmp-version="2"; fi; fi) \
      $(if [ $HOSTNAME = cell-user ]; then echo --disable-embedded-perl 
--without-perl-modules; fi) \
      "$@"
    ;;
  SunOS*)
    ${srcdir}/configure \
      --enable-developer \
      --enable-ipv6 \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="smux mibII rmon-mib examples/example" \
      "$@"
    ;;
  CYGWIN*)
    # --disable-embedded-perl
    ENV_SEPARATOR=":" \
    ${srcdir}/configure \
      --enable-developer \
      --enable-ipv6 \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="smux examples/example ucd-snmp/extensible winExtDLL" \
      "$@"
    ;;
  MINGW*)
    ${srcdir}/configure \
      --disable-embedded-perl \
      $(if [ "$branch_name" != "V5-4-patches" ]; then
          echo --enable-ipv6;
          echo --with-openssl=/c/OpenSSL;
        fi) \
      --prefix="/usr/local/net-snmp-${branch_name}" \
      --with-cflags="$cflags" \
      --with-defaults \
      --with-mib-modules="examples/example smux snmp-notification-mib \
            ucd-snmp/dlmod ucd-snmp/extensible winExtDLL" \
      --without-perl-modules \
      #--with-mibdirs="C:/usr/share/snmp/mibs" \
    ;;
  *)
    echo "Unknown OS $(uname)."
    ;;
esac
#!/usr/bin/env bash

set -x

usage() {
    echo "Usage: $(basename "$0") [-p]"
}

scriptdir="$(dirname "$0")"

[ -e /usr/bin/getopt ] || exit 1
options="$(/usr/bin/getopt p "$@")" || { usage; exit 1; }
set -- $options
while [ "$1" != "${1#-}" ]; do
    case "$1" in
        '-p') preserve=true; shift;;
        '--') shift; break;;
        *)    usage; exit 1;;
    esac
done

{
  killall lt-snmpd lt-snmptrapd >&/dev/null
  if [ -z "$preserve" ]; then "${scriptdir}"/clean-source-tree; fi &&
  if [ -e .svn ] && type -p svn >&/dev/null; then
       svn update
     elif [ -e .git ]; then
       :
       #git fetch origin -p
       #git rebase origin/$($scriptdir/branch-name)
     fi &&
  "${scriptdir}"/net-snmp-configure "$@" &&
  make -s &&
  make -s test &&
  (
      cd testing &&
      if [ -e RUNFULLTESTS ]; then ./RUNFULLTESTS -g unit-tests; fi
  ) &&
  (
      export 
LD_LIBRARY_PATH="$PWD/snmplib/.libs:$PWD/agent/.libs:$PWD/agent/helpers/.libs" 
&&
      cd perl &&
      make test
  )
} 2>&1 | tee ../net-snmp-$(basename $PWD)-build-log.txt
#!/usr/bin/env bash

shopt -s nullglob

remove_empty_directories() {
    find . -depth -type d |
        sed 's|^\./||' |
        grep -Ev '^\.$|^\.svn/|/\.svn/|/\.svn$|^\.hg/|^\.hg$|^\.git/|^\.git$' |
        while read d; do
            for f in "$d"/{*,.*}; do
                if ! [ -e "$f" ]; then
                    rmdir "$d"
                fi
                break
            done
        done
}

if [ $# = 0 ]; then
  . "$0" .
else
  for d in "$@"; do
  (
    if cd "$d"; then
      if [ -e .svn ]; then
        if ! type -p svn >&/dev/null; then
          echo "$0: svn: not found."
          exit 0
        fi
        "$(dirname "$0")"/list-non-source-files |
          while read f; do
            if [ "$f" != "TAGS" ]; then rm -rf -- "$f"; fi;
          done
      elif [ -e .git -o -e ../.git ]; then
        if ! type -p git >&/dev/null; then
          echo "$0: git: not found."
          exit 0
        fi
        git clean -f -d -x >/dev/null
        remove_empty_directories
      elif [ -e .hg -o -e ../.hg ]; then
        if ! type -p hg >&/dev/null; then
          echo "$0: hg: not found."
          exit 0
        fi
        hg purge --all
      else
        echo "$0: $d: not administered by Subversion, Git or Mercurial."
        continue
      fi
    fi
  )
  done
fi
#!/usr/bin/env bash

if [ -e .git ]; then
  cat .git/HEAD | sed 's:.*/::'
elif [ -e .svn ]; then
  svn info . | sed -n 's=^URL: .*/\([^/]*\)$=\1=p'
else
  echo branch-name-not-known
fi
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to