[poppler] poppler/m4: qt.m4,1.3,1.4
Albert Astals Cid
aacid at kemper.freedesktop.org
Sun Apr 9 04:05:53 PDT 2006
Update of /cvs/poppler/poppler/m4
In directory kemper:/tmp/cvs-serv663/m4
Modified Files:
qt.m4
Log Message:
m4/qt.m4: Improve for systems that need -pthread to be linked when linking Qt. Patch by Diego Pettenò
Index: qt.m4
===================================================================
RCS file: /cvs/poppler/poppler/m4/qt.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- qt.m4 2 Apr 2006 18:07:59 -0000 1.3
+++ qt.m4 9 Apr 2006 11:05:51 -0000 1.4
@@ -53,8 +53,34 @@
fi
if test "x$have_qt" == "xyes"; then
+ AC_LANG_PUSH([C++])
+ pthread_needed=no
+
+ save_LDFLAGS=$LDFLAGS
+ save_CXXFLAGS=$CXXFLAGS
+ save_LIBS=$LIBS
+ CXXFLAGS="$CXXFLAGS -I$qt_incdir"
+ LIBS="$LIBS $qt_libdir/$qt_test_library"
+ AC_MSG_CHECKING([if Qt needs -pthread])
+ AC_TRY_LINK([#include <qt.h>], [QString s;], [pthread_needed=no], [pthread_needed=yes])
+ if test "x$pthread_needed" = "xyes"; then
+ LDFLAGS="$LDFLAGS -pthread"
+ AC_TRY_LINK([#include <qt.h>], [QString s;], [pthread_needed=yes], [pthread_needed=no])
+ fi
+ AC_MSG_RESULT([$pthread_needed])
+ LDFLAGS=$save_LDFLAGS
+ CXXFLAGS=$save_CXXFLAGS
+ LIBS=$save_LIBS
+
+ AC_LANG_POP
+
+ qtpthread=''
+ if test "x$pthread_needed" = "xyes"; then
+ qtpthread="-pthread"
+ fi
+
$1[]_CXXFLAGS="-I$qt_incdir"
- $1[]_LIBS="$qt_libdir/$qt_test_library"
+ $1[]_LIBS="$qtpthread $qt_libdir/$qt_test_library"
ifelse([$2], , :, [$2])
else
ifelse([$3], , [AC_MSG_FAILURE(dnl
More information about the poppler
mailing list