This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Building cygwin1.dll and mknetrel

Here are some observations of building cygwin1.dll with the mknetrel
package.  I have not yet looked enough at the innards to be able to
document how to add an 'extras' file, which is how mknetrel overrides
the normal build procedure for some packages.  All in all, it looks like
a pretty elegant package made up mostly of shell scripts, which
themselves are made up mostly of shell functions.  It may be copied into
the FAQ or anywhere else you may like.  There's even a company in Oragon
that will print in onto a roll of toilet paper for you. ;->  If it
doesn't end up on the official web, I'll probably just throw it on my

For testing of this script, I made a fresh install with setup, and
installed the following packages:

ash            bash           binutils       bzip2          crypt          
cvs            cygwin         diffutils      ed             fileutils      
findutils      gawk           gcc            gdbm           grep           
gzip           libbz2_1       libintl1       libncurses5    libncurses6    
libpng         libreadline4   libreadline5   make           mingw-runtime  
pcre          *perl           sed            sh-utils       tar            
terminfo      *tetex-beta     texinfo        textutils     *getopt 

This appears to be close to the minimum set.  Perl may not be needed.
tetex-beta really isn't needed, it is installed just for readlink.  The
command, I think, could be replaced with:

| #!/usr/bin/perl
| $x = readlink $ARGV[0];
| exit 1 unless defined $x;
| print $x, "\n";
| exit 0;

or maybe
|find "$1" -type l -maxdepth 0 -printf '%l\n'

getopt is not a cygwin package.  My copy came out of a copy of smail on
my linux box, it's PD from AT&T, and compiled out of the box on cygwin.
It could probably be replaced with a shell script/function.

After installing the system, and adding getopt, the following script was
sufficient to build cygwin; it ended up in a lovely tarball in

|cd /bin
|for name in c++ ar ranlib g++ dlltool as windres nm strip; do
|  do ln -s $name i686-pc-cygwin-$name
|cd /
|mkdir netrel
|cd netrel
|cvs -d co
|mkdir src inst build uploads extra
|cd src
|tar -xjf $SETUPDIR/release/cygwin/*-src.tar.bz2
|tar -xjf $SETUPDIR/release/mingw-runtime/*-src.tar.bz2
|tar -xjf $SETUPDIR/release/w32api/*-src.tar.bz2
|cd cygwin*/winsup
|rm -fr mingw cinstall w32api
|ln -s /netrel/src/mingw-runtime-*/ mingw
|ln -s /netrel/src/w32api-*/ w32api
|cd /netrel
|mknetrel cygwin 2>&1 | tee mknetrel.cygwin.out

	*	The first time you connect to the CVS server, you're going to
	 	have to do a cvs login
	*	mknetrel has hardcoded absolute paths.  your build tree must be
	 	in /netrel exactly.

	*	mknetrel, it appears, can build most but not all cygwin
	 	packages.  vim, for example, looses, because the build must be
		done in the src directory.  It looks like an 'extras' script
		could be produced to accomidate vim, either with a link tree (I
		seem to recall the vim build supports this) or some other hack.

	*	On my production system, I had to change the '#!/bin/sh' to
		'#!/bin/bash' on one of the mknetrel shell scripts
		to get the shell to accept the usage of getopts ... but on the
		fresh install, I did not.  (This is the bash getopts builtin,
		not the standalone and singular 'getopt' discussed above)
	*	The fact that mknetrel uses i686-pc-cygwin-xxx as it's tools
		during the build implies that it may work with a cross compiler
		as well, or may have been developed to cross compile.  I haven't
		yet had time to prove this.

	*	I use wildcards in some places to avoid explicitly stating
		package versions.  The drawback to this approach is that it will
		break in the presence of dup package versions.

	*	Some of my test builds produced a linux version of libiberty as
		an added bonus.  I don't know why, but it didn't seem to hurt

Got freedom?  Vote Libertarian:

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]