|
From: Ethan A M. <sf...@us...> - 2014-06-19 20:41:28
|
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. > 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? > > 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. > > but that won't make the gtk3 build actually work, because we already > > know it doesn't report the correct set of libraries that are needed. > > The problem above is unrelated. Adding extra flags is slightly > different that preventing the user to even compile gnuplot (by adding > incompatible flags). > > > >> > 1037c1037,1038 > >> > < if expr ${WXWIDGETS_VERSION} \> 2.8 >/dev/null; then > >> > --- > >> >> if expr ${WXWIDGETS_VERSION} \> 2.8 >/dev/null && \ > >> >> ${WX_CONFIG} --basename | grep 'wx_gtk' >/dev/null 2>&1; then > >> > >> Yes, checking for wx_gtk should help, even though I believe that some > >> package (either gtk or wxwidgets) should suggest the proper flag. > > > > But that is exactly the problem! > > I'm not saying that this is ideal. Just saying that this is better > than the current situation where you add X11 unconditionally; it would > help to eliminate problems at least in the cases where wxWidgets is > not even based on GTK. > > (But then again it is probably a lot easier to add compiler flags than > to remove them.) > > > Yes, gtk and/or wxWidgets should declare what support libraries are > > required. That is what `wx-config --libs` is supposed to do. > > But it doesn't. > > I would ask the wxWidgets developers for advice. > > Mojca |