Improved installation. Updated for inclusion of YAZ header files.
[idzebra-moved-to-github.git] / configure.in
index cdb3f48..dbf056e 100644 (file)
@@ -1,5 +1,5 @@
 dnl Zebra, Index Data Aps, 1994-1999
-dnl $Id: configure.in,v 1.10 1999-07-14 10:59:26 adam Exp $
+dnl $Id: configure.in,v 1.11 1999-11-30 13:48:03 adam Exp $
 dnl See the file LICENSE.2 for details.
 dnl
 AC_INIT(include/zebraver.h)
@@ -8,6 +8,8 @@ AC_SUBST(ODEFS)
 AC_SUBST(DEFS)
 AC_SUBST(TCL_INCLUDE)
 AC_SUBST(TCL_LIB)
+AC_SUBST(YAZLIB)
+AC_SUBST(YAZINC)
 dnl
 dnl ------ Checking programs
 AC_PROG_CC
@@ -15,7 +17,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,25 +84,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
 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
@@ -78,4 +100,4 @@ if test "$ac_cv_header_stdc" = "no"; then
 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)