*** empty log message ***
[idzebra-moved-to-github.git] / configure.in
index 62cd8ec..d5f70f4 100644 (file)
@@ -1,5 +1,5 @@
-dnl Zebra, Index Data Aps, 1994-2000
-dnl $Id: configure.in,v 1.21 2000-05-15 15:32:50 adam Exp $
+dnl Zebra, Index Data Aps, 1994-2002
+dnl $Id: configure.in,v 1.32 2002-03-15 20:11:36 adam Exp $
 dnl
 AC_INIT(include/zebraver.h)
 AC_MSG_CHECKING(for package)
@@ -7,42 +7,30 @@ 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"
+       AM_INIT_AUTOMAKE(zmbol,1.1.1)
 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"
+       AM_INIT_AUTOMAKE(zebra,1.1.1)
        if test ! -r ${srcdir}/isam; then
                mkdir ${srcdir}/isam
-               touch ${srcdir}/isam/Makefile.in
        fi
+       touch ${srcdir}/isam/Makefile.in
        if test ! -r ${srcdir}/isamc; then
                mkdir ${srcdir}/isamc
-               touch ${srcdir}/isamc/Makefile.in
        fi
+       touch ${srcdir}/isamc/Makefile.in
+       if test ! -r ${srcdir}/isamb; then
+               mkdir ${srcdir}/isamb
+       fi
+       touch ${srcdir}/isamb/Makefile.in
 fi
 AM_CONDITIONAL(ISZMBOL,test $PACKAGE = zmbol)
 dnl ------ Substitutions
-AC_SUBST(SUBLIBS)
 AC_SUBST(DEFS)
 AC_SUBST(TCL_INCLUDE)
 AC_SUBST(TCL_LIB)
-AC_SUBST(YAZLIB)
-AC_SUBST(YAZINC)
 AC_SUBST(PROGPREFIX)
 dnl
 dnl ------ Checking programs
@@ -50,55 +38,8 @@ AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_RANLIB
-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=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/yaz-config; then
-                               yazconfig=$i/yaz-config
-                       fi
-               fi
-       done
-       if test "x$yazconfig" = "xNONE"; then
-               AC_PATH_PROG(yazconfig, yaz-config, NONE)
-       fi
-fi
-AC_MSG_CHECKING(for YAZ)
-if test -r $yazconfig; then
-       . $yazconfig
-       AC_MSG_RESULT($yazconfig)
-else
-       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
+
+YAZ_INIT(threads)
 dnl
 dnl ------ Look for Tcl
 dnl See if user has specified location of tclConfig.sh; otherwise
@@ -137,29 +78,51 @@ fi
 dnl
 dnl ------ times
 AC_CHECK_HEADERS(sys/times.h)
+dnl ------ mkstemp
+AC_CHECK_FUNCS(mkstemp)
 dnl
 dnl ------- BZIP2
 AC_CHECK_LIB(bz2,bzCompressInit)
 if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then
        AC_CHECK_HEADERS(bzlib.h)
+else
+       AC_CHECK_LIB(bz2,BZ2_bzCompressInit)
+       if test "$ac_cv_lib_bz2_BZ2_bzCompressInit" = "yes"; then
+               AC_CHECK_HEADERS(bzlib.h)
+       fi
 fi
 dnl ------- 64 bit files
-AC_MSG_CHECKING(for large files)
+AC_MSG_CHECKING(for LFS)
 AC_TRY_RUN([#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
 int main(int argc, char **argv)
 {
        off_t o;
        char tmp_str[32];
-       if (sizeof(off_t) == 8) {
-               o = 2000000000;
-               sprintf (tmp_str, "%Ld", o+o+o);
-               if (!strcmp (tmp_str, "6000000000"))
-                       exit (0);
-       }
-       exit (1);
+       int fd;
+       struct flock area;
+       if (sizeof(off_t) != 8) 
+               exit (1);
+       o = 2000000000;
+       sprintf (tmp_str, "%Ld", o+o+o);
+       if (strcmp (tmp_str, "6000000000"))
+               exit (1);
+       fd = creat ("config.tmp", 0644);
+       if (fd < 0)
+               exit (1);
+       area.l_type = F_WRLCK;
+       area.l_whence = SEEK_SET;
+       area.l_len = area.l_start = 0L;
+       if (fcntl(fd, F_SETLKW, &area))
+               exit (1);
+       close (fd);
+       unlink ("config.tmp");
+       exit (0);
 }
 ],bits=64,bits=32,bits=32)
 if test "$bits" = "64"; then
@@ -181,6 +144,7 @@ AC_OUTPUT([
   bfile/Makefile
   dfa/Makefile
   dict/Makefile
+  isamb/Makefile
   isams/Makefile
   isamc/Makefile
   isam/Makefile
@@ -190,5 +154,5 @@ AC_OUTPUT([
   include/Makefile
   tab/Makefile
   doc/Makefile
-  test/Makefile test/gils/Makefile test/usmarc/Makefile
+  test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile
 ])