aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-14 18:50:55 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-14 18:50:55 +0100
commitb5efc114ea3a6ad395c3330a290b01558703138d (patch)
treec5adccbeb5d7c4b4abb0c8605ea048d6409ce673
parenta635a010c4b57bfd0accbc0e47c50150da8ed9dd (diff)
downloadgnunet-gtk-b5efc114ea3a6ad395c3330a290b01558703138d.tar.gz
gnunet-gtk-b5efc114ea3a6ad395c3330a290b01558703138d.zip
add gtk 3.22 version check
-rw-r--r--README2
-rw-r--r--configure.ac7
-rw-r--r--m4/gtk-2.0.m4196
-rw-r--r--m4/gtk-3.0.m410
4 files changed, 10 insertions, 205 deletions
diff --git a/README b/README
index c35c86e0..87301ee3 100644
--- a/README
+++ b/README
@@ -9,7 +9,7 @@ $ export GNUNET_PREFIX=/usr/local/lib # or other directory of your choice
9$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/.. 9$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/..
10$ make install 10$ make install
11 11
12gnunet-gtk requires GTK 3.0.0 or higher and libgladeui-2 (i.e. 3.8 or 12gnunet-gtk requires GTK 3.22.0 or higher and libgladeui-2 (i.e. 3.8 or
133.10). glade-3.8 should be used to edit the UI. 133.10). glade-3.8 should be used to edit the UI.
14 14
15 15
diff --git a/configure.ac b/configure.ac
index 11f36996..4ccbb544 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
1# This file is part of GNUnet. 1# This file is part of GNUnet.
2# (C) 2001--2013 Christian Grothoff (and other contributing authors) 2# (C) 2001--2017 Christian Grothoff (and other contributing authors)
3# 3#
4# GNUnet is free software; you can redistribute it and/or modify 4# GNUnet is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published 5# it under the terms of the GNU General Public License as published
@@ -243,7 +243,9 @@ AC_SUBST(QR_LIBS)
243 243
244AC_MSG_CHECKING(for gtk) 244AC_MSG_CHECKING(for gtk)
245without_gtk=true 245without_gtk=true
246PKG_CHECK_MODULES([GTK], [gtk+-3.22]) 246PKG_CHECK_MODULES([GTK], [gtk+-3.0])
247
248AM_PATH_GTK_3_0([3.22.0],,AC_MSG_ERROR([gnunet-gtk requires GTK 3.22]))
247 249
248# test for libunique 250# test for libunique
249AC_ARG_WITH([libunique], AC_HELP_STRING([--without-libunique], [disable libunique])) 251AC_ARG_WITH([libunique], AC_HELP_STRING([--without-libunique], [disable libunique]))
@@ -258,7 +260,6 @@ LIBS="$LIBS $GTK_LIBS"
258AC_CHECK_HEADERS([glib.h gmodule.h gtk/gtk.h gdk/gdk.h],,AC_MSG_ERROR([gnunet-gtk requires GTK])) 260AC_CHECK_HEADERS([glib.h gmodule.h gtk/gtk.h gdk/gdk.h],,AC_MSG_ERROR([gnunet-gtk requires GTK]))
259 261
260 262
261
262# test for Glade 263# test for Glade
263glade=0 264glade=0
264lookin=${prefix} 265lookin=${prefix}
diff --git a/m4/gtk-2.0.m4 b/m4/gtk-2.0.m4
deleted file mode 100644
index 88596a96..00000000
--- a/m4/gtk-2.0.m4
+++ /dev/null
@@ -1,196 +0,0 @@
1# Configure paths for GTK+
2# Owen Taylor 1997-2001
3
4dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
5dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
6dnl pass to pkg-config
7dnl
8AC_DEFUN([AM_PATH_GTK_2_0],
9[dnl
10dnl Get the cflags and libraries from pkg-config
11dnl
12AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
13 , enable_gtktest=yes)
14
15 pkg_config_args=gtk+-2.0
16 for module in . $4
17 do
18 case "$module" in
19 gthread)
20 pkg_config_args="$pkg_config_args gthread-2.0"
21 ;;
22 esac
23 done
24
25 no_gtk=""
26
27 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
28
29 if test x$PKG_CONFIG != xno ; then
30 if pkg-config --atleast-pkgconfig-version 0.7 ; then
31 :
32 else
33 echo "*** pkg-config too old; version 0.7 or better required."
34 no_gtk=yes
35 PKG_CONFIG=no
36 fi
37 else
38 no_gtk=yes
39 fi
40
41 min_gtk_version=ifelse([$1], ,2.0.0,$1)
42 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
43
44 if test x$PKG_CONFIG != xno ; then
45 ## don't try to run the test against uninstalled libtool libs
46 if $PKG_CONFIG --uninstalled $pkg_config_args; then
47 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
48 enable_gtktest=no
49 fi
50
51 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
52 :
53 else
54 no_gtk=yes
55 fi
56 fi
57
58 if test x"$no_gtk" = x ; then
59 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
60 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
61 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
62 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
63 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
64 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
65 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
66 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
67 if test "x$enable_gtktest" = "xyes" ; then
68 ac_save_CFLAGS="$CFLAGS"
69 ac_save_LIBS="$LIBS"
70 CFLAGS="$CFLAGS $GTK_CFLAGS"
71 LIBS="$GTK_LIBS $LIBS"
72dnl
73dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
74dnl checks the results of pkg-config to some extent)
75dnl
76 rm -f conf.gtktest
77 AC_TRY_RUN([
78#include <gtk/gtk.h>
79#include <stdio.h>
80#include <stdlib.h>
81
82int
83main ()
84{
85 int major, minor, micro;
86 char *tmp_version;
87
88 fclose (fopen ("conf.gtktest", "w"));
89
90 /* HP/UX 9 (%@#!) writes to sscanf strings */
91 tmp_version = g_strdup("$min_gtk_version");
92 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
93 printf("%s, bad version string\n", "$min_gtk_version");
94 exit(1);
95 }
96
97 if ((gtk_major_version != $gtk_config_major_version) ||
98 (gtk_minor_version != $gtk_config_minor_version) ||
99 (gtk_micro_version != $gtk_config_micro_version))
100 {
101 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
102 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
103 gtk_major_version, gtk_minor_version, gtk_micro_version);
104 printf ("*** was found! If pkg-config was correct, then it is best\n");
105 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
106 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
107 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
108 printf("*** required on your system.\n");
109 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
110 printf("*** to point to the correct configuration files\n");
111 }
112 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
113 (gtk_minor_version != GTK_MINOR_VERSION) ||
114 (gtk_micro_version != GTK_MICRO_VERSION))
115 {
116 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
117 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
118 printf("*** library (version %d.%d.%d)\n",
119 gtk_major_version, gtk_minor_version, gtk_micro_version);
120 }
121 else
122 {
123 if ((gtk_major_version > major) ||
124 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
125 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
126 {
127 return 0;
128 }
129 else
130 {
131 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
132 gtk_major_version, gtk_minor_version, gtk_micro_version);
133 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
134 major, minor, micro);
135 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
136 printf("***\n");
137 printf("*** If you have already installed a sufficiently new version, this error\n");
138 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
139 printf("*** being found. The easiest way to fix this is to remove the old version\n");
140 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
141 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
142 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
143 printf("*** so that the correct libraries are found at run-time))\n");
144 }
145 }
146 return 1;
147}
148],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
149 CFLAGS="$ac_save_CFLAGS"
150 LIBS="$ac_save_LIBS"
151 fi
152 fi
153 if test "x$no_gtk" = x ; then
154 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
155 ifelse([$2], , :, [$2])
156 else
157 AC_MSG_RESULT(no)
158 if test "$PKG_CONFIG" = "no" ; then
159 echo "*** A new enough version of pkg-config was not found."
160 echo "*** See http://pkgconfig.sourceforge.net"
161 else
162 if test -f conf.gtktest ; then
163 :
164 else
165 echo "*** Could not run GTK+ test program, checking why..."
166 ac_save_CFLAGS="$CFLAGS"
167 ac_save_LIBS="$LIBS"
168 CFLAGS="$CFLAGS $GTK_CFLAGS"
169 LIBS="$LIBS $GTK_LIBS"
170 AC_TRY_LINK([
171#include <gtk/gtk.h>
172#include <stdio.h>
173], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
174 [ echo "*** The test program compiled, but did not run. This usually means"
175 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
176 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
177 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
178 echo "*** to the installed location Also, make sure you have run ldconfig if that"
179 echo "*** is required on your system"
180 echo "***"
181 echo "*** If you have an old version installed, it is best to remove it, although"
182 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
183 [ echo "*** The test program failed to compile or link. See the file config.log for the"
184 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
185 CFLAGS="$ac_save_CFLAGS"
186 LIBS="$ac_save_LIBS"
187 fi
188 fi
189 GTK_CFLAGS=""
190 GTK_LIBS=""
191 ifelse([$3], , :, [$3])
192 fi
193 AC_SUBST(GTK_CFLAGS)
194 AC_SUBST(GTK_LIBS)
195 rm -f conf.gtktest
196])
diff --git a/m4/gtk-3.0.m4 b/m4/gtk-3.0.m4
index 5238b434..e188bfbe 100644
--- a/m4/gtk-3.0.m4
+++ b/m4/gtk-3.0.m4
@@ -2,11 +2,11 @@
2# Owen Taylor 1997-2001 2# Owen Taylor 1997-2001
3 3
4dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) 4dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
5dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 5dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
6dnl pass to pkg-config 6dnl pass to pkg-config
7dnl 7dnl
8AC_DEFUN([AM_PATH_GTK_3_0], 8AC_DEFUN([AM_PATH_GTK_3_0],
9[dnl 9[dnl
10dnl Get the cflags and libraries from pkg-config 10dnl Get the cflags and libraries from pkg-config
11dnl 11dnl
12AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], 12AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
@@ -79,7 +79,7 @@ dnl
79#include <stdio.h> 79#include <stdio.h>
80#include <stdlib.h> 80#include <stdlib.h>
81 81
82int 82int
83main () 83main ()
84{ 84{
85 int major, minor, micro; 85 int major, minor, micro;
@@ -98,7 +98,7 @@ main ()
98 (gtk_minor_version != $gtk_config_minor_version) || 98 (gtk_minor_version != $gtk_config_minor_version) ||
99 (gtk_micro_version != $gtk_config_micro_version)) 99 (gtk_micro_version != $gtk_config_micro_version))
100 { 100 {
101 printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 101 printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
102 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, 102 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
103 gtk_major_version, gtk_minor_version, gtk_micro_version); 103 gtk_major_version, gtk_minor_version, gtk_micro_version);
104 printf ("*** was found! If pkg-config was correct, then it is best\n"); 104 printf ("*** was found! If pkg-config was correct, then it is best\n");
@@ -108,7 +108,7 @@ main ()
108 printf("*** required on your system.\n"); 108 printf("*** required on your system.\n");
109 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); 109 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
110 printf("*** to point to the correct configuration files\n"); 110 printf("*** to point to the correct configuration files\n");
111 } 111 }
112 else if ((gtk_major_version != GTK_MAJOR_VERSION) || 112 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
113 (gtk_minor_version != GTK_MINOR_VERSION) || 113 (gtk_minor_version != GTK_MINOR_VERSION) ||
114 (gtk_micro_version != GTK_MICRO_VERSION)) 114 (gtk_micro_version != GTK_MICRO_VERSION))