Bläddra i källkod

Merge branch 'optional-tcl'

* optional-tcl:
  * Fix symbol generating files changing between builds when it shouldn't have been
  * Don't try looking for TCL files if disabled
  * Reference proper build name
  * Use new MY_ARG_DISABLED for tcl/ipv6
  * Use MY_ARG_WITH_PATH for OpenSSL path
  * Add macros: MY_ARG_WITH, MY_ARG_WITH_PATH, MY_ARG_ENABLE, MY_ARG_DISABLE
  * Add --disable-script-tcl (default enabled)
  * Include -I in TCLINC
  * Don't exit if failing to find a symbol
  * Only echo out typedef if non-empty
  * Hide errors when pre-processing files for symbols
  * Speedup symbol generating by executing generate_symbol.sh less often
  * Cleanup wording on failure to find TCL

Conflicts:
	autotools/configure.ac
	configure
Bryan Drewery 14 år sedan
förälder
incheckning
7f0258d186
11 ändrade filer med 565 tillägg och 412 borttagningar
  1. 1 1
      Makefile.in
  2. 9 2
      autotools/configure.ac
  3. 67 26
      autotools/includes/acinclude.m4
  4. 204 177
      autotools/includes/libtcl.m4
  5. 11 1
      config.h.in
  6. 233 178
      configure
  7. 2 2
      src/cmds.c
  8. 13 11
      src/generate_defs.sh
  9. 17 6
      src/generate_symbol.sh
  10. 7 7
      src/libtcl.c
  11. 1 1
      src/libtcl.h

+ 1 - 1
Makefile.in

@@ -40,7 +40,7 @@ DIFF = @DIFF@
 
 
 #LIBS = @LIBS@ @ZLIB@
 #LIBS = @LIBS@ @ZLIB@
 LIBS = @LIBS@
 LIBS = @LIBS@
-INCLUDES = -I@TCLINC@
+INCLUDES = @TCL_INCLUDES@
 
 
 DEBCXXFLAGS = -DDEBUG -fno-inline -g3 -ggdb3 -O0 -Wshadow -Wpointer-arith -Wcast-align @GCC3DEB@ @GCC4DEB@
 DEBCXXFLAGS = -DDEBUG -fno-inline -g3 -ggdb3 -O0 -Wshadow -Wpointer-arith -Wcast-align @GCC3DEB@ @GCC4DEB@
 CFLGS = @GCC3@ -fno-rtti @SSL_INCLUDES@
 CFLGS = @GCC3@ -fno-rtti @SSL_INCLUDES@

+ 9 - 2
autotools/configure.ac

@@ -124,7 +124,7 @@ tclheaderpaths="$HOME/include $HOME/tcl/include \
 
 
 
 
 # Misc Tcl checks.
 # Misc Tcl checks.
-EGG_TCL_ARG_WITH
+EGG_TCL_OPTIONS
 EGG_TCL_ENV
 EGG_TCL_ENV
 EGG_TCL_WITH_TCLLIB
 EGG_TCL_WITH_TCLLIB
 EGG_TCL_WITH_TCLINC
 EGG_TCL_WITH_TCLINC
@@ -260,6 +260,13 @@ AH_BOTTOM([/*
 #    endif
 #    endif
 #  endif
 #  endif
 #endif
 #endif
+
+/* TCL sanity check */
+#ifdef USE_SCRIPT_TCL
+#  ifndef HAVE_LIBTCL
+#    undef USE_SCRIPT_TCL
+#  endif
+#endif
 ])
 ])
 
 
 [
 [
@@ -285,7 +292,7 @@ if test -d .git; then
 fi
 fi
 ]
 ]
 
 
