Ludwig Schwardt wrote: > Hi, > > Fernando wrote: > >> The code for this path detection is obviously rather convoluted and >> brittle, since there seems to be no clear API provided by Tk for this >> information, unfortunately. >> > > Michael wrote: > >> I know the Tcl/Tk header lookup mechanism is inherently complex. >> Could someone who knows what's going on there have a look? >> > > I last rewrote the Tcl/Tk detection routines, but did not touch > add_tk_flags(), which is definitely the grungy heart of this problem. > On that function I am unfortunately as clueless as the rest. > > Jon wrote: > >> I thought you are expected to pick up the correct include directories from >> the files tclConfig.sh and tkConfig.sh, which are found in the lib >> directory returned from your query_tcltk function? >> > > In response to Jon's comment: Many systems have broken t*Config.sh > scripts, for example way back on cygwin. My current Mac OS X 10.4.11 > installation has the following in tkConfig.sh: > > TK_PREFIX='/Users/andreask/dbn/lba/night/builds/macosx-ix86/out' > I take it andreask is not you? ;) That seems like a broken build of Tk and should be reported to the packager. Fortunately, the TK_PREFIX isn't really relevant. > Mmmm. So exclusive use of these files are also not an option... We > need to deduce the include dir from the library dir returned by the > tk.getvar() or tcl.getvar() calls in some robust(?) way. > Thanks for this background.
I don't know if that is possible -- on RHEL4: tcl_library: /usr/share/tcl8.4 TCL_INCLUDE_SPEC: /usr/include tclConfig.sh: /usr/lib/tclConfig.sh on Ubuntu 8.04: tcl_library: /usr/share/tcltk/tcl8.4 TCL_INCLUDE_SPEC: /usr/include/tcl8.4 tclConfig.sh: /usr/share/tcltk/tcl8.4/tclConfig.sh So, with these two examples, at least, the relative location of tcl_library and TCL_INCLUDE_SPEC is not fixed -- that is the assumption of the currently released code that falls down on Ubuntu 8.04. Notice that even the location of tclConfig.sh is not fixed, and my new code has to check both tcl_library and "/usr/lib". Unfortunately, Googling hasn't revealed the "right" way to do this, yet. It's a wonder that anything ever gets built against Tcl/Tk at all... ;) A note about my changes -- if using the tclConfig.sh fails to find a "tk.h" file, it falls back on the old way of working, which by all reports works for most people except on Ubuntu 8.04, so hopefully we're reasonably covered until the next cycle of distros comes along ;) Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel