summaryrefslogtreecommitdiffstats
path: root/configure.in.in
blob: 51e5dc8f95b3bddd3a1fc8f0d4ee1061641f8cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#MIN_CONFIG(3.3)
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/sysctl.h sys/param.h sys/time.h sys/types.h unistd.h values.h sys/limits.h err.h sys/cdefs.h)

AC_CHECK_SETENV
AC_CHECK_UNSETENV

KDE_NEED_FLEX

if test "$x_includes" != "NONE"; then
  AC_DEFINE(HAVE_X11_HEADERS,1,Define if you have X11 header files)
fi
AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, [LIBXTST=-lXtst],, -lX11)
AC_SUBST(LIBXTST)
if test "$LIBXTST" != ""; then
  AC_CHECK_HEADER([X11/extensions/XTest.h],
                  [AC_DEFINE(HAVE_XTEST, 1, [Define if you have X11 Xtest header files])])
fi

KDE_INIT_DOXYGEN([KDE PIM API Reference], [Version $VERSION])

KDE_CHECK_THREADING

dnl For apps that NEED threads
if test -z "$LIBPTHREAD" && test -z "$USE_THREADS"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE knode"
fi

CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"

# check for libbluetooth (Bluetooth library) because gnokii may require it
AC_DEFUN([KDE_CHECK_BLUETOOTH],
[
  AC_CHECK_HEADERS(bluetooth/bluetooth.h)
  LIB_BLUETOOTH=
  AC_CHECK_LIB(bluetooth, hci_open_dev,
       [ LIB_BLUETOOTH="-lbluetooth" ],
       [],
       [] )
  AC_SUBST(LIB_BLUETOOTH)
])


# check for libgnokii (Nokia mobile phone library)
AC_DEFUN([KDE_CHECK_GNOKII],
[
  KDE_CHECK_HEADERS(gnokii.h)
  AC_REQUIRE([AC_HAVE_XPM])
  AC_CHECK_LIB(gnokii, gn_cfg_read,
       [ LIB_GNOKII="-lgnokii $LIB_BLUETOOTH" ],
       [
    	AC_CHECK_LIB(gnokii, gn_cfg_get,
       	[ LIB_GNOKII="-lgnokii -lintl $LIB_BLUETOOTH" ],
       	[], $all_libraries -lintl -lXpm -lX11 $LIB_BLUETOOTH )
       ],
       $all_libraries -lXpm -lX11 $LIB_BLUETOOTH )
  AC_SUBST(LIB_GNOKII)
])

AC_ARG_WITH(gnokii,
  [AC_HELP_STRING(--with-gnokii,
    [enable support for mobile phones through gnokii @<:@default=check@:>@])],
  [], with_gnokii=check)

LIB_GNOKII=
if test "x$with_gnokii" != xno; then
  # for kaddressbook/xxport/ and kmobile/devices/gnokii/
  KDE_CHECK_BLUETOOTH
  KDE_CHECK_GNOKII

  if test "x$with_gnokii" != xcheck && test -z "$LIB_GNOKII"; then
    AC_MSG_ERROR([--with-gnokii was given, but test for gnokii failed])
  fi
fi

dnl Checks for header files.
AC_CHECK_HEADERS(sys/cdefs.h) dnl for libkholidays/lunarphase.cpp
AC_CHECK_HEADERS(sys/ioctl.h) dnl for kandy/src/modem.cpp
AC_CHECK_HEADERS(sys/file.h sys/stat.h sys/time.h byteswap.h) dnl for at least kmail

