1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id: configure.in,v 1.21 2009/11/08 18:14:47 mrsam Exp $
4 dnl Copyright 1998 - 2009 Double Precision, Inc. See COPYING for
5 dnl distribution information.
7 AC_INIT(rfc822lib, 0.13, [courier-users@lists.sourceforge.net])
9 >confdefs.h # Kill PACKAGE_ macros
11 AC_CONFIG_SRCDIR(rfc822.c)
12 AM_INIT_AUTOMAKE([foreign no-define])
13 AM_CONFIG_HEADER(config.h)
15 dnl Checks for programs.
16 AC_USE_SYSTEM_EXTENSIONS
20 if test "$GCC" = yes ; then
21 CXXFLAGS="$CXXFLAGS -Wall"
22 CFLAGS="$CFLAGS -Wall"
25 dnl Checks for libraries.
27 dnl Checks for header files.
29 AC_CHECK_HEADERS(locale.h)
31 dnl Checks for typedefs, structures, and compiler characteristics.
36 dnl Checks for library functions.
38 AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
39 [Support IDN (needs GNU Libidn)]),
40 libidn=$withval, libidn=yes)
42 if test "$libidn" != "no"
44 PKG_CHECK_MODULES(LIBIDN, libidn >= 0.0.0, [libidn=yes], [libidn=no])
45 if test "$libidn" != "yes"
48 AC_MSG_WARN([Libidn not found])
51 AC_DEFINE(LIBIDN, 1, [Define to 1 if you want Libidn.])
54 AC_MSG_CHECKING([if Libidn should be used])
55 AC_MSG_RESULT($libidn)
57 AC_CHECK_FUNCS(strcasecmp strncasecmp setlocale)
59 AC_CACHE_CHECK([how to calculate alternate timezone],librfc822_cv_SYS_TIMEZONE,
70 ], librfc822_cv_SYS_TIMEZONE=altzone,
81 ], librfc822_cv_SYS_TIMEZONE=daylight,
86 extern struct tm dummy;
90 long n=dummy.tm_gmtoff;
94 ] ,librfc822_cv_SYS_TIMEZONE=tm_gmtoff,
95 librfc822_cv_SYS_TIMEZONE=unknown
101 case $librfc822_cv_SYS_TIMEZONE in
103 AC_DEFINE_UNQUOTED(USE_TIME_GMTOFF,1,
104 [ The time offset is specified in the tm_gmtoff member ])
107 AC_DEFINE_UNQUOTED(USE_TIME_ALTZONE,1,
108 [ The daylight savings time offset is in the altzone member ])
111 AC_DEFINE_UNQUOTED(USE_TIME_DAYLIGHT,1,
112 [ The daylight savings time offset is in the tm_isdst member ])
115 AC_MSG_WARN([Cannot figure out how to calculate the alternate timezone, will use GMT])
119 AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)