1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright 1998 - 2009 Double Precision, Inc. See COPYING for
4 dnl distribution information.
6 AC_INIT(rfc822lib, 0.13, [courier-users@lists.sourceforge.net])
8 >confdefs.h # Kill PACKAGE_ macros
10 AC_CONFIG_SRCDIR(rfc822.c)
11 AC_CONFIG_AUX_DIR(../..)
12 AM_INIT_AUTOMAKE([foreign no-define])
13 AC_CONFIG_HEADERS(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 CFLAGS="$CFLAGS -I.. -I$srcdir/.."
27 dnl Checks for libraries.
29 dnl Checks for header files.
31 AC_CHECK_HEADERS(locale.h)
33 dnl Checks for typedefs, structures, and compiler characteristics.
39 dnl Checks for library functions.
41 AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
42 [Support IDN (needs GNU Libidn)]),
43 libidn=$withval, libidn=yes)
45 if test "$libidn" != "no"
47 PKG_CHECK_MODULES(LIBIDN, libidn >= 0.0.0, [libidn=yes], [libidn=no])
48 if test "$libidn" != "yes"
51 AC_MSG_WARN([Libidn not found])
54 AC_DEFINE(LIBIDN, 1, [Define to 1 if you want Libidn.])
57 AC_MSG_CHECKING([if Libidn should be used])
58 AC_MSG_RESULT($libidn)
60 AC_CHECK_FUNCS(strcasecmp strncasecmp setlocale)
62 AC_CACHE_CHECK([how to calculate alternate timezone],librfc822_cv_SYS_TIMEZONE,
68 ], librfc822_cv_SYS_TIMEZONE=altzone,
74 ], librfc822_cv_SYS_TIMEZONE=daylight,
79 extern struct tm dummy;
81 long n=dummy.tm_gmtoff;
82 ] ,librfc822_cv_SYS_TIMEZONE=tm_gmtoff,
83 librfc822_cv_SYS_TIMEZONE=unknown
89 case $librfc822_cv_SYS_TIMEZONE in
91 AC_DEFINE_UNQUOTED(USE_TIME_GMTOFF,1,
92 [ The time offset is specified in the tm_gmtoff member ])
95 AC_DEFINE_UNQUOTED(USE_TIME_ALTZONE,1,
96 [ The daylight savings time offset is in the altzone member ])
99 AC_DEFINE_UNQUOTED(USE_TIME_DAYLIGHT,1,
100 [ The daylight savings time offset is in the tm_isdst member ])
103 AC_MSG_WARN([Cannot figure out how to calculate the alternate timezone, will use GMT])
107 AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
109 echo "libidn=$libidn" >rfc822.config