1 |
578 |
markom |
This file contains a collection of notes that various people have
|
2 |
|
|
provided about porting Tcl to various machines and operating systems.
|
3 |
|
|
I don't have personal access to any of these machines, so I make
|
4 |
|
|
no guarantees that the notes are correct, complete, or up-to-date.
|
5 |
|
|
If you see the word "I" in any explanations, it refers to the person
|
6 |
|
|
who contributed the information, not to me; this means that I
|
7 |
|
|
probably can't answer any questions about any of this stuff. In
|
8 |
|
|
some cases, a person has volunteered to act as a contact point for
|
9 |
|
|
questions about porting Tcl to a particular machine; in these
|
10 |
|
|
cases the person's name and e-mail address are listed. I'm
|
11 |
|
|
interested in getting new porting information to add to the file;
|
12 |
|
|
please mail updates to "john.ousterhout@eng.sun.com".
|
13 |
|
|
|
14 |
|
|
This file reflects information provided for Tcl 7.4 and later releases (8.x).
|
15 |
|
|
If there is no information for your configuration in this file, check
|
16 |
|
|
the file "porting.old" too; it contains information that was
|
17 |
|
|
submitted for Tcl 7.3 and earlier releases, and some of that information
|
18 |
|
|
may still be valid.
|
19 |
|
|
|
20 |
|
|
A new porting database has recently become available on the Web at
|
21 |
|
|
the following URL:
|
22 |
|
|
http://www.sunlabs.com/cgi-bin/tcl/info.8.0
|
23 |
|
|
This page provides information about the platforms on which Tcl and
|
24 |
|
|
and Tk 8.0 have been compiled and what changes were needed to get Tcl
|
25 |
|
|
and Tk to compile. You can also add new entries to that database
|
26 |
|
|
when you install Tcl and Tk on a new platform. The Web database is
|
27 |
|
|
likely to be more up-to-date than this file.
|
28 |
|
|
|
29 |
|
|
sccsid = RCS: @(#) $Id: porting.notes,v 1.1.1.1 2002-01-16 10:25:37 markom Exp $
|
30 |
|
|
|
31 |
|
|
--------------------------------------------
|
32 |
|
|
Solaris, various versions
|
33 |
|
|
--------------------------------------------
|
34 |
|
|
|
35 |
|
|
1. If typing "make test" results in an error message saying that
|
36 |
|
|
there are no "*.test" files, or you get lots of globbing errors,
|
37 |
|
|
it's probably because your system doesn't have cc installed and
|
38 |
|
|
you used gcc. In order for this to work, you have to set your
|
39 |
|
|
CC environment variable to gcc and your CPP environment variable
|
40 |
|
|
to "gcc -E" before running the configure script.
|
41 |
|
|
|
42 |
|
|
2. Make sure that /usr/ucb is not in your PATH or LD_LIBRARY_PATH
|
43 |
|
|
environment variables; this will cause confusion between the new
|
44 |
|
|
Solaris libraries and older UCB versions (Tcl will expect one version
|
45 |
|
|
and get another).
|
46 |
|
|
|
47 |
|
|
3. There have been several reports of problems with the "glob" command.
|
48 |
|
|
So far these reports have all been for older versions of Tcl, but
|
49 |
|
|
if you run into problems, edit the Makefile after "configure" is
|
50 |
|
|
run and add "-DNO_DIRENT_H=1" to the definitions of DEFS. Do this
|
51 |
|
|
before compiling.
|
52 |
|
|
|
53 |
|
|
--------------------------------------------
|
54 |
|
|
SunOS 4 and potentially other OSes
|
55 |
|
|
--------------------------------------------
|
56 |
|
|
|
57 |
|
|
On systems where both getcwd(3) and getwd(3) exist, check the man
|
58 |
|
|
page and if getcwd, like on SunOS 4, uses popen to pwd(1)
|
59 |
|
|
add -DUSEGETWD to the flags CFLAGS so getwd will be used instead.
|
60 |
|
|
|
61 |
|
|
That is, change the CFLAGS = -O line so it reads
|
62 |
|
|
CFLAGS = -O -DUSEGETWD
|
63 |
|
|
|
64 |
|
|
--------------------------------------------
|
65 |
|
|
Linux, ELF, various versions/distributions
|
66 |
|
|
--------------------------------------------
|
67 |
|
|
|
68 |
|
|
If ./configure --enable-shared complains it can not do a shared
|
69 |
|
|
library you might have to make the following symbolic link:
|
70 |
|
|
ln -s /lib/libdl.so.1 /lib/libdl.so
|
71 |
|
|
then remove config.cache and re run configure.
|
72 |
|
|
|
73 |
|
|
--------------------------------------------
|
74 |
|
|
Pyramid DC/OSx SVr4, DC/OSx version 94c079
|
75 |
|
|
--------------------------------------------
|
76 |
|
|
|
77 |
|
|
Tcl seems to dump core in cmdinfo.test when compiled with the
|
78 |
|
|
optimiser turned on in TclEval which calls 'free'. To get around
|
79 |
|
|
this, turn the optimiser off.
|
80 |
|
|
|
81 |
|
|
--------------------------------------------
|
82 |
|
|
SGI machines, IRIX 5.2, 5.3, IRIX64 6.0.1
|
83 |
|
|
--------------------------------------------
|
84 |
|
|
|
85 |
|
|
1. If you compile with gcc-2.6.3 under some versions of IRIX (e.g.
|
86 |
|
|
4.0.5), DBL_MAX is defined too large for gcc and Tcl complains
|
87 |
|
|
about all floating-point values being too large to represent.
|
88 |
|
|
If this happens, redefining DBL_MAX to 9.99e299.
|
89 |
|
|
|
90 |
|
|
2. Add "-D_BSD_TIME" to CFLAGS in Makefile. This avoids type conflicts
|
91 |
|
|
in the prototype for the gettimeofday procedure.
|
92 |
|
|
|
93 |
|
|
2. If you're running under Irix 6.x and tclsh dumps core, try
|
94 |
|
|
removing -O from the CFLAGS in Makefile and recompiling; compiler
|
95 |
|
|
optimizations seem to cause problems on some machines.
|
96 |
|
|
|
97 |
|
|
--------------------------------------------
|
98 |
|
|
IBM RTs, AOS
|
99 |
|
|
--------------------------------------------
|
100 |
|
|
|
101 |
|
|
1. Steal fmod from 4.4BSD
|
102 |
|
|
2. Add a #define to tclExpr such that:
|
103 |
|
|
extern double fmod();
|
104 |
|
|
is defined conditionally on ibm032
|
105 |
|
|
|
106 |
|
|
--------------------------------------------
|
107 |
|
|
QNX 4.22
|
108 |
|
|
--------------------------------------------
|
109 |
|
|
|
110 |
|
|
tclPort.h
|
111 |
|
|
- commented out 2 lines containing #include
|
112 |
|
|
|
113 |
|
|
tcl.h
|
114 |
|
|
- changed #define VARARGS ()
|
115 |
|
|
- to #ifndef __QNX__
|
116 |
|
|
#define VARARGS ()
|
117 |
|
|
#else
|
118 |
|
|
#define VARARGS (void *, ...)
|
119 |
|
|
#endif
|
120 |
|
|
|
121 |
|
|
--------------------------------------------
|
122 |
|
|
Interactive UNIX
|
123 |
|
|
--------------------------------------------
|
124 |
|
|
|
125 |
|
|
Add the switch -Xp to LIBS in Makefile; otherwise strftime will not
|
126 |
|
|
be found when linking.
|
127 |
|
|
|
128 |
|
|
--------------------------------------------
|
129 |
|
|
Motorola SVR4 V4.2 (m88k)
|
130 |
|
|
--------------------------------------------
|
131 |
|
|
|
132 |
|
|
For Motorola Unix R40V4.2 (m88k architechure), use /usr/ucb/cc instead of
|
133 |
|
|
/usr/bin/cc. Otherwise, the compile will fail because of conflicts over
|
134 |
|
|
the gettimeofday() call.
|
135 |
|
|
|
136 |
|
|
Also, -DNO_DIRENT_H=1 is required for the "glob" command to work.
|
137 |
|
|
|
138 |
|
|
--------------------------------------------
|
139 |
|
|
NeXTSTEP 3.x
|
140 |
|
|
--------------------------------------------
|
141 |
|
|
|
142 |
|
|
Here's the set of changes I made to make 7.5b3 compile cleanly on
|
143 |
|
|
NeXTSTEP3.x.
|
144 |
|
|
|
145 |
|
|
Here are a couple lines from unix/Makefile:
|
146 |
|
|
|
147 |
|
|
# Added utsname.o, which implements a uname() emulation for NeXTSTEP.
|
148 |
|
|
COMPAT_OBJS = getcwd.o strtod.o tmpnam.o utsname.o
|
149 |
|
|
|
150 |
|
|
TCL_NAMES=\
|
151 |
|
|
-Dstrtod=tcl_strtod -Dtmpnam=tcl_tmpnam -Dgetcwd=tcl_getcwd \
|
152 |
|
|
-Dpanic=tcl_panic -Dmatherr=tcl_matherr \
|
153 |
|
|
-Duname=tcl_uname -Dutsname=tcl_utsname
|
154 |
|
|
|
155 |
|
|
# Added mode_t, pid_t, and O_NONBLOCK definitions.
|
156 |
|
|
AC_FLAGS = -DNO_DIRENT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1
|
157 |
|
|
-DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1
|
158 |
|
|
-DSTDC_HEADERS=1 -Dmode_t=int -Dpid_t=int -DO_NONBLOCK=O_NDELAY ${TCL_NAMES}
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
Here are diffs for other files. utsname.[hc] are a couple files I added
|
162 |
|
|
to compat/ I'm not clear whether that's where they legitimately belong
|
163 |
|
|
- I considered stashing them in tclLoadNext.c instead. The tclIO.c
|
164 |
|
|
change was a bug, I believe, which I reported on comp.lang.tcl and
|
165 |
|
|
has apparently been noted and fixed. The objc_loadModules() change
|
166 |
|
|
allows "load" to load object code containing Objective-C code in
|
167 |
|
|
addition to plain C code.
|
168 |
|
|
|
169 |
|
|
---
|
170 |
|
|
scott hess (WWW to "http://www.winternet.com/~shess/")
|
171 |
|
|
Work: 12550 Portland Avenue South #121, Burnsville, MN 55337 (612)895-1208
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
diff -rc tcl7.5b3.orig/compat/utsname.c tcl7.5b3/compat/utsname.c
|
175 |
|
|
*** tcl7.5b3.orig/compat/utsname.c Tue Apr 2 13:57:23 1996
|
176 |
|
|
--- tcl7.5b3/compat/utsname.c Mon Mar 18 11:05:54 1996
|
177 |
|
|
***************
|
178 |
|
|
*** 0 ****
|
179 |
|
|
--- 1,27 ----
|
180 |
|
|
+ /*
|
181 |
|
|
+ * utsname.c --
|
182 |
|
|
+ *
|
183 |
|
|
+ * This file is an emulation of the POSIX uname() function
|
184 |
|
|
+ * under NeXTSTEP 3.x.
|
185 |
|
|
+ *
|
186 |
|
|
+ */
|
187 |
|
|
+
|
188 |
|
|
|
189 |
|
|
+ #include "utsname.h"
|
190 |
|
|
+ #include
|
191 |
|
|
+ #include
|
192 |
|
|
+
|
193 |
|
|
|
194 |
|
|
+ int uname( struct utsname *name)
|
195 |
|
|
+ {
|
196 |
|
|
+ const NXArchInfo *arch;
|
197 |
|
|
+ if( gethostname( name->nodename, sizeof( name->nodename))==-1) {
|
198 |
|
|
+ return -1;
|
199 |
|
|
+ }
|
200 |
|
|
+ if( (arch=NXGetLocalArchInfo())==NULL) {
|
201 |
|
|
+ return -1;
|
202 |
|
|
+ }
|
203 |
|
|
+ strncpy( name->machine, arch->description, sizeof( name->machine));
|
204 |
|
|
+ strcpy( name->sysname, "NEXTSTEP");
|
205 |
|
|
+ strcpy( name->release, "0");
|
206 |
|
|
+ strcpy( name->version, "3");
|
207 |
|
|
+ return 0;
|
208 |
|
|
+ }
|
209 |
|
|
diff -rc tcl7.5b3.orig/compat/utsname.h tcl7.5b3/compat/utsname.h
|
210 |
|
|
*** tcl7.5b3.orig/compat/utsname.h Tue Apr 2 13:57:26 1996
|
211 |
|
|
--- tcl7.5b3/compat/utsname.h Mon Mar 18 10:34:05 1996
|
212 |
|
|
***************
|
213 |
|
|
*** 0 ****
|
214 |
|
|
--- 1,22 ----
|
215 |
|
|
+ /*
|
216 |
|
|
+ * utsname.h --
|
217 |
|
|
+ *
|
218 |
|
|
+ * This file is an emulation of the POSIX uname() function
|
219 |
|
|
+ * under NeXTSTEP.
|
220 |
|
|
+ *
|
221 |
|
|
+ */
|
222 |
|
|
+
|
223 |
|
|
|
224 |
|
|
+ #ifndef _UTSNAME
|
225 |
|
|
+ #define _UTSNAME
|
226 |
|
|
+
|
227 |
|
|
|
228 |
|
|
+ struct utsname {
|
229 |
|
|
+ char sysname[ 32];
|
230 |
|
|
+ char nodename[ 32];
|
231 |
|
|
+ char release[ 32];
|
232 |
|
|
+ char version[ 32];
|
233 |
|
|
+ char machine[ 32];
|
234 |
|
|
+ };
|
235 |
|
|
+
|
236 |
|
|
|
237 |
|
|
+ extern int uname( struct utsname *name);
|
238 |
|
|
+
|
239 |
|
|
|
240 |
|
|
+ #endif /* _UTSNAME */
|
241 |
|
|
diff -rc tcl7.5b3.orig/generic/tclIO.c tcl7.5b3/generic/tclIO.c
|
242 |
|
|
*** tcl7.5b3.orig/generic/tclIO.c Fri Mar 8 12:59:53 1996
|
243 |
|
|
--- tcl7.5b3/generic/tclIO.c Mon Mar 18 11:38:57 1996
|
244 |
|
|
***************
|
245 |
|
|
*** 2542,2548 ****
|
246 |
|
|
}
|
247 |
|
|
result = GetInput(chanPtr);
|
248 |
|
|
if (result != 0) {
|
249 |
|
|
! if (result == EWOULDBLOCK) {
|
250 |
|
|
chanPtr->flags |= CHANNEL_BLOCKED;
|
251 |
|
|
return copied;
|
252 |
|
|
}
|
253 |
|
|
--- 2542,2548 ----
|
254 |
|
|
}
|
255 |
|
|
result = GetInput(chanPtr);
|
256 |
|
|
if (result != 0) {
|
257 |
|
|
! if (result == EAGAIN) {
|
258 |
|
|
chanPtr->flags |= CHANNEL_BLOCKED;
|
259 |
|
|
return copied;
|
260 |
|
|
}
|
261 |
|
|
diff -rc tcl7.5b3.orig/unix/tclLoadNext.c tcl7.5b3/unix/tclLoadNext.c
|
262 |
|
|
*** tcl7.5b3.orig/unix/tclLoadNext.c Sat Feb 17 16:16:42 1996
|
263 |
|
|
--- tcl7.5b3/unix/tclLoadNext.c Mon Mar 18 10:02:36 1996
|
264 |
|
|
***************
|
265 |
|
|
*** 55,61 ****
|
266 |
|
|
char *files[]={fileName,NULL};
|
267 |
|
|
NXStream *errorStream=NXOpenMemory(0,0,NX_READWRITE);
|
268 |
|
|
|
269 |
|
|
|
270 |
|
|
! if(!rld_load(errorStream,&header,files,NULL)) {
|
271 |
|
|
NXGetMemoryBuffer(errorStream,&data,&len,&maxlen);
|
272 |
|
|
Tcl_AppendResult(interp,"couldn't load file \"",fileName,"\": ",data,NULL);
|
273 |
|
|
NXCloseMemory(errorStream,NX_FREEBUFFER);
|
274 |
|
|
--- 55,61 ----
|
275 |
|
|
char *files[]={fileName,NULL};
|
276 |
|
|
NXStream *errorStream=NXOpenMemory(0,0,NX_READWRITE);
|
277 |
|
|
|
278 |
|
|
|
279 |
|
|
! if(objc_loadModules(files,errorStream,NULL,&header,NULL)) {
|
280 |
|
|
NXGetMemoryBuffer(errorStream,&data,&len,&maxlen);
|
281 |
|
|
Tcl_AppendResult(interp,"couldn't load file \"",fileName,"\": ",data,NULL);
|
282 |
|
|
NXCloseMemory(errorStream,NX_FREEBUFFER);
|
283 |
|
|
diff -rc tcl7.5b3.orig/unix/tclUnixFile.c tcl7.5b3/unix/tclUnixFile.c
|
284 |
|
|
*** tcl7.5b3.orig/unix/tclUnixFile.c Thu Mar 7 18:16:34 1996
|
285 |
|
|
--- tcl7.5b3/unix/tclUnixFile.c Mon Mar 18 11:10:03 1996
|
286 |
|
|
***************
|
287 |
|
|
*** 31,37 ****
|
288 |
|
|
--- 31,41 ----
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
static int executableNameExitHandlerSet = 0;
|
292 |
|
|
|
293 |
|
|
|
294 |
|
|
+ #if NeXT
|
295 |
|
|
+ #define waitpid( p, s, o) wait4( p, s, o, NULL)
|
296 |
|
|
+ #else
|
297 |
|
|
extern pid_t waitpid _ANSI_ARGS_((pid_t pid, int *stat_loc, int options));
|
298 |
|
|
+ #endif
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
/*
|
302 |
|
|
* Static routines for this file:
|
303 |
|
|
diff -rc tcl7.5b3.orig/unix/tclUnixInit.c tcl7.5b3/unix/tclUnixInit.c
|
304 |
|
|
*** tcl7.5b3.orig/unix/tclUnixInit.c Sat Feb 17 16:16:39 1996
|
305 |
|
|
--- tcl7.5b3/unix/tclUnixInit.c Mon Mar 18 11:50:28 1996
|
306 |
|
|
***************
|
307 |
|
|
*** 14,20 ****
|
308 |
|
|
#include "tclInt.h"
|
309 |
|
|
#include "tclPort.h"
|
310 |
|
|
#ifndef NO_UNAME
|
311 |
|
|
! # include
|
312 |
|
|
#endif
|
313 |
|
|
#if defined(__FreeBSD__)
|
314 |
|
|
#include
|
315 |
|
|
--- 14,24 ----
|
316 |
|
|
#include "tclInt.h"
|
317 |
|
|
#include "tclPort.h"
|
318 |
|
|
#ifndef NO_UNAME
|
319 |
|
|
! # if NeXT
|
320 |
|
|
! # include "../compat/utsname.h"
|
321 |
|
|
! # else
|
322 |
|
|
! # include
|
323 |
|
|
! # endif
|
324 |
|
|
#endif
|
325 |
|
|
#if defined(__FreeBSD__)
|
326 |
|
|
#include
|
327 |
|
|
diff -rc tcl7.5b3.orig/unix/tclUnixPort.h tcl7.5b3/unix/tclUnixPort.h
|
328 |
|
|
*** tcl7.5b3.orig/unix/tclUnixPort.h Thu Mar 7 18:16:31 1996
|
329 |
|
|
--- tcl7.5b3/unix/tclUnixPort.h Mon Mar 18 11:53:14 1996
|
330 |
|
|
***************
|
331 |
|
|
*** 76,82 ****
|
332 |
|
|
*/
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
#include /* struct sockaddr, SOCK_STREAM, ... */
|
336 |
|
|
! #include /* uname system call. */
|
337 |
|
|
#include /* struct in_addr, struct sockaddr_in */
|
338 |
|
|
#include /* inet_ntoa() */
|
339 |
|
|
#include /* gethostbyname() */
|
340 |
|
|
--- 76,88 ----
|
341 |
|
|
*/
|
342 |
|
|
|
343 |
|
|
|
344 |
|
|
#include /* struct sockaddr, SOCK_STREAM, ... */
|
345 |
|
|
! #ifndef NO_UNAME
|
346 |
|
|
! # if NeXT
|
347 |
|
|
! # include "../compat/utsname.h"
|
348 |
|
|
! # else
|
349 |
|
|
! # include /* uname system call. */
|
350 |
|
|
! # endif
|
351 |
|
|
! #endif
|
352 |
|
|
#include /* struct in_addr, struct sockaddr_in */
|
353 |
|
|
#include /* inet_ntoa() */
|
354 |
|
|
#include /* gethostbyname() */
|
355 |
|
|
|
356 |
|
|
--------------------------------------------
|
357 |
|
|
SCO Unix 3.2.4 (ODT 3.0)
|
358 |
|
|
--------------------------------------------
|
359 |
|
|
|
360 |
|
|
The macro va_start in /usr/include/stdarg.h is incorrectly terminated by
|
361 |
|
|
a semi-colon. This causes compile of generic/tclBasic.c to fail. The
|
362 |
|
|
best solution is to edit the definition of va_start to remove the `;'.
|
363 |
|
|
This will fix this file for anything you want to compile. If you don't have
|
364 |
|
|
permission to edit /usr/include/stdarg.h in place, copy it to the tcl unix
|
365 |
|
|
directory and change it there.
|
366 |
|
|
|
367 |
|
|
Contact me directly if you have problems on SCO systems.
|
368 |
|
|
Mark Diekhans
|
369 |
|
|
|
370 |
|
|
--------------------------------------------
|
371 |
|
|
SCO Unix 3.2.5 (ODT 5.0)
|
372 |
|
|
--------------------------------------------
|
373 |
|
|
|
374 |
|
|
Expect failures from socket tests 2.9 and 3.1.
|
375 |
|
|
|
376 |
|
|
Contact me directly if you have problems on SCO systems.
|
377 |
|
|
Mark Diekhans
|
378 |
|
|
|
379 |
|
|
--------------------------------------------
|
380 |
|
|
Linux 1.2.13 (gcc 2.7.0, libc.so.5.0.9)
|
381 |
|
|
--------------------------------------------
|
382 |
|
|
|
383 |
|
|
Symptoms:
|
384 |
|
|
|
385 |
|
|
* Some extensions could not be loaded dynamically, most
|
386 |
|
|
prominently Blt 2.0
|
387 |
|
|
|
388 |
|
|
The given error message essentially said:
|
389 |
|
|
Could not resolve symbol '__eprintf'.
|
390 |
|
|
|
391 |
|
|
(This procedure is used by the macro 'assert')
|
392 |
|
|
|
393 |
|
|
Cause
|
394 |
|
|
|
395 |
|
|
* '__eprintf' is defined in 'libgcc.a', not 'libc.so.x.y'.
|
396 |
|
|
It is therefore impossible to load it dynamically.
|
397 |
|
|
|
398 |
|
|
* Neither tcl nor tk make use of 'assert', thereby
|
399 |
|
|
preventing a static linkage.
|
400 |
|
|
|
401 |
|
|
Workaround
|
402 |
|
|
|
403 |
|
|
* I included in 'tclAppInit.c' / 'tkAppInit.c'
|
404 |
|
|
and then executed 'assert (argc)' just before the call
|
405 |
|
|
to Tcl_Main / Tk_Main.
|
406 |
|
|
|
407 |
|
|
This forced the static linkage of '__eprintf' and
|
408 |
|
|
everything went fine from then on.
|
409 |
|
|
|
410 |
|
|
(Something like 'assert (1)', 'assert (a==a)' is not
|
411 |
|
|
sufficient, it will be optimized away).
|
412 |
|
|
|