-CXX="$CXX" TCLINC="$TCLINC" SSL_INCLUDES="$SSL_INCLUDES" SED="$SED" src/generate_defs.sh
+CXX="$CXX" TCL_INCLUDES="$TCL_INCLUDES" SSL_INCLUDES="$SSL_INCLUDES" SED="$SED" src/generate_defs.sh
 [
 [
 if [ $? -ne 0 ]; then
 if [ $? -ne 0 ]; then
   exit 1
   exit 1

+ 67 - 26
autotools/includes/acinclude.m4

@@ -3,6 +3,65 @@ dnl   macros autoconf uses when building configure from configure.in
 dnl
 dnl
 dnl
 dnl
 
 
+AC_DEFUN([MY_ARG_WITH], [
+  AC_ARG_WITH(m4_translit([[$1]], [_], [-]),
+     [AS_HELP_STRING([--with-m4_translit([$1], [_], [-])],
+                     [use $1 (default is $2)])],
+     [with_[]$1=$withval],
+     [with_[]$1=$2])
+])
+
+AC_DEFUN([MY_ARG_WITH_PATH], [
+  AC_ARG_WITH(m4_translit([[$1]], [_], [-]),
+     [AS_HELP_STRING([--with-m4_translit([$1], [_], [-])=PATH],
+                     [$2])],
+     [with_[]$1_path=$withval],
+     [with_[]$1_path=$3])
+])
+
+AC_DEFUN([MY_ARG_ENABLE], [
+  AC_MSG_CHECKING([whether $2 is enabled])
+  AC_ARG_ENABLE(m4_translit([[$1]], [_], [-]),
+     [AS_HELP_STRING([--enable-m4_translit([$1], [_], [-])],
+                     [enable $2 support])],
+     [
+       enable_[]$1=$enableval
+       AC_MSG_RESULT([$enableval])
+       AC_DEFINE(m4_translit([[USE_$1]], [a-z], [A-Z]), 1, [Define if you want $2 support])
+     ],
+     [
+       # default if not given is DISABLED
+       if test "x$enableval" = "x"; then
+         enableval="no"
+       fi
+       enable_[]$1=$enableval
+       AC_MSG_RESULT([$enableval])
+     ]
+  )
+])
+
+AC_DEFUN([MY_ARG_DISABLE], [
+  AC_MSG_CHECKING([whether $2 is enabled])
+  AC_ARG_ENABLE(m4_translit([[$1]], [_], [-]),
+     [AS_HELP_STRING([--disable-m4_translit([$1], [_], [-])],
+                     [disable $2 support])],
+     [
+       enable_[]$1=$enableval
+       AC_MSG_RESULT([$enableval])
+     ],
+     [
+       # default if not given is ENABLED
+       if test "x$enableval" = "x"; then
+         enableval="yes"
+       fi
+       enable_[]$1=$enableval
+       AC_MSG_RESULT([$enableval])
+       AC_DEFINE(m4_translit([[USE_$1]], [a-z], [A-Z]), 1, [Define if you want $2 support])
+     ]
+  )
+])
+
+
 dnl  EGG_CHECK_CC()
 dnl  EGG_CHECK_CC()
 dnl
 dnl
 AC_DEFUN([EGG_CHECK_CC], 
 AC_DEFUN([EGG_CHECK_CC], 
@@ -13,7 +72,7 @@ then
 configure: error:
 configure: error:
 
 
   This system does not appear to have a working C compiler.
   This system does not appear to have a working C compiler.
-  A working C compiler is required to compile Eggdrop.
+  A working C compiler is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -29,21 +88,7 @@ dnl  EGG_IPV6_OPTIONS()
 dnl
 dnl
 AC_DEFUN([EGG_IPV6_OPTIONS], 
 AC_DEFUN([EGG_IPV6_OPTIONS], 
 [
 [
-AC_MSG_CHECKING(whether or not you disabled IPv6 support)
-AC_ARG_ENABLE(ipv6, [AS_HELP_STRING([--disable-ipv6], [disable IPv6 support])],
-[ ac_cv_dipv6="yes"
-  AC_MSG_RESULT(yes)
-],
-[ ac_cv_dipv6="no"
-  if test "$egg_cv_ipv6_supported" = "no"; then
-    ac_cv_dipv6="no"
-  fi
-  AC_MSG_RESULT($ac_cv_dipv6)
-])
-
-if test "$ac_cv_dipv6" = "no"; then
-  AC_DEFINE(USE_IPV6, 1, [Define if you want ipv6 support])
-fi
+MY_ARG_DISABLE(ipv6, [IPv6])
 ])
 ])
 
 
 
 
@@ -203,7 +248,7 @@ then
 configure: error:
 configure: error:
 
 
   This system seems to lack a working 'head -1' or 'head -n 1' command.
   This system seems to lack a working 'head -1' or 'head -n 1' command.
-  A working 'head -1' (or equivalent) command is required to compile Eggdrop.
+  A working 'head -1' (or equivalent) command is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -226,7 +271,7 @@ then
 configure: error:
 configure: error:
 
 
   This system seems to lack a working 'awk' command.
   This system seems to lack a working 'awk' command.
-  A working 'awk' command is required to compile Eggdrop.
+  A working 'awk' command is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -246,7 +291,7 @@ then
 configure: error:
 configure: error:
 
 
   This system seems to lack a working 'basename' command.
   This system seems to lack a working 'basename' command.
-  A working 'basename' command is required to compile Eggdrop.
+  A working 'basename' command is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -460,16 +505,12 @@ AC_DEFUN([CHECK_SSL],
 dnl Adapted from Ratbox configure.ac
 dnl Adapted from Ratbox configure.ac
 dnl OpenSSL support
 dnl OpenSSL support
 AC_MSG_CHECKING(for path to OpenSSL)
 AC_MSG_CHECKING(for path to OpenSSL)
-AC_ARG_WITH(openssl,
-[AS_HELP_STRING([--with-openssl=DIR],[Path to OpenSSL])],
-[cf_with_openssl=$withval],
-[cf_with_openssl="auto"]
-)
+MY_ARG_WITH_PATH(openssl, [Path to OpenSSL], [auto])
 
 
 cf_openssl_basedir=""
 cf_openssl_basedir=""
-if test "$cf_with_openssl" != "auto"; then
+if test "$with_openssl_path" != "auto"; then
   dnl Support for --with-openssl=/some/place
   dnl Support for --with-openssl=/some/place
-  cf_openssl_basedir="`echo ${cf_with_openssl} | sed 's/\/$//'`"
+  cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`"
 else
 else
   dnl Do the auto-probe here.  Check some common directory paths.
   dnl Do the auto-probe here.  Check some common directory paths.
   for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
   for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do

+ 204 - 177
autotools/includes/libtcl.m4

@@ -3,13 +3,15 @@ dnl   macros autoconf uses when building configure from configure.in
 dnl   These are taken from Eggdrop
 dnl   These are taken from Eggdrop
 dnl
 dnl
 
 
-dnl EGG_TCL_ARG_WITH()
+dnl EGG_TCL_OPTIONS()
 dnl
 dnl
-AC_DEFUN([EGG_TCL_ARG_WITH],
+AC_DEFUN([EGG_TCL_OPTIONS],
 [
 [
   AC_ARG_WITH(tcllib, [AS_HELP_STRING([--with-tcllib=PATH],[full path to Tcl library])], [tcllibname="$withval"])
   AC_ARG_WITH(tcllib, [AS_HELP_STRING([--with-tcllib=PATH],[full path to Tcl library])], [tcllibname="$withval"])
   AC_ARG_WITH(tclinc, [AS_HELP_STRING([--with-tclinc=PATH],[full path to Tcl header])],  [tclincname="$withval"])
   AC_ARG_WITH(tclinc, [AS_HELP_STRING([--with-tclinc=PATH],[full path to Tcl header])],  [tclincname="$withval"])
 
 
+  MY_ARG_DISABLE([script_tcl], [TCL Script])
+
   WARN=0
   WARN=0
   # Make sure either both or neither $tcllibname and $tclincname are set
   # Make sure either both or neither $tcllibname and $tclincname are set
   if test "x$tcllibname" != x; then
   if test "x$tcllibname" != x; then
@@ -213,31 +215,33 @@ dnl EGG_TCL_CHECK_LIBRARY()
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_LIBRARY],
 AC_DEFUN([EGG_TCL_CHECK_LIBRARY],
 [
 [
-  AC_MSG_CHECKING([for Tcl library])
+  if test "$enable_script_tcl" = "yes"; then
+    AC_MSG_CHECKING([for Tcl library])
 
 
-  # Attempt autodetect for $TCLLIBFN if it's not set
-  if test "x$TCLLIBFN" != x; then
-    AC_MSG_RESULT([using ${TCLLIB}/lib${TCLLIBFN}])
-  else
-    for tcllibfns in $tcllibnames; do
-      for tcllibext in $tcllibextensions; do
-        for tcllibpath in $tcllibpaths; do
-          if test -r "${tcllibpath}/lib${tcllibfns}${tcllibext}"; then
-            AC_MSG_RESULT([found ${tcllibpath}/lib${tcllibfns}${tcllibext}])
-            TCLLIB="$tcllibpath"
-            TCLLIBFN="${tcllibfns}${tcllibext}"
-            TCLLIBEXT="$tcllibext"
-            TCLLIBFNS="$tcllibfns"
-            break 3
-          fi
+    # Attempt autodetect for $TCLLIBFN if it's not set
+    if test "x$TCLLIBFN" != x; then
+      AC_MSG_RESULT([using ${TCLLIB}/lib${TCLLIBFN}])
+    else
+      for tcllibfns in $tcllibnames; do
+        for tcllibext in $tcllibextensions; do
+          for tcllibpath in $tcllibpaths; do
+            if test -r "${tcllibpath}/lib${tcllibfns}${tcllibext}"; then
+              AC_MSG_RESULT([found ${tcllibpath}/lib${tcllibfns}${tcllibext}])
+              TCLLIB="$tcllibpath"
+              TCLLIBFN="${tcllibfns}${tcllibext}"
+              TCLLIBEXT="$tcllibext"
+              TCLLIBFNS="$tcllibfns"
+              break 3
+            fi
+          done
         done
         done
       done
       done
-    done
-  fi
+    fi
 
 
-  # Show if $TCLLIBFN wasn't found
-  if test "x$TCLLIBFN" = x; then
-    AC_MSG_RESULT([not found])
+    # Show if $TCLLIBFN wasn't found
+    if test "x$TCLLIBFN" = x; then
+      AC_MSG_RESULT([not found])
+    fi
   fi
   fi
 
 
   AC_SUBST(TCLLIB)
   AC_SUBST(TCLLIB)
@@ -249,45 +253,52 @@ dnl EGG_TCL_CHECK_HEADER()
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_HEADER],
 AC_DEFUN([EGG_TCL_CHECK_HEADER],
 [
 [
-  AC_MSG_CHECKING([for Tcl header])
+  if test "$enable_script_tcl" = "yes"; then
+    AC_MSG_CHECKING([for Tcl header])
 
 
-  # Attempt autodetect for $TCLINCFN if it's not set
-  if test "x$TCLINCFN" != x; then
-    AC_MSG_RESULT([using ${TCLINC}/${TCLINCFN}])
-  else
-    for tclheaderpath in $tclheaderpaths; do
-      for tclheaderfn in $tclheadernames; do
-        if test -r "${tclheaderpath}/${tclheaderfn}"; then
-          AC_MSG_RESULT([found ${tclheaderpath}/${tclheaderfn}])
-          TCLINC="$tclheaderpath"
-          TCLINCFN="$tclheaderfn"
-          break 2
-        fi
+    # Attempt autodetect for $TCLINCFN if it's not set
+    if test "x$TCLINCFN" != x; then
+      AC_MSG_RESULT([using ${TCLINC}/${TCLINCFN}])
+    else
+      for tclheaderpath in $tclheaderpaths; do
+        for tclheaderfn in $tclheadernames; do
+          if test -r "${tclheaderpath}/${tclheaderfn}"; then
+            AC_MSG_RESULT([found ${tclheaderpath}/${tclheaderfn}])
+            TCLINC="$tclheaderpath"
+            TCLINCFN="$tclheaderfn"
+            break 2
+          fi
+        done
       done
       done
-    done
 
 
-    # FreeBSD hack ...
-    if test "x$TCLINCFN" = x; then
-      for tcllibfns in $tcllibnames; do
-        for tclheaderpath in $tclheaderpaths; do
-          for tclheaderfn in $tclheadernames; do
-            if test -r "${tclheaderpath}/${tcllibfns}/${tclheaderfn}"; then
-              AC_MSG_RESULT([found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}])
-              TCLINC="${tclheaderpath}/${tcllibfns}"
-              TCLINCFN="$tclheaderfn"
-              break 3
-            fi
+      # FreeBSD hack ...
+      if test "x$TCLINCFN" = x; then
+        for tcllibfns in $tcllibnames; do
+          for tclheaderpath in $tclheaderpaths; do
+            for tclheaderfn in $tclheadernames; do
+              if test -r "${tclheaderpath}/${tcllibfns}/${tclheaderfn}"; then
+                AC_MSG_RESULT([found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}])
+                TCLINC="${tclheaderpath}/${tcllibfns}"
+                TCLINCFN="$tclheaderfn"
+                break 3
+              fi
+            done
           done
           done
         done
         done
-      done
+      fi
+    fi
+
+    TCL_INCLUDES=""
+    if ! test "x$TCLINC" = x; then
+      TCL_INCLUDES="-I$TCLINC"
     fi
     fi
-  fi
 
 
-  if test "x$TCLINCFN" = x; then
-    AC_MSG_RESULT([not found])
+    if test "x$TCLINCFN" = x; then
+      AC_MSG_RESULT([not found])
+    fi
   fi
   fi
 
 
-  AC_SUBST(TCLINC)
+  AC_SUBST(TCL_INCLUDES)
   AC_SUBST(TCLINCFN)
   AC_SUBST(TCLINCFN)
 ])
 ])
 
 
@@ -310,30 +321,32 @@ dnl as egg_tcl_changed is set to "yes".
 dnl
 dnl
 AC_DEFUN([EGG_TCL_DETECT_CHANGE],
 AC_DEFUN([EGG_TCL_DETECT_CHANGE],
 [
 [
-  dnl NOTE: autoconf 2.50+ disables config.cache by default.
-  dnl       These checks don't do us much good if cache is disabled.
-  AC_MSG_CHECKING([whether the Tcl system has changed])
-  egg_tcl_changed="yes"
-  egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
-  if test "$egg_tcl_id" != ":::"; then
-    egg_tcl_cached="yes"
-    AC_CACHE_VAL(egg_cv_var_tcl_id, [
-      egg_cv_var_tcl_id="$egg_tcl_id"
-      egg_tcl_cached="no"
-    ])
-    if test "$egg_tcl_cached" = yes; then
-      if test "x$egg_cv_var_tcl_id" = "x$egg_tcl_id"; then
-        egg_tcl_changed="no"
-      else
+  if test "$enable_script_tcl" = "yes"; then
+    dnl NOTE: autoconf 2.50+ disables config.cache by default.
+    dnl       These checks don't do us much good if cache is disabled.
+    AC_MSG_CHECKING([whether the Tcl system has changed])
+    egg_tcl_changed="yes"
+    egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
+    if test "$egg_tcl_id" != ":::"; then
+      egg_tcl_cached="yes"
+      AC_CACHE_VAL(egg_cv_var_tcl_id, [
         egg_cv_var_tcl_id="$egg_tcl_id"
         egg_cv_var_tcl_id="$egg_tcl_id"
+        egg_tcl_cached="no"
+      ])
+      if test "$egg_tcl_cached" = yes; then
+        if test "x$egg_cv_var_tcl_id" = "x$egg_tcl_id"; then
+          egg_tcl_changed="no"
+        else
+          egg_cv_var_tcl_id="$egg_tcl_id"
+        fi
       fi
       fi
     fi
     fi
-  fi
 
 
-  if test "$egg_tcl_changed" = yes; then
-    AC_MSG_RESULT([yes])
-  else
-    AC_MSG_RESULT([no])
+    if test "$egg_tcl_changed" = yes; then
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
   fi
   fi
 ])
 ])
 
 
@@ -342,60 +355,62 @@ dnl EGG_TCL_CHECK_VERSION()
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_VERSION],
 AC_DEFUN([EGG_TCL_CHECK_VERSION],
 [
 [
-  # Both TCLLIBFN & TCLINCFN must be set, or we bail
-  TCL_FOUND=0
-  if test "x$TCLLIBFN" != x && test "x$TCLINCFN" != x; then
-    TCL_FOUND=1
-
-    # Check Tcl's version
-    if test "$egg_tcl_changed" = yes; then
-      EGG_CACHE_UNSET(egg_cv_var_tcl_version)
-    fi
+  if test "$enable_script_tcl" = "yes"; then
+    # Both TCLLIBFN & TCLINCFN must be set, or we bail
+    TCL_FOUND=0
+    if test "x$TCLLIBFN" != x && test "x$TCLINCFN" != x; then
+      TCL_FOUND=1
+
+      # Check Tcl's version
+      if test "$egg_tcl_changed" = yes; then
+        EGG_CACHE_UNSET(egg_cv_var_tcl_version)
+      fi
 
 
-    AC_MSG_CHECKING([for Tcl version])
-    AC_CACHE_VAL(egg_cv_var_tcl_version, [
-      egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
-    ])
+      AC_MSG_CHECKING([for Tcl version])
+      AC_CACHE_VAL(egg_cv_var_tcl_version, [
+        egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
+      ])
 
 
-    if test "x$egg_cv_var_tcl_version" != x; then
-      AC_MSG_RESULT([$egg_cv_var_tcl_version])
-    else
-      AC_MSG_RESULT([not found])
-      TCL_FOUND=0
-    fi
+      if test "x$egg_cv_var_tcl_version" != x; then
+        AC_MSG_RESULT([$egg_cv_var_tcl_version])
+      else
+        AC_MSG_RESULT([not found])
+        TCL_FOUND=0
+      fi
 
 
-    # Check Tcl's patch level (if available)
-    if test "$egg_tcl_changed" = yes; then
-      EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
-    fi
-    AC_MSG_CHECKING([for Tcl patch level])
-    AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [
-      eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
-    ])
+      # Check Tcl's patch level (if available)
+      if test "$egg_tcl_changed" = yes; then
+        EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
+      fi
+      AC_MSG_CHECKING([for Tcl patch level])
+      AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [
+        eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
+      ])
 
 
-    if test "x$egg_cv_var_tcl_patch_level" != x; then
-      AC_MSG_RESULT([$egg_cv_var_tcl_patch_level])
-    else
-      egg_cv_var_tcl_patch_level="unknown"
-      AC_MSG_RESULT([unknown])
+      if test "x$egg_cv_var_tcl_patch_level" != x; then
+        AC_MSG_RESULT([$egg_cv_var_tcl_patch_level])
+      else
+        egg_cv_var_tcl_patch_level="unknown"
+        AC_MSG_RESULT([unknown])
+      fi
     fi
     fi
-  fi
 
 
-  # Check if we found Tcl's version
-  if test "$TCL_FOUND" = 0; then
-    cat << 'EOF' >&2
+    # Check if we found Tcl's version
+    if test "$TCL_FOUND" = 0; then
+      cat << 'EOF' >&2
 configure: error:
 configure: error:
 
 
   Tcl cannot be found on this system.
   Tcl cannot be found on this system.
 
 
   Tcl is not required. Wraith will be compiled without TCL support. If you
   Tcl is not required. Wraith will be compiled without TCL support. If you
-  already have Tcl installed on this system, and I just wasn't looking in
-  the right place for it, re-run ./configure using the
-  --with-tcllib='/path/to/libtcl.so' and --with-tclinc='/path/to/tcl.h' options.
+  already have Tcl installed on this system, please specify the path by
+  rerunning ./configure using the --with-tcllib='/path/to/libtcl.so' and
+  --with-tclinc='/path/to/tcl.h' options.
 
 
 EOF
 EOF
-  else
-    AC_DEFINE(HAVE_LIBTCL, 1, [Define if you have support for libtcl])
+    else
+      AC_DEFINE(HAVE_LIBTCL, 1, [Define if you have support for libtcl])
+    fi
   fi
   fi
 ])
 ])
 
 
@@ -404,13 +419,14 @@ dnl EGG_TCL_CHECK_PRE70()
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_PRE70],
 AC_DEFUN([EGG_TCL_CHECK_PRE70],
 [
 [
-  # Is this version of Tcl too old for us to use ?
-  TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
-  if test "$HAVE_LIBTCL" = 1 -a "$TCL_VER_PRE70" = yes; then
-    cat << EOF >&2
+  if test "$enable_script_tcl" = "yes"; then
+    # Is this version of Tcl too old for us to use ?
+    TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
+    if test "$TCL_VER_PRE70" = yes; then
+      cat << EOF >&2
 configure: error:
 configure: error:
 
 
-  Your Tcl version is much too old for Eggdrop to use. You should
+  Your Tcl version is much too old for Wraith to use. You should
   download and compile a more recent version. The most reliable
   download and compile a more recent version. The most reliable
   current version is $tclrecommendver and can be downloaded from
   current version is $tclrecommendver and can be downloaded from
   ${tclrecommendsite}.
   ${tclrecommendsite}.
@@ -419,7 +435,8 @@ configure: error:
   for more information.
   for more information.
 
 
 EOF
 EOF
-    exit 1
+      exit 1
+    fi
   fi
   fi
 ])
 ])
 
 
@@ -441,15 +458,17 @@ dnl EGG_TCL_CHECK_FREE()
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_FREE],
 AC_DEFUN([EGG_TCL_CHECK_FREE],
 [
 [
-  if test "$egg_tcl_changed" = yes; then
-    EGG_CACHE_UNSET(egg_cv_var_tcl_free)
-  fi
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$egg_tcl_changed" = yes; then
+      EGG_CACHE_UNSET(egg_cv_var_tcl_free)
+    fi
 
 
-  # Check for Tcl_Free()
-  AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, [egg_cv_var_tcl_free="yes"], [egg_cv_var_tcl_free="no"], $TCL_TEST_OTHERLIBS)
+    # Check for Tcl_Free()
+    AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, [egg_cv_var_tcl_free="yes"], [egg_cv_var_tcl_free="no"], $TCL_TEST_OTHERLIBS)
 
 
-  if test "$egg_cv_var_tcl_free" = yes; then
-    AC_DEFINE(HAVE_TCL_FREE, 1, [Define for Tcl that has Tcl_Free() (7.5p1 and later).])
+    if test "$egg_cv_var_tcl_free" = yes; then
+      AC_DEFINE(HAVE_TCL_FREE, 1, [Define for Tcl that has Tcl_Free() (7.5p1 and later).])
+    fi
   fi
   fi
 ])
 ])
 
 
@@ -458,18 +477,20 @@ dnl EGG_TCL_CHECK_GETCURRENTTHREAD
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_GETCURRENTTHREAD],
 AC_DEFUN([EGG_TCL_CHECK_GETCURRENTTHREAD],
 [
 [
-  if test "$egg_tcl_changed" = yes; then
-    EGG_CACHE_UNSET(egg_cv_var_tcl_getcurrentthread)
-  fi
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$egg_tcl_changed" = yes; then
+      EGG_CACHE_UNSET(egg_cv_var_tcl_getcurrentthread)
+    fi
 
 
-  # Check for Tcl_GetCurrentThread()
-  AC_CHECK_LIB($TCL_TEST_LIB, Tcl_GetCurrentThread, [egg_cv_var_tcl_getcurrentthread="yes"], [egg_cv_var_tcl_getcurrentthread="no"], $TCL_TEST_OTHERLIBS)
-  if test "$egg_cv_var_tcl_getcurrentthread" = yes; then
-    AC_DEFINE(HAVE_TCL_GETCURRENTTHREAD, 1, [Define for Tcl that has Tcl_GetCurrentThread() (8.1a2 and later).])
+    # Check for Tcl_GetCurrentThread()
+    AC_CHECK_LIB($TCL_TEST_LIB, Tcl_GetCurrentThread, [egg_cv_var_tcl_getcurrentthread="yes"], [egg_cv_var_tcl_getcurrentthread="no"], $TCL_TEST_OTHERLIBS)
+    if test "$egg_cv_var_tcl_getcurrentthread" = yes; then
+      AC_DEFINE(HAVE_TCL_GETCURRENTTHREAD, 1, [Define for Tcl that has Tcl_GetCurrentThread() (8.1a2 and later).])
 
 
-    # Add pthread library to $LIBS if we need it for threaded Tcl
-    if test "x$ac_cv_lib_pthread" != x; then
-      EGG_APPEND_VAR(LIBS, $ac_cv_lib_pthread)
+      # Add pthread library to $LIBS if we need it for threaded Tcl
+      if test "x$ac_cv_lib_pthread" != x; then
+        EGG_APPEND_VAR(LIBS, $ac_cv_lib_pthread)
+      fi
     fi
     fi
   fi
   fi
 ])
 ])
@@ -479,14 +500,16 @@ dnl EGG_TCL_CHECK_GETTHREADDATA
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_GETTHREADDATA],
 AC_DEFUN([EGG_TCL_CHECK_GETTHREADDATA],
 [
 [
-  if test "$egg_tcl_changed" = yes; then
-    EGG_CACHE_UNSET(egg_cv_var_tcl_getthreaddata)
-  fi
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$egg_tcl_changed" = yes; then
+      EGG_CACHE_UNSET(egg_cv_var_tcl_getthreaddata)
+    fi
 
 
-  # Check for Tcl_GetThreadData()
-  AC_CHECK_LIB($TCL_TEST_LIB, Tcl_GetThreadData, [egg_cv_var_tcl_getthreaddata="yes"], [egg_cv_var_tcl_getthreaddata="no"], $TCL_TEST_OTHERLIBS)
-  if test "$egg_cv_var_tcl_getthreaddata" = yes; then
-    AC_DEFINE(HAVE_TCL_GETTHREADDATA, 1, [Define for Tcl that has Tcl_GetThreadData() (8.1a2 and later).])
+    # Check for Tcl_GetThreadData()
+    AC_CHECK_LIB($TCL_TEST_LIB, Tcl_GetThreadData, [egg_cv_var_tcl_getthreaddata="yes"], [egg_cv_var_tcl_getthreaddata="no"], $TCL_TEST_OTHERLIBS)
+    if test "$egg_cv_var_tcl_getthreaddata" = yes; then
+      AC_DEFINE(HAVE_TCL_GETTHREADDATA, 1, [Define for Tcl that has Tcl_GetThreadData() (8.1a2 and later).])
+    fi
   fi
   fi
 ])
 ])
 
 
@@ -495,14 +518,16 @@ dnl EGG_TCL_CHECK_SETNOTIFIER
 dnl
 dnl
 AC_DEFUN([EGG_TCL_CHECK_SETNOTIFIER],
 AC_DEFUN([EGG_TCL_CHECK_SETNOTIFIER],
 [
 [
-  if test "$egg_tcl_changed" = yes; then
-    EGG_CACHE_UNSET(egg_cv_var_tcl_setnotifier)
-  fi
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$egg_tcl_changed" = yes; then
+      EGG_CACHE_UNSET(egg_cv_var_tcl_setnotifier)
+    fi
 
 
-  # Check for Tcl_SetNotifier()
-  AC_CHECK_LIB($TCL_TEST_LIB, Tcl_SetNotifier, [egg_cv_var_tcl_setnotifier="yes"], [egg_cv_var_tcl_setnotifier="no"], $TCL_TEST_OTHERLIBS)
-  if test "$egg_cv_var_tcl_setnotifier" = yes; then
-    AC_DEFINE(HAVE_TCL_SETNOTIFIER, 1, [Define for Tcl that has Tcl_SetNotifier() (8.2b1 and later).])
+    # Check for Tcl_SetNotifier()
+    AC_CHECK_LIB($TCL_TEST_LIB, Tcl_SetNotifier, [egg_cv_var_tcl_setnotifier="yes"], [egg_cv_var_tcl_setnotifier="no"], $TCL_TEST_OTHERLIBS)
+    if test "$egg_cv_var_tcl_setnotifier" = yes; then
+      AC_DEFINE(HAVE_TCL_SETNOTIFIER, 1, [Define for Tcl that has Tcl_SetNotifier() (8.2b1 and later).])
+    fi
   fi
   fi
 ])
 ])
 
 
@@ -511,49 +536,51 @@ dnl EGG_TCL_LIB_REQS()
 dnl
 dnl
 AC_DEFUN([EGG_TCL_LIB_REQS],
 AC_DEFUN([EGG_TCL_LIB_REQS],
 [
 [
-  if test "$EGG_CYGWIN" = yes; then
-    TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
-    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
-  else
-    if test "$TCLLIBEXT" != ".a"; then
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$EGG_CYGWIN" = yes; then
       TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
       TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
       TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
       TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
     else
     else
-      # Set default make as static for unshared Tcl library
-      if test "$DEFAULT_MAKE" != static; then
-        cat << 'EOF' >&2
+      if test "$TCLLIBEXT" != ".a"; then
+        TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
+        TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
+      else
+        # Set default make as static for unshared Tcl library
+        if test "$DEFAULT_MAKE" != static; then
+          cat << 'EOF' >&2
 configure: WARNING:
 configure: WARNING:
 
 
   Your Tcl library is not a shared lib.
   Your Tcl library is not a shared lib.
   configure will now set default make type to static.
   configure will now set default make type to static.
 
 
 EOF
 EOF
-        DEFAULT_MAKE="static"
-        AC_SUBST(DEFAULT_MAKE)
-      fi
-
-      # Are we using a pre 7.4 Tcl version ?
-      TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
-      if test "$TCL_VER_PRE74" = no; then
+          DEFAULT_MAKE="static"
+          AC_SUBST(DEFAULT_MAKE)
+        fi
 
 
-        # Was the --with-tcllib option given ?
-        if test "x$tcllibname" != x; then
-          TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
-          TCL_LIBS="${TCLLIB}/lib${TCLLIBFN} $EGG_MATH_LIB"
+        # Are we using a pre 7.4 Tcl version ?
+        TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
+        if test "$TCL_VER_PRE74" = no; then
+
+          # Was the --with-tcllib option given ?
+          if test "x$tcllibname" != x; then
+            TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
+            TCL_LIBS="${TCLLIB}/lib${TCLLIBFN} $EGG_MATH_LIB"
+          else
+            TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
+            TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
+          fi
         else
         else
-          TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
-          TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
-        fi
-      else
-        cat << EOF >&2
+          cat << EOF >&2
 configure: WARNING:
 configure: WARNING:
 
 
   Your Tcl version ($egg_cv_var_tcl_version) is older than 7.4.
   Your Tcl version ($egg_cv_var_tcl_version) is older than 7.4.
   There are known problems, but we will attempt to work around them.
   There are known problems, but we will attempt to work around them.
 
 
 EOF
 EOF
-        TCL_REQS="libtcle.a"
-        TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
+          TCL_REQS="libtcle.a"
+          TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
+        fi
       fi
       fi
     fi
     fi
   fi
   fi

+ 11 - 1
config.h.in

@@ -310,9 +310,12 @@
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
 #undef TM_IN_SYS_TIME
 #undef TM_IN_SYS_TIME
 
 
-/* Define if you want ipv6 support */
+/* Define if you want IPv6 support */
 #undef USE_IPV6
 #undef USE_IPV6
 
 
+/* Define if you want TCL Script support */
+#undef USE_SCRIPT_TCL
+
 /* Enable extensions on AIX 3, Interix.  */
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 # undef _ALL_SOURCE
@@ -468,3 +471,10 @@
 #  endif
 #  endif
 #endif
 #endif
 
 
+/* TCL sanity check */
+#ifdef USE_SCRIPT_TCL
+#  ifndef HAVE_LIBTCL
+#    undef USE_SCRIPT_TCL
+#  endif
+#endif
+

+ 233 - 178
configure

@@ -614,7 +614,7 @@ TCL_LIBS
 TCL_REQS
 TCL_REQS
 DEFAULT_MAKE
 DEFAULT_MAKE
 TCLINCFN
 TCLINCFN
-TCLINC
+TCL_INCLUDES
 TCLLIBFN
 TCLLIBFN
 TCLLIB
 TCLLIB
 SSL_LIBS
 SSL_LIBS
@@ -695,6 +695,7 @@ enable_ipv6
 with_openssl
 with_openssl
 with_tcllib
 with_tcllib
 with_tclinc
 with_tclinc
+enable_script_tcl
 '
 '
       ac_precious_vars='build_alias
       ac_precious_vars='build_alias
 host_alias
 host_alias
@@ -1316,11 +1317,12 @@ Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-ipv6          disable IPv6 support
   --disable-ipv6          disable IPv6 support
+  --disable-script-tcl    disable TCL Script support
 
 
 Optional Packages:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-openssl=DIR      Path to OpenSSL
+  --with-openssl=PATH     Path to OpenSSL
   --with-tcllib=PATH      full path to Tcl library
   --with-tcllib=PATH      full path to Tcl library
   --with-tclinc=PATH      full path to Tcl header
   --with-tclinc=PATH      full path to Tcl header
 
 
@@ -2961,7 +2963,7 @@ then
 configure: error:
 configure: error:
 
 
   This system does not appear to have a working C compiler.
   This system does not appear to have a working C compiler.
-  A working C compiler is required to compile Eggdrop.
+  A working C compiler is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -3897,7 +3899,7 @@ then
 configure: error:
 configure: error:
 
 
   This system seems to lack a working 'head -1' or 'head -n 1' command.
   This system seems to lack a working 'head -1' or 'head -n 1' command.
-  A working 'head -1' (or equivalent) command is required to compile Eggdrop.
+  A working 'head -1' (or equivalent) command is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -3956,7 +3958,7 @@ then
 configure: error:
 configure: error:
 
 
   This system seems to lack a working 'awk' command.
   This system seems to lack a working 'awk' command.
-  A working 'awk' command is required to compile Eggdrop.
+  A working 'awk' command is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -4007,7 +4009,7 @@ then
 configure: error:
 configure: error:
 
 
   This system seems to lack a working 'basename' command.
   This system seems to lack a working 'basename' command.
-  A working 'basename' command is required to compile Eggdrop.
+  A working 'basename' command is required to compile Wraith.
 
 
 EOF
 EOF
   exit 1
   exit 1
@@ -4376,32 +4378,35 @@ esac
 # Check for IPv6 support
 # Check for IPv6 support
 #EGG_IPV6_SUPPORTED
 #EGG_IPV6_SUPPORTED
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not you disabled IPv6 support" >&5
-$as_echo_n "checking whether or not you disabled IPv6 support... " >&6; }
-# Check whether --enable-ipv6 was given.
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether IPv6 is enabled" >&5
+$as_echo_n "checking whether IPv6 is enabled... " >&6; }
+  # Check whether --enable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then :
 if test "${enable_ipv6+set}" = set; then :
-  enableval=$enable_ipv6;  ac_cv_dipv6="yes"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  enableval=$enable_ipv6;
+       enable_ipv6=$enableval
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
 
 
 else
 else
-   ac_cv_dipv6="no"
-  if test "$egg_cv_ipv6_supported" = "no"; then
-    ac_cv_dipv6="no"
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dipv6" >&5
-$as_echo "$ac_cv_dipv6" >&6; }
 
 
-fi
+       # default if not given is ENABLED
+       if test "x$enableval" = "x"; then
+         enableval="yes"
+       fi
+       enable_ipv6=$enableval
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
 
 
+$as_echo "#define USE_IPV6 1" >>confdefs.h
 
 
-if test "$ac_cv_dipv6" = "no"; then
 
 
-$as_echo "#define USE_IPV6 1" >>confdefs.h
 
 
 fi
 fi
 
 
 
 
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
 $as_echo_n "checking for socklen_t... " >&6; }
 $as_echo_n "checking for socklen_t... " >&6; }
 if ${egg_cv_socklen_t+:} false; then :
 if ${egg_cv_socklen_t+:} false; then :
@@ -5329,18 +5334,19 @@ rm -f confcache
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for path to OpenSSL" >&5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for path to OpenSSL" >&5
 $as_echo_n "checking for path to OpenSSL... " >&6; }
 $as_echo_n "checking for path to OpenSSL... " >&6; }
 
 
+
 # Check whether --with-openssl was given.
 # Check whether --with-openssl was given.
 if test "${with_openssl+set}" = set; then :
 if test "${with_openssl+set}" = set; then :
-  withval=$with_openssl; cf_with_openssl=$withval
+  withval=$with_openssl; with_openssl_path=$withval
 else
 else
-  cf_with_openssl="auto"
-
+  with_openssl_path=auto
 fi
 fi
 
 
 
 
+
 cf_openssl_basedir=""
 cf_openssl_basedir=""
-if test "$cf_with_openssl" != "auto"; then
-    cf_openssl_basedir="`echo ${cf_with_openssl} | sed 's/\/$//'`"
+if test "$with_openssl_path" != "auto"; then
+    cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`"
 else
 else
     for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
     for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
     if test -f "${dirs}/include/openssl/opensslv.h" ; then
     if test -f "${dirs}/include/openssl/opensslv.h" ; then
@@ -5526,6 +5532,34 @@ if test "${with_tclinc+set}" = set; then :
 fi
 fi
 
 
 
 
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TCL Script is enabled" >&5
+$as_echo_n "checking whether TCL Script is enabled... " >&6; }
+  # Check whether --enable-script-tcl was given.
+if test "${enable_script_tcl+set}" = set; then :
+  enableval=$enable_script_tcl;
+       enable_script_tcl=$enableval
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+
+else
+
+       # default if not given is ENABLED
+       if test "x$enableval" = "x"; then
+         enableval="yes"
+       fi
+       enable_script_tcl=$enableval
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+
+$as_echo "#define USE_SCRIPT_TCL 1" >>confdefs.h
+
+
+
+fi
+
+
+
   WARN=0
   WARN=0
   # Make sure either both or neither $tcllibname and $tclincname are set
   # Make sure either both or neither $tcllibname and $tclincname are set
   if test "x$tcllibname" != x; then
   if test "x$tcllibname" != x; then
@@ -5699,203 +5733,217 @@ EOF
   fi
   fi
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl library" >&5
+  if test "$enable_script_tcl" = "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl library" >&5
 $as_echo_n "checking for Tcl library... " >&6; }
 $as_echo_n "checking for Tcl library... " >&6; }
 
 
-  # Attempt autodetect for $TCLLIBFN if it's not set
-  if test "x$TCLLIBFN" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: using ${TCLLIB}/lib${TCLLIBFN}" >&5
+    # Attempt autodetect for $TCLLIBFN if it's not set
+    if test "x$TCLLIBFN" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using ${TCLLIB}/lib${TCLLIBFN}" >&5
 $as_echo "using ${TCLLIB}/lib${TCLLIBFN}" >&6; }
 $as_echo "using ${TCLLIB}/lib${TCLLIBFN}" >&6; }
