-dnl Zebra, Index Data Aps, 1994-1999
-dnl $Id: configure.in,v 1.11 1999-11-30 13:48:03 adam Exp $
-dnl See the file LICENSE.2 for details.
+dnl Zebra, Index Data Aps, 1994-2000
+dnl $Id: configure.in,v 1.19 2000-04-05 09:55:44 adam Exp $
dnl
AC_INIT(include/zebraver.h)
+AC_MSG_CHECKING(for package)
+if test -r ${srcdir}/LICENSE.zmbol; then
+ AC_MSG_RESULT([Z'mbol])
+ PROGPREFIX=zmbol
+ AC_DEFINE(ZMBOL,1)
+ AM_INIT_AUTOMAKE(zmbol,1.1)
+ SUBLIBS="../rset/librset.a \
+ ../dict/libdict.a \
+ ../isams/libisams.a \
+ ../isam/libisam.a \
+ ../isamc/libisamc.a \
+ ../recctrl/librecctrl.a \
+ ../bfile/libbfile.a \
+ ../dfa/libdfa.a \
+ ../util/libutil.a"
+else
+ AC_MSG_RESULT([Zebra])
+ PROGPREFIX=zebra
+ AC_DEFINE(ZMBOL,0)
+ AM_INIT_AUTOMAKE(zebra,1.1)
+ SUBLIBS="../rset/librset.a ../dict/libdict.a ../isams/libisams.a \
+ ../recctrl/librecctrl.a \
+ ../bfile/libbfile.a ../dfa/libdfa.a \
+ ../util/libutil.a"
+ if test ! -r ${srcdir}/isam; then
+ mkdir ${srcdir}/isam
+ touch ${srcdir}/isam/Makefile.in
+ fi
+ if test ! -r ${srcdir}/isamc; then
+ mkdir ${srcdir}/isamc
+ touch ${srcdir}/isamc/Makefile.in
+ fi
+fi
+AM_CONDITIONAL(ISZMBOL,test $PACKAGE = zmbol)
dnl ------ Substitutions
+AC_SUBST(SUBLIBS)
AC_SUBST(ODEFS)
AC_SUBST(DEFS)
AC_SUBST(TCL_INCLUDE)
AC_SUBST(TCL_LIB)
AC_SUBST(YAZLIB)
AC_SUBST(YAZINC)
+AC_SUBST(PROGPREFIX)
dnl
dnl ------ Checking programs
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl
-dnl ------ Build root
-AC_SUBST(build_root)
-AC_ARG_WITH(build-root, [ --with-buildroot RPM Build root],[build_root=$withval],[build_root=""])
-dnl
dnl ------ Look for Yaz
dnl See if user specified location of yaz-config; otherwise
dnl use ../yaz if is a directory (internal development); otherwise
dnl use yaz-config found in PATH.
yazconfig=NONE
yazpath=NONE
-AC_ARG_WITH(yazconfig, [ --with-yazconfig Path for yaz-config], [yazpath=$withval])
+AC_ARG_WITH(yazconfig, [ --with-yazconfig=DIR yaz-config in DIR (example /home/yaz-1.5)], [yazpath=$withval])
if test "x$yazpath" != "xNONE"; then
yazconfig=$yazpath/yaz-config
else
for i in ../yaz* ../yaz; do
if test -d $i; then
- if test -r $i/include/yaz/yaz-version.h; then
+ if test -r $i/yaz-config; then
yazconfig=$i/yaz-config
fi
fi
AC_MSG_RESULT(Not found)
fi
dnl
+dnl ------ Threads
+AC_ARG_ENABLE(threads, [ --disable-threads disable threads],[enable_threads=$enableval],[enable_threads=yes])
+if test "$enable_threads" = "yes"; then
+ AC_CHECK_LIB(pthread,main)
+ AC_MSG_CHECKING(for working POSIX Threads)
+ AC_TRY_LINK([#include <pthread.h>
+ int func(void *p) { return 0; }
+ ],[
+ pthread_t pthread_id;
+ int r = pthread_create (&pthread_id, 0, func, 0);],
+ thread_ok=yes,thread_ok=no)
+ if test "$thread_ok" = "yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PTHREAD_H)
+ AC_DEFINE(_REENTRANT)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+dnl
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
TCL_LIB=""
TCL_INCLUDE=""
tclconfig=NONE
-AC_ARG_WITH(tclconfig, [ --with-tclconfig Path for tclConfig.sh], [tclconfig=$withval])
+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}
fi
+AC_MSG_CHECKING(for Tcl)
if test -r ${tclconfig}/tclConfig.sh; then
- AC_MSG_CHECKING(for Tcl)
. ${tclconfig}/tclConfig.sh
if test -r ${tclconfig}/../generic/tcl.h; then
TCL_INCLUDE=-I${tclconfig}/../generic
AC_MSG_RESULT($TCL_VERSION)
ODEFS="-DHAVE_TCL_H=1"
else
+ AC_MSG_RESULT(Not found)
ODEFS="-DHAVE_TCL_H=0"
fi
dnl
if test "$ac_cv_header_stdc" = "no"; then
AC_MSG_WARN(Your system doesn't seem to support ANSI C)
fi
-dnl
dnl ------ Create Makefiles
-AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isams/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile)
+AC_OUTPUT([
+ Makefile
+ util/Makefile
+ bfile/Makefile
+ dfa/Makefile
+ dict/Makefile
+ isams/Makefile
+ isamc/Makefile
+ isam/Makefile
+ rset/Makefile
+ recctrl/Makefile
+ index/Makefile
+ include/Makefile
+ tab/Makefile
+ doc/Makefile
+ test/Makefile test/gils/Makefile test/usmarc/Makefile
+])