Ralf Wildenhues wrote:
Hello Yevgen,
* Yevgen Muntyan wrote on Wed, Jan 10, 2007 at 06:17:09AM CET:
AC_TRY_LINK puts LDFLAGS before conftest.c on compilation
command line, and it fails with mingw. Here, it made the following:
/usr/bin/i586-mingw32msvc-gcc -o conftest.exe -O2
-I/usr/local/win/gtk/include -mms-bitfields -march=i686
-I/usr/local/win/gtk/include -I/usr/local/win/Python24/include
-L/usr/local/win/gtk/lib -L/usr/local/win/Python24/libs -lpython24
conftest.c
It produces linker errors, undefined reference to whatever is in
libpython24.
AC_COMPILE_IFELSE does work fine.
Post the errors, otherwise there's little we can do to help you.
Apparently same thing happens with -Wl,--as-needed option.
If you put it into LDFLAGS, then AC_CHECK_FUNCS fails.
For instance for
AC_CHECK_FUNCS([FAMMonitorDirectory FAMOpen],[fam_found=yes],[fam_found=no])
it produces this command line:
gcc -o conftest -g -L/usr/local/gtk/lib -Wl,--as-needed -lfam conftest.c
which fails with "undefined reference to `FAMOpen'", but this works:
gcc -o conftest -g conftest.c -L/usr/local/gtk/lib -Wl,--as-needed -lfam
Best regards,
Yevgen