From 7a1456252a76dea54f0c4204f510b82b6457f3bc Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 22 Jun 1995 13:46:52 +0000 Subject: [PATCH] Better detection of X11. New make feature: make distribution which does what it says. --- Makefile.in | 19 +++++++++++++--- configure.in | 69 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7a3b724..b2b1645 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.3 1995-06-22 07:15:57 adam Exp $ +# $Id: Makefile.in,v 1.4 1995-06-22 13:46:52 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -24,8 +24,8 @@ MOSIDIR=@MOSIDIR@ LIBS=@LIBS@ -lm # X11 libraries and include file paths -XLIB=@XLIB@ -lX11 -XINCLUDE=@XINCLUDE@ +XLIB=@XLIBSW@ +XINCLUDE=@XINCLUDES@ # Tcl/Tk libraries TCLLIB=@TCLLIB@ @@ -93,6 +93,19 @@ autoconf: autoconf configure +distribution: + echo "Making distribution version $(VERSION). Did you commit?" + autoconf + if [ -d tmp ]; then \ + rm -fr tmp; \ + fi + mkdir tmp; cd tmp; cvs export -f -D now ir-tcl + cp configure tmp/ir-tcl + cd tmp/ir-tcl/doc; make all + cd tmp; mv ir-tcl ir-tcl-$(VERSION) + cd tmp; tar zcf ../ir-tcl-$(VERSION).tar.gz ir-tcl-$(VERSION) + rm -fr tmp + .c.o: $(CC) -c $(CFLAGS) $(DEFS) $< diff --git a/configure.in b/configure.in index 7eaa25a..81bf02e 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl IR toolkit for tcl/tk dnl (c) Index Data 1995 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.3 1995-06-22 07:15:59 adam Exp $ +dnl $Id: configure.in,v 1.4 1995-06-22 13:46:53 adam Exp $ AC_INIT(README) AC_PROG_CC AC_PROG_RANLIB @@ -62,21 +62,68 @@ 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 ], , 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 ], , 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 - XINCLUDE="" + 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 -if test "x$x_libraries" != x; then - XLIB=-L$x_libraries +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 - XLIB="" + 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 +AC_SUBST(XLIBSW) AC_SUBST(TKLIB) -AC_CHECK_LIB(tk, Tk_MainLoop, tkFound=1, tkFound=0, $TCLLIB $XLIB -lX11 -lm) +AC_CHECK_LIB(tk, Tk_MainLoop, tkFound=1, tkFound=0, $TCLLIB $XLIBSW -lm) if test "$tkFound" = 1; then TKLIB=-ltk else -- 1.7.10.4