Building static executables

Fergus fergus@bonhard.uklinux.net
Wed Apr 15 14:00:00 GMT 2009


I noticed that /bin/bash.exe has several library dependencies:

~> cygcheck /bin/bash.exe
   D:\bin\cygwin1.dll
   D:\bin\cygintl-8.dll
     D:\bin\cygiconv-2.dll
   D:\bin\cygreadline6.dll
     D:\bin\cygncurses-8.dll

(as well as other requirements under c:\Windows\system32\ not listed 
here). I was able to build a "static" version (that is, a version 
requiring only a co-located cygwin1.dll to run) by defining

~> export CFLAGS="-static"

and then building bash from source*.

I was able to do the same thing with nano.exe, which in its "non-static" 
standard form requires all of cygncurses-8.dll, cygintl-8.dll, 
cygiconv-2.dll as well as cygwin1.dll.

I then tried (because it provides a nicer look than bash)

~> cygcheck /bin/rxvt.exe
   D:\bin\cygwin1.dll

and guessed that /bin/rxvt.exe already was "static" in the sense that it 
would require only a co-located cygwin1.dll to run; but when I tried it 
in that sparse environment I got the error message:

   failed to load libW11.dll

Q1. Can anybody tell me why cygcheck /bin/rxvt.exe does not show 
libW11.dll as a dependency?

I then tried building rxvt from source* with the same setting for 
CFLAGS, but although an executable built perfectly well, it was not 
static either. And in the same way: it needs libW11.dll.

Q2. Please can anybody tell me how to build static executables (in 
general) in Cygwin, from source*?

* What I mean by "source" is the .tar.gz from GNU or SourceForge or ...

Thank you.

Fergus



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list