]>
Commit | Line | Data |
---|---|---|
5431ee70 ER |
1 | --- net-snmp-5.4.1/agent/mibgroup/host/hr_swinst.c 2008-05-15 13:05:07.575307614 +0300 |
2 | +++ net-snmp-5.4.1.hrmib/agent/mibgroup/host/hr_swinst.c 2008-05-15 13:04:24.676830108 +0300 | |
3 | @@ -183,6 +183,10 @@ | |
5131293d ER |
4 | #define _PATH_HRSW_directory "/var/db/pkg" |
5 | #endif | |
6 | ||
5431ee70 ER |
7 | +#if defined(RPM_HRMIB_PATH) |
8 | +#define _PATH_HRSW_directory RPM_HRMIB_PATH | |
9 | +#endif | |
5131293d ER |
10 | + |
11 | void | |
12 | init_hr_swinst(void) | |
13 | { | |
afbe2a1a JB |
14 | --- net-snmp-5.6/configure.d/config_os_libs.orig 2010-10-24 10:37:25.527741043 +0200 |
15 | +++ net-snmp-5.6/configure.d/config_os_libs 2010-10-24 10:40:56.519744396 +0200 | |
16 | @@ -425,20 +425,34 @@ | |
849c236b AM |
17 | # RPM checks |
18 | # | |
19 | ## | |
5431ee70 | 20 | -AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) |
849c236b | 21 | - |
5431ee70 ER |
22 | -AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no) |
23 | -AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no) | |
24 | - | |
25 | -if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then | |
26 | - if test "x$with_rpm" = "xyes" ; then | |
27 | - AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support]) | |
28 | - else | |
29 | - with_rpm=no | |
30 | - fi | |
afbe2a1a JB |
31 | +# |
32 | +# check if we can use rpm hrmib export | |
33 | +if test "$with_rpm" != "no" ; then | |
34 | + AC_PATH_PROG([RPM], rpm) | |
35 | + if test -n "$RPM"; then | |
36 | + changequote(, ) | |
37 | + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,') | |
38 | + changequote([, ]) | |
39 | + if test -n "$RPM_HRMIB_PATH"; then | |
40 | + AC_DEFINE_UNQUOTED([RPM_HRMIB_PATH], ["$RPM_HRMIB_PATH"], [Directory where RPM exports packages hrmib information]) | |
41 | + fi | |
42 | + fi | |
43 | fi | |
44 | +# otherwise try binary linkin | |
45 | +if test -z "$RPM_HRMIB_PATH"; then | |
46 | + AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) | |
849c236b | 47 | + |
afbe2a1a JB |
48 | + AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no) |
49 | + AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no) | |
50 | + | |
51 | + if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then | |
52 | + if test "x$with_rpm" = "xyes" ; then | |
53 | + AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support]) | |
54 | + else | |
55 | + with_rpm=no | |
56 | + fi | |
57 | + fi | |
58 | ||
59 | -# | |
5431ee70 ER |
60 | # rpm libraries only needed for the host resources mib software |
61 | # installed tables (on linux in particular) | |
62 | # | |
afbe2a1a JB |
63 | @@ -490,6 +504,12 @@ |
64 | AC_DEFINE([_RPM_4_4_COMPAT], [], [Define if you have RPM 4.6 or newer to turn on legacy API]), | |
65 | [[#include <rpm/rpmlib.h>]] | |
66 | ) | |
849c236b | 67 | + |
afbe2a1a JB |
68 | + OLDLIBS=$LIBS |
69 | + LIBS=$LMIBLIBS | |
70 | + AC_CHECK_FUNCS([rpmGetPath]) | |
71 | + LIBS=$OLDLIBS | |
849c236b | 72 | + fi |
afbe2a1a | 73 | fi |
5431ee70 | 74 | |
849c236b | 75 | ## |
849c236b AM |
76 | --- net-snmp-5.5/configure.d/config_os_functions~ 2009-07-26 20:20:55.000000000 +0200 |
77 | +++ net-snmp-5.5/configure.d/config_os_functions 2010-05-12 14:35:39.421276242 +0200 | |
78 | @@ -67,15 +67,6 @@ | |
79 | # (Agent) | |
80 | ## | |
81 | ||
82 | -# rpmGetPath check needs clean LIBS environment (Linux) | |
83 | -# | |
5431ee70 | 84 | -if test "x$with_rpm" != "xno" && \ |
849c236b AM |
85 | - echo " $module_list " | $GREP " host/hr_swinst " > /dev/null; then |
86 | - OLDLIBS=$LIBS | |
87 | - LIBS=$LMIBLIBS | |
88 | - AC_CHECK_FUNCS(rpmGetPath) | |
89 | - LIBS=$OLDLIBS | |
5431ee70 ER |
90 | -fi |
91 | ||
849c236b AM |
92 | # statfs( char *, struct fs_data* ) (Ultrix) |
93 | # | |
94 |