threaded version of tcl81

This commit is contained in:
Eric J.Chet 1999-01-21 18:19:58 +00:00
parent 4ad7dd9d51
commit ed48c607c8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=16245
8 changed files with 435 additions and 0 deletions

View file

@ -0,0 +1,67 @@
# New ports collection makefile for: tcl8.1
# Version required: 8.1.b2
# Date created: 19 August 1997
# Whom: jkh
#
# $Id$
#
DISTNAME= tcl8.1b1
PKGNAME= tcl-8.1.b1-thread
CATEGORIES= lang tcl81
MASTER_SITES= ftp://ftp.scriptics.com/pub/tcl/tcl8_1/
MAINTAINER= ejc@FreeBSD.ORG
FILE_DEPENDS= ${PORTSDIR}/lang/tcl80
NO_LATEST_LINK= yes
WRKSRC= ${WRKDIR}/${DISTNAME}/unix
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-shared --enable-threads
CONFIGURE_ENV= PORTSDIR=${PORTSDIR}
PKGINSTALL= ${PORTSDIR}/lang/tcl80/pkg/INSTALL.tclsh
MAN1= tclsh.1
MAN3= AddErrInfo.3 Alloc.3 AllowExc.3 AppInit.3 AssocData.3 Async.3 \
BackgdErr.3 Backslash.3 BoolObj.3 ByteArrObj.3 CallDel.3 CmdCmplt.3 \
Concat.3 CrtChannel.3 CrtChnlHdlr.3 CrtCloseHdlr.3 CrtCommand.3 \
CrtFileHdlr.3 CrtInterp.3 CrtMathFnc.3 CrtObjCmd.3 CrtSlave.3 \
CrtTimerHdlr.3 CrtTrace.3 DString.3 DetachPids.3 DoOneEvent.3 \
DoWhenIdle.3 DoubleObj.3 Encoding.3 Eval.3 Exit.3 ExprLong.3 \
ExprLongObj.3 FindExec.3 GetIndex.3 GetInt.3 GetOpnFl.3 GetStdChan.3 \
Hash.3 IntObj.3 Interp.3 LinkVar.3 ListObj.3 Notifier.3 Object.3 \
ObjectType.3 OpenFileChnl.3 OpenTcp.3 ParseCmd.3 PkgRequire.3 \
Preserve.3 PrintDbl.3 RecEvalObj.3 RecordEval.3 RegExp.3 SaveResult.3 \
SetErrno.3 SetRecLmt.3 SetResult.3 SetVar.3 Sleep.3 SplitList.3 \
SplitPath.3 StaticPkg.3 StrMatch.3 StringObj.3 Tcl_Main.3 Thread.3 \
ToUpper.3 TraceVar.3 Translate.3 UpVar.3 Utf.3 WrongNumArgs.3
MANN= Tcl.n after.n append.n array.n bgerror.n binary.n break.n case.n \
catch.n cd.n clock.n close.n concat.n continue.n encoding.n eof.n \
error.n eval.n exec.n exit.n expr.n fblocked.n fconfigure.n fcopy.n \
file.n fileevent.n filename.n flush.n for.n foreach.n format.n gets.n \
glob.n global.n history.n http.n if.n incr.n info.n interp.n join.n \
lappend.n library.n lindex.n linsert.n list.n llength.n load.n \
lrange.n lreplace.n lsearch.n lsort.n msgcat.n namespace.n open.n \
package.n pid.n pkgMkIndex.n proc.n puts.n pwd.n read.n regexp.n \
registry.n regsub.n rename.n resource.n return.n safe.n scan.n seek.n \
set.n socket.n source.n split.n string.n subst.n switch.n tclvars.n \
tell.n time.n trace.n unknown.n unset.n update.n uplevel.n upvar.n \
variable.n vwait.n while.n
MANCOMPRESSED= yes
.include <bsd.port.pre.mk>
post-install:
${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib
.if exists(${PKGINSTALL})
${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL}
.endif
test:
cd ${WRKSRC} && ${MAKE} test
.include <bsd.port.post.mk>

View file

@ -0,0 +1 @@
MD5 (tcl8.1b1.tar.gz) = 608c36993dfa52f06499f5c2004c7633

View file

@ -0,0 +1,179 @@
--- Makefile.in.orig Fri Dec 11 18:36:13 1998
+++ Makefile.in Thu Jan 21 11:09:47 1999
@@ -55,7 +55,9 @@
BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
# Directory in which to install the include file tcl.h:
-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
+INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include/tcl$(VERSION)
+GENERIC_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include/tcl$(VERSION)/generic
+UNIX_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include/tcl$(VERSION)/unix
# Top-level directory in which to install manual entries:
MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
@@ -86,7 +88,7 @@
#CFLAGS = $(CFLAGS_DEBUG)
#CFLAGS = $(CFLAGS_OPTIMIZE)
#CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE)
-CFLAGS = @CFLAGS@
+CFLAGS? = @CFLAGS@
# To disable ANSI-C procedure prototypes reverse the comment characters
@@ -152,7 +154,7 @@
# "install" around; better to use the install-sh script that comes
# with the distribution, which is slower but guaranteed to work.
-INSTALL = @srcdir@/install-sh -c
+INSTALL = install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
@@ -226,7 +228,7 @@
${COMPILE_DEBUG_FLAGS} ${NO_DEPRECATED_FLAGS} ${ENV_FLAGS} \
-DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\"
-LIBS = @DL_LIBS@ @LIBS@ $(MATH_LIBS) -lc
+LIBS = @DL_LIBS@ @LIBS@ $(MATH_LIBS)
DEPEND_SWITCHES = ${CFLAGS} -I${GENERIC_DIR} -I${SRC_DIR} \
${AC_FLAGS} ${MATH_FLAGS} \
@@ -357,15 +359,21 @@
SRCS = $(GENERIC_SRCS) $(UNIX_SRCS)
-all: ${TCL_LIB_FILE} tclsh
+all: ${TCL_LIB_FILE} libtcl81.a tclsh
# The following target is configured by autoconf to generate either
# a shared library or non-shared library for Tcl.
${TCL_LIB_FILE}: ${OBJS}
rm -f ${TCL_LIB_FILE}
@MAKE_LIB@
+ ln -sf ${TCL_LIB_FILE} libtcl81.so
$(RANLIB) ${TCL_LIB_FILE}
+libtcl81.a: ${OBJS}
+ rm -f libtcl81.a
+ ar cr libtcl81.a ${OBJS}
+ $(RANLIB) libtcl81.a
+
# Make target which outputs the list of the .o contained in the Tcl lib
# usefull to build a single big shared library containing Tcl and other
# extensions. used for the Tcl Plugin. -- dl
@@ -379,7 +387,7 @@
tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE}
- ${CC} @LD_FLAGS@ ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
+ ${CC} -pthread @LD_FLAGS@ ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
@TCL_LD_SEARCH_FLAGS@ -o tclsh
tcltest: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${BUILD_DLTEST}
@@ -459,7 +467,7 @@
# some ranlibs write to current directory, and this might not always be
# possible (e.g. if installing as root).
-install-binaries: $(TCL_LIB_FILE) tclsh
+install-binaries: $(TCL_LIB_FILE) libtcl81.a tclsh
@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
do \
if [ ! -d $$i ] ; then \
@@ -469,18 +477,24 @@
else true; \
fi; \
done;
- @echo "Installing $(TCL_LIB_FILE)"
- @$(INSTALL_DATA) $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
- @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TCL_LIB_FILE))
- @chmod 555 $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
+ @echo "Installing libtcl81_r.so.1"
+ @$(INSTALL_DATA) $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/libtcl81_r.so.1
+ @ln -sf libtcl81_r.so.1 $(LIB_INSTALL_DIR)/libtcl81_r.so
+ @(cd $(LIB_INSTALL_DIR); $(RANLIB) libtcl81_r.so.1)
+ @chmod 555 $(LIB_INSTALL_DIR)/libtcl81_r.so.1
+ @echo "Installing libtcl81.a"
+ @$(INSTALL_DATA) libtcl81.a $(LIB_INSTALL_DIR)/libtcl81_r.a
+ @(cd $(LIB_INSTALL_DIR); $(RANLIB) libtcl81_r.a)
+ @chmod 555 $(LIB_INSTALL_DIR)/libtcl81_r.a
@echo "Installing tclsh"
- @$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION)
+ @$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION)_r
@echo "Installing tclConfig.sh"
- @$(INSTALL_DATA) tclConfig.sh $(LIB_INSTALL_DIR)/tclConfig.sh
+ @mkdir -p $(SCRIPT_INSTALL_DIR)
+ @$(INSTALL_DATA) tclConfig.sh $(SCRIPT_INSTALL_DIR)/tclConfig.sh
install-libraries:
- @for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
- $(SCRIPT_INSTALL_DIR); \
+ @for i in $(INSTALL_ROOT)$(prefix)/lib $(GENERIC_INCLUDE_INSTALL_DIR) \
+ $(UNIX_INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR); \
do \
if [ ! -d $$i ] ; then \
echo "Making directory $$i"; \
@@ -498,8 +512,15 @@
else true; \
fi; \
done;
- @echo "Installing tcl.h"
- @$(INSTALL_DATA) $(GENERIC_DIR)/tcl.h $(INCLUDE_INSTALL_DIR)/tcl.h
+ @echo "Installing libraries, tcl.h and other headers"
+ @for i in $(GENERIC_DIR)/*.h ; \
+ do \
+ echo "Installing $$i"; \
+ $(INSTALL_DATA) $$i $(GENERIC_INCLUDE_INSTALL_DIR); \
+ done;
+ @ln -sf $(GENERIC_INCLUDE_INSTALL_DIR)/tcl.h $(INCLUDE_INSTALL_DIR)/tcl.h
+ @echo "Installing $(TOP_DIR)unix/tclUnixPort.h"
+ @$(INSTALL_DATA) $(TOP_DIR)/unix/tclUnixPort.h $(UNIX_INCLUDE_INSTALL_DIR)
@for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tclAppInit.c $(UNIX_DIR)/ldAix; \
do \
echo "Installing $$i"; \
@@ -531,30 +552,37 @@
@cd $(TOP_DIR)/doc; for i in *.1; \
do \
echo "Installing doc/$$i"; \
- rm -f $(MAN1_INSTALL_DIR)/$$i; \
+ rm -f $(MAN1_INSTALL_DIR)/$$i $(MAN1_INSTALL_DIR)/$$i.gz ; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
- $$i > $(MAN1_INSTALL_DIR)/$$i; \
- chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
+ $$i | gzip -c > $(MAN1_INSTALL_DIR)/$$i.gz; \
+ chmod 444 $(MAN1_INSTALL_DIR)/$$i.gz; \
done;
$(UNIX_DIR)/mkLinks $(MAN1_INSTALL_DIR)
@cd $(TOP_DIR)/doc; for i in *.3; \
do \
echo "Installing doc/$$i"; \
- rm -f $(MAN3_INSTALL_DIR)/$$i; \
+ rm -f $(MAN3_INSTALL_DIR)/$$i $(MAN3_INSTALL_DIR)/$$i.gz ; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
- $$i > $(MAN3_INSTALL_DIR)/$$i; \
- chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
+ $$i | gzip -c > $(MAN3_INSTALL_DIR)/$$i.gz; \
+ chmod 444 $(MAN3_INSTALL_DIR)/$$i.gz; \
done;
$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
@cd $(TOP_DIR)/doc; for i in *.n; \
do \
echo "Installing doc/$$i"; \
- rm -f $(MANN_INSTALL_DIR)/$$i; \
+ rm -f $(MANN_INSTALL_DIR)/$$i $(MANN_INSTALL_DIR)/$$i.gz; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
- $$i > $(MANN_INSTALL_DIR)/$$i; \
- chmod 444 $(MANN_INSTALL_DIR)/$$i; \
+ $$i | gzip -c > $(MANN_INSTALL_DIR)/$$i.gz; \
+ chmod 444 $(MANN_INSTALL_DIR)/$$i.gz; \
done;
$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR)
+ @echo "**********"
+ @echo "IMPORTANT:"
+ @echo "**********"
+ @echo "tclConfig.sh in $(SCRIPT_INSTALL_DIR)/tclConfig.sh"
+ @echo "tcl.h in $(INCLUDE_INSTALL_DIR)/tcl.h"
+ @echo "There are NOT default place, but good place to avoid"
+ @echo "conflicting with another version of Tcl/Tks."
Makefile: $(UNIX_DIR)/Makefile.in
$(SHELL) config.status

View file

@ -0,0 +1,47 @@
--- configure.orig Fri Dec 11 18:36:14 1998
+++ configure Tue Jan 5 14:03:32 1999
@@ -756,7 +756,7 @@
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lpthread $LIBS"
+LDFLAGS="-pthread $LDFLAGS"
cat > conftest.$ac_ext <<EOF
#line 762 "configure"
#include "confdefs.h"
@@ -784,12 +784,11 @@
tcl_ok=yes
else
echo "$ac_t""no" 1>&6
-tcl_ok=no
+tcl_ok=yes
fi
if test "$tcl_ok" = "yes"; then
# The space is needed
- THREADS_LIBS=" -lpthread"
else
echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2
fi
@@ -4330,14 +4329,19 @@
echo "$ac_t""yes" 1>&6
SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_FLAGS=""
LD_SEARCH_FLAGS=""
- TCL_SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+ if eval "test \"`echo ${PORTOBJFORMAT}`\" = elf"; then
+ TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1'
+ SHLIB_LD="ld -shared -x -soname \$@"
+ else
+ TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0'
+ SHLIB_LD="ld -Bshareable -x"
+ fi
else
echo "$ac_t""no" 1>&6

View file

@ -0,0 +1,11 @@
--- tclUnixThrd.c.orig Tue Jan 5 14:17:19 1999
+++ tclUnixThrd.c Tue Jan 5 14:19:05 1999
@@ -109,7 +109,7 @@
pthread_attr_t attr;
pthread_attr_init(&attr);
- pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+ /* pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); */
if (pthread_create((pthread_t *)idPtr, &attr, (void * (*)())proc, (void *)clientData) < 0) {
return TCL_ERROR;
} else {

View file

@ -0,0 +1,11 @@
4. Threads. If configured with the --enable-threads flag, Tcl can
now be compiled for use in a multi-threaded application.
Individual threads are allowed to use one or more interpreters as
long as each interpreter (and any slave interpreters) is only
accessed by one thread. Each thread runs its own event loop, and
you can post events to other threads. There are new C APIs for
mutexes, condition variables, and thread local storage. See the
doc/Thread.3 manual entry for more details. Tk 8.1 is not yet
multi-thread safe. There is not yet support for tcl level use of
threading except for a test command. (Compile tcltest and try
testthread.)

View file

@ -0,0 +1,6 @@
This is Tcl8.1, an embeddable tool command language.
The best way to get started with Tcl is to read ``Tcl and the Tk
Toolkit'' by John K. Ousterhout, Addison-Wesley, ISBN 0-201-63337-X.
A full set of manual pages is also provided with this package.

113
lang/tcl81-thread/pkg-plist Normal file
View file

@ -0,0 +1,113 @@
bin/tclsh8.1_r
include/tcl8.1/generic/regcustom.h
include/tcl8.1/generic/regerrs.h
include/tcl8.1/generic/regex.h
include/tcl8.1/generic/regguts.h
include/tcl8.1/generic/tcl.h
include/tcl8.1/generic/tclCompile.h
include/tcl8.1/generic/tclInitScript.h
include/tcl8.1/generic/tclInt.h
include/tcl8.1/generic/tclMath.h
include/tcl8.1/generic/tclPort.h
include/tcl8.1/generic/tclRegexp.h
include/tcl8.1/unix/tclUnixPort.h
lib/libtcl81_r.a
lib/libtcl81_r.so.1
@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m %B
@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
lib/tcl8.1/auto.tcl
lib/tcl8.1/encoding/ascii.enc
lib/tcl8.1/encoding/big5.enc
lib/tcl8.1/encoding/cp1250.enc
lib/tcl8.1/encoding/cp1251.enc
lib/tcl8.1/encoding/cp1252.enc
lib/tcl8.1/encoding/cp1253.enc
lib/tcl8.1/encoding/cp1254.enc
lib/tcl8.1/encoding/cp1255.enc
lib/tcl8.1/encoding/cp1256.enc
lib/tcl8.1/encoding/cp1257.enc
lib/tcl8.1/encoding/cp1258.enc
lib/tcl8.1/encoding/cp437.enc
lib/tcl8.1/encoding/cp737.enc
lib/tcl8.1/encoding/cp775.enc
lib/tcl8.1/encoding/cp850.enc
lib/tcl8.1/encoding/cp852.enc
lib/tcl8.1/encoding/cp855.enc
lib/tcl8.1/encoding/cp857.enc
lib/tcl8.1/encoding/cp860.enc
lib/tcl8.1/encoding/cp861.enc
lib/tcl8.1/encoding/cp862.enc
lib/tcl8.1/encoding/cp863.enc
lib/tcl8.1/encoding/cp864.enc
lib/tcl8.1/encoding/cp865.enc
lib/tcl8.1/encoding/cp866.enc
lib/tcl8.1/encoding/cp869.enc
lib/tcl8.1/encoding/cp874.enc
lib/tcl8.1/encoding/cp932.enc
lib/tcl8.1/encoding/cp936.enc
lib/tcl8.1/encoding/cp949.enc
lib/tcl8.1/encoding/cp950.enc
lib/tcl8.1/encoding/dingbats.enc
lib/tcl8.1/encoding/euc-jp.enc
lib/tcl8.1/encoding/euc-kr.enc
lib/tcl8.1/encoding/gb12345.enc
lib/tcl8.1/encoding/gb1988.enc
lib/tcl8.1/encoding/gb2312.enc
lib/tcl8.1/encoding/iso2022-jp.enc
lib/tcl8.1/encoding/iso2022-kr.enc
lib/tcl8.1/encoding/iso2022.enc
lib/tcl8.1/encoding/iso8859-1.enc
lib/tcl8.1/encoding/iso8859-2.enc
lib/tcl8.1/encoding/iso8859-3.enc
lib/tcl8.1/encoding/iso8859-4.enc
lib/tcl8.1/encoding/iso8859-5.enc
lib/tcl8.1/encoding/iso8859-6.enc
lib/tcl8.1/encoding/iso8859-7.enc
lib/tcl8.1/encoding/iso8859-8.enc
lib/tcl8.1/encoding/iso8859-9.enc
lib/tcl8.1/encoding/jis0201.enc
lib/tcl8.1/encoding/jis0208.enc
lib/tcl8.1/encoding/jis0212.enc
lib/tcl8.1/encoding/ksc5601.enc
lib/tcl8.1/encoding/macCentEuro.enc
lib/tcl8.1/encoding/macCroatian.enc
lib/tcl8.1/encoding/macCyrillic.enc
lib/tcl8.1/encoding/macDingbats.enc
lib/tcl8.1/encoding/macGreek.enc
lib/tcl8.1/encoding/macIceland.enc
lib/tcl8.1/encoding/macJapan.enc
lib/tcl8.1/encoding/macRoman.enc
lib/tcl8.1/encoding/macRomania.enc
lib/tcl8.1/encoding/macThai.enc
lib/tcl8.1/encoding/macTurkish.enc
lib/tcl8.1/encoding/macUkraine.enc
lib/tcl8.1/encoding/shiftjis.enc
lib/tcl8.1/encoding/symbol.enc
lib/tcl8.1/history.tcl
lib/tcl8.1/http1.0/http.tcl
lib/tcl8.1/http1.0/pkgIndex.tcl
lib/tcl8.1/http2.0/http.tcl
lib/tcl8.1/http2.0/pkgIndex.tcl
lib/tcl8.1/init.tcl
lib/tcl8.1/ldAix
lib/tcl8.1/ldAout.tcl
lib/tcl8.1/msgcat1.0/msgcat.tcl
lib/tcl8.1/msgcat1.0/pkgIndex.tcl
lib/tcl8.1/opt0.4/optparse.tcl
lib/tcl8.1/opt0.4/pkgIndex.tcl
lib/tcl8.1/package.tcl
lib/tcl8.1/parray.tcl
lib/tcl8.1/safe.tcl
lib/tcl8.1/tclAppInit.c
lib/tcl8.1/tclConfig.sh
lib/tcl8.1/tclIndex
lib/tcl8.1/word.tcl
@dirrm lib/tcl8.1/opt0.4
@dirrm lib/tcl8.1/msgcat1.0
@dirrm lib/tcl8.1/http2.0
@dirrm lib/tcl8.1/http1.0
@dirrm lib/tcl8.1/encoding
@dirrm lib/tcl8.1
@dirrm include/tcl8.1/unix
@dirrm include/tcl8.1/generic
@dirrm include/tcl8.1