fix cross-compiling issue in configure, force configure args to what we need, cleanup...
[packages.git] / net / ifstat / patches / 001-configure_cross.patch
1 diff -ruN ifstat-1.1-old/configure ifstat-1.1-new/configure
2 --- ifstat-1.1-old/configure    2004-01-01 20:18:14.000000000 +0100
3 +++ ifstat-1.1-new/configure    2007-09-06 12:20:40.000000000 +0200
4 @@ -1387,34 +1387,39 @@
5    esac
6    echo $ac_n "checking for proc interface in $file""... $ac_c" 1>&6
7  echo "configure:1390: checking for proc interface in $file" >&5
8 -  if grep -q Inter- $file 2>/dev/null; then
9 -    cat >> confdefs.h <<\EOF
10 +  if test "$cross_compiling" = yes; then
11 +    with_proc=cross
12 +  elif grep -q Inter- $file 2>/dev/null; then
13 +    with_proc=yes
14 +  else
15 +    with_proc=no
16 +  fi
17 +  echo "$ac_t""$with_proc" 1>&6
18 +fi
19 +if test "x$with_proc" != "xno"; then
20 +  cat >> confdefs.h <<\EOF
21  #define USE_PROC 1
22  EOF
23  
24 -    cat >> confdefs.h <<EOF
25 +  cat >> confdefs.h <<EOF
26  #define PROC_FILE "$file"
27  EOF
28  
29 -    with_proc=yes
30 -    with_ioctl=yes
31 -    local=yes
32 -  else
33 -    with_proc=no
34 -  fi
35 -  echo "$ac_t""$with_proc" 1>&6
36 +  with_proc=yes
37 +  with_ioctl=yes
38 +  local=yes
39  fi
40  
41  # checking for kstat (Solaris)
42  test "x$with_kstat" = "xauto" -a "x$local" = "xyes" && with_kstat=no
43  if test "x$with_kstat" != "xno"; then
44    echo $ac_n "checking for kstat_open""... $ac_c" 1>&6
45 -echo "configure:1413: checking for kstat_open" >&5
46 +echo "configure:1418: checking for kstat_open" >&5
47  if eval "test \"`echo '$''{'ac_cv_func_kstat_open'+set}'`\" = set"; then
48    echo $ac_n "(cached) $ac_c" 1>&6
49  else
50    cat > conftest.$ac_ext <<EOF
51 -#line 1418 "configure"
52 +#line 1423 "configure"
53  #include "confdefs.h"
54  /* System header to define __stub macros and hopefully few prototypes,
55      which can conflict with char kstat_open(); below.  */
56 @@ -1437,7 +1442,7 @@
57  
58  ; return 0; }
59  EOF
60 -if { (eval echo configure:1441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
61 +if { (eval echo configure:1446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
62    rm -rf conftest*
63    eval "ac_cv_func_kstat_open=yes"
64  else
65 @@ -1461,7 +1466,7 @@
66      case "x$LIBS" in
67        *-lkstat*) ;;
68        *) echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
69 -echo "configure:1465: checking for kstat_open in -lkstat" >&5
70 +echo "configure:1470: checking for kstat_open in -lkstat" >&5
71  ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
72  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
73    echo $ac_n "(cached) $ac_c" 1>&6
74 @@ -1469,7 +1474,7 @@
75    ac_save_LIBS="$LIBS"
76  LIBS="-lkstat  $LIBS"
77  cat > conftest.$ac_ext <<EOF
78 -#line 1473 "configure"
79 +#line 1478 "configure"
80  #include "confdefs.h"
81  /* Override any gcc2 internal prototype to avoid an error.  */
82  /* We use char because int might match the return type of a gcc2
83 @@ -1480,7 +1485,7 @@
84  kstat_open()
85  ; return 0; }
86  EOF
87 -if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
88 +if { (eval echo configure:1489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
89    rm -rf conftest*
90    eval "ac_cv_lib_$ac_lib_var=yes"
91  else
92 @@ -1507,17 +1512,17 @@
93  do
94  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
95  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
96 -echo "configure:1511: checking for $ac_hdr" >&5
97 +echo "configure:1516: checking for $ac_hdr" >&5
98  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
99    echo $ac_n "(cached) $ac_c" 1>&6
100  else
101    cat > conftest.$ac_ext <<EOF
102 -#line 1516 "configure"
103 +#line 1521 "configure"
104  #include "confdefs.h"
105  #include <$ac_hdr>
106  EOF
107  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
108 -{ (eval echo configure:1521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
109 +{ (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
110  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
111  if test -z "$ac_err"; then
112    rm -rf conftest*
113 @@ -1557,17 +1562,17 @@
114  if test "x$with_ifmib" != "xno"; then
115    ac_safe=`echo "net/if_mib.h" | sed 'y%./+-%__p_%'`
116  echo $ac_n "checking for net/if_mib.h""... $ac_c" 1>&6
117 -echo "configure:1561: checking for net/if_mib.h" >&5
118 +echo "configure:1566: checking for net/if_mib.h" >&5
119  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
120    echo $ac_n "(cached) $ac_c" 1>&6
121  else
122    cat > conftest.$ac_ext <<EOF
123 -#line 1566 "configure"
124 +#line 1571 "configure"
125  #include "confdefs.h"
126  #include <net/if_mib.h>
127  EOF
128  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
129 -{ (eval echo configure:1571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
130 +{ (eval echo configure:1576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
131  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
132  if test -z "$ac_err"; then
133    rm -rf conftest*
134 @@ -1584,12 +1589,12 @@
135  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
136    echo "$ac_t""yes" 1>&6
137    echo $ac_n "checking for sysctl""... $ac_c" 1>&6
138 -echo "configure:1588: checking for sysctl" >&5
139 +echo "configure:1593: checking for sysctl" >&5
140  if eval "test \"`echo '$''{'ac_cv_func_sysctl'+set}'`\" = set"; then
141    echo $ac_n "(cached) $ac_c" 1>&6
142  else
143    cat > conftest.$ac_ext <<EOF
144 -#line 1593 "configure"
145 +#line 1598 "configure"
146  #include "confdefs.h"
147  /* System header to define __stub macros and hopefully few prototypes,
148      which can conflict with char sysctl(); below.  */
149 @@ -1612,7 +1617,7 @@
150  
151  ; return 0; }
152  EOF
153 -if { (eval echo configure:1616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
154 +if { (eval echo configure:1621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
155    rm -rf conftest*
156    eval "ac_cv_func_sysctl=yes"
157  else
158 @@ -1642,17 +1647,17 @@
159  do
160  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
161  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
162 -echo "configure:1646: checking for $ac_hdr" >&5
163 +echo "configure:1651: checking for $ac_hdr" >&5
164  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
165    echo $ac_n "(cached) $ac_c" 1>&6
166  else
167    cat > conftest.$ac_ext <<EOF
168 -#line 1651 "configure"
169 +#line 1656 "configure"
170  #include "confdefs.h"
171  #include <$ac_hdr>
172  EOF
173  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
174 -{ (eval echo configure:1656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
175 +{ (eval echo configure:1661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
176  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
177  if test -z "$ac_err"; then
178    rm -rf conftest*
179 @@ -1679,13 +1684,13 @@
180  done
181  
182      echo $ac_n "checking for working ifmib sysctl""... $ac_c" 1>&6
183 -echo "configure:1683: checking for working ifmib sysctl" >&5
184 +echo "configure:1688: checking for working ifmib sysctl" >&5
185      # try run since interface is available on darwin but doesn't work
186      if test "$cross_compiling" = yes; then
187    with_ifmib=maybe
188  else
189    cat > conftest.$ac_ext <<EOF
190 -#line 1689 "configure"
191 +#line 1694 "configure"
192  #include "confdefs.h"
193  #include <sys/types.h>
194                 #include <sys/socket.h>
195 @@ -1706,7 +1711,7 @@
196                 int size;
197                 int main() { return sysctl(ifcount, 5, NULL, &size, NULL, NULL); }
198  EOF
199 -if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
200 +if { (eval echo configure:1715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
201  then
202    with_ifmib=yes
203  else
204 @@ -1733,9 +1738,9 @@
205  test "x$with_ifdata" = "xauto" -a "x$local" = "xyes" && with_ifdata=no
206  if test "x$with_ifdata" != "xno"; then
207    echo $ac_n "checking for SIOCGIFDATA and ifdatareq""... $ac_c" 1>&6
208 -echo "configure:1737: checking for SIOCGIFDATA and ifdatareq" >&5
209 +echo "configure:1742: checking for SIOCGIFDATA and ifdatareq" >&5
210    cat > conftest.$ac_ext <<EOF
211 -#line 1739 "configure"
212 +#line 1744 "configure"
213  #include "confdefs.h"
214  #include <sys/types.h>
215                   #include <sys/socket.h>
216 @@ -1753,7 +1758,7 @@
217                   ifd.ifd_ifd.ifi_ibytes = ifd.ifd_ifd.ifi_obytes;
218  ; return 0; }
219  EOF
220 -if { (eval echo configure:1757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
221 +if { (eval echo configure:1762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
222    rm -rf conftest*
223    with_ifdata=yes
224  else
225 @@ -1768,9 +1773,9 @@
226  fi
227  if test "x$with_ifdata" = "xcheckifr"; then
228    echo $ac_n "checking for SIOCGIFDATA and ifreq.ifr_data""... $ac_c" 1>&6
229 -echo "configure:1772: checking for SIOCGIFDATA and ifreq.ifr_data" >&5
230 +echo "configure:1777: checking for SIOCGIFDATA and ifreq.ifr_data" >&5
231    cat > conftest.$ac_ext <<EOF
232 -#line 1774 "configure"
233 +#line 1779 "configure"
234  #include "confdefs.h"
235  #include <sys/types.h>
236                   #include <sys/socket.h>
237 @@ -1789,7 +1794,7 @@
238                   ifd.ifi_ibytes = ifd.ifi_obytes;
239  ; return 0; }
240  EOF
241 -if { (eval echo configure:1793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
242 +if { (eval echo configure:1798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
243    rm -rf conftest*
244    with_ifdata=yes
245                     cat >> confdefs.h <<\EOF
246 @@ -1821,17 +1826,17 @@
247  do
248  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
249  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
250 -echo "configure:1825: checking for $ac_hdr" >&5
251 +echo "configure:1830: checking for $ac_hdr" >&5
252  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
253    echo $ac_n "(cached) $ac_c" 1>&6
254  else
255    cat > conftest.$ac_ext <<EOF
256 -#line 1830 "configure"
257 +#line 1835 "configure"
258  #include "confdefs.h"
259  #include <$ac_hdr>
260  EOF
261  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
262 -{ (eval echo configure:1835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
263 +{ (eval echo configure:1840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
264  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
265  if test -z "$ac_err"; then
266    rm -rf conftest*
267 @@ -1858,12 +1863,12 @@
268  done
269  
270    echo $ac_n "checking for sysctl""... $ac_c" 1>&6
271 -echo "configure:1862: checking for sysctl" >&5
272 +echo "configure:1867: checking for sysctl" >&5
273  if eval "test \"`echo '$''{'ac_cv_func_sysctl'+set}'`\" = set"; then
274    echo $ac_n "(cached) $ac_c" 1>&6
275  else
276    cat > conftest.$ac_ext <<EOF
277 -#line 1867 "configure"
278 +#line 1872 "configure"
279  #include "confdefs.h"
280  /* System header to define __stub macros and hopefully few prototypes,
281      which can conflict with char sysctl(); below.  */
282 @@ -1886,7 +1891,7 @@
283  
284  ; return 0; }
285  EOF
286 -if { (eval echo configure:1890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
287 +if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
288    rm -rf conftest*
289    eval "ac_cv_func_sysctl=yes"
290  else
291 @@ -1908,9 +1913,9 @@
292  
293    if test "x$with_route" = "xyes"; then
294      echo $ac_n "checking for route info sysctl""... $ac_c" 1>&6
295 -echo "configure:1912: checking for route info sysctl" >&5
296 +echo "configure:1917: checking for route info sysctl" >&5
297      cat > conftest.$ac_ext <<EOF
298 -#line 1914 "configure"
299 +#line 1919 "configure"
300  #include "confdefs.h"
301  #include <sys/types.h>
302                     #include <sys/socket.h>
303 @@ -1935,7 +1940,7 @@
304                     ifm.ifm_data.ifi_ibytes;
305  ; return 0; }
306  EOF
307 -if { (eval echo configure:1939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
308 +if { (eval echo configure:1944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
309    rm -rf conftest*
310    with_route=yes
311  else
312 @@ -1960,12 +1965,12 @@
313  test "x$with_kvm" = "xauto" -a "x$local" = "xyes" && with_kvm=no
314  if test "x$with_kvm" != "xno"; then
315    echo $ac_n "checking for kvm_openfiles""... $ac_c" 1>&6
316 -echo "configure:1964: checking for kvm_openfiles" >&5
317 +echo "configure:1969: checking for kvm_openfiles" >&5
318  if eval "test \"`echo '$''{'ac_cv_func_kvm_openfiles'+set}'`\" = set"; then
319    echo $ac_n "(cached) $ac_c" 1>&6
320  else
321    cat > conftest.$ac_ext <<EOF
322 -#line 1969 "configure"
323 +#line 1974 "configure"
324  #include "confdefs.h"
325  /* System header to define __stub macros and hopefully few prototypes,
326      which can conflict with char kvm_openfiles(); below.  */
327 @@ -1988,7 +1993,7 @@
328  
329  ; return 0; }
330  EOF
331 -if { (eval echo configure:1992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
332 +if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
333    rm -rf conftest*
334    eval "ac_cv_func_kvm_openfiles=yes"
335  else
336 @@ -2012,7 +2017,7 @@
337      case "x$LIBS" in
338       *-lkvm*) ;;
339       *) echo $ac_n "checking for kvm_openfiles in -lkvm""... $ac_c" 1>&6
340 -echo "configure:2016: checking for kvm_openfiles in -lkvm" >&5
341 +echo "configure:2021: checking for kvm_openfiles in -lkvm" >&5
342  ac_lib_var=`echo kvm'_'kvm_openfiles | sed 'y%./+-%__p_%'`
343  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
344    echo $ac_n "(cached) $ac_c" 1>&6
345 @@ -2020,7 +2025,7 @@
346    ac_save_LIBS="$LIBS"
347  LIBS="-lkvm  $LIBS"
348  cat > conftest.$ac_ext <<EOF
349 -#line 2024 "configure"
350 +#line 2029 "configure"
351  #include "confdefs.h"
352  /* Override any gcc2 internal prototype to avoid an error.  */
353  /* We use char because int might match the return type of a gcc2
354 @@ -2031,7 +2036,7 @@
355  kvm_openfiles()
356  ; return 0; }
357  EOF
358 -if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
359 +if { (eval echo configure:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
360    rm -rf conftest*
361    eval "ac_cv_lib_$ac_lib_var=yes"
362  else
363 @@ -2059,17 +2064,17 @@
364  do
365  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
366  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
367 -echo "configure:2063: checking for $ac_hdr" >&5
368 +echo "configure:2068: checking for $ac_hdr" >&5
369  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
370    echo $ac_n "(cached) $ac_c" 1>&6
371  else
372    cat > conftest.$ac_ext <<EOF
373 -#line 2068 "configure"
374 +#line 2073 "configure"
375  #include "confdefs.h"
376  #include <$ac_hdr>
377  EOF
378  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
379 -{ (eval echo configure:2073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
380 +{ (eval echo configure:2078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
381  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
382  if test -z "$ac_err"; then
383    rm -rf conftest*
384 @@ -2093,12 +2098,12 @@
385        for ac_func in knlist
386  do
387  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
388 -echo "configure:2097: checking for $ac_func" >&5
389 +echo "configure:2102: checking for $ac_func" >&5
390  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
391    echo $ac_n "(cached) $ac_c" 1>&6
392  else
393    cat > conftest.$ac_ext <<EOF
394 -#line 2102 "configure"
395 +#line 2107 "configure"
396  #include "confdefs.h"
397  /* System header to define __stub macros and hopefully few prototypes,
398      which can conflict with char $ac_func(); below.  */
399 @@ -2121,7 +2126,7 @@
400  
401  ; return 0; }
402  EOF
403 -if { (eval echo configure:2125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
404 +if { (eval echo configure:2130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
405    rm -rf conftest*
406    eval "ac_cv_func_$ac_func=yes"
407  else
408 @@ -2142,16 +2147,16 @@
409   
410          with_kvm=yes
411          echo $ac_n "checking whether knlist takes 3 arguments""... $ac_c" 1>&6
412 -echo "configure:2146: checking whether knlist takes 3 arguments" >&5
413 +echo "configure:2151: checking whether knlist takes 3 arguments" >&5
414          cat > conftest.$ac_ext <<EOF
415 -#line 2148 "configure"
416 +#line 2153 "configure"
417  #include "confdefs.h"
418  #include <nlist.h>
419  int main() {
420  knlist((struct nlist *) 0, 0, 10);
421  ; return 0; }
422  EOF
423 -if { (eval echo configure:2155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
424 +if { (eval echo configure:2160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
425    rm -rf conftest*
426    knlist3=yes
427  else
428 @@ -2172,12 +2177,12 @@
429  else
430    echo "$ac_t""no" 1>&6
431  echo $ac_n "checking for nlist""... $ac_c" 1>&6
432 -echo "configure:2176: checking for nlist" >&5
433 +echo "configure:2181: checking for nlist" >&5
434  if eval "test \"`echo '$''{'ac_cv_func_nlist'+set}'`\" = set"; then
435    echo $ac_n "(cached) $ac_c" 1>&6
436  else
437    cat > conftest.$ac_ext <<EOF
438 -#line 2181 "configure"
439 +#line 2186 "configure"
440  #include "confdefs.h"
441  /* System header to define __stub macros and hopefully few prototypes,
442      which can conflict with char nlist(); below.  */
443 @@ -2200,7 +2205,7 @@
444  
445  ; return 0; }
446  EOF
447 -if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
448 +if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
449    rm -rf conftest*
450    eval "ac_cv_func_nlist=yes"
451  else
452 @@ -2232,12 +2237,12 @@
453        for ac_func in readx
454  do
455  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
456 -echo "configure:2236: checking for $ac_func" >&5
457 +echo "configure:2241: checking for $ac_func" >&5
458  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
459    echo $ac_n "(cached) $ac_c" 1>&6
460  else
461    cat > conftest.$ac_ext <<EOF
462 -#line 2241 "configure"
463 +#line 2246 "configure"
464  #include "confdefs.h"
465  /* System header to define __stub macros and hopefully few prototypes,
466      which can conflict with char $ac_func(); below.  */
467 @@ -2260,7 +2265,7 @@
468  
469  ; return 0; }
470  EOF
471 -if { (eval echo configure:2264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
472 +if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
473    rm -rf conftest*
474    eval "ac_cv_func_$ac_func=yes"
475  else
476 @@ -2288,17 +2293,17 @@
477  do
478  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
479  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
480 -echo "configure:2292: checking for $ac_hdr" >&5
481 +echo "configure:2297: checking for $ac_hdr" >&5
482  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
483    echo $ac_n "(cached) $ac_c" 1>&6
484  else
485    cat > conftest.$ac_ext <<EOF
486 -#line 2297 "configure"
487 +#line 2302 "configure"
488  #include "confdefs.h"
489  #include <$ac_hdr>
490  EOF
491  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
492 -{ (eval echo configure:2302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
493 +{ (eval echo configure:2307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
494  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
495  if test -z "$ac_err"; then
496    rm -rf conftest*
497 @@ -2330,17 +2335,17 @@
498  do
499  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
500  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
501 -echo "configure:2334: checking for $ac_hdr" >&5
502 +echo "configure:2339: checking for $ac_hdr" >&5
503  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
504    echo $ac_n "(cached) $ac_c" 1>&6
505  else
506    cat > conftest.$ac_ext <<EOF
507 -#line 2339 "configure"
508 +#line 2344 "configure"
509  #include "confdefs.h"
510  #include <$ac_hdr>
511  EOF
512  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
513 -{ (eval echo configure:2344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
514 +{ (eval echo configure:2349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
515  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
516  if test -z "$ac_err"; then
517    rm -rf conftest*
518 @@ -2373,9 +2378,9 @@
519    fi
520    if test "x$with_kvm" = "xyes"; then
521      echo $ac_n "checking whether struct ifnet has needed interface data""... $ac_c" 1>&6
522 -echo "configure:2377: checking whether struct ifnet has needed interface data" >&5
523 +echo "configure:2382: checking whether struct ifnet has needed interface data" >&5
524      cat > conftest.$ac_ext <<EOF
525 -#line 2379 "configure"
526 +#line 2384 "configure"
527  #include "confdefs.h"
528  #include <sys/types.h>
529                      #include <sys/socket.h>
530 @@ -2388,7 +2393,7 @@
531                               in.if_type = in.if_flags
532  ; return 0; }
533  EOF
534 -if { (eval echo configure:2392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
535 +if { (eval echo configure:2397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
536    rm -rf conftest*
537    with_kvm=yes
538  else
539 @@ -2402,9 +2407,9 @@
540    fi
541    if test "x$with_kvm" = "xyes"; then
542      echo $ac_n "checking for struct ifnet if_xname member""... $ac_c" 1>&6
543 -echo "configure:2406: checking for struct ifnet if_xname member" >&5
544 +echo "configure:2411: checking for struct ifnet if_xname member" >&5
545      cat > conftest.$ac_ext <<EOF
546 -#line 2408 "configure"
547 +#line 2413 "configure"
548  #include "confdefs.h"
549  #include <sys/types.h>
550                      #include <sys/socket.h>
551 @@ -2416,7 +2421,7 @@
552  struct ifnet in; in.if_xname[0] = 'a';
553  ; return 0; }
554  EOF
555 -if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
556 +if { (eval echo configure:2425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
557    rm -rf conftest*
558    ifxname=yes
559  else
560 @@ -2433,9 +2438,9 @@
561      echo "$ac_t""$ifxname" 1>&6
562  
563      echo $ac_n "checking for struct ifnet if_next member""... $ac_c" 1>&6
564 -echo "configure:2437: checking for struct ifnet if_next member" >&5
565 +echo "configure:2442: checking for struct ifnet if_next member" >&5
566      cat > conftest.$ac_ext <<EOF
567 -#line 2439 "configure"
568 +#line 2444 "configure"
569  #include "confdefs.h"
570  #include <sys/types.h>
571                      #include <sys/socket.h>
572 @@ -2447,7 +2452,7 @@
573  struct ifnet in; in.if_next;
574  ; return 0; }
575  EOF
576 -if { (eval echo configure:2451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
577 +if { (eval echo configure:2456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
578    rm -rf conftest*
579    ifnext=yes
580  else
581 @@ -2465,9 +2470,9 @@
582  
583      else 
584        echo $ac_n "checking for struct ifnet if_link member""... $ac_c" 1>&6
585 -echo "configure:2469: checking for struct ifnet if_link member" >&5
586 +echo "configure:2474: checking for struct ifnet if_link member" >&5
587        cat > conftest.$ac_ext <<EOF
588 -#line 2471 "configure"
589 +#line 2476 "configure"
590  #include "confdefs.h"
591  #include <sys/types.h>
592                        #include <sys/socket.h>
593 @@ -2479,7 +2484,7 @@
594  struct ifnet in; in.if_link;
595  ; return 0; }
596  EOF
597 -if { (eval echo configure:2483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
598 +if { (eval echo configure:2488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
599    rm -rf conftest*
600    iflink=yes
601  else
602 @@ -2512,17 +2517,17 @@
603  do
604  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
605  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
606 -echo "configure:2516: checking for $ac_hdr" >&5
607 +echo "configure:2521: checking for $ac_hdr" >&5
608  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
609    echo $ac_n "(cached) $ac_c" 1>&6
610  else
611    cat > conftest.$ac_ext <<EOF
612 -#line 2521 "configure"
613 +#line 2526 "configure"
614  #include "confdefs.h"
615  #include <$ac_hdr>
616  EOF
617  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
618 -{ (eval echo configure:2526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
619 +{ (eval echo configure:2531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
620  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
621  if test -z "$ac_err"; then
622    rm -rf conftest*
623 @@ -2549,9 +2554,9 @@
624  done
625  
626    echo $ac_n "checking for dlpi streams interface""... $ac_c" 1>&6
627 -echo "configure:2553: checking for dlpi streams interface" >&5
628 +echo "configure:2558: checking for dlpi streams interface" >&5
629    cat > conftest.$ac_ext <<EOF
630 -#line 2555 "configure"
631 +#line 2560 "configure"
632  #include "confdefs.h"
633  #ifdef HAVE_UNISTD_H
634                   #include <unistd.h>
635 @@ -2573,7 +2578,7 @@
636                    struct strbuf ctlptr; putmsg(0, &ctlptr, NULL, 0);
637  ; return 0; }
638  EOF
639 -if { (eval echo configure:2577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
640 +if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
641    rm -rf conftest*
642    with_dlpi=yes
643  else
644 @@ -2596,11 +2601,11 @@
645  test "x$with_win32" = "xauto" -a "x$local" = "xyes" && with_win32=no
646  if test "x$with_win32" != "xno"; then
647    echo $ac_n "checking for win32 GetIfTable interface""... $ac_c" 1>&6
648 -echo "configure:2600: checking for win32 GetIfTable interface" >&5
649 +echo "configure:2605: checking for win32 GetIfTable interface" >&5
650    OLIBS="$LIBS"
651    LIBS="$LIBS -liphlpapi"
652    cat > conftest.$ac_ext <<EOF
653 -#line 2604 "configure"
654 +#line 2609 "configure"
655  #include "confdefs.h"
656  #include <windows.h>
657                 #include <iphlpapi.h>
658 @@ -2608,7 +2613,7 @@
659  GetIfTable(NULL, NULL, 0);
660  ; return 0; }
661  EOF
662 -if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
663 +if { (eval echo configure:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
664    rm -rf conftest*
665    with_win32=yes
666  else
667 @@ -2636,12 +2641,12 @@
668  EOF
669  
670    echo $ac_n "checking for socket""... $ac_c" 1>&6
671 -echo "configure:2640: checking for socket" >&5
672 +echo "configure:2645: checking for socket" >&5
673  if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
674    echo $ac_n "(cached) $ac_c" 1>&6
675  else
676    cat > conftest.$ac_ext <<EOF
677 -#line 2645 "configure"
678 +#line 2650 "configure"
679  #include "confdefs.h"
680  /* System header to define __stub macros and hopefully few prototypes,
681      which can conflict with char socket(); below.  */
682 @@ -2664,7 +2669,7 @@
683  
684  ; return 0; }
685  EOF
686 -if { (eval echo configure:2668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
687 +if { (eval echo configure:2673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
688    rm -rf conftest*
689    eval "ac_cv_func_socket=yes"
690  else
691 @@ -2688,7 +2693,7 @@
692      case "x$LIBS" in
693        *-lsocket*);;
694        *) echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
695 -echo "configure:2692: checking for socket in -lsocket" >&5
696 +echo "configure:2697: checking for socket in -lsocket" >&5
697  ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
698  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
699    echo $ac_n "(cached) $ac_c" 1>&6
700 @@ -2696,7 +2701,7 @@
701    ac_save_LIBS="$LIBS"
702  LIBS="-lsocket  $LIBS"
703  cat > conftest.$ac_ext <<EOF
704 -#line 2700 "configure"
705 +#line 2705 "configure"
706  #include "confdefs.h"
707  /* Override any gcc2 internal prototype to avoid an error.  */
708  /* We use char because int might match the return type of a gcc2
709 @@ -2707,7 +2712,7 @@
710  socket()
711  ; return 0; }
712  EOF
713 -if { (eval echo configure:2711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
714 +if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
715    rm -rf conftest*
716    eval "ac_cv_lib_$ac_lib_var=yes"
717  else
718 @@ -2737,12 +2742,12 @@
719      esac
720    fi
721    echo $ac_n "checking for if_nameindex""... $ac_c" 1>&6
722 -echo "configure:2741: checking for if_nameindex" >&5
723 +echo "configure:2746: checking for if_nameindex" >&5
724  if eval "test \"`echo '$''{'ac_cv_func_if_nameindex'+set}'`\" = set"; then
725    echo $ac_n "(cached) $ac_c" 1>&6
726  else
727    cat > conftest.$ac_ext <<EOF
728 -#line 2746 "configure"
729 +#line 2751 "configure"
730  #include "confdefs.h"
731  /* System header to define __stub macros and hopefully few prototypes,
732      which can conflict with char if_nameindex(); below.  */
733 @@ -2765,7 +2770,7 @@
734  
735  ; return 0; }
736  EOF
737 -if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
738 +if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
739    rm -rf conftest*
740    eval "ac_cv_func_if_nameindex=yes"
741  else
742 @@ -2789,7 +2794,7 @@
743      case "x$LIBS" in
744        *-lnsl*);;
745        *) echo $ac_n "checking for if_nameindex in -lnsl""... $ac_c" 1>&6
746 -echo "configure:2793: checking for if_nameindex in -lnsl" >&5
747 +echo "configure:2798: checking for if_nameindex in -lnsl" >&5
748  ac_lib_var=`echo nsl'_'if_nameindex | sed 'y%./+-%__p_%'`
749  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
750    echo $ac_n "(cached) $ac_c" 1>&6
751 @@ -2797,7 +2802,7 @@
752    ac_save_LIBS="$LIBS"
753  LIBS="-lnsl  $LIBS"
754  cat > conftest.$ac_ext <<EOF
755 -#line 2801 "configure"
756 +#line 2806 "configure"
757  #include "confdefs.h"
758  /* Override any gcc2 internal prototype to avoid an error.  */
759  /* We use char because int might match the return type of a gcc2
760 @@ -2808,7 +2813,7 @@
761  if_nameindex()
762  ; return 0; }
763  EOF
764 -if { (eval echo configure:2812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
765 +if { (eval echo configure:2817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
766    rm -rf conftest*
767    eval "ac_cv_lib_$ac_lib_var=yes"
768  else
769 @@ -2832,9 +2837,9 @@
770    fi
771    if test "x$ifnameindex" != "xyes"; then
772      echo $ac_n "checking for sockaddr sa_len member""... $ac_c" 1>&6
773 -echo "configure:2836: checking for sockaddr sa_len member" >&5
774 +echo "configure:2841: checking for sockaddr sa_len member" >&5
775      cat > conftest.$ac_ext <<EOF
776 -#line 2838 "configure"
777 +#line 2843 "configure"
778  #include "confdefs.h"
779  
780      #include <sys/types.h>
781 @@ -2843,7 +2848,7 @@
782  struct sockaddr sa; sa.sa_len = 1;
783  ; return 0; }
784  EOF
785 -if { (eval echo configure:2847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
786 +if { (eval echo configure:2852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
787    rm -rf conftest*
788    salen=yes
789  else
790 @@ -2875,7 +2880,7 @@
791    # Extract the first word of "net-snmp-config", so it can be a program name with args.
792  set dummy net-snmp-config; ac_word=$2
793  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
794 -echo "configure:2879: checking for $ac_word" >&5
795 +echo "configure:2884: checking for $ac_word" >&5
796  if eval "test \"`echo '$''{'ac_cv_path_netsnmpconfig'+set}'`\" = set"; then
797    echo $ac_n "(cached) $ac_c" 1>&6
798  else
799 @@ -2912,16 +2917,16 @@
800      CPPFLAGS="$CPPFLAGS `$netsnmpconfig --base-cflags 2>/dev/null`"
801      LDFLAGS="$LDFLAGS `$netsnmpconfig --libs 2>/dev/null`"
802      echo $ac_n "checking whether net-snmp-config hints compiles and links fine""... $ac_c" 1>&6
803 -echo "configure:2916: checking whether net-snmp-config hints compiles and links fine" >&5
804 +echo "configure:2921: checking whether net-snmp-config hints compiles and links fine" >&5
805      cat > conftest.$ac_ext <<EOF
806 -#line 2918 "configure"
807 +#line 2923 "configure"
808  #include "confdefs.h"
809  #include<net-snmp/net-snmp-config.h>
810  int main() {
811  snmp_sess_init((void *) 0);
812  ; return 0; }
813  EOF
814 -if { (eval echo configure:2925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
815 +if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
816    rm -rf conftest*
817    snmp_ok=yes
818  else
819 @@ -2948,17 +2953,17 @@
820      fi
821      ac_safe=`echo "net-snmp/net-snmp-config.h" | sed 'y%./+-%__p_%'`
822  echo $ac_n "checking for net-snmp/net-snmp-config.h""... $ac_c" 1>&6
823 -echo "configure:2952: checking for net-snmp/net-snmp-config.h" >&5
824 +echo "configure:2957: checking for net-snmp/net-snmp-config.h" >&5
825  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
826    echo $ac_n "(cached) $ac_c" 1>&6
827  else
828    cat > conftest.$ac_ext <<EOF
829 -#line 2957 "configure"
830 +#line 2962 "configure"
831  #include "confdefs.h"
832  #include <net-snmp/net-snmp-config.h>
833  EOF
834  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
835 -{ (eval echo configure:2962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
836 +{ (eval echo configure:2967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
837  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
838  if test -z "$ac_err"; then
839    rm -rf conftest*
840 @@ -2979,17 +2984,17 @@
841    echo "$ac_t""no" 1>&6
842  ac_safe=`echo "ucd-snmp/ucd-snmp-config.h" | sed 'y%./+-%__p_%'`
843  echo $ac_n "checking for ucd-snmp/ucd-snmp-config.h""... $ac_c" 1>&6
844 -echo "configure:2983: checking for ucd-snmp/ucd-snmp-config.h" >&5
845 +echo "configure:2988: checking for ucd-snmp/ucd-snmp-config.h" >&5
846  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
847    echo $ac_n "(cached) $ac_c" 1>&6
848  else
849    cat > conftest.$ac_ext <<EOF
850 -#line 2988 "configure"
851 +#line 2993 "configure"
852  #include "confdefs.h"
853  #include <ucd-snmp/ucd-snmp-config.h>
854  EOF
855  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
856 -{ (eval echo configure:2993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
857 +{ (eval echo configure:2998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
858  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
859  if test -z "$ac_err"; then
860    rm -rf conftest*
861 @@ -3040,18 +3045,18 @@
862        for lib in $SNMPLIBALONE "$libsnmp -lcrypto" ; do
863          if test "x$with_snmp" != "xyes" ; then
864            echo $ac_n "checking for snmp support in $lib""... $ac_c" 1>&6
865 -echo "configure:3044: checking for snmp support in $lib" >&5
866 +echo "configure:3049: checking for snmp support in $lib" >&5
867            OLIBS="$LIBS"
868            LIBS="$LIBS $lib"
869            cat > conftest.$ac_ext <<EOF
870 -#line 3048 "configure"
871 +#line 3053 "configure"
872  #include "confdefs.h"
873  
874  int main() {
875  snmp_sess_init();
876  ; return 0; }
877  EOF
878 -if { (eval echo configure:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
879 +if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
880    rm -rf conftest*
881    with_snmp=yes
882  else
883 diff -ruN ifstat-1.1-old/configure.in ifstat-1.1-new/configure.in
884 --- ifstat-1.1-old/configure.in 2003-11-22 02:27:51.000000000 +0100
885 +++ ifstat-1.1-new/configure.in 2007-09-06 12:20:21.000000000 +0200
886 @@ -59,17 +59,22 @@
887       *) file=/proc/net/dev ;;
888    esac
889    AC_MSG_CHECKING([for proc interface in $file])
890 -  if grep -q Inter- $file 2>/dev/null; then
891 -    AC_DEFINE([USE_PROC], 1, [Define if you want to use /proc to get stats])
892 -    AC_DEFINE_UNQUOTED([PROC_FILE], ["$file"], [Proc file to poll for stats])
893 +  if test "$cross_compiling" = yes; then
894 +    with_proc=cross
895 +  elif grep -q Inter- $file 2>/dev/null; then
896      with_proc=yes
897 -    with_ioctl=yes
898 -    local=yes
899    else
900      with_proc=no
901    fi
902    AC_MSG_RESULT([$with_proc])
903  fi
904 +if test "x$with_proc" != "xno"; then
905 +  AC_DEFINE([USE_PROC], 1, [Define if you want to use /proc to get stats])
906 +  AC_DEFINE_UNQUOTED([PROC_FILE], ["$file"], [Proc file to poll for stats])
907 +  with_proc=yes
908 +  with_ioctl=yes
909 +  local=yes
910 +fi
911  
912  # checking for kstat (Solaris)
913  test "x$with_kstat" = "xauto" -a "x$local" = "xyes" && with_kstat=no