From: Mojca M. <moj...@gm...> - 2016-01-05 07:18:45
|
On 5 January 2016 at 06:03, sfeam <sf...@us...> wrote: > On Monday, 04 January 2016 09:58:36 PM Mojca Miklavec wrote: >> On 4 January 2016 at 21:30, Ethan A Merritt wrote: >> > On Monday, 04 January, 2016 11:53:37 Mojca Miklavec wrote: >> > >> >> Hi, >> >> >> >> I would like to ask for a bit of help with fixing some opportunistical >> >> linking against GTK+ when wxWidgets is used: >> >> https://trac.macports.org/ticket/50199 >> >> >> >> The problem is that as soon as pkg-config finds GTK+ version 2 on the >> >> system and if wxWidgets terminal is enabled, gnuplot links against >> >> GTK2 even if no GTK code is being used at all. And if wxWidgets uses >> >> GTK 3, compilation fails because gnuplot tries to call some functions >> >> that no longer exist in GTK 3. >> > >> > >> > >> > We've had this conversation before. >> >> I'm sorry, I missed that. >> >> > The answer to that latter issue (gdk_window_foreign_new not in gtk3) >> > is to configure with --disable-raise-console. Or if you could comment >> > out or remove that section of code just for wxt since it obviously isn't >> > going to work anyhow. >> >> I don't want to patch this (comment it out) just on MacPorts because >> MacPorts doesn't provide GTK-based wxWidgets inside gnuplot. >> >> But it would be wise to provide "universal" patch that doesn't attempt >> to use GTK 2 functions inside GTK 3 (I can try to help with that if >> needed). >> >> > As to OSX + wxwidgets not requiring gtk at all, I would be happy >> > to take a patch that sorted this out in the autoconf script. >> > I suppose it would test the output of >> > >> > wx-config --query-toolkit >> > >> > What does that return on OSX? >> >> I have three different installations of wxWidgets: >> - wxWidgets 3.0 built against Cocoa >> - wxWidgets 3.0 built against GTK 3 >> - wxWidgets 2.8 built against GTK 2 >> >> Here are the results: >> >> $ /path/to/wxWidgets/3.0/bin/wx-config --query-toolkit >> osx_cocoa >> $ /path/to/wxGTK/3.0/bin/wx-config --query-toolkit >> gtk3 >> $ /path/to/wxGTK/2.8/bin/wx-config --query-toolkit >> gtk2 >> >> I assume you should only accept "gtk2". > > Why? Do you know that gtk3 doesn't work? Because I get error: use of undeclared identifier 'gdk_window_foreign_new' when I use gtk3 (but you just said that you get the same problem with gtk2). > Please try the attached patch for configure.ac I'm confused. What about the fact that gdk_window_foreign_new() doesn't seem to work at all? Apart from that I like the first part of the patch with if test "${WX_TOOLKIT}" = gtk2 ; then but I don't like this test for gtk+-2.0: PKG_CHECK_MODULES(GTK, [gtk+-2.0], have_gtk=yes, have_gtk=no) even if gtk3 is known to be used. In my opinion it should be if test "${WX_TOOLKIT}" = gtk2 ; then PKG_CHECK_MODULES(GTK, [gtk+-2.0], ..., ...) AC_DEFINE(...) WX_CXXFLAGS=... WX_LIBS=... elif test "${WX_TOOLKIT}" = gtk3 ; then PKG_CHECK_MODULES(GTK, [gtk+-3.0], ..., ...) AC_DEFINE(...) WX_CXXFLAGS=... WX_LIBS=... fi Mojca |