|
From: Ethan A M. <sf...@us...> - 2014-06-20 16:56:09
|
On Friday, 20 June, 2014 09:59:17 Mojca Miklavec wrote: > On Fri, Jun 20, 2014 at 12:43 AM, Allin Cottrell wrote: > > On Thu, 19 Jun 2014, Ethan A Merritt wrote: > >> On Thursday, 19 June, 2014 22:27:46 Mojca Miklavec wrote: > >>> On Thu, Jun 19, 2014 at 9:31 PM, Ethan A Merritt > >> > >>>>> So please also check whether wxWidgets are using gtk2 or gtk3 before > >>>>> calling pkg-config to supply build flags. > >>>> > >>>> > >>>> That's a chicken-or-egg dilemma. > >>>> wx-config is supposed to tell us the version, but we need the version in > >>>> order to call the correct wx-config. > >>> > >>> > >>> I don't see any chicken here ;) > >>> > >>> Once gnuplot calls > >>> WX_CXXFLAGS="`$WX_CONFIG --cxxflags > >>> it already knows which $WX_CONFIG it is calling. > >>> > >>> The problematic line is only > >>> PKG_CHECK_MODULES(GTK, [gtk+-2.0], have_gtk=yes, have_gtk=no) > >>> > >>> Gnuplot should run > >>> "$WX_CONFIG" --basename | <grep something> > >>> before asking for gtk+-2.0. > >> > >> > >> On linux (at least on my machines) there are two different wx-configs, > >> one for wx2 and one for wx3. You need to pick up the version from > >> somewhere > >> before you even know which one to run. > > > > > > Running on Mac, Mojca may or may not realize that most, if not all, modern > > Linux distros pack both gtk2 and gtk3, > > Yes, I know that. I have both gtk2 and gtk3 installed myself (on a Mac). > > > and therefore both variants of > > wxWidgets may also be present. > > (Theoretically the number of wxWidgets installations is only limited > by the disk space.) So yes, I'm aware that one can have both gtk2 and > gtk3 installed. What I don't believe though is that any linux > distribution would ship two copies of wxWidgets30 distribution, once > compiled against GTK 2 and once compiled against GTK 3. Believe it or not as you choose, but the wxWidgets 3.0 package I have here doesn't make a choice between gtk2 and gtk3 until the application is compiled. You have to tell it which to use. > But for the sake of argument let's assume that a machine has all of > the following installed: > - wxWidgets 2.8 with GTK 2 > - wxWidgets 2.8 with GTK 3 (maybe that's not possible) > - wxWidgets 3.0 with GTK 2 > - wxWidgets 3.0 with GTK 3 > > Can you please write in pseudocode what exactly you mean / based on > what would you pick wxWidgets then and how? > > > Software that supports both variants must therefore establish a policy. The > > software that I work on, gretl, has chosen (bowing to the apparently > > inevitable) to make gtk3 the default, if available, but we have a configure > > option > > > > --enable-gtk2 > > > > Most users won't have to worry about this. If they only have gtk2, that will > > be used regardless; if they only have gtk3, that will be used regardless; if > > they have both, gtk3 will be used unless they apply this "enable" flag when > > configuring. > > In the ConTeXt of gnuplot this would translate to: > - if user has only wxWidgets 3.0, use 3.0 > - if user has only wxWidgets 2.8, use 2.8 > - if user has both, pick wxWidgets 3.0 > > Or what else exactly would you do with GTK versions? I don't think any of us can provide you with pseudo-code for how to make this work, because I don't think anyone has succeeded in getting wxWidgets3 (or gtk3?) to work on linux. I can tell you that on my test machine wxWidgets 3.0 + gtk3 fails to compile because of header conflicts. wxWidgets 3.0 + gtk2 compiles but gives errors at run time. FWIW the choice of gtk2 or gtk3 is determined by a compile-time flag. the wx headers check this flag and then do different things depending on which gtk version they are [trying to be] compatible with. So far as I can see the current state of wxt on linux is "wxWidgets 3.0 is not supported". That is unfortunate, since apparently Debian is planning to drop wxWidgets 2.8 and that means they will also drop the wxt version of gnuplot. Some quick but by no means definitive poking around in the Release Notes for wxWidgets 3.0 suggests to me that we would have to make significant changes to the wxt terminal in order to make it work. I don't think that's going to happen for version 5. The only mitigating factor may be that a bug-fix version of wxWidgets was released last week. I see 2 items listed that might possibly be relevant to our problems, but it could be quite a while before this new version actually appears in linux distro packages for testing. Ethan |