Fix build problem with gcc 4.6 on 64 bit From: Christof Schmitt As reported in https://bugs.launchpad.net/ubuntu/+source/hamfax/+bug/770985 and debugged by John Nogatch, gcc requires that the library has to be specified after the module that references it. Fix this by specifying the Qt libraries in LIBS, not in LDFLAGS and adjust the test in bnc_try_4 as well. Also remove the empty argument to AC_TRY_LINK, that seems to break newer autoconf versions. --- hamfax.orig/Makefile.am +++ hamfax/Makefile.am @@ -29,7 +29,7 @@ src/LookUpTable.hpp\ src/hamfax.cpp -hamfax_LDFLAGS = @QT_LIBS@ +LIBS+=@QT_LIBS@ hamfax_CXXFLAGS = @QT_CXXFLAGS@ -Wall hamfax_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" --- hamfax.orig/acinclude.m4 +++ hamfax/acinclude.m4 @@ -208,7 +208,7 @@ echo "configure: could not compile:" >&AC_FD_CC cat bnv_qt_main.$ac_ext >&AC_FD_CC else - bnv_try_4="$CXX $QT_LIBS $LIBS -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o >/dev/null 2>bnv_qt_test_4.out" + bnv_try_4="$CXX -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o $QT_LIBS $LIBS >/dev/null 2>bnv_qt_test_4.out" AC_TRY_EVAL(bnv_try_4) bnv_err_4=`grep -v '^ *+' bnv_qt_test_4.out` if test x"$bnv_err_4" != x; then @@ -379,8 +379,6 @@ # Succes. # We can link with no special library directory. bnv_qt_lib_dir= - ], [ - # Leave bnv_qt_lib_dir defined ]) ]) ])