Commit e8d3b21d authored by Brad Hards's avatar Brad Hards

Switch to using pkg-config to find Qt4.

parent bd99616b
2007-03-06 Brad Hards <bradh@kde.org>
* configure.ac
* m4/qt.m4
* poppler/Makefile.am
* qt4/src/Makefile.am
* qt4/tests/Makefile.am
Switch to using pkg-config to find Qt4.
2007-02-25 Julien Rebetez <julienr@svn.gnome.org>
reviewed by: Albert Astals Cid <aacid@kde.org>
......
......@@ -220,35 +220,32 @@ AM_CONDITIONAL(BUILD_POPPLER_QT, test "x$enable_poppler_qt" = "xyes")
dnl
dnl Try Qt4
dnl
AC_ARG_ENABLE(poppler-qt4,
AC_HELP_STRING([--disable-poppler-qt4],
[Don't compile poppler Qt4 wrapper.]),
enable_poppler_qt4=$enableval,
enable_poppler_qt4="try")
AC_ARG_ENABLE(poppler-qt4,
AC_HELP_STRING([--disable-poppler-qt4],
[Don't compile poppler Qt4 wrapper.]),
enable_poppler_qt4=$enableval,
enable_poppler_qt4="try")
if test x$enable_poppler_qt4 = xyes; then
POPPLER_FIND_QT4(POPPLER_QT4)
PKG_CHECK_MODULES(POPPLER_QT4,
QtCore >= 4.1.0 QtGui >= 4.1.0 QtXml >= 4.1.0 QtTest >= 4.1.0)
elif test x$enable_poppler_qt4 = xtry; then
POPPLER_FIND_QT4(POPPLER_QT4,
[enable_poppler_qt4="yes"],
[enable_poppler_qt4="no"])
PKG_CHECK_MODULES(POPPLER_QT4,
QtCore >= 4.1.0 QtGui >= 4.1.0 QtXml >= 4.1.0 QtTest >= 4.1.0,
[enable_poppler_qt4="yes"],
[enable_poppler_qt4="no"])
fi
AC_SUBST(POPPLER_QT4_CXXFLAGS)
AC_SUBST(POPPLER_QT4_LIBS)
AM_CONDITIONAL(BUILD_POPPLER_QT4, test "x$enable_poppler_qt4" = "xyes")
if test x$enable_poppler_qt4 = xyes; then
POPPLER_FIND_QT4TEST(POPPLER_QTTEST,
[enable_poppler_qt4testlib="yes"],
[enable_poppler_qt4testlib="no"])
AC_SUBST(POPPLER_QTTEST_CXXFLAGS)
AC_SUBST(POPPLER_QTTEST_LIBS)
else
enable_poppler_qt4testlib="no"
if test x$enable_splash_output != xyes; then
if test x$enable_poppler_qt4 = xyes; then
enable_poppler_qt4="no because of disabled splash"
fi
fi
AM_CONDITIONAL(BUILD_POPPLER_QT4TESTS, test x$enable_poppler_qt4testlib = xyes)
AM_CONDITIONAL(BUILD_POPPLER_QT4, test "x$enable_poppler_qt4" = "xyes")
AC_ARG_ENABLE(gtk-test,
AC_HELP_STRING([--disable-gtk-test],
......@@ -332,7 +329,6 @@ echo " splash output: $enable_splash_output"
echo " cairo output: $enable_cairo_output"
echo " qt wrapper: $enable_poppler_qt"
echo " qt4 wrapper: $enable_poppler_qt4"
echo " qt4 unittests: $enable_poppler_qt4testlib"
echo " glib wrapper: $enable_poppler_glib"
echo " use gtk-doc: $enable_gtk_doc"
echo " use libjpeg: $enable_libjpeg"
......
......@@ -90,168 +90,3 @@ fi
])
# POPPLER_FIND_QT4(VARIABLE-PREFIX, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check whether the Qt4 libraries are available.
#
# --------------------------------------------------------------
AC_DEFUN([POPPLER_FIND_QT4],
[
have_qt4=no
dnl Search paths for Qt4 - not much real experience with this yet.
qt4_incdirs="/usr/local/qt/include /usr/include/qt4 /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt/include /usr/lib/qt4/include"
qt4_libdirs="/usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt/lib /usr/lib/qt4/lib"
if test -n "$QTDIR" ; then
qt4_incdirs="$QTDIR/include $qt4_incdirs"
qt4_libdirs="$QTDIR/lib $qt4_libdirs"
fi
dnl What to test
qt4_test_include="QtCore/QCoreApplication"
qt4_test_la_library="libQtCore.la"
qt4_test_library="libQtCore.so"
qt4_test_framework="QtCore.framework"
qt4_windows_test_library="QtCore4.dll"
dnl Check for Qt4 headers
AC_MSG_CHECKING([for Qt4 headers])
qt4_incdir="no"
for it in $qt4_incdirs ; do
if test -r "$it/$qt4_test_include" ; then
qt4_incdir="$it"
break
fi
done
AC_MSG_RESULT([$qt4_incdir])
dnl Check for Qt4 libraries
AC_MSG_CHECKING([for Qt4 libraries])
qt4_libdir="no"
for qt4_check in $qt4_libdirs ; do
if test -r "$qt4_check/$qt4_test_la_library" ; then
qt4_libdir="$qt4_check"
break
fi
if test -r "$qt4_check/$qt4_test_library" ; then
qt4_libdir="$qt4_check"
break
fi
if test -r "$qt4_check/$qt4_windows_test_library" ; then
qt4_libdir="$qt4_check"
windows_qt="yes"
break
fi
if test -d "$qt4_check/$qt4_test_framework"; then
qt4_libdir="$qt4_check"
mac_qt="yes"
break
fi
done
AC_MSG_RESULT([$qt4_libdir])
if test "x$qt4_libdir" != "xno" ; then
if test "x$qt4_incdir" != "xno" ; then
have_qt4=yes;
fi
fi
if test "x$have_qt4" == "xyes"; then
$1[]_CXXFLAGS="-I$qt4_incdir"
if test x$windows_qt = xyes; then
$1[]_LIBS="-L$qt4_libdir -lQtCore4 -lQtGui4 -lQtXml4"
elif test x$mac_qt = xyes; then
$1[]_LIBS="-L$qt4_libdir -Wl,-F$qt4_libdir -framework QtCore -framework QtGui -framework QtXml"
else
$1[]_LIBS="-L$qt4_libdir -lQtCore -lQtGui -lQtXml"
fi
ifelse([$2], , :, [$2])
else
ifelse([$3], , [AC_MSG_FAILURE(dnl
[Qt4 development libraries not found])],
[$3])
fi
])
# POPPLER_FIND_QT4TEST(VARIABLE-PREFIX,
# [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
# Check whether the Qt4 libraries are available.
#
# --------------------------------------------------------------
AC_DEFUN([POPPLER_FIND_QT4TEST],
[
have_qt4testlib=no
qt4_incdirs="/usr/local/qt/include /usr/include/qt4 /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt/include"
qt4_libdirs="/usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt/lib"
if test -n "$QTDIR" ; then
qt4_incdirs="$QTDIR/include $qt4_incdirs"
qt4_libdirs="$QTDIR/lib $qt4_libdirs"
fi
dnl What to test
qt4test_test_include="QtTest/QtTest"
qt4test_test_la_library="libQtTest.la"
qt4test_test_library="libQtTest.so"
qt4test_test_framework="QtTest.framework"
dnl Check for QtTestLib headers
AC_MSG_CHECKING([for QtTestLib headers])
qt4test_incdir="no"
for it in $qt4_incdirs ; do
if test -r "$it/$qt4test_test_include" ; then
qt4test_incdir="$it"
break
fi
done
AC_MSG_RESULT([$qt4test_incdir])
dnl Check for Qt4 libraries
AC_MSG_CHECKING([for QtTestLib libraries])
qt4test_libdir="no"
for qt4test_check in $qt4_libdirs ; do
if test -r "$qt4test_check/$qt4test_test_la_library" ; then
qt4test_libdir="$qt4test_check"
break
fi
if test -r "$qt4test_check/$qt4test_test_library" ; then
qt4test_libdir="$qt4test_check"
break
fi
if test -d "$qt4test_check/$qt4test_test_framework" ; then
qt4test_libdir="$qt4test_check"
mac_test=yes
break
fi
done
AC_MSG_RESULT([$qt4test_libdir])
if test "x$qt4test_libdir" != "xno" ; then
if test "x$qt4test_incdir" != "xno" ; then
have_qt4testlib=yes;
fi
fi
if test "x$have_qt4testlib" == "xyes"; then
$1[]_CXXFLAGS="-I$qt4test_incdir"
if test x$mac_test = xyes; then
$1[]_LIBS="-L$qt4test_libdir -Wl,-F$qt4test_libdir -framework QtTest"
else
$1[]_LIBS="-L$qt4test_libdir -lQtTest"
fi
ifelse([$2], , :, [$2])
else
ifelse([$3], , [AC_MSG_FAILURE(dnl
[Qt4 test libraries not found])],
[$3])
fi
])
......@@ -22,7 +22,7 @@ libpoppler_arthur_la_SOURCES = \
ArthurOutputDev.cc
arthur_includes = \
$(POPPLER_QT4_CXXFLAGS)
$(POPPLER_QT4_CFLAGS)
arthur_libs = \
$(POPPLER_QT4_LIBS)
......
......@@ -3,8 +3,7 @@ INCLUDES = \
-I$(top_srcdir)/poppler \
-I$(top_srcdir)/qt \
$(FONTCONFIG_CFLAGS) \
$(POPPLER_QT4_CXXFLAGS)
$(POPPLER_QT4_CFLAGS)
poppler_includedir = $(includedir)/poppler
......
......@@ -4,8 +4,7 @@ INCLUDES = \
-I$(top_srcdir)/qt4/src \
-I$(top_srcdir)/qt \
$(FONTCONFIG_CFLAGS) \
$(POPPLER_QT4_CXXFLAGS) \
$(POPPLER_QTTEST_CXXFLAGS)
$(POPPLER_QT4_CFLAGS)
LDADDS = \
$(top_builddir)/poppler/libpoppler.la \
......@@ -13,8 +12,6 @@ LDADDS = \
$(FONTCONFIG_LIBS) \
$(POPPLER_QT4_LIBS)
UT_LDADDS = $(LDADDS) $(POPPLER_QTTEST_LIBS)
SUFFIXES: .moc
.cpp.moc:
......@@ -52,7 +49,7 @@ stress_poppler_qt4_SOURCES = \
stress_poppler_qt4_LDADD = $(LDADDS)
if BUILD_POPPLER_QT4TESTS
if BUILD_POPPLER_QT4
TESTS = \
check_attachments \
check_dateConversion \
......@@ -66,31 +63,31 @@ check_PROGRAMS = $(TESTS)
check_attachments_SOURCES = check_attachments.cpp
check_attachments.$(OBJEXT): check_attachments.moc
check_attachments_LDADD = $(UT_LDADDS)
check_attachments_LDADD = $(LDADDS)
check_dateConversion_SOURCES = check_dateConversion.cpp
check_dateConversion.$(OBJEXT): check_dateConversion.moc
check_dateConversion_LDADD = $(UT_LDADDS)
check_dateConversion_LDADD = $(LDADDS)
check_fonts_SOURCES = check_fonts.cpp
check_fonts.$(OBJEXT): check_fonts.moc
check_fonts_LDADD = $(UT_LDADDS)
check_fonts_LDADD = $(LDADDS)
check_metadata_SOURCES = check_metadata.cpp
check_metadata.$(OBJEXT): check_metadata.moc
check_metadata_LDADD = $(UT_LDADDS)
check_metadata_LDADD = $(LDADDS)
check_pagemode_SOURCES = check_pagemode.cpp
check_pagemode.$(OBJEXT): check_pagemode.moc
check_pagemode_LDADD = $(UT_LDADDS)
check_pagemode_LDADD = $(LDADDS)
check_permissions_SOURCES = check_permissions.cpp
check_permissions.$(OBJEXT): check_permissions.moc
check_permissions_LDADD = $(UT_LDADDS)
check_permissions_LDADD = $(LDADDS)
check_pagelayout_SOURCES = check_pagelayout.cpp
check_pagelayout.$(OBJEXT): check_pagelayout.moc
check_pagelayout_LDADD = $(UT_LDADDS)
check_pagelayout_LDADD = $(LDADDS)
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment