Bug 442881 - Add Super-H(sh3,sh4) to supported archs in net-snmp-config
Summary: Add Super-H(sh3,sh4) to supported archs in net-snmp-config
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp
Version: rawhide
Hardware: sh4
OS: Linux
Target Milestone: ---
Assignee: Jan Safranek
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-04-17 11:49 UTC by CHIKAMA Masaki
Modified: 2008-05-17 14:47 UTC (History)
0 users

Clone Of:
Last Closed: 2008-04-24 13:57:53 UTC

Attachments (Terms of Use)

Description CHIKAMA Masaki 2008-04-17 11:49:18 UTC
Description of problem:

 Add suport sh3,sh4 archs in net-snmp-config and net-snmp-config.h .
Also include diff against net-snmp.spec file. Without this patch,
the package that needs net-snmp-devel,such as 'nut', fails to compile.
Please apply.


--- net-snmp-config.h.org       2008-04-16 20:32:26.000000000 +0900
+++ net-snmp-config.h   2008-04-16 20:21:55.000000000 +0900
@@ -25,6 +25,8 @@
 #include "net-snmp-config-x86_64.h"
 #elif defined(__alpha__)
 #include "net-snmp-config-alpha.h"
+#elif defined(__sh__)
+#include "net-snmp-config-sh.h"
 #error "net-snmp-devel package does not work on your architecture"
--- net-snmp-config.org 2008-04-16 20:32:20.000000000 +0900
+++ net-snmp-config     2008-04-16 20:21:42.000000000 +0900
@@ -47,5 +47,13 @@
     net-snmp-config-alpha $*
     exit 0
+if [ "$arch" = "sh3" ] ; then
+    net-snmp-config-sh $*
+    exit 0
+if [ "$arch" = "sh4" ] ; then
+    net-snmp-config-sh $*
+    exit 0
 echo "Cannot determine architecture"
--- net-snmp.spec.org   2008-04-16 20:16:22.000000000 +0900
+++ net-snmp.spec       2008-04-16 20:24:57.000000000 +0900
@@ -211,6 +211,9 @@
 %ifarch %{ix86}
+%ifarch sh3 sh4
 mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
 install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config

Comment 1 Jan Safranek 2008-04-23 13:30:09 UTC
From time to time I get request to add new platform and I am pretty confused
what these changes do... I understand that on multilib architectures it's
necessary to distinguish these two archs. But is your sh3 and sh4 multilib? I
doubt so.

IMHO it's time to rework the multilib stuff to apply only on multilib arches and
let the usual architectures, like your sh3, work without any changes in .spec -
because in few months will somebody else come and want me to add another special
architecture for his/her fridge or whatever.

Could you please test .src.rpm at http://people.redhat.com/jsafrane/bugs/442881/
? It should create -devel package with default net-snmp-config and
net-snmp-config.h if it gets compiled on unknown architecture and create the
special one only on multilib arch.

I'll put it into rawhide if it works. Thanks

Comment 2 CHIKAMA Masaki 2008-04-23 14:04:04 UTC
>But is your sh3 and sh4 multilib? I doubt so.
No. It's a separate arch. 
It can be multilib, but it's verly rare case.

I'll try your new package, but super-H is embeded arch and it's very slow.
So please don't wait my result when you go ahead.


Comment 3 Jan Safranek 2008-04-23 14:09:03 UTC
I think there is no rush, I'll rather wait for your results and release good
solution than fix bad one later.

Comment 4 CHIKAMA Masaki 2008-04-24 12:54:07 UTC
I backported the changes of multilib's part from net-snmp-5.4.1-15 to
net-snmp-5.4.1-4 (Fedora8's release version) and confirmed that
net-snmp-devel package can compile 'nut' package. 
(I'm in the middle of mass build of dist-f8 packages using mock and koji,
so I thought backporting is faster way to check your change.)

Thank you.

@@ -234,13 +232,13 @@
-mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
-install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
 %ifarch %{multilib_arches}
 # Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
 # can have both a 32- and 64-bit version of the library, and they each need
 # their own correct-but-different versions of net-snmp-config.h to be usable.
+mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
+install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
 mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h
 install -m644 %SOURCE6 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h

Comment 5 Jan Safranek 2008-04-24 13:57:53 UTC
Thanks for feedback!

Note You need to log in before you can comment on or make changes to this bug.