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)
63
64AC_ARG_WITH(package, [], package="$withval",
65	[
66		package="$PACKAGE"
67		ac_configure_args="$ac_configure_args --with-package=$PACKAGE"
68	])
69
70AC_ARG_WITH(version, [], version="$withval",
71	[
72		version="$VERSION"
73		ac_configure_args="$ac_configure_args --with-version=$VERSION"
74	])
75
76AC_DEFINE_UNQUOTED(RFC2045PKG,"$package", [ Package that uses librfc2045.a ])
77AC_DEFINE_UNQUOTED(RFC2045VER,"$version", [ Package that uses librfc2045.a ])
78
79AC_ARG_ENABLE(mimecharset,
80	[  --enable-mimecharset=charset   Default MIME charset to set on new messages],
81	RFC2045CHARSET="$enableval", RFC2045CHARSET="utf-8")
82
83CFLAGS="$CFLAGS -I.. -I${srcdir}/.."
84CXXFLAGS="$CXXFLAGS -I.. -I${srcdir}/.."
85AC_SUBST(rfc822includedir)
86
87AC_SUBST(RFC2045CHARSET)
88
89AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
90
91. ../rfc822/rfc822.config
92
93AM_CONDITIONAL(HAVE_LIBIDN, test "$libidn" = "yes")
94AC_OUTPUT(Makefile rfc2045charset.h)
95