-  else
-    for tcllibfns in $tcllibnames; do
-      for tcllibext in $tcllibextensions; do
-        for tcllibpath in $tcllibpaths; do
-          if test -r "${tcllibpath}/lib${tcllibfns}${tcllibext}"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${tcllibpath}/lib${tcllibfns}${tcllibext}" >&5
+    else
+      for tcllibfns in $tcllibnames; do
+        for tcllibext in $tcllibextensions; do
+          for tcllibpath in $tcllibpaths; do
+            if test -r "${tcllibpath}/lib${tcllibfns}${tcllibext}"; then
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${tcllibpath}/lib${tcllibfns}${tcllibext}" >&5
 $as_echo "found ${tcllibpath}/lib${tcllibfns}${tcllibext}" >&6; }
 $as_echo "found ${tcllibpath}/lib${tcllibfns}${tcllibext}" >&6; }
-            TCLLIB="$tcllibpath"
-            TCLLIBFN="${tcllibfns}${tcllibext}"
-            TCLLIBEXT="$tcllibext"
-            TCLLIBFNS="$tcllibfns"
-            break 3
-          fi
+              TCLLIB="$tcllibpath"
+              TCLLIBFN="${tcllibfns}${tcllibext}"
+              TCLLIBEXT="$tcllibext"
+              TCLLIBFNS="$tcllibfns"
+              break 3
+            fi
+          done
         done
         done
       done
       done
