configure.ac.in 11.8 KB
Newer Older
1
dnl Orage - Calendar application for Xfce
Benedikt Meurer's avatar
Benedikt Meurer committed
2
dnl
3
dnl Copyright (c) 2003-2022
4
5
dnl         The Xfce development team. All rights reserved.
dnl
Juha Kautto's avatar
Juha Kautto committed
6
dnl Written for Xfce by Juha Kautto <juha@xfce.org>
Benedikt Meurer's avatar
Benedikt Meurer committed
7
8
dnl

9
dnl Version information
10
11
12
13
m4_define([orage_version_major], [4])
m4_define([orage_version_minor], [16])
m4_define([orage_version_micro], [0])
m4_define([orage_version_build], [@REVISION@])
Gaël Bonithon's avatar
Gaël Bonithon committed
14
m4_define([orage_version_tag], [git]) # Leave empty for releases
15
m4_define([orage_version], [orage_version_major().orage_version_minor().orage_version_micro()ifelse(orage_version_tag(), [git], [orage_version_tag()-orage_version_build()], [orage_version_tag()])])
Juha Kautto's avatar
Juha Kautto committed
16

17
m4_define([glib_minimum_version], [2.52.0])
Erkki Moorits's avatar
Erkki Moorits committed
18
19
m4_define([gtk_minimum_version], [3.24.0])
m4_define([xfce_minimum_version], [4.16.0])
20
m4_define([dbus_minimum_version], [0.1])
Juha Kautto's avatar
Juha Kautto committed
21
m4_define([notify_minimum_version], [0.3.2])
Erkki Moorits's avatar
Erkki Moorits committed
22
m4_define([intltool_minimum_version], [0.35])
23
m4_define([libical_minimum_version], [3.0])
24
m4_define([libpopt_minimum_version], [1.18])
Benedikt Meurer's avatar
Benedikt Meurer committed
25
26


27
28
29
dnl # DO NOT MODIFY ANYTHING BELOW THIS LINE, UNLESS YOU KNOW WHAT
dnl # YOU ARE DOING.

Benedikt Meurer's avatar
Benedikt Meurer committed
30

31
dnl Initialize autoconf
32
AC_COPYRIGHT([Copyright (c) 2003-2022
33
34
        The Xfce development team. All rights reserved.

Juha Kautto's avatar
Juha Kautto committed
35
Written for Xfce by Juha Kautto <juha@xfce.org>.])
36
AC_INIT([orage], [orage_version], [xfce4-dev@xfce.org])
37
AC_CONFIG_MACRO_DIRS([m4])
38
39
40
41
AC_PREREQ([2.50])
AC_REVISION([$Id$])

dnl Initialize automake
42
AM_INIT_AUTOMAKE(1.8 no-dist-gzip dist-bzip2 tar-ustar foreign)
43
AM_SILENT_RULES([yes])
Gaël Bonithon's avatar
Gaël Bonithon committed
44
AC_CONFIG_HEADERS([config.h])
45
AM_MAINTAINER_MODE()
Benedikt Meurer's avatar
Benedikt Meurer committed
46

Erkki Moorits's avatar
Erkki Moorits committed
47
48
AC_PROG_CC([gcc clang cc])

Benedikt Meurer's avatar
Benedikt Meurer committed
49
dnl Check for UNIX variants
Gaël Bonithon's avatar
Gaël Bonithon committed
50
51
AC_USE_SYSTEM_EXTENSIONS()
AC_SEARCH_LIBS([strerror], [cposix])
Juha Kautto's avatar
Juha Kautto committed
52
AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""])
Benedikt Meurer's avatar
Benedikt Meurer committed
53
54

dnl Check for basic programs
55
AC_PROG_INSTALL()
Erkki Moorits's avatar
Erkki Moorits committed
56
IT_PROG_INTLTOOL([intltool_minimum_version])
Erkki Moorits's avatar
Erkki Moorits committed
57
AC_PROG_SED()
58
59
AC_PROG_YACC()
AC_PROG_LN_S()
Gaël Bonithon's avatar
Gaël Bonithon committed
60
m4_version_prereq([2.70], [AC_PROG_LEX(noyywrap)], [AC_PROG_LEX])
61
AM_PROG_CC_C_O()
62
63
64
65

