1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([libical], [0.48], [http://freeassociation.sf.net/])
8 AM_CONFIG_HEADER(config.h)
10 dnl Initialize maintainer mode
13 dnl Checks for programs.
21 dnl Initialize libtool
26 dnl *** check for Win32
28 AC_MSG_CHECKING([whether the system provides zonefiles or we should bring our own? ])
31 use_builtin_timezone=yes
35 use_builtin_timezone=no
39 use_builtin_timezone=no
43 use_builtin_timezone=yes
48 if test "$use_builtin_timezone" = "no" ; then
49 if test ! -d /usr/share/zoneinfo; then
50 use_builtin_timezone=yes
54 AC_MSG_RESULT([$use_builtin_timezone])
55 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
57 if test "x$os_win32" = "xyes"; then
58 zoneinfo_dir="zoneinfo"
61 dnl should we override the system default?
62 AC_ARG_WITH(builtintz, [ --with-builtintz deliver our own zonefiles?],
63 [if test "x$withval" = "xyes" ; then
64 use_builtin_timezone="yes"
66 if test "x$withval" = "xno" ; then
67 use_builtin_timezone="no"
72 if test "$use_builtin_timezone" = "yes"; then
73 AC_DEFINE(USE_BUILTIN_TZDATA, [], [whether we should bring our own TZ-Data])
76 AC_SUBST(ZONE_INFO, "$zoneinfodir")
82 AC_MSG_CHECKING(for Berkeley DB4 support)
83 AC_ARG_WITH(bdb4, [ --with-bdb4 Add support for Berkeley DB 4.0],
85 yes) AC_MSG_RESULT(yes)
86 AC_MSG_RESULT( Adding Berkeley DB support)
92 AC_MSG_RESULT(Ignoring unknown argument to --with-bdb4: $with_bdb4)
97 if test x$WITH_BDB4 = xyes; then
98 AC_ARG_WITH(bdb4_dir, [ --with-bdb4-dir=PATH Use PATH as location of BerkeleyDB 4.0],
100 BDB_DIR=/usr/local/BerkeleyDB.4.0
103 AC_MSG_CHECKING(for Berkeley DB include files)
104 if test -f $BDB_DIR/include/db.h; then
105 BDB_DIR_INCLUDE=$BDB_DIR/include
106 AC_MSG_RESULT($BDB_DIR_INCLUDE)
108 if test -f $BDB_DIR/include/db4/db.h; then
109 BDB_DIR_INCLUDE=$BDB_DIR/include/db4
110 AC_MSG_RESULT($BDB_DIR_INCLUDE)
113 AC_MSG_RESULT(not found!)
117 AC_MSG_CHECKING(for Berkeley DB libraries)
118 if test -f $BDB_DIR/lib/libdb-4.0.la; then
119 BDB_DIR_LIB=$BDB_DIR/lib
121 AC_MSG_RESULT($BDB_DIR_LIB $BDB_LIB)
123 if test -f $BDB_DIR/lib/libdb4.la; then
124 BDB_DIR_LIB=$BDB_DIR/lib
126 AC_MSG_RESULT($BDB_DIR_LIB $BDB_LIB)
129 AC_MSG_RESULT(not found!)
134 AC_SUBST(BDB_DIR_INCLUDE)
135 AC_SUBST(BDB_DIR_LIB)
137 dnl 4.0 is required...
139 AC_SUBST(BDB_VERSION)
141 AM_CONDITIONAL(WITH_BDB4, test x$WITH_BDB4 = xyes)
144 dnl disable backtrace if we don't want it.
145 AC_ARG_WITH(backtrace,
146 [ --with-backtrace enable backtrace dumps in the syslog],
147 [ if test "x$withval" != "xno" ; then
148 CFLAGS="$CFLAGS -rdynamic "
149 LDFLAGS="$LDFLAGS -rdynamic "
150 SERVER_LDFLAGS="$SERVER_LDFLAGS -rdynamic "
151 AC_CHECK_FUNCS(backtrace)
156 dnl *** Yacc/Bison support
158 AC_MSG_CHECKING(whether to support development)
159 AC_ARG_WITH(devel, [ --with-devel Add development options],
163 AC_MSG_RESULT(Setting up for development: -Wall, flex, bison)
164 AC_MSG_RESULT(** Note that you will need flex 2.5.7 or higher)
166 no) AC_MSG_RESULT(no)
169 AC_MSG_RESULT(Ignoring unknown argument to --with-devel: $with_devel)
173 AM_CONDITIONAL(DEV, test x$DEV = xyes)
175 AC_CHECK_PROGS(AR, ar aal, ar)
176 AC_CHECK_PROGS(PERL, perl5 perl)
178 AC_MSG_CHECKING(whether to define _REENTRANT)
179 AC_ARG_ENABLE(reentrant, [ --enable-reentrant define _REENTRANT to enable reentrant system calls],
180 [ case "${enableval}" in
187 AC_DEFINE(ICAL_REENTRANT, ,[Define if we want _REENTRANT]) [CFLAGS="$CFLAGS -D_REENTRANT"]
195 dnl **************************************************
196 dnl ICAL_ERRORS_ARE_FATAL
197 dnl **************************************************
198 AC_MSG_CHECKING(if icalerrors_* calls should abort instead of internally signalling an error)
199 AC_ARG_ENABLE(icalerrors-are-fatal,
200 [ --enable-icalerrors-are-fatal define ICAL_ERRORS_ARE_FATAL to make icalerror_* calls fatal],
201 [ case "${enableval}" in
203 ac_cv_ical_errors_are_fatal=yes
206 ac_cv_ical_errors_are_fatal=no
209 ac_cv_ical_errors_are_fatal=no
211 AC_MSG_RESULT($ac_cv_ical_errors_are_fatal)
213 if test "x$ac_cv_ical_errors_are_fatal" != "xyes"; then
214 AC_DEFINE(ICAL_ERRORS_ARE_FATAL, 0, [Define to make icalerror_* calls abort instead of internally signalling an error])
216 AC_DEFINE(ICAL_ERRORS_ARE_FATAL, 1, [Define to make icalerror_* calls abort instead of internally signalling an error])
219 dnl **************************************************
220 dnl test/regression.c (and maybe others) needs this defined
221 dnl **************************************************
222 AC_DEFINE(NO_WARN_DEPRECATED,1,[Define to 1 if you DO NOT WANT to see deprecated messages])
223 AC_DEFINE(NO_WARN_ICAL_MALFORMEDDATA_ERROR_HACK,1,[Define to 1 if you DO NO WANT to see the warning messages related to ICAL_MALFORMEDDATA_ERROR and parsing .ics zoneinfo files])
225 AC_DEFINE(ICAL_UNIX_NEWLINE,1,[Define to terminate lines with "\n" instead of "\r\n"])
226 AC_DEFINE(ICAL_ALLOW_EMPTY_PROPERTIES,0,[Define to prevent empty properties from being replaced with X-LIC-ERROR properties])
227 dnl AC_DEFINE(ICAL_NO_EMPTY_ARRAY_DECL,1,[Define to 1 if your compile does not like lines like: struct something foo[]])
229 dnl Checks for libraries.
230 dnl Replace `main' with a function in -lical:
231 dnl AC_CHECK_LIB(ical, main)
233 dnl Check if this system can use pthreads
234 dnl HACK to support FreeBSD 4.x pthread
238 AC_MSG_RESULT(checking for pthread_create in -lpthread... -pthread (FreeBSD 4.x style))
239 AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
240 PTHREAD_LIBS=-pthread;;
243 AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
244 if test "x$have_pthread" = xyes; then
245 AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
246 PTHREAD_LIBS=-lpthread
250 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
251 AC_SUBST(PTHREAD_LIBS)
253 dnl Checks for header files.
255 AC_CHECK_HEADERS(assert.h ctype.h pthread.h stdint.h time.h sys/types.h unistd.h wctype.h endian.h sys/endian.h byteswap.h)
257 dnl Checks for typedefs, structures, and compiler characteristics.
261 AC_CHECK_TYPE(intptr_t)
264 dnl Checks for library functions.
265 AC_CHECK_FUNCS(gmtime_r isspace iswspace strdup snprintf unsetenv setenv)
267 dnl **************************************************
269 dnl **************************************************
272 [ --enable-cxx Enable C++ bindings],,enable_cxx="no")
273 AM_CONDITIONAL(WITH_CXX_BINDINGS, test x$enable_cxx = "xyes")
275 AC_PREFIX_DEFAULT(/usr/local/libical)
276 if test "$prefix" = NONE; then
277 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "$ac_default_prefix/share/libical", [where our self provided zonefiles should live])
278 ssl_dir="$ac_default_prefix/keys"
280 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "$prefix/share/libical", [where our self provided zonefiles should live])
283 dnl **************************************************
285 dnl **************************************************
288 [ --enable-java Enable Java bindings],,enable_java="no")
289 if test "x$enable_java" = "xyes"; then
290 AC_PATH_PROG(JAR, jar, /usr/local/bin/jar, /usr/local/bin:$PATH)
291 AC_PATH_PROG(JAVA, java, /usr/local/bin/java, /usr/local/bin:$PATH)
292 AC_PATH_PROG(JAVAC, javac, /usr/local/bin/javac, /usr/local/bin:$PATH)
293 AC_PATH_PROG(JAVAH, javah, /usr/local/bin/javah, /usr/local/bin:$PATH)
302 *-*-solaris*) JAVA_PLATFORM="solaris" ;;
303 *-*-linux*) JAVA_PLATFORM="linux" ;;
304 *-*-freebsd*) JAVA_PLATFORM="bsd" ;;
305 *-*-aix*) JAVA_PLATFORM="aix" ;;
306 *-sequent-*) JAVA_PLATFORM="ptx" ;;
307 *-*-hpux*) JAVA_PLATFORM="hpux" ;;
308 *-*-irix*) JAVA_PLATFORM="irix" ;;
309 *-*-os390*) JAVA_PLATFORM="os390" ;;
310 *-*-os400*) JAVA_PLATFORM="os400" ;;
311 *-apple-darwin*|*-apple-rhapsody*) JAVA_PLATFORM="darwin" ;;
312 *) JAVA_PLATFORM="unknown" ;;
315 AC_SUBST(JAVA_PLATFORM)
318 AM_CONDITIONAL(WITH_JAVA, test x$enable_java = "xyes")
320 dnl **************************************************
321 dnl * Check for Python
322 dnl **************************************************
324 AC_ARG_ENABLE(python,
325 [ --enable-python Enable python bindings],,enable_python="no")
327 if test "x$enable_python" = "xyes"; then
328 AM_PATH_PYTHON([2.3], , [:])
329 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
330 AC_CHECK_PROG(swig_val, swig, true, false)
331 AM_CONDITIONAL([HAVE_SWIG], [test "x$swig_val" = "xtrue"])
333 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
334 AC_CHECK_HEADER([python$PYTHON_VERSION/Python.h],[],[AC_MSG_ERROR([Can't find python header files])])
335 if test -f "$PY_PREFIX/include/python$PYTHON_VERSION/Python.h"; then
337 PY_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
340 # SWIG needs PIC in order to work.
341 CFLAGS="$CFLAGS -fPIC"
344 AC_CONFIG_FILES([src/python/Makefile])
346 AM_CONDITIONAL([HAVE_PYTHON], false)
347 AM_CONDITIONAL([HAVE_SWIG], false)
350 if test "$use_builtin_timezone" = "yes"; then
351 AC_CONFIG_FILES([zoneinfo/Makefile])
354 AC_CONFIG_FILES([Makefile])
355 AC_CONFIG_FILES([design-data/Makefile])
356 AC_CONFIG_FILES([doc/Makefile])
357 AC_CONFIG_FILES([examples/Makefile])
358 AC_CONFIG_FILES([scripts/Makefile])
359 AC_CONFIG_FILES([src/Makefile])
360 AC_CONFIG_FILES([src/libical/Makefile])
361 AC_CONFIG_FILES([src/libical/icalversion.h])
362 AC_CONFIG_FILES([src/libical/icalerror.h])
363 AC_CONFIG_FILES([src/libicalss/Makefile])
364 AC_CONFIG_FILES([src/libicalvcal/Makefile])
365 AC_CONFIG_FILES([src/test/Makefile])
366 AC_CONFIG_FILES([test-data/Makefile])
367 AC_CONFIG_FILES([libical.pc])