LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Cannot build apcups on slack64-current (http://www.linuxquestions.org/questions/slackware-14/cannot-build-apcups-on-slack64-current-775065/)

tux_dude 12-11-2009 07:55 PM

Cannot build apcups on slack64-current
 
Using the current slackbuild for 3.14.7 and unable to compile apcups with snmp enabled. Getting the error
Code:

In file included from drv_powernet.c:27:
snmp.h:82: error: expected unqualified-id before numeric constant
snmp.h:82: error: expected ';' before numeric constant
drv_powernet.c: In function 'int powernet_check_comm_lost(UPSINFO*)':
drv_powernet.c:37: error: expected primary-expression before '*' token
drv_powernet.c:37: error: expected primary-expression before ')' token
drv_powernet.c:37: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_static_data(UPSINFO*)':
drv_powernet.c:164: error: expected primary-expression before '*' token
drv_powernet.c:164: error: expected primary-expression before ')' token
drv_powernet.c:164: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_volatile_data(UPSINFO*)':
drv_powernet.c:303: error: expected primary-expression before '*' token
drv_powernet.c:303: error: expected primary-expression before ')' token
drv_powernet.c:303: error: expected ',' or ';' before 'Sid'
make[4]: *** [.obj/drv_powernet.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [snmp_DIR] Error 2
make[1]: *** [drivers_DIR] Error 2
make: *** [src_DIR] Error 2

It compiles fine without snmp. I have net-snmp installed on slack64. The build also works fine on slack32-current with snmp. Anyone have luck with apcups on slack64?

GooseYArd 12-11-2009 09:22 PM

Quote:

Originally Posted by tux_dude (Post 3788433)
Using the current slackbuild for 3.14.7 and unable to compile apcups with snmp enabled. Getting the error
Code:

In file included from drv_powernet.c:27:
snmp.h:82: error: expected unqualified-id before numeric constant
snmp.h:82: error: expected ';' before numeric constant
drv_powernet.c: In function 'int powernet_check_comm_lost(UPSINFO*)':
drv_powernet.c:37: error: expected primary-expression before '*' token
drv_powernet.c:37: error: expected primary-expression before ')' token
drv_powernet.c:37: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_static_data(UPSINFO*)':
drv_powernet.c:164: error: expected primary-expression before '*' token
drv_powernet.c:164: error: expected primary-expression before ')' token
drv_powernet.c:164: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_volatile_data(UPSINFO*)':
drv_powernet.c:303: error: expected primary-expression before '*' token
drv_powernet.c:303: error: expected primary-expression before ')' token
drv_powernet.c:303: error: expected ',' or ';' before 'Sid'
make[4]: *** [.obj/drv_powernet.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [snmp_DIR] Error 2
make[1]: *** [drivers_DIR] Error 2
make: *** [src_DIR] Error 2

It compiles fine without snmp. I have net-snmp installed on slack64. The build also works fine on slack32-current with snmp. Anyone have luck with apcups on slack64?

in apcupsd.SlackBuild, change:

elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
fi

to

elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC -DNETSNMP_NO_LEGACY_DEFINITIONS=1"
LIBDIRSUFFIX="64"
fi


for some reason,

/usr/include/net-snmp/library/mib.h:#define MIB NETSNMP_MIB2_OID

which causes the string MIB to get treated as a macro. Adding the -D definition is probably not the right way to fix this, but it'll work.

.andy

tux_dude 12-12-2009 06:58 PM

Thanks for the help. Any reason why MIB is defined differently in Slack64. Or is this a question for Pat himself?

GooseYArd 12-13-2009 08:19 AM

Quote:

Originally Posted by tux_dude (Post 3789281)
Thanks for the help. Any reason why MIB is defined differently in Slack64. Or is this a question for Pat himself?

We'd need to poke through the net-snmp headers a little deeper to know for sure, but I noticed a couple of other 64 bit platforms make the same definition (-DNETSNMP_NO_LEGACY_DEFINITIONS=1). I would shoot the package maintainer a message, he'll probably spot the problem right away.

.andy

rworkman 12-14-2009 01:55 PM

I'll try to get this worked around in the script soonish. Based on what I see in the current cvs code for apcupsd, it looks like the author is planning to use an internal "minisnmp" library for future releases, so I don't see much reason to even bother with trying to find a "better" fix.

GooseYArd 12-15-2009 06:42 AM

Quote:

Originally Posted by rworkman (Post 3791287)
I'll try to get this worked around in the script soonish. Based on what I see in the current cvs code for apcupsd, it looks like the author is planning to use an internal "minisnmp" library for future releases, so I don't see much reason to even bother with trying to find a "better" fix.

hah see, this is why slackware is so cool :)


All times are GMT -5. The time now is 09:14 AM.