Do not log an error for missing Video info in DefineVideo, as that's fine when Vide...
[gnash.git] / macros / kde3.m4
blob3ce79e8307d4e57ae00d3d6efd839620d695b760
1 dnl  
2 dnl    Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
3 dnl  
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.
8 dnl  
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
17 AC_DEFUN([GNASH_PATH_KDE3],
18
19   has_kde3=no
21   dnl setup the various options to custimize paths
22   AC_ARG_WITH(kde3_incl, AC_HELP_STRING([--with-kde3-incl],
23              [directory where KDE 3.x headers are]),
24              with_kde3_incl=${withval})
25   dnl make sure the path is a useable one
26   if test x"${with_kde3_incl}" != x ; then
27     if test ! -f ${with_kde3_incl}/kapp.h ; then
28       AC_MSG_ERROR([${with_kde3_incl} directory doesn't contain any KDE 3.x headers])
29     fi
30   fi
32   AC_ARG_WITH(kde3_prefix, AC_HELP_STRING([--with-kde3-prefix],
33              [Prefix for KDE plugin, like /usr]),
34              with_kde3_prefix=${withval})
36   AC_ARG_WITH(kde3_lib, AC_HELP_STRING([--with-kde3-lib],
37              [directory where KDE 3.x libraries are]),
38              with_kde3_lib=${withval})
39   dnl make sure the path is a useable one
40   if test x"${with_kde3_lib}" != x ; then 
41     if test ! -f ${with_kde3_lib}/libkdeui.la; then
42       AC_MSG_ERROR([${with_kde3_lib} directory doesn't contain any KDE 3.x libraries!])
43     fi
44   fi
46   dnl Specifiy a custom directory for the kparts plugin
47   AC_ARG_WITH(kde3_plugindir, AC_HELP_STRING([--with-kde3-plugindir=DIR],
48              [Directory to install KDE 3.x plugin in]),
49              with_kde3_plugindir=${withval})
50   if test x"${with_kde3_plugindir}" != x ; then 
51     if test ! -d ${with_kde3_plugindir}/designer; then
52       AC_MSG_ERROR([${with_kde3_plugindir} directory doesn't contain any KDE 3.x plugins!])
53     fi
54   fi
56   dnl Specifiy a custom directory for the kde services directory
57   AC_ARG_WITH(kde3_servicesdir, AC_HELP_STRING([--with-kde3-servicesdir=DIR],
58              [Directory to install KDE 3.x plugin in]),
59              with_kde3_servicesdir=${withval})
60   if test x"${with_kde3_servicesdir}" != x ; then 
61     if test ! -d ${with_kde3_servicesdir}; then
62       AC_MSG_ERROR([${with_kde3_} directory doesn't contain any KDE 3.x plugins!])
63     fi
64   fi
66   AC_ARG_WITH(kde3-configdir, AC_HELP_STRING([--with-kde3-configdir=DIR],
67       [Directory to install KDE 3.x configfile in]),
68     [KDE3_CONFIGDIR=${withval}
69   ])
71   AC_ARG_WITH(kde3-appsdatadir, AC_HELP_STRING([--with-kde3-appsdatadir=DIR],
72       [Directory to install KDE 3.x data in]),
73     [KDE3_APPSDATADIR=${withval}
74   ])
76   dnl Look for the files necessary to build KDE 3.x applications
77   if test x"${build_kde3}" = xyes; then
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}/kapp.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/kapplication.h; then
99             ac_cv_path_kde3_incl="-I$i/kde"
100             kde3_prefix=`dirname $i`
101             if test ! -f $i/kde/qxembed.h -a x"${build_kde4}" = x"no"; then
102               AC_MSG_ERROR([You specified building kde3, but you have kde4 installed!])
103               break
104             fi
105             break
106           fi
107           if test -f $i/kapplication.h; then
108             ac_cv_path_kde3_incl="-I$i"
109             kde3_prefix=`dirname $i`
110             if test ! -f $i/qxembed.h -a x"${build_kde4}" = x"no"; then
111               AC_MSG_ERROR([You specified building kde3, but you have kde4 installed!])
112               break
113             fi
114             break
115           fi
116         done
117       fi
118       if test x"${ac_cv_path_kde3_incl}" != x ; then
119         AC_MSG_RESULT(${ac_cv_path_kde3_incl})
120       else
121         AC_MSG_RESULT(no)
122         if test x${cross_compiling} = xno; then
123           dnl if no headers have been found yet, make a last ditch
124           dnl attempt to use the compiler to find them.
125           AC_CHECK_HEADERS(kde/kapplication.h, [ac_cv_path_kde3_incl=""])
126         fi
127       fi
128     ])                  dnl end of cache ac_cv_path_kde3_incl
130     dnl Look for the libraries
131     AC_CACHE_VAL(ac_cv_path_kde3_lib, [
132       if test x"${with_kde3_lib}" != x ; then
133         if test -f ${with_kde3_lib}/libkdeui.la; then
134                 ac_cv_path_kde3_lib="-L`(cd ${with_kde3_lib}; pwd)`"
135         else
136                 AC_MSG_ERROR([${with_kde3_lib} directory doesn't contain KDE 3.x libraries.])
137         fi
138       fi
139       if test x"${ac_cv_path_kde3_lib}" = x; then
140         AC_MSG_CHECKING([for kdeui library])
141         kde3_topdir=
142         for i in ${kde3_prefix}/lib64 ${kde3_prefix}/lib $libslist ; do
143           if test -f $i/libkdeui.${shlibext} -o -f $i/libkdeui.la; then
144             kde3_topdir=$i
145             AC_MSG_RESULT(${kde3_topdir}/libkdeui)
146                   if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
147                     ac_cv_path_kde3_lib="-L$i -lkdeui"
148               break
149             else
150                     ac_cv_path_kde3_lib="-lkdeui"
151                     break
152             fi
153           fi
154         done
155       fi
156       dnl Look for the kdecore library, which is required
157       if test x"${ac_cv_path_kde3_lib}" != x; then
158         AC_MSG_CHECKING([for kdecore library])
159         if test -f ${kde3_topdir}/libkdecore.la; then
160           ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} -lkdecore"
161           AC_MSG_RESULT(${kde3_topdir}/libkdecore)
162         else
163          AC_MSG_RESULT(no)
164         fi
165       fi
166       dnl Look for the kdeprint library, which is required
167       AC_MSG_CHECKING([for kdeprint library])
168       if test x"${libkdeprint}" = x; then
169         if test -f ${kde3_topdir}/libkdeprint.la -o -f ${kde3_topdir}/libkdeprint.${shlibext}; then
170           ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} -lkdeprint"
171           AC_MSG_RESULT(${kde3_topdir}/libkdeprint)
172         else
173           AC_MSG_RESULT(no)
174         fi
175       else
176         AC_MSG_RESULT(${libkdeprint})
177         ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} ${libkdeprint}"
178       fi        
179     ])                  dnl end of cache ac_cv_path_kde3_lib
180   fi                    dnl end of build_kde3
182   KLASH_PLUGIN=
183   
184   dnl If building the kparts plugin, get the install paths correct.  
185   if test x$build_kparts3 = xyes; then
186     AC_CACHE_VAL(ac_cv_path_kde3_prefix,[
187       dnl if the user specified a path, sanity check it and then use it
188       if test x"${with_kde3_prefix}" != x; then
189           ac_cv_path_kde3_prefix="`(cd ${with_kde3_prefix}; pwd)`"
190       fi
191     ])                  dnl end of cache ac_cv_path_kde3_prefix
193     KDE3_PREFIX="${ac_cv_path_kde3_prefix}"
194     if test x"${PLUGINS_INSTALL_POLICY}" != x; then
195       case "${PLUGINS_INSTALL_POLICY}" in
196         user)
197           KDE3_PREFIX=${HOME}/.kde
198           ;;
199         system)
200           KDE3_PREFIX="${kde3_prefix}"
201           ;;
202         prefix)
203                 KDE3_PREFIX="${prefix}"
204           ;;
205       esac
206     fi
208     KDE3_PLUGINDIR="${KDE3_PREFIX}/lib/kde3"
209     KDE3_SERVICESDIR="${KDE3_PREFIX}/share/services"
210     KDE3_CONFIGDIR="${KDE3_PREFIX}/share/config"
211     KDE3_APPSDATADIR="${KDE3_PREFIX}/share/apps/klash"
212   fi                            dnl end of build_kparts3
214   if test x"${ac_cv_path_kde3_incl}" != x ; then
215     if test x"${ac_cv_path_kde3_incl}" != x"-I/usr/include"; then
216       KDE3_CFLAGS="${ac_cv_path_kde3_incl}"
217     else
218       KDE3_CFLAGS=""
219     fi
220   else
221     KDE3_CFLAGS=""
222   fi
224   if test x"${ac_cv_path_kde3_lib}" != x; then
225     KDE3_LIBS="${ac_cv_path_kde3_lib}"
226     AC_DEFINE(HAVE_KDE3, 1,[Have KDE 3.x installed])
227     has_kde3=yes
228   else
229     KDE3_LIBS=""
230     has_kde3=no
231   fi
233   AC_SUBST(KLASH_PLUGIN)
234   AC_SUBST(KDE3_CFLAGS)  
235   AC_SUBST(KDE3_LIBS)
237   AC_SUBST(KDE3_PLUGINDIR)
238   AC_SUBST(KDE3_SERVICESDIR)
239   AC_SUBST(KDE3_CONFIGDIR)
240   AC_SUBST(KDE3_APPSDATADIR)
243 # Local Variables:
244 # c-basic-offset: 2
245 # tab-width: 2
246 # indent-tabs-mode: nil
247 # End: