diff options
Diffstat (limited to 'src/patchsets/mico/9999/013_all_gtk-versions.patch')
-rw-r--r-- | src/patchsets/mico/9999/013_all_gtk-versions.patch | 143 |
1 files changed, 80 insertions, 63 deletions
diff --git a/src/patchsets/mico/9999/013_all_gtk-versions.patch b/src/patchsets/mico/9999/013_all_gtk-versions.patch index e795800d4d..26997089b7 100644 --- a/src/patchsets/mico/9999/013_all_gtk-versions.patch +++ b/src/patchsets/mico/9999/013_all_gtk-versions.patch @@ -1,54 +1,18 @@ ---- mico/configure.in -+++ mico/configure.in -@@ -152,8 +152,8 @@ - QTDIR=$withval, QTDIR="") - - AC_ARG_WITH(gtk, -- [ --with-gtk=gtkdir use GTK installed in gtkdir], -- GTKDIR=$withval, GTKDIR="") -+ [ --with-gtk=gtk-major use GTK major version, either 1, 2 or 3], -+ , with_gtk="no") - - AC_ARG_WITH(tcl, - [ --with-tcl=tcldir use TCL installed in tcldir], -@@ -1156,16 +1156,28 @@ - fi - - -+HAVE_GTK=no - AC_SUBST(HAVE_GTK) - --if test X"$GTKDIR" != X; then -- AM_PATH_GTK(,HAVE_GTK=yes, -- AC_MSG_WARN(cannot find gtk-config. GTK parts disabled) -- HAVE_GTK=no) --else -- HAVE_GTK=no -+if test "X$with_gtk" = Xyes -o "X$with_gtk" = X3; then -+ AC_LANG_C -+ AM_PATH_GTK_3_0(,HAVE_GTK=yes; with_gtk=3) -+ AC_LANG_CPLUSPLUS -+fi -+ -+if test "X$with_gtk" = Xyes -o "X$with_gtk" = X2; then -+ AC_LANG_C -+ AM_PATH_GTK_2_0(,HAVE_GTK=yes; with_gtk=2) -+ AC_LANG_CPLUSPLUS - fi - -+if test "X$with_gtk" = Xyes -o "X$with_gtk" = X1; then -+ AM_PATH_GTK(,HAVE_GTK=yes; with_gtk=1) -+fi -+ -+if test "X$with_gtk" != Xno && test "X$HAVE_GTK" = Xno; then -+ AC_MSG_WARN(cannot find any GTK+ version, GTK parts disabled) -+fi - - AC_SUBST(HAVE_TCL) - AC_SUBST(TCL_LIBS) ---- mico/aclocal.m4 -+++ mico/aclocal.m4 -@@ -878,3 +878,422 @@ +From 16e9586b3630174f8c27579dca9b974022110838 Mon Sep 17 00:00:00 2001 +From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> +Date: Tue, 21 May 2019 18:37:25 +0200 +Subject: [PATCH 12/19] check for gtk-3, gtk-2, gtk-1 in order + +--- + aclocal.m4 | 419 +++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.in | 28 +++- + 2 files changed, 439 insertions(+), 8 deletions(-) + +diff --git a/aclocal.m4 b/aclocal.m4 +index 485fcbf..c10653e 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -878,3 +878,422 @@ main () AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) @@ -58,11 +22,11 @@ +# Owen Taylor 1997-2001 + +dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -+dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, ++dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, +dnl pass to pkg-config +dnl +AC_DEFUN([AM_PATH_GTK_2_0], -+[dnl ++[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], @@ -72,7 +36,7 @@ + for module in . $4 + do + case "$module" in -+ gthread) ++ gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + esac @@ -135,7 +99,7 @@ +#include <stdio.h> +#include <stdlib.h> + -+int ++int +main () +{ + int major, minor, micro; @@ -154,7 +118,7 @@ + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { -+ printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", ++ printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); @@ -164,7 +128,7 @@ + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); -+ } ++ } + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) @@ -208,7 +172,7 @@ + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) -+ ifelse([$2], , :, [$2]) ++ ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$PKG_CONFIG" = "no" ; then @@ -256,11 +220,11 @@ +# Owen Taylor 1997-2001 + +dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -+dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, ++dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, +dnl pass to pkg-config +dnl +AC_DEFUN([AM_PATH_GTK_3_0], -+[dnl ++[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], @@ -333,7 +297,7 @@ +#include <stdio.h> +#include <stdlib.h> + -+int ++int +main () +{ + int major, minor, micro; @@ -352,7 +316,7 @@ + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { -+ printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", ++ printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); @@ -362,7 +326,7 @@ + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); -+ } ++ } + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) @@ -471,3 +435,56 @@ + ifelse([$3],,[:],[$3]) + fi +]) +diff --git a/configure.in b/configure.in +index 849ea35..727a51f 100644 +--- a/configure.in ++++ b/configure.in +@@ -152,8 +152,8 @@ AC_ARG_WITH(qt, + QTDIR=$withval, QTDIR="") + + AC_ARG_WITH(gtk, +- [ --with-gtk=gtkdir use GTK installed in gtkdir], +- GTKDIR=$withval, GTKDIR="") ++ [ --with-gtk=gtk-major use GTK major version, either 1, 2 or 3], ++ , with_gtk="no") + + AC_ARG_WITH(tcl, + [ --with-tcl=tcldir use TCL installed in tcldir], +@@ -1180,16 +1180,28 @@ else + fi + + ++HAVE_GTK=no + AC_SUBST(HAVE_GTK) + +-if test X"$GTKDIR" != X; then +- AM_PATH_GTK(,HAVE_GTK=yes, +- AC_MSG_WARN(cannot find gtk-config. GTK parts disabled) +- HAVE_GTK=no) +-else +- HAVE_GTK=no ++if test "X$with_gtk" = Xyes -o "X$with_gtk" = X3; then ++ AC_LANG_C ++ AM_PATH_GTK_3_0(,HAVE_GTK=yes; with_gtk=3) ++ AC_LANG_CPLUSPLUS ++fi ++ ++if test "X$with_gtk" = Xyes -o "X$with_gtk" = X2; then ++ AC_LANG_C ++ AM_PATH_GTK_2_0(,HAVE_GTK=yes; with_gtk=2) ++ AC_LANG_CPLUSPLUS + fi + ++if test "X$with_gtk" = Xyes -o "X$with_gtk" = X1; then ++ AM_PATH_GTK(,HAVE_GTK=yes; with_gtk=1) ++fi ++ ++if test "X$with_gtk" != Xno && test "X$HAVE_GTK" = Xno; then ++ AC_MSG_WARN(cannot find any GTK+ version, GTK parts disabled) ++fi + + AC_SUBST(HAVE_TCL) + AC_SUBST(TCL_LIBS) +-- +2.19.2 + |