1 AC_DEFUN([KDE_CONFIG_OPTIONS],
5 [AS_HELP_STRING([--with-kde4-config=PATH],
6 [kde4-config script to use])],
7 [KDE4_CONFIG=$withval], [KDE4_CONFIG=""])
10 [AS_HELP_STRING([--enable-kde-in-home],
11 [install KDE related stuff in your home dir])],
12 [KDE_IN_HOME=$enableval], [KDE_IN_HOME=no])
15 AC_DEFUN([KDE_CONFIG_CHECK],
17 AS_IF([test -z ${KDE4_CONFIG}],
19 AC_PATH_PROG(KDE4_CONFIG, kde4-config)
22 AC_MSG_CHECKING(for kde4-config)
23 AS_IF([test ! -x KDE4_CONFIG],
25 KDE4_CONFIG="not found"
26 AC_MSG_RESULT(not found)
31 AS_IF([ test "${KDE4_CONFIG}" != "not found"],
33 KDE_CONF_VER=`${KDE4_CONFIG} --version | grep KDE | sed -e 's/^.*: //' -e 's/ (.*$//'`
34 AS_IF([test `echo ${KDE_CONF_VER} | sed -e 's/\..*$//'` = 4],
36 AC_MSG_RESULT(found ${KDE4_CONFIG} with version ${KDE_CONF_VER})
39 AC_MSG_RESULT(at least version 4 required)
44 AC_MSG_RESULT(not found)
50 AC_DEFUN([KDE_HEADER_CHECK],
52 AC_MSG_CHECKING(for kde4 headers)
53 [KDE_HEADER_DIR=`${KDE4_CONFIG} --path include`]
55 AS_IF([test -f ${KDE_HEADER_DIR}kdirwatch.h],
57 AS_IF([test -f ${KDE_HEADER_DIR}plasma/dataengine.h],
59 AC_MSG_RESULT(${KDE_HEADER_DIR})
62 AC_MSG_RESULT(dataengine.h not found)
67 AC_MSG_RESULT(kdirwatch.h not found)
70 AC_SUBST(KDE_HEADER_DIR)
73 AC_DEFUN([KDE_SERVICE_PATH_CHECK],
75 AC_REQUIRE([AC_PROG_EGREP])
76 AC_MSG_CHECKING(for kde4 services Path)
77 AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
81 AS_IF([test ${KDE_IN_HOME} = "yes"],
83 KDE_SERVICE_PATH=`${KDE4_CONFIG} --path services | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
86 KDE_SERVICE_PATH=`${KDE4_CONFIG} --path services | tr ":" "\n" | grep /usr | head -1`
88 AC_MSG_RESULT(${KDE_SERVICE_PATH})
89 AC_SUBST(KDE_SERVICE_PATH)
92 AC_DEFUN([KDE_MODULE_PATH_CHECK],
94 AC_REQUIRE([AC_PROG_EGREP])
95 AC_MSG_CHECKING(for kde4 plugins Path)
96 AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
100 AS_IF([test ${KDE_IN_HOME} = "yes"],
102 KDE_MODULE_PATH=`${KDE4_CONFIG} --path module | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
105 KDE_MODULE_PATH=`${KDE4_CONFIG} --path module | tr ":" "\n" | grep /usr | head -1`
107 AC_MSG_RESULT(${KDE_MODULE_PATH})
108 AC_SUBST(KDE_MODULE_PATH)
111 AC_DEFUN([KDE_ICON_PATH_CHECK],
113 AC_REQUIRE([AC_PROG_EGREP])
114 AC_MSG_CHECKING(for kde4 icons Path)
115 AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
119 AS_IF([test ${KDE_IN_HOME} = "yes"],
121 KDE_ICON_PATH=`${KDE4_CONFIG} --path icon | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
124 KDE_ICON_PATH=`${KDE4_CONFIG} --path icon | tr ":" "\n" | grep /usr | head -1`
126 KDE_ICON_PATH=${KDE_ICON_PATH}hicolor/scalable/mimetypes/
127 AC_MSG_RESULT(${KDE_ICON_PATH})
128 AC_SUBST(KDE_ICON_PATH)
131 AC_DEFUN([KDE_MIME_PATH_CHECK],
133 AC_REQUIRE([AC_PROG_EGREP])
134 AC_MSG_CHECKING(for location for mime-type installation)
135 AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
139 AS_IF([test ${KDE_IN_HOME} = "yes"],
141 KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
144 AS_IF([test -n ${prefix}],
146 KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | grep ${prefix} | head -1`
147 AS_IF([test -n ${KDE_MIME_PATH}],
149 KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | $EGREP -v '(/home|/root)' | head -1`
153 KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | $EGREP -v '(/home|/root)' | head -1`
156 AC_MSG_RESULT(${KDE_MIME_PATH})
157 AC_SUBST(KDE_MIME_PATH)
160 AC_DEFUN([KDE_APPLNK_PATH_CHECK],
162 AC_REQUIRE([AC_PROG_EGREP])
163 AC_MSG_CHECKING(for kde4 applinks Path)
164 AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
168 AS_IF([test ${KDE_IN_HOME} = "yes"],
170 KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
173 AS_IF([test -n ${prefix}],
175 KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | grep ${prefix} | head -1`
176 AS_IF([test -n ${KDE_APPLNK_PATH}],
178 KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | grep -vE '(/home|/root)' | head -1`
182 KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | grep -vE '(/home|/root)' | head -1`
185 AC_MSG_RESULT(${KDE_APPLNK_PATH})
186 AC_SUBST(KDE_APPLNK_PATH)