-    done
-  fi
+    fi
 
 
-  # Show if $TCLLIBFN wasn't found
-  if test "x$TCLLIBFN" = x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+    # Show if $TCLLIBFN wasn't found
+    if test "x$TCLLIBFN" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
 $as_echo "not found" >&6; }
 $as_echo "not found" >&6; }
+    fi
   fi
   fi
 
 
 
 
 
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl header" >&5
+  if test "$enable_script_tcl" = "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl header" >&5
 $as_echo_n "checking for Tcl header... " >&6; }
 $as_echo_n "checking for Tcl header... " >&6; }
 
 
-  # Attempt autodetect for $TCLINCFN if it's not set
-  if test "x$TCLINCFN" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: using ${TCLINC}/${TCLINCFN}" >&5
+    # Attempt autodetect for $TCLINCFN if it's not set
+    if test "x$TCLINCFN" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using ${TCLINC}/${TCLINCFN}" >&5
 $as_echo "using ${TCLINC}/${TCLINCFN}" >&6; }
 $as_echo "using ${TCLINC}/${TCLINCFN}" >&6; }
-  else
-    for tclheaderpath in $tclheaderpaths; do
-      for tclheaderfn in $tclheadernames; do
-        if test -r "${tclheaderpath}/${tclheaderfn}"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${tclheaderpath}/${tclheaderfn}" >&5
+    else
+      for tclheaderpath in $tclheaderpaths; do
+        for tclheaderfn in $tclheadernames; do
+          if test -r "${tclheaderpath}/${tclheaderfn}"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${tclheaderpath}/${tclheaderfn}" >&5
 $as_echo "found ${tclheaderpath}/${tclheaderfn}" >&6; }
 $as_echo "found ${tclheaderpath}/${tclheaderfn}" >&6; }
