c8d8e06d5989d72c58d7e2271bf5d1059a8b5f8b
[citadel.git] / libcitadel / configure.in
1 dnl   configuration script for libcitadel
2 dnl   Process this file with autoconf to produce a configure script.
3 dnl
4
5 dnl Ensure that libcitadel is configured with autoconf 2.52 or newer
6 AC_PREREQ(2.52)
7
8 AC_INIT(citadel, 1.00, example@example.com)
9 undefine([expat_version])
10
11 AC_CONFIG_SRCDIR(Makefile.in)
12 AC_CONFIG_AUX_DIR(conftools)
13
14
15 dnl
16 dnl Increment LIBREVISION if source code has changed at all
17 dnl
18 dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0
19 dnl
20 dnl If the API changes compatibly (i.e. simply adding a new function
21 dnl without changing or removing earlier interfaces), then increment LIBAGE.
22 dnl 
23 dnl If the API changes incompatibly set LIBAGE back to 0
24 dnl
25
26 LIBCURRENT=1
27 LIBREVISION=0
28 LIBAGE=0
29
30 sinclude(conftools/libtool.m4)
31 sinclude(conftools/ac_c_bigendian_cross.m4)
32
33 AC_LIBTOOL_WIN32_DLL
34 AC_PROG_LIBTOOL
35
36 AC_SUBST(LIBCURRENT)
37 AC_SUBST(LIBREVISION)
38 AC_SUBST(LIBAGE)
39
40 dnl Checks for programs.
41 AC_PROG_CC
42 AC_PROG_INSTALL
43
44 if test "$GCC" = yes ; then
45     dnl
46     dnl Be careful about adding the -fexceptions option; some versions of
47     dnl GCC don't support it and it causes extra warnings that are only
48     dnl distracting; avoid.
49     dnl
50     OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
51     CFLAGS="$OLDCFLAGS -fexceptions"
52     AC_MSG_CHECKING(whether $CC accepts -fexceptions)
53     AC_TRY_LINK( , ,
54                    AC_MSG_RESULT(yes),
55                    AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS")
56     CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'`
57 fi
58
59 dnl Checks for header files.
60 AC_HEADER_STDC
61
62 dnl Checks for typedefs, structures, and compiler characteristics.
63
64 dnl Note: Avoid using AC_C_BIGENDIAN because it does not
65 dnl work in a cross compile.
66 AC_C_BIGENDIAN_CROSS
67
68 AC_C_CONST
69 AC_TYPE_SIZE_T
70 AC_CHECK_FUNCS(memmove bcopy)
71
72 AC_CONFIG_FILES(Makefile)
73 AC_OUTPUT
74
75 abs_srcdir="`cd $srcdir && pwd`"
76 abs_builddir="`pwd`"
77 if test "$abs_srcdir" != "$abs_builddir"; then
78   make mkdir-init
79 fi