CVSROOT: /sources/gnash Module name: gnash Changes by: Rob Savoye <rsavoye> 07/11/28 22:28:54
Modified files: . : configure.ac ChangeLog macros : qtopia.m4 kde.m4 Added files: macros : qt.m4 Log message: * macros/qt.m4: New file. originally pulled from kde.m4, but then modified heavily to use QTDIR correctly, and to handle multiple differing versions of QT APIs. For now the default is to use Qt3 instead of Qt4. * macros/kde.m4: QT stuff moved to it;'s own file. * macros/qtopia.m4: Change how the version and topdir get set based on now correctly handling QPEDIR. * configure.ac: Add Automake conditrional for cross compiling. Add more Automake conditionals for the different QT versions. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.444&r2=1.445 http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4999&r2=1.5000 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/qtopia.m4?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/kde.m4?cvsroot=gnash&r1=1.41&r2=1.42 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/qt.m4?cvsroot=gnash&rev=1.1 Patches: Index: configure.ac =================================================================== RCS file: /sources/gnash/gnash/configure.ac,v retrieving revision 1.444 retrieving revision 1.445 diff -u -b -r1.444 -r1.445 --- configure.ac 28 Nov 2007 08:26:17 -0000 1.444 +++ configure.ac 28 Nov 2007 22:28:52 -0000 1.445 @@ -15,7 +15,7 @@ dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl -dnl $Id: configure.ac,v 1.444 2007/11/28 08:26:17 strk Exp $ +dnl $Id: configure.ac,v 1.445 2007/11/28 22:28:52 rsavoye Exp $ AC_PREREQ(2.50) AC_INIT(gnash, cvs) @@ -696,6 +696,8 @@ export pathlist=$PATH fi +AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ]) + dnl Check for PKG_CONFIG before any GNASH_PATH call PKG_PROG_PKG_CONFIG @@ -889,7 +891,7 @@ AC_CHECK_LIB(m, trunc, AC_DEFINE(HAVE_TRUNC, 1, [Has trunc()])) dnl don't look for X11 when using a raw framebuffer for the GUI -if test x$build_gtk = xyes -o x$build_kde = xyes -o x$build_fltk = xyes -o x$build_sdl = xyes; then +if ! test x$build_fb = xyes; then dnl AC_PATH_XTRA dnl AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation) dnl AC_CHECK_LIB(gmp, _gmp_get_memory_functions) @@ -1129,6 +1131,10 @@ AM_CONDITIONAL(HAVE_QT, [test x$has_qt = xyes]) AM_CONDITIONAL(HAVE_QTOPIA, [test x$has_qtopia = xyes]) +AM_CONDITIONAL(HAVE_QT_2, [test $gnash_qt_version -eq 2]) +AM_CONDITIONAL(HAVE_QT_3, [test $gnash_qt_version -eq 3]) +AM_CONDITIONAL(HAVE_QT_4, [test $gnash_qt_version -eq 4]) + dnl Need GLIB for both GTK and GST if test x$build_gtk = xyes -o x${media_handler} = "xgst"; then GNASH_PATH_GLIB Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4999 retrieving revision 1.5000 diff -u -b -r1.4999 -r1.5000 --- ChangeLog 28 Nov 2007 22:27:47 -0000 1.4999 +++ ChangeLog 28 Nov 2007 22:28:53 -0000 1.5000 @@ -1,3 +1,15 @@ +2007-11-28 Rob Savoye <[EMAIL PROTECTED]> + + * macros/qt.m4: New file. originally pulled from kde.m4, but then + modified heavily to use QTDIR correctly, and to handle multiple + differing versions of QT APIs. For now the default is to use Qt3 + instead of Qt4. + * macros/kde.m4: QT stuff moved to it;'s own file. + * macros/qtopia.m4: Change how the version and topdir get set + based on now correctly handling QPEDIR. + * configure.ac: Add Automake conditrional for cross compiling. Add + more Automake conditionals for the different QT versions. + 2007-11-28 Markus Gothe <[EMAIL PROTECTED]> * backend/render_handler_ogl.cpp: boost::ref(this) -> *this. Index: macros/qtopia.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/qtopia.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- macros/qtopia.m4 28 Nov 2007 03:34:27 -0000 1.1 +++ macros/qtopia.m4 28 Nov 2007 22:28:53 -0000 1.2 @@ -14,7 +14,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -dnl $Id: qtopia.m4,v 1.1 2007/11/28 03:34:27 rsavoye Exp $ +dnl $Id: qtopia.m4,v 1.2 2007/11/28 22:28:53 rsavoye Exp $ dnl [EMAIL PROTECTED] pts/8> QtCore QtSvg Qtnetwork QtXml dnl QtCore: Command not found. @@ -27,72 +27,72 @@ has_qtopia=no dnl the list of Qtopia headers we need dnl Look for the header - AC_ARG_WITH(qtopia_incl, AC_HELP_STRING([--with-qtopia-incl], [directory where libqtopia header is]), with_qtopia_incl=${withval}) + AC_ARG_WITH(qtopia, AC_HELP_STRING([--with-qtopia], [directory where Qtopia is installed]), with_qtopia=${withval}) AC_CACHE_VAL(ac_cv_path_qtopia_incl,[ - if test x"${with_qtopia_incl}" != x ; then - if test -f ${with_qtopia_incl}/qtopiamail/qtopiamail.h ; then - gnash_qtopia_topdir="${with_qtopia_incl}" - ac_cv_path_qtopia_incl="-I`(cd ${with_qtopia_incl}; pwd)`" + if test x"${with_qtopia}" != x ; then + if test -f ${with_qtopia}/include/qtopiamail/qtopiamail.h ; then + gnash_qtopia_topdir="${with_qtopia}" + ac_cv_path_qtopia_incl="-I`(cd ${with_qtopia}/include; pwd)`" gnash_qtopia_version=4 else - gnash_qtopia_topdir="${with_qtopia_incl}" - if test -f ${with_qtopia_incl}/qtopia/mail/qtopiamail.h ; then - ac_cv_path_qtopia_incl="-I`(cd ${with_qtopia_incl}; pwd)`" + gnash_qtopia_topdir="${with_qtopia}" + if test -f ${with_qtopia_incl}/include/qtopia/mail/qtopiamail.h ; then + ac_cv_path_qtopia_incl="-I`(cd ${with_qtopia}/include; pwd)`" gnash_qtopia_version=2 else - AC_MSG_ERROR([${with_qtopia_incl} directory doesn't contain qtopiamail.h]) + AC_MSG_ERROR([${with_qtopia} directory doesn't contain Qtopia headers]) fi fi - fi - ]) - - if test x"${ac_cv_path_qtopia_incl}" = x; then - if test x$cross_compiling = xno; then - if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_qtopia_incl}" = x; then - $PKG_CONFIG --exists qt-mt && ac_cv_path_qtopia_incl="`$PKG_CONFIG --cflags-only-I qt-mt | cut -d ' ' -f 1`" + if test -f ${with_qtopia}/lib/libqtopiamail.a -o -f ${with_qtopia}/lib/libqtopiamail.${shlibext}; then + ac_cv_path_qtopia_lib="-L`(cd ${with_qtopia_lib}/lib; pwd)`" + else + AC_MSG_ERROR([${with_qtopia}/lib directory doesn't contain Qtopia libraries]) fi fi + ]) - dnl Attempt to find the top level directory, which unfortunately has a - dnl version number attached. At least on Debain based systems, this - dnl doesn't seem to get a directory that is unversioned. - - AC_MSG_CHECKING([for the Qtopia Version]) - if test x$cross_compiling = xno; then - if test x"$PKG_CONFIG" != x; then - $PKG_CONFIG --exists qtopia-1 && gnash_qtopia_version="`$PKG_CONFIG --modversion qtopia-1 | cut -d '.' -f 1`" + if test x$QPEDIR != x; then + gnash_qtopia_topdir=$QPEDIR + else + if test x $gnash_qtopia_topdir = x; then + AC_MSG_ERROR([QPEDIR must be set in your shell environment or use --with-qtopia=]) fi fi + if test x"${ac_cv_path_qtopia_incl}" = x; then + dnl Attempt to find the top level directory, which unfortunately + dnl has a x version number attached. At least on Debain based + dnl systems, this doesn't seem to get a directory that is + dnl unversioned. if test x"${gnash_qtopia_version}" = x; then - gnash_qtopia_topdir="" - gnash_qtopia_version="" - for i in $incllist; do - for j in `ls -dr $i/qtopia-[[0-9]] 2>/dev/null`; do - if test -f $j/qtopia/qtopia-program.h; then - gnash_qtopia_topdir="`basename $j`" - gnash_qtopia_version="`echo ${gnash_qtopia_topdir} | sed -e 's:qtopia-::'`" - ac_cv_path_qtopia_incl="-I$i/${gnash_qtopia_topdir}" - break - fi - done - if test x$gnash_qtopia_version != x; then - break; + AC_MSG_CHECKING([for libqtopia header]) + if test -f ${gnash_qtopia_topdir}/include/qtopiamail/qtopiamail.h ; then + ac_cv_path_qtopia_incl="-I`(cd ${gnash_qtopia_topdir}/include; pwd)`" + gnash_qtopia_version=4 + else + if test -f ${gnash_qtopia_topdir}/include/qtopia/mail/qtopiamail.h ; then + ac_cv_path_qtopia_incl="-I`(cd ${gnash_qtopia_topdir}/include; pwd)`" + gnash_qtopia_version=2 + else + AC_MSG_ERROR([${gnash_qtopia_topdir} directory doesn't contain qtopia]) fi - done fi - fi dnl end of ${ac_cv_path_qtopia_incl} + AC_MSG_RESULT(${ac_cv_path_qtopia_incl}) + fi dnl end of gnash_qtopia_version + fi dnl end of ac_cv_path_qtopia_incl + + AC_MSG_CHECKING([for the Qtopia Version]) + AC_MSG_RESULT(${gnash_qtopia_version}) dnl this a sanity check for Qtopia 2 AC_MSG_CHECKING([Sanity checking the Qtopia header installation]) - qt_headers="qpen.h qpixmap.h" + qt_headers="qmainwindow.h qmenubar.h qpopupmenu.h qapplication.h" if test $gnash_qtopia_version -eq 2; then - gnash_qtopia_topdir=`dirname ${gnash_qtopia_topdir}` if test x"${ac_cv_path_qtopia_incl}" != x; then for i in $qt_headers; do if ! test -f ${gnash_qtopia_topdir}/include/$i; then - AC_MSG_WARN([$i not found!]) + AC_MSG_WARN([${gnash_qtopia_topdir}/include/$i not found!]) qtopia_nogo=yes fi done @@ -102,11 +102,10 @@ dnl this a sanity check for Qtopia 4 qt_headers="QtXml QtGui QtCore" if test $gnash_qtopia_version -eq 4; then - gnash_qtopia_topdir=`dirname ${gnash_qtopia_topdir}` if test x"${ac_cv_path_qtopia_incl}" != x; then for i in $qt_headers; do - if ! test -f ${gnash_qtopia_topdir}/qtopiacore/target/include/Qt/$i; then - AC_MSG_WARN([$i not found!]) + if ! test -d ${gnash_qtopia_topdir}/qtopiacore/target/include/$i; then + AC_MSG_WARN([${gnash_qtopia_topdir}/qtopiacore/target/include/$i not found!]) qtopia_nogo=yes fi done @@ -125,58 +124,34 @@ AC_MSG_RESULT([${gnash_qtopia_version}]) fi - AC_MSG_CHECKING([for libqtopia header]) - AC_MSG_RESULT(${ac_cv_path_qtopia_incl}) - dnl the list of Qtopia libs we need qt_libs="qtopiabase qtopia md5 qtopia-sqlite qtopiasecurity" - dnl Look for the library - AC_ARG_WITH(qtopia_lib, AC_HELP_STRING([--with-qtopia-lib], [directory where qtopia library is]), with_qtopia_lib=${withval}) - AC_CACHE_VAL(ac_cv_path_qtopia_lib,[ - if test x"${with_qtopia_lib}" != x ; then - if test -f ${with_qtopia_lib}/libqtopiamail.a -o -f ${with_qtopia_lib}/libqtopiamail.${shlibext}; then - ac_cv_path_qtopia_lib="-L`(cd ${with_qtopia_lib}; pwd)`" - else - AC_MSG_ERROR([${with_qtopia_lib} directory doesn't contain libqtopiaqtopia.]) - fi - fi - ]) - if test x"${ac_cv_path_qtopia_lib}" = x; then - if test x$cross_compiling = xno; then - if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_qtopia_lib}" = x; then - $PKG_CONFIG --exists qt-mt && ac_cv_path_qtopia_lib="`$PKG_CONFIG --libs-only-l qt-mt | cut -d ' ' -f 1`" - fi - fi - if test x"${ac_cv_path_qtopia_lib}" = x; then - for i in $libslist; do - if test -f $i/libqtopiamail.a -o -f $i/libqtopiamail.${shlibext}; then + AC_MSG_CHECKING([for libqtopia library]) + if test -f $gnash_qtopia_topdir/lib/libqtopiamail.a -o -f $gnash_qtopia_topdir/lib/libqtopiamail.${shlibext}; then if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then - ac_cv_path_qtopia_lib="-L$i -lqtopiamail" + ac_cv_path_qtopia_lib="-L$gnash_qtopia_topdir/lib -lqtopiamail" break else ac_cv_path_qtopia_lib="-lqtopiamail" break fi fi - done - else - qtopia_lib_path=`$PKG_CONFIG --libs-only-L qtopia` - if test ! $qtopia_lib_path = "-L/usr/lib" -o $qtopia_lib_path = "-L/usr/lib64"; then - ac_cv_path_qtopia_lib="${qtopia_lib_path} ${ac_cv_path_qtopia_lib}" - fi fi + AC_MSG_RESULT(${ac_cv_path_qtopia_lib}) fi + AC_MSG_CHECKING([Sanity checking the Qtopia installation]) dnl this a sanity check for Qtopia 2 - qt_libs="libqt libqtopia" + qt_libs="libqt libqtopia libqpe" if test $gnash_qtopia_version -eq 2; then + AC_DEFINE([GNASH_QTOPIA_VERSION], 2, [The Qtopia version]) if test x"${ac_cv_path_qtopia_lib}" != x; then for i in $qt_libs; do if ! test -f ${gnash_qtopia_topdir}/lib/$i.${shlibext}; then - AC_MSG_WARN([$i not found!]) + AC_MSG_WARN([${gnash_qtopia_topdir}/lib/$i.${shlibext} not found!]) qtopia_nogo=yes fi done @@ -184,13 +159,14 @@ fi dnl this a sanity check for Qtopia 4 - AC_MSG_CHECKING([Sanity checking the Qtopia installation]) qt_libs="libqtopia libqtopiabase" if test $gnash_qtopia_version -eq 4; then + AC_DEFINE([GNASH_QTOPIA_VERSION], 4, [The Qtopia version]) + gnash_qtopia_version=`dirname ${gnash_qtopia_topdir}` if test x"${ac_cv_path_qtopia_lib}" != x; then for i in $qt_libs; do if ! test -f ${gnash_qtopia_topdir}/lib/$i.${shlibext}; then - AC_MSG_WARN([$i not found!]) + AC_MSG_WARN([${gnash_qtopia_topdir}/lib/$i${shlibext} not found!]) qtopia_nogo=yes fi done @@ -202,13 +178,8 @@ AC_MSG_RESULT([fine]) fi - AC_DEFINE([QTOPIA_VERSION], [${gnash_qtopia_version}], [The Qtopia version]) - - AC_MSG_CHECKING([for libqtopia library]) - AC_MSG_RESULT(${ac_cv_path_qtopia_lib}) - if test x"${ac_cv_path_qtopia_lib}" = x; then - AC_CHECK_LIB(qtopia-${gnash_qtopia_version}, qtopia_engine_shape_class_init, [ac_cv_path_qtopia_lib="-lqtopia-${gnash_qtopia_version}"]) + AC_CHECK_LIB(qtopia-${gnash_qtopia_version}, qtopia_engine_shape_class_init, [ac_cv_path_qtopia_lib="-lqtopia"]) fi if test x"${ac_cv_path_qtopia_incl}" != x; then @@ -219,8 +190,8 @@ if test x"${ac_cv_path_qtopia_lib}" != x; then QTOPIA_LIBS="${ac_cv_path_qtopia_lib}" - AC_DEFINE(HAVE_QTOPIA, [1], [has the Qtopia framework]) - has_qtopia=yes + AC_DEFINE(HAVE_QTOPIA, 1, [has the Qtopia framework]) + has_qtopia="yes" else QTOPIA_LIBS="" fi Index: macros/kde.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/kde.m4,v retrieving revision 1.41 retrieving revision 1.42 diff -u -b -r1.41 -r1.42 --- macros/kde.m4 13 Oct 2007 23:24:08 -0000 1.41 +++ macros/kde.m4 28 Nov 2007 22:28:53 -0000 1.42 @@ -14,7 +14,6 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -dnl $Id: kde.m4,v 1.41 2007/10/13 23:24:08 rsavoye Exp $ AC_DEFUN([GNASH_PATH_KDE], [ @@ -153,115 +152,6 @@ AC_SUBST(KDE_LIBS) ]) -dnl Now look for QT as well -AC_DEFUN([GNASH_PATH_QT], -[ - dnl Lool for the header - AC_ARG_WITH(qt_incl, AC_HELP_STRING([--with-qt-incl], [directory where qt headers are]), with_qt_incl=${withval}) - AC_CACHE_VAL(ac_cv_path_qt_incl,[ - if test x"${with_qt_incl}" != x ; then - if test -f ${with_qt_incl}/qobject.h ; then - ac_cv_path_qt_incl="-I`(cd ${with_qt_incl}; pwd)`" - else - AC_MSG_ERROR([${with_qt_incl} directory doesn't contain any headers]) - fi - fi - ]) - - AC_MSG_CHECKING([for qt header]) - gnash_qt_topdir="" - gnash_qt_version="" - dnl QT stores it's headers in ../lib/qt-3.3/include for example, so use libslist - dnl instead of incllist - for i in $QTDIR $libslist $incllist; do - for j in $QTDIR `ls -dr $i/qt-[[0-9]].[[0-9]] 2>/dev/null`; do - if test -f $j/include/qobject.h; then - gnash_qt_topdir=$j - gnash_qt_version=`echo ${gnash_qt_topdir} | sed -e 's:qt-::'` - ac_cv_path_qt_incl="-I$j/include" - break - fi - done - - if test "x$gnash_qt_version" != x; then - break; - fi - done - -dnl On Debian the dir is /usr/include/qt3 with /usr/lib/libqt-mt.* -dnl so we set topdir to /usr so that $topdir/lib/libqt-mt.* works below, -dnl and version to 3 or whatever. -dnl incllist is inherited from configure.ac. - if test "x$gnash_qt_version" = x; then - for i in $incllist; do - for j in `ls -dr $i/qt[[0-9]] 2>/dev/null`; do - if test -f $j/qobject.h; then - gnash_qt_topdir=`echo "$i" | sed 's:/include::'` - gnash_qt_version=`echo "$j" | sed "s:$i/qt::"` - ac_cv_path_qt_incl="-I$j" - break - fi - done - if test x$gnash_qt_version != x; then - break; - fi - done - fi - - if test x"${ac_cv_path_qt_incl}" = x; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(${ac_cv_path_qt_incl}) - fi - - if test x"${ac_cv_path_qt_incl}" != x ; then - QT_CFLAGS="${ac_cv_path_qt_incl}" - else - QT_CFLAGS="" - fi - -dnl # QT_LIBS = -lqtui -lqtcore -lqtprint -L/usr/lib/qt-3.3/lib -lqt-mt - dnl Look for the libraries - AC_ARG_WITH(qt_lib, AC_HELP_STRING([--with-qt-lib], [directory where qt libraries are]), with_qt_lib=${withval}) - AC_CACHE_VAL(ac_cv_path_qt_lib, [ - if test x"${with_qt_lib}" != x ; then - if test `ls -C1 ${gnash_qt_topdir}/lib/libqt-mt.*| wc -l` -gt 0 ; then - ac_cv_path_qt_lib="-L`(cd ${with_qt_lib}; pwd)` -lqt-mt" - else - AC_MSG_ERROR([${with_qt_lib} directory doesn't contain qt libraries.]) - fi - fi - ]) - - if test x"${ac_cv_path_qt_lib}" = x; then - AC_MSG_CHECKING([for qt library]) - if test `ls -C1 ${gnash_qt_topdir}/lib/libqt-mt.*| wc -l` -gt 0 ; then - ac_cv_path_qt_lib="-L${gnash_qt_topdir}/lib -lqt-mt" - fi - if test x"${ac_cv_path_qt_lib}" != x; then - AC_MSG_RESULT(${gnash_qt_topdir}/lib/libqt-mt) - else - AC_MSG_RESULT(no) - fi - fi - - if test x"${ac_cv_path_qt_lib}" != x; then - QT_LIBS="${ac_cv_path_qt_lib}" - AC_DEFINE(HAVE_QT,1,[Have QT installed]) - has_qt="yes" - else - QT_LIBS="" - has_qt="no" - fi - - AC_PATH_PROG(MOC, moc, ,[${gnash_qt_topdir}/bin ${pathlist}]) - - AC_SUBST(MOC) - - AC_SUBST(QT_CFLAGS) - AC_SUBST(QT_LIBS) -]) - # Local Variables: # c-basic-offset: 2 # tab-width: 2 Index: macros/qt.m4 =================================================================== RCS file: macros/qt.m4 diff -N macros/qt.m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ macros/qt.m4 28 Nov 2007 22:28:53 -0000 1.1 @@ -0,0 +1,207 @@ +dnl +dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +dnl Configuing QT is a pain in the neck if you want to support all +dnl versions, as the layout of the API has changed significantly +dnl between Qt3 and Qt4. In Qt4, all the top level includes are in a +dnl 'Qt' subdirectory now. Since it's best for now to handle the path +dnl changes in the source files so we're concious of the changes, we +dnl set version flags in config.h and use Automake conditionals to +dnl force onebehaviour or the other. + +AC_DEFUN([GNASH_PATH_QT], +[ + gnash_qt_topdir="" + gnash_qt_version=0 + qt3support="" + + dnl Lool for the header + AC_ARG_WITH(qt_incl, AC_HELP_STRING([--with-qt-incl], [directory where qt headers are]), with_qt_incl=${withval}) + AC_CACHE_VAL(ac_cv_path_qt_incl,[ + if test x"${with_qt_incl}" != x ; then + if test -f ${with_qt_incl}/qobject.h ; then + ac_cv_path_qt_incl="-I`(cd ${with_qt_incl}; pwd)`" + else + AC_MSG_ERROR([${with_qt_incl} directory doesn't contain any headers]) + fi + fi + ]) + + dnl if QTDIR is set, don't use pkg-config, as it screws the flags + dnl up. Default to Qt3 for now. + qt_pkg="qt-mt" + if test x$QTDIR != x; then + if test -f $QTDIR/include/qobject.h; then + qt_pkg="qt-mt" + if test x`basename $QTDIR` = "qt3"; then + gnash_qt_version=3 + else + gnash_qt_version=4 + fi + else + qt_pkg="QtCore" + gnash_qt_version=4 + fi + fi + + if test x$cross_compiling = xno; then + if test x"$PKG_CONFIG" != x; then + gnash_qt_version="`$PKG_CONFIG --modversion $qt_pkg | cut -d '.' -f 1`" + fi + fi + + AC_MSG_CHECKING([for qt header]) + if test x$cross_compiling = xno; then + if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_qt_incl}" = x; then + $PKG_CONFIG --exists $qt_pkg && ac_cv_path_qt_incl="`$PKG_CONFIG --cflags-only-I $qt_pkg | cut -d ' ' -f 1`" + fi + fi + + dnl QT stores it's headers in ../lib/qt-3.3/include for example, so + dnl use libslist instead of incllist + if test x"${ac_cv_path_qt_incl}" = x; then + for i in $QTDIR $libslist $incllist; do + for j in $QTDIR `ls -dr $i/qt[[0-9]] 2>/dev/null`; do + if test -f $j/include/qobject.h; then + gnash_qt_topdir="$j" + if test $gnash_qt_version -eq 0; then + gnash_qt_version=2 + fi + ac_cv_path_qt_incl="-I$j/include" + break + else + if test -f $j/Qt/qobject.h; then + gnash_qt_topdir="$j" + if test $gnash_qt_version -eq 0; then + gnash_qt_version=4 + fi + ac_cv_path_qt_incl="-I$j/Qt" + fi + fi + done + if test "x$gnash_qt_topdir" != x; then + break; + fi + done + fi +dnl On Debian the dir is /usr/include/qt3 with /usr/lib/libqt-mt.* +dnl so we set topdir to /usr so that $topdir/lib/libqt-mt.* works below, +dnl and version to 3 or whatever. +dnl incllist is inherited from configure.ac. + if test "x$gnash_qt_version" = x; then + for i in $QTDIR $incllist; do + for j in $QTDIR `ls -dr $i/qt[[0-9]] 2>/dev/null`; do + if test -f $j/qobject.h -o -f $j/Qt/qobject.h; then +dnl gnash_qt_version=`echo "$j" | sed "s:$i/qt::"` + ac_cv_path_qt_incl="-I$j" + break + fi + done + if test x$gnash_qt_version != x; then + break; + fi + done + fi + + if test x"${ac_cv_path_qt_incl}" = x; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(${ac_cv_path_qt_incl}) + fi + + if test x"${ac_cv_path_qt_incl}" != x ; then + QT_CFLAGS="${ac_cv_path_qt_incl}" + else + QT_CFLAGS="" + fi + + if test x$gnash_qt_version != x; then + AC_MSG_NOTICE([QT version is $gnash_qt_version]) + dnl due to a weird problem with variable expansion, we have to use + dnl a case statement to set the QT version. + case $gnash_qt_version in + 2) + AC_DEFINE([GNASH_QT_VERSION], 2, [The Qtopia version]) + ;; + 3) + AC_DEFINE([GNASH_QT_VERSION], 3, [The Qtopia version]) + ;; + 4) + AC_DEFINE([GNASH_QT_VERSION], 4, [The Qtopia version]) + qt3support="-lqt3support" + ;; + esac + fi + +dnl # QT_LIBS = -lqtui -lqtcore -lqtprint -L/usr/lib/qt-3.3/lib -lqt-mt + dnl Look for the libraries + AC_ARG_WITH(qt_lib, AC_HELP_STRING([--with-qt-lib], [directory where qt libraries are]), with_qt_lib=${withval}) + AC_CACHE_VAL(ac_cv_path_qt_lib, [ + if test x"${with_qt_lib}" != x ; then + if test `ls -C1 ${gnash_qt_topdir}/lib/libqt-mt.*| wc -l` -gt 0 ; then + ac_cv_path_qt_lib="-L`(cd ${with_qt_lib}; pwd)` ${qt3support} -lqt-mt" + else + AC_MSG_ERROR([${with_qt_lib} directory doesn't contain qt libraries.]) + fi + fi + ]) + + if test x$cross_compiling = xno; then + if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_qt_lib}" = x; then + $PKG_CONFIG --exists $qt_pkg && ac_cv_path_qt_lib="`$PKG_CONFIG --libs-only-l $qt_pkg | cut -d ' ' -f 1`" + fi + fi + + if test x"${ac_cv_path_qt_lib}" = x; then + AC_MSG_CHECKING([for qt library]) + if test `ls -C1 ${gnash_qt_topdir}/lib/libqt*-mt.*| wc -l` -gt 0 ; then + dnl Qtopia (embedded QT) uses libqte-mt instead of libqt-mt + if test -f ${gnash_qt_topdir}/lib/libqte-mt.${shlibext}; then + ac_cv_path_qt_lib="-L${gnash_qt_topdir}/lib ${qt3support} -lqte-mt" + else + ac_cv_path_qt_lib="-L${gnash_qt_topdir}/lib ${qt3support} -lqt-mt" + fi + fi + if test x"${ac_cv_path_qt_lib}" != x; then + AC_MSG_RESULT(${ac_cv_path_qt_lib}) + else + AC_MSG_RESULT(none) + fi + fi + + if test x"${ac_cv_path_qt_lib}" != x; then + QT_LIBS="${ac_cv_path_qt_lib}" + AC_DEFINE(HAVE_QT,1,[Have QT installed]) + has_qt="yes" + else + QT_LIBS="" + has_qt="no" + fi + + AC_PATH_PROG(MOC, moc, ,[${gnash_qt_topdir}/bin ${pathlist}]) + + AC_SUBST(MOC) + + AC_SUBST(QT_CFLAGS) + AC_SUBST(QT_LIBS) +]) + + +# Local Variables: +# c-basic-offset: 2 +# tab-width: 2 +# indent-tabs-mode: nil +# End: _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit