[PATCH] Introduced --with-gtk option for configure.ac
Jiri Vanek
jvanek at redhat.com
Mon May 14 04:22:07 PDT 2012
Hi!
This change have sense for me.
Few just formal things:
News file just one line should be enough and without x;):
+ - RH720836: project can be compiled against GTK+ 2.x or 3.x libraries
Make file have missing empty line between date-name and content.
Also there is habit to have mentioned each modified file with each modified procedure, so in your
case somenthing like:
2012-05-11 Peter Hatina<phatina at redhat.com>
Introduced configure option --with-gtk=2.0|3.0 to be able to compile
against different version of GTK+ (2.x or 3.x).
NEWS: mentioned bug
acinclude.m4: (GTK_SET_CXX_VARS) macro for setting gtk flags
(GTK_CHECK) macro for checking gtk version
But I'm no changelog x news guru so take my advice with reserves;)
Because I was looking over your shoulder during your patching, I do not feel 100% capable to review
the autotools code, So I have added dr Andrew (although he is moreover observer for ICEDTEA-WEB ;)
to check this for you.
Several things I have noticed:
There is help string [the GTK+ version to use (default: 2.0)])], But It looks like default is 3,
isn't it?
I also believe that for head default should be 3 (as you have it) But for 1.2 MAYBE 2?
Do I read it correctly taht if there is gtk specified, you check whether it exists and if not then
die quickly. If there is nothing set then yo check for three, two.. and die quickly?
I like it:)
in "invalid GTK+ version specified" this sentence the copy of input can be useful.
Also I have not found any regressions by using gtk3 instead of 2. But I must admit I have not tested
the change with epiphanyy/midory. Btw - do they need special place for plugins or are they enough
with mozilla-fylesystem?
Much more funny will be decisions for specfile changes....
Thanx for patch!
J.
ps, next time please changelog off-patch ;)
On 05/11/2012 12:24 PM, Peter Hatina wrote:
> Hi,
>
> I ran across a problem, that deals with GTK+ of different versions. IcedTeaPlugin
> is unusable in webkitgtk browsers, that are compiled against GTK+ 3.x. The issue
> can be solved by compiling IcedTeaPlugin with corrent GTK+. Current state of this
> plugin can be seen in eg. Fedora 16, 17 (browser epiphany can not use Java applets).
>
> Can you, please review my patch, that adds desired option for configure script,
> which sets up GTK+ compiler flags and libraries to correct version (2.x or 3.x)?
>
> Thank you in advance,
>
> cheers,
>
> Peter Hatina
> EMEA ENG-Desktop Development
> Red Hat Czech, Brno
>
> ---
> ChangeLog | 4 ++++
> NEWS | 2 ++
> acinclude.m4 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 59 insertions(+), 1 deletion(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 82c0feb..4cf3ebf 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2012-05-11 Peter Hatina<phatina at redhat.com>
> + Introduced configure option --with-gtk=2.0|3.0 to be able to compile
> + against different version of GTK+ (2.x or 3.x).
> +
> 2012-05-02 Jiri Vanek<jvanek at redhat.com>
>
> Introduced new annotations Bug (to connect test/reproducer with documentation)
> diff --git a/NEWS b/NEWS
> index 8397639..38dc1c0 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -16,6 +16,8 @@ New in release 1.3 (2012-XX-XX):
> - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass
> * Common
> - PR918: java applet windows uses a low resulution black/white icon
> +* GTK+ 2.0|3.0
> + - RHX720836: project can be compiled against GTK+ 2.x or 3.x libraries
>
> New in release 1.2 (2011-XX-XX):
> * Security updates:
> diff --git a/acinclude.m4 b/acinclude.m4
> index a330d0f..647f781 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -359,13 +359,65 @@ AC_ARG_ENABLE([plugin],
> AC_MSG_RESULT(${enable_plugin})
> ])
>
> +dnl GTK_CHECK_VERSION([gtk version], [ACTION-IF-FOUND], [ACTION-IF-NOT])
> +AC_DEFUN([GTK_CHECK_VERSION],
> +[
> + if pkg-config --modversion gtk+-$1&> /dev/null; then
> + $2
> + else
> + $3
> + fi
> +])
> +
> +dnl GTK_SET_CXX_VARS([gtk version])
> +AC_DEFUN([GTK_SET_CXX_VARS],
> +[
> + GTK_CFLAGS=`pkg-config --cflags gtk+-$1`
> + GTK_LIBS=`pkg-config --libs gtk+-$1`
> +])
> +
> +dnl GTK_CHECK([gtk version])
> +AC_DEFUN([GTK_CHECK],
> +[
> + AC_CACHE_CHECK([for GTK+], [gtk_cv_version],
> + [
> + case "$1" in
> + default)
> + GTK_CHECK_VERSION(["3.0"],
> + [echo -n "3.0"
> + GTK_SET_CXX_VARS(["3.0"])],
> + [GTK_CHECK_VERSION(["2.0"],
> + [echo -n "2.0"
> + GTK_SET_CXX_VARS(["2.0"])],
> + [AC_MSG_RESULT([no])
> + AC_MSG_ERROR([GTK+ not found])])])
> + ;;
> + *)
> + GTK_CHECK_VERSION([$1],
> + [echo -n "$1"
> + GTK_SET_CXX_VARS([$1])],
> + [AC_MSG_RESULT([no])
> + AC_MSG_ERROR([GTK+ $1 not found])])
> + ;;
> + esac
> + ])
> +])
> +
> AC_DEFUN_ONCE([IT_CHECK_PLUGIN_DEPENDENCIES],
> [
> dnl Check for plugin support headers and libraries.
> dnl FIXME: use unstable
> AC_REQUIRE([IT_CHECK_PLUGIN])
> if test "x${enable_plugin}" = "xyes" ; then
> - PKG_CHECK_MODULES(GTK, gtk+-2.0)
> + AC_ARG_WITH([gtk],
> + [AS_HELP_STRING([--with-gtk=2.0|3.0],
> + [the GTK+ version to use (default: 2.0)])],
> + [case "$with_gtk" in
> + 2.0|3.0) ;;
> + *) AC_MSG_ERROR([invalid GTK+ version specified]) ;;
> + esac],
> + [with_gtk=default])
> + GTK_CHECK([$with_gtk])
> PKG_CHECK_MODULES(GLIB, glib-2.0)
> AC_SUBST(GLIB_CFLAGS)
> AC_SUBST(GLIB_LIBS)
> -- 1.7.10.1
>
More information about the distro-pkg-dev
mailing list