Commit | Line | Data |
---|---|---|
d9898ee8 | 1 | dnl Process this file with autoconf to produce a configure script. |
d9898ee8 | 2 | dnl |
8d138742 | 3 | dnl Copyright 1998 - 2009 Double Precision, Inc. See COPYING for |
d9898ee8 | 4 | dnl distribution information. |
5 | ||
8d138742 | 6 | AC_INIT(rfc822lib, 0.13, [courier-users@lists.sourceforge.net]) |
d9898ee8 | 7 | |
8 | >confdefs.h # Kill PACKAGE_ macros | |
9 | ||
10 | AC_CONFIG_SRCDIR(rfc822.c) | |
b0322a85 | 11 | AC_CONFIG_AUX_DIR(../..) |
d9898ee8 | 12 | AM_INIT_AUTOMAKE([foreign no-define]) |
d50284c4 | 13 | AC_CONFIG_HEADERS(config.h) |
d9898ee8 | 14 | |
15 | dnl Checks for programs. | |
8d138742 | 16 | AC_USE_SYSTEM_EXTENSIONS |
d9898ee8 | 17 | AC_PROG_CC |
d9898ee8 | 18 | AC_PROG_LIBTOOL |
19 | ||
20 | if test "$GCC" = yes ; then | |
21 | CXXFLAGS="$CXXFLAGS -Wall" | |
22 | CFLAGS="$CFLAGS -Wall" | |
23 | fi | |
24 | ||
b0322a85 CE |
25 | CFLAGS="$CFLAGS -I.. -I$srcdir/.." |
26 | ||
d9898ee8 | 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 | |
b0322a85 | 37 | AC_SYS_LARGEFILE |
d9898ee8 | 38 | |
39 | dnl Checks for library functions. | |
40 | ||
8d138742 CE |
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 | ||
d9898ee8 | 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 | ],[ | |
d9898ee8 | 67 | time_t t=altzone; |
d9898ee8 | 68 | ], librfc822_cv_SYS_TIMEZONE=altzone, |
69 | ||
70 | AC_TRY_COMPILE([ | |
71 | #include <time.h> | |
72 | ],[ | |
d9898ee8 | 73 | int n=daylight; |
d9898ee8 | 74 | ], librfc822_cv_SYS_TIMEZONE=daylight, |
75 | ||
76 | AC_TRY_COMPILE([ | |
77 | #include <time.h> | |
78 | ||
79 | extern struct tm dummy; | |
80 | ],[ | |
d9898ee8 | 81 | long n=dummy.tm_gmtoff; |
d9898ee8 | 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 | ||
d9898ee8 | 107 | AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook) |
108 | ||
b0322a85 | 109 | echo "libidn=$libidn" >rfc822.config |
d9898ee8 | 110 | AC_OUTPUT(Makefile) |