|
From: Mojca M. <moj...@gm...> - 2014-06-19 20:55:08
|
On Thu, Jun 19, 2014 at 10:36 PM, 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.
There are two issues here:
- picking up the right wxWidgets (wxWidgets 2.8 vs. wxWidgets 3.0)
- using the right GTK (GTK 2 or 3; if wxWidgets depends on GTK at all)
I don't know how you want to pick "the right" wxWidgets, but I prefer to use
--with-wx-config=/path/to/the/desired/wx/bin/wx-config
or
--with-wxdir=/path/to/the/desired/wx/bin
or in case of gnuplot (which has the argument name different from the
official one)
--with-wx=/path/to/the/desired/wx/bin
Then the wxWidgets version is set in stone.
>> Here's what FileZilla does for example:
>> http://svn.filezilla-project.org/filezilla/FileZilla3/trunk/configure.ac?view=markup
>>
>> if echo "`$WX_CONFIG_WITH_ARGS --basename`" | grep -i gtk2 >
>> /dev/null 2>&1; then
>> PKG_CHECK_MODULES(LIBGTK, gtk+-2.0,, [
>> AC_MSG_ERROR([gtk+-2.0 was not found ...])
>> ])
>> fi
>> if echo "`$WX_CONFIG_WITH_ARGS --basename`" | grep -i gtk3 >
>> /dev/null 2>&1; then
>> PKG_CHECK_MODULES(LIBGTK, gtk+-3.0,, [
>> AC_MSG_ERROR([gtk+-3.0 was not found ...])
>> ])
>> fi
>
> So what happens if both are installed?
This is not a question of what happens if both gtk 2 and 3 are
installed because that's easily the case.
But in the case above
`$WX_CONFIG_WITH_ARGS --basename`
one gets something like:
$ wx-config --basename
wx_gtk3u
I have both GTK 2 and GTK 3 installed, but --basename tells me that
wxWidgets requires GTK 3
With the code above you cannot get both
wx_gtk3u | grep gtk2
and
wx_gtk3u | grep gtk3
to return you the result. In the code above exactly one GTK version
will be asked for.
>> > I suppose we can add configuration options --with-gtk={ gtk2 | gtk3 }
>>
>> No, please don't. The user has zero influence on that and that is only
>> going to lead into problems. Gnuplot should automatically determine
>> whether wxWidgets are using GTK and if so, which version. wx-config
>> --basename return wx_gtk2* or wx_gtk3* ("*" can be different endings
>> based on other characteristics of the installation).
>
> There's your chicken.
I don't understand.
You can have
- wxWidgets 2.8 compiled against GTK 2 and
- wxWidgets 3.0 compiled against GTK 2
What exacly would --with-gtk=gtk3 do in that case? GTK 3 wouldn't work
with either.
Mojca
|