|
From: Allin C. <cot...@wf...> - 2014-06-20 16:53:10
|
On Fri, 20 Jun 2014, 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.
>
> 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?
Well, I'm not sure if this answers all cases, but what I have in mind is
as follows (where, e.g., "gtk2" means that gtk+-2.0 is available on the
host as revealed by pkg-config):
if user-says-prefer-gtk2
if gtk2 && wx-gtk2
use wx-gtk2
elif gtk3 && wx-gtk3
use wx-gtk3
endif
else
if gtk3 && wx-gtk3
use wx-gtk3
elif gtk2 && wx-gtk2
use wx-gtk2
endif
endif
Allin Cottrell
|