Upstream tarball 10152
[amule.git] / m4 / kde.m4
blobcc640c79eb44025dc6b3f5b509c967a698223d96
1 AC_DEFUN([KDE_CONFIG_OPTIONS],
3         AC_ARG_WITH(
4                 [kde4-config],
5                 [AS_HELP_STRING([--with-kde4-config=PATH],
6                         [kde4-config script to use])],
7                 [KDE4_CONFIG=$withval], [KDE4_CONFIG=""])
8         AC_ARG_ENABLE(
9                 [kde-in-home],
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}],
18         [
19                 AC_PATH_PROG(KDE4_CONFIG, kde4-config)
20         ],
21         [
22                 AC_MSG_CHECKING(for kde4-config)
23                 AS_IF([test ! -x KDE4_CONFIG],
24                 [
25                         KDE4_CONFIG="not found"
26                         AC_MSG_RESULT(not found)
27                 ])
28         ])
30         AS_IF([ test "${KDE4_CONFIG}" != "not found"],
31         [
32                 KDE_CONF_VER=`${KDE4_CONFIG} --version | grep KDE | sed -e 's/^.*: //' -e 's/ (.*$//'`
33                 AS_IF([test `echo ${KDE_CONF_VER} | sed -e 's/\..*$//'` = 4],
34                 [
35                         AC_MSG_RESULT(found ${KDE4_CONFIG} with version ${KDE_CONF_VER})
36                 ],
37                 [
38                         AC_MSG_RESULT(not found)
39                 ])
40         ],
41         [
42                 AC_MSG_RESULT(not found)
43         ])
44         AC_SUBST(KDE4_CONFIG)
47 AC_DEFUN([KDE_HEADER_CHECK],
49         AC_MSG_CHECKING(for kde4 headers)
50         [KDE_HEADER_DIR=`${KDE4_CONFIG} --path include`]
52         AS_IF([test -f ${KDE_HEADER_DIR+kdirwatch.h}],
53         [
54                 AS_IF([test -f ${KDE_HEADER_DIR+plasma/dataengine.h}],
55                 [
56                         AC_MSG_RESULT($KDE_HEADER_DIR)
57                 ],
58                 [
59                         AC_MSG_RESULT(not found)
60                 ])
61         ],
62         [
63                 AC_MSG_RESULT(not found)
64         ])
65         AC_SUBST(KDE_HEADER_DIR)
68 AC_DEFUN([KDE_SERVICE_PATH_CHECK],
70         AC_MSG_CHECKING(for kde4 services Path)
71         AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
72         [
73                 KDE_IN_HOME="yes"
74         ])
75         AS_IF([test ${KDE_IN_HOME} = "yes"],
76         [
77                 KDE_SERVICE_PATH=`${KDE4_CONFIG} --path services | tr ":" "\n" | grep /home | head -1`
78         ],
79         [
80                 KDE_SERVICE_PATH=`${KDE4_CONFIG} --path services | tr ":" "\n" | grep /usr | head -1`
81         ])
82         AC_MSG_RESULT(${KDE_SERVICE_PATH})
83         AC_SUBST(KDE_SERVICE_PATH)
86 AC_DEFUN([KDE_MODULE_PATH_CHECK],
88         AC_MSG_CHECKING(for kde4 plugins Path)
89         AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
90         [
91                 KDE_IN_HOME="yes"
92         ])
93         AS_IF([test ${KDE_IN_HOME} = "yes"],
94         [
95                 KDE_MODULE_PATH=`${KDE4_CONFIG} --path module | tr ":" "\n" | grep /home | head -1`
96         ],
97         [
98                 KDE_MODULE_PATH=`${KDE4_CONFIG} --path module | tr ":" "\n" | grep /usr | head -1`
99         ])
100         AC_MSG_RESULT(${KDE_MODULE_PATH})
101         AC_SUBST(KDE_MODULE_PATH)
104 AC_DEFUN([KDE_ICON_PATH_CHECK],
106         AC_MSG_CHECKING(for kde4 icons Path)
107         AS_IF([test `echo ${prefix} | grep home | wc -l` == 1],
108         [
109                 KDE_IN_HOME="yes"
110         ])
111         AS_IF([test ${KDE_IN_HOME} = "yes"],
112         [
113                 KDE_ICON_PATH=`${KDE4_CONFIG} --path icon | tr ":" "\n" | grep /home | head -1`
114         ],
115         [
116                 KDE_ICON_PATH=`${KDE4_CONFIG} --path icon | tr ":" "\n" | grep /usr | head -1`
117         ])
118         AC_MSG_RESULT(${KDE_ICON_PATH})
119         AC_SUBST(KDE_ICON_PATH)