dnl Initialize libtool
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
66

Benedikt Meurer's avatar
Benedikt Meurer committed
67
dnl Check for standard header files
68
69
70
71
72
73
74
75
76
77
AC_CHECK_HEADERS([assert.h errno.h pthread.h stdint.h time.h sys/types.h unistd.h wctype.h])

dnl Checks for typedefs, structures, and compiler characteristics (libical)
AC_C_CONST()
AC_TYPE_SIZE_T()
AC_TYPE_MODE_T()
AC_STRUCT_TM()

dnl Checks for library functions (libical)
AC_CHECK_FUNCS([gmtime_r iswspace strdup snprintf])
Benedikt Meurer's avatar
Benedikt Meurer committed
78
79

dnl Check for i18n support
Jean-François Wauthy's avatar
Jean-François Wauthy committed
80
XDT_I18N([@LINGUAS@])
Benedikt Meurer's avatar
Benedikt Meurer committed
81
82

dnl Check for required packages
83

84
85
86
87
88
dnl *******************************
dnl *** Check for X11 installed ***
dnl *******************************
XDT_CHECK_LIBX11_REQUIRE()

Erkki Moorits's avatar
Erkki Moorits committed
89
dnl XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [xfce_minimum_version])
90
91
AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_52, Warn when using post 2_52 APIs)
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_52, Don't warn about post 2_52 deprecations)
92
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [glib_minimum_version])
Erkki Moorits's avatar
Erkki Moorits committed
93
XDT_CHECK_PACKAGE([LIBGTK], [gtk+-3.0], [gtk_minimum_version])
Erkki Moorits's avatar
Erkki Moorits committed
94
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [xfce_minimum_version])
95
96
97
98

dnl ************************************************
dnl *** Optional support for Xfce Panel          ***
dnl ************************************************
Erkki Moorits's avatar
Erkki Moorits committed
99
100
101
XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0],
                           [xfce_minimum_version], [libxfce4panel],
                           [LIBXFCE4PANEL support])
102

103
104
105
if test x"$LIBXFCE4PANEL_FOUND" = x"yes"; then
   XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [xfce_minimum_version])
fi
Juha Kautto's avatar
Juha Kautto committed
106

107
108
109
110
111
112
113
114
115
116
117
118
119
120
dnl *********************************************
dnl *** Optional support for external libical ***
dnl *********************************************
dnl *** This is optional NOW, but will become mandatory after external
dnl *** libical can do what Orage internal version can do or Orage works
dnl *** with it.
XDT_CHECK_OPTIONAL_PACKAGE([LIBICAL], [libical],
                           [libical_minimum_version], [libical],
                           [LIBICAL support])

if test x"$LIBICAL_FOUND" = x"yes"; then
echo "* LIBICAL support:           yes"
else
echo "* LIBICAL support:           no"
121
dnl the ical magic
Juha Kautto's avatar
Juha Kautto committed
122
ac_INCLUDED_LIBICAL=yes
123
ac_TZ_CONVERT_CHECKS=yes
124
125
126

dnl Check for additional programs (libical)
AC_CHECK_PROGS([AR], [ar aal], [ar])
127
128
AC_CHECK_PROGS([PERL], [perl5 perl])

Juha Kautto's avatar
Juha Kautto committed
129
130
AC_MSG_CHECKING(for Berkeley DB4 support)
AC_ARG_WITH(bdb4, [  --with-bdb4             Add support for Berkeley DB 4.0],
131
[case $with_bdb4 in
Juha Kautto's avatar
Juha Kautto committed
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
    yes)	AC_MSG_RESULT(yes)
    AC_MSG_RESULT(  Adding Berkeley DB support)
    WITH_BDB4="yes"
    ;;
    no)		AC_MSG_RESULT(no)
    ;;
    *)		AC_MSG_RESULT(no)
    AC_MSG_RESULT(Ignoring unknown argument to --with-bdb4: $with_bdb4)
    ;;
esac],
AC_MSG_RESULT(no))

