<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=DE link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>SUCCESS!<span lang=EN-US> Setting the flag <i>--disable-shared</i> when using the <i>./configure</i> command solved the problem. THANKS CHARLES, I couldn’t have done it if you haven’t told me the problem was Libtool and its dynamic libraries. <br><br><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>As you can see, I’m a noob in the slow process of learning. Sorry if I spammed the forum too much with trivial things (for you).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Now, how can contribute my part to the project? The biggest challenge for the windows port (compiling) is already done by Denis and his guide. I can add the modified source for <i>nutdrv_atcl_usb</i> to the repositories but I haven’t any experience on doing that as well. Also I don’t know how to make it work with dynamic libraries. Maybe the whole Windows port is statically built since my <i>nutdrv_atcl_usb.exe </i>is pretty much equal to the other ones at 240 KB.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Anyway, you have my email.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Cheers to the NUT project!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Humberto<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Gesendet von <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> für Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>Von: </b><a href="mailto:hamberthm@gmail.com">Humberto Möckel</a><br><b>Gesendet: </b>Samstag, 11. März 2017 18:29<br><b>An: </b><a href="mailto:nut-upsuser@lists.alioth.debian.org">nut-upsuser@lists.alioth.debian.org</a><br><b>Betreff: </b>Re: [Nut-upsuser] Need nutdrv_atcl_usb for Windows port</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Hello Charles and first of all, thank you so mucho for replying. I really appreciate your help.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>This is the guide I was talking about: <a href="http://lists.alioth.debian.org/pipermail/nut-upsdev/2016-April/007171.html">http://lists.alioth.debian.org/pipermail/nut-upsdev/2016-April/007171.html</a></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>All the versions of MinGW and msys plugins I'm using are exactly the ones listed on that guide written by Denis Serov. </p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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:</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>- Patched file "<a href="http://nut-usbinfo.pl">nut-usbinfo.pl</a>" 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):</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>elsif ($nameFile eq "nutdrv_atcl_usb.c") {<br> $driver="nutdrv_atcl_usb";</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>- Patched the "<a href="http://makefile.am">makefile.am</a>" 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.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>NOTE:<u> I have no idea what those edits do.</u> 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.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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. </p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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 <a href="http://makefile.in">makefile.in</a>:</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>[shell]<br> cd /home/Administrator/nut-2.6.5-7<br> autogen.sh --enable-maintainer-mode<br> ./configure --with-doc=html-single CPPFLAGS="-DWINVER=0x0501 -D_WIN32_WINNT=0x0501" --enable-maintainer-mode<br> export XML_CATALOG_FILES=/mingw/etc/xml/catalog<br> make<br> cd /docs/man<br> make html-man</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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!</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>THANKS!</p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Sat, Mar 11, 2017 at 11:20 AM, Charles Lepple <<a href="mailto:clepple@gmail.com" target="_blank">clepple@gmail.com</a>> wrote:</p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>On Mar 10, 2017, at 5:25 PM, <a href="mailto:hamberthm@gmail.com">hamberthm@gmail.com</a> wrote:<br>><br>> UPDATE: I managed to build the windows port using a guide a user posted a while ago.<br><br>Which guide?<br><br>> 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:<br>><br>> C:\MinGW\msys\1.0\home\Administrator\nut-2.6.5-7\drivers>nutdrv_atcl_usb<br>> nutdrv_atcl_usb:./.libs/lt-nutdrv_atcl_usb.c:233: FATAL: couldn't find nutdrv_atcl_usb.<br>><br>> Now I have no idea how to continue…<br>><br><br>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.<br><br>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.</p></blockquote></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>