Updated configure for Zmbol/Zebra dependent settings.
[idzebra-moved-to-github.git] / configure.in
index 2c0dc13..c4e4371 100644 (file)
@@ -1,21 +1,62 @@
-# Zebra, Index Data Aps, 1994-1999
-# $Id: configure.in,v 1.7 1999-05-21 12:00:17 adam Exp $
-# See the file LICENSE.2 for details.
-#
+dnl Zebra, Index Data Aps, 1994-1999
+dnl $Id: configure.in,v 1.12 1999-12-01 13:30:30 adam Exp $
+dnl See the file LICENSE.2 for details.
+dnl
 AC_INIT(include/zebraver.h)
-# ------ Substitutions
+dnl ------ Substitutions
 AC_SUBST(ODEFS)
 AC_SUBST(DEFS)
 AC_SUBST(TCL_INCLUDE)
 AC_SUBST(TCL_LIB)
-#
-# ------ Checking programs
+AC_SUBST(YAZLIB)
+AC_SUBST(YAZINC)
+AC_SUBST(SUBDIR)
+AC_SUBST(SUBLIBS)
+AC_SUBST(PROGPREFIX)
+dnl
+dnl ------ Checking programs
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_RANLIB
-#
-# look for Tcl
+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])
+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
+                               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 ------ 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
@@ -45,28 +86,50 @@ if test -r ${tclconfig}/tclConfig.sh; then
 else
        ODEFS="-DHAVE_TCL_H=0"
 fi
-#
-# sockets
-checkBoth=0
-AC_CHECK_FUNC(connect)
-if test "$ac_cv_func_connect" = "no"; then
-       AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
-fi
-if test "$checkBoth" = "1"; then
-       oldLibs=$LIBS
-       LIBS="$LIBS -lsocket -lnsl"
-       AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
+dnl
+dnl ------ times
+AC_CHECK_HEADERS(sys/times.h)
+dnl
+dnl ------- BZIP2
+AC_CHECK_LIB(bz2,bzCompressInit)
+if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then
+       AC_CHECK_HEADERS(bzlib.h)
 fi
-AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
-#
-# tcpd wrapper
-AC_CHECK_LIB(wrap, main, [LIBS="$LIBS -lwrap"])
-# 
-# headers
+dnl
+dnl ------ ANSI C Header files
 AC_STDC_HEADERS
 if test "$ac_cv_header_stdc" = "no"; then
        AC_MSG_WARN(Your system doesn't seem to support ANSI C)
 fi
-#
-# makefiles
-AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile)
+dnl
+dnl ------ Is it Zebra or Z'mbol
+if test -r LICENSE.zmbol; then
+       AC_DEFINE(ZMBOL,1)
+       PROGPREFIX=zmbol
+       SUBDIR="util bfile dfa dict isams isamc isam rset recctrl index"
+       SUBLIBS="../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a\
+ ../lib/recctrl.a ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a\
+ ../lib/zebrautl.a"
+else
+       PROGPREFIX=zebra
+       SUBDIR="util bfile dfa dict isams rset recctrl index"
+       SUBLIBS="../lib/rset.a ../lib/dict.a ../lib/isams.a\
+ ../lib/recctrl.a ../lib/bfile.a ../lib/dfa.a\
+ ../lib/zebrautl.a"
+       AC_DEFINE(ZMBOL,0)
+       if ! test -d isamc; then
+               mkdir isamc
+       fi
+       if ! test -r isamc/Makefile.in; then
+               touch isamc/Makefile.in
+       fi
+       if ! test -d isam; then
+               mkdir isam
+       fi
+       if ! test -r isam/Makefile.in; then
+               touch isam/Makefile.in
+       fi
+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)