Alexander Hansen wrote:
> Jean-François Mertens wrote:
[]
> I've got a #include <sys/signal.h> line in /usr/include/signal.h on both
> of my systems (3.1 and 3.1.1).

The logic behind this bug is a little complicated. The result of the 
analysis below is that the culprit is...

   xquartz version >= 2.3.0.

My guess is therefore that on those machines where xdvi does not build, 
such a version of xquartz is installed. A possible workaround is 
described at the end of this message.

Here is the story:

The file /usr/include/sys/signal.h, which is needed for the definition 
of NSIG, is in fact included, but too early. Not from 
/usr/include/signal.h, but from /usr/include/sys/wait.h, included from 
/usr/include/stdlib.h. Then when /usr/include/signal.h tries to load it 
again, it is not read, because it protects itself from being included 
multiple times.

Normally the time when a header file is read shouldn't matter, but here 
it does: Both the definition of NSIG and its use are conditional, namely 
inside a

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || 
defined(_DARWIN_C_SOURCE))

clause. And between the time when /usr/include/sys/signal.h is loaded 
and when it is used, the conditions change: The file

/usr/include/X11/Xosdefs.h

is loaded, and in its xquartz (>=2.3.0) version, it contains the lines

#if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || 
defined(_POSIX_C_SOURCE)
#define _DARWIN_C_SOURCE
#endif

The final straw is that xdvi.h #defines _XOPEN_SOURCE before including 
<X11/Xosdefs.h>. Threfore _DARWIN_C_SOURCE is defined, therefore the #if 
clause is executed the second time, but not the first time.

The result of this analysis is that the culprit is the new version of 
<X11/Xosdefs.h>.

A workaround would be to define the variable _DARWIN_C_SOURCE on the 
compiler line. This will result in a repeated warning about a 
redefinition of this macro, but the compilation goes through. In the 
xdvi.info file, it suffices to have the line

SetCFLAGS: -O2 -D_DARWIN_C_SOURCE

-- 
Martin








-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to