Updated French and Turkish translation by gagar
[amule.git] / m4 / kde.m4
blob43bc0cfe03903a53672a026b48e759ec500e78a8
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                         exit 1
28                 ])
29         ])
31         AS_IF([ test "${KDE4_CONFIG}" != "not found"],
32         [
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],
35                 [
36                         AC_MSG_RESULT(found ${KDE4_CONFIG} with version ${KDE_CONF_VER})
37                 ],
38                 [
39                         AC_MSG_RESULT(at least version 4 required)
40                         exit 1
41                 ])
42         ],
43         [
44                 AC_MSG_RESULT(not found)
45                 exit 1
46         ])
47         AC_SUBST(KDE4_CONFIG)
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],
56         [
57                 AS_IF([test -f ${KDE_HEADER_DIR}plasma/dataengine.h],
58                 [
59                         AC_MSG_RESULT(${KDE_HEADER_DIR})
60                 ],
61                 [
62                         AC_MSG_RESULT(dataengine.h not found)
63                         exit 1
64                 ])
65         ],
66         [
67                 AC_MSG_RESULT(kdirwatch.h not found)
68                 exit 1
69         ])
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],
78         [
79                 KDE_IN_HOME="yes"
80         ])
81         AS_IF([test ${KDE_IN_HOME} = "yes"],
82         [
83                 KDE_SERVICE_PATH=`${KDE4_CONFIG} --path services | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
84         ],
85         [
86                 KDE_SERVICE_PATH=`${KDE4_CONFIG} --path services | tr ":" "\n" | grep /usr | head -1`
87         ])
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],
97         [
98                 KDE_IN_HOME="yes"
99         ])
100         AS_IF([test ${KDE_IN_HOME} = "yes"],
101         [
102                 KDE_MODULE_PATH=`${KDE4_CONFIG} --path module | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
103         ],
104         [
105                 KDE_MODULE_PATH=`${KDE4_CONFIG} --path module | tr ":" "\n" | grep /usr | head -1`
106         ])
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],
116         [
117                 KDE_IN_HOME="yes"
118         ])
119         AS_IF([test ${KDE_IN_HOME} = "yes"],
120         [
121                 KDE_ICON_PATH=`${KDE4_CONFIG} --path icon | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
122         ],
123         [
124                 KDE_ICON_PATH=`${KDE4_CONFIG} --path icon | tr ":" "\n" | grep /usr | head -1`
125         ])
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],
136         [
137                 KDE_IN_HOME="yes"
138         ])
139         AS_IF([test ${KDE_IN_HOME} = "yes"],
140         [
141                 KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
142         ],
143         [
144                 AS_IF([test -n ${prefix}],
145                 [
146                         KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | grep ${prefix} | head -1`
147                         AS_IF([test -n ${KDE_MIME_PATH}],
148                         [
149                                 KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | $EGREP -v '(/home|/root)' | head -1`
150                         ])
151                 ],
152                 [
153                         KDE_MIME_PATH=`${KDE4_CONFIG} --path xdgdata-mime | tr ":" "\n" | $EGREP -v '(/home|/root)' | head -1`
154                 ])
155         ])
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],
165         [
166                 KDE_IN_HOME="yes"
167         ])
168         AS_IF([test ${KDE_IN_HOME} = "yes"],
169         [
170                 KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | $EGREP '(/home|/root)' | head -1`
171         ],
172         [
173                 AS_IF([test -n ${prefix}],
174                 [
175                         KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | grep ${prefix} | head -1`
176                         AS_IF([test -n ${KDE_APPLNK_PATH}],
177                         [
178                                 KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | grep -vE '(/home|/root)' | head -1`
179                         ])
180                 ],
181                 [
182                         KDE_APPLNK_PATH=`${KDE4_CONFIG} --path xdgdata-apps | tr ":" "\n" | grep -vE '(/home|/root)' | head -1`
183                 ])
184         ])
185         AC_MSG_RESULT(${KDE_APPLNK_PATH})
186         AC_SUBST(KDE_APPLNK_PATH)