Import Upstream version 0.69.0
[hcoop/debian/courier-authlib.git] / libs / rfc822 / configure.ac
CommitLineData
d9898ee8 1dnl Process this file with autoconf to produce a configure script.
d9898ee8 2dnl
8d138742 3dnl Copyright 1998 - 2009 Double Precision, Inc. See COPYING for
d9898ee8 4dnl distribution information.
5
8d138742 6AC_INIT(rfc822lib, 0.13, [courier-users@lists.sourceforge.net])
d9898ee8 7
8>confdefs.h # Kill PACKAGE_ macros
9
10AC_CONFIG_SRCDIR(rfc822.c)
b0322a85 11AC_CONFIG_AUX_DIR(../..)
d9898ee8 12AM_INIT_AUTOMAKE([foreign no-define])
d50284c4 13AC_CONFIG_HEADERS(config.h)
d9898ee8 14
15dnl Checks for programs.
8d138742 16AC_USE_SYSTEM_EXTENSIONS
d9898ee8 17AC_PROG_CC
d9898ee8 18AC_PROG_LIBTOOL
19
20if test "$GCC" = yes ; then
21 CXXFLAGS="$CXXFLAGS -Wall"
22 CFLAGS="$CFLAGS -Wall"
23fi
24
b0322a85
CE
25CFLAGS="$CFLAGS -I.. -I$srcdir/.."
26
d9898ee8 27dnl Checks for libraries.
28
29dnl Checks for header files.
30AC_HEADER_STDC
31AC_CHECK_HEADERS(locale.h)
32
33dnl Checks for typedefs, structures, and compiler characteristics.
34AC_C_CONST
35AC_TYPE_SIZE_T
36AC_STRUCT_TM
b0322a85 37AC_SYS_LARGEFILE
d9898ee8 38
39dnl Checks for library functions.
40
8d138742
CE
41AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
42 [Support IDN (needs GNU Libidn)]),
43 libidn=$withval, libidn=yes)
44
45if test "$libidn" != "no"
46then
47 PKG_CHECK_MODULES(LIBIDN, libidn >= 0.0.0, [libidn=yes], [libidn=no])
48 if test "$libidn" != "yes"
49 then
50 libidn=no
51 AC_MSG_WARN([Libidn not found])
52 else
53 libidn=yes
54 AC_DEFINE(LIBIDN, 1, [Define to 1 if you want Libidn.])
55 fi
56fi
57AC_MSG_CHECKING([if Libidn should be used])
58AC_MSG_RESULT($libidn)
59
d9898ee8 60AC_CHECK_FUNCS(strcasecmp strncasecmp setlocale)
61
62AC_CACHE_CHECK([how to calculate alternate timezone],librfc822_cv_SYS_TIMEZONE,
63
64AC_TRY_COMPILE([
65#include <time.h>
66],[
d9898ee8 67time_t t=altzone;
d9898ee8 68], librfc822_cv_SYS_TIMEZONE=altzone,
69
70 AC_TRY_COMPILE([
71#include <time.h>
72],[
d9898ee8 73int n=daylight;
d9898ee8 74 ], librfc822_cv_SYS_TIMEZONE=daylight,
75
76 AC_TRY_COMPILE([
77#include <time.h>
78
79extern struct tm dummy;
80],[
d9898ee8 81long n=dummy.tm_gmtoff;
d9898ee8 82 ] ,librfc822_cv_SYS_TIMEZONE=tm_gmtoff,
83 librfc822_cv_SYS_TIMEZONE=unknown
84 )
85 )
86 )
87)
88
89case $librfc822_cv_SYS_TIMEZONE in
90tm_gmtoff)
91 AC_DEFINE_UNQUOTED(USE_TIME_GMTOFF,1,
92 [ The time offset is specified in the tm_gmtoff member ])
93 ;;
94altzone)
95 AC_DEFINE_UNQUOTED(USE_TIME_ALTZONE,1,
96 [ The daylight savings time offset is in the altzone member ])
97 ;;
98daylight)
99 AC_DEFINE_UNQUOTED(USE_TIME_DAYLIGHT,1,
100 [ The daylight savings time offset is in the tm_isdst member ])
101 ;;
102*)
103 AC_MSG_WARN([Cannot figure out how to calculate the alternate timezone, will use GMT])
104 ;;
105esac
106
d9898ee8 107AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
108
b0322a85 109echo "libidn=$libidn" >rfc822.config
d9898ee8 110AC_OUTPUT(Makefile)