C++ compilation.
[idzebra-moved-to-github.git] / configure.in
1 dnl Zebra, Index Data Aps, 1994-1999
2 dnl $Id: configure.in,v 1.8 1999-05-26 07:49:12 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 dnl
12 dnl ------ Checking programs
13 AC_PROG_CC
14 AC_PROG_CPP
15 AC_PROG_INSTALL
16 AC_PROG_RANLIB
17 dnl
18 dnl ------ Look for Tcl
19 TCL_LIB=""
20 TCL_INCLUDE=""
21 tclconfig=NONE
22 AC_ARG_WITH(tclconfig, [  --with-tclconfig        Path for tclConfig.sh], [tclconfig=$withval])
23 if test "x$tclconfig" = xNONE; then
24         saveprefix=${prefix}
25         AC_PREFIX_PROGRAM(tclsh)
26         tclconfig=${prefix}/lib
27         prefix=${saveprefix}
28 fi
29 if test -r ${tclconfig}/tclConfig.sh; then
30         AC_MSG_CHECKING(for Tcl)
31         . ${tclconfig}/tclConfig.sh
32         if test -r ${tclconfig}/../generic/tcl.h; then
33                 TCL_INCLUDE=-I${tclconfig}/../generic
34                 TCL_LIB="$TCL_BUILD_LIB_SPEC $TCL_LIBS"
35         else
36                 TCL_INCLUDE=-I${TCL_PREFIX}/include
37                 TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS"
38         fi
39         SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
40         SHLIB_LD=$TCL_SHLIB_LD
41         SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
42         SHLIB_VERSION=$TCL_SHLIB_VERSION
43         AC_MSG_RESULT($TCL_VERSION)
44         ODEFS="-DHAVE_TCL_H=1"
45 else
46         ODEFS="-DHAVE_TCL_H=0"
47 fi
48 dnl
49 dnl ------ Socket libraries
50 checkBoth=0
51 AC_CHECK_FUNC(connect)
52 if test "$ac_cv_func_connect" = "no"; then
53         AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
54 fi
55 if test "$checkBoth" = "1"; then
56         oldLibs=$LIBS
57         LIBS="$LIBS -lsocket -lnsl"
58         AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
59 fi
60 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
61 dnl
62 dnl ------ TCP wrapper (for Linux)
63 AC_CHECK_LIB(wrap, main, [LIBS="$LIBS -lwrap"])
64 dnl 
65 dnl ------ ANSI C Header files
66 AC_STDC_HEADERS
67 if test "$ac_cv_header_stdc" = "no"; then
68         AC_MSG_WARN(Your system doesn't seem to support ANSI C)
69 fi
70 dnl
71 dnl ------ Create Makefiles
72 AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile)