For various reasons that will be of interest to no-one, I need to compile at least a minimal upsmon (and hopefully upsc) as a static binary. Unfortunately, the ./configure options that purport to do this, don't have any effect on the resulting binary. Either with the latest (2.4.1), or older versions of NUT.<br>
<br>CFLAGS="-static" ./configure --enable-static --disable-shared --without-usb --without-serial --without-ssl --without-wrap --with-drivers="" && gmake<br><br>Above configure line works without complaint, however the binaries are dynamically linked:<br>
<br>nut-2.4.1$ ldd clients/upsmon<br>clients/upsmon needs:<br> /usr/lib/libsocket.so.2<br> /usr/lib/libc.so.1<br><br>I've had no such problems creating static binaries from far more complex bits of software (like OpenSSH) on the same system(s).<br>
<br>I could provide more system information, but I'm confident it won't be helpful. I have the same problem on several different system, with vastly varied configurations. <br><br>I expect there's some libtool / gcc linking flag I'm ignorant of, or neglecting to use, but extensive trial and error has not found it. [-Xlinker] -all-static , -without-shared, -static-libtool-libs, etc. have not had any effect on the end binary.<br>
<br>Any tips are welcome.<br>