Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 407497 - sys-libs/zlib-1.2.6 on mingw32: two pkg-config files, bad pkg-config file, missing dll import lib
Summary: sys-libs/zlib-1.2.6 on mingw32: two pkg-config files, bad pkg-config file, mi...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-09 03:03 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2012-03-12 05:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge--info.txt (emerge--info.txt,3.27 KB, text/plain)
2012-03-09 03:03 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
zlib-1.2.6.ebuild-mingw32.patch (zlib-1.2.6.ebuild-mingw32.patch,1.81 KB, patch)
2012-03-09 03:08 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff
zlib-1.2.6-mingw32-destdir.patch (zlib-1.2.6-mingw32-destdir.patch,2.58 KB, patch)
2012-03-09 03:17 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-03-09 03:03:55 UTC
Created attachment 304689 [details]
emerge--info.txt

There are some improvements regarding mingw32 support in zlib-1.2.6. These are found in changes to win32/Makefile.gcc:

1. The import lib is installed as libz.dll.a instead of libzdll.a. This allows `gcc -static -o app app.o -lz' and `gcc -o app app.o -lz' to both work instead of requiring -lzdll when linking against the DLL.

2. The mingw32 Makefile now installs zlib.pc itself.

However, each of these has some issues:

1. When compiling with USE=-static-libs, an `rm *.{l,}a' sort of command is run in src_install(). This does properly kill the mingw32 static libz.a, but it also kills the import lib named libz.dll.a. This makes it impossible to link anything against -lz at all (unless if you want to pull out dlltool, which is not something buildsystems will be doing).

2. The win32/Makefile.gcc does not have DESTDIR support, so when it performs substitutions into zlib.pc, the paths end up with ${D} in them. Thus, one gets output like:

binkidesky zlib # mingw32-pkg-config --libs zlib
-L/usr/mingw32/usr/mingw32/tmp/portage/sys-libs/zlib-1.2.6/image//usr/lib -lz

Secondly, the mingw32 Makefile installs the .pc file into $(libdir)/pkgconfig while the ebuild itself installs it into $(datadir)/pkgconfig.

And I have patches :-).
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-03-09 03:08:04 UTC
Created attachment 304691 [details, diff]
zlib-1.2.6.ebuild-mingw32.patch
Comment 2 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-03-09 03:17:37 UTC
Created attachment 304693 [details, diff]
zlib-1.2.6-mingw32-destdir.patch

Pull pending: https://github.com/madler/zlib/pull/5
Comment 3 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-03-10 05:48:15 UTC
(In reply to comment #2)
> Created attachment 304693 [details, diff] [details, diff]
> zlib-1.2.6-mingw32-destdir.patch
> 
> Pull pending: https://github.com/madler/zlib/pull/5

And pulled into https://github.com/madler/zlib/tree/develop
Comment 4 SpanKY gentoo-dev 2012-03-12 05:05:04 UTC
if it's fixed in upstream, the i'm inclined to just wait for 1.2.7 to be released