1dnl
2dnl Copyright 1998 - 2011 Double Precision, Inc.  See COPYING for
3dnl distribution information.
4AC_INIT(rfc2045lib, 0.20, [courier-maildrop@lists.sourceforge.net])
5
6>confdefs.h  # Kill PACKAGE_ macros
7
8AC_CONFIG_SRCDIR(rfc2045.c)
9AC_CONFIG_AUX_DIR(../..)
10AM_INIT_AUTOMAKE([foreign no-define])
11AC_CONFIG_HEADERS(rfc2045_config.h)
12
13dnl Checks for programs.
14AC_USE_SYSTEM_EXTENSIONS
15AC_PROG_CC
16AC_PROG_CC_C99
17AC_PROG_CXX
18AC_LIBTOOL_DLOPEN
19AM_PROG_LIBTOOL
20
21if test "$GCC" = yes ; then
22        CXXFLAGS="$CXXFLAGS -Wall"
23        CFLAGS="$CFLAGS -Wall"
24fi
25
26dnl Checks for libraries.
27
28dnl Checks for header files.
29AC_HEADER_STDC
30AC_CHECK_HEADERS(unistd.h sys/wait.h strings.h locale.h)
31
32AC_CACHE_CHECK([for missing gethostname prototype],rfc2045_cv_SYS_GETHOSTNAME,
33
34AC_TRY_COMPILE([
35#if HAVE_UNISTD_H
36#include	<unistd.h>
37#endif
38
39extern int gethostname(int,int);
40],[
41],rfc2045_cv_SYS_GETHOSTNAME=yes,rfc2045_cv_SYS_GETHOSTNAME=no
42)
43
44)
45
46if test $rfc2045_cv_SYS_GETHOSTNAME = "no"
47then
48	AC_DEFINE_UNQUOTED(HAS_GETHOSTNAME,1,
49	[ Whether unistd.h includes a prototype for gethostname() ])
50fi
51
52dnl Checks for typedefs, structures, and compiler characteristics.
53AC_C_CONST
54AC_TYPE_OFF_T
55AC_TYPE_SIZE_T
56AC_TYPE_PID_T
57AC_SYS_LARGEFILE
58AX_COURIER_UNICODE_CXXFLAGS
59AC_SUBST(COURIER_UNICODE_CXXFLAGS)
60
61dnl Checks for library functions.
62AC_CHECK_FUNCS(setlocale)
63AC_CHECK_FUNC(strncasecmp,,CFLAGS="$CFLAGS -Dstrncasecmp=strnicmp")
64AC_CHECK_FUNC(strcasecmp,,CFLAGS="$CFLAGS -Dstrcasecmp=stricmp")
65
66AC_ARG_WITH(package, [], package="$withval",
67	[
68		package="$PACKAGE"
69		ac_configure_args="$ac_configure_args --with-package=$PACKAGE"
70	])
71
72AC_ARG_WITH(version, [], version="$withval",
73	[
74		version="$VERSION"
75		ac_configure_args="$ac_configure_args --with-version=$VERSION"
76	])
77
78AC_DEFINE_UNQUOTED(RFC2045PKG,"$package", [ Package that uses librfc2045.a ])
79AC_DEFINE_UNQUOTED(RFC2045VER,"$version", [ Package that uses librfc2045.a ])
80
81AC_ARG_ENABLE(mimecharset,
82	[  --enable-mimecharset=charset   Default MIME charset to set on new messages],
83	RFC2045CHARSET="$enableval", RFC2045CHARSET="utf-8")
84
85CFLAGS="$CFLAGS -I.. -I${srcdir}/.."
86CXXFLAGS="$CXXFLAGS -I.. -I${srcdir}/.."
87AC_SUBST(rfc822includedir)
88
89AC_SUBST(RFC2045CHARSET)
90
91AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
92
93. ../rfc822/rfc822.config
94
95AM_CONDITIONAL(HAVE_LIBIDN, test "$libidn" = "yes")
96AC_OUTPUT(Makefile rfc2045charset.h)
97