if test x$WITH_BDB4 = xyes; then
  AC_ARG_WITH(bdb4_dir, [  --with-bdb4-dir=PATH    Use PATH as location of BerkeleyDB 4.0],
     BDB_DIR=$withval,
     BDB_DIR=/usr/local/BerkeleyDB.4.0
  )

  AC_MSG_CHECKING(for Berkeley DB include files)
  if test -f $BDB_DIR/include/db.h; then
   BDB_DIR_INCLUDE=$BDB_DIR/include
   AC_MSG_RESULT($BDB_DIR_INCLUDE)
  else
    if test -f $BDB_DIR/include/db4/db.h; then
     BDB_DIR_INCLUDE=$BDB_DIR/include/db4
157
158
     AC_MSG_RESULT($BDB_DIR_INCLUDE)
    else
Juha Kautto's avatar
Juha Kautto committed
159
160
     WITH_BDB4="no"
     AC_MSG_RESULT(not found!)
161
    fi
Juha Kautto's avatar
Juha Kautto committed
162
  fi
163

Juha Kautto's avatar
Juha Kautto committed
164
165
166
167
168
169
170
  AC_MSG_CHECKING(for Berkeley DB libraries)
  if test -f $BDB_DIR/lib/libdb-4.0.la; then
   BDB_DIR_LIB=$BDB_DIR/lib
   BDB_LIB=libdb-4.0.la
   AC_MSG_RESULT($BDB_DIR_LIB $BDB_LIB)
  else
    if test -f $BDB_DIR/lib/libdb4.la; then
171
     BDB_DIR_LIB=$BDB_DIR/lib
Juha Kautto's avatar
Juha Kautto committed
172
     BDB_LIB=libdb4.la
173
174
     AC_MSG_RESULT($BDB_DIR_LIB $BDB_LIB)
    else
Juha Kautto's avatar
Juha Kautto committed
175
176
     WITH_BDB4="no"
     AC_MSG_RESULT(not found!)
177
178
179
    fi
  fi

Juha Kautto's avatar
Juha Kautto committed
180
181
182
183
184
185
186
187
188
189
190
191
192
  AC_SUBST(BDB_DIR)
  AC_SUBST(BDB_DIR_INCLUDE)
  AC_SUBST(BDB_DIR_LIB)
  AC_SUBST(BDB_LIB)
  dnl 4.0 is required...
  BDB_VERSION="4.0"
  AC_SUBST(BDB_VERSION)
fi

AC_MSG_CHECKING(whether to define _REENTRANT)
AC_ARG_ENABLE(reentrant, [  --enable-reentrant      define _REENTRANT to enable reentrant system calls],
[ case "${enableval}" in
  no)
193
    AC_MSG_RESULT(no)
Juha Kautto's avatar
Juha Kautto committed
194
195
    ac_cv_reentrant=no
    ;;
196
  *)
Juha Kautto's avatar
Juha Kautto committed
197
198
199
200
201
202
203
    AC_MSG_RESULT(yes)
    AC_DEFINE([ICAL_REENTRANT], ,[Define if we want _REENTRANT]) [CFLAGS="$CFLAGS -D_REENTRANT"]
    ac_cv_reentrant=yes
    ;;
  esac ],
  AC_MSG_RESULT(no)
)
204
case "${host}" in
Juha Kautto's avatar
Juha Kautto committed
205
206
207
208
209
210
211
212
213
214
215
216
217
        *-*-freebsdelf4* )
    AC_MSG_RESULT(checking for pthread_create in -lpthread... -pthread (FreeBSD 4.x style))
    AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
    PTHREAD_LIBS=-pthread;;

  *)
  AC_CHECK_LIB([pthread], [pthread_create], [have_pthread=yes])
  if test "x$have_pthread" = xyes; then
     AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
     PTHREAD_LIBS=-lpthread
  fi;;
