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