Charles Lepple
2010-Feb-13 01:44 UTC
[Nut-upsdev] building on Solaris 10 (was Re: 2.4.2 freeze)
On Fri, Feb 12, 2010 at 5:35 PM, Tim Rice <tim at multitalents.net> wrote:> Attached as cofig.log.gz and compile.log.gzI saw a few warnings:> "/opt/src/utils/nut-2.4.1-r2339/drivers/apcsmart.c", line 34: warning: too many struct/union initializers > "/opt/src/utils/nut-2.4.1-r2339/drivers/apcsmart.c", line 44: warning: too many struct/union initializers > "/opt/src/utils/nut-2.4.1-r2339/drivers/bcmxcp.c", line 135: warning: too many struct/union initializers > "/opt/src/utils/nut-2.4.1-r2339/drivers/bcmxcp_ser.c", line 17: warning: too many struct/union initializers > "/opt/src/utils/nut-2.4.1-r2339/drivers/belkin.c", line 39: warning: too many struct/union initializers[...] Hopefully the preceding lines compiled properly - we use those structures all over the place.> "/opt/src/utils/nut-2.4.1-r2339/drivers/apcsmart.c", line 127: warning: statement not reachedIs there a way to flag a statement as "not reached" with the Sun C compiler? We have a comment to that effect in the code there.> Some Solaris 10 build notes: > The Solaris 10 (U8) SUNWsmcmd package is broken so > /usr/sfw/bin/net-snmp-config is symlinked to net-snmp-config-64 > instead of net-snmp-config-32. So configure will find the SNMP bits > but the build will fail.I am not familiar with Solaris' 32/64 bit support. Is there some other place in the code that we are specifying 32-bit code? Should we check some system variable and look for net-snmp-config-32 before net-snmp-config?> If the symlink gets fixed there is still > the issue of net-snmp-config spitting out "-R../lib" that the linker > doesn't like. This post configure perl script does the trick. > perl -pi -e "s|-R../lib |-R/usr/sfw/lib |g;" \ > ? ?`find . -name Makefile -print`I suspect that we would want to handle this earlier in the configuration process, probably around when those options are retrieved. Is there a chance that someone would see "-R../lib" with the absolute path ending up as something other than /usr/sfw/lib? (I am trying to find out how reasonable it would be to hardcode that fix.) -- - Charles Lepple
Arjen de Korte
2010-Feb-13 12:39 UTC
[Nut-upsdev] building on Solaris 10 (was Re: 2.4.2 freeze)
Citeren Charles Lepple <clepple op gmail.com>:>> "/opt/src/utils/nut-2.4.1-r2339/drivers/apcsmart.c", line 127: >> warning: statement not reached > Is there a way to flag a statement as "not reached" with the Sun C > compiler? We have a comment to that effect in the code there.We could also remove that line of code, or move the code from the preceding default to outside the switch cases. I have to agree with the compiler here, that this code is unreachable and might just as well be removed.>> Some Solaris 10 build notes: >> The Solaris 10 (U8) SUNWsmcmd package is broken so >> /usr/sfw/bin/net-snmp-config is symlinked to net-snmp-config-64 >> instead of net-snmp-config-32. So configure will find the SNMP bits >> but the build will fail.In that case, this is either a problem with installing the wrong Net-SNMP version or the SUNWsmcmd package is badly broken. Rather than attempting to fix this, this should be fixed upstream. [...]>> If the symlink gets fixed there is still >> the issue of net-snmp-config spitting out "-R../lib" that the linker >> doesn't like. This post configure perl script does the trick. >> perl -pi -e "s|-R../lib |-R/usr/sfw/lib |g;" \ >> ? ?`find . -name Makefile -print` > I suspect that we would want to handle this earlier in the > configuration process, probably around when those options are > retrieved.Yes. But this is also something that should be fixed upstream. Knowing this, I think it makes sense to check for the usability of the Net-SNMP library during configuration not by just checking if the header files are installed, but also by checking if we can link a test program. At least the remaining stuff will then build properly. Best regards, Arjen -- Please keep list traffic on the list
On Fri, 12 Feb 2010, Charles Lepple wrote:> On Fri, Feb 12, 2010 at 5:35 PM, Tim Rice <tim at multitalents.net> wrote: > > Attached as cofig.log.gz and compile.log.gz > > I saw a few warnings: > > > "/opt/src/utils/nut-2.4.1-r2339/drivers/apcsmart.c", line 34: warning: too many struct/union initializers[...]> > Hopefully the preceding lines compiled properly - we use those > structures all over the place.It does compile. -- Tim Rice Multitalents (707) 887-1469 tim at multitalents.net