esac
AC_SUBST([PTHREAD_LIBS])
218
219
220
221
222
223
224
225
226
227
228
LIBICAL_DIRS="
libical/Makefile
libical/design-data/Makefile
libical/doc/Makefile
libical/scripts/Makefile
libical/src/Makefile
libical/src/libical/Makefile
libical/src/libical/icalversion.h
libical/src/libicalss/Makefile
libical/zoneinfo/Makefile"
fi
Juha Kautto's avatar
Juha Kautto committed
229

230
231
232
233
234
dnl **********************************
dnl *** check if we have _NL_TIME_FIRST_WEEKDAY 
dnl *** note that it is an enum and not a define
dnl **********************************
AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
Gaël Bonithon's avatar
Gaël Bonithon committed
235
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <langinfo.h>], [
236
237
char c;
c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
Gaël Bonithon's avatar
Gaël Bonithon committed
238
])], nl_ok=yes, nl_ok=no)
239
240
241
242
243
244
AC_MSG_RESULT($nl_ok)
if test "$nl_ok" = "yes"; then
  AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
      [Define if _NL_TIME_FIRST_WEEKDAY is available])
fi

245
AM_CONDITIONAL([INCLUDED_LIBICAL], [test x"$ac_INCLUDED_LIBICAL" = x"yes"])
246
AM_CONDITIONAL([HAVE_PTHREAD], [test x"$have_pthread" = x"yes"])
247
248
AM_CONDITIONAL([WITH_BDB4], [test x"$WITH_BDB4" = x"yes"])

Juha Kautto's avatar
Juha Kautto committed
249
250
251
252
dnl **********************************
dnl *** Optional support for D-BUS ***
dnl **********************************
XDT_CHECK_OPTIONAL_PACKAGE([DBUS], [dbus-glib-1],
253
254
                           [dbus_minimum_version], [dbus],
                           [D-BUS support])
Juha Kautto's avatar
Juha Kautto committed
255

Juha Kautto's avatar
Juha Kautto committed
256
257
258
259
dnl **************************************
dnl *** Optional support for libnotify ***
dnl **************************************
XDT_CHECK_OPTIONAL_PACKAGE([NOTIFY], [libnotify],
260
                           [notify_minimum_version], [libnotify],
Juha Kautto's avatar
Juha Kautto committed
261
262
                           [LIBNOTIFY support])

263
264
265
dnl **************************************
dnl *** Check support for libpopt      ***
dnl **************************************
266
267
268
XDT_CHECK_OPTIONAL_PACKAGE([LIBPOPT], [popt],
                           [libpopt_minimum_version], [libpopt],
                           [LIBPOPT support])
269

270
271
272
273
274
275
if test x"$ac_TZ_CONVERT_CHECKS" = x"yes" && test x"$LIBPOPT_FOUND" = x"yes"; then
ac_BUILD_TZ_CONVERT=yes
fi

AM_CONDITIONAL([BUILD_TZ_CONVERT], [test x"$ac_BUILD_TZ_CONVERT" = x"yes"])

276
277
278
279
280
dnl ************************************************
dnl *** Optional support for automatic archiving ***
dnl ************************************************
have_archive="no"
AC_ARG_ENABLE([archive],
Gaël Bonithon's avatar
Gaël Bonithon committed
281
282
AS_HELP_STRING([--enable-archive], [use automatic archiving (defaut=yes)])
AS_HELP_STRING([--disable-archive], [do not use automatic archiving]),
283
284
285
286
287
288
  [], [enable_archive=yes])
if test x"$enable_archive" = x"yes"; then
    AC_DEFINE([HAVE_ARCHIVE], [1], [Define to enable archiving])
    have_archive="yes"
fi

289
290
291
292
293
294
295
296
dnl ************************************************
dnl *** Optional support for 4.6 Xfce            ***
dnl ************************************************
dnl XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0],
dnl                            [xfce_minimum_version], [libxfcegui4],
dnl                            [LIBXFCEGUI4 support])

dnl ************************************************
Erkki Moorits's avatar
Erkki Moorits committed
297
dnl *** Optional support for Xfce                ***
298
dnl ************************************************
Erkki Moorits's avatar
Erkki Moorits committed
299
300
301
XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4UI], [libxfce4ui-2],
                           [xfce_minimum_version], [libxfce4ui],
                           [LIBXFCE4UI support])
