summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/Makefile.in8
-rwxr-xr-xwin/configure105
-rw-r--r--win/makefile.vc22
-rw-r--r--win/tcl.m479
-rw-r--r--win/tclWinInit.c16
5 files changed, 140 insertions, 90 deletions
diff --git a/win/Makefile.in b/win/Makefile.in
index cbb20f6..9b379d8 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -5,7 +5,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.54 2001/09/14 01:00:59 andreas_kupries Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.55 2001/10/01 20:58:51 hobbs Exp $
VERSION = @TCL_VERSION@
@@ -311,11 +311,11 @@ $(MAN2TCL): $(ROOT_DIR)/tools/man2tcl.c
$(TCLSH): $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(TCLSH_OBJS) tclsh.$(RES)
$(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB_FILE) $(LIBS) \
- tclsh.$(RES) $(CC_EXENAME)
+ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
$(TCLTEST): $(TCL_LIB_FILE) $(TCLTEST_OBJS) $(CAT32) tclsh.$(RES)
$(CC) $(CFLAGS) $(TCLTEST_OBJS) $(TCL_LIB_FILE) $(LIBS) \
- tclsh.$(RES) $(CC_EXENAME)
+ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
cat32.$(OBJEXT): cat.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
@@ -361,7 +361,7 @@ ${REG_LIB_FILE}: ${REG_OBJS} ${TCL_LIB_FILE}
${PIPE_DLL_FILE}: ${PIPE_OBJS}
@$(RM) ${PIPE_DLL_FILE}
- @MAKE_EXE@ $(CFLAGS) ${PIPE_OBJS} $(LIBS)
+ @MAKE_EXE@ $(CFLAGS) ${PIPE_OBJS} $(LIBS) $(LDFLAGS_CONSOLE)
# Add the object extension to the implicit rules. By default .obj is not
# automatically added.
diff --git a/win/configure b/win/configure
index 50cc369..4000c42 100755
--- a/win/configure
+++ b/win/configure
@@ -1135,14 +1135,13 @@ fi
echo "$ac_t""$do64bit" 1>&6
-
# Set some defaults (may get changed below)
EXTRA_CFLAGS=""
# Extract the first word of "cygpath", so it can be a program name with args.
set dummy cygpath; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1146: checking for $ac_word" >&5
+echo "configure:1145: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1179,7 +1178,7 @@ fi
# set various compiler flags depending on whether we are using gcc or cl
echo $ac_n "checking compiler flags""... $ac_c" 1>&6
-echo "configure:1183: checking compiler flags" >&5
+echo "configure:1182: checking compiler flags" >&5
if test "${GCC}" = "yes" ; then
if test "$do64bit" = "yes" ; then
echo "configure: warning: "64bit mode not supported with GCC on Windows"" 1>&2
@@ -1266,22 +1265,6 @@ echo "configure:1183: checking compiler flags" >&5
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
else
- SHLIB_LD="link -dll -nologo -link50compat -incremental:no"
- SHLIB_LD_LIBS="user32.lib advapi32.lib"
- LIBS="user32.lib advapi32.lib"
- LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib"
- STLIB_LD="lib -nologo"
- RC="rc"
- RC_OUT=-fo
- RC_TYPE=-r
- RC_INCLUDE=-i
- RC_DEFINE=-d
- RES=res
- MAKE_LIB="\${STLIB_LD} -out:\$@"
- POST_MAKE_LIB=
- MAKE_EXE="\${CC} -Fe\$@"
- LIBPREFIX=""
-
if test "${SHARED_BUILD}" = "0" ; then
# static
echo "$ac_t""using static flags" 1>&6
@@ -1304,10 +1287,58 @@ echo "configure:1183: checking compiler flags" >&5
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX="\${DBGX}.dll"
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ if test "$do64bit" = "yes" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft SDK"
+ fi
+ # In order to work in the tortured autoconf environment,
+ # we need to ensure that this path has no spaces
+ MSSDK=$(cygpath -w -s "$MSSDK" | sed -e 's!\\!/!g')
+ if test ! -d "${MSSDK}/bin/win64" ; then
+ echo "configure: warning: "could not find 64-bit SDK to enable 64bit mode"" 1>&2
+ do64bit="no"
+ fi
+ fi
+
+ if test "$do64bit" = "yes" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="${MSSDK}/Bin/Win64/cl.exe \
+ -I${MSSDK}/Include/prerelease \
+ -I${MSSDK}/Include/Win64/crt \
+ -I${MSSDK}/Include/Win64/crt/sys \
+ -I${MSSDK}/Include"
+ RC="${MSSDK}/bin/rc.exe"
+ CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -Gs ${runtime}"
+ lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
+ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
+ STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
+ LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
+ else
+ RC="rc"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
+ STLIB_LD="lib -nologo"
+ LINKBIN="link -link50compat"
+ fi
+
+ SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no"
+ SHLIB_LD_LIBS="user32.lib advapi32.lib"
+ LIBS="user32.lib advapi32.lib"
+ LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib"
+ RC_OUT=-fo
+ RC_TYPE=-r
+ RC_INCLUDE=-i
+ RC_DEFINE=-d
+ RES=res
+ MAKE_LIB="\${STLIB_LD} -out:\$@"
+ POST_MAKE_LIB=
+ MAKE_EXE="\${CC} -Fe\$@"
+ LIBPREFIX=""
+
EXTRA_CFLAGS="-YX"
- CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
-# CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
- CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
CFLAGS_WARNING="-W3"
LDFLAGS_DEBUG="-debug:full -debugtype:cv"
LDFLAGS_OPTIMIZE="-release"
@@ -1318,12 +1349,8 @@ echo "configure:1183: checking compiler flags" >&5
# Specify linker flags depending on the type of app being
# built -- Console vs. Window.
- LDFLAGS_CONSOLE="-link -subsystem:console"
- LDFLAGS_WINDOW="-link -subsystem:windows"
-
- if test "$do64bit" = "yes" ; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TCLALLOC=0"
- fi
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
@@ -1335,7 +1362,7 @@ echo "configure:1183: checking compiler flags" >&5
echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
-echo "configure:1339: checking for build with symbols" >&5
+echo "configure:1366: checking for build with symbols" >&5
# Check whether --enable-symbols or --disable-symbols was given.
if test "${enable_symbols+set}" = set; then
enableval="$enable_symbols"
@@ -1365,7 +1392,7 @@ TCL_DBGX=${DBGX}
#--------------------------------------------------------------------
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1369: checking how to run the C preprocessor" >&5
+echo "configure:1396: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1380,13 +1407,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1384 "configure"
+#line 1411 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1397,13 +1424,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1401 "configure"
+#line 1428 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1414,13 +1441,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1418 "configure"
+#line 1445 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1446,17 +1473,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for errno.h""... $ac_c" 1>&6
-echo "configure:1450: checking for errno.h" >&5
+echo "configure:1477: checking for errno.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1455 "configure"
+#line 1482 "configure"
#include "confdefs.h"
#include <errno.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
diff --git a/win/makefile.vc b/win/makefile.vc
index 03639b3..08ef169 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -5,8 +5,9 @@
#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
+# Copyright (c) 2001 ActiveState Corporation.
#
-# RCS: @(#) $Id: makefile.vc,v 1.65 2001/09/14 01:00:59 andreas_kupries Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.66 2001/10/01 20:58:52 hobbs Exp $
# Does not depend on the presence of any environment variables in
# order to compile tcl; all needed information is derived from
@@ -36,10 +37,10 @@ INSTALLDIR = C:\Progra~1\Tcl
!IF "$(MACHINE)" == "IA64"
# IA64 support is based on the standard setup with v2 of the
-# Microsoft Platform SDK for Whistler, build 2267
+# Microsoft SDK for XP, RC1
-TOOLS32 = C:\Progra~1\Microsoft Platform SDK
-TOOLS32_rc = C:\Progra~1\Microsoft Platform SDK
+TOOLS32 = C:\Progra~1\Microsoft SDK
+TOOLS32_rc = C:\Progra~1\Microsoft SDK
cc32 = "$(TOOLS32)\bin\Win64\cl.exe"
link32 = "$(TOOLS32)\bin\Win64\link.exe"
@@ -78,17 +79,8 @@ NODEBUG = 1
# -DTCL_MEM_DEBUG Enables the debugging memory allocator.
# -DTCL_COMPILE_DEBUG Enables byte compilation logging.
# -DTCL_COMPILE_STATS Enables byte compilation statistics gathering.
-# -DUSE_TCLALLOC=0 Disables the Tcl memory allocator in favor
-# of the native malloc implementation. This is
-# needed when using Purify. For IA64, we do
-# want to use the native allocator.
#
#DEBUGDEFINES = -DTCL_MEM_DEBUG -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
-!IF "$(MACHINE)" == "IA64"
-DEBUGDEFINES = -DUSE_TCLALLOC=0
-!ELSE
-#DEBUGDEFINES = -DUSE_TCLALLOC=0
-!ENDIF
######################################################################
# Do not modify below this line
@@ -251,7 +243,11 @@ TCL_DEFINES = $(DEBUGDEFINES) $(THREADDEFINES)
!IF "$(NODEBUG)" == "1"
# This cranks the optimization level to maximize speed
+!IF "$(MACHINE)" == "IA64"
+cdebug = -O2 -Gs
+!ELSE
cdebug = -O2 -Gs -GD
+!ENDIF
!ELSE IF "$(MACHINE)" == "IA64"
cdebug = -Od -Zi
!ELSE
diff --git a/win/tcl.m4 b/win/tcl.m4
index d7e642c..271984b 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -326,7 +326,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no])
AC_MSG_RESULT($do64bit)
-
# Set some defaults (may get changed below)
EXTRA_CFLAGS=""
@@ -427,22 +426,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
else
- SHLIB_LD="link -dll -nologo -link50compat -incremental:no"
- SHLIB_LD_LIBS="user32.lib advapi32.lib"
- LIBS="user32.lib advapi32.lib"
- LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib"
- STLIB_LD="lib -nologo"
- RC="rc"
- RC_OUT=-fo
- RC_TYPE=-r
- RC_INCLUDE=-i
- RC_DEFINE=-d
- RES=res
- MAKE_LIB="\${STLIB_LD} -out:\[$]@"
- POST_MAKE_LIB=
- MAKE_EXE="\${CC} -Fe\[$]@"
- LIBPREFIX=""
-
if test "${SHARED_BUILD}" = "0" ; then
# static
AC_MSG_RESULT([using static flags])
@@ -465,10 +448,58 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX="\${DBGX}.dll"
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ if test "$do64bit" = "yes" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft SDK"
+ fi
+ # In order to work in the tortured autoconf environment,
+ # we need to ensure that this path has no spaces
+ MSSDK=$(cygpath -w -s "$MSSDK" | sed -e 's!\\!/!g')
+ if test ! -d "${MSSDK}/bin/win64" ; then
+ AC_MSG_WARN("could not find 64-bit SDK to enable 64bit mode")
+ do64bit="no"
+ fi
+ fi
+
+ if test "$do64bit" = "yes" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="${MSSDK}/Bin/Win64/cl.exe \
+ -I${MSSDK}/Include/prerelease \
+ -I${MSSDK}/Include/Win64/crt \
+ -I${MSSDK}/Include/Win64/crt/sys \
+ -I${MSSDK}/Include"
+ RC="${MSSDK}/bin/rc.exe"
+ CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -Gs ${runtime}"
+ lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
+ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
+ STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
+ LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
+ else
+ RC="rc"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
+ STLIB_LD="lib -nologo"
+ LINKBIN="link -link50compat"
+ fi
+
+ SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no"
+ SHLIB_LD_LIBS="user32.lib advapi32.lib"
+ LIBS="user32.lib advapi32.lib"
+ LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib"
+ RC_OUT=-fo
+ RC_TYPE=-r
+ RC_INCLUDE=-i
+ RC_DEFINE=-d
+ RES=res
+ MAKE_LIB="\${STLIB_LD} -out:\[$]@"
+ POST_MAKE_LIB=
+ MAKE_EXE="\${CC} -Fe\[$]@"
+ LIBPREFIX=""
+
EXTRA_CFLAGS="-YX"
- CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
-# CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
- CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
CFLAGS_WARNING="-W3"
LDFLAGS_DEBUG="-debug:full -debugtype:cv"
LDFLAGS_OPTIMIZE="-release"
@@ -479,12 +510,8 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
# Specify linker flags depending on the type of app being
# built -- Console vs. Window.
- LDFLAGS_CONSOLE="-link -subsystem:console"
- LDFLAGS_WINDOW="-link -subsystem:windows"
-
- if test "$do64bit" = "yes" ; then
- EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TCLALLOC=0"
- fi
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
])
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 2e2c237..219f193 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -7,7 +7,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclWinInit.c,v 1.30 2001/09/20 18:35:25 hobbs Exp $
+ * RCS: @(#) $Id: tclWinInit.c,v 1.31 2001/10/01 20:58:52 hobbs Exp $
*/
#include "tclWinInt.h"
@@ -42,14 +42,11 @@ typedef struct {
#ifndef PROCESSOR_ARCHITECTURE_PPC
#define PROCESSOR_ARCHITECTURE_PPC 3
#endif
-#ifndef PROCESSOR_ARCHITECTURE_UNKNOWN
-#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
-#endif
#ifndef PROCESSOR_ARCHITECTURE_SHX
-#define PROCESSOR_ARCHITECTURE_SHX 4
+#define PROCESSOR_ARCHITECTURE_SHX 4
#endif
#ifndef PROCESSOR_ARCHITECTURE_ARM
-#define PROCESSOR_ARCHITECTURE_ARM 5
+#define PROCESSOR_ARCHITECTURE_ARM 5
#endif
#ifndef PROCESSOR_ARCHITECTURE_IA64
#define PROCESSOR_ARCHITECTURE_IA64 6
@@ -60,6 +57,9 @@ typedef struct {
#ifndef PROCESSOR_ARCHITECTURE_MSIL
#define PROCESSOR_ARCHITECTURE_MSIL 8
#endif
+#ifndef PROCESSOR_ARCHITECTURE_UNKNOWN
+#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
+#endif
/*
* The following arrays contain the human readable strings for the Windows
@@ -459,7 +459,7 @@ ToUtf(
wSrc++;
}
*dst = '\0';
- return dst - start;
+ return (int) (dst - start);
}
@@ -703,7 +703,7 @@ TclpFindVariable(name, lengthPtr)
if (p1 == NULL) {
continue;
}
- length = p1 - envUpper;
+ length = (int) (p1 - envUpper);
Tcl_DStringSetLength(&envString, length+1);
Tcl_UtfToUpper(envUpper);