summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredman <redman>1999-03-10 02:22:51 (GMT)
committerredman <redman>1999-03-10 02:22:51 (GMT)
commit25b76e9221e8248ee8375b99159f7a53b1037507 (patch)
treea3a909de2f874e2d303b96ec794f83de6ad90e5e
parentc739ef13703c81ff6a02950f098ac031a3674ecf (diff)
downloadtk-25b76e9221e8248ee8375b99159f7a53b1037507.zip
tk-25b76e9221e8248ee8375b99159f7a53b1037507.tar.gz
tk-25b76e9221e8248ee8375b99159f7a53b1037507.tar.bz2
merge 8.0.6 code for stubs into 8.1 for UNIX dev_8_1_stubs_branch
-rw-r--r--generic/tkCursor.c5
-rw-r--r--unix/Makefile.in133
-rw-r--r--unix/configure.in65
-rw-r--r--unix/tkConfig.sh.in21
-rw-r--r--unix/tkUnixMenubu.c4
5 files changed, 203 insertions, 25 deletions
diff --git a/generic/tkCursor.c b/generic/tkCursor.c
index c3e4a12..9a90166 100644
--- a/generic/tkCursor.c
+++ b/generic/tkCursor.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCursor.c,v 1.1.4.3 1998/12/13 08:16:04 lfb Exp $
+ * RCS: @(#) $Id: tkCursor.c,v 1.1.4.3.2.1 1999/03/10 02:22:51 redman Exp $
*/
#include "tkPort.h"
@@ -330,7 +330,8 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
register TkCursor *cursorPtr;
int new;
XColor fgColor, bgColor;
- TkDisplay *dispPtr;
+ TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
+
if (!dispPtr->cursorInit) {
CursorInit(dispPtr);
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 0e43347..80e744b 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -5,7 +5,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.1.4.4 1999/02/16 12:03:59 lfb Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.1.4.4.2.1 1999/03/10 02:23:05 redman Exp $
# Current Tk version; used in various names.
@@ -111,9 +111,6 @@ X11_INCLUDES = @XINCLUDES@
# can override it).
X11_LIB_SWITCHES = @XLIBSW@
-# Libraries to use when linking. This definition is determined by the
-# configure script.
-LIBS = @TCL_BUILD_LIB_SPEC@ @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
# To turn off the security checks that disallow incoming sends when
# the X server appears to be insecure, reverse the comments on the
@@ -167,14 +164,31 @@ INSTALL_DATA = ${INSTALL} -m 644
TK_SHLIB_CFLAGS = @TK_SHLIB_CFLAGS@
+# To enable support for stubs in Tcl.
+STUB_LIB_FILE = @STUB_LIB_FILE@
+
+TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
+#TK_STUB_LIB_FILE = libtkstub.a
+
+TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@
+#TK_STUB_LIB_FLAG = -ltkstub
+
TK_LIB_FILE = @TK_LIB_FILE@
#TK_LIB_FILE = libtk.a
TK_LIB_FLAG = @TK_LIB_FLAG@
#TK_LIB_FLAG = -ltk
-TCL_LIB_FLAG = @TCL_LIB_FLAG@
-#TCL_LIB_FLAG = -ltcl
+TCL_LIB_SPEC = @TCL_BUILD_LIB_SPEC@
+TK_EXP_FILE = @TK_EXP_FILE@
+TK_BUILD_EXP_FILE = @TK_BUILD_EXP_FILE@
+
+TCL_STUB_FLAGS = @TCL_STUB_FLAGS@
+
+# Libraries to use when linking. This definition is determined by the
+# configure script.
+LIBS = @SHLIB_LD_LIBS@ @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
+WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
# The symbol below provides support for dynamic loading and shared
# libraries. See configure.in for a description of what it means.
@@ -213,9 +227,23 @@ TOOL_DIR = @TCL_SRC_DIR@/tools
CC = @CC@
CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TK_SHLIB_CFLAGS} \
-I${UNIX_DIR} -I${GENERIC_DIR} \
--I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} ${AC_FLAGS} ${PROTO_FLAGS} \
+-I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} \
+${AC_FLAGS} ${PROTO_FLAGS} ${TCL_STUB_FLAGS} \
${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS}
+WISH_CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TK_SHLIB_CFLAGS} \
+-I${UNIX_DIR} -I${GENERIC_DIR} \
+-I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} \
+${AC_FLAGS} ${PROTO_FLAGS} \
+${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS}
+
+STUB_CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TK_SHLIB_CFLAGS} \
+-I${UNIX_DIR} -I${GENERIC_DIR} \
+-I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} \
+${AC_FLAGS} ${PROTO_FLAGS} \
+${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS}
+
+
DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \
-I${BMAP_DIR} \
-I${TCL_GENERIC_DIR} ${X11_INCLUDES} \
@@ -245,7 +273,10 @@ UNIXOBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \
tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \
tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \
tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \
- tkUnixSend.o tkUnixWm.o tkUnixXId.o
+ tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o
+
+STUB_LIB_OBJS = tkStubs.o tkIntStubs.o tkIntPlatStubs.o tkPlatStubs.o \
+ tkIntXlibStubs.o tkStubLib.o
OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o \
tkColor.o tkConfig.o tkCursor.o tkError.o tkEvent.o \
@@ -254,6 +285,10 @@ OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o \
tkSelect.o tkUtil.o tkVisual.o tkWindow.o \
$(UNIXOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS)
+TK_DECLS = \
+ $(GENERIC_DIR)/tk.decls \
+ $(GENERIC_DIR)/tkInt.decls
+
SRCS = \
$(GENERIC_DIR)/tk3d.c $(GENERIC_DIR)/tkArgv.c \
$(GENERIC_DIR)/tkAtom.c $(GENERIC_DIR)/tkBind.c \
@@ -291,6 +326,9 @@ SRCS = \
$(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \
$(GENERIC_DIR)/tkOldConfig.c \
$(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \
+ $(GENERIC_DIR)/tkStubs.c $(GENERIC_DIR)/tkIntStubs.c \
+ $(GENERIC_DIR)/tkPlatStubs.c $(GENERIC_DIR)/tkIntPlatStubs.c \
+ $(GENERIC_DIR)/tkIntXlibStubs.c $(GENERIC_DIR)/tkInitStubs.c \
$(UNIX_DIR)/tkAppInit.c $(UNIX_DIR)/tkUnix.c \
$(UNIX_DIR)/tkUnix3d.c \
$(UNIX_DIR)/tkUnixButton.c $(UNIX_DIR)/tkUnixColor.c \
@@ -323,18 +361,24 @@ ${TK_LIB_FILE}: ${OBJS}
@MAKE_LIB@
$(RANLIB) ${TK_LIB_FILE}
+${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
+ rm -f ${STUB_LIB_FILE}
+ @MAKE_STUB_LIB@
+ $(RANLIB) ${STUB_LIB_FILE}
+
# Make target which outputs the list of the .o contained in the Tk lib
# usefull to build a single big shared library containing Tcl/Tk and other
# extensions. used for the Tcl Plugin. -- dl
tkLibObjs:
@echo ${OBJS}
+
# This targets actually build the objects needed for the lib in the above
# case
objs: ${OBJS}
-wish: $(WISH_OBJS) $(TK_LIB_FILE)
- $(CC) @LD_FLAGS@ $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ $(LIBS) \
+wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE)
+ $(CC) @LD_FLAGS@ $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ $(WISH_LIBS) \
$(TK_CC_SEARCH_FLAGS) -o wish
tktest: $(TKTEST_OBJS) $(TK_LIB_FILE)
@@ -377,7 +421,7 @@ install: install-binaries install-libraries install-demos install-man
# some ranlibs write to current directory, and this might not always be
# possible (e.g. if installing as root).
-install-binaries: $(TK_LIB_FILE) wish
+install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
do \
if [ ! -d $$i ] ; then \
@@ -395,6 +439,16 @@ install-binaries: $(TK_LIB_FILE) wish
@$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION)
@echo "Installing tkConfig.sh"
@$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh
+ @if test "$(TK_BUILD_EXP_FILE)" != ""; then \
+ echo "Installing $(TK_EXP_FILE)"; \
+ $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \
+ $(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \
+ fi
+ @if test "$(TK_STUB_LIB_FILE)" != "" ; then \
+ echo "Installing $(TK_STUB_LIB_FILE)"; \
+ $(INSTALL_DATA) $(STUB_LIB_FILE) \
+ $(LIB_INSTALL_DIR)/$(TK_STUB_LIB_FILE); \
+ fi
install-libraries:
@for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
@@ -522,12 +576,12 @@ tkTestInit.o: $(UNIX_DIR)/tkAppInit.c
mv tkAppInit.sav tkAppInit.o; \
fi;
+tkAppInit.o: $(UNIX_DIR)/tkAppInit.c
+ $(CC) -c $(WISH_CC_SWITCHES) $(UNIX_DIR)/tkAppInit.c
+
tk3d.o: $(GENERIC_DIR)/tk3d.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tk3d.c
-tkAppInit.o: $(UNIX_DIR)/tkAppInit.c
- $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkAppInit.c
-
tkArgv.o: $(GENERIC_DIR)/tkArgv.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkArgv.c
@@ -723,6 +777,31 @@ tkTextTag.o: $(GENERIC_DIR)/tkTextTag.c
tkTextWind.o: $(GENERIC_DIR)/tkTextWind.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextWind.c
+tkStubInit.o: $(GENERIC_DIR)/tkStubInit.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStubInit.c
+
+# Stub library binaries, these must be compiled for use in a shared library
+# even though they will be placed in a static archive
+
+tkStubs.o: $(GENERIC_DIR)/tkStubs.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tkStubs.c
+
+tkIntStubs.o: $(GENERIC_DIR)/tkIntStubs.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tkIntStubs.c
+
+tkPlatStubs.o: $(GENERIC_DIR)/tkPlatStubs.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tkPlatStubs.c
+
+tkIntPlatStubs.o: $(GENERIC_DIR)/tkIntPlatStubs.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tkIntPlatStubs.c
+
+tkIntXlibStubs.o: $(GENERIC_DIR)/tkIntXlibStubs.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tkIntXlibStubs.c
+
+tkStubLib.o: $(GENERIC_DIR)/tkStubLib.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tkStubLib.c
+
+
tkUnix.o: $(UNIX_DIR)/tkUnix.c
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnix.c
@@ -805,6 +884,32 @@ checkuchar:
checkexports: $(TK_LIB_FILE)
-nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k'
+# Target to regenerate header files and stub files from the *.decls tables.
+#
+
+genstubs:
+ tclsh $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
+ $(GENERIC_DIR)/tk.decls $(GENERIC_DIR)/tkInt.decls
+
+#
+# Target to check that all exported functions have an entry in the stubs
+# tables.
+#
+
+checkstubs:
+ -@for i in `nm -p $(TK_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \
+ | sort -n`; do \
+ match=0; \
+ for j in $(TK_DECLS); do \
+ if [ `grep -c $$i $$j` -gt 0 ]; then \
+ match=1; \
+ fi; \
+ done; \
+ if [ $$match -eq 0 ]; then echo $$i; fi \
+ done
+
+
+
#
# Target to create a proper Tk distribution from information in the
# master source directory. DISTDIR must be defined to indicate where
diff --git a/unix/configure.in b/unix/configure.in
index 995cb5b..eb7320a 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -1,8 +1,9 @@
+#! /bin/bash -norc
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
AC_INIT(../generic/tk.h)
-# RCS: @(#) $Id: configure.in,v 1.1.4.9 1999/02/12 01:09:02 stanton Exp $
+# RCS: @(#) $Id: configure.in,v 1.1.4.9.2.1 1999/03/10 02:23:06 redman Exp $
TK_VERSION=8.1
TK_MAJOR_VERSION=8
@@ -453,13 +454,64 @@ eval "TK_LIB_FILE=${TK_LIB_FILE}"
# AIX remembers this path and will attempt to use it at run-time to look
# up the Tcl library.
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
+if test $TK_SHARED_BUILD = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
+ else
+ TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
+ fi
+ TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
+ TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}"
+ TK_BUILD_EXP_FILE=""
+ TK_EXP_FILE=""
+else
+ TK_BUILD_EXP_FILE="lib.exp"
+ eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
+
+ TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
+ TK_LIB_SPEC="-bI:${exec_prefix}/lib/${TK_EXP_FILE}"
+fi
+
+#--------------------------------------------------------------------
+# The statements below define various symbols relating to Tk
+# using tcl stub support.
+#--------------------------------------------------------------------
+
+AC_MSG_CHECKING(how to link to Tcl)
+
+AC_ARG_ENABLE(tcl-stub,
+ [ --enable-tcl-stub use the Tcl stub interface],
+ [tk_ok=$enableval], [tk_ok=no])
+
+if test "$tk_ok" = "yes" ; then
+
+ AC_MSG_RESULT(using Tcl stub interface)
+
+ MAKE_STUB_LIB="ar cr \${STUB_LIB_FILE} \${STUB_LIB_OBJS}"
+ TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
+
+ # Don't link Tk directly to Tcl.
+
+ SHLIB_LD_LIBS="\${TCL_BUILD_STUB_LIB_SPEC}"
else
- TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
+ AC_MSG_RESULT(dynamic linking)
+
+ TCL_BUILD_STUB_LIB_SPEC=""
+ TCL_STUB_FLAGS=""
fi
-TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
-TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}"
+
+AC_SUBST(STUB_LIB_FILE)
+
+AC_SUBST(TK_STUB_LIB_FILE)
+AC_SUBST(TK_STUB_LIB_FLAG)
+AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
+AC_SUBST(TK_STUB_LIB_SPEC)
+AC_SUBST(TK_BUILD_STUB_LIB_PATH)
+AC_SUBST(TK_STUB_LIB_PATH)
+AC_SUBST(MAKE_STUB_LIB)
+AC_SUBST(TCL_STUB_FLAGS)
+AC_SUBST(TK_BUILD_EXP_FILE)
+AC_SUBST(TK_EXP_FILE)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_DEFAULT)
@@ -477,6 +529,7 @@ AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(SHLIB_VERSION)
AC_SUBST(TCL_BIN_DIR)
+AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
AC_SUBST(TCL_BUILD_LIB_SPEC)
AC_SUBST(TCL_DBGX)
AC_SUBST(TCL_LIB_FLAG)
diff --git a/unix/tkConfig.sh.in b/unix/tkConfig.sh.in
index cc5c33d..c00406a 100644
--- a/unix/tkConfig.sh.in
+++ b/unix/tkConfig.sh.in
@@ -11,7 +11,7 @@
#
# The information in this file is specific to a single platform.
#
-# RCS: @(#) $Id: tkConfig.sh.in,v 1.1.4.1 1998/09/30 02:19:13 stanton Exp $
+# RCS: @(#) $Id: tkConfig.sh.in,v 1.1.4.1.2.1 1999/03/10 02:23:07 redman Exp $
# Tk's version number.
TK_VERSION='@TK_VERSION@'
@@ -72,3 +72,22 @@ TK_SRC_DIR='@TK_SRC_DIR@'
TK_CC_SEARCH_FLAGS='@TK_CC_SEARCH_FLAGS@'
TK_LD_SEARCH_FLAGS='@TK_LD_SEARCH_FLAGS@'
+# The name of the Tk stub library (.a):
+TK_STUB_LIB_FILE='@TK_STUB_LIB_FILE@'
+
+# -l flag to pass to the linker to pick up the Tk stub library
+TK_STUB_LIB_FLAG='@TK_STUB_LIB_FLAG@'
+
+# String to pass to linker to pick up the Tk stub library from its
+# build directory.
+TK_BUILD_STUB_LIB_SPEC='@TK_BUILD_STUB_LIB_SPEC@'
+
+# String to pass to linker to pick up the Tk stub library from its
+# installed directory.
+TK_STUB_LIB_SPEC='@TK_STUB_LIB_SPEC@'
+
+# Path to the Tk stub library in the build directory.
+TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@'
+
+# Path to the Tk stub library in the install directory.
+TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@'
diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c
index c94653c..9f1111e 100644
--- a/unix/tkUnixMenubu.c
+++ b/unix/tkUnixMenubu.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixMenubu.c,v 1.1.4.4 1999/02/16 06:00:09 lfb Exp $
+ * RCS: @(#) $Id: tkUnixMenubu.c,v 1.1.4.4.2.1 1999/03/10 02:23:07 redman Exp $
*/
#include "tkMenubutton.h"
@@ -143,7 +143,7 @@ TkpDisplayMenuButton(clientData)
* foreground color, generate the stippled effect.
*/
- if ((mbPtr->state == STATE_DISABLED) && (mbPtr->disabledFg != NULL)
+ if (((mbPtr->state == STATE_DISABLED) && (mbPtr->disabledFg != NULL) )
|| (mbPtr->image != NULL)) {
XFillRectangle(mbPtr->display, pixmap, mbPtr->disabledGC,
mbPtr->inset, mbPtr->inset,