302

303
dnl Check for debugging support
Juha Kautto's avatar
Juha Kautto committed
304
305
dnl BM_DEBUG_SUPPORT()
XDT_FEATURE_DEBUG
306

307
308
309
310
dnl the intention was to use variable
dnl $LIBICAL_DIRS
dnl to control if libical is being compiled or not, but only very
dnl recent autotools can have such variables in AC_OUTPUT.
311
dnl Reverting back to full list until time is right for using it.
312
313
314
dnl This causes some extra work at compile time, but should not cause
dnl any issues to users.

Gaël Bonithon's avatar
Gaël Bonithon committed
315
AC_CONFIG_FILES([
Benedikt Meurer's avatar
Benedikt Meurer committed
316
Makefile
317
318
319
320
321
322
323
324
325
libical/Makefile
libical/design-data/Makefile
libical/doc/Makefile
libical/scripts/Makefile
libical/src/Makefile
libical/src/libical/Makefile
libical/src/libical/icalversion.h
libical/src/libicalss/Makefile
libical/zoneinfo/Makefile
326
icons/Makefile
newhoa's avatar
newhoa committed
327
328
329
icons/16x16/Makefile
icons/24x24/Makefile
icons/32x32/Makefile
330
icons/48x48/Makefile
newhoa's avatar
newhoa committed
331
332
icons/64x64/Makefile
icons/128x128/Makefile
333
icons/160x160/Makefile
Benedikt Meurer's avatar
Benedikt Meurer committed
334
icons/scalable/Makefile
Benedikt Meurer's avatar
Benedikt Meurer committed
335
po/Makefile.in
336
sounds/Makefile
Benedikt Meurer's avatar
Benedikt Meurer committed
337
src/Makefile
Graf's avatar
Graf committed
338
plugin/Makefile
Juha Kautto's avatar
Juha Kautto committed
339
panel-plugin/Makefile
Juha Kautto's avatar
Juha Kautto committed
340
globaltime/Makefile
Juha Kautto's avatar
Juha Kautto committed
341
tz_convert/Makefile
Benedikt Meurer's avatar
Benedikt Meurer committed
342
])
Gaël Bonithon's avatar
Gaël Bonithon committed
343
AC_OUTPUT
Juha Kautto's avatar
Juha Kautto committed
344
345

dnl ***************************
Juha Kautto's avatar
Juha Kautto committed
346
dnl *** Print configuration ***
Juha Kautto's avatar
Juha Kautto committed
347
348
349
350
351
352
353
354
355
dnl ***************************
echo
echo "Build Configuration:"
echo
if test x"$DBUS_FOUND" = x"yes"; then
echo "* D-BUS support:             yes"
else
echo "* D-BUS support:             no"
fi
Juha Kautto's avatar
Juha Kautto committed
356
357
358
359
360
if test x"$NOTIFY_FOUND" = x"yes"; then
echo "* LIBNOTIFY support:         yes"
else
echo "* LIBNOTIFY support:         no"
fi
361
if test x"$LIBICAL_FOUND" = x"yes"; then
362
echo "* LIBICAL support:           yes, and not building tz_convert "
363
else
364
echo "* LIBICAL support:           no. Using Orage local libical"
365
if test x"$LIBPOPT_FOUND" = x"yes"; then
366
echo "* libpopt available:         yes, building tz_convert"
367
else
368
369
echo "* libpopt not available:     no, not building tz_convert"
fi
370
371
fi
echo "* Automatic archiving:       $have_archive"
372
373
374
375
if test x"$LIBXFCE4PANEL_FOUND" = x"yes"; then
echo "* LIBXFCE4PANEL support:     yes, building xfce panel plugin"
else
echo "* LIBXFCE4PANEL support:     no, not building xfce panel plugin"
376
fi
Erkki Moorits's avatar
Erkki Moorits committed
377
378
379
380
381
if test x"$LIBXFCE4UI_FOUND" = x"yes"; then
echo "* LIBXFCE4UI support:        yes"
else
echo "* LIBXFCE4UI support:        no"
fi
Juha Kautto's avatar
Juha Kautto committed
382
echo