2 dnl Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program; if not, write to the Free Software
15 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 dnl ~{rob@ute} pts/8> QtCore QtSvg Qtnetwork QtXml
19 dnl QtCore: Command not found.
20 dnl ~{rob@ute} pts/8> -L/home/rob/projects/gnu/i686-pc-linux-gnulibc1/qtopia/lib -lQtSvg -L/home/rob/projects/gnu/i686-pc-linux-gnulibc1/qtopia/qtopiacore/target/lib -lQtSql -lQtXml -lQtGui -lpng -lQtNetwork -lQtCore -lz -lm -lrt -ldl -lpthread -lqtopiabase -lqtopia -lmd5 -lqtopia-sqlite -lqtopiasecurity -Wl,-rpath,/usr/local/qtopia-prefix/lib
21 dnl -L/home/rob/projects/gnu/i686-pc-linux-gnulibc1/qtopia/lib: Command not found.
23 AC_DEFUN([GNASH_PATH_QTOPIA],
27 gnash_qtopia_version=0
29 dnl the list of Qtopia headers we need
30 dnl Look for the header
31 AC_ARG_WITH(qtopia, AC_HELP_STRING([--with-qtopia], [directory where Qtopia is installed]), with_qtopia=${withval})
32 AC_CACHE_VAL(ac_cv_path_qtopia_incl,[
33 if test x"${with_qtopia}" != x ; then
34 if test -f ${with_qtopia}/include/qtopiamail/qtopiamail.h ; then
35 gnash_qtopia_topdir="${with_qtopia}"
36 ac_cv_path_qtopia_incl="-I`(cd ${with_qtopia}/include; pwd)`"
37 gnash_qtopia_version=4
39 gnash_qtopia_topdir="${with_qtopia}"
40 if test -f ${with_qtopia}/include/qtopia/mail/qtopiamail.h ; then
41 ac_cv_path_qtopia_incl="-I`(cd ${with_qtopia}/include; pwd)`"
42 gnash_qtopia_version=2
44 AC_MSG_ERROR([${with_qtopia} directory doesn't contain Qtopia headers])
47 if test -f ${with_qtopia}/lib/libqtopiamail.a -o -f ${with_qtopia}/lib/libqtopiamail.${shlibext}; then
48 ac_cv_path_qtopia_lib="-L`(cd ${with_qtopia}/lib; pwd)`"
50 AC_MSG_ERROR([${with_qtopia}/lib directory doesn't contain Qtopia libraries])
56 if test x"${QPEDIR}" != x; then
57 gnash_qtopia_topdir=$QPEDIR
59 if test x"${gnash_qtopia_topdir}" = x; then
60 AC_MSG_ERROR([QPEDIR must be set in your shell environment or use --with-qtopia=])
64 if test x"${ac_cv_path_qtopia_incl}" = x; then
65 dnl Attempt to find the top level directory, which unfortunately
66 dnl has a x version number attached. At least on Debain based
67 dnl systems, this doesn't seem to get a directory that is
69 if test x"${gnash_qtopia_version}" = x; then
70 AC_MSG_CHECKING([for libqtopia header])
71 if test -f ${gnash_qtopia_topdir}/include/qtopiamail/qtopiamail.h ; then
72 ac_cv_path_qtopia_incl="-I`(cd ${gnash_qtopia_topdir}/include; pwd)`"
73 gnash_qtopia_version=4
75 if test -f ${gnash_qtopia_topdir}/include/qtopia/mail/qtopiamail.h ; then
76 ac_cv_path_qtopia_incl="-I`(cd ${gnash_qtopia_topdir}/include; pwd)`"
77 gnash_qtopia_version=2
79 AC_MSG_ERROR([${gnash_qtopia_topdir} directory doesn't contain qtopia])
82 AC_MSG_RESULT(${ac_cv_path_qtopia_incl})
83 fi dnl end of gnash_qtopia_version
84 fi dnl end of ac_cv_path_qtopia_incl
86 AC_MSG_CHECKING([for the Qtopia Version])
87 AC_MSG_RESULT(${gnash_qtopia_version})
89 dnl this a sanity check for Qtopia 2
90 AC_MSG_CHECKING([Sanity checking the Qtopia header installation])
91 qt_headers="qmainwindow.h qmenubar.h qpopupmenu.h qapplication.h"
92 if test ${gnash_qtopia_version} -eq 2; then
93 if test x"${ac_cv_path_qtopia_incl}" != x; then
94 for i in $qt_headers; do
95 if ! test -f ${gnash_qtopia_topdir}/include/$i; then
96 AC_MSG_WARN([${gnash_qtopia_topdir}/include/$i not found!])
103 dnl this a sanity check for Qtopia 4
104 qt_headers="QtXml QtGui QtCore QtNetwork QtSql"
105 if test ${gnash_qtopia_version} -eq 4; then
106 if test x"${ac_cv_path_qtopia_incl}" != x; then
107 for i in $qt_headers; do
108 if ! test -d ${gnash_qtopia_topdir}/qtopiacore/target/include/$i; then
109 AC_MSG_WARN([${gnash_qtopia_topdir}/qtopiacore/target/include/$i not found!])
116 if test x"${qtopia_nogo}" = xyes; then
117 AC_MSG_ERROR([Broken Qtopia header installation!])
119 AC_MSG_RESULT([fine])
122 if test ${gnash_qtopia_version} -eq 0; then
125 AC_MSG_RESULT([${gnash_qtopia_version}])
128 dnl the list of Qtopia libs we need
129 qt_libs="qtopiabase qtopia qpe qt"
131 if test x"${ac_cv_path_qtopia_lib}" = x; then
132 if test x"${ac_cv_path_qtopia_lib}" = x; then
133 AC_MSG_CHECKING([for libqtopia library])
134 if test -f $gnash_qtopia_topdir/lib/libqpe.a -o -f $gnash_qtopia_topdir/lib/libqpe.${shlibext}; then
135 if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
136 ac_cv_path_qtopia_lib="-L$gnash_qtopia_topdir/lib -lqpe"
139 ac_cv_path_qtopia_lib="-lqpe"
144 AC_MSG_RESULT(${ac_cv_path_qtopia_lib})
147 AC_MSG_CHECKING([Sanity checking the Qtopia installation])
148 dnl this a sanity check for Qtopia 2
149 qt_libs="libqtopia libqpe"
150 if test ${gnash_qtopia_version} -eq 2; then
151 AC_DEFINE([GNASH_QTOPIA_VERSION], 2, [The Qtopia version])
152 if test x"${ac_cv_path_qtopia_lib}" != x; then
153 for i in $qt_libs; do
154 if ! test -f ${gnash_qtopia_topdir}/lib/$i.${shlibext}; then
155 AC_MSG_WARN([${gnash_qtopia_topdir}/lib/$i.${shlibext} not found!])
162 dnl this a sanity check for Qtopia 4
163 qt_libs="libqtopia libqtopiabase"
164 if test ${gnash_qtopia_version} -eq 4; then
165 AC_DEFINE([GNASH_QTOPIA_VERSION], 4, [The Qtopia version])
166 gnash_qtopia_version=`dirname ${gnash_qtopia_topdir}`
167 if test x"${ac_cv_path_qtopia_lib}" != x; then
168 for i in $qt_libs; do
169 if ! test -f ${gnash_qtopia_topdir}/lib/$i.${shlibext}; then
170 AC_MSG_WARN([${gnash_qtopia_topdir}/lib/$i${shlibext} not found!])
176 if test x"${qtopia_nogo}" = xyes; then
177 AC_MSG_ERROR([Broken Qtopia library installation!])
179 AC_MSG_RESULT([fine])
182 if test x"${ac_cv_path_qtopia_lib}" = x; then
183 AC_CHECK_LIB(qtopia-${gnash_qtopia_version}, qtopia_engine_shape_class_init, [ac_cv_path_qtopia_lib="-lqtopia"])
186 if test x"${ac_cv_path_qtopia_incl}" != x; then
187 QTOPIA_CFLAGS="${ac_cv_path_qtopia_incl}"
192 if test x"${ac_cv_path_qtopia_lib}" != x; then
193 QTOPIA_LIBS="${ac_cv_path_qtopia_lib}"
194 AC_DEFINE(HAVE_QTOPIA, 1, [has the Qtopia framework])
200 AC_SUBST(QTOPIA_CFLAGS)
201 AC_SUBST(QTOPIA_LIBS)
207 # indent-tabs-mode: nil