Add automated test on delayed return value handling in ExternalInterface.call().
[gnash.git] / macros / kde3.m4
blob0b47509058dc3e0f5ee16d190732f7cd029201dc
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 dnl  2011 Free Software Foundation, Inc.
4 dnl  
5 dnl  This program is free software; you can redistribute it and/or modify
6 dnl  it under the terms of the GNU General Public License as published by
7 dnl  the Free Software Foundation; either version 3 of the License, or
8 dnl  (at your option) any later version.
9 dnl  
10 dnl  This program is distributed in the hope that it will be useful,
11 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl  GNU General Public License for more details.
14 dnl  You should have received a copy of the GNU General Public License
15 dnl  along with this program; if not, write to the Free Software
16 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 AC_DEFUN([GNASH_PATH_KDE3],
19
20   has_kde3=no
22   dnl setup the various options to custimize paths
23   AC_ARG_WITH(kde3_incl, AC_HELP_STRING([--with-kde3-incl],
24              [directory where KDE 3.x headers are]),
25              with_kde3_incl=${withval})
26   dnl make sure the path is a useable one
27   if test x"${with_kde3_incl}" != x ; then
28     if test ! -f ${with_kde3_incl}/qxembed.h ; then
29       AC_MSG_ERROR([${with_kde3_incl} directory doesn't contain qxembed.h headers])
30     fi
31   fi
33   AC_ARG_WITH(kde3_prefix, AC_HELP_STRING([--with-kde3-prefix],
34              [Prefix for KDE plugin, like /usr]),
35              with_kde3_prefix=${withval})
37   AC_ARG_WITH(kde3_lib, AC_HELP_STRING([--with-kde3-lib],
38              [directory where KDE 3.x libraries are]),
39              with_kde3_lib=${withval})
40   dnl make sure the path is a useable one
41   if test x"${with_kde3_lib}" != x ; then 
42     if test ! -f ${with_kde3_lib}/libkdeui.la; then
43       AC_MSG_ERROR([${with_kde3_lib} directory doesn't contain any KDE 3.x libraries!])
44     fi
45   fi
47   dnl Specifiy a custom directory for the kparts plugin
48   AC_ARG_WITH(kde3_plugindir, AC_HELP_STRING([--with-kde3-plugindir=DIR],
49              [Directory to install KDE 3.x plugin in]),
50              with_kde3_plugindir=${withval})
51   if test x"${with_kde3_plugindir}" != x ; then 
52     if test ! -d ${with_kde3_plugindir}/designer; then
53       AC_MSG_ERROR([${with_kde3_plugindir} directory doesn't contain any KDE 3.x plugins!])
54     fi
55   fi
57   dnl Specifiy a custom directory for the kde services directory
58   AC_ARG_WITH(kde3_servicesdir, AC_HELP_STRING([--with-kde3-servicesdir=DIR],
59              [Directory to install KDE 3.x plugin in]),
60              with_kde3_servicesdir=${withval})
61   if test x"${with_kde3_servicesdir}" != x ; then 
62     if test ! -d ${with_kde3_servicesdir}; then
63       AC_MSG_ERROR([${with_kde3_} directory doesn't contain any KDE 3.x plugins!])
64     fi
65   fi
67   AC_ARG_WITH(kde3-configdir, AC_HELP_STRING([--with-kde3-configdir=DIR],
68       [Directory to install KDE 3.x configfile in]),
69     [KDE3_CONFIGDIR=${withval}
70   ])
72   AC_ARG_WITH(kde3-appsdatadir, AC_HELP_STRING([--with-kde3-appsdatadir=DIR],
73       [Directory to install KDE 3.x data in]),
74     [KDE3_APPSDATADIR=${withval}
75   ])
77   dnl Look for the files necessary to build KDE 3.x applications
78     kde3_prefix=
79     AC_PATH_PROG(KDE3_CONFIG, kde-config, ,[${pathlist}])
80     if test "x$KDE3_CONFIG" != "x" ; then
81       kde3_prefix=`$KDE3_CONFIG --prefix`
82       AC_MSG_NOTICE([KDE3 prefix from kde-config is ${kde3_prefix}])
83     fi
85     AC_CACHE_VAL(ac_cv_path_kde3_incl,[
86       dnl if the user specified a path, sanity check it and then use it
87       if test x"${with_kde3_incl}" != x; then
88         if test -f ${with_kde3_incl}/qxembed.h; then
89           ac_cv_path_kde3_incl="-I`(cd ${with_kde3_incl}; pwd)`"
90         fi
91       fi
92       dnl if the user didn't specify a path, go search a list of
93       dnl likely directories for the header files.
94       if test x"${ac_cv_path_kde3_incl}" = x ; then
95         AC_MSG_CHECKING([for KDE 3.x header path])
96         dnl incllist is inherited from configure.ac, and lives in /macros
97         for i in ${kde3_prefix}/include ${incllist}; do 
98          if test -f $i/kde/qxembed.h; then
99             ac_cv_path_kde3_incl="-I$i/kde"
100             kde3_prefix=`dirname $i`
101             break
102           fi
103           if test -f $i/qxembed.h; then
104             ac_cv_path_kde3_incl="-I$i"
105             kde3_prefix=`dirname $i`
106             break
107           fi
108         done
109       fi
110       if test x"${ac_cv_path_kde3_incl}" != x ; then
111         AC_MSG_RESULT(${ac_cv_path_kde3_incl})
112       else
113         AC_MSG_RESULT(no)
114         if test x${cross_compiling} = xno; then
115           dnl if no headers have been found yet, make a last ditch
116           dnl attempt to use the compiler to find them.
117           AC_CHECK_HEADERS(kde/qxembed.h, [ac_cv_path_kde3_incl=""])
118         fi
119       fi
120     ])                  dnl end of cache ac_cv_path_kde3_incl
122     dnl Look for the libraries
123     AC_CACHE_VAL(ac_cv_path_kde3_lib, [
124       if test x"${with_kde3_lib}" != x ; then
125         if test -f ${with_kde3_lib}/libkdeui.la; then
126                 ac_cv_path_kde3_lib="-L`(cd ${with_kde3_lib}; pwd)`"
127         else
128                 AC_MSG_ERROR([${with_kde3_lib} directory doesn't contain KDE 3.x libraries.])
129         fi
130       fi
131       if test x"${ac_cv_path_kde3_lib}" = x; then
132         AC_MSG_CHECKING([for kdeui library])
133         kde3_topdir=
134         for i in ${kde3_prefix}/lib64 ${kde3_prefix}/lib $libslist ; do
135           if test -f $i/libkdeui.${shlibext} -o -f $i/libkdeui.la; then
136             kde3_topdir=$i
137             AC_MSG_RESULT(${kde3_topdir}/libkdeui)
138                   if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
139                     ac_cv_path_kde3_lib="-L$i -lkdeui"
140               break
141             else
142                     ac_cv_path_kde3_lib="-lkdeui"
143                     break
144             fi
145           fi
146         done
147       fi
148       dnl Look for the kdecore library, which is required
149       if test x"${ac_cv_path_kde3_lib}" != x; then
150         AC_MSG_CHECKING([for kdecore library])
151         if test -f ${kde3_topdir}/libkdecore.la; then
152           ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} -lkdecore"
153           AC_MSG_RESULT(${kde3_topdir}/libkdecore)
154         else
155          AC_MSG_RESULT(no)
156         fi
157       fi
158       dnl Look for the kdeprint library, which is required
159       AC_MSG_CHECKING([for kdeprint library])
160       if test x"${libkdeprint}" = x; then
161         if test -f ${kde3_topdir}/libkdeprint.la -o -f ${kde3_topdir}/libkdeprint.${shlibext}; then
162           ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} -lkdeprint"
163           AC_MSG_RESULT(${kde3_topdir}/libkdeprint)
164         else
165           AC_MSG_RESULT(no)
166         fi
167       else
168         AC_MSG_RESULT(${libkdeprint})
169         ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} ${libkdeprint}"
170       fi        
171     ])                  dnl end of cache ac_cv_path_kde3_lib
173   KLASH_PLUGIN=
174   
175   dnl If building the kparts plugin, get the install paths correct.  
176     AC_CACHE_VAL(ac_cv_path_kde3_prefix,[
177       dnl if the user specified a path, sanity check it and then use it
178       if test x"${with_kde3_prefix}" != x; then
179           ac_cv_path_kde3_prefix="`(cd ${with_kde3_prefix}; pwd)`"
180       fi
181     ])                  dnl end of cache ac_cv_path_kde3_prefix
183     KDE3_PREFIX="${ac_cv_path_kde3_prefix}"
184     if test x"${PLUGINS_INSTALL_POLICY}" != x; then
185       case "${PLUGINS_INSTALL_POLICY}" in
186         user)
187           KDE3_PREFIX=${HOME}/.kde
188           ;;
189         system)
190           KDE3_PREFIX="${kde3_prefix}"
191           ;;
192         prefix)
193                 KDE3_PREFIX="\${prefix}"
194           ;;
195       esac
196     fi
198     KDE3_PLUGINDIR="${KDE3_PREFIX}/lib/kde3"
199     KDE3_SERVICESDIR="${KDE3_PREFIX}/share/services"
200     KDE3_CONFIGDIR="${KDE3_PREFIX}/share/config"
201     KDE3_APPSDATADIR="${KDE3_PREFIX}/share/apps/klash"
203   if test x"${ac_cv_path_kde3_incl}" != x ; then
204     if test x"${ac_cv_path_kde3_incl}" != x"-I/usr/include"; then
205       KDE3_CFLAGS="${ac_cv_path_kde3_incl}"
206     else
207       KDE3_CFLAGS=""
208     fi
209   else
210     KDE3_CFLAGS=""
211   fi
213   if test x"${ac_cv_path_kde3_lib}" != x; then
214     KDE3_LIBS="${ac_cv_path_kde3_lib}"
215     AC_DEFINE(HAVE_KDE3, 1,[Have KDE 3.x installed])
216     has_kde3=yes
217   else
218     KDE3_LIBS=""
219     has_kde3=no
220   fi
222   AC_SUBST(KLASH_PLUGIN)
223   AC_SUBST(KDE3_CFLAGS)  
224   AC_SUBST(KDE3_LIBS)
226   AC_SUBST(KDE3_PLUGINDIR)
227   AC_SUBST(KDE3_SERVICESDIR)
228   AC_SUBST(KDE3_CONFIGDIR)
229   AC_SUBST(KDE3_APPSDATADIR)
232 # Local Variables:
233 # c-basic-offset: 2
234 # tab-width: 2
235 # indent-tabs-mode: nil
236 # End: