Minor changes.
[ir-tcl-moved-to-github.git] / configure.in
index d6e93d2..f6a6e87 100644 (file)
@@ -1,7 +1,7 @@
 dnl IR toolkit for tcl/tk
-dnl (c) Index Data 1996
+dnl (c) Index Data 1996-1998
 dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.17 1996-06-28 08:43:55 adam Exp $
+dnl $Id: configure.in,v 1.23 1998-01-16 11:01:17 adam Exp $
 AC_INIT(ir-tcl.h)
 CC=${CC-cc}
 dnl ------ Substitutions
@@ -15,21 +15,43 @@ AC_SUBST(MOSI)
 AC_SUBST(MOSIDIR)
 AC_SUBST(MOSILIB)
 AC_SUBST(MOSIINC)
+AC_SUBST(SHLIB_CFLAGS)
+AC_SUBST(SHLIB_LD)
+AC_SUBST(SHLIB_SUFFIX)
+AC_SUBST(SHLIB_VERSION)
+AC_SUBST(SHLIB_IRTCL)
+AC_SUBST(ALL_SPEC)
+AC_SUBST(IRCLIENT_SHELL)
+dnl
 dnl ------ Preliminary settings
 AC_PROG_INSTALL
 AC_PREFIX_PROGRAM(tclsh)
+if test "x$prefix" = xNONE; then
+       AC_PREFIX_PROGRAM(tclsh8.1)
+fi
+if test "x$prefix" = xNONE; then
+       AC_PREFIX_PROGRAM(tclsh8.0)
+fi
+if test "x$prefix" = xNONE; then
+       AC_PREFIX_PROGRAM(tclsh7.6)
+fi
+if test "x$prefix" = xNONE; then
+       AC_PREFIX_PROGRAM(tclsh7.5)
+fi
 AC_STDC_HEADERS
 if test "$ac_cv_header_stdc" = no; then
        AC_MSG_WARN(Your system doesn't seem to support ANSI C)
 fi
+dnl
 dnl ------ look for YAZ/XTImOSI
+dnl
 AC_MSG_CHECKING(for YAZ directory)
 AC_ARG_WITH(yazdir,[  --with-yazdir           Yaz directory], [YAZDIR=$withval])
 if test "$YAZDIR" = "yes"; then
-       YAZDIR="../yaz-1.2"
+       YAZDIR="../yaz-1.4"
 elif test "$YAZDIR" = ""; then
-        YAZDIR="../yaz"
-        for i in ../yaz-1.2 ../yaz-1.3 ../yaz; do
+       YAZDIR=../yaz
+        for i in ../yaz* ../yaz; do
             if test -d $i; then
                 YAZDIR=$i
             fi
@@ -61,7 +83,9 @@ else
         MOSITELL=no
 fi
 AC_MSG_RESULT($MOSITELL)
+dnl
 dnl ------ look for Tcl
+dnl
 if test "x$prefix" = xNONE; then
        tryprefix=/usr/local
 else
@@ -70,16 +94,22 @@ fi
 if test -r ${tryprefix}/lib/tclConfig.sh; then
        AC_MSG_CHECKING(for Tcl)
        source ${tryprefix}/lib/tclConfig.sh
-       if test "$TCL_LIB_VERSIONS_OK" = "yes"; then
-               TCLLIB="-L${TCL_PREFIX}/lib -ltcl${TCL_VERSION}"
-       else
-               TCLLIB=${TCL_PREFIX}/lib/${TCL_LIB_FILE}
-       fi
-       TCLLIB="${TCLLIB} ${TCL_LIBS}"
+       TCLLIB="${TCL_LIB_SPEC} ${TCL_LIBS}"
        TCLINC=-I${TCL_PREFIX}/include
        RANLIB=$TCL_RANLIB
+        SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
+       SHLIB_LD=$TCL_SHLIB_LD
+       SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
+       SHLIB_VERSION=$TCL_SHLIB_VERSION
+       SHLIB_IRTCL=irtcl${TCL_SHLIB_SUFFIX}
+       ALL_SPEC="irtcl${TCL_SHLIB_SUFFIX} libirtcl.a"
        AC_MSG_RESULT($TCL_VERSION)
 else
+        SHLIB_CFLAGS=""
+       SHLIB_LD="shared-linker"
+       SHLIB_SUFFIX=""
+       SHLIB_VERSION=""
+       SHLIB_IRTCL="irtcl-shared"
        AC_PROG_RANLIB
        checkBoth=0
        AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
@@ -94,14 +124,14 @@ else
        AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
        AC_MSG_CHECKING(for Tcl)
        TCL_VERSION=nope
-       for i in "" 7.4 7.5; do
+       for i in "" 7.4 7.5 7.6 8.0; do
                if test -r ${tryprefix}/lib/libtcl${i}.a; then
                        TCL_VERSION=$i
                fi
        done
        if test "$TCL_VERSION" = nope; then
                AC_MSG_WARN(Didn't find Tcl)
-               TCLLIB=-ltcl
+               TCL_LIB_SPEC=-ltcl
                TCLINC=" # -I.. Tcl/Tk include path"
        else
                if test "$TCL_VERSION" = ""; then
@@ -109,22 +139,26 @@ else
                else
                        AC_MSG_RESULT($TCL_VERSION)
                fi
-               TCLLIB=${tryprefix}/lib/libtcl${TCL_VERSION}.a
+               TCL_LIB_SPEC=${tryprefix}/lib/libtcl${TCL_VERSION}.a
                TCLINC=-I${tryprefix}/include
        fi
-       TCLLIB="${TCLLIB} ${LIBS} -lm"
+       TCLLIB="${TCL_LIB_SPEC} ${LIBS} -lm"
+       ALL_SPEC="ir-tcl ir-tk"
 fi
+dnl 
 dnl ------ look for Tk
+dnl
 if test -r ${tryprefix}/lib/tkConfig.sh; then
        AC_MSG_CHECKING(for Tk)
        source ${tryprefix}/lib/tkConfig.sh
        AC_MSG_RESULT($TK_VERSION)
        TKINC=${TK_XINCLUDES}
-       TKLIB="${TK_PREFIX}/lib/${TK_LIB_FILE} ${TK_LIBS}"
+       TKLIB="${TK_LIB_SPEC} ${TCL_LIB_SPEC} ${TK_LIBS}"
+       IRCLIENT_SHELL=wish${TK_VERSION}
 else
        AC_MSG_CHECKING(for Tk)
        TK_VERSION=nope
-       for i in "" 4.0 4.1; do
+       for i in "" 4.0 4.1 4.2 8.0; do
                if test -r ${tryprefix}/lib/libtk${i}.a; then
                        TK_VERSION=$i
                fi
@@ -140,7 +174,6 @@ else
                        AC_MSG_RESULT($TK_VERSION)
                fi
        fi
-       TKLIB=${tryprefix}/lib/libtk${i}.a
        AC_PATH_X
        not_really_there=""
        if test "$no_x" = ""; then
@@ -198,7 +231,8 @@ else
                echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
                XLIBSW=-lX11
        fi
-       TKINC=$XINCLUDE
+       TKINC=$XINCLUDES
        TKLIB="${TKLIB} ${XLIBSW} ${TCLLIB}"
+       IRCLIENT_SHELL=ir-tk
 fi
 AC_OUTPUT(Makefile)