-          TCLINC="$tclheaderpath"
-          TCLINCFN="$tclheaderfn"
-          break 2
-        fi
+            TCLINC="$tclheaderpath"
+            TCLINCFN="$tclheaderfn"
+            break 2
+          fi
+        done
       done
       done
-    done
 
 
-    # FreeBSD hack ...
-    if test "x$TCLINCFN" = x; then
-      for tcllibfns in $tcllibnames; do
-        for tclheaderpath in $tclheaderpaths; do
-          for tclheaderfn in $tclheadernames; do
-            if test -r "${tclheaderpath}/${tcllibfns}/${tclheaderfn}"; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}" >&5
+      # FreeBSD hack ...
+      if test "x$TCLINCFN" = x; then
+        for tcllibfns in $tcllibnames; do
+          for tclheaderpath in $tclheaderpaths; do
+            for tclheaderfn in $tclheadernames; do
+              if test -r "${tclheaderpath}/${tcllibfns}/${tclheaderfn}"; then
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}" >&5
 $as_echo "found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}" >&6; }
 $as_echo "found ${tclheaderpath}/${tcllibfns}/${tclheaderfn}" >&6; }
-              TCLINC="${tclheaderpath}/${tcllibfns}"
-              TCLINCFN="$tclheaderfn"
-              break 3
-            fi
+                TCLINC="${tclheaderpath}/${tcllibfns}"
+                TCLINCFN="$tclheaderfn"
+                break 3
+              fi
+            done
           done
           done
         done
         done
-      done
+      fi
     fi
     fi
-  fi
 
 
-  if test "x$TCLINCFN" = x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+    TCL_INCLUDES=""
+    if ! test "x$TCLINC" = x; then
+      TCL_INCLUDES="-I$TCLINC"
+    fi
+
+    if test "x$TCLINCFN" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
 $as_echo "not found" >&6; }
 $as_echo "not found" >&6; }
+    fi
   fi
   fi
 
 
 
 
 
 
 
 
 
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Tcl system has changed" >&5
+  if test "$enable_script_tcl" = "yes"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Tcl system has changed" >&5
 $as_echo_n "checking whether the Tcl system has changed... " >&6; }
 $as_echo_n "checking whether the Tcl system has changed... " >&6; }
-  egg_tcl_changed="yes"
-  egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
-  if test "$egg_tcl_id" != ":::"; then
-    egg_tcl_cached="yes"
-    if ${egg_cv_var_tcl_id+:} false; then :
+    egg_tcl_changed="yes"
+    egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
+    if test "$egg_tcl_id" != ":::"; then
+      egg_tcl_cached="yes"
+      if ${egg_cv_var_tcl_id+:} false; then :
   $as_echo_n "(cached) " >&6
   $as_echo_n "(cached) " >&6
 else
 else
 
 
-      egg_cv_var_tcl_id="$egg_tcl_id"
-      egg_tcl_cached="no"
+        egg_cv_var_tcl_id="$egg_tcl_id"
+        egg_tcl_cached="no"
 
 
 fi
 fi
 
 
-    if test "$egg_tcl_cached" = yes; then
-      if test "x$egg_cv_var_tcl_id" = "x$egg_tcl_id"; then
-        egg_tcl_changed="no"
-      else
-        egg_cv_var_tcl_id="$egg_tcl_id"
+      if test "$egg_tcl_cached" = yes; then
+        if test "x$egg_cv_var_tcl_id" = "x$egg_tcl_id"; then
+          egg_tcl_changed="no"
+        else
+          egg_cv_var_tcl_id="$egg_tcl_id"
+        fi
       fi
       fi
     fi
     fi
-  fi
 
 
-  if test "$egg_tcl_changed" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+    if test "$egg_tcl_changed" = yes; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 $as_echo "yes" >&6; }
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 $as_echo "no" >&6; }
+    fi
   fi
   fi
 
 
 
 
-  # Both TCLLIBFN & TCLINCFN must be set, or we bail
-  TCL_FOUND=0
-  if test "x$TCLLIBFN" != x && test "x$TCLINCFN" != x; then
-    TCL_FOUND=1
+  if test "$enable_script_tcl" = "yes"; then
+    # Both TCLLIBFN & TCLINCFN must be set, or we bail
+    TCL_FOUND=0
+    if test "x$TCLLIBFN" != x && test "x$TCLINCFN" != x; then
+      TCL_FOUND=1
 
 
-    # Check Tcl's version
-    if test "$egg_tcl_changed" = yes; then
-      unset egg_cv_var_tcl_version
-    fi
+      # Check Tcl's version
+      if test "$egg_tcl_changed" = yes; then
+        unset egg_cv_var_tcl_version
+      fi
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl version" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl version" >&5
 $as_echo_n "checking for Tcl version... " >&6; }
 $as_echo_n "checking for Tcl version... " >&6; }
-    if ${egg_cv_var_tcl_version+:} false; then :
+      if ${egg_cv_var_tcl_version+:} false; then :
   $as_echo_n "(cached) " >&6
   $as_echo_n "(cached) " >&6
 else
 else
 
 
-      egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", $3); print $3}'`
+        egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", $3); print $3}'`
 
 
 fi
 fi
 
 
 
 
-    if test "x$egg_cv_var_tcl_version" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_var_tcl_version" >&5
+      if test "x$egg_cv_var_tcl_version" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_var_tcl_version" >&5
 $as_echo "$egg_cv_var_tcl_version" >&6; }
 $as_echo "$egg_cv_var_tcl_version" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
 $as_echo "not found" >&6; }
 $as_echo "not found" >&6; }
-      TCL_FOUND=0
-    fi
+        TCL_FOUND=0
+      fi
 
 
-    # Check Tcl's patch level (if available)
-    if test "$egg_tcl_changed" = yes; then
-      unset egg_cv_var_tcl_patch_level
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl patch level" >&5
+      # Check Tcl's patch level (if available)
+      if test "$egg_tcl_changed" = yes; then
+        unset egg_cv_var_tcl_patch_level
+      fi
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl patch level" >&5
 $as_echo_n "checking for Tcl patch level... " >&6; }
 $as_echo_n "checking for Tcl patch level... " >&6; }
-    if ${egg_cv_var_tcl_patch_level+:} false; then :
+      if ${egg_cv_var_tcl_patch_level+:} false; then :
   $as_echo_n "(cached) " >&6
   $as_echo_n "(cached) " >&6
 else
 else
 
 
-      eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", $3); print $3}'`"
+        eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", $3); print $3}'`"
 
 
 fi
 fi
 
 
 
 
-    if test "x$egg_cv_var_tcl_patch_level" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_var_tcl_patch_level" >&5
+      if test "x$egg_cv_var_tcl_patch_level" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_var_tcl_patch_level" >&5
 $as_echo "$egg_cv_var_tcl_patch_level" >&6; }
 $as_echo "$egg_cv_var_tcl_patch_level" >&6; }
-    else
-      egg_cv_var_tcl_patch_level="unknown"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+      else
+        egg_cv_var_tcl_patch_level="unknown"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
 $as_echo "unknown" >&6; }
 $as_echo "unknown" >&6; }
+      fi
     fi
     fi
-  fi
 
 
-  # Check if we found Tcl's version
-  if test "$TCL_FOUND" = 0; then
-    cat << 'EOF' >&2
+    # Check if we found Tcl's version
+    if test "$TCL_FOUND" = 0; then
+      cat << 'EOF' >&2
 configure: error:
 configure: error:
 
 
   Tcl cannot be found on this system.
   Tcl cannot be found on this system.
 
 
   Tcl is not required. Wraith will be compiled without TCL support. If you
   Tcl is not required. Wraith will be compiled without TCL support. If you
-  already have Tcl installed on this system, and I just wasn't looking in
-  the right place for it, re-run ./configure using the
-  --with-tcllib='/path/to/libtcl.so' and --with-tclinc='/path/to/tcl.h' options.
+  already have Tcl installed on this system, please specify the path by
+  rerunning ./configure using the --with-tcllib='/path/to/libtcl.so' and
+  --with-tclinc='/path/to/tcl.h' options.
 
 
 EOF
 EOF
-  else
+    else
 
 
 $as_echo "#define HAVE_LIBTCL 1" >>confdefs.h
 $as_echo "#define HAVE_LIBTCL 1" >>confdefs.h
 
 
+    fi
   fi
   fi
 
 
 
 
-  # Is this version of Tcl too old for us to use ?
-  TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split($1, i, "."); if (i[1] < 7) print "yes"; else print "no"}'`
-  if test "$HAVE_LIBTCL" = 1 -a "$TCL_VER_PRE70" = yes; then
-    cat << EOF >&2
+  if test "$enable_script_tcl" = "yes"; then
+    # Is this version of Tcl too old for us to use ?
+    TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split($1, i, "."); if (i[1] < 7) print "yes"; else print "no"}'`
+    if test "$TCL_VER_PRE70" = yes; then
+      cat << EOF >&2
 configure: error:
 configure: error:
 
 
-  Your Tcl version is much too old for Eggdrop to use. You should
+  Your Tcl version is much too old for Wraith to use. You should
   download and compile a more recent version. The most reliable
   download and compile a more recent version. The most reliable
   current version is $tclrecommendver and can be downloaded from
   current version is $tclrecommendver and can be downloaded from
   ${tclrecommendsite}.
   ${tclrecommendsite}.
@@ -5904,7 +5952,8 @@ configure: error:
   for more information.
   for more information.
 
 
 EOF
 EOF
-    exit 1
+      exit 1
+    fi
   fi
   fi
 
 
 
 
@@ -5916,12 +5965,13 @@ EOF
   fi
   fi
 
 
 
 
-  if test "$egg_tcl_changed" = yes; then
-    unset egg_cv_var_tcl_free
-  fi
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$egg_tcl_changed" = yes; then
+      unset egg_cv_var_tcl_free
+    fi
 
 
-  # Check for Tcl_Free()
-  as_ac_Lib=`$as_echo "ac_cv_lib_$TCL_TEST_LIB''_Tcl_Free" | $as_tr_sh`
+    # Check for Tcl_Free()
+    as_ac_Lib=`$as_echo "ac_cv_lib_$TCL_TEST_LIB''_Tcl_Free" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_Free in -l$TCL_TEST_LIB" >&5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_Free in -l$TCL_TEST_LIB" >&5
 $as_echo_n "checking for Tcl_Free in -l$TCL_TEST_LIB... " >&6; }
 $as_echo_n "checking for Tcl_Free in -l$TCL_TEST_LIB... " >&6; }
 if eval \${$as_ac_Lib+:} false; then :
 if eval \${$as_ac_Lib+:} false; then :
@@ -5966,21 +6016,23 @@ else
 fi
 fi
 
 
 
 
-  if test "$egg_cv_var_tcl_free" = yes; then
+    if test "$egg_cv_var_tcl_free" = yes; then
 
 
 $as_echo "#define HAVE_TCL_FREE 1" >>confdefs.h
 $as_echo "#define HAVE_TCL_FREE 1" >>confdefs.h
 
 
+    fi
   fi
   fi
 
 
 #EGG_TCL_CHECK_GETCURRENTTHREAD
 #EGG_TCL_CHECK_GETCURRENTTHREAD
 #EGG_TCL_CHECK_GETTHREADDATA
 #EGG_TCL_CHECK_GETTHREADDATA
 
 
-  if test "$egg_tcl_changed" = yes; then
-    unset egg_cv_var_tcl_setnotifier
-  fi
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$egg_tcl_changed" = yes; then
+      unset egg_cv_var_tcl_setnotifier
+    fi
 
 
-  # Check for Tcl_SetNotifier()
-  as_ac_Lib=`$as_echo "ac_cv_lib_$TCL_TEST_LIB''_Tcl_SetNotifier" | $as_tr_sh`
+    # Check for Tcl_SetNotifier()
+    as_ac_Lib=`$as_echo "ac_cv_lib_$TCL_TEST_LIB''_Tcl_SetNotifier" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_SetNotifier in -l$TCL_TEST_LIB" >&5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_SetNotifier in -l$TCL_TEST_LIB" >&5
 $as_echo_n "checking for Tcl_SetNotifier in -l$TCL_TEST_LIB... " >&6; }
 $as_echo_n "checking for Tcl_SetNotifier in -l$TCL_TEST_LIB... " >&6; }
 if eval \${$as_ac_Lib+:} false; then :
 if eval \${$as_ac_Lib+:} false; then :
@@ -6024,56 +6076,59 @@ else
   egg_cv_var_tcl_setnotifier="no"
   egg_cv_var_tcl_setnotifier="no"
 fi
 fi
 
 
-  if test "$egg_cv_var_tcl_setnotifier" = yes; then
+    if test "$egg_cv_var_tcl_setnotifier" = yes; then
 
 
 $as_echo "#define HAVE_TCL_SETNOTIFIER 1" >>confdefs.h
 $as_echo "#define HAVE_TCL_SETNOTIFIER 1" >>confdefs.h
 
 
+    fi
   fi
   fi
 
 
 
 
-  if test "$EGG_CYGWIN" = yes; then
-    TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
-    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
-  else
-    if test "$TCLLIBEXT" != ".a"; then
+  if test "$enable_script_tcl" = "yes"; then
+    if test "$EGG_CYGWIN" = yes; then
       TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
       TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
       TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
       TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
     else
     else
-      # Set default make as static for unshared Tcl library
-      if test "$DEFAULT_MAKE" != static; then
-        cat << 'EOF' >&2
+      if test "$TCLLIBEXT" != ".a"; then
+        TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
+        TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
+      else
+        # Set default make as static for unshared Tcl library
+        if test "$DEFAULT_MAKE" != static; then
+          cat << 'EOF' >&2
 configure: WARNING:
 configure: WARNING:
 
 
   Your Tcl library is not a shared lib.
   Your Tcl library is not a shared lib.
   configure will now set default make type to static.
   configure will now set default make type to static.
 
 
 EOF
 EOF
-        DEFAULT_MAKE="static"
-
-      fi
+          DEFAULT_MAKE="static"
 
 
-      # Are we using a pre 7.4 Tcl version ?
-      TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split($1, i, "."); if (((i[1] == 7) && (i[2] < 4)) || (i[1] < 7)) print "yes"; else print "no"}'`
-      if test "$TCL_VER_PRE74" = no; then
+        fi
 
 
-        # Was the --with-tcllib option given ?
-        if test "x$tcllibname" != x; then
-          TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
-          TCL_LIBS="${TCLLIB}/lib${TCLLIBFN} $EGG_MATH_LIB"
+        # Are we using a pre 7.4 Tcl version ?
+        TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split($1, i, "."); if (((i[1] == 7) && (i[2] < 4)) || (i[1] < 7)) print "yes"; else print "no"}'`
+        if test "$TCL_VER_PRE74" = no; then
+
+          # Was the --with-tcllib option given ?
+          if test "x$tcllibname" != x; then
+            TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
+            TCL_LIBS="${TCLLIB}/lib${TCLLIBFN} $EGG_MATH_LIB"
+          else
+            TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
+            TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
+          fi
         else
         else
-          TCL_REQS="${TCLLIB}/lib${TCLLIBFN}"
-          TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
-        fi
-      else
-        cat << EOF >&2
+          cat << EOF >&2
 configure: WARNING:
 configure: WARNING:
 
 
   Your Tcl version ($egg_cv_var_tcl_version) is older than 7.4.
   Your Tcl version ($egg_cv_var_tcl_version) is older than 7.4.
   There are known problems, but we will attempt to work around them.
   There are known problems, but we will attempt to work around them.
 
 
 EOF
 EOF
-        TCL_REQS="libtcle.a"
-        TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
+          TCL_REQS="libtcle.a"
+          TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
+        fi
       fi
       fi
     fi
     fi
   fi
   fi
@@ -9874,9 +9929,6 @@ if [ "$GIT_REQUIRED" = "1" ]; then
 fi
 fi
 
 
 
 
-echo ""
-echo ""
-echo "------------ Configuring BDLIB ------------"
 
 
 if test -d .git; then
 if test -d .git; then
   git submodule init
   git submodule init
@@ -9884,11 +9936,14 @@ if test -d .git; then
 fi
 fi
 
 
 
 
-CXX="$CXX" TCLINC="$TCLINC" SSL_INCLUDES="$SSL_INCLUDES" SED="$SED" src/generate_defs.sh
+CXX="$CXX" TCL_INCLUDES="$TCL_INCLUDES" SSL_INCLUDES="$SSL_INCLUDES" SED="$SED" src/generate_defs.sh
 
 
 if [ $? -ne 0 ]; then
 if [ $? -ne 0 ]; then
   exit 1
   exit 1
 fi
 fi
 
 
 
 
+echo ""
+echo ""
+echo "------------ Configuring BDLIB ------------"
 test -f lib/bdlib/configure && cd lib/bdlib && MAKEJOBS="$MAKEJOBS" ./configure
 test -f lib/bdlib/configure && cd lib/bdlib && MAKEJOBS="$MAKEJOBS" ./configure

+ 2 - 2
src/cmds.c

