Bug 442881 - Add Super-H(sh3,sh4) to supported archs in net-snmp-config
Add Super-H(sh3,sh4) to supported archs in net-snmp-config
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: net-snmp (Show other bugs)
rawhide
sh4 Linux
low Severity low
: ---
: ---
Assigned To: Jan Safranek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-17 07:49 EDT by CHIKAMA Masaki
Modified: 2008-05-17 10:47 EDT (History)
0 users

See Also:
Fixed In Version: net-snmp-5_4_1-15_fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-24 09:57:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description CHIKAMA Masaki 2008-04-17 07:49:18 EDT
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.

 Thanks.


--- 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"
 #else
 #error "net-snmp-devel package does not work on your architecture"
 #endif
--- 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
 fi
+if [ "$arch" = "sh3" ] ; then
+    net-snmp-config-sh $*
+    exit 0
+fi
+if [ "$arch" = "sh4" ] ; then
+    net-snmp-config-sh $*
+    exit 0
+fi
 
 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}
 basearch=i386
 %endif
+%ifarch sh3 sh4
+basearch=sh
+%endif
 
 mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
 install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
Comment 1 Jan Safranek 2008-04-23 09:30:09 EDT
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 10:04:04 EDT
>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.

Thanks.
Comment 3 Jan Safranek 2008-04-23 10:09:03 EDT
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 08:54:07 EDT
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 @@
 basearch=i386
 %endif
 
-mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
-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
${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
+install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
 mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h
${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config-${basearch}.h
 install -m644 %SOURCE6 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h
 %endif
Comment 5 Jan Safranek 2008-04-24 09:57:53 EDT
Thanks for feedback!

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