yapsnmp library for python
[openwrt/svn-archive/archive.git] / libs / yapsnmp / patches / 000-compile_fix.patch
1 --- yapsnmp-0.7.8/configure 2004-03-08 05:21:26.000000000 -0600
2 +++ yapsnmp-0.7.8.new/configure 2007-07-19 15:19:03.712465556 -0500
3 @@ -9291,7 +9291,7 @@
4 done
5
6
7 -for PYTHONINCPATH in python2.3 python2.2 python2.1 python2.0 python1.6 python1.5
8 +for PYTHONINCPATH in python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5
9 do
10 as_ac_Header=`echo "ac_cv_header_$PYTHONINCPATH/Python.h" | $as_tr_sh`
11 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12 --- yapsnmp-0.7.8/src/mib.h-patch 2004-03-07 17:09:53.000000000 -0600
13 +++ yapsnmp-0.7.8.new/src/mib.h-patch 2007-07-19 15:12:46.266956163 -0500
14 @@ -1,36 +1,11 @@
15 -*** /usr/include/net-snmp/library/mib.h 2003-11-11 08:37:02.000000000 -0800
16 ---- mib.h 2004-03-07 14:59:47.000000000 -0800
17 -***************
18 -*** 127,133 ****
19 - int get_wild_node(const char *, oid *, size_t *);
20 - int get_node(const char *, oid *, size_t *);
21 - oid *snmp_parse_oid(const char *, oid *, size_t *);
22 -! struct tree *get_symbol(oid *, size_t, struct tree *, char *);
23 - struct tree *get_tree(const oid *, size_t, struct tree *);
24 - struct tree *get_tree_head(void);
25 - void set_function(struct tree *);
26 ---- 127,133 ----
27 - int get_wild_node(const char *, oid *, size_t *);
28 - int get_node(const char *, oid *, size_t *);
29 - oid *snmp_parse_oid(const char *, oid *, size_t *);
30 -! /* struct tree *get_symbol(oid *, size_t, struct tree *, char *);*/
31 - struct tree *get_tree(const oid *, size_t, struct tree *);
32 - struct tree *get_tree_head(void);
33 - void set_function(struct tree *);
34 -***************
35 -*** 482,488 ****
36 - const char *parse_octet_hint(const char *hint, const char *value,
37 - unsigned char **new_val, int *new_val_len);
38 -
39 -! void clear_tree_flags(register struct tree *tp);
40 -
41 - char *snmp_out_toggle_options(char *);
42 - void snmp_out_toggle_options_usage(const char *, FILE *);
43 ---- 482,488 ----
44 - const char *parse_octet_hint(const char *hint, const char *value,
45 - unsigned char **new_val, int *new_val_len);
46 -
47 -! /* void clear_tree_flags(register struct tree *tp);*/
48 -
49 - char *snmp_out_toggle_options(char *);
50 - void snmp_out_toggle_options_usage(const char *, FILE *);
51 +--- mib.h.old 2007-07-19 15:11:03.917123577 -0500
52 ++++ mib.h 2007-07-19 15:10:44.804034380 -0500
53 +@@ -498,7 +498,7 @@
54 + const char *parse_octet_hint(const char *hint, const char *value,
55 + unsigned char **new_val, int *new_val_len);
56 +
57 +- void clear_tree_flags(register struct tree *tp);
58 ++ /* void clear_tree_flags(register struct tree *tp); */
59 +
60 + char *snmp_out_toggle_options(char *);
61 + void snmp_out_toggle_options_usage(const char *, FILE *);
62 --- yapsnmp-0.7.8/src/snmp_api.h-patch 2004-03-07 17:09:53.000000000 -0600
63 +++ yapsnmp-0.7.8.new/src/snmp_api.h-patch 2007-07-19 14:59:23.653217810 -0500
64 @@ -1,147 +1,100 @@
65 -*** /usr/include/net-snmp/library/snmp_api.h 2003-11-11 08:37:07.000000000 -0800
66 ---- snmp_api.h 2004-03-07 15:02:18.000000000 -0800
67 -***************
68 -*** 82,91 ****
69 -
70 - /*
71 - * The actual transport domain. This SHOULD NOT BE FREE()D.
72 -- */
73 -
74 - const oid *tDomain;
75 - size_t tDomainLen;
76 -
77 - netsnmp_variable_list *variables;
78 -
79 ---- 82,91 ----
80 -
81 - /*
82 - * The actual transport domain. This SHOULD NOT BE FREE()D.
83 -
84 - const oid *tDomain;
85 - size_t tDomainLen;
86 -+ */
87 -
88 - netsnmp_variable_list *variables;
89 -
90 -***************
91 -*** 152,158 ****
92 - /*
93 - * Authentication function or NULL if null authentication is used
94 - */
95 -! u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t);
96 - netsnmp_callback callback; /* Function to interpret incoming data */
97 - /*
98 - * Pointer to data that the callback function may consider important
99 ---- 152,158 ----
100 - /*
101 - * Authentication function or NULL if null authentication is used
102 - */
103 -! /* u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t);*/
104 - netsnmp_callback callback; /* Function to interpret incoming data */
105 - /*
106 - * Pointer to data that the callback function may consider important
107 -***************
108 -*** 384,391 ****
109 ---- 384,393 ----
110 -
111 - #define SNMPERR_MAX (-63)
112 -
113 -+ /*
114 - #define non_repeaters errstat
115 - #define max_repetitions errindex
116 -+ */
117 -
118 - struct variable_list {
119 - struct variable_list *next_variable; /* NULL for last variable */
120 -***************
121 -*** 410,416 ****
122 - oid name_loc[MAX_OID_LEN]; /* 90 percentile < 24. */
123 - u_char buf[40]; /* 90 percentile < 40. */
124 - void *data; /* (Opaque) hook for additional data */
125 -! void (*dataFreeHook)(void *); /* callback to free above */
126 - int index;
127 - };
128 -
129 ---- 412,418 ----
130 - oid name_loc[MAX_OID_LEN]; /* 90 percentile < 24. */
131 - u_char buf[40]; /* 90 percentile < 40. */
132 - void *data; /* (Opaque) hook for additional data */
133 -! /* void (*dataFreeHook)(void *); */ /* callback to free above */
134 - int index;
135 - };
136 -
137 -***************
138 -*** 601,608 ****
139 - size_t);
140 - int netsnmp_oid_equals(const oid *, size_t, const oid *,
141 - size_t);
142 -! int netsnmp_oid_tree_equals(const oid *, size_t, const oid *,
143 -! size_t);
144 - int netsnmp_oid_is_subtree(const oid *, size_t, const oid *,
145 - size_t);
146 - int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1,
147 ---- 603,610 ----
148 - size_t);
149 - int netsnmp_oid_equals(const oid *, size_t, const oid *,
150 - size_t);
151 -! /* int netsnmp_oid_tree_equals(const oid *, size_t, const oid *,
152 -! size_t);*/
153 - int netsnmp_oid_is_subtree(const oid *, size_t, const oid *,
154 - size_t);
155 - int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1,
156 -***************
157 -*** 619,629 ****
158 ---- 621,633 ----
159 +--- snmp_api.h.orig Fri Jan 7 17:06:46 2005
160 ++++ snmp_api.h Fri Jan 7 17:10:01 2005
161 +@@ -112,10 +112,10 @@
162 +
163 + /**
164 + * The actual transport domain. This SHOULD NOT BE FREE()D.
165 +- */
166 +
167 + const oid *tDomain;
168 + size_t tDomainLen;
169 ++ */
170 +
171 + netsnmp_variable_list *variables;
172 +
173 +@@ -209,7 +209,7 @@
174 + /**
175 + * Authentication function or NULL if null authentication is used
176 + */
177 +- u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t);
178 ++ /* u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t); */
179 + /** Function to interpret incoming data */
180 + netsnmp_callback callback;
181 + /**
182 +@@ -487,8 +487,10 @@
183 +
184 + #define SNMPERR_MAX (-63)
185 +
186 ++/*
187 + #define non_repeaters errstat
188 + #define max_repetitions errindex
189 ++*/
190 +
191 + typedef union {
192 + long *integer;
193 +@@ -530,7 +532,7 @@
194 + /** (Opaque) hook for additional data */
195 + void *data;
196 + /** callback to free above */
197 +- void (*dataFreeHook)(void *);
198 ++ /* void (*dataFreeHook)(void *); */
199 + int index;
200 + };
201 +
202 +@@ -721,8 +723,8 @@
203 + size_t);
204 + int netsnmp_oid_equals(const oid *, size_t, const oid *,
205 + size_t);
206 +- int netsnmp_oid_tree_equals(const oid *, size_t, const oid *,
207 +- size_t);
208 ++/* int netsnmp_oid_tree_equals(const oid *, size_t, const oid *,
209 ++ size_t);*/
210 + int netsnmp_oid_is_subtree(const oid *, size_t, const oid *,
211 + size_t);
212 + int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1,
213 +@@ -739,11 +741,13 @@
214 + size_t * out_length,
215 + u_char * pdu_data,
216 + size_t pdu_data_len);
217 ++/*
218 + int snmpv3_packet_rbuild(netsnmp_session *,
219 + netsnmp_pdu *pdu, u_char * packet,
220 size_t * out_length,
221 u_char * pdu_data,
222 size_t pdu_data_len);
223 -+ /*
224 - int snmpv3_packet_rbuild(netsnmp_session *,
225 - netsnmp_pdu *pdu, u_char * packet,
226 - size_t * out_length,
227 - u_char * pdu_data,
228 - size_t pdu_data_len);
229 -+ */
230 - int snmpv3_make_report(netsnmp_pdu *pdu, int error);
231 - int snmpv3_get_report_type(netsnmp_pdu *pdu);
232 - int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data,
233 -***************
234 -*** 672,677 ****
235 ---- 676,682 ----
236 - * Extended open; fpre_parse has changed.
237 - */
238 -
239 -+ /*
240 - netsnmp_session *snmp_open_ex(netsnmp_session *,
241 - int (*fpre_parse) (netsnmp_session *,
242 - struct
243 -***************
244 -*** 689,694 ****
245 ---- 694,700 ----
246 - netsnmp_pdu *, u_char **,
247 - size_t *, size_t *),
248 - int (*fcheck) (u_char *, size_t));
249 -+ */
250 -
251 - /*
252 - * provided for backwards compatability. Don't use these functions.
253 -***************
254 -*** 770,775 ****
255 ---- 776,782 ----
256 - *
257 - */
258 -
259 -+ /*
260 - void *snmp_sess_add_ex(netsnmp_session *,
261 - struct netsnmp_transport_s *,
262 - int (*fpre_parse) (netsnmp_session *,
263 -***************
264 -*** 836,841 ****
265 ---- 843,849 ----
266 - *, void *,
267 - size_t)
268 - );
269 -+ */
270 -
271 - /*
272 - * use return value from snmp_sess_open as void * parameter
273 ++*/
274 + int snmpv3_make_report(netsnmp_pdu *pdu, int error);
275 + int snmpv3_get_report_type(netsnmp_pdu *pdu);
276 + int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data,
277 +@@ -793,6 +797,7 @@
278 + * Extended open; fpre_parse has changed.
279 + */
280 +
281 ++ /*
282 + netsnmp_session *snmp_open_ex(netsnmp_session *,
283 + int (*fpre_parse) (netsnmp_session *,
284 + struct
285 +@@ -810,6 +815,7 @@
286 + netsnmp_pdu *, u_char **,
287 + size_t *, size_t *),
288 + int (*fcheck) (u_char *, size_t));
289 ++ */
290 +
291 + /*
292 + * provided for backwards compatability. Don't use these functions.
293 +@@ -891,6 +897,7 @@
294 + *
295 + */
296 +
297 ++ /*
298 + void *snmp_sess_add_ex(netsnmp_session *,
299 + struct netsnmp_transport_s *,
300 + int (*fpre_parse) (netsnmp_session *,
301 +@@ -957,6 +964,7 @@
302 + *, void *,
303 + size_t)
304 + );
305 ++ */
306 +
307 + /*
308 + * use return value from snmp_sess_open as void * parameter
309 --- yapsnmp-0.7.8/configure.old 2007-07-19 16:27:36.126818690 -0500
310 +++ yapsnmp-0.7.8/configure 2007-07-19 16:28:12.692902474 -0500
311 @@ -8816,7 +8816,7 @@
312 #define HAVE_LIBSNMP 1
313 _ACEOF
314
315 - LIBS="-lsnmp $LIBS"
316 + LIBS="-lnetsnmp $LIBS"
317
318 else
319 { { echo "$as_me:$LINENO: error: Couldn't find libsnmp" >&5
320 --- yapsnmp-0.7.8/configure.old 2007-07-19 16:30:48.185763508 -0500
321 +++ yapsnmp-0.7.8/configure 2007-07-19 16:30:52.021982121 -0500
322 @@ -8757,13 +8757,13 @@
323 fi
324
325
326 -echo "$as_me:$LINENO: checking for init_snmp in -lsnmp" >&5
327 -echo $ECHO_N "checking for init_snmp in -lsnmp... $ECHO_C" >&6
328 +echo "$as_me:$LINENO: checking for init_snmp in -lnetsnmp" >&5
329 +echo $ECHO_N "checking for init_snmp in -lnetsnmp... $ECHO_C" >&6
330 if test "${ac_cv_lib_snmp_init_snmp+set}" = set; then
331 echo $ECHO_N "(cached) $ECHO_C" >&6
332 else
333 ac_check_lib_save_LIBS=$LIBS
334 -LIBS="-lsnmp $LIBS"
335 +LIBS="-lnetsnmp $LIBS"
336 cat >conftest.$ac_ext <<_ACEOF
337 #line $LINENO "configure"
338 /* confdefs.h. */
339 --- yapsnmp-0.7.8/configure.old 2007-07-19 16:31:52.277415884 -0500
340 +++ yapsnmp-0.7.8/configure 2007-07-19 16:36:41.477896480 -0500
341 @@ -9262,35 +9262,6 @@
342
343 done
344
345 -
346 -for TEMP in $oldincludedir $ac_default_prefix/include $prefix/include
347 -do
348 - SNMPINCDIR=$TEMP/$NETINCL
349 - as_ac_File=`echo "ac_cv_file_$SNMPINCDIR" | $as_tr_sh`
350 -echo "$as_me:$LINENO: checking for $SNMPINCDIR" >&5
351 -echo $ECHO_N "checking for $SNMPINCDIR... $ECHO_C" >&6
352 -if eval "test \"\${$as_ac_File+set}\" = set"; then
353 - echo $ECHO_N "(cached) $ECHO_C" >&6
354 -else
355 - test "$cross_compiling" = yes &&
356 - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
357 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
358 - { (exit 1); exit 1; }; }
359 -if test -r "$SNMPINCDIR"; then
360 - eval "$as_ac_File=yes"
361 -else
362 - eval "$as_ac_File=no"
363 -fi
364 -fi
365 -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
366 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
367 -if test `eval echo '${'$as_ac_File'}'` = yes; then
368 - break
369 -fi
370 -
371 -done
372 -
373 -
374 for PYTHONINCPATH in python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5
375 do
376 as_ac_Header=`echo "ac_cv_header_$PYTHONINCPATH/Python.h" | $as_tr_sh`
377 --- yapsnmp-0.7.8/configure.old 2007-07-19 16:37:52.729956905 -0500
378 +++ yapsnmp-0.7.8/configure 2007-07-19 16:39:47.880518956 -0500
379 @@ -9406,35 +9406,6 @@
380 if test "${enable_site_packages_prefix+set}" = set; then
381 enableval="$enable_site_packages_prefix"
382 SITEPACKAGE=\$\(exec_prefix\)/lib/$PYTHONINCPATH/site-packages
383 -else
384 -
385 -for TEMP in /usr/lib $ac_default_prefix/lib $prefix/lib
386 -do
387 - SITEPACKAGE=$TEMP/$PYTHONINCPATH/site-packages
388 - as_ac_File=`echo "ac_cv_file_$SITEPACKAGE" | $as_tr_sh`
389 -echo "$as_me:$LINENO: checking for $SITEPACKAGE" >&5
390 -echo $ECHO_N "checking for $SITEPACKAGE... $ECHO_C" >&6
391 -if eval "test \"\${$as_ac_File+set}\" = set"; then
392 - echo $ECHO_N "(cached) $ECHO_C" >&6
393 -else
394 - test "$cross_compiling" = yes &&
395 - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
396 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
397 - { (exit 1); exit 1; }; }
398 -if test -r "$SITEPACKAGE"; then
399 - eval "$as_ac_File=yes"
400 -else
401 - eval "$as_ac_File=no"
402 -fi
403 -fi
404 -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
405 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
406 -if test `eval echo '${'$as_ac_File'}'` = yes; then
407 - break
408 -fi
409 -
410 -done
411 -
412 fi;
413
414
415 --- yapsnmp-0.7.8/src/Makefile.in.old 2007-07-19 21:38:20.589306061 -0500
416 +++ yapsnmp-0.7.8/src/Makefile.in 2007-07-19 21:38:37.290257791 -0500
417 @@ -180,7 +180,7 @@
418 rm -f "$${dir}/so_locations"; \
419 done
420 netsnmpc.la: $(netsnmpc_la_OBJECTS) $(netsnmpc_la_DEPENDENCIES)
421 - $(LINK) -rpath $(libdir) $(netsnmpc_la_LDFLAGS) $(netsnmpc_la_OBJECTS) $(netsnmpc_la_LIBADD) $(LIBS)
422 + $(LINK) -rpath /usr/lib $(netsnmpc_la_LDFLAGS) $(netsnmpc_la_OBJECTS) $(netsnmpc_la_LIBADD) $(LIBS)
423
424 mostlyclean-compile:
425 -rm -f *.$(OBJEXT) core *.core