@@ -4658,7 +4658,7 @@ void cmd_test(int idx, char *par)
   putlog(LOG_CMDS, "*", "#%s# test", dcc[idx].nick);
   putlog(LOG_CMDS, "*", "#%s# test", dcc[idx].nick);
 }
 }
 
 
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
 void cmd_tcl(int idx, char *par)
 void cmd_tcl(int idx, char *par)
 {
 {
   if (!isowner(dcc[idx].nick)) {
   if (!isowner(dcc[idx].nick)) {
@@ -4800,7 +4800,7 @@ cmd_t C_dcc[] =
   {"w", 		"n", 	(Function) cmd_w, 		NULL, 0},
   {"w", 		"n", 	(Function) cmd_w, 		NULL, 0},
   {"channels", 		"", 	(Function) cmd_channels, 	NULL, 0},
   {"channels", 		"", 	(Function) cmd_channels, 	NULL, 0},
   {"test",		"",	(Function) cmd_test,		NULL, 0},
   {"test",		"",	(Function) cmd_test,		NULL, 0},
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
   {"tcl",		"a",	(Function) cmd_tcl,		NULL, AUTH_ALL},
   {"tcl",		"a",	(Function) cmd_tcl,		NULL, AUTH_ALL},
 #endif
 #endif
   {"botlink",		"a",	(Function) cmd_botlink,		NULL, 0},
   {"botlink",		"a",	(Function) cmd_botlink,		NULL, 0},

+ 13 - 11
src/generate_defs.sh

@@ -1,11 +1,14 @@
 #! /bin/sh
 #! /bin/sh
 
 
+### Export LC_ALL=C sort(1) stays consistent
+export LC_ALL=C
+
 if [ -z "$SED" -o -z "$CXX" ]; then
 if [ -z "$SED" -o -z "$CXX" ]; then
   echo "This must be ran by configure" >&2
   echo "This must be ran by configure" >&2
   exit 1
   exit 1
 fi
 fi
 echo "Generating lib symbols"
 echo "Generating lib symbols"
-INCLUDES="-I${TCLINC} ${SSL_INCLUDES}"
+INCLUDES="${TCL_INCLUDES} ${SSL_INCLUDES}"
 
 
 mkdir -p src/.defs > /dev/null 2>&1
 mkdir -p src/.defs > /dev/null 2>&1
 TMPFILE=$(mktemp "/tmp/pre.XXXXXX")
 TMPFILE=$(mktemp "/tmp/pre.XXXXXX")
@@ -25,9 +28,9 @@ for file in $(grep -l DLSYM_GLOBAL src/*.c|grep -v "src/_"); do
 
 
   echo "extern \"C\" {" > $defsFile_wrappers
   echo "extern \"C\" {" > $defsFile_wrappers
   echo "extern \"C\" {" > $defsFile_post
   echo "extern \"C\" {" > $defsFile_post
-  touch $defsFile_pre
+
   cd src >/dev/null 2>&1
   cd src >/dev/null 2>&1
-  $CXX -E -I. -I.. -I../lib ${INCLUDES} -DHAVE_CONFIG_H ../${file} > $TMPFILE
+  $CXX -E -I. -I.. -I../lib ${INCLUDES} -DHAVE_CONFIG_H ../${file} > $TMPFILE 2> /dev/null
   # Fix wrapped prototypes
   # Fix wrapped prototypes
   $SED -e :a -e N -e '$!ba' -e 's/,\n/,/g' $TMPFILE > $TMPFILE.sed
   $SED -e :a -e N -e '$!ba' -e 's/,\n/,/g' $TMPFILE > $TMPFILE.sed
   mv $TMPFILE.sed $TMPFILE
   mv $TMPFILE.sed $TMPFILE
@@ -35,27 +38,26 @@ for file in $(grep -l DLSYM_GLOBAL src/*.c|grep -v "src/_"); do
   cd .. >/dev/null 2>&1
   cd .. >/dev/null 2>&1
 
 
   for symbol in $($SED -n -e 's/.*DLSYM_GLOBAL(.*, \([^)]*\).*/\1/p' $file|sort -u); do
   for symbol in $($SED -n -e 's/.*DLSYM_GLOBAL(.*, \([^)]*\).*/\1/p' $file|sort -u); do
-    echo "#define ${symbol} ORIGINAL_SYMBOL_${symbol}" >> $defsFile_pre
-    echo "#undef ${symbol}" >> $defsFile_post
     # Check if the typedef is already defined ...
     # Check if the typedef is already defined ...
     typedef=$(grep "^typedef .*(\*${symbol}_t)" $(dirname $file)/$(basename $file .c).h)
     typedef=$(grep "^typedef .*(\*${symbol}_t)" $(dirname $file)/$(basename $file .c).h)
     # ... if not, generate it
     # ... if not, generate it
     if [ -z "$typedef" ]; then
     if [ -z "$typedef" ]; then
       # Trim off any extern "C", trim out the variable names, cleanup whitespace issues
       # Trim off any extern "C", trim out the variable names, cleanup whitespace issues
       typedef=$(grep -w "${symbol}" $TMPFILE | head -n 1 | $SED -e 's/extern "C" *//' -e "s/\(.*\) *${symbol} *(\(.*\)).*/typedef \1 (*${symbol}_t)(\2);/" -e 's/[_0-9A-Za-z]*\(,\)/\1/g' -e 's/[_0-9A-Za-z]*\();\)/\1/g' -e 's/  */ /g' -e 's/ \([,)]\)/\1/g' -e 's/ *()/(void)/g')
       typedef=$(grep -w "${symbol}" $TMPFILE | head -n 1 | $SED -e 's/extern "C" *//' -e "s/\(.*\) *${symbol} *(\(.*\)).*/typedef \1 (*${symbol}_t)(\2);/" -e 's/[_0-9A-Za-z]*\(,\)/\1/g' -e 's/[_0-9A-Za-z]*\();\)/\1/g' -e 's/  */ /g' -e 's/ \([,)]\)/\1/g' -e 's/ *()/(void)/g')
-      echo "$typedef" >> $defsFile_post
+      existing_typedef=0
+    else
+      existing_typedef=1
     fi
     fi
 
 
     if [ "${typedef%;}" = "${typedef}" ]; then
     if [ "${typedef%;}" = "${typedef}" ]; then
       echo "Error: Unable to generate typedef for: ${symbol}" >&2
       echo "Error: Unable to generate typedef for: ${symbol}" >&2
-      echo "$typedef"
-      rm -rf $TMPFILE
-      exit 1
+      test -n "$typedef" && echo "$typedef" >&2
+      continue
     fi
     fi
 
 
     #pipe typedef into generate_symbol.sh
     #pipe typedef into generate_symbol.sh
-    echo "$typedef" | src/generate_symbol.sh >> $defsFile_wrappers 2>> $defsFile_post
-  done
+    test -n "$typedef" && echo "${symbol} ${existing_typedef} ${typedef}"
+  done | src/generate_symbol.sh $defsFile_wrappers $defsFile_pre $defsFile_post
 
 
   echo "}" >> $defsFile_wrappers
   echo "}" >> $defsFile_wrappers
   echo "}" >> $defsFile_post
   echo "}" >> $defsFile_post

+ 17 - 6
src/generate_symbol.sh

@@ -1,12 +1,21 @@
 #! /bin/sh
 #! /bin/sh
 
 
+defsFile_wrappers="$1"
+defsFile_pre="$2"
+defsFile_post="$3"
+
 # X="typedef int (*Tcl_Eval_t)(Tcl_Interp*, const char*);"
 # X="typedef int (*Tcl_Eval_t)(Tcl_Interp*, const char*);"
 
 
-while read line; do
-  returntype=$(echo "$line" | sed -e 's/typedef \([^(]*\) (\*\([^ ]*\)_t)(\(.*\));/\1/')
-  name=$(echo "$line" | sed -e 's/typedef \([^(]*\) (\*\([^ ]*\)_t)(\(.*\));/\2/')
-  params=$(echo "$line" | sed -e 's/typedef \([^(]*\) (\*\([^ ]*\)_t)(\(.*\));/\3/')
+while read symbol existing_typedef typedef; do
+  echo "#define ${symbol} ORIGINAL_SYMBOL_${symbol}" >> $defsFile_pre
+  echo "#undef ${symbol}" >> $defsFile_post
+  test $existing_typedef -eq 0 && echo "$typedef" >> $defsFile_post
+
+  returntype=$(echo "$typedef" | sed -e 's/typedef \([^(]*\) (\*\([^ ]*\)_t)(\(.*\));/\1/')
+  name=$(echo "$typedef" | sed -e 's/typedef \([^(]*\) (\*\([^ ]*\)_t)(\(.*\));/\2/')
+  params=$(echo "$typedef" | sed -e 's/typedef \([^(]*\) (\*\([^ ]*\)_t)(\(.*\));/\3/')
 
 
+  SAVE_IFS=$IFS
   IFS=,
   IFS=,
 
 
   params_full=""
   params_full=""
@@ -35,11 +44,13 @@ while read line; do
     i=$((i + 1))
     i=$((i + 1))
   done
   done
 
 
-  cat << EOF
+  cat >> $defsFile_wrappers << EOF
 $returntype $name ($params_full) {
 $returntype $name ($params_full) {
   return DLSYM_VAR($name)($param_names);
   return DLSYM_VAR($name)($param_names);
 }
 }
 EOF
 EOF
 
 
-  echo "$returntype $name ($params_full);" >&2
+  echo "$returntype $name ($params_full);" >> $defsFile_post
+
+  IFS=$SAVE_IFS
 done
 done

+ 7 - 7
src/libtcl.c

@@ -34,7 +34,7 @@
 #include "libtcl.h"
 #include "libtcl.h"
 #include ".defs/libtcl_defs.c"
 #include ".defs/libtcl_defs.c"
 
 
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
 Tcl_Interp *global_interp = NULL;
 Tcl_Interp *global_interp = NULL;
 #endif
 #endif
 
 
@@ -44,7 +44,7 @@ static bd::Array<bd::String> my_symbols;
 void initialize_binds_tcl();
 void initialize_binds_tcl();
 
 
 static int load_symbols(void *handle) {
 static int load_symbols(void *handle) {
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
   const char *dlsym_error = NULL;
   const char *dlsym_error = NULL;
 
 
   DLSYM_GLOBAL(handle, Tcl_Eval);
   DLSYM_GLOBAL(handle, Tcl_Eval);
@@ -60,7 +60,7 @@ static int load_symbols(void *handle) {
 }
 }
 
 
 int load_libtcl() {
 int load_libtcl() {
-#ifndef HAVE_LIBTCL
+#ifndef USE_SCRIPT_TCL
   sdprintf("Not compiled with TCL support");
   sdprintf("Not compiled with TCL support");
   return 1;
   return 1;
 #else
 #else
@@ -83,7 +83,7 @@ int load_libtcl() {
 
 
   load_symbols(libtcl_handle);
   load_symbols(libtcl_handle);
 
 
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
   // create interp
   // create interp
   global_interp = Tcl_CreateInterp();
   global_interp = Tcl_CreateInterp();
   Tcl_FindExecutable(binname);
   Tcl_FindExecutable(binname);
@@ -98,7 +98,7 @@ int load_libtcl() {
   return 0;
   return 0;
 }
 }
 
 
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
 
 
 #include "chanprog.h"
 #include "chanprog.h"
 static int cmd_privmsg STDVAR {
 static int cmd_privmsg STDVAR {
@@ -118,7 +118,7 @@ void initialize_binds_tcl() {
 
 
 int unload_libtcl() {
 int unload_libtcl() {
   if (libtcl_handle) {
   if (libtcl_handle) {
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
     if (global_interp) {
     if (global_interp) {
       Tcl_DeleteInterp(global_interp);
       Tcl_DeleteInterp(global_interp);
       global_interp = NULL;
       global_interp = NULL;
@@ -139,7 +139,7 @@ int unload_libtcl() {
   return 1;
   return 1;
 }
 }
 
 
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
 bd::String tcl_eval(const bd::String& str) {
 bd::String tcl_eval(const bd::String& str) {
   load_libtcl();
   load_libtcl();
   if (!global_interp) return bd::String();
   if (!global_interp) return bd::String();

+ 1 - 1
src/libtcl.h

@@ -4,7 +4,7 @@
 #include "common.h"
 #include "common.h"
 #include "dl.h"
 #include "dl.h"
 #include <bdlib/src/String.h>
 #include <bdlib/src/String.h>
-#ifdef HAVE_LIBTCL
+#ifdef USE_SCRIPT_TCL
 
 
 #include ".defs/libtcl_pre.h"
 #include ".defs/libtcl_pre.h"