[plug] building static binaries

Luke Dudney dex at wn.com.au
Mon Dec 29 16:10:36 WST 2003


On Mon, 2003-12-29 at 15:16, James Devenish wrote:
> In message <1072681007.15478.14.camel at lukenew>
> on Mon, Dec 29, 2003 at 02:56:47PM +0800, Luke Dudney wrote:
> > I'm trying to install EtherApe 0.9.0 onto a server system which does not
> > have any X or gnome libraries (libX11, libgnome, libglade etc)
> > installed. Etherape's dependencies are numerous, but I'm not really keen
> > on installing all of them onto this server.
> 
> Does it actually need all those dependencies? (I don't use the product,
> so I don't know). That is, will it do everything it needs to do if you
> compile it without the GUI stuff?

Yep, it's an application that displays network traffic graphically in
realtime, so it needs the libs.

> > I've tried setting CFLAGS=-static but this results in an error:
> [...]
> > checking for res_init in -lbind... no
> > checking for res_init in -lresolv... no
> [...]
> > checking for res_mkquery in -lbind... no
> > checking for res_mkquery in -lresolv... no
> > configure: error: No resolver library found
> 
> Is your system missing libresolv.a? What might be happening is that the
> linker is looking for libresolv.a but finding only libresolv.so or
> something. Also, I would have suspected that LDFLAGS=-static is the
> thing to use, rather than CFLAGS=-static.

I've just tried with all combinations of CFLAGS and LDFLAGS unset or set
to "-static", same result.

> > Obviously I'm not going about this the right way. Can someone suggest
> > how I can achieve what I'm trying to do? Is it even advisable, or should
> > I just bite the bullet and install the deps?
> 
> Keep in mind that you'd only be installing the libs, not the X server,
> etc., so it's not so bad. Also keep in mind that even if the libs are
> statically linked, they might require certain support files (e.g.
> configuration files) to be present on the system. So...might be better
> to either compile without the GUI libs in the first place, or install
> the GUI libs on the server.

If there weren't so many of the darned libs I would have given up and
installed them long ago. But take a look at its requirements:

0=[16:06:41]luke at lukenew:~/src/etherape-0.9.0$ ldd
/usr/local/bin/etherape
        libglade-2.0.so.0 => /usr/lib/libglade-2.0.so.0 (0x03940000)
        libgnomeui-2.so.0 => /usr/lib/libgnomeui-2.so.0 (0x038b0000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x00136000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x00140000)
        libbonoboui-2.so.0 => /usr/lib/libbonoboui-2.so.0 (0x037d0000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0064e000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00124000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00111000)
        libgnomecanvas-2.so.0 => /usr/lib/libgnomecanvas-2.so.0
(0x0016d000)
        libgnome-2.so.0 => /usr/lib/libgnome-2.so.0 (0x00ac0000)
        libpopt.so.0 => /usr/lib/libpopt.so.0 (0x00619000)
        libart_lgpl_2.so.2 => /usr/lib/libart_lgpl_2.so.2 (0x00453000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0
(0x0019b000)
        libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x00748000)
        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x009e8000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x009cc000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0
(0x00623000)
        libpangoxft-1.0.so.0 => /usr/lib/libpangoxft-1.0.so.0
(0x00a57000)
        libpangox-1.0.so.0 => /usr/lib/libpangox-1.0.so.0 (0x00a98000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00998000)
        libbonobo-2.so.0 => /usr/lib/libbonobo-2.so.0 (0x03834000)
        libgconf-2.so.4 => /usr/lib/libgconf-2.so.4 (0x00b01000)
        libgnomevfs-2.so.0 => /usr/lib/libgnomevfs-2.so.0 (0x03793000)
        libbonobo-activation.so.4 => /usr/lib/libbonobo-activation.so.4
(0x00b87000)
        libORBit-2.so.0 => /usr/lib/libORBit-2.so.0 (0x00b37000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x005e4000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00a91000)
        libm.so.6 => /lib/tls/libm.so.6 (0x00cf5000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x005de000)
        libdl.so.2 => /lib/libdl.so.2 (0x00d19000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x0046b000)
        libpcap.so.0.6.2 => /usr/lib/libpcap.so.0.6.2 (0x001bd000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00159000)
        libc.so.6 => /lib/tls/libc.so.6 (0x00bba000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x0029e000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x00d1e000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00ba2000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x00ab6000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x00ada000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0026b000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x001da000)
        libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x002be000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x00294000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x00101000)
        libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x00257000)
        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x0022b000)
        libORBitCosNaming-2.so.0 => /usr/lib/libORBitCosNaming-2.so.0
(0x00aa7000)
        libssl.so.4 => /lib/libssl.so.4 (0x00592000)
        libcrypto.so.4 => /lib/libcrypto.so.4 (0x002c4000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x005c9000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x003bc000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x003b7000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00425000)
        librt.so.1 => /lib/tls/librt.so.1 (0x00638000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0x00235000)

:P

> 
> PS. I'm glad I don't use EtherApe because one unfortunate mistake in its
> pronunciation would make something that sounds wrong in so many ways.
> Like viagrafix and powergenitalia.

Yes, I intentionally capitalised it thus just prior to posting :)

Cheers
Luke






More information about the plug mailing list