Helper script for building cygwin DLL

Charles Wilson
Thu Oct 22 23:18:00 GMT 2009

The attached script helps automate the process, for us duffers, of
building a cygwin DLL from CVS and preparing to install it.  To use the
script, checkout winsup from CVS:

$ cvs -z3 co winsup

NOTE: Until some form is accepted into mingw CVS, you'll also need to
manually apply the following patch:
$ cd src/winsup
$ zcat mingw-destdir.patch4.gz | patch -p0
$ cd ../..

Uncompress and copy the script into the src/winsup/cygwin directory, and
then execute it:

$ src/winsup/cygwin/cygdll-build almostall

This will configure, compile, install into a destination directory, and
create pseudo-installation packages. You can then use

$ src/winsup/cygwin/cygdll-build deploy

to install the new package (mostly; you'll still need to then shut down
all cygwin processes, and manually move the new cygwin1.dll into place.
See the --help output).

For convenience, you can also invoke the script thru a symbolic link
(not a hardlink), so long as the real file actually resides in the
winsup/cygwin/ subdirectory of your CVS checkout (which need not be
named "src").

The script is very flexible; there is a -d debug mode that
configures/builds with appropriate options for a debuggable DLL. Also,
you can pass any VARIABLE=VALUE argument, and it will be passed on to
the configure and make commands.

    Usage: cygdll-build [OPTIONS] COMMAND [COMMAND2 [...]] [VAR=VAL ...]

    COMMAND may be one or more of the following:
      conf         configure for building, in
      compile      build
      install      install into a DESTDIR, <autodetect>/src-inst.
                   Note that
                   will be removed first.
      package      create a binary package
      deploy       install the cygwin binary package into /usr. You
                   may need to run this step as Administrator. You
                   WILL need to manually stop all cygwin processes,
                   and copy bin/cygwin1-<DATE>.dll to bin/cygwin1.dll,
                   and bin/cygwin1-<DATE>.dbg to bin/cygwin1.dbg. You
                   may also need to do the same for the two bin/cyglsa*
                   dlls, and then reboot -- but only if you use them.
      deployall    installs the cygwin binary package as well as the
                   w32api and mingw-runtime binary packages.
      almostall    run all of the above, excluding deploy
      all          run all of the above, including deploy
      <func>       If ~/.cygdll-buildrc defines a function <func>,
                   specifying its name as COMMAND will invoke the
                   function (with no arguments)

    OPTIONS may be:
      --help|-h|-? display this help
      --version|-v display version information
      -d           build debug version: CFLAGS="-O0 -ggdb3" for all
                   commands, and --enable-debugging if 'conf',
      -n           dry-run
      -b DIR       build in 'DIR' rather than 'src-build' [*]
      -i DIR       install to 'DIR' rather than 'src-inst' [*]

However, the default settings should be sufficient for most folks just
trying -- perhaps for their first time -- to build a cygwin DLL from source.

A lot of ideas were taken from cygport, and the core settings used in
the default build were taken from Dave Korn's recipe.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygdll-build.gz
Type: application/gzip
Size: 5730 bytes
Desc: not available
URL: <>

More information about the Cygwin-developers mailing list