|
From: Mojca M. <moj...@gm...> - 2016-01-04 10:53:44
|
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.
(I can move the ticket to the gnuplot tracker, but I maybe some
autoconf or GTK guru could help a bit.)
Mojca
|
|
From: Ethan A M. <sf...@us...> - 2016-01-04 20:32:21
|
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. 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. 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? Ethan > > (I can move the ticket to the gnuplot tracker, but I maybe some > autoconf or GTK guru could help a bit.) > > Mojca > > ------------------------------------------------------------------------------ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta |
|
From: Mojca M. <moj...@gm...> - 2016-01-04 20:58:44
|
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". (Please note that it is *possible* to build wxWidgets against GTK2, it just isn't the default configuration and it would rarely be used under any normal circumstances. We use it for software that didn't bother switching to wxWidgets 3.0 yet because wxWidgets 2.8 doesn't work natively on modern versions of OS X. So you should generally not use "if this is OS X", but rather check if "--query-toolkit" would return gtk2.) Mojca |
|
From: Ethan A M. <sf...@us...> - 2016-01-04 21:43:45
|
On Monday, 04 January, 2016 21:58:36 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). Hmm. As it turns out, it doesn't work for me with current GTK2 either unless I enable deprecated API components. My build script always disables raise-console, so I never noticed this before. When I enable raise-console I get: wxterminal/wxt_gui.cpp:1537:51: error: ‘gdk_window_foreign_new’ was not declared in this scope wxterminal/wxt_gui.cpp:3170:48: error: ‘GtkWidget’ has no member named ‘window’ wxterminal/wxt_gui.cpp:3183:47: error: ‘GtkWidget’ has no member named ‘window’ Those API components must have been deprecated at some point during the gtk2 release series. I'll look into it. Ethan > > > 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". > > (Please note that it is *possible* to build wxWidgets against GTK2, it > just isn't the default configuration and it would rarely be used under > any normal circumstances. We use it for software that didn't bother > switching to wxWidgets 3.0 yet because wxWidgets 2.8 doesn't work > natively on modern versions of OS X. So you should generally not use > "if this is OS X", but rather check if "--query-toolkit" would return > gtk2.) > > Mojca > > ------------------------------------------------------------------------------ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta |
|
From: sfeam <sf...@us...> - 2016-01-05 05:04:10
Attachments:
configure_check_if_want_gtk.patch
|
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? Please try the attached patch for configure.ac Ethan > > (Please note that it is *possible* to build wxWidgets against GTK2, it > just isn't the default configuration and it would rarely be used under > any normal circumstances. We use it for software that didn't bother > switching to wxWidgets 3.0 yet because wxWidgets 2.8 doesn't work > natively on modern versions of OS X. So you should generally not use > "if this is OS X", but rather check if "--query-toolkit" would return > gtk2.) > > Mojca |
|
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 |