GNOME Bugzilla – Bug 584101
Configure fails with kerberos and LDFLAGS="-Wl,--as-needed"
Last modified: 2009-05-28 16:01:23 UTC
Please describe the problem: when you enable kerberos support in configure and have LDFLAGS="-"Wl,--as-needed" configure bails out with the message of not finding the libraries: checking for Kerberos 5... no no configure: error: You specified with krb5, but it was not found. Steps to reproduce: 1. run configure with --with-krb5 and have LDFLAGS="-Wl,--as-needed" Actual results: Expected results: Does this happen every time? Other information: The problem is that the libraries to link against are being added to LDFLAGS instead of LIBS resulting in the following gcc call: gcc ${CFLAGS} ${LDFLAGS} -o conftest.o conftest where LDFLAGS contains then "-Wl,--as-needed -lkrb5 ..." meaning that symbols get stripped before conftest actually gets linked, thus the symbol krb5_init_... which conftest.o tries to use being undefined. Adding -lkrb5... to LIBS adds them after conftest.c.
Created attachment 135486 [details] [review] evolution-data-server-2.26.2-as-needed-configure.patch and here's the patch for configure.in to solve the issue
$ LDFLAGS="-Wl,--as-needed" ./configure --with-krb5 The above command works fine for me on Fedora with or without the patch. But your explanation is sound and Googling for similar cases show the same solution.
Committed to master http://git.gnome.org/cgit/evolution-data-server/commit/?id=e650b73b562d825ffbc10a94e0920e5b0a93c182 and gnome-2-26 http://git.gnome.org/cgit/evolution-data-server/commit/?h=gnome-2-26&id=b59d92c8c25fec91a8097c59cf62b5978ccb497b Thanks Tiziano!