Avoid overriding the check-local rule, hushing automake warning
[gnash.git] / macros / kde3.m4
blob62f68ac7e651b2114b1eef9252df1bce2404a979
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     kde3_prefix=
78     AC_PATH_PROG(KDE3_CONFIG, kde-config, ,[${pathlist}])
79     if test "x$KDE3_CONFIG" != "x" ; then
80       kde3_prefix=`$KDE3_CONFIG --prefix`
81       AC_MSG_NOTICE([KDE3 prefix from kde-config is ${kde3_prefix}])
82     fi
84     AC_CACHE_VAL(ac_cv_path_kde3_incl,[
85       dnl if the user specified a path, sanity check it and then use it
86       if test x"${with_kde3_incl}" != x; then
87         if test -f ${with_kde3_incl}/kapp.h; then
88           ac_cv_path_kde3_incl="-I`(cd ${with_kde3_incl}; pwd)`"
89         fi
90       fi
91       dnl if the user didn't specify a path, go search a list of
92       dnl likely directories for the header files.
93       if test x"${ac_cv_path_kde3_incl}" = x ; then
94         AC_MSG_CHECKING([for KDE 3.x header path])
95         dnl incllist is inherited from configure.ac, and lives in /macros
96         for i in ${kde3_prefix}/include ${incllist}; do 
97          if test -f $i/kde/kapplication.h; then
98             ac_cv_path_kde3_incl="-I$i/kde"
99             kde3_prefix=`dirname $i`
100             break
101           fi
102           if test -f $i/kapplication.h; then
103             ac_cv_path_kde3_incl="-I$i"
104             kde3_prefix=`dirname $i`
105             break
106           fi
107         done
108       fi
109       if test x"${ac_cv_path_kde3_incl}" != x ; then
110         AC_MSG_RESULT(${ac_cv_path_kde3_incl})
111       else
112         AC_MSG_RESULT(no)
113         if test x${cross_compiling} = xno; then
114           dnl if no headers have been found yet, make a last ditch
115           dnl attempt to use the compiler to find them.
116           AC_CHECK_HEADERS(kde/kapplication.h, [ac_cv_path_kde3_incl=""])
117         fi
118       fi
119     ])                  dnl end of cache ac_cv_path_kde3_incl
121     dnl Look for the libraries
122     AC_CACHE_VAL(ac_cv_path_kde3_lib, [
123       if test x"${with_kde3_lib}" != x ; then
124         if test -f ${with_kde3_lib}/libkdeui.la; then
125                 ac_cv_path_kde3_lib="-L`(cd ${with_kde3_lib}; pwd)`"
126         else
127                 AC_MSG_ERROR([${with_kde3_lib} directory doesn't contain KDE 3.x libraries.])
128         fi
129       fi
130       if test x"${ac_cv_path_kde3_lib}" = x; then
131         AC_MSG_CHECKING([for kdeui library])
132         kde3_topdir=
133         for i in ${kde3_prefix}/lib64 ${kde3_prefix}/lib $libslist ; do
134           if test -f $i/libkdeui.${shlibext} -o -f $i/libkdeui.la; then
135             kde3_topdir=$i
136             AC_MSG_RESULT(${kde3_topdir}/libkdeui)
137                   if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
138                     ac_cv_path_kde3_lib="-L$i -lkdeui"
139               break
140             else
141                     ac_cv_path_kde3_lib="-lkdeui"
142                     break
143             fi
144           fi
145         done
146       fi
147       dnl Look for the kdecore library, which is required
148       if test x"${ac_cv_path_kde3_lib}" != x; then
149         AC_MSG_CHECKING([for kdecore library])
150         if test -f ${kde3_topdir}/libkdecore.la; then
151           ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} -lkdecore"
152           AC_MSG_RESULT(${kde3_topdir}/libkdecore)
153         else
154          AC_MSG_RESULT(no)
155         fi
156       fi
157       dnl Look for the kdeprint library, which is required
158       AC_MSG_CHECKING([for kdeprint library])
159       if test x"${libkdeprint}" = x; then
160         if test -f ${kde3_topdir}/libkdeprint.la -o -f ${kde3_topdir}/libkdeprint.${shlibext}; then
161           ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} -lkdeprint"
162           AC_MSG_RESULT(${kde3_topdir}/libkdeprint)
163         else
164           AC_MSG_RESULT(no)
165         fi
166       else
167         AC_MSG_RESULT(${libkdeprint})
168         ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} ${libkdeprint}"
169       fi        
170     ])                  dnl end of cache ac_cv_path_kde3_lib
172   KLASH_PLUGIN=
173   
174   dnl If building the kparts plugin, get the install paths correct.  
175     AC_CACHE_VAL(ac_cv_path_kde3_prefix,[
176       dnl if the user specified a path, sanity check it and then use it
177       if test x"${with_kde3_prefix}" != x; then
178           ac_cv_path_kde3_prefix="`(cd ${with_kde3_prefix}; pwd)`"
179       fi
180     ])                  dnl end of cache ac_cv_path_kde3_prefix
182     KDE3_PREFIX="${ac_cv_path_kde3_prefix}"
183     if test x"${PLUGINS_INSTALL_POLICY}" != x; then
184       case "${PLUGINS_INSTALL_POLICY}" in
185         user)
186           KDE3_PREFIX=${HOME}/.kde
187           ;;
188         system)
189           KDE3_PREFIX="${kde3_prefix}"
190           ;;
191         prefix)
192                 KDE3_PREFIX="\${prefix}"
193           ;;
194       esac
195     fi
197     KDE3_PLUGINDIR="${KDE3_PREFIX}/lib/kde3"
198     KDE3_SERVICESDIR="${KDE3_PREFIX}/share/services"
199     KDE3_CONFIGDIR="${KDE3_PREFIX}/share/config"
200     KDE3_APPSDATADIR="${KDE3_PREFIX}/share/apps/klash"
202   if test x"${ac_cv_path_kde3_incl}" != x ; then
203     if test x"${ac_cv_path_kde3_incl}" != x"-I/usr/include"; then
204       KDE3_CFLAGS="${ac_cv_path_kde3_incl}"
205     else
206       KDE3_CFLAGS=""
207     fi
208   else
209     KDE3_CFLAGS=""
210   fi
212   if test x"${ac_cv_path_kde3_lib}" != x; then
213     KDE3_LIBS="${ac_cv_path_kde3_lib}"
214     AC_DEFINE(HAVE_KDE3, 1,[Have KDE 3.x installed])
215     has_kde3=yes
216   else
217     KDE3_LIBS=""
218     has_kde3=no
219   fi
221   AC_SUBST(KLASH_PLUGIN)
222   AC_SUBST(KDE3_CFLAGS)  
223   AC_SUBST(KDE3_LIBS)
225   AC_SUBST(KDE3_PLUGINDIR)
226   AC_SUBST(KDE3_SERVICESDIR)
227   AC_SUBST(KDE3_CONFIGDIR)
228   AC_SUBST(KDE3_APPSDATADIR)
231 # Local Variables:
232 # c-basic-offset: 2
233 # tab-width: 2
234 # indent-tabs-mode: nil
235 # End: