[Nut-upsuser] Install problems (group permissions) with nut 2.7.2

Rob Groner rgroner at RTD.com
Mon Mar 9 16:00:02 UTC 2015


Sorry for the bad formatting of the previous message...I tried to use plus signs as bullet points, and that caused a problem somehow.

Ok...I discovered that if I do the autoreconf after the first failed make (and the autoreconf still gives that error message), and then do make again...it builds.

Conclusions:
1) Autoreconf *must* be run, and not ./configure?  I had thought that putting in my *.c and *.h files and making the makefile changes and then executing ./configure for the first time would be enough.  
2) Autoreconf appears to do what it needs to do, even though it shows and error and says it exited.

Sincerely,
Rob Groner



> -----Original Message-----
> From: Nut-upsuser [mailto:nut-upsuser-
> bounces+rgroner=rtd.com at lists.alioth.debian.org] On Behalf Of Rob Groner
> Sent: Monday, March 09, 2015 11:49 AM
> To: 'nut-upsuser List'
> Subject: Re: [Nut-upsuser] Install problems (group permissions) with nut
> 2.7.2
> 
> Ok, I tried this from scratch on a fresh 2.7.2 directory.  I followed the web
> instructions, specifically:
> 
> + I generated the new subdriver for my UPS (rtd-hid.*) based on PATH info.
> + I put them in the drivers subdir
> + I added the include line (#include rtd-hid.h) in usbhid-ups.c
> + (specifically in the #ifndef SHUT_MODE section) I added
> + &rtd_subdriver,  to the subdriver_list in usbhid-ups.c (specifically
> + in the #ifndef SHUT_MODE section) I added "rtd-hid.c" to
> + USBHID_UPS_SUBDRIVERS in drivers/Makefile.am I added "rtd-hid.h" to
> + dist_noinst_HEADERS in drivers/Makefile.am I executed ./configure
> + --with-usb --with-dev --etc --etc
> 
> I execute make, and I get an error:
> /bin/sh ../libtool --tag=CC   --mode=link gcc -I../include      -g -O2 -Wall -
> Wsign-compare   -o usbhid-ups usbhid-ups.o libhid.o libusb.o hidparser.o
> usb-common.o apc-hid.o belkin-hid.o cps-hid.o explore-hid.o liebert-hid.o
> mge-hid.o powercom-hid.o tripplite-hid.o idowell-hid.o openups-hid.o
> ../common/libcommon.la ../common/libparseconf.la main.o dstate.o -lusb  -
> lpthread
> libtool: link: gcc -I../include -g -O2 -Wall -Wsign-compare -o usbhid-ups
> usbhid-ups.o libhid.o libusb.o hidparser.o usb-common.o apc-hid.o belkin-
> hid.o cps-hid.o explore-hid.o liebert-hid.o mge-hid.o powercom-hid.o
> tripplite-hid.o idowell-hid.o openups-hid.o main.o dstate.o
> ../common/.libs/libcommon.a ../common/.libs/libparseconf.a -lusb -lpthread
> usbhid-ups.o:(.rodata+0x110): undefined reference to `rtd_subdriver'
> collect2: error: ld returned 1 exit status
> make[1]: *** [usbhid-ups] Error 1
> make[1]: Leaving directory `/home/rtd/nut-2.7.2/drivers'
> 
> I can see that somehow, somewhere, my rtd-hid.o isn't being included in
> that list.
> 
> I followed the same process again, but this time tried autoreconf instead of
> configure (I had already run ./configure once).  That gave me an error
> message that I do not believe is related to my driver:
> 
> Parallel-tests: error: required file './test-driver' not found
> Parallel-tests:  'automake --add-missing' can install 'test-driver'
> Autoreconf: automake failed with exit status 1
> 
> 
> 
> Sincerely,
> Rob Groner
> 
> 
> > -----Original Message-----
> > From: Charles Lepple [mailto:clepple at gmail.com]
> > Sent: Monday, March 02, 2015 8:27 PM
> > To: Rob Groner
> > Cc: nut-upsuser List
> > Subject: Re: [Nut-upsuser] Install problems (group permissions) with
> > nut
> > 2.7.2
> >
> > On Mar 2, 2015, at 12:49 PM, Rob Groner <rgroner at RTD.com> wrote:
> >
> > > Well, having spent a decent amount of time trying to get my driver
> > > file
> > added into the Makefile build system (and failing), I've decided that
> > for now, simply adding that one line to the openups-hid.c file and
> > recompiling is the best route to go.  When I can no longer live with
> > the limited nature of the openups-hid driver, I'll revisit writing our own.
> >
> > I'll take this as a TODO item to make it clearer, but for later the
> > basic information is here:
> >
> > http://www.networkupstools.org/docs/developer-
> > guide.chunked/ar01s04.html#_writing_a_subdriver
> >
> > "You must also add the subdriver to USBHID_UPS_SUBDRIVERS in
> > drivers/Makefile.am and call "autoreconf" and/or "./configure" from
> > the top level NUT directory."
> >
> > To run autoreconf, you need automake, autoconf and libtool. automake
> > turns Makefile.am into Makefile.in, and the ./configure script
> > converts Makefile.in to the Makefile.
> >
> > --
> > Charles Lepple
> > clepple at gmail
> >
> >
> 
> 
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser



More information about the Nut-upsuser mailing list