Colin Rafferty wrote:
> I thought that I'd have a look at the external widget
feature.
> After a fair amount of debugging core dumps, I figured that you need
> to use -DXTHREADS if it was used for compiling libXt.
This is only the case if your X library is thread-safe.
Whatever. The point is that src/extw-Xt.c uses the (presumably
private) Xt function _XtWaitForSomething, which has either 7 or 8
arguments, depending upon whether libXt was compiled with -DXTHREADS.
> It would be useful if someone who understands autoconf better
than I
> do could figure out how to get the value of ProjectThreadsDefines from
> xmkmf and stick it in the compilation command for src/extw-Xt.c.
I don't know enough about the X installation to know what the right
thing to do is. I haven't installed X since 1990.
OK, that last suggestion was wrong. The logic of the Imake config
files is fairly convoluted, but basically:
In X11.tmpl:
ProjectThreadsDefines defaults to -DXTHREADS
In Threads.tmpl:
LocalThreadsDefines defaults to ProjectThreadsDefines
if LocalThreads is defined, THREADS_DEFINES is defined to include
LocalThreadsDefines
LocalThreads defaults to ThreadedProject
In X11.tmpl:
ThreadedProject defaults to ThreadedX
ThreadedX is defined according to HasPosixThreads or
HasCThreads, but most of the platform-specific config files
(e.g. linux.cf) define ThreadedX themselves
In Imake.tmpl:
The definition of ALLDEFINES includes $(THREADS_DEFINES)
/usr/src/xc/lib/Xt/Imakefile includes Threads.tmpl, so the presence or
absence of -DXTHREADS in the compilation of libXt would appear to be
determined by whether ThreadedX is defined (none of the other macros
listed above appear to be overriden by any other Imake configuration
files, or by the X Imakefiles).
I would guess at something like:
#include <Threads.tmpl>
#if ThreadedX
#define XTHREADS -DXTHREADS
#else
#define XTHREADS
#endif
test:
ļ¼ echo XTHREADS
But how does one get this into configure?
Alternatively, it may be simpler to just add a note to the PROBLEMS
file suggesting --cflags='... -DXTHREADS' if XEmacs segfaults in
_XtWaitForSomething when trying to control an external widget.
--
Glynn Clements <glynn(a)sensei.co.uk>