Updated version to 0.2.1.
[tclrobot.git] / configure.in
1 dnl (c) Index Data 1996-2001
2 dnl See the file LICENSE for details.
3 dnl $Id: configure.in,v 1.8 2002/09/20 09:45:02 adam Exp $
4 AC_INIT(hswitch.c)
5 dnl ------ Substitutions
6 AC_SUBST(CC)
7 AC_SUBST(TCLLIB)
8 AC_SUBST(TCLINC)
9 AC_SUBST(SHLIB_CFLAGS)
10 AC_SUBST(SHLIB_LD)
11 AC_SUBST(SHLIB_SUFFIX)
12 AC_SUBST(SHLIB_VERSION)
13 AC_PROG_INSTALL
14 dnl
15 dnl ------ look for Tcl
16 tclconfig=NONE
17 AC_ARG_WITH(tclconfig, [  --with-tclconfig        Path for tclConfig.sh], [tclconfig=$withval])
18 if test "x$tclconfig" = xNONE; then
19         saveprefix=${prefix}
20         AC_PREFIX_PROGRAM(tclsh)
21         if test "x$prefix" = xNONE; then
22                 AC_PREFIX_PROGRAM(tclsh8.3)
23         fi
24         if test "x$prefix" = xNONE; then
25                 AC_PREFIX_PROGRAM(tclsh8.2)
26         fi
27         if test "x$prefix" = xNONE; then
28                 AC_PREFIX_PROGRAM(tclsh8.1)
29         fi
30         if test "x$prefix" = xNONE; then
31                 AC_PREFIX_PROGRAM(tclsh8.0)
32         fi
33         if test "x$prefix" = xNONE; then
34                 AC_PREFIX_PROGRAM(tclsh7.6)
35         fi
36         if test "x$prefix" = xNONE; then
37                 AC_PREFIX_PROGRAM(tclsh7.5)
38         fi
39         if test "x$prefix" = xNONE; then
40                 prefix=/usr/local
41         fi
42         tclconfig=${prefix}/lib
43         prefix=${saveprefix}
44         if test ! -r ${tclconfig}/tclConfig.sh; then
45                 # Not found, try search for Tcl on Debian systems.
46                 for d in /usr/lib/tcl*; do
47                         if test -f $d/tclConfig.sh; then
48                                 tclconfig=$d
49                         fi
50                 done
51         fi
52 fi
53 AC_MSG_CHECKING(for Tcl)
54 if test -d ${tclconfig}; then
55         tclconfig=${tclconfig}/tclConfig.sh
56 fi
57 if test -r ${tclconfig}; then
58         . ${tclconfig}
59         TCLLIB="${TCL_LIB_SPEC} ${TCL_LIBS}"
60
61         if test -d ${TCL_PREFIX}/include/tcl${TCL_VERSION}; then
62                 TCLINC=-I${TCL_PREFIX}/include/tcl${TCL_VERSION}
63         else
64                 TCLINC=-I${TCL_PREFIX}/include
65         fi
66         RANLIB=$TCL_RANLIB
67         SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
68         SHLIB_LD=$TCL_SHLIB_LD
69         SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
70         SHLIB_VERSION=$TCL_SHLIB_VERSION
71         AC_MSG_RESULT($TCL_VERSION)
72         CC=$TCL_CC
73 else
74         AC_MSG_RESULT(Not found)
75 fi
76 AC_OUTPUT(Makefile)