Updated configure for Zmbol/Zebra dependent settings.
[idzebra-moved-to-github.git] / configure.in
index 61bf5ea..c4e4371 100644 (file)
@@ -1,5 +1,5 @@
 dnl Zebra, Index Data Aps, 1994-1999
-dnl $Id: configure.in,v 1.9 1999-06-25 13:48:02 adam Exp $
+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)
@@ -8,6 +8,11 @@ AC_SUBST(ODEFS)
 AC_SUBST(DEFS)
 AC_SUBST(TCL_INCLUDE)
 AC_SUBST(TCL_LIB)
+AC_SUBST(YAZLIB)
+AC_SUBST(YAZINC)
+AC_SUBST(SUBDIR)
+AC_SUBST(SUBLIBS)
+AC_SUBST(PROGPREFIX)
 dnl
 dnl ------ Checking programs
 AC_PROG_CC
@@ -15,7 +20,43 @@ AC_PROG_CPP
 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])
+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
@@ -46,22 +87,9 @@ else
        ODEFS="-DHAVE_TCL_H=0"
 fi
 dnl
-dnl ------ Socket libraries
-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])
-fi
-AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
+dnl ------ times
+AC_CHECK_HEADERS(sys/times.h)
 dnl
-dnl ------ TCP wrapper (for Linux)
-AC_CHECK_LIB(wrap, main, [LIBS="$LIBS -lwrap"])
-dnl 
 dnl ------- BZIP2
 AC_CHECK_LIB(bz2,bzCompressInit)
 if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then
@@ -74,5 +102,34 @@ if test "$ac_cv_header_stdc" = "no"; then
        AC_MSG_WARN(Your system doesn't seem to support ANSI C)
 fi
 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 isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile)
+AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isams/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile)