Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Compile tcltk 8.3.4 on MacOSX

Closed / Wont Fix506393ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 24 years ago
Descriptionplain2002-01-21 11:27:33
I have tried to compile tcltk 8.3.4 on MacOSX 10.1.2.
I have encoutered the following problems.

(1) I have to add the following line to Makefile after
configure in order to compile.

@@ -372,7 +373,7 @@
 # a shared library or non-shared library for Tk.

 ${TK_LIB_FILE}: ${OBJS}

 rm -f ${TK_LIB_FILE}

-${SHLIB_LD} -o $@ ${OBJS} $(TK_LD_SEARCH_FLAGS) 

-L$(TCL_BIN_DIR) $(TCL_STUB_LIB_FLAG) ${SHLIB_LD_LIBS}

+${SHLIB_LD} -o $@ ${OBJS} $(TK_LD_SEARCH_FLAGS)
-L$(TCL_BIN_DIR) $(TCL_STUB_LIB_FLAG) ${SHLIB_LD_LIBS}
-L/usr/X11R6/lib -lX11 -ltcl8.3
        $(RANLIB) ${TK_LIB_FILE}
(2)I could compile tcltk8.3.4 but there is still
warning as follows.

cc -pipe  tkAppInit.o
-L/Users/kcg/scratch/GNU/tk8.3.4/unix -ltk8.3 
-L/Users/kcg/scratch/GNU/tcl8.3.4/unix -ltcl8.3 
-L/usr/X11R6/lib -lX11   -lc  -o wish

/usr/bin/ld: warning multiple definitions of symbol
_dataKey
/Users/kcg/scratch/GNU/tk8.3.4/unix/libtk8.3.dylib(tkMain.o)
definition of _dataKey
/Users/kcg/scratch/GNU/tcl8.3.4/unix/libtcl8.3.dylib(tclMain.o)
definition of _dataKey

Is it OK?
das Ticket [506393ffff]: 1 change [History diff]2002-01-23 18:35:09
dasplain2002-01-23 18:35:10
Logged In: YES 
user_id=90580

this should really be a tktoolkit bug not tcl.

your point (2) is not a problem and your tk build is fine.

the source of the build problem is that to link the tk shared 
lib the Mac OS X linker (unlike other linkers) needs to link 
with the tcl shared or stub lib.

one relatively easy fix is to turn on USE_TCL_STUBS in 
configure.in, but for this to work some missing support in 
the tk buildsystem needs to be backported from 8.4

once this done (easy), Tk seems to works fine on OSX, is 
there another reason why USE_TCL_STUBS shouldn't be turned on 
in tk's configure.in for core-8-3-1-branch ?
dasplain2002-01-23 18:37:45
Logged In: YES 
user_id=90580

Jeff, can you help with the USE_TCL_STUBS issue above ?
hobbsplain2002-01-24 03:45:24
Logged In: YES 
user_id=72656

Oddly enough, this does seem to be multiply defined tsd 
items, but other compilers never cared as they aren't 
actually used outside the named files.  Normally these are 
declared static.  This isn't really a stubs issue, nor is 
it an issue for 8.4 as those keys have been removed in 
dgp's rewrite of the stdin handling routines.  I'll leave 
it to Daniel to determine whether he wants to fix this for 
the 8-3-1-branch for macs.
nobodyplain2002-01-24 13:07:02
Logged In: NO 

I have changed the configure.in  as follows.

------
--- configure.in.orig   Sat Oct 20 09:24:40 2001
+++ configure.in        Thu Jan 24 14:47:19 2002
@@ -352,8 +352,8 @@
     MAKE_LIB="\${SHLIB_LD} -o \[$]@ \${OBJS} \
$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \
${SHLIB_LD_LIBS}"
     RANLIB=":"
 
-#    TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
-    TCL_STUB_FLAGS=""
+    TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
+#    TCL_STUB_FLAGS=""
 else
     TK_SHLIB_CFLAGS=""
     TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}

------------------
However, I got same message.
Did I have any mistakes?

----
cc -pipe -prebind  tkAppInit.o \
        -L/Users/tawada/tmp/tk8.3.4/unix -ltk8.3 \
        -L/Users/tawada/tmp/tcl8.3.4/unix -ltcl8.3  -L/usr/X11R6/lib -lX11   -lc  -o wish
/usr/bin/ld: warning prebinding disabled because dependent library: libtk8.3.dylib 
is not prebound
/usr/bin/ld: warning multiple definitions of symbol _dataKey
/Users/tawada/tmp/tk8.3.4/unix/libtk8.3.dylib(tkMain.o) definition of _dataKey
/Users/tawada/tmp/tcl8.3.4/unix/libtcl8.3.dylib(tclMain.o) definition of _dataKey
nobodyplain2002-01-24 13:35:28
Logged In: NO 

(3) I have third problem on compiling tk8.3.4.
I would like to compile tcl and tk as a static library.

%./configure --disable-shared

However, I failed to compile.

cc -pipe -c -O3 -Wall -Wconversion -Wno-implicit-int -fno-common -I/Users/
tawada/tmp/tk8.3.4/unix -I/Users/tawada/tmp/tk8.3.4/unix/../generic -I/Users/
tawada/tmp/tk8.3.4/unix/../bitmaps -I/Users/tawada/tmp/tcl8.3.4/generic -I/usr/
X11R6/include -arch ppc -pipe  -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=
1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1 -
DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1 -DSTATIC_BUILD=
1      -DTCL_NO_DEPRECATED /Users/tawada/tmp/tk8.3.4/unix/tkAppInit.c
cc -pipe -prebind  tkAppInit.o \
        -L/Users/tawada/tmp/tk8.3.4/unix -ltk8.3 \
        -L/Users/tawada/tmp/tcl8.3.4/unix -ltcl8.3  -L/usr/X11R6/lib -lX11   -lc  -o wish
/usr/bin/ld: warning prebinding disabled because dependent library: /usr/X11R6/
lib/libX11.6.dylib is not prebound
/usr/bin/ld: Undefined symbols:
_Tcl_SetMainLoop
make: *** [wish] Error 1

Why?
I couldn't compile as a static on 8.3.4.
dasplain2002-01-25 09:15:22
Logged In: YES 
user_id=90580

I think you both misunderstood me... the dataKey _warning_ 
messages are not a problem at all and don't prevent the 
linker from succeeding. (neither do the prebind warnings, 
just ignore them)

what causes the link _errors_ is that the OSX linker needs to 
link with the tcl shared or stub lib to be able to link the 
tk shared lib.

my stab at a fix was to turn on stubs given that the 
makesystem already includes support for stubs in MAKE_LIB 
(albeit with some bits missing that can be backported from 
8.4 easily) 

given the user's (BTW, please login) failure to link 
statically, maybe linking to the tcl library itself is 
needed.

Jeff, in any case, is there a reason why stubs should not be 
turned on for Tk core-8-3-1-branch ?
hobbsplain2003-01-28 05:14:58
Logged In: YES 
user_id=72656

I see no reason not to allow it, but I no longer have a machine 
to check this stuff.  I also consider the 8.3 branch EOL.
dasplain2003-02-20 00:08:11
Logged In: YES 
user_id=90580

this is old, core-8-3-1-branch is EOL
Log in (anonymous is fine) to add a comment.