Imported Upstream version 0.66.1
[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])
13AM_CONFIG_HEADER(config.h)
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],[
67int main()
68{
69time_t t=altzone;
70
71 return (0);
72}
73], librfc822_cv_SYS_TIMEZONE=altzone,
74
75 AC_TRY_COMPILE([
76#include <time.h>
77],[
78int main()
79{
80int n=daylight;
81
82 return (0);
83}
84 ], librfc822_cv_SYS_TIMEZONE=daylight,
85
86 AC_TRY_COMPILE([
87#include <time.h>
88
89extern struct tm dummy;
90],[
91int main()
92{
93long n=dummy.tm_gmtoff;
94
95 return (0);
96}
97 ] ,librfc822_cv_SYS_TIMEZONE=tm_gmtoff,
98 librfc822_cv_SYS_TIMEZONE=unknown
99 )
100 )
101 )
102)
103
104case $librfc822_cv_SYS_TIMEZONE in
105tm_gmtoff)
106 AC_DEFINE_UNQUOTED(USE_TIME_GMTOFF,1,
107 [ The time offset is specified in the tm_gmtoff member ])
108 ;;
109altzone)
110 AC_DEFINE_UNQUOTED(USE_TIME_ALTZONE,1,
111 [ The daylight savings time offset is in the altzone member ])
112 ;;
113daylight)
114 AC_DEFINE_UNQUOTED(USE_TIME_DAYLIGHT,1,
115 [ The daylight savings time offset is in the tm_isdst member ])
116 ;;
117*)
118 AC_MSG_WARN([Cannot figure out how to calculate the alternate timezone, will use GMT])
119 ;;
120esac
121
d9898ee8 122AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
123
b0322a85 124echo "libidn=$libidn" >rfc822.config
d9898ee8 125AC_OUTPUT(Makefile)