[Nut-upsuser] Need nutdrv_atcl_usb for Windows port

Humberto Möckel hamberthm at gmail.com
Sat Mar 11 21:29:39 UTC 2017

Hello Charles and first of all, thank you so mucho for replying. I really
appreciate your help.

This is the guide I was talking about:

All the versions of MinGW and msys plugins I'm using are exactly the ones
listed on that guide written by Denis Serov.

The procedure I used to compile is also the same as Denis suggested, but I
made some changes on my own in the "build NUT" step since I added the
"nutdrv_atcl_usb.c" source file from the last version of NUT, not present
in the latest Windows build. Those are:

- Patched file "nut-usbinfo.pl" as otherwise it will abort the make process
with an error. In the section "process the driver name" with the following
code (same as latest NUT linux version):

elsif ($nameFile eq "nutdrv_atcl_usb.c") {

- Patched the "makefile.am" in the drivers folder so it will include the
source in the build. I added nutdrv_atcl_usb to the USB_LIBUSB_DRIVERLIST
and added the LDADD/CFLAGS.

NOTE:* I have no idea what those edits do.* The only thing I wanted is the
compiler to see the new source and compile it. So I just blindly
searched mentions of the driver inside all the latest linux build
sources and tried to patch them the same way on the outdated windows port.
The two files above were all I could find where the driver was mentioned.

Also made two minor changes to the source file itself, fixed one variable
that was giving error at building (I think it was something like USB sleep
that I fixed to 5000), and the SleepEx() function instead of the sleep()
one since the windows port was redefining sleep() to Sleep() and this one
doesn't return 0 once the time has elapsed.

For the build commands, I use as follows. I added the flag
"--enable-maintainer-mode"  as I read in the developer guide to allow
regeneration of the makefile.in:

    cd /home/Administrator/nut-2.6.5-7
    autogen.sh --enable-maintainer-mode
   ./configure --with-doc=html-single CPPFLAGS="-DWINVER=0x0501
-D_WIN32_WINNT=0x0501" --enable-maintainer-mode
    export XML_CATALOG_FILES=/mingw/etc/xml/catalog
    cd /docs/man
    make html-man

Now in response to you suggestion; I have no idea what NUT Scanner does and
if I need it or not. The only thing I want is to use this driver so I can
manage my UPS with NUT, and if possible to publish the changes I made so
other people can use it.

I will wait for your answer anxiously. It has been a week of hours of trial
and error and making this to work would be so nice!


On Sat, Mar 11, 2017 at 11:20 AM, Charles Lepple <clepple at gmail.com> wrote:

> On Mar 10, 2017, at 5:25 PM, hamberthm at gmail.com wrote:
> >
> > UPDATE: I managed to build the windows port using a guide a user posted
> a while ago.
> Which guide?
> > I’ve also corrected a couple of variables like the SleepEx() function
> instead of the sleep() used in Linux. I’ve successfully compiled the EXE
> for nutdrv_atcl_usb but when I execute it via upsdrvctl it gives the
> following output:
> >
> > C:\MinGW\msys\1.0\home\Administrator\nut-2.6.5-7\drivers>nutdrv_atcl_usb
> > nutdrv_atcl_usb:./.libs/lt-nutdrv_atcl_usb.c:233: FATAL: couldn't find
> nutdrv_atcl_usb.
> >
> > Now I have no idea how to continue…
> >
> The lt-*.c part indicates that the problem is likely related to libtool.
> Do you need any of the functionality like nut-scanner which requires
> libtool? If not, it might be possible to reconfigure for a static build.
> It might help to see the ./configure parameters you used, plus any
> patches. Also, versions of the various MinGW/msys components would probably
> be useful for anyone else trying to build for Windows.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170311/606fed0b/attachment.html>

More information about the Nut-upsuser mailing list