Build failure on MinGW with GCC >= 4.6 because of "-no-undefined"
|Status:||Closed||Start date:||27 Mar 2011|
|Assignee:||Andreas Huggel||% Done:|
Exiv2 fails to build under MinGW when compiled with GCC >= 4.6.
The problem is the "-no-undefined" flag, which should only be passed to libtool and never to GCC. Previous versions of GCC tolerated this flag, but that changed since GCC 4.6. See also the libtool mailing list for more information on that topic:
Note that the Exiv2 Makefile already does everything right. The problem is the configure.ac which adds "-no-undefined" to LDFLAGS too early in the configure process. That way, the library checks will use this flag and pass it to GCC. So the ./configure process fails with a misleading error message, e.g. stating that zlib couldn't be found.
The solution is to add "-no-undefined" as lately as possible, after all other configure checks.