Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 390119 - sys-power/nut-2.6.2 fails to build tools/nut-scanner with USE=-snmp
Summary: sys-power/nut-2.6.2 fails to build tools/nut-scanner with USE=-snmp
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on: 406099
Blocks:
  Show dependency tree
 
Reported: 2011-11-10 20:22 UTC by Malcolm Lashley
Modified: 2012-06-02 17:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
nut-2.6.2 build log (nut-2.6.2-build.log.gz,9.42 KB, application/octet-stream)
2011-11-30 14:58 UTC, MarisN
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm Lashley 2011-11-10 20:22:52 UTC
Building sys-power/nut-2.6.2 with USE=-snmp causes tools/nut-scanner to fail to find 


make[2]: Entering directory `/var/tmp/portage/sys-power/nut-2.6.2/work/nut-2.6.2/tools/nut-scanner'
make  all-am
make[3]: Entering directory `/var/tmp/portage/sys-power/nut-2.6.2/work/nut-2.6.2/tools/nut-scanner'
/bin/sh ../../libtool --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -I../../clients -I../../include -O2 -pipe -ggdb -march=core2 -msse4 -mcx16 -msahf -msse4.1 -msse4.2 -Wall -Wsign-compare  -Wl,-O1,-hash-style=gnu,-as-needed -o nut-scanner nut_scanner-nut-scanner.o libnutscan.la -lpthread 
libtool: link: x86_64-pc-linux-gnu-gcc -I../../clients -I../../include -O2 -pipe -ggdb -march=core2 -msse4 -mcx16 -msahf -msse4.1 -msse4.2 -Wall -Wsign-compare -Wl,-O1 -Wl,-hash-style=gnu -Wl,-as-needed -o .libs/nut-scanner nut_scanner-nut-scanner.o  ./.libs/libnutscan.so /var/tmp/portage/sys-power/nut-2.6.2/work/nut-2.6.2/clients/.libs/libupsclient.so -lssl -lcrypto -ldl -lz /usr/lib64/libusb.so -lneon -lpthread
nut_scanner-nut-scanner.o: In function `run_snmp':
/var/tmp/portage/sys-power/nut-2.6.2/work/nut-2.6.2/tools/nut-scanner/nut-scanner.c:87: undefined reference to `nutscan_scan_snmp'
collect2: ld returned 1 exit status
make[3]: *** [nut-scanner] Error 1

The Makefile is correctly excluding building the referenced functions when configure --without-snmp is used

@WITH_SNMP_TRUE@am__append_6 = scan_snmp.c
@WITH_SNMP_TRUE@am__append_7 = $(LIBNETSNMP_CFLAGS)
@WITH_SNMP_TRUE@am__append_8 = $(LIBNETSNMP_LIBS)

However - the code is protected with:


#ifdef HAVE_NET_SNMP_NET_SNMP_CONFIG_H
static void * run_snmp(void * arg)
{
        nutscan_snmp_t * sec = (nutscan_snmp_t *)arg;

        dev[TYPE_SNMP] = nutscan_scan_snmp(start_ip,end_ip,timeout,sec);
        return NULL;
}
#endif

Which configure is (correctly) auto-detecting I have - and thus defining in config.h


/* Define to 1 if you have the <net-snmp/net-snmp-config.h> header file. */
#define HAVE_NET_SNMP_NET_SNMP_CONFIG_H 1

The problem appears in configure.in which runs the header-check unconditionally

dnl These checks are performed unconditionally, even if the corresponding
dnl --with-* options are not given. This is because we cannot predict
dnl what will be in the --with-drivers argument.

NUT_CHECK_LIBNETSNMP

My autoconf-fu is too weak to propose a fix from here, but hopefully this gives someone a pointer.

Reproducible: Always

Steps to Reproduce:
1. USE=-snmp emerge sys-power/nut
2.
3.
Actual Results:  
1. Nut fails with the error message above

Expected Results:  
1. nut is complied successfully

