[Zlib-devel] [Patch] support for building DLL for cygwin, mingw

Charles Wilson cygwin at cwilson.fastmail.fm
Tue Aug 3 22:58:24 EDT 2010


On 8/3/2010 6:02 PM, Enrico Weigelt wrote:
>> The "create symbolic links for $SHAREDLIB and $SHAREDLIBM" step is moved
>> to a variable set by configure, "SHAREDLIBPOST". Most targets define it as
>>   '(rm -f $(SHAREDLIB) $(SHAREDLIBM); ln -s $@ $(SHAREDLIB) ; ln -s $@
>> $(SHAREDLIBM) )'
> 
> I'd prefer if's instead of putting commands into variables ;-p

It's a smaller change to do it this way; I was trying to keep the
magnitude of the changes smaller, for easier review.  Certainly tweaks
along those lines can and should be discussed...

>> Finally, two new variables are added to compile and link rules:
>> EXTRA_CFLAGS and EXTRA_LDFLAGS. These are used so that the user can pass
>> additional values without clobbering the ones computed by configure.
> 
> Why not simply passing them via common CFLAGS/LDFLAGS variables on
> ./configure call ?

Because (a) zlib's configure doesn't appear to have a concept of
precious variables, unlike autoconf-generated configure scripts, and (b)
setting them that way appears to *override* the ones established by the
configure script, rather than allowing you to append "extra" settings on
top of the automatically determined ones.

>> [*] DESTDIR is fundamentally broken (this is not a zlib specific
>> problem) on mingw; when prefix is X:/bar, you can't prepend DESTDIR=/foo
>> because that gives /fooX:/bar, which is just so wrong...
> 
> I'm not sure whether drive letters should be used at all.

Take it up with Bill, but they aren't going any where.  On MinGW/MSYS,
it is VERY common to configure using --prefix=C:/MinGW.  I only pointed
out the [*] because out of the three "recipes" I posted, the mingw one
was a little odd in that it did not use DESTDIR; I just wanted to
explain why.  Certainly an end user could configure with --prefix=/mingw
instead, but as I say --prefix=X:/foo is quite common, and the recipe I
gave is how you handle "destdir-ish" installs in that situation.

>> The reason EXTRA_* flags are used for mingw, instead of hardcoding them
>> in configure, is because these options change the library's ABI, and
>> this is the way the mingw and cygwin projects will be building them.
> 
> Maybe it would make sense to add own ./configure options for this ?

Well, I wasn't sure how many additional system-specific options would be
welcomed.  Right now, configure is rather svelte -- do we really want to
bloat it with a bunch of platform-specific "--use-ms-compatible-structs"
options and the like?

--
Chuck




More information about the Zlib-devel mailing list