1 diff -Nru ucd-snmp-4.2.1/acinclude.m4 ucd-snmp-4.2.1.new/acinclude.m4
2 --- ucd-snmp-4.2.1/acinclude.m4 Thu Jan 1 01:00:00 1970
3 +++ ucd-snmp-4.2.1.new/acinclude.m4 Fri May 18 06:48:59 2001
5 +dnl @synopsis AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT])
7 +dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
8 +dnl DEFAULT value if the user merely hits return.
11 +dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
13 +AC_DEFUN([AC_PROMPT_USER_NO_DEFINE],
14 +dnl changequote(<<, >>) dnl
17 +if test "x$defaults" = "xno"; then
18 +echo $ac_n "$2 ($3): $ac_c"
20 +if test "$tmpinput" = "" -a "$3" != ""; then
23 +eval $1=\"$tmpinput\"
26 +eval $1=\"$tmpinput\"
30 +dnl changequote([, ])
31 +) dnl done AC_PROMPT_USER
33 +dnl @synopsis AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT],QUOTED)
35 +dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
36 +dnl DEFAULT value if the user merely hits return. Also calls
37 +dnl AC_DEFINE_UNQUOTED() on the VARIABLENAME for VARIABLENAMEs that should
38 +dnl be entered into the config.h file as well. If QUOTED is "quoted" then
39 +dnl the result will be defined within quotes.
42 +dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
44 +AC_DEFUN([AC_PROMPT_USER],
46 +MSG_CHECK=`echo "$2" | tail -1`
47 +AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1,
49 +AC_PROMPT_USER_NO_DEFINE($1,[$2],$3)
50 +eval ac_cv_user_prompt_$1=\$$1
51 +echo $ac_n "setting $MSG_CHECK to... $ac_c" >&AC_FD_MSG
53 +if test "$ac_cv_user_prompt_$1" != "none"; then
54 + if test "x$4" = "xquoted" -o "x$4" = "xQUOTED"; then
55 + AC_DEFINE_UNQUOTED($1,"$ac_cv_user_prompt_$1")
57 + AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1)
62 +dnl @synopsis AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
64 +dnl Checks STRUCT for MEMBER and defines DEFINE if found.
67 +dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
69 +AC_DEFUN(AC_CHECK_STRUCT_FOR,[
71 +ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
72 +ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
73 +ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
75 + ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
78 +AC_MSG_CHECKING([for $2.$3])
79 +AC_CACHE_VAL($ac_safe_all,
81 +if test "x$4" = "x"; then
83 +elif test "x$4" = "xno"; then
93 +], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
96 +if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
98 + AC_DEFINE_UNQUOTED($ac_uc_define)
105 +dnl AC_CHECK_IFNET_FOR(SUBSTRUCT,[no])
106 +AC_DEFUN(AC_CHECK_IFNET_FOR,[
107 +dnl check for $1 in struct ifnet
108 +AC_CHECK_STRUCT_FOR([
109 +#ifdef IFNET_NEEDS_KERNEL
112 +#include <sys/types.h>
113 +#include <sys/socket.h>
114 +#ifdef HAVE_SYS_TIME_H
115 +#include <sys/time.h>
118 +#ifdef HAVE_NET_IF_VAR_H
119 +#include <net/if_var.h>
121 +#ifdef HAVE_SYS_QUEUE_H
122 +#include <sys/queue.h>
126 + char *if_name; /* name, e.g. "en" or "lo" */
127 + short if_unit; /* sub-unit for lower level driver */
128 + short if_mtu; /* maximum transmission unit */
129 + short if_flags; /* up/down, broadcast, etc. */
130 + int if_metric; /* routing metric (external only) */
131 + char if_hwaddr [6]; /* ethernet address */
132 + int if_type; /* interface type: 1=generic,
133 + 28=slip, ether=6, loopback=24 */
134 + int if_speed; /* interface speed: in bits/sec */
136 + struct sockaddr if_addr; /* interface's address */
137 + struct sockaddr ifu_broadaddr; /* broadcast address */
138 + struct sockaddr ia_subnetmask; /* interface's mask */
143 + } if_snd; /* output queue */
144 + int if_ibytes; /* octets received on interface */
145 + int if_ipackets; /* packets received on interface */
146 + int if_ierrors; /* input errors on interface */
147 + int if_iqdrops; /* input queue overruns */
148 + int if_obytes; /* octets sent on interface */
149 + int if_opackets; /* packets sent on interface */
150 + int if_oerrors; /* output errors on interface */
151 + int if_collisions; /* collisions on csma interfaces */
152 +/* end statistics */
153 + struct ifnet *if_next;
160 +dnl Add a search path to the LIBS and CFLAGS variables
162 +AC_DEFUN(AC_ADD_SEARCH_PATH,[
163 + if test "x$1" != x -a -d $1; then
164 + if test -d $1/lib; then
165 + LDFLAGS="-L$1/lib $LDFLAGS"
167 + if test -d $1/include; then
168 + CPPFLAGS="-I$1/include $CPPFLAGS"
174 +dnl Store information for displaying later.
176 +AC_DEFUN(AC_MSG_CACHE_INIT,[
177 + rm -f configure-summary
180 +AC_DEFUN(AC_MSG_CACHE_ADD,[
181 + cat >> configure-summary << EOF
186 +AC_DEFUN(AC_MSG_CACHE_DISPLAY,[
188 + echo "---------------------------------------------------------"
189 + echo " Net-SNMP configuration summary:"
190 + echo "---------------------------------------------------------"
192 + cat configure-summary
194 + echo "---------------------------------------------------------"