Tk Source Code

View Ticket
Login
Ticket UUID: 17f427c72855450297c378454a31cf37d8591975
Title: X11 collision name header if build with aqua for MacOSX
Type: Bug Version: trunk
Submitter: bouvier Created on: 2019-07-01 11:00:23
Subsystem: 99. Other Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2019-07-04 01:11:50
Resolution: None Closed By: nobody
    Closed on:
Description:
I don't know if it is really a bug from Tk and I didn't see any ticket about that so...

The problem might happen if you use x11 apps with MacOSX.

If we build with --enable-aqua,  Tk provides a local dir. named X11 with some headers whose the names might collide with the Xorg headers (X11/Xlib.h, X11/X.h for instance).

Typically, the X11 tk local dir is localized directly under the {prefix}/include. If we use "make install" you might erase X11 header from Xorg project.
That means that "downstream" (like pkgsrc for instance) cannot have on the same system X11 applications and Tcl/Tk installed with aqua build ;
 or even an user cannot have without more isolation have Tk with aqua build and X11.

I don't know if the local X11 headers change might have an impact to Tk C api application
but I tried to isolate them to "tk/X11" header in order to avoid a potential name collision.

I succeeded in compiling both X11 and aqua Tk project on macosx. I tried to compile some tiny C code and that seems ok.
Test are ok.

I didn't test more because I don't know if the problem and the patch are relevant.
User Comments: chrstphrchvz added on 2019-07-04 01:11:50:

I'm aware that Tk Aqua in MacPorts (tk +quartz) also has to work around this issue. Currently, …/include/X11/ is instead installed to …/include/X11_tk/, then anything using those headers is patched, e.g.

#include <X11/Xlib.h>

becomes

#include <X11_tk/Xlib.h>


Attachments: