Mike Patterson
2006-May-19 16:18 UTC
[Nut-upsdev] minor building issues (svn HEAD revision 427)
While attempting to package up the HEAD version of nut for our
department/campus, I've run into a couple of minor issues with the
latest HEAD - I'm going to give it another whack at a PW9170+ UPS and
want to make sure I have the latest revision. :)
First is, whilst building the drivers (SNMP required), I get:
gmake[1]: Entering directory `/fsys2/source/nut-2.1/nut-2.1_cvs/drivers'
gmake[1]: *** No rule to make target `net-snmp/net-snmp-config.h',
needed by `snmp-ups.o'. Stop.
gmake[1]: Leaving directory `/fsys2/source/nut-2.1/nut-2.1_cvs/drivers'
gmake: *** [build] Error 1
Doing a "gmake depend" in the drivers subdirectory fixes things up,
but
leads to the next problem (which I've had for a while). Output:
gcc -I../include -O -Wall -Wsign-compare -g -Dsolaris2
-I/software/openssl-0.9.7_runtime/include -I.
-I/software/netsnmp-5.3/include -o snmp-ups snmp-ups.o main.o dstate.o \
../common/state.o ../common/upsconf.o ../common/parseconf.o \
../common/common.o ../common/setenv.o ../common/inet_aton.o
-lnsl -lsocket -L/software/openssl-0.9.7_runtime/lib
-R/software/openssl-0.9.7_runtime/lib:/software/libz-1.1.4_runtime/lib
-L/software/netsnmp-5.3/lib -lnetsnmp -lgen -lcrypto -lkstat -lelf -lm
-lnsl -lsocket -ladm
ld: fatal: symbol `setenv' is multiply-defined:
(file ../common/setenv.o type=FUNC; file
/software/netsnmp-5.3/lib/libnetsnmp.a(system.o) type=FUNC);
ld: fatal: File processing errors. No output written to snmp-ups
I can fix this by changing the setenv() definition in common/setenv.c to
nut_setenv, and changing the calls to setenv() in client/upsmon.c
appropriately. I'm wondering if this is a known issue, or if perhaps
it's a problem related to our environment (which is weird and wonderful
and largely unknown to me)? Should I submit a patch?
thanks,
Mike
--
...very few phenomena can pull someone out of Deep Hack Mode, with two
noted exceptions: being struck by lightning, or worse, your *computer*
being struck by lightning. - Matt Welsh
Charles Lepple
2006-May-19 16:27 UTC
[Nut-upsdev] minor building issues (svn HEAD revision 427)
On 5/19/06, Mike Patterson <mpatters@cs.uwaterloo.ca> wrote:> ld: fatal: symbol `setenv' is multiply-defined: > (file ../common/setenv.o type=FUNC; file > /software/netsnmp-5.3/lib/libnetsnmp.a(system.o) type=FUNC); > ld: fatal: File processing errors. No output written to snmp-upsCan you check and see if your version of netsnmp documents their setenv call?> I can fix this by changing the setenv() definition in common/setenv.c to > nut_setenv, and changing the calls to setenv() in client/upsmon.c > appropriately. I'm wondering if this is a known issue, or if perhaps > it's a problem related to our environment (which is weird and wonderful > and largely unknown to me)? Should I submit a patch?Probably just that people aren't testing with both Solaris (where setenv is evidently not part of the C library) and netsnmp. Depending on whether the netsnmp setenv is the same or not, we might be able to just make a quick adjustment to the configure script. If it is the same, then we just won't use common/setenv.o when netsnmp is present. -- - Charles Lepple
Charles Lepple
2006-May-20 15:15 UTC
[Nut-upsdev] minor building issues (svn HEAD revision 427)
Mike, what parameters did you pass to ./configure? thanks, -- - Charles Lepple
Mike Patterson
2006-May-20 15:19 UTC
[Nut-upsdev] minor building issues (svn HEAD revision 427)
Charles Lepple wrote on 20/05/2006 11:14 AM:> what parameters did you pass to ./configure?Pardon the imakefile syntax (told you our environment was weird and wonderful): PACKAGEDIR = /software/${PACKAGE} PREFIX = ${PACKAGEDIR} DESTOPTIONS = --prefix=${PACKAGEDIR} \ --exec-prefix=${PREFIX} \ --datadir=${PACKAGEDIR}/data \ --localstatedir=${PACKAGEDIR}/data \ --libdir=${PACKAGEDIR}/lib \ --mandir=${PACKAGEDIR}/man \ --sysconfdir=${PACKAGEDIR}/config/local \ --includedir=${PACKAGEDIR}/include/${BASENAME} \ --bindir=${PACKAGEDIR}/bin \ --sbindir=${PACKAGEDIR}/servers \ --with-log-facility CONFIGUREOPTIONS = --enable-shared \ --with-user=root \ --with-statepath=${PACKAGEDIR}/data/local/ups \ --with-pidpath=${PACKAGEDIR}/data/local/run \ --with-drvpath=${PACKAGEDIR}/maintenance \ --with-cgipath=${PACKAGEDIR}/cgi-bin \ --with-drivers=snmp-ups (where PACKAGE is previously defined as nut-2.1). Then the actual configure is "./configure ${CONFIGUREOPTIONS} ${DESTOPTIONS}". Mike