1AC_INIT()
2
3USER_CPPFLAGS=$CPPFLAGS
4USER_LDFLAGS=$LDFLAGS
5CPPFLAGS="-I/usr/local/include $CPPFLAGS"
6LDFLAGS="-L/usr/local/lib $LDFLAGS"
7
8AC_MSG_CHECKING(for VERSION)
9if test -f VERSION; then
10	af_version=`cat VERSION`
11	AC_MSG_RESULT($af_version)
12else
13	af_version=`date +%Y%m%d`
14	AC_MSG_RESULT(no; using $af_version)
15fi
16
17AC_PROG_CC
18AC_PROG_CXX
19
20AC_CHECK_FUNC(getopt_long, , AC_CHECK_LIB(iberty, getopt_long))
21
22AC_CHECK_SIZEOF(short int, 0)
23AC_CHECK_SIZEOF(int, 0)
24AC_CHECK_SIZEOF(long int, 0)
25
26xml=yes
27AC_ARG_ENABLE(xml, [  --disable-xml           disable linking with Xerces and XML support], [
28	if test "$enableval" = "no"; then
29		xml=no
30	fi
31] )
32AC_MSG_CHECKING(whether xml is enabled)
33if test "$xml" = "yes"; then
34	AC_MSG_RESULT(yes)
35	AC_CHECK_LIB(xerces-c, main, [
36			xmllib=yes
37			LIBS="-lxerces-c $LIBS"
38			AC_DEFINE(HAVE_LIBXERCES_C)
39		],
40		xmllib=no)
41	AC_CHECK_HEADERS([xercesc/util/XercesVersion.hpp], xmlinc=yes, xmlinc=no)
42else
43	AC_MSG_RESULT(no)
44fi
45xmlon=no
46if test "$xmllib" = "yes"; then
47	if test "$xmlinc" = "yes"; then
48		xmlon=yes
49		AC_DEFINE(ETYMON_AF_XML)
50	fi
51fi
52
53stemmer=no
54rm -f src/stem.d
55AC_MSG_CHECKING(for stemmer)
56if test -f src/porter.cc; then
57	stemmer=yes
58	AC_DEFINE(HAVE_STEMMER)
59fi
60AC_MSG_RESULT($stemmer)
61
62AC_MSG_NOTICE(creating src/version.h)
63echo "#define AF_VERSION \"$af_version\"" > src/version.h
64AC_MSG_NOTICE(creating doc/version.texi)
65echo "@set VERSION $af_version" > doc/version.texi
66
67AC_CONFIG_HEADER(src/config.h)
68AC_CONFIG_FILES(src/Makefile)
69AC_CONFIG_FILES(doc/Makefile)
70
71AC_SUBST(BIN, $bin)
72
73AC_OUTPUT()
74
75echo ""
76echo "User options"
77echo "------------"
78echo "Install prefix                : $prefix"
79echo "CPPFLAGS                      : $USER_CPPFLAGS"
80echo "LDFLAGS                       : $USER_LDFLAGS"
81echo "Enable XML                    : $xml"
82echo ""
83echo "Configure results"
84echo "-----------------"
85echo "Amberfish version             : $af_version"
86echo "C compiler                    : $CC"
87echo "C++ compiler                  : $CXX"
88if test "$xml" = "yes"; then
89	echo "Xerces-C library found        : $xmllib"
90	echo "Xerces-C headers found        : $xmlinc"
91fi
92echo "XML support enabled           : $xmlon"
93echo "Stemmer enabled               : $stemmer"
94echo ""
95