2 dnl Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 dnl 2011 Free Software Foundation, Inc.
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.
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],
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])
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!])
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!])
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!])
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}
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}
77 dnl Look for the files necessary to build KDE 3.x applications
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}])
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)`"
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`
103 if test -f $i/qxembed.h; then
104 ac_cv_path_kde3_incl="-I$i"
105 kde3_prefix=`dirname $i`
110 if test x"${ac_cv_path_kde3_incl}" != x ; then
111 AC_MSG_RESULT(${ac_cv_path_kde3_incl})
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=""])
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)`"
128 AC_MSG_ERROR([${with_kde3_lib} directory doesn't contain KDE 3.x libraries.])
131 if test x"${ac_cv_path_kde3_lib}" = x; then
132 AC_MSG_CHECKING([for kdeui library])
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
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"
142 ac_cv_path_kde3_lib="-lkdeui"
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)
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)
168 AC_MSG_RESULT(${libkdeprint})
169 ac_cv_path_kde3_lib="${ac_cv_path_kde3_lib} ${libkdeprint}"
171 ]) dnl end of cache ac_cv_path_kde3_lib
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)`"
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
187 KDE3_PREFIX=${HOME}/.kde
190 KDE3_PREFIX="${kde3_prefix}"
193 KDE3_PREFIX="\${prefix}"
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}"
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])
222 AC_SUBST(KLASH_PLUGIN)
223 AC_SUBST(KDE3_CFLAGS)
226 AC_SUBST(KDE3_PLUGINDIR)
227 AC_SUBST(KDE3_SERVICESDIR)
228 AC_SUBST(KDE3_CONFIGDIR)
229 AC_SUBST(KDE3_APPSDATADIR)
235 # indent-tabs-mode: nil