Ethereal-users: [Ethereal-users] small (solved) problem with ethereal-0.8.18's snmp support

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Chris Sylvain <csylvain@xxxxxxxxx>
Date: Wed, 20 Jun 2001 14:16:49 -0400
I built the ucd-snmp-4.2.1 libraries with SSL (openssl-0.9.6a) support,
and the ethereal configure script would bomb at the second attempt to check
for -lsnmp (this time with -lkstat needed on my Solaris7 host) because it
wasn't also adding -lssl and -lcrypto to the list of libraries.

Here's the output from the unmodified configure:

checking for sprint_objid in -lsnmp... no
checking for sprint_objid in -lsnmp... no
configure: error: SNMP header files found, but sprint_objid not found in SNMP library.

So I modified the second check for -lsnmp and the output looks like this:

checking for sprint_objid in -lsnmp... LIBS = -lsnmp -lsocket -lnsl 
         -lz  -R/usr/local/lib
no
checking for sprint_objid in -lsnmp... LIBS = -lsnmp -lsocket -lnsl  -lkstat -lssl -lcrypto
             -lz  -R/usr/local/lib
yes

As you can see, the modified second check now permits configure to finish
successfully.

Here's the diff for configure (I also changed the datatype for sprint_objid,
not that it matters very much):

$ diff -C 3 configure configure.mod
*** configure   Tue Jun 19 18:07:13 2001
- - --- configure.mod       Tue Jun 19 17:53:30 2001
***************
*** 3951,3956 ****
- - --- 3951,3957 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lsnmp $SOCKET_LIBS $NSL_LIBS $SSL_LIBS
         $LIBS"
+ echo "LIBS = $LIBS"
  cat > conftest.$ac_ext <<EOF
  #line 3956 "configure"
  #include "confdefs.h"
***************
*** 3957,3963 ****
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char sprint_objid();
  
  int main() {
  sprint_objid()
- - --- 3958,3964 ----
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char *sprint_objid();
  
  int main() {
  sprint_objid()
***************
*** 3985,3991 ****
            #
            # Throw away the cached "we didn't find it" answer.
            #
!           unset ac_cv_lib_snmp_sprint_objid
            echo $ac_n "checking for sprint_objid in -lsnmp""... $ac_c" 1>&6
  echo "configure:3991: checking for sprint_objid in -lsnmp" >&5
  ac_lib_var=`echo snmp'_'sprint_objid | sed 'y%./+-%__p_%'`
- - --- 3986,3992 ----
            #
            # Throw away the cached "we didn't find it" answer.
            #
!           unset ac_cv_lib_$ac_lib_var
            echo $ac_n "checking for sprint_objid in -lsnmp""... $ac_c" 1>&6
  echo "configure:3991: checking for sprint_objid in -lsnmp" >&5
  ac_lib_var=`echo snmp'_'sprint_objid | sed 'y%./+-%__p_%'`
***************
*** 3993,4000 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
! LIBS="-lsnmp $SOCKET_LIBS $NSL_LIBS $SSL_LIBS -lkstat
             $LIBS"
  cat > conftest.$ac_ext <<EOF
  #line 4000 "configure"
  #include "confdefs.h"
- - --- 3994,4002 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
! LIBS="-lsnmp $SOCKET_LIBS $NSL_LIBS $SSL_LIBS -lkstat -lssl -lcrypto
             $LIBS"
+ echo "LIBS = $LIBS"
  cat > conftest.$ac_ext <<EOF
  #line 4000 "configure"
  #include "confdefs.h"
***************
*** 4001,4007 ****
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char sprint_objid();
  
  int main() {
  sprint_objid()
- - --- 4003,4009 ----
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char *sprint_objid();
  
  int main() {
  sprint_objid()


Hope this helps!

 -christopher sylvain