+dnl ----- DOCBOOK DTD
+AC_SUBST(DTD_DIR)
+AC_ARG_WITH(dtd, [ --with-dtd[=DIR] Use docbookx.dtd in DIR],
+[
+ if test -f "$withval/docbookx.dtd"; then
+ DTD_DIR=$withval
+ fi
+],[
+ AC_MSG_CHECKING(for docbookx.dtd)
+ for d in /usr/share/sgml/docbook/dtd/xml/4.1.2 \
+ /usr/share/sgml/docbook/xml-dtd-4.1.2* \
+ /usr/share/sgml/docbook/xml-dtd-4.1 \
+ /usr/share/sgml/docbook/dtd/xml/4.0 \
+ /usr/lib/sgml/dtd/docbook-xml
+ do
+ if test -f $d/docbookx.dtd; then
+ AC_MSG_RESULT($d)
+ DTD_DIR=$d
+ break
+ fi
+ done
+ if test -z "$DTD_DIR"; then
+ AC_MSG_RESULT(Not found)
+ fi
+])
+AC_SUBST(DSSSL_DIR)
+AC_ARG_WITH(dsssl,[ --with-dsssl[=DIR] Use DSSSL in DIR/{html,print}/docbook.dsl],
+[
+ if test -f "$withval/html/docbook.dsl"; then
+ DSSSL_DIR=$withval
+ fi
+],[
+ AC_MSG_CHECKING(for docbook.dsl)
+ for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
+ /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
+ /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh
+ do
+ if test -f $d/html/docbook.dsl; then
+ AC_MSG_RESULT($d)
+ DSSSL_DIR=$d
+ break
+ fi
+ done
+ if test -z "$DSSSL_DIR"; then
+ AC_MSG_RESULT(Not found)
+ fi
+])
+dnl
+AC_ARG_ENABLE(threads, [ --disable-threads disable threads],[enable_threads=$enableval],[enable_threads=yes])
+if test "$enable_threads" = "yes"; then
+ yazflag=threads
+else
+ yazflag=""
+fi
+YAZ_INIT($yazflag)
+if echo "$YAZINC"|grep YAZ_POSIX_THREADS=1 >/dev/null; then
+ AM_CONDITIONAL(ISTHR,true)
+else
+ AM_CONDITIONAL(ISTHR,false)
+fi
+dnl ------ Look for Tcl
+dnl See if user has specified location of tclConfig.sh; otherwise
+dnl see if tclConfig.sh exists in same prefix lcoation as tclsh; otherwise
+dnl disable Tcl.
+TCL_LIB=""
+TCL_INCLUDE=""
+tclconfig=NONE
+AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR tclConfig.sh in DIR], [tclconfig=$withval])
+if test "x$tclconfig" = xNONE; then
+ saveprefix=${prefix}
+ AC_PREFIX_PROGRAM(tclsh)
+ tclconfig=${prefix}/lib
+ prefix=${saveprefix}
+ if test ! -r ${tclconfig}/tclConfig.sh; then
+ # Not found, try search for Tcl on Debian systems.
+ for d in /usr/lib/tcl*; do
+ if test -f $d/tclConfig.sh; then
+ tclconfig=$d
+ fi
+ done
+ fi
+fi
+AC_MSG_CHECKING(for Tcl)
+if test -r ${tclconfig}/tclConfig.sh; then
+ . ${tclconfig}/tclConfig.sh
+ if test -r ${tclconfig}/../generic/tcl.h; then
+ TCL_INCLUDE=-I${tclconfig}/../generic
+ TCL_LIB="$TCL_BUILD_LIB_SPEC $TCL_LIBS"
+ elif test -d ${TCL_PREFIX}/include/tcl${TCL_VERSION}; then
+ TCL_INCLUDE=-I${TCL_PREFIX}/include/tcl${TCL_VERSION}
+ TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS"
+ else
+ TCL_INCLUDE=-I${TCL_PREFIX}/include
+ TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS"
+ fi
+ TCL_LIB=`echo $TCL_LIB|sed 's%-L/usr/lib%%g'`
+ SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
+ SHLIB_LD=$TCL_SHLIB_LD
+ SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
+ SHLIB_VERSION=$TCL_SHLIB_VERSION
+ AC_MSG_RESULT($TCL_VERSION)
+ AC_DEFINE(HAVE_TCL_H,1)
+else
+ AC_MSG_RESULT(Not found)
+ AC_DEFINE(HAVE_TCL_H,0)
+fi
+dnl
+dnl ------ times
+AC_CHECK_HEADERS(sys/times.h)
+dnl
+dnl ------ mkstemp
+AC_CHECK_FUNCS(mkstemp)
+dnl
+dnl ------ GNU Readline
+READLINE_SHARED_LIBADD=""
+AC_CHECK_LIB(ncurses, tgetent, [READLINE_SHARED_LIBADD="-lncurses"],
+ AC_CHECK_LIB(termcap, tgetent, [READLINE_SHARED_LIBADD="-ltermcap"])
+)
+READLINE_LIBS=""
+AC_CHECK_LIB(readline, readline, [READLINE_LIBS="$READLINE_LIBS -lreadline $READLINE_SHARED_LIBADD"],,$READLINE_SHARED_LIBADD)
+AC_CHECK_LIB(history, add_history, [READLINE_LIBS="$READLINE_LIBS -lhistory"])
+if test "$ac_cv_lib_readline_readline" = "yes"; then
+ AC_CHECK_HEADERS(readline/readline.h readline/history.h)
+ xLIBS=$LIBS
+ LIBS="$LIBS $READLINE_LIBS"
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <readline/readline.h>
+ ],[
+ static void f()
+ {
+ rl_attempted_completion_over = 0;
+ }
+ ],AC_DEFINE(HAVE_READLINE_COMPLETION_OVER))
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <readline/readline.h>
+ ],[
+ static void f()
+ {
+ rl_completion_matches (0, 0);
+ }
+ ],AC_DEFINE(HAVE_READLINE_RL_COMPLETION_MATCHES))
+ LIBS=$xLIBS