dnl the below is copied from tdenetwork's configure as too many apps moved
dnl and noone can say which tests are needed and which are obsolete for tdepim ;(

AC_CHECK_HEADERS(fcntl.h unistd.h sysent.h strings.h paths.h)

dnl unused AC_CHECK_HEADER([resolv.h],,,[#include <netinet/in.h>])

KDE_CHECK_LARGEFILE

AC_CHECK_USLEEP

dnl Checks for library functions.
AC_CHECK_FUNCS(socket fabsl strdup vsnprintf tzset)
AC_CHECK_GETDOMAINNAME
AC_CHECK_GETHOSTNAME
AC_C_BIGENDIAN

AC_CHECK_RES_INIT

dnl needed by libkmime
AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
	AC_TRY_COMPILE([
		#include <time.h>
	], [
		timezone = 1;
	], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
if test $ac_cv_var_timezone = yes; then
	AC_DEFINE(HAVE_TIMEZONE, 1, [define if you have a timezone variable])
fi

dnl needed by libkmime
AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,	
	AC_TRY_COMPILE([
		#include <time.h>
	], [
		struct tm tm;
		tm.tm_gmtoff = 1;
	], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
if test $ac_cv_struct_tm_gmtoff = yes; then
	AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if you have a tm_gmtoff member in struct tm])
fi

dnl Check libical API version
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
cxx_flags_safe="$CXXFLAGS"
cflags_safe="$CFLAGS"
CXXFLAGS="$CXXFLAGS -I$ac_cv_sword_incdir"
CFLAGS="$CFLAGS -I$ac_cv_sword_incdir"
AC_MSG_CHECKING([for libical >= 0.46])
AC_TRY_COMPILE([extern "C" {
  #include <libical/ical.h>
  #include <libical/icalparser.h>
  #include <libical/icalrestriction.h>
}
],[icalattach *attach;
    attach = icalattach_new_from_data ( (const char *)"TEST", 0, 0 );],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_LIBICAL_0_46,1,[yes])],
AC_MSG_RESULT(no))
CXXFLAGS="$cxx_flags_safe"
CFLAGS="$cflags_safe"
AC_LANG_RESTORE

AC_LANG_PUSH(C++)
AC_CACHE_CHECK(for stl coping with namespace std, ac_cv_var_stlnamespace,
        AC_TRY_COMPILE([
                #include <iterator>
		struct s : public std::iterator<std::forward_iterator_tag, int> {};
        ], [
        ], ac_cv_var_stlnamespace=yes, ac_cv_var_stlnamespace=no))
if test $ac_cv_var_stlnamespace = yes; then
        AC_DEFINE(HAVE_STLNAMESPACE, 1, [Define if your version of stl is defined in namespace std])
	AC_DEFINE(STD_NAMESPACE_PREFIX, [std::], [Namespace prefix the stl is defined in])
else
	AC_DEFINE(STD_NAMESPACE_PREFIX, [], [Namespace prefix the stl is defined in])
fi

AC_LANG_POP

dnl Say what we're doing
AC_MSG_CHECKING(if egroupware resource is allowed)
AC_ARG_ENABLE(caldav, [  --disable-egroupware	  disable egroupware support ],  with_egroupware=$enableval, with_egroupware=yes)
if test "$with_egroupware" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_egroupware_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_egroupware_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if kolab resource is allowed)
AC_ARG_ENABLE(caldav, [  --disable-kolab	  disable kolab support ],  with_kolab=$enableval, with_kolab=yes)
if test "$with_kolab" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_kolab_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_kolab_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if slox resource is allowed)
AC_ARG_ENABLE(caldav, [  --disable-slox	  disable slox support ],  with_slox=$enableval, with_slox=yes)
if test "$with_slox" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_slox_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_slox_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if groupwise resource is allowed)
AC_ARG_ENABLE(caldav, [  --disable-groupwise	  disable groupwise support ],  with_groupwise=$enableval, with_groupwise=yes)
if test "$with_groupwise" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_groupwise_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_groupwise_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if featureplan resource is allowed)
AC_ARG_ENABLE(featureplan, [  --disable-featureplan	  disable featureplan support ],  with_featureplan=$enableval, with_featureplan=yes)
if test "$with_featureplan" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_featureplan_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_featureplan_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if groupdav resource is allowed)
AC_ARG_ENABLE(groupdav, [  --disable-groupdav	  disable groupdav support ],  with_groupdav=$enableval, with_groupdav=yes)
if test "$with_groupdav" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_groupdav_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_groupdav_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if birthdays resource is allowed)
AC_ARG_ENABLE(birthdays, [  --disable-birthdays	  disable birthdays support ],  with_birthdays=$enableval, with_birthdays=yes)
if test "$with_birthdays" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_birthdays_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_birthdays_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if newexchange resource is allowed)
AC_ARG_ENABLE(newexchange, [  --disable-newexchange	  disable newexchange support ],  with_newexchange=$enableval, with_newexchange=yes)
if test "$with_newexchange" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_newexchange_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_newexchange_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if scalix resource is allowed)
AC_ARG_ENABLE(scalix, [  --disable-scalix	  disable scalix support ],  with_scalix=$enableval, with_scalix=yes)
if test "$with_scalix" = "yes"; then
    AC_MSG_RESULT([yes])
    AM_CONDITIONAL(include_scalix_SUBDIR, test true = true)
else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_scalix_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if caldav resource is allowed)
AC_ARG_ENABLE(caldav, [  --disable-caldav	  disable caldav support (caldav resources such as Google Calendar and Zimbra will not function) ],  with_caldav=$enableval, with_caldav=yes)
if test "$with_caldav" = "yes"; then
    AC_MSG_RESULT([yes])

    dnl Check caldav API version
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    cxx_flags_safe="$CXXFLAGS"
    cflags_safe="$CFLAGS"
    CXXFLAGS="$CXXFLAGS"
    CFLAGS="$CFLAGS"
    AC_MSG_CHECKING([for libcaldav])
    AC_TRY_COMPILE([extern "C" {
    #include <libcaldav/caldav.h>
    }
    ],[return 0;],
    [AC_MSG_RESULT(found)
    AM_CONDITIONAL(include_caldav_SUBDIR, test true = true)],
    [AC_MSG_RESULT(not found)
    AM_CONDITIONAL(include_caldav_SUBDIR, test true = false)])
    CXXFLAGS="$cxx_flags_safe"
    CFLAGS="$cflags_safe"
    AC_LANG_RESTORE

else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_caldav_SUBDIR, test true = false)
fi

dnl Say what we're doing
AC_MSG_CHECKING(if carddav resource is allowed)
AC_ARG_ENABLE(carddav, [  --disable-carddav	  disable carddav support (carddav resources such as Google Contacts and Zimbra will not function) ],  with_carddav=$enableval, with_carddav=yes)
if test "$with_carddav" = "yes"; then
    AC_MSG_RESULT([yes])

    dnl Check carddav API version
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    cxx_flags_safe="$CXXFLAGS"
    cflags_safe="$CFLAGS"
    CXXFLAGS="$CXXFLAGS"
    CFLAGS="$CFLAGS"
    AC_MSG_CHECKING([for libcarddav])
    AC_TRY_COMPILE([extern "C" {
    #include <libcarddav/carddav.h>
    }
    ],[return 0;],
    [AC_MSG_RESULT(found)
    AM_CONDITIONAL(include_carddav_SUBDIR, test true = true)],
    [AC_MSG_RESULT(not found)
    AM_CONDITIONAL(include_carddav_SUBDIR, test true = false)])
    CXXFLAGS="$cxx_flags_safe"
    CFLAGS="$cflags_safe"
    AC_LANG_RESTORE

else
    AC_MSG_RESULT([no])
    AM_CONDITIONAL(include_carddav_SUBDIR, test true = false)
fi