Imported Upstream version 0.66.1
[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 AM_CONFIG_HEADER(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 int main()
68 {
69 time_t t=altzone;
70
71 return (0);
72 }
73 ], librfc822_cv_SYS_TIMEZONE=altzone,
74
75 AC_TRY_COMPILE([
76 #include <time.h>
77 ],[
78 int main()
79 {
80 int n=daylight;
81
82 return (0);
83 }
84 ], librfc822_cv_SYS_TIMEZONE=daylight,
85
86 AC_TRY_COMPILE([
87 #include <time.h>
88
89 extern struct tm dummy;
90 ],[
91 int main()
92 {
93 long 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
104 case $librfc822_cv_SYS_TIMEZONE in
105 tm_gmtoff)
106 AC_DEFINE_UNQUOTED(USE_TIME_GMTOFF,1,
107 [ The time offset is specified in the tm_gmtoff member ])
108 ;;
109 altzone)
110 AC_DEFINE_UNQUOTED(USE_TIME_ALTZONE,1,
111 [ The daylight savings time offset is in the altzone member ])
112 ;;
113 daylight)
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 ;;
120 esac
121
122 AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
123
124 echo "libidn=$libidn" >rfc822.config
125 AC_OUTPUT(Makefile)