Removed lines and list as synonyms of list in MARC extractron.
[ir-tcl-moved-to-github.git] / configure.in
index ea86d56..8cb371f 100644 (file)
@@ -1,33 +1,52 @@
 dnl IR toolkit for tcl/tk
 dnl (c) Index Data 1995
 dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.1 1995-06-21 11:04:53 adam Exp $
-AC_INIT(README)
-AC_PROG_CC
+dnl $Id: configure.in,v 1.9 1995-08-28 12:21:21 adam Exp $
+AC_INIT(ir-tcl.h)
+CC=${CC-cc}
+AC_SUBST(CC)
 AC_PROG_RANLIB
 AC_PROG_INSTALL
-AC_CHECK_LIB(nsl, ,[LIBS="$LIBS -lnsl"])
-AC_CHECK_LIB(socket, ,[LIBS="$LIBS -lsocket"])
-AC_CHECK_LIB(net, , [LIBS="$LIBS -lnet"])
+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_HAVE_HEADERS(sys/select.h)
+AC_SUBST(TCLLIB)
+AC_CHECK_LIB(tcl, Tcl_Eval, tclFound=1, tclFound=0, -lm)
+if test "$tclFound" = 1; then
+    TCLLIB=-ltcl 
+elif test -r /usr/local/lib/libtcl7.4.a; then
+    TCLLIB=/usr/local/lib/libtcl7.4.a
+else
+    TCLLIB=/usr/local/lib/libtcl.a
+fi
 AC_SUBST(YAZDIR)
 AC_SUBST(MOSI)
 AC_SUBST(MOSILIB)
 AC_SUBST(MOSIDIR)
-AC_MSG_CHECKING(for Yaz directory)
+AC_MSG_CHECKING(for YAZ directory)
 AC_ARG_WITH(yazdir,[  --with-yazdir           Yaz directory], [YAZDIR=$withval])
 if test "$YAZDIR" = "yes"; then
-       YAZDIR="../yaz"
+       YAZDIR="../yaz-1.0b3"
 elif test "$YAZDIR" = ""; then
-       YAZDIR="../yaz"
-       if test -d "../yaz-1.0b"; then
-               YAZDIR="../yaz-1.0b"
-       fi
+        YAZDIR="../yaz"
+        for i in ../yaz-1.0b3 ../yaz-1.0b4 ../yaz-1.0 ../yaz; do
+            if test -d $i; then
+                YAZDIR=$i
+            fi
+        done
 fi
 AC_MSG_RESULT($YAZDIR)
 if test ! -d $YAZDIR; then
-       AC_MSG_WARN(Yaz directory doesnt exist)
+       AC_MSG_WARN(YAZ directory doesnt exist)
 fi
 AC_MSG_CHECKING(for MOSI)
 AC_ARG_WITH(mosidir, [  --with-mosidir          MOSI directory], [MOSIDIR=$withval])
@@ -48,17 +67,73 @@ else
         MOSITELL=no
 fi
 AC_MSG_RESULT($MOSITELL)
-AC_SUBST(XINCLUDE)
-AC_SUBST(XLIB)
-AC_FIND_X
-if test "x$x_includes" != x; then
-       XINCLUDE=-I$x_includes
+AC_PATH_X
+not_really_there=""
+if test "$no_x" = ""; then
+    if test "$x_includes" = ""; then
+       AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
+    else
+       if test ! -r $x_includes/X11/Intrinsic.h; then
+           not_really_there="yes"
+       fi
+    fi
+fi
+if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+    echo checking for X11 header files
+    XINCLUDES="# no special path needed"
+    AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
+    if test "$XINCLUDES" = nope; then
+        dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include"
+        for i in $dirs ; do
+           if test -r $i/X11/Intrinsic.h; then
+               XINCLUDES=" -I$i"
+           fi
+        done
+    fi
+else
+    if test "$x_includes" != ""; then
+       XINCLUDES=-I$x_includes
+    else
+       XINCLUDES="# no special path needed"
+    fi
+fi
+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
+       dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+       for i in $dirs ; do
+           if test -r $i/libX11.a; then
+               XLIBSW="-L$i -lX11"
+           fi
+       done
+    fi
 else
-       XINCLUDE=""
+    if test "$x_libraries" = ""; then
+       XLIBSW=-lX11
+    else
+       XLIBSW="-L$x_libraries -lX11"
+    fi
+fi
+if test "$XLIBSW" = nope ; then
+    AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
+fi
+if test "$XLIBSW" = nope ; then
+    echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
+    XLIBSW=-lX11
 fi
-if test "x$x_libraries" != x; then
-       XLIB=-L$x_libraries
+AC_SUBST(XLIBSW)
+AC_SUBST(TKLIB)
+AC_CHECK_LIB(tk, main, tkFound=1, tkFound=0, $TCLLIB $XLIBSW -lm)
+if test "$tkFound" = 1; then
+    TKLIB=-ltk
+elif test -r /usr/local/lib/libtk4.0.a; then
+    TKLIB=/usr/local/lib/libtk4.0.a
 else
-       XLIB=""
+    TKLIB=/usr/local/lib/libtk.a
 fi
 AC_OUTPUT(Makefile)