From 8b80f9fd0ae23ac28b440976486283055d5e1b81 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 27 Mar 1996 08:38:30 +0000 Subject: [PATCH] Configure uses tclConfig.sh where available. --- Makefile.in | 6 ++-- configure.in | 102 ++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 73 insertions(+), 35 deletions(-) diff --git a/Makefile.in b/Makefile.in index b9a31ff..22e1e5f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # (c) Index Data 1995 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.31 1996-03-20 13:54:01 adam Exp $ +# $Id: Makefile.in,v 1.32 1996-03-27 08:38:30 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -21,7 +21,7 @@ INCDIR=$(prefix)/include IRTCLDIR=$(prefix)/lib/irtcl YAZDIR=@YAZDIR@ -LIBS=@LIBS@ -lm +LIBS=@LIBS@ CC=@CC@ @@ -57,7 +57,7 @@ RANLIB = @RANLIB@ O=ir-tcl.o marc.o queue.o mem.o grs.o -all: ir-tk ir-tcl +all: ir-tcl ir-tk ir-tk: libirtcl.a tkinit.o $(CC) $(CFLAGS) tkinit.o -o ir-tk libirtcl.a $(YAZLIB) $(TKLIB) \ diff --git a/configure.in b/configure.in index 2494d60..ac8c16d 100644 --- a/configure.in +++ b/configure.in @@ -1,46 +1,29 @@ dnl IR toolkit for tcl/tk -dnl (c) Index Data 1995 +dnl (c) Index Data 1996 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.13 1996-01-11 12:14:53 adam Exp $ +dnl $Id: configure.in,v 1.14 1996-03-27 08:38:32 adam Exp $ AC_INIT(ir-tcl.h) CC=${CC-cc} +dnl ------ Substitutions AC_SUBST(CC) -AC_PROG_RANLIB -AC_PROG_INSTALL -checkBoth=0 -AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1) -if test "$tk_checkSocket" = 1; then - AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1) -fi -if test "$checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, , [LIBS=$tk_oldLibs]) -fi -AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) -AC_STDC_HEADERS AC_SUBST(TCLLIB) AC_SUBST(TKLIB) AC_SUBST(TCLINCLUDE) -TCLLIB=-ltcl -TKLIB=-ltk -TCLINCLUDE=" # -I.. Tcl/Tk include path" -for i in .a 7.4.a 7.5.a; do - if test -r /usr/local/lib/libtcl$i; then - TCLLIB=/usr/local/lib/libtcl$i - TCLINCLUDE=-I/usr/local/include - fi -done -for i in .a 4.0.a 4.1.a; do - if test -r /usr/local/lib/libtk$i; then - TKLIB=/usr/local/lib/libtk$i - fi -done AC_SUBST(YAZDIR) AC_SUBST(MOSI) AC_SUBST(MOSIDIR) AC_SUBST(MOSILIB) AC_SUBST(MOSIINC) +AC_SUBST(XINCLUDES) +AC_SUBST(XLIBSW) +dnl ------ Preliminary settings +AC_PROG_INSTALL +AC_PREFIX_PROGRAM(tclsh) +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 ------ look for YAZ/XTImOSI AC_MSG_CHECKING(for YAZ directory) AC_ARG_WITH(yazdir,[ --with-yazdir Yaz directory], [YAZDIR=$withval]) if test "$YAZDIR" = "yes"; then @@ -78,6 +61,63 @@ else MOSITELL=no fi AC_MSG_RESULT($MOSITELL) +dnl ------ look for Tcl +if test "x$prefix" = xNONE; then + trylib=/usr/local/lib +else + trylib=${prefix}/lib +fi +if test -r ${trylib}/tclConfig.sh; then + AC_MSG_CHECKING(for Tcl) + source ${trylib}/tclConfig.sh + LIBS=$TCL_LIBS + 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 + TCLINCLUDE=-I${TCL_PREFIX}/include + RANLIB=$TCL_RANLIB + AC_MSG_RESULT($TCL_VERSION) +else + AC_PROG_RANLIB + checkBoth=0 + AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1) + if test "$tk_checkSocket" = 1; then + AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1) + fi + if test "$checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + AC_CHECK_FUNC(accept, , [LIBS=$tk_oldLibs]) + fi + 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 + if test -r ${trylib}/libtcl${i}.a; then + TCL_VERSION=$i + fi + done + if test "$TCL_VERSION" = nope; then + AC_MSG_WARN(Didn't find Tcl) + TCLLIB=-ltcl + TCLINCLUDE=" # -I.. Tcl/Tk include path" + else + AC_MSG_RESULT($TCL_VERSION) + TCLLIB=${trylib}/libtcl${TCL_VERSION}.a + TCLINCLUDE=-I${trylib} + fi + LIBS="${LIBS} -lm" +fi +dnl ------ look for Tk +TKLIB=-ltk +for i in .a 4.0.a 4.1.a; do + if test -r /usr/local/lib/libtk$i; then + TKLIB=/usr/local/lib/libtk$i + fi +done +dnl ------ look for X11 AC_PATH_X not_really_there="" if test "$no_x" = ""; then @@ -112,7 +152,6 @@ if test "$XINCLUDES" = nope; then echo "Warning: couldn't find any X11 include files." XINCLUDES="# no include files found" fi -AC_SUBST(XINCLUDES) if test "$no_x" = yes; then XLIBSW=nope if test "$XLIBSW" = nope; then @@ -137,5 +176,4 @@ if test "$XLIBSW" = nope ; then echo "Warning: couldn't find the X11 library archive. Using -lX11." XLIBSW=-lX11 fi -AC_SUBST(XLIBSW) AC_OUTPUT(Makefile) -- 1.7.10.4