1 dnl Zebra, Index Data Aps, 1995-2002
2 dnl $Id: configure.in,v 1.54 2002-11-08 19:59:52 adam Exp $
4 AC_INIT(include/zebraver.h)
5 AM_INIT_AUTOMAKE(idzebra,1.3.3)
6 dnl ------ Substitutions
10 dnl ------ Checking programs
18 AC_ARG_WITH(dtd, [ --with-dtd[=DIR] Use docbookx.dtd in DIR],
20 if test -f "$withval/docbookx.dtd"; then
24 AC_MSG_CHECKING(for docbookx.dtd)
25 for d in /usr/share/sgml/docbook/dtd/xml/4.1.2 \
26 /usr/share/sgml/docbook/xml-dtd-4.1.2* \
27 /usr/share/sgml/docbook/xml-dtd-4.1 \
28 /usr/share/sgml/docbook/dtd/xml/4.0 \
29 /usr/lib/sgml/dtd/docbook-xml
31 if test -f $d/docbookx.dtd; then
37 if test -z "$DTD_DIR"; then
38 AC_MSG_RESULT(Not found)
42 AC_ARG_WITH(dsssl,[ --with-dsssl[=DIR] Use DSSSL in DIR/{html,print}/docbook.dsl],
44 if test -f "$withval/html/docbook.dsl"; then
48 AC_MSG_CHECKING(for docbook.dsl)
49 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
50 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
51 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh
53 if test -f $d/html/docbook.dsl; then
59 if test -z "$DSSSL_DIR"; then
60 AC_MSG_RESULT(Not found)
64 AC_ARG_ENABLE(threads, [ --disable-threads disable threads],[enable_threads=$enableval],[enable_threads=yes])
65 if test "$enable_threads" = "yes"; then
72 dnl ------ Look for Tcl
73 dnl See if user has specified location of tclConfig.sh; otherwise
74 dnl see if tclConfig.sh exists in same prefix lcoation as tclsh; otherwise
79 AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR tclConfig.sh in DIR], [tclconfig=$withval])
80 if test "x$tclconfig" = xNONE; then
82 AC_PREFIX_PROGRAM(tclsh)
83 tclconfig=${prefix}/lib
85 if test ! -r ${tclconfig}/tclConfig.sh; then
86 # Not found, try search for Tcl on Debian systems.
87 for d in /usr/lib/tcl*; do
88 if test -f $d/tclConfig.sh; then
94 AC_MSG_CHECKING(for Tcl)
95 if test -r ${tclconfig}/tclConfig.sh; then
96 . ${tclconfig}/tclConfig.sh
97 if test -r ${tclconfig}/../generic/tcl.h; then
98 TCL_INCLUDE=-I${tclconfig}/../generic
99 TCL_LIB="$TCL_BUILD_LIB_SPEC $TCL_LIBS"
100 elif test -d ${TCL_PREFIX}/include/tcl${TCL_VERSION}; then
101 TCL_INCLUDE=-I${TCL_PREFIX}/include/tcl${TCL_VERSION}
102 TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS"
104 TCL_INCLUDE=-I${TCL_PREFIX}/include
105 TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS"
107 SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
108 SHLIB_LD=$TCL_SHLIB_LD
109 SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
110 SHLIB_VERSION=$TCL_SHLIB_VERSION
111 AC_MSG_RESULT($TCL_VERSION)
112 AC_DEFINE(HAVE_TCL_H,1)
114 AC_MSG_RESULT(Not found)
115 AC_DEFINE(HAVE_TCL_H,0)
119 AC_CHECK_HEADERS(sys/times.h)
122 AC_CHECK_FUNCS(mkstemp)
125 AC_ARG_WITH(iconv, [ --with-iconv[=DIR] iconv library in DIR])
126 if test "$with_iconv" != "no"; then
127 AC_MSG_CHECKING(for iconv)
129 oldCPPFLAGS="${CPPFLAGS}"
130 if test "$with_iconv" != "yes" -a "$with_iconv" != ""; then
131 LIBS="$LIBS -L${with_iconv}/lib"
132 CPPFLAGS="${CPPFLAGS} -I${with_iconv}/include"
137 static void f() {iconv_t t = iconv_open("", ""); }
139 AC_DEFINE(HAVE_ICONV_H)
146 static void f() {iconv_t t = iconv_open("", ""); }
148 AC_DEFINE(HAVE_ICONV_H)
152 CPPFLAGS="$oldCPPFLAGS"
159 AC_CHECK_LIB(bz2,bzCompressInit)
160 if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then
161 AC_CHECK_HEADERS(bzlib.h)
163 AC_CHECK_LIB(bz2,BZ2_bzCompressInit)
164 if test "$ac_cv_lib_bz2_BZ2_bzCompressInit" = "yes"; then
165 AC_CHECK_HEADERS(bzlib.h)
171 AC_ARG_WITH(expat, [ --with-expat[=DIR] EXPAT library in DIR],[expat=$withval])
172 if test "$expat" != "no"; then
175 if test "$expat" != "yes"; then
176 EXPAT_CFLAGS="-I$expat/include"
177 EXPAT_LIBS="-L$expat/lib"
178 CFLAGS="$EXPAT_CFLAGS $CFLAGS"
179 LIBS="$EXPAT_LIBS $LIBS"
181 AC_CHECK_LIB(expat,XML_ParserCreate,[LIBS="$LIBS -lexpat"])
182 if test "$ac_cv_lib_expat_XML_ParserCreate" = "yes"; then
183 AC_CHECK_HEADERS(expat.h)
189 dnl ------- 64 bit files
190 AC_MSG_CHECKING(for LFS)
191 AC_TRY_RUN([#define _FILE_OFFSET_BITS 64
192 #include <sys/types.h>
198 int main(int argc, char **argv)
204 if (sizeof(off_t) != 8)
207 sprintf (tmp_str, "%Ld", o+o+o);
208 if (strcmp (tmp_str, "6000000000"))
210 fd = creat ("config.tmp", 0644);
213 area.l_type = F_WRLCK;
214 area.l_whence = SEEK_SET;
215 area.l_len = area.l_start = 0L;
216 if (fcntl(fd, F_SETLKW, &area))
219 unlink ("config.tmp");
222 ],bits=64,bits=32,bits=32)
223 if test "$bits" = "64"; then
224 AC_DEFINE(_FILE_OFFSET_BITS,64)
230 dnl ------ ANSI C Header files
232 if test "$ac_cv_header_stdc" = "no"; then
233 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
235 dnl ------ Create Makefiles
258 test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile
260 examples/Makefile examples/gils/Makefile