Hi, Jan Nieuwenhuizen wrote: > AC_LIB_HAVE_LINKFLAGS is broken for cross building, it looks > in $prefix/lib, which is usually /usr/lib/, which is usually > right. > > When cross building using a cross compiler for a different > host root, say /home/janneke/vc/gub/target/mingw/root, things > go horribly wrong.
The issue is not with cross building or not (test "$cross_compiling" = yes), but with using a DESTDIR = /home/janneke/vc/gub/target/mingw/root. See: - In native compiles without DESTDIR, looking up libraries in $prefix/lib is desired: The user expects the configuration to find programs that he has installed earlier with the same --prefix. - In cross-compiles without DESTDIR (oh yes, that exists: I have done cross-compiles with --prefix=/cross/sparc64-linux and similar), looking up libraries in $prefix/lib is desired as well. - In native compiles with DESTDIR - this mode is typically used by package distributors that want to make a clear distinction between the build machine and the end-user's machine, even if the $host is the same -, looking up libraries in $prefix/lib is undesired. - In cross-compiles with DESTDIR - your situation - it is undesired as well. So, when there is a DESTDIR, looking up libraries in $prefix/lib is undesired. There is a set of configure option for this: --without-libxyz-prefix, one for each library libxyz. For example, gettext's "configure --help" contains: --without-libpth-prefix don't search for PACKLIBS in includedir and libdir --without-libiconv-prefix don't search for PACKLIBS in includedir and libdir --without-libintl-prefix don't search for PACKLIBS in includedir and libdir --without-libglib-2.0-prefix don't search for PACKLIBS in includedir and libdir --without-libcroco-0.6-prefix don't search for PACKLIBS in includedir and libdir --without-libunistring-prefix don't search for PACKLIBS in includedir and libdir --without-libxml2-prefix don't search for PACKLIBS in includedir and libdir --without-libncurses-prefix don't search for PACKLIBS in includedir and libdir --without-libtermcap-prefix don't search for PACKLIBS in includedir and libdir --without-libxcurses-prefix don't search for PACKLIBS in includedir and libdir --without-libcurses-prefix don't search for PACKLIBS in includedir and libdir --without-libexpat-prefix don't search for PACKLIBS in includedir and libdir > suggestion to revert back to AC_CHECK_LIB This would disable the search in $prefix/lib and $prefix/include for all users, not only the compilations with DESTDIR. It would be seen as a regression by the majority of the users. Whereas for the users in your situation - a minority of the users -, the desired behaviour is attainable through configure options. Bruno -- In memoriam Ilan Ramon <http://en.wikipedia.org/wiki/Ilan_Ramon>