[Nut-upsuser] Compiling NUT static binaries

cooleyr at gmail.com cooleyr at gmail.com
Tue May 19 21:21:10 UTC 2009


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.

CFLAGS="-static" ./configure --enable-static --disable-shared --without-usb
--without-serial --without-ssl --without-wrap --with-drivers=""  && gmake

Above configure line works without complaint, however the binaries are
dynamically linked:

nut-2.4.1$ ldd clients/upsmon
clients/upsmon needs:
        /usr/lib/libsocket.so.2
        /usr/lib/libc.so.1

I've had no such problems creating static binaries from far more complex
bits of software (like OpenSSH) on the same system(s).

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.

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.

Any tips are welcome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20090519/4a317613/attachment.htm>


More information about the Nut-upsuser mailing list