[eggheads-patches] PATCH: configure_tcl-changes.diff

Tothwolf tothwolf at concentric.net
Mon Oct 4 15:14:42 CST 1999


configure_tcl-changes.diff - changes the way configure looks for Tcl,
                             Makefile changes
-------------- next part --------------
Index: Makefile.in
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/Makefile.in,v
retrieving revision 1.9
diff -u -r1.9 Makefile.in
--- Makefile.in	1999/09/19 17:37:31	1.9
+++ Makefile.in	1999/10/03 06:24:50
@@ -61,17 +61,21 @@
 	@echo "To make eggdrop :"
 	@echo "   % make "
 
-clean: cleanmods
-	@rm -f eggdrop egg core *.o *.a *.so *~ *.stamp
-	@cd src ; rm -f eggdrop egg core *.o *.a *~ language/*~
-	@cd src/md5 ; ${MAKE} clean
-	
 cleanmods:
-	@cd src/mod ; ${MAKE} clean 'MAKE=${MAKE}'
+	@cd src/mod; ${MAKE} clean 'MAKE=${MAKE}'
 
-dist: clean
+clean: cleanmods
+	@rm -f eggdrop egg core DEBUG *.o *.a *.so *.stamp
+	@cd src; rm -f eggdrop egg core DEBUG *.o *.a
+	@cd src/md5; ${MAKE} clean
+	
+distclean: clean
 	@rm -f Makefile config.cache config.log config.status config.h lush.h
-	@rm -f doc/*~
+	@rm -f `find . \( -name '*~' -o -name '*#' -o -name '*.orig' \
+		-o -name '*.rej' -o -name '*.bak' \) -print`
+
+distrib: distclean Makefile.in
+	@rm -rf `find . \( -name "CVS" \) -print`
 	@echo "all:" >Makefile
 	@echo "	@./configure; make" >>Makefile
 
@@ -83,11 +87,10 @@
 	@echo You do not have the eggdrop source!
 	@exit 1
 
-OBJS =  botcmd.o botmsg.o botnet.o chanprog.o cmds.o \
-	dcc.o dccutil.o flags.o language.o main.o md5/md5c.o mem.o \
-	misc.o modules.o net.o rfc1459.o \
-	tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o userent.o \
-	userrec.o users.o
+OBJS =	botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \
+	dccutil.o flags.o language.o main.o mem.o misc.o \
+	modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o \
+	tclmisc.o tcluser.o userent.o userrec.o users.o md5/md5c.o
 
 GMAKE_STATIC = ${MAKE} 'CC=${CC}' 'LD=${LD}' 'OBJS=${OBJS}'\
 'STRIP=${MOD_STRIP}' 'CFLAGS=${CFLAGS} -DSTATIC' 'XLIBS=@TCL_LIBS@ @LIBS@'
@@ -113,32 +116,32 @@
 	@echo "Making module objects for static linking..."
 	@echo ""
 	@rm -f src/main.o
-	@cd src/mod;${GMAKE_STATIC} static
+	@cd src/mod; ${GMAKE_STATIC} static
 	@echo ""
 	@echo "Making core eggdrop for static linking..."
 	@echo ""
-	@cd src;${GMAKE_STATIC} static
+	@cd src; ${GMAKE_STATIC} static
 
 modegg: modtest
-	@cd src;${GMAKE_MOD} eggdrop
+	@cd src; ${GMAKE_MOD} eggdrop
 	@echo
 	@./eggdrop -v
 	@ls -la eggdrop
 	
 modules:  modtest
-	@cd src/mod;${GMAKE_SHLIB} modules
+	@cd src/mod; ${GMAKE_SHLIB} modules
 	@echo
 	@echo "modules made:"
 	@ls -la *.so
 
 debmodules:  modtest
-	@cd src/mod;${DMAKE_SHLIB} modules
+	@cd src/mod; ${DMAKE_SHLIB} modules
 	@echo
 	@echo "modules made:"
 	@ls -la *.so
 
 memegg:  modtest
-	@cd src;${DMAKE_MEM} eggdrop
+	@cd src; ${DMAKE_MEM} eggdrop
 	@echo
 	@./eggdrop -v
 	@ls -la eggdrop
@@ -197,8 +200,8 @@
 		rm -f $(DEST)/oeggdrop; \
 	fi
 	@if test ! -r $(DEST)/motd; then \
-	        $(CP1) motd $(DEST)/; \
-        fi
+		$(CP1) motd $(DEST)/; \
+	fi
 	@if test ! -r $(DEST)/telnet-banner; then \
 		$(CP1) telnet-banner $(DEST)/; \
 	fi
@@ -254,7 +257,7 @@
 		$(CP2) scripts/* $(DEST)/scripts; \
 	fi
 	@echo
-	@${MAKE} REALDEST=`cd $(DEST);pwd` install2
+	@${MAKE} REALDEST=`cd $(DEST); pwd` install2
 	@echo
 	@echo Installation completed.
 	@echo You MUST ensure that you edit/verify your configuration file.
@@ -263,6 +266,6 @@
 
 install2:
 	@echo Installing mods -- DEST = $(REALDEST)
-	@cd src/mod;${MAKE} REALDEST=$(REALDEST) install CP1='${CP1}'; cd ../..
+	@cd src/mod; ${MAKE} REALDEST=$(REALDEST) install CP1='${CP1}'; cd ../..
 
 #safety hash
Index: configure
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/configure,v
retrieving revision 1.12
diff -u -r1.12 configure
--- configure	1999/09/26 23:14:23	1.12
+++ configure	1999/10/03 06:24:59
@@ -932,7 +932,7 @@
 fi
 
 
-if test ! x${cross_compiling} = xno
+if ! test "x${cross_compiling}" = "xno"
 then
   echo ""
   echo "This system does not appear to have a working C compiler."
@@ -1128,7 +1128,7 @@
     DLOPEN_1=
     ;;
   BSD/OS)
-    if test x`uname -r | cut -d . -f 1` = "x2"
+    if test "x`uname -r | cut -d . -f 1`" = "x2"
     then
       echo "$ac_t""BSD/OS 2! statically linked modules are the only choice" 1>&6
       need_dl=0
@@ -1193,7 +1193,7 @@
     DLOPEN_1=
     ;;
   SunOS)
-    if test x`uname -r | cut -d . -f 1` = "x5"
+    if test "x`uname -r | cut -d . -f 1`" = "x5"
     then
       echo "$ac_t""Solaris!" 1>&6
       SHLIB_LD="/usr/ccs/bin/ld -G -z text"
@@ -1314,7 +1314,7 @@
 #define HPUX_HACKS 1
 EOF
 
-    if test x`uname -r | cut -d . -f 2` = "x10"
+    if test "x`uname -r | cut -d . -f 2`" = "x10"
     then
        cat >> confdefs.h <<\EOF
 #define HPUX10_HACKS 1
@@ -1334,7 +1334,7 @@
     DEFAULT_MAKE=static
     ;;
   *)
-    if test -r /mach
+    if test -r "/mach"
     then
       echo "$ac_t""NeXT...We are borg, you will be assimilated" 1>&6
       echo "$ac_t""break out the static modules, it's all you'll ever get :P" 1>&6
@@ -1352,7 +1352,7 @@
     ;;
 esac
 
-if test ${IRIX} = yes
+if test "${IRIX}" = "yes"
 then
   echo Skipping library tests because they CONFUSE Irix.
 else
@@ -1544,11 +1544,11 @@
   echo "$ac_t""no" 1>&6
 fi
 
-  if test x`${UNAME}` = "xSunOS"
+  if test "x`${UNAME}`" = "xSunOS"
   then
     echo $ac_n "checking for SunOS 4""... $ac_c" 1>&6
 echo "configure:1551: checking for SunOS 4" >&5
-    if test x`uname -r | cut -d . -f 1` = "x5"
+    if test "x`uname -r | cut -d . -f 1`" = "x5"
     then
       echo "$ac_t""Solaris -- "*bollocks*" zarni " 1>&6
     else
@@ -2349,13 +2349,26 @@
 rm -f abacab abacab.o abacab.c
 echo "   (standard is currently 48/512 bytes)"
 
-
 # ---------- begin robey's tcl thingies
+# (well, what used to be robey's tcl thingies...)
+
+# Check whether --with-tcllib or --without-tcllib was given.
+if test "${with_tcllib+set}" = set; then
+  withval="$with_tcllib"
+  tcllibname=$withval
+fi
+
+# Check whether --with-tclinc or --without-tclinc was given.
+if test "${with_tclinc+set}" = set; then
+  withval="$with_tclinc"
+  tclincname=$withval
+fi
 
+
 # Extract the first word of "basename", so it can be a program name with args.
 set dummy basename; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2359: checking for $ac_word" >&5
+echo "configure:2372: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_BASENAME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2384,7 +2397,7 @@
 # Extract the first word of "dirname", so it can be a program name with args.
 set dummy dirname; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2388: checking for $ac_word" >&5
+echo "configure:2401: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DIRNAME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2410,24 +2423,25 @@
   echo "$ac_t""no" 1>&6
 fi
 
-if test $BASENAME = "" || test $DIRNAME = ""
+if test "$BASENAME" = "" || test "$DIRNAME" = ""
 then
-  echo ack...no basename or dirname, we cant configure tcl without em.
+  echo "ack...no basename or dirname, we can't configure Tcl without them."
   exit 1
 fi
 
-# Check whether --with-tcllib or --without-tcllib was given.
-if test "${with_tcllib+set}" = set; then
-  withval="$with_tcllib"
-  tcllibname=$withval
-fi
+tcllibnames="tcl tcl8.2 tcl82 tcl8.1 tcl81 \
+	tcl8.0 tcl80 tcl7.6 tcl76 tcl7.5 tcl75"
 
-# Check whether --with-tclinc or --without-tclinc was given.
-if test "${with_tclinc+set}" = set; then
-  withval="$with_tclinc"
-  tclincname=$withval
-fi
+tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .a"
 
+tcllibpaths="$HOME/lib $HOME/tcl $HOME/tcl/lib $HOME \
+	/usr/local/lib /usr/local/lib/tcl \
+	/usr/local/pkgs/tcl/lib /usr/lib /lib \
+	/usr/i486-linuxaout/lib"
+
+tclheaderpaths="$HOME/include $HOME/tcl $HOME/tcl/include $HOME \
+	/usr/local/include /usr/local/include/tcl \
+	/usr/local/pkgs/tcl/include /usr/include /usr/include/tcl"
 
 if test -r "$tcllibname"
 then
@@ -2435,70 +2449,64 @@
   TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
   echo "using tcllib $TCLLIB/lib$TCLLIBFN"
 else
+
+  # look for libtcl: if TCLLIB is set, check there first
+  if test ! "$TCLLIB" = ""
+  then
+    for tcllibfn in $tcllibnames
+    do
+      for tcllibext in $tcllibextensions
+      do
+	if test -r "$TCLLIB/lib$tcllibfn$tcllibext"
+	then
+	  if test "$TCLLIBFN" = ""
+	  then
+	    TCLLIBFN=lib$libtclfn$tcllibext
+	    TCLLIBEXT=$tcllibext
+	    TCLLIBVER=`echo $tcllibfn | cut -c4-`
+	    break
+	  fi
+	fi
+      done
+    done
+    if test "$TCLLIBFN" = ""
+    then
+      echo "Environment variable TCLLIB is set, but incorrect."
+      unset TCLLIB
+    fi
+  fi
 
- libnames="tcl.so tcl.so.1\
-	tcl8.2.so tcl8.2.so.1 tcl82.so.1.0 tcl82.so.1\
-	tcl8.1.so tcl8.1.so.1 tcl81.so.1.0 tcl81.so.1\
-	tcl8.0.so tcl8.0.so.1 tcl80.so.1.0 tcl80.so.1\
-	tcl7.6.so tcl7.6.so.1 tcl76.so.1.0 tcl76.so.1\
-	tcl7.5.so tcl7.5.so.1 tcl75.so.1.0 tcl75.so.1\
-	tcl.a\
-	tcl8.2.a tcl82.a\
-	tcl8.1.a tcl81.a\
-	tcl8.0.a tcl80.a\
-	tcl7.6.a tcl76.a\
-	tcl7.5.a tcl75.a\
-	tcl7.4.a tcl74.a"
-
- # look for libtcl: if TCLLIB is set, check there first
- if test "$TCLLIB" != ""
- then
-   TCLLIBFN=notfound
-   for checkfn in $libnames
-   do
-     if test -r $TCLLIB/lib$checkfn
-     then
-       if test $TCLLIBFN = notfound
-       then
-	 TCLLIBFN=$checkfn
-       fi
-     fi
-   done
-   if test $TCLLIBFN = notfound
-   then
-     echo "Environment variable TCLLIB is set, but incorrect."
-     unset TCLLIB
-   fi
- fi
-
- # check in common places now
- echo $ac_n "checking for libtcl""... $ac_c" 1>&6
-echo "configure:2477: checking for libtcl" >&5
- if test "$TCLLIB" = ""
- then
-   for checkfn in $libnames
-   do
-     if test "$TCLLIB" = ""
-     then
-       for check in /usr/local/lib /usr/local/lib/tcl /usr/local/pkgs/tcl/lib /usr/lib /usr/i486-linuxaout/lib $HOME/lib $HOME/tcl $HOME/tcl/lib $HOME /lib
-       do
-	 if test -r $check/lib$checkfn
-         then
-	   if test "$TCLLIB" = ""
-           then
-	     echo "$ac_t""found in $check/lib$checkfn" 1>&6
-	     TCLLIB=$check
-	     TCLLIBFN=$checkfn
-	   fi
-	 fi
-       done
-     fi
-   done
- else
-   echo "$ac_t""found in $TCLLIB/lib$TCLLIBFN" 1>&6
- fi
+  # check in common places now
+  echo $ac_n "checking for libtcl""... $ac_c" 1>&6
+echo "configure:2482: checking for libtcl" >&5
+  if test ! "$TCLLIB" = ""
+  then
+    echo "$ac_t""found in $TCLLIB/$TCLLIBFN" 1>&6
+  else
+    for tcllibfn in $tcllibnames
+    do
+      for tcllibext in $tcllibextensions
+      do
+	for tcllibpath in $tcllibpaths
+	do
+	  if test -r "$tcllibpath/lib$tcllibfn$tcllibext"
+	  then
+	    if test "$TCLLIB" = ""
+	    then
+	      echo "$ac_t""found in $tcllibpath/lib$tcllibfn$tcllibext" 1>&6
+	      TCLLIB=$tcllibpath
+	      TCLLIBFN=lib$tcllibfn$tcllibext
+	      TCLLIBEXT=$tcllibext
+	      TCLLIBVER=`echo $tcllibfn | cut -c4-`
+	      break 3
+	    fi
+	  fi
+	done
+      done
+    done
+  fi
 
-fi # option
+fi # test tcllibname
 
 # give up if they don't even have that
 if test "$TCLLIB" = ""
@@ -2513,10 +2521,12 @@
   TCLINCFN=`$BASENAME $tclincname`
   echo "using TCL header $TCLINC/$TCLINCFN"
 else
+
   TCLINCFN=tcl.h
-  if test "$TCLINC" != ""
+
+  if test ! "$TCLINC" = ""
   then
-    if test ! -r $TCLINC/$TCLINCFN
+    if test ! -r "$TCLINC/$TCLINCFN"
     then
       echo "Environment variable TCLINC is set, but incorrect."
       unset TCLINC
@@ -2525,41 +2535,23 @@
 
   # check in common places now
   echo $ac_n "checking for $TCLINCFN""... $ac_c" 1>&6
-echo "configure:2529: checking for $TCLINCFN" >&5
-  if test "$TCLINC" = ""
+echo "configure:2539: checking for $TCLINCFN" >&5
+  if test ! "$TCLINC" = ""
   then
-    for check in /usr/local/include /usr/local/include/tcl /usr/local/pkgs/tcl/include /usr/include /usr/include/tcl $HOME/include $HOME/tcl $HOME/tcl/include $HOME
+    echo "$ac_t""found in $TCLINC/$TCLINCFN" 1>&6
+  else
+    for headerpath in $tclheaderpaths /usr/local/include/tcl${TCLLIBVER}/
     do
-      if test -r $check/$TCLINCFN
+      if test -r "$headerpath/$TCLINCFN"
       then
-	if test "$TCLINC" != ""
-        then
+	if test "$TCLINC" = ""
+	then
+	  echo "$ac_t""found in $headerpath/$TCLINCFN" 1>&6
+	  TCLINC=$headerpath
 	  break
 	fi
-	echo "$ac_t""found in $check/$TCLINCFN" 1>&6
-	TCLINC=$check
-	break
       fi
     done
-    # freebsd hack
-    if test "$TCLINC" = ""
-    then
-      for ver in 8.2 8.1 8.0 7.6 7.5 7.4
-      do
-	if test -r /usr/local/include/tcl$ver/$TCLINCFN
-        then
-	  if test "$TCLINC" != ""
-          then
-	    break
-	  fi
-	  echo "$ac_t""found in /usr/local/include/tcl$ver/$TCLINCFN" 1>&6
-	  TCLINC=/usr/local/include/tcl$ver
-	  break
-	fi
-      done
-    fi
-  else
-    echo "$ac_t""found in $TCLINC/$TCLINCFN" 1>&6
   fi
 
   # had TCLLIB but not TCLINC?  so close... :(
@@ -2568,8 +2560,11 @@
     echo "$ac_t""not found" 1>&6
     unset TCLLIB
     unset TCLLIBFN
+    unset TCLLIBEXT
+    unset TCLLIBVER
   fi
-fi # option
+
+fi # test tclincname
 
 # done looking, now either TCLLIB & TCLINC are both set, or neither is set
 
@@ -2589,99 +2584,97 @@
   echo ""
   exit 1
 else
-  echo Checking $TCLINC directory for tcl version
   echo $ac_n "checking for Tcl version""... $ac_c" 1>&6
-echo "configure:2595: checking for Tcl version" >&5
-  tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "7.5" | wc -l`
-  if test $tclver = 0; then
-    tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "7.6" | wc -l`
-    if test $tclver = 0; then
-      tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.0" | wc -l`
-      if test $tclver = 0; then
-	tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.1" | wc -l`
-	if test $tclver = 0; then
-	  tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.2" | wc -l`
-	  if test $tclver = 1; then
-	    echo "$ac_t""8.2 found" 1>&6	
-	  else
-	    echo "$ac_t""hmm... unknown version" 1>&6
-          fi
-	else
-	  echo "$ac_t""8.1 found" 1>&6
-	fi
-      else
-	echo "$ac_t""8.0 found!" 1>&6
-      fi
-    else
-      echo "$ac_t""7.6 found!" 1>&6
-    fi
-  else      
-    echo "$ac_t""7.5 found" 1>&6
-  fi
-fi # option 
+echo "configure:2589: checking for Tcl version" >&5
 
-  if test $need_dl = 1 -a "${ac_cv_func_dlopen}" = "no"
-  then
-    if test "$LINUX" = "yes"
+  for ver in $tcllibnames
+  do
+    ver=`echo $ver | cut -c4-`
+    if test ! "$ver" = ""
     then
-      echo "Since you are on a Linux system, this has a known problem,"
-      if test -r /lib/libdl.so.1
+      tclfound=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep $ver | wc -l`
+      if test ! $tclfound = 0
       then
-	echo "and you seem to have it, I know a kludge for it,"
-	echo "so we'll do that..."
-	echo ""
-	cat >> confdefs.h <<\EOF
-#define HAVE_DLOPEN 1
-EOF
-
-	LIBS="/lib/libdl.so.1 $LIBS"
-	got_dl=1
-      else 
-	echo "which you DONT seem to have... doh!"
-	echo "perhaps you may still have the stuff lying around somewhere"
-	echo "if you work out where it is, add it to your XLIBS= lines"
-	echo "and #define HAVE_DLOPEN in config.h"
-	echo ""
-	echo "we'll proceed on anyways, but you probably won't be able"
-	echo "to 'make eggdrop' but you might be able to make the"
-	echo "static bot (I'll default your make to this version)."
-	DEFAULT_MAKE=static
+	tclversion=$ver
+	break
       fi
-    else 
-      echo "You don't seem to have libdl anywhere I can find it, this will"
-      echo "prevent you from doing dynamic modules, I'll set your default"
-      echo "make to static linking."
-      DEFAULT_MAKE=static
     fi
+  done
+
+  if test ! "$tclversion" = ""
+  then
+    echo "$ac_t""$tclversion found" 1>&6
+  else
+    echo "$ac_t""hmm... unknown version" 1>&6
   fi
 
-  TCLLIBFNS=`basename $TCLLIBFN .a`
-  TCLLIBFNS=`basename $TCLLIBFNS .so.1.2`
-  TCLLIBFNS=`basename $TCLLIBFNS .so.1.0`
-  TCLLIBFNS=`basename $TCLLIBFNS .so.1`
-  TCLLIBFNS=`basename $TCLLIBFNS .so`
-  if test $tclver = 1
+  if test $tclfound = 1
   then
-    TCL_REQS="$TCLLIB/lib$TCLLIBFN"
-    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm"
+    TCL_REQS="$TCLLIB/$TCLLIBFN"
+    TCL_LIBS="-L$TCLLIB -ltcl$TCLLIBVER -lm"
   else
     echo ""
-    echo "You're tcl version is way too old - Version 7.4 or earlier"
+    echo "Your tcl version is too old - version 7.4 or earlier"
     echo "I suggest you download and complie a more recent version"
-    echo "The most reliable current version is 8.2b1"
+    echo "The most reliable current version is 8.2.0"
     echo ""
     exit 1
   fi
 
+  if test "$TCLLIBEXT" = ".a"
+  then
+    echo ""
+    echo "Your libtcl is not a shared library, eggdrop will build static."
+    echo ""
+    DEFAULT_MAKE=static
+  fi
 
+fi # test TCLLIB
 
 
 
 
 
 
+
+
 # ---------- end of robey's tcl thingies
 
+if test $need_dl = 1 && test "${ac_cv_func_dlopen}" = "no"
+then
+  if test "$LINUX" = "yes"
+  then
+    echo "Since you are on a Linux system, this has a known problem,"
+    if test -r "/lib/libdl.so.1"
+    then
+      echo "and you seem to have it, I know a kludge for it,"
+      echo "so we'll do that..."
+      echo ""
+      cat >> confdefs.h <<\EOF
+#define HAVE_DLOPEN 1
+EOF
+
+      LIBS="/lib/libdl.so.1 $LIBS"
+      got_dl=1
+    else 
+      echo "which you DONT seem to have... doh!"
+      echo "perhaps you may still have the stuff lying around somewhere"
+      echo "if you work out where it is, add it to your XLIBS= lines"
+      echo "and #define HAVE_DLOPEN in config.h"
+      echo ""
+      echo "we'll proceed on anyways, but you probably won't be able"
+      echo "to 'make eggdrop' but you might be able to make the"
+      echo "static bot (I'll default your make to this version)."
+      DEFAULT_MAKE=static
+    fi
+  else 
+    echo "You don't seem to have libdl anywhere I can find it, this will"
+    echo "prevent you from doing dynamic modules, I'll set your default"
+    echo "make to static linking."
+    DEFAULT_MAKE=static
+  fi
+fi
+
 if test ! "x$GMAKE" = "x"
 then
   SET_MAKE="MAKE=gmake"
@@ -2691,7 +2684,6 @@
 then
   DEST=\${prefix}
 fi
-
 
 
 
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/configure.in,v
retrieving revision 1.11
diff -u -r1.11 configure.in
--- configure.in	1999/09/26 23:14:23	1.11
+++ configure.in	1999/10/03 06:25:02
@@ -17,7 +17,7 @@
 AC_MINIX
 dnl no cross-compiling!
 
-if test ! x${cross_compiling} = xno
+if ! test "x${cross_compiling}" = "xno"
 then
   echo ""
   echo "This system does not appear to have a working C compiler."
@@ -101,7 +101,7 @@
     DLOPEN_1=
     ;;
   BSD/OS)
-    if test x`uname -r | cut -d . -f 1` = "x2"
+    if test "x`uname -r | cut -d . -f 1`" = "x2"
     then
       AC_MSG_RESULT(BSD/OS 2! statically linked modules are the only choice)
       need_dl=0
@@ -132,7 +132,7 @@
     DLOPEN_1=
     ;;
   SunOS)
-    if test x`uname -r | cut -d . -f 1` = "x5"
+    if test "x`uname -r | cut -d . -f 1`" = "x5"
     then
       AC_MSG_RESULT(Solaris!)
       SHLIB_LD="/usr/ccs/bin/ld -G -z text"
@@ -180,7 +180,7 @@
     AC_CHECK_LIB(dld,shl_load)
     AC_DEFINE(MODULES_OK)
     AC_DEFINE(HPUX_HACKS)
-    if test x`uname -r | cut -d . -f 2` = "x10"
+    if test "x`uname -r | cut -d . -f 2`" = "x10"
     then
        AC_DEFINE(HPUX10_HACKS)
     fi
@@ -197,7 +197,7 @@
     DEFAULT_MAKE=static
     ;;
   *)
-    if test -r /mach
+    if test -r "/mach"
     then
       AC_MSG_RESULT([NeXT...We are borg, you will be assimilated])
       AC_MSG_RESULT([break out the static modules, it's all you'll ever get :P])
@@ -213,7 +213,7 @@
 esac
 
 dnl Check for Sun libraries.
-if test ${IRIX} = yes
+if test "${IRIX}" = "yes"
 then
   echo Skipping library tests because they CONFUSE Irix.
 else
@@ -221,10 +221,10 @@
   AC_CHECK_LIB(nsl,connect)
   AC_CHECK_LIB(dns,gethostbyname)
   AC_CHECK_LIB(dl,dlopen)
-  if test x`${UNAME}` = "xSunOS"
+  if test "x`${UNAME}`" = "xSunOS"
   then
     AC_MSG_CHECKING(for SunOS 4)
-    if test x`uname -r | cut -d . -f 1` = "x5"
+    if test "x`uname -r | cut -d . -f 1`" = "x5"
     then
       AC_MSG_RESULT(Solaris -- "*bollocks*" zarni )
     else
@@ -287,20 +287,34 @@
 echo "   (standard is currently 48/512 bytes)"
 
 dnl where is tcl?  is it here?
-
 # ---------- begin robey's tcl thingies
+# (well, what used to be robey's tcl thingies...)
 
 dnl oohh new configure --variables for those with multiple tcl libs
+AC_ARG_WITH(tcllib, [  --with-tcllib=PATH      full path to tcl library], tcllibname=$withval)
+AC_ARG_WITH(tclinc, [  --with-tclinc=PATH      full path to tcl header], tclincname=$withval)
+
 AC_CHECK_PROG(BASENAME,basename,basename)
 AC_CHECK_PROG(DIRNAME,dirname,dirname)
-if test $BASENAME = "" || test $DIRNAME = ""
+if test "$BASENAME" = "" || test "$DIRNAME" = ""
 then
-  echo ack...no basename or dirname, we cant configure tcl without em.
+  echo "ack...no basename or dirname, we can't configure Tcl without them."
   exit 1
 fi
 
-AC_ARG_WITH(tcllib, [  --with-tcllib=PATH      full path to tcl library], tcllibname=$withval)
-AC_ARG_WITH(tclinc, [  --with-tclinc=PATH      full path to tcl header], tclincname=$withval)
+tcllibnames="tcl tcl8.2 tcl82 tcl8.1 tcl81 \
+	tcl8.0 tcl80 tcl7.6 tcl76 tcl7.5 tcl75"
+
+tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .a"
+
+tcllibpaths="$HOME/lib $HOME/tcl $HOME/tcl/lib $HOME \
+	/usr/local/lib /usr/local/lib/tcl \
+	/usr/local/pkgs/tcl/lib /usr/lib /lib \
+	/usr/i486-linuxaout/lib"
+
+tclheaderpaths="$HOME/include $HOME/tcl $HOME/tcl/include $HOME \
+	/usr/local/include /usr/local/include/tcl \
+	/usr/local/pkgs/tcl/include /usr/include /usr/include/tcl"
 
 if test -r "$tcllibname"
 then
@@ -308,69 +322,63 @@
   TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
   echo "using tcllib $TCLLIB/lib$TCLLIBFN"
 else
+
+  # look for libtcl: if TCLLIB is set, check there first
+  if test ! "$TCLLIB" = ""
+  then
+    for tcllibfn in $tcllibnames
+    do
+      for tcllibext in $tcllibextensions
+      do
+	if test -r "$TCLLIB/lib$tcllibfn$tcllibext"
+	then
+	  if test "$TCLLIBFN" = ""
+	  then
+	    TCLLIBFN=lib$libtclfn$tcllibext
+	    TCLLIBEXT=$tcllibext
+	    TCLLIBVER=`echo $tcllibfn | cut -c4-`
+	    break
+	  fi
+	fi
+      done
+    done
+    if test "$TCLLIBFN" = ""
+    then
+      echo "Environment variable TCLLIB is set, but incorrect."
+      unset TCLLIB
+    fi
+  fi
 
- libnames="tcl.so tcl.so.1\
-	tcl8.2.so tcl8.2.so.1 tcl82.so.1.0 tcl82.so.1\
-	tcl8.1.so tcl8.1.so.1 tcl81.so.1.0 tcl81.so.1\
-	tcl8.0.so tcl8.0.so.1 tcl80.so.1.0 tcl80.so.1\
-	tcl7.6.so tcl7.6.so.1 tcl76.so.1.0 tcl76.so.1\
-	tcl7.5.so tcl7.5.so.1 tcl75.so.1.0 tcl75.so.1\
-	tcl.a\
-	tcl8.2.a tcl82.a\
-	tcl8.1.a tcl81.a\
-	tcl8.0.a tcl80.a\
-	tcl7.6.a tcl76.a\
-	tcl7.5.a tcl75.a\
-	tcl7.4.a tcl74.a"
-
- # look for libtcl: if TCLLIB is set, check there first
- if test "$TCLLIB" != ""
- then
-   TCLLIBFN=notfound
-   for checkfn in $libnames
-   do
-     if test -r $TCLLIB/lib$checkfn
-     then
-       if test $TCLLIBFN = notfound
-       then
-	 TCLLIBFN=$checkfn
-       fi
-     fi
-   done
-   if test $TCLLIBFN = notfound
-   then
-     echo "Environment variable TCLLIB is set, but incorrect."
-     unset TCLLIB
-   fi
- fi
-
- # check in common places now
- AC_MSG_CHECKING(for libtcl)
- if test "$TCLLIB" = ""
- then
-   for checkfn in $libnames
-   do
-     if test "$TCLLIB" = ""
-     then
-       for check in /usr/local/lib /usr/local/lib/tcl /usr/local/pkgs/tcl/lib /usr/lib /usr/i486-linuxaout/lib $HOME/lib $HOME/tcl $HOME/tcl/lib $HOME /lib
-       do
-	 if test -r $check/lib$checkfn
-         then
-	   if test "$TCLLIB" = ""
-           then
-	     AC_MSG_RESULT(found in $check/lib$checkfn)
-	     TCLLIB=$check
-	     TCLLIBFN=$checkfn
-	   fi
-	 fi
-       done
-     fi
-   done
- else
-   AC_MSG_RESULT(found in $TCLLIB/lib$TCLLIBFN)
- fi
+  # check in common places now
+  AC_MSG_CHECKING(for libtcl)
+  if test ! "$TCLLIB" = ""
+  then
+    AC_MSG_RESULT(found in $TCLLIB/$TCLLIBFN)
+  else
+    for tcllibfn in $tcllibnames
+    do
+      for tcllibext in $tcllibextensions
+      do
+	for tcllibpath in $tcllibpaths
+	do
+	  if test -r "$tcllibpath/lib$tcllibfn$tcllibext"
+	  then
+	    if test "$TCLLIB" = ""
+	    then
+	      AC_MSG_RESULT(found in $tcllibpath/lib$tcllibfn$tcllibext)
+	      TCLLIB=$tcllibpath
+	      TCLLIBFN=lib$tcllibfn$tcllibext
+	      TCLLIBEXT=$tcllibext
+	      TCLLIBVER=`echo $tcllibfn | cut -c4-`
+	      break 3
+	    fi
+	  fi
+	done
+      done
+    done
+  fi
 
-fi # option
+fi # test tcllibname
 
 # give up if they don't even have that
 if test "$TCLLIB" = ""
@@ -385,10 +393,12 @@
   TCLINCFN=`$BASENAME $tclincname`
   echo "using TCL header $TCLINC/$TCLINCFN"
 else
+
   TCLINCFN=tcl.h
-  if test "$TCLINC" != ""
+
+  if test ! "$TCLINC" = ""
   then
-    if test ! -r $TCLINC/$TCLINCFN
+    if test ! -r "$TCLINC/$TCLINCFN"
     then
       echo "Environment variable TCLINC is set, but incorrect."
       unset TCLINC
@@ -397,40 +407,22 @@
 
   # check in common places now
   AC_MSG_CHECKING(for $TCLINCFN)
-  if test "$TCLINC" = ""
+  if test ! "$TCLINC" = ""
   then
-    for check in /usr/local/include /usr/local/include/tcl /usr/local/pkgs/tcl/include /usr/include /usr/include/tcl $HOME/include $HOME/tcl $HOME/tcl/include $HOME
+    AC_MSG_RESULT(found in $TCLINC/$TCLINCFN)
+  else
+    for headerpath in $tclheaderpaths /usr/local/include/tcl${TCLLIBVER}/
     do
-      if test -r $check/$TCLINCFN
+      if test -r "$headerpath/$TCLINCFN"
       then
-	if test "$TCLINC" != ""
-        then
+	if test "$TCLINC" = ""
+	then
+	  AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
+	  TCLINC=$headerpath
 	  break
 	fi
-	AC_MSG_RESULT(found in $check/$TCLINCFN)
-	TCLINC=$check
-	break
       fi
     done
-    # freebsd hack
-    if test "$TCLINC" = ""
-    then
-      for ver in 8.2 8.1 8.0 7.6 7.5 7.4
-      do
-	if test -r /usr/local/include/tcl$ver/$TCLINCFN
-        then
-	  if test "$TCLINC" != ""
-          then
-	    break
-	  fi
-	  AC_MSG_RESULT(found in /usr/local/include/tcl$ver/$TCLINCFN)
-	  TCLINC=/usr/local/include/tcl$ver
-	  break
-	fi
-      done
-    fi
-  else
-    AC_MSG_RESULT(found in $TCLINC/$TCLINCFN)
   fi
 
   # had TCLLIB but not TCLINC?  so close... :(
@@ -439,9 +431,12 @@
     AC_MSG_RESULT(not found)
     unset TCLLIB
     unset TCLLIBFN
+    unset TCLLIBEXT
+    unset TCLLIBVER
   fi
-fi # option
 
+fi # test tclincname
+
 # done looking, now either TCLLIB & TCLINC are both set, or neither is set
 
 if test "$TCLLIB" = ""
@@ -460,86 +455,52 @@
   echo ""
   exit 1
 else
-  echo Checking $TCLINC directory for tcl version
   AC_MSG_CHECKING(for Tcl version)
-  tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "7.5" | wc -l`
-  if test $tclver = 0; then
-    tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "7.6" | wc -l`
-    if test $tclver = 0; then
-      tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.0" | wc -l`
-      if test $tclver = 0; then
-	tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.1" | wc -l`
-	if test $tclver = 0; then
-	  tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.2" | wc -l`
-	  if test $tclver = 1; then
-	    AC_MSG_RESULT(8.2 found)	
-	  else
-	    AC_MSG_RESULT(hmm... unknown version)
-          fi
-	else
-	  AC_MSG_RESULT(8.1 found)
-	fi
-      else
-	AC_MSG_RESULT(8.0 found!)
-      fi
-    else
-      AC_MSG_RESULT(7.6 found!)
-    fi
-  else      
-    AC_MSG_RESULT(7.5 found)
-  fi
-fi # option 
 
-  if test $need_dl = 1 -a "${ac_cv_func_dlopen}" = "no"
-  then
-    if test "$LINUX" = "yes"
+  for ver in $tcllibnames
+  do
+    ver=`echo $ver | cut -c4-`
+    if test ! "$ver" = ""
     then
-      echo "Since you are on a Linux system, this has a known problem,"
-      if test -r /lib/libdl.so.1
+      tclfound=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep $ver | wc -l`
+      if test ! $tclfound = 0
       then
-	echo "and you seem to have it, I know a kludge for it,"
-	echo "so we'll do that..."
-	echo ""
-	AC_DEFINE(HAVE_DLOPEN)
-	LIBS="/lib/libdl.so.1 $LIBS"
-	got_dl=1
-      else 
-	echo "which you DONT seem to have... doh!"
-	echo "perhaps you may still have the stuff lying around somewhere"
-	echo "if you work out where it is, add it to your XLIBS= lines"
-	echo "and #define HAVE_DLOPEN in config.h"
-	echo ""
-	echo "we'll proceed on anyways, but you probably won't be able"
-	echo "to 'make eggdrop' but you might be able to make the"
-	echo "static bot (I'll default your make to this version)."
-	DEFAULT_MAKE=static
+	tclversion=$ver
+	break
       fi
-    else 
-      echo "You don't seem to have libdl anywhere I can find it, this will"
-      echo "prevent you from doing dynamic modules, I'll set your default"
-      echo "make to static linking."
-      DEFAULT_MAKE=static
     fi
+  done
+
+  if test ! "$tclversion" = ""
+  then
+    AC_MSG_RESULT($tclversion found)
+  else
+    AC_MSG_RESULT(hmm... unknown version)
   fi
 
-  TCLLIBFNS=`basename $TCLLIBFN .a`
-  TCLLIBFNS=`basename $TCLLIBFNS .so.1.2`
-  TCLLIBFNS=`basename $TCLLIBFNS .so.1.0`
-  TCLLIBFNS=`basename $TCLLIBFNS .so.1`
-  TCLLIBFNS=`basename $TCLLIBFNS .so`
-  if test $tclver = 1
+  if test $tclfound = 1
   then
-    TCL_REQS="$TCLLIB/lib$TCLLIBFN"
-    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm"
+    TCL_REQS="$TCLLIB/$TCLLIBFN"
+    TCL_LIBS="-L$TCLLIB -ltcl$TCLLIBVER -lm"
   else
     echo ""
-    echo "You're tcl version is way too old - Version 7.4 or earlier"
+    echo "Your tcl version is too old - version 7.4 or earlier"
     echo "I suggest you download and complie a more recent version"
-    echo "The most reliable current version is 8.2b1"
+    echo "The most reliable current version is 8.2.0"
     echo ""
     exit 1
   fi
 
+  if test "$TCLLIBEXT" = ".a"
+  then
+    echo ""
+    echo "Your libtcl is not a shared library, eggdrop will build static."
+    echo ""
+    DEFAULT_MAKE=static
+  fi
+
+fi # test TCLLIB
+
 AC_SUBST(TCLINC)
 AC_SUBST(TCLLIB)
 AC_SUBST(TCLINCFN)
@@ -549,6 +510,38 @@
 
 # ---------- end of robey's tcl thingies
 
+if test $need_dl = 1 && test "${ac_cv_func_dlopen}" = "no"
+then
+  if test "$LINUX" = "yes"
+  then
+    echo "Since you are on a Linux system, this has a known problem,"
+    if test -r "/lib/libdl.so.1"
+    then
+      echo "and you seem to have it, I know a kludge for it,"
+      echo "so we'll do that..."
+      echo ""
+      AC_DEFINE(HAVE_DLOPEN)
+      LIBS="/lib/libdl.so.1 $LIBS"
+      got_dl=1
+    else 
+      echo "which you DONT seem to have... doh!"
+      echo "perhaps you may still have the stuff lying around somewhere"
+      echo "if you work out where it is, add it to your XLIBS= lines"
+      echo "and #define HAVE_DLOPEN in config.h"
+      echo ""
+      echo "we'll proceed on anyways, but you probably won't be able"
+      echo "to 'make eggdrop' but you might be able to make the"
+      echo "static bot (I'll default your make to this version)."
+      DEFAULT_MAKE=static
+    fi
+  else 
+    echo "You don't seem to have libdl anywhere I can find it, this will"
+    echo "prevent you from doing dynamic modules, I'll set your default"
+    echo "make to static linking."
+    DEFAULT_MAKE=static
+  fi
+fi
+
 if test ! "x$GMAKE" = "x"
 then
   SET_MAKE="MAKE=gmake"
@@ -573,7 +566,6 @@
 AC_SUBST(BEL_MOD_STRIP)
 AC_SUBST(DLFLAGS)
 AC_SUBST(DEFAULT_MAKE)
-
 AC_OUTPUT(Makefile lush.h)
 
 # if you configure again, you must re-make everything.  tough shit.
Index: doc/UPDATES1.3
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/doc/UPDATES1.3,v
retrieving revision 1.167
diff -u -r1.167 UPDATES1.3
--- doc/UPDATES1.3	1999/10/02 22:31:10	1.167
+++ doc/UPDATES1.3	1999/10/03 06:25:12
@@ -4,6 +4,9 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          Tothwolf  changed the way './configure' checks for Tcl,
+                    check for Tcl on freebsd machines properly,
+                    Makefile changes.
           dw        it said 'JOIN flood from @%s!  Banning.'
                     for nick floods.
 reddawg   rtc       md5 make could fail on some OS
Index: src/Makefile
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/src/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- src/Makefile	1999/10/02 22:31:15	1.4
+++ src/Makefile	1999/10/03 06:25:13
@@ -73,9 +73,6 @@
 	'-DLDFLAGS="${LD}"' \
 	'-DSTRIPFLAGS="${STRIP}"' main.c
 
-md5/md5c.o:
-	@cd md5; ${GMAKE} md5
-
 mem.o: mem.c
 	${CC} ${CFLAGS} mem.c
 	
@@ -114,6 +111,9 @@
 
 users.o: users.c
 	${CC} ${CFLAGS} users.c
+
+md5/md5c.o:
+	@cd md5; ${GMAKE} md5
 	@echo "---------- Yeah! that's the compiling, now the linking! ----------"
 
 # I orginially had this in another file, but some lame make's can't cope :/ 


More information about the Patches mailing list