summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclAlloc.c20
-rw-r--r--generic/tclPkgConfig.c4
-rwxr-xr-xunix/configure11
-rw-r--r--unix/tcl.m43
-rw-r--r--unix/tclConfig.h.in2
-rwxr-xr-xwin/configure32
-rw-r--r--win/makefile.bc2
-rw-r--r--win/rules.vc2
-rw-r--r--win/tcl.m427
-rw-r--r--win/tclWinInit.c2
11 files changed, 61 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index 75b90f3..e1b2f51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-04-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tclWinInit.c: [Bug 3448512]: clock scan "1958-01-01" fails only
+ * win/tcl.m4: in debug compilation.
+ * win/configure:
+ * unix/tcl.m4: Use NDEBUG consistantly meaning: no debugging.
+ * unix/configure:
+
2012-04-04 Jan Nijtmans <nijtmans@users.sf.net>
* win/tclWinSock.c: [Bug 510001]: TclSockMinimumBuffers needs plat imp
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c
index 7647b4d..8d0a2cc 100644
--- a/generic/tclAlloc.c
+++ b/generic/tclAlloc.c
@@ -26,12 +26,6 @@
#if USE_TCLALLOC
-#ifdef TCL_DEBUG
-# define DEBUG
-/* #define MSTATS */
-# define RCHECK
-#endif
-
/*
* We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait
* until Tcl uses config.h properly.
@@ -60,7 +54,7 @@ union overhead {
unsigned char index; /* bucket # */
unsigned char unused; /* unused */
unsigned char magic1; /* other magic number */
-#ifdef RCHECK
+#ifndef NDEBUG
unsigned short rmagic; /* range magic number */
unsigned long size; /* actual block size */
unsigned short unused2; /* padding to 8-byte align */
@@ -77,7 +71,7 @@ union overhead {
#define MAGIC 0xef /* magic # on accounting info */
#define RMAGIC 0x5555 /* magic # on range info */
-#ifdef RCHECK
+#ifndef NDEBUG
#define RSLOP sizeof (unsigned short)
#else
#define RSLOP 0
@@ -143,7 +137,7 @@ static unsigned int numMallocs[NBUCKETS+1];
#include <stdio.h>
#endif
-#if defined(DEBUG) || defined(RCHECK)
+#if !defined(NDEBUG)
#define ASSERT(p) if (!(p)) Tcl_Panic(# p)
#define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p)
#else
@@ -300,7 +294,7 @@ TclpAlloc(
numMallocs[NBUCKETS]++;
#endif
-#ifdef RCHECK
+#ifndef NDEBUG
/*
* Record allocated size of block and bound space with magic numbers.
*/
@@ -358,7 +352,7 @@ TclpAlloc(
numMallocs[bucket]++;
#endif
-#ifdef RCHECK
+#ifndef NDEBUG
/*
* Record allocated size of block and bound space with magic numbers.
*/
@@ -578,7 +572,7 @@ TclpRealloc(
numMallocs[NBUCKETS]++;
#endif
-#ifdef RCHECK
+#ifndef NDEBUG
/*
* Record allocated size of block and update magic number bounds.
*/
@@ -620,7 +614,7 @@ TclpRealloc(
* Ok, we don't have to copy, it fits as-is
*/
-#ifdef RCHECK
+#ifndef NDEBUG
overPtr->realBlockSize = (numBytes + RSLOP - 1) & ~(RSLOP - 1);
BLOCK_END(overPtr) = RMAGIC;
#endif
diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c
index 4eed372..840ebed 100644
--- a/generic/tclPkgConfig.c
+++ b/generic/tclPkgConfig.c
@@ -22,7 +22,7 @@
* - TCL_COMPILE_STATS OSCMa bytecode compiler statistics.
*
* - TCL_CFG_DO64BIT NSCMdt tcl is compiled for a 64bit system.
- * - TCL_CFG_DEBUG NSCMdt tcl is compiled with symbol info on.
+ * - NDEBUG NSCMdt tcl is compiled with symbol info off.
* - TCL_CFG_OPTIMIZED NSCMdt tcl is compiled with cc optimizations on
* - TCL_CFG_PROFILED NSCMdt tcl is compiled with profiling info.
*
@@ -70,7 +70,7 @@
# define CFG_64 "0"
#endif
-#ifdef TCL_CFG_DEBUG
+#ifndef NDEBUG
# define CFG_DEBUG "1"
#else
# define CFG_DEBUG "0"
diff --git a/unix/configure b/unix/configure
index 4a6466d..67ae68b 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9136,6 +9136,11 @@ fi;
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
+
+cat >>confdefs.h <<\_ACEOF
+#define NDEBUG 1
+_ACEOF
+
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
@@ -9153,12 +9158,6 @@ echo "${ECHO_T}yes (standard debugging)" >&6
fi
- ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging?
-
-cat >>confdefs.h <<\_ACEOF
-#define TCL_CFG_DEBUG 1
-_ACEOF
-
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index ca77586..4ccb37e 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -775,6 +775,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
+ AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?])
AC_MSG_RESULT([no])
AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?])
else
@@ -786,8 +787,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
fi
AC_SUBST(CFLAGS_DEFAULT)
AC_SUBST(LDFLAGS_DEFAULT)
- ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging?
- AC_DEFINE(TCL_CFG_DEBUG, 1, [Is debugging enabled?])
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 8bede7e..1f1513d 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -341,7 +341,7 @@
#undef TCL_CFGVAL_ENCODING
/* Is debugging enabled? */
-#undef TCL_CFG_DEBUG
+#undef NDEBUG
/* Is this a 64-bit build? */
#undef TCL_CFG_DO64BIT
diff --git a/win/configure b/win/configure
index 4d837b0..fd09f73 100755
--- a/win/configure
+++ b/win/configure
@@ -3329,7 +3329,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #ifdef __WIN32__
+ #ifndef __WIN32__
#error cross-compiler
#endif
@@ -3363,12 +3363,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_cross=yes
+ ac_cv_cross=no
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_cross=no
+ac_cv_cross=yes
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -3617,8 +3617,8 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #ifdef _WIN64
- #error 64-bit
+ #ifndef _WIN64
+ #error 32-bit
#endif
int
@@ -3651,12 +3651,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- tcl_win_64bit=no
+ tcl_win_64bit=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-tcl_win_64bit=yes
+tcl_win_64bit=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -4629,6 +4629,11 @@ fi;
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
DBGX=""
+
+cat >>confdefs.h <<\_ACEOF
+#define NDEBUG 1
+_ACEOF
+
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
@@ -4647,24 +4652,23 @@ echo "${ECHO_T}yes (standard debugging)" >&6
fi
- cat >>confdefs.h <<\_ACEOF
-#define TCL_CFG_DEBUG 1
-_ACEOF
-
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
- cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
#define TCL_MEM_DEBUG 1
_ACEOF
fi
if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
- cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
#define TCL_COMPILE_DEBUG 1
_ACEOF
- cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
#define TCL_COMPILE_STATS 1
_ACEOF
diff --git a/win/makefile.bc b/win/makefile.bc
index 6ba4420..2faf415 100644
--- a/win/makefile.bc
+++ b/win/makefile.bc
@@ -137,7 +137,7 @@ BINROOT = ..
!IF "$(NODEBUG)" == "1"
TMPDIRNAME = Release
DBGX =
-SYMDEFINES =
+SYMDEFINES = -DNDEBUG
!ELSE
TMPDIRNAME = Debug
#DBGX = d
diff --git a/win/rules.vc b/win/rules.vc
index e18dca9..63ecf01 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -446,6 +446,8 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG
!elseif $(OPTIMIZING)
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
+!else
+OPTDEFINES = $(OPTDEFINES) -DNDEBUG
!endif
!if $(PROFILE)
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED
diff --git a/win/tcl.m4 b/win/tcl.m4
index 9a5fa7b..9320d89 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -34,7 +34,10 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
fi
if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
- AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+ if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then
+ AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+ fi
+ TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd`
fi
AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh)
])
@@ -300,6 +303,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
DBGX=""
+ AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?])
AC_MSG_RESULT([no])
AC_DEFINE(TCL_CFG_OPTIMIZED)
@@ -313,15 +317,14 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
fi
AC_SUBST(CFLAGS_DEFAULT)
AC_SUBST(LDFLAGS_DEFAULT)
- AC_DEFINE(TCL_CFG_DEBUG)
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
- AC_DEFINE(TCL_MEM_DEBUG)
+ AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
fi
if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
- AC_DEFINE(TCL_COMPILE_DEBUG)
- AC_DEFINE(TCL_COMPILE_STATS)
+ AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?])
+ AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?])
fi
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
@@ -416,12 +419,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK(for cross-compile version of gcc,
ac_cv_cross,
AC_TRY_COMPILE([
- #ifdef __WIN32__
+ #ifndef __WIN32__
#error cross-compiler
#endif
], [],
- ac_cv_cross=yes,
- ac_cv_cross=no)
+ ac_cv_cross=no,
+ ac_cv_cross=yes)
)
if test "$ac_cv_cross" = "yes"; then
@@ -593,12 +596,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
;;
*)
AC_TRY_COMPILE([
- #ifdef _WIN64
- #error 64-bit
+ #ifndef _WIN64
+ #error 32-bit
#endif
], [],
- tcl_win_64bit=no,
- tcl_win_64bit=yes
+ tcl_win_64bit=yes,
+ tcl_win_64bit=no
)
if test "$tcl_win_64bit" = "yes" ; then
do64bit=amd64
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index a1087c9..d80fa28 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -532,7 +532,7 @@ TclpSetVariables(
TCL_GLOBAL_ONLY);
}
-#ifdef _DEBUG
+#ifndef NDEBUG
/*
* The existence of the "debug" element of the tcl_platform array
* indicates that this particular Tcl shell has been compiled with debug