]>
Commit | Line | Data |
---|---|---|
7d781163 AF |
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 | |
4 | @@ -0,0 +1,192 @@ | |
5 | +dnl @synopsis AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT]) | |
6 | +dnl | |
7 | +dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional | |
8 | +dnl DEFAULT value if the user merely hits return. | |
9 | +dnl | |
10 | +dnl @version 1.15 | |
11 | +dnl @author Wes Hardaker <hardaker@users.sourceforge.net> | |
12 | +dnl | |
13 | +AC_DEFUN([AC_PROMPT_USER_NO_DEFINE], | |
14 | +dnl changequote(<<, >>) dnl | |
15 | +dnl << | |
16 | +[ | |
17 | +if test "x$defaults" = "xno"; then | |
18 | +echo $ac_n "$2 ($3): $ac_c" | |
19 | +read tmpinput | |
20 | +if test "$tmpinput" = "" -a "$3" != ""; then | |
21 | + tmpinput="$3" | |
22 | +fi | |
23 | +eval $1=\"$tmpinput\" | |
24 | +else | |
25 | +tmpinput="$3" | |
26 | +eval $1=\"$tmpinput\" | |
27 | +fi | |
28 | +] | |
29 | +dnl >> | |
30 | +dnl changequote([, ]) | |
31 | +) dnl done AC_PROMPT_USER | |
32 | + | |
33 | +dnl @synopsis AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT],QUOTED) | |
34 | +dnl | |
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. | |
40 | +dnl | |
41 | +dnl @version 1.15 | |
42 | +dnl @author Wes Hardaker <hardaker@users.sourceforge.net> | |
43 | +dnl | |
44 | +AC_DEFUN([AC_PROMPT_USER], | |
45 | +[ | |
46 | +MSG_CHECK=`echo "$2" | tail -1` | |
47 | +AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1, | |
48 | +[echo "" >&AC_FD_MSG | |
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 | |
52 | +]) | |
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") | |
56 | + else | |
57 | + AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1) | |
58 | + fi | |
59 | +fi | |
60 | +]) dnl | |
61 | + | |
62 | +dnl @synopsis AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no]) | |
63 | +dnl | |
64 | +dnl Checks STRUCT for MEMBER and defines DEFINE if found. | |
65 | +dnl | |
66 | +dnl @version 1.15 | |
67 | +dnl @author Wes Hardaker <hardaker@users.sourceforge.net> | |
68 | +dnl | |
69 | +AC_DEFUN(AC_CHECK_STRUCT_FOR,[ | |
70 | + | |
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}" | |
74 | +changequote(, )dnl | |
75 | + ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` | |
76 | +changequote([, ])dnl | |
77 | + | |
78 | +AC_MSG_CHECKING([for $2.$3]) | |
79 | +AC_CACHE_VAL($ac_safe_all, | |
80 | +[ | |
81 | +if test "x$4" = "x"; then | |
82 | + defineit="= 0" | |
83 | +elif test "x$4" = "xno"; then | |
84 | + defineit="" | |
85 | +else | |
86 | + defineit="$4" | |
87 | +fi | |
88 | +AC_TRY_COMPILE([ | |
89 | +$1 | |
90 | +],[ | |
91 | +struct $2 testit; | |
92 | +testit.$3 $defineit; | |
93 | +], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" ) | |
94 | +]) | |
95 | + | |
96 | +if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then | |
97 | + AC_MSG_RESULT(yes) | |
98 | + AC_DEFINE_UNQUOTED($ac_uc_define) | |
99 | +else | |
100 | + AC_MSG_RESULT(no) | |
101 | +fi | |
102 | + | |
103 | +]) | |
104 | + | |
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 | |
110 | +#define _KERNEL 1 | |
111 | +#endif | |
112 | +#include <sys/types.h> | |
113 | +#include <sys/socket.h> | |
114 | +#ifdef HAVE_SYS_TIME_H | |
115 | +#include <sys/time.h> | |
116 | +#endif | |
117 | +#include <net/if.h> | |
118 | +#ifdef HAVE_NET_IF_VAR_H | |
119 | +#include <net/if_var.h> | |
120 | +#endif | |
121 | +#ifdef HAVE_SYS_QUEUE_H | |
122 | +#include <sys/queue.h> | |
123 | +#endif | |
124 | +#ifdef linux | |
125 | +struct ifnet { | |
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 */ | |
135 | + | |
136 | + struct sockaddr if_addr; /* interface's address */ | |
137 | + struct sockaddr ifu_broadaddr; /* broadcast address */ | |
138 | + struct sockaddr ia_subnetmask; /* interface's mask */ | |
139 | + | |
140 | + struct ifqueue { | |
141 | + int ifq_len; | |
142 | + int ifq_drops; | |
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; | |
154 | +}; | |
155 | +#endif | |
156 | +], ifnet, $1, $2) | |
157 | +]) | |
158 | + | |
159 | +dnl | |
160 | +dnl Add a search path to the LIBS and CFLAGS variables | |
161 | +dnl | |
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" | |
166 | + fi | |
167 | + if test -d $1/include; then | |
168 | + CPPFLAGS="-I$1/include $CPPFLAGS" | |
169 | + fi | |
170 | + fi | |
171 | +]) | |
172 | + | |
173 | +dnl | |
174 | +dnl Store information for displaying later. | |
175 | +dnl | |
176 | +AC_DEFUN(AC_MSG_CACHE_INIT,[ | |
177 | + rm -f configure-summary | |
178 | +]) | |
179 | + | |
180 | +AC_DEFUN(AC_MSG_CACHE_ADD,[ | |
181 | + cat >> configure-summary << EOF | |
182 | + $1 | |
183 | +EOF | |
184 | +]) | |
185 | + | |
186 | +AC_DEFUN(AC_MSG_CACHE_DISPLAY,[ | |
187 | + echo "" | |
188 | + echo "---------------------------------------------------------" | |
189 | + echo " Net-SNMP configuration summary:" | |
190 | + echo "---------------------------------------------------------" | |
191 | + echo "" | |
192 | + cat configure-summary | |
193 | + echo "" | |
194 | + echo "---------------------------------------------------------" | |
195 | + echo "" | |
196 | +]) |