Portage 2.2.0_alpha73 (default/linux/amd64/10.0/desktop, gcc-4.5.3, glibc-2.13-r4, 3.1.0-gentoo x86_64)                                                                                                                                                                                                                                   
=================================================================                                                                                                                                                                                                                                                                         
System uname: Linux-3.1.0-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.1                                                                                                                                                                                                                                            
Timestamp of tree: Thu, 10 Nov 2011 19:15:01 +0000                                                                                                                                                                                                                                                                                        
ccache version 3.1.6 [disabled]                                                                                                                                                                                                                                                                                                           
app-shells/bash:          4.2_p10                                                                                                                                                                                                                                                                                                         
dev-java/java-config:     2.1.11-r3                                                                                                                                                                                                                                                                                                       
dev-lang/python:          2.6.7-r2, 2.7.2-r3, 3.1.4-r3, 3.2.2                                                                                                                                                                                                                                                                             
dev-util/ccache:          3.1.6                                                                                                                                                                                                                                                                                                           
dev-util/cmake:           2.8.5-r2                                                                                                                                                                                                                                                                                                        
dev-util/pkgconfig:       0.26                                                                                                                                                                                                                                                                                                            
sys-apps/baselayout:      2.1                                                                                                                                                                                                                                                                                                             
sys-apps/openrc:          0.9.3-r1                                                                                                                                                                                                                                                                                                        
sys-apps/sandbox:         2.5                                                                                                                                                                                                                                                                                                             
sys-devel/autoconf:       2.13, 2.68                                                                                                                                                                                                                                                                                                      
sys-devel/automake:       1.7.9-r2, 1.10.3, 1.11.1-r1                                                                                                                                                                                                                                                                                     
sys-devel/binutils:       2.21.1-r1                                                                                                                                                                                                                                                                                                       
sys-devel/gcc:            4.5.3-r1                                                                                                                                                                                                                                                                                                        
sys-devel/gcc-config:     1.4.1-r1                                                                                                                                                                                                                                                                                                        
sys-devel/libtool:        2.4-r3                                                                                                                                                                                                                                                                                                          
sys-devel/make:           3.82-r3                                                                                                                                                                                                                                                                                                         
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)                                                                                                                                                                                                                                                                                     
sys-libs/glibc:           2.13-r4                                                                                                                                                                                                                                                                                                         
Repositories: gentoo cj-overlay kde mlashley ardunio
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 cadsoft googleearth AdobeFlash-10 AdobeFlash-10.1 google-talkplugin Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ggdb -march=core2 -msse4 -mcx16 -msahf -msse4.1 -msse4.2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -ggdb -march=core2 -msse4 -mcx16 -msahf -msse4.1 -msse4.2"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.virginmedia.com/ ftp://ftp.heanet.ie/pub/gentoo/ http://mirror.bytemark.co.uk/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://mirror.qubenet.net/mirror/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1,-hash-style=gnu,-as-needed"
LINGUAS="en en_GB"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/cj-overlay /var/lib/layman/kde /home/mlashley/overlay /home/mlashley/arduinoverlay"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X \ a52 aac aalib acl acpi alsa amd64 apng bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cscope cups cxx daap dbus declarative dri dts dv dvd dvdr embedded emboss encode exif fam ffmpeg fftw firefox flac fortran gdbm gdu geolocation gif git gphoto2 gpm gpssync gtk hddtemp hdri iconv icu id3tag ieee1394 imap inotify ipod ipv6 isag jack java java6 jpeg jpeg2k kde kipi lastfm lcms ldap lensfun libnotify lm_sensors lua lv2 mad mjpeg mmx mng modules mp3 mp4 mpeg mplayer mudflap multilib mysql ncurses netboot nls nptl nptlonly nsplugin ogg openexr opengl openmp optimized-qmake pam pango pcre pdf perl plasma png policykit ppds pppd qt3support qt4 quicktime rdp readline redeyes romio rss scim sdl semantic-desktop session smi smp spell sql sqlite sse sse2 sse3 sse4 sse4.1 sse4.2 ssl ssse3 startup-notification svg sysfs tcpd theora threads tiff tools truetype udev unicode usb v4l2 vim-syntax vnc vorbis vpx webkit x264 xcb xcomposite xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="canon directory ptp2" COLLECTD_PLUGINS="ipvs netlink apple_sensors nut apache apcups ascent battery bind conntrack contextswitch cpu cpufreq curl curl_xml df disk dns email entropy exec filecount fscache hddtemp interface iptables irq java load madwifi mbmon memory multimeter mysql network nfs nginx ntpd olsrd openvpn powerdns processes protocols python rrdcached sensors serial snmp swap table tail tcpconns teamspeak2 ted thermal uptime users vmem wireless csv exec logfile network notify_desktop python rrdcached rrdtool syslog unixsock write_http match_empty_counter match_hashed match_regex match_timediff match_value target_notification target_replace target_scale target_set uuid" DRACUT_MODULES="mdraid" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Agostino Sarubbo gentoo-dev 2011-11-10 20:55:30 UTC
please add complete build log
Comment 2 MarisN 2011-11-30 14:58:15 UTC
Created attachment 294329 [details]
nut-2.6.2 build log

This seems to be a known issue and has been fixed by upstream for the next release.

More info:
http://lists.alioth.debian.org/pipermail/nut-upsuser/2011-September/007158.html

Build log attached, as requested.
Comment 3 Michael Weber (RETIRED) gentoo-dev 2012-06-02 17:52:59 UTC
this no longer happens with version 2.6.3, bug 406099.
Just a second