Improved installation. Updated for inclusion of YAZ header files.
[idzebra-moved-to-github.git] / configure.in
1 dnl Zebra, Index Data Aps, 1994-1999
2 dnl $Id: configure.in,v 1.11 1999-11-30 13:48:03 adam Exp $
3 dnl See the file LICENSE.2 for details.
4 dnl
5 AC_INIT(include/zebraver.h)
6 dnl ------ Substitutions
7 AC_SUBST(ODEFS)
8 AC_SUBST(DEFS)
9 AC_SUBST(TCL_INCLUDE)
10 AC_SUBST(TCL_LIB)
11 AC_SUBST(YAZLIB)
12 AC_SUBST(YAZINC)
13 dnl
14 dnl ------ Checking programs
15 AC_PROG_CC
16 AC_PROG_CPP
17 AC_PROG_INSTALL
18 AC_PROG_RANLIB
19 dnl
20 dnl ------ Build root
21 AC_SUBST(build_root)
22 AC_ARG_WITH(build-root, [  --with-buildroot        RPM Build root],[build_root=$withval],[build_root=""])
23 dnl
24 dnl ------ Look for Yaz
25 dnl See if user specified location of yaz-config; otherwise
26 dnl use ../yaz if is a directory (internal development); otherwise
27 dnl use yaz-config found in PATH.
28 yazconfig=NONE
29 yazpath=NONE
30 AC_ARG_WITH(yazconfig, [  --with-yazconfig        Path for yaz-config], [yazpath=$withval])
31 if test "x$yazpath" != "xNONE"; then
32         yazconfig=$yazpath/yaz-config
33 else
34         for i in ../yaz* ../yaz; do
35                 if test -d $i; then
36                         if test -r $i/include/yaz/yaz-version.h; then
37                                 yazconfig=$i/yaz-config
38                         fi
39                 fi
40         done
41         if test "x$yazconfig" = "xNONE"; then
42                 AC_PATH_PROG(yazconfig, yaz-config, NONE)
43         fi
44 fi
45 AC_MSG_CHECKING(for YAZ)
46 if test -r $yazconfig; then
47         . $yazconfig
48         AC_MSG_RESULT($yazconfig)
49 else
50         AC_MSG_RESULT(Not found)
51 fi
52 dnl
53 dnl ------ Look for Tcl
54 dnl See if user has specified location of tclConfig.sh; otherwise
55 dnl see if tclConfig.sh exists in same prefix lcoation as tclsh; otherwise
56 dnl disable Tcl.
57 TCL_LIB=""
58 TCL_INCLUDE=""
59 tclconfig=NONE
60 AC_ARG_WITH(tclconfig, [  --with-tclconfig        Path for tclConfig.sh], [tclconfig=$withval])
61 if test "x$tclconfig" = xNONE; then
62         saveprefix=${prefix}
63         AC_PREFIX_PROGRAM(tclsh)
64         tclconfig=${prefix}/lib
65         prefix=${saveprefix}
66 fi
67 if test -r ${tclconfig}/tclConfig.sh; then
68         AC_MSG_CHECKING(for Tcl)
69         . ${tclconfig}/tclConfig.sh
70         if test -r ${tclconfig}/../generic/tcl.h; then
71                 TCL_INCLUDE=-I${tclconfig}/../generic
72                 TCL_LIB="$TCL_BUILD_LIB_SPEC $TCL_LIBS"
73         else
74                 TCL_INCLUDE=-I${TCL_PREFIX}/include
75                 TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS"
76         fi
77         SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
78         SHLIB_LD=$TCL_SHLIB_LD
79         SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
80         SHLIB_VERSION=$TCL_SHLIB_VERSION
81         AC_MSG_RESULT($TCL_VERSION)
82         ODEFS="-DHAVE_TCL_H=1"
83 else
84         ODEFS="-DHAVE_TCL_H=0"
85 fi
86 dnl
87 dnl ------ times
88 AC_CHECK_HEADERS(sys/times.h)
89 dnl
90 dnl ------- BZIP2
91 AC_CHECK_LIB(bz2,bzCompressInit)
92 if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then
93         AC_CHECK_HEADERS(bzlib.h)
94 fi
95 dnl
96 dnl ------ ANSI C Header files
97 AC_STDC_HEADERS
98 if test "$ac_cv_header_stdc" = "no"; then
99         AC_MSG_WARN(Your system doesn't seem to support ANSI C)
100 fi
101 dnl
102 dnl ------ Create Makefiles
103 AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isams/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile)