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