Annotation of /trunk/imlib/patches/imlib-1.9.15-conditional-gtk1.patch
Parent Directory | Revision Log
Revision 972 -
(hide annotations)
(download)
Sat Jan 2 12:59:25 2010 UTC (14 years, 8 months ago) by niro
File size: 10595 byte(s)
Sat Jan 2 12:59:25 2010 UTC (14 years, 8 months ago) by niro
File size: 10595 byte(s)
-add missing gtk1-m4 file to the patch
1 | niro | 972 | diff -Naur imlib-1.9.15/configure.in imlib-1.9.15-magellan/configure.in |
2 | --- imlib-1.9.15/configure.in 2004-09-23 03:13:45.000000000 +0200 | ||
3 | +++ imlib-1.9.15-magellan/configure.in 2010-01-02 14:16:32.000000000 +0100 | ||
4 | niro | 970 | @@ -17,11 +17,26 @@ |
5 | dnl incase it is broken for example. | ||
6 | AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]], echo $enable_shm, enable_shm="yes") | ||
7 | |||
8 | +AC_ARG_ENABLE(gdk, [ --enable-gdk enable gdk_imlib compilation [default=yes]],[ | ||
9 | + if test x$enableval = xyes; then | ||
10 | + disable_gdk="no" | ||
11 | + else | ||
12 | + disable_gdk="yes" | ||
13 | + fi],disable_gdk=no) | ||
14 | + | ||
15 | +if test x$disable_gdk = xno; then | ||
16 | + AC_MSG_RESULT(no) | ||
17 | + | ||
18 | AM_PATH_GTK(1.2.1,[ | ||
19 | GDK_IMLIB="gdk_imlib utils"],[ | ||
20 | GDK_IMLIB="" | ||
21 | AC_MSG_WARN([*** gdk_imlib will not be built ***])]) | ||
22 | |||
23 | +else | ||
24 | + AC_MSG_RESULT(yes) | ||
25 | + GDK_IMLIB="" | ||
26 | +fi | ||
27 | + | ||
28 | AC_MSG_CHECKING(whether to build gmodulized imlib) | ||
29 | |||
30 | AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[ | ||
31 | niro | 972 | diff -Naur imlib-1.9.15/imlib-config.in imlib-1.9.15-magellan/imlib-config.in |
32 | --- imlib-1.9.15/imlib-config.in 2004-08-27 18:03:11.000000000 +0200 | ||
33 | +++ imlib-1.9.15-magellan/imlib-config.in 2010-01-02 14:16:32.000000000 +0100 | ||
34 | niro | 970 | @@ -46,15 +46,9 @@ |
35 | echo @VERSION@ | ||
36 | ;; | ||
37 | --cflags) | ||
38 | - if test @includedir@ != /usr/include ; then | ||
39 | - includes=-I@includedir@ | ||
40 | - fi | ||
41 | echo $includes @X_CFLAGS@ | ||
42 | ;; | ||
43 | --cflags-gdk) | ||
44 | - if test @includedir@ != /usr/include ; then | ||
45 | - includes=-I@includedir@ | ||
46 | - fi | ||
47 | echo `@GTK_CONFIG@ --cflags` $includes @X_CFLAGS@ | ||
48 | ;; | ||
49 | --libs) | ||
50 | niro | 972 | diff -Naur imlib-1.9.15/m4/gtk-1-for-imlib.m4 imlib-1.9.15-magellan/m4/gtk-1-for-imlib.m4 |
51 | --- imlib-1.9.15/m4/gtk-1-for-imlib.m4 1970-01-01 01:00:00.000000000 +0100 | ||
52 | +++ imlib-1.9.15-magellan/m4/gtk-1-for-imlib.m4 2010-01-02 14:17:08.000000000 +0100 | ||
53 | @@ -0,0 +1,199 @@ | ||
54 | +# Configure paths for GTK+ | ||
55 | +# Owen Taylor 97-11-3 | ||
56 | +AC_DEFUN([GTK_AC_DIVERT_BEFORE_HELP], | ||
57 | +[ifdef([m4_divert_text], [m4_divert_text([NOTICE],[$1])], | ||
58 | + [ifdef([AC_DIVERT], [AC_DIVERT([NOTICE],[$1])], | ||
59 | + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl | ||
60 | +$1 | ||
61 | +AC_DIVERT_POP()])])]) | ||
62 | +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | ||
63 | +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS | ||
64 | +dnl | ||
65 | +AC_DEFUN([AM_PATH_GTK], | ||
66 | +[dnl | ||
67 | +dnl Get the cflags and libraries from the gtk-config script | ||
68 | +dnl | ||
69 | +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], | ||
70 | + gtk_config_prefix="$withval", gtk_config_prefix="") | ||
71 | +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], | ||
72 | + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") | ||
73 | +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], | ||
74 | + , enable_gtktest=yes) | ||
75 | + | ||
76 | + for module in . $4 | ||
77 | + do | ||
78 | + case "$module" in | ||
79 | + gthread) | ||
80 | + gtk_config_args="$gtk_config_args gthread" | ||
81 | + ;; | ||
82 | + esac | ||
83 | + done | ||
84 | + | ||
85 | + if test x$gtk_config_exec_prefix != x ; then | ||
86 | + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" | ||
87 | + if test x${GTK_CONFIG+set} != xset ; then | ||
88 | + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config | ||
89 | + fi | ||
90 | + fi | ||
91 | + if test x$gtk_config_prefix != x ; then | ||
92 | + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" | ||
93 | + if test x${GTK_CONFIG+set} != xset ; then | ||
94 | + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config | ||
95 | + fi | ||
96 | + fi | ||
97 | + | ||
98 | + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) | ||
99 | + min_gtk_version=ifelse([$1], ,0.99.7,$1) | ||
100 | + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) | ||
101 | + no_gtk="" | ||
102 | + if test "$GTK_CONFIG" = "no" ; then | ||
103 | + no_gtk=yes | ||
104 | + else | ||
105 | + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` | ||
106 | + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` | ||
107 | + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ | ||
108 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | ||
109 | + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ | ||
110 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | ||
111 | + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ | ||
112 | + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | ||
113 | + if test "x$enable_gtktest" = "xyes" ; then | ||
114 | + ac_save_CFLAGS="$CFLAGS" | ||
115 | + ac_save_LIBS="$LIBS" | ||
116 | + CFLAGS="$CFLAGS $GTK_CFLAGS" | ||
117 | + LIBS="$GTK_LIBS $LIBS" | ||
118 | +dnl | ||
119 | +dnl Now check if the installed GTK is sufficiently new. (Also sanity | ||
120 | +dnl checks the results of gtk-config to some extent | ||
121 | +dnl | ||
122 | + rm -f conf.gtktest | ||
123 | + AC_TRY_RUN([ | ||
124 | +#include <gtk/gtk.h> | ||
125 | +#include <stdio.h> | ||
126 | +#include <stdlib.h> | ||
127 | + | ||
128 | +int | ||
129 | +main () | ||
130 | +{ | ||
131 | + int major, minor, micro; | ||
132 | + char *tmp_version; | ||
133 | + | ||
134 | + system ("touch conf.gtktest"); | ||
135 | + | ||
136 | + /* HP/UX 9 (%@#!) writes to sscanf strings */ | ||
137 | + tmp_version = g_strdup("$min_gtk_version"); | ||
138 | + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | ||
139 | + printf("%s, bad version string\n", "$min_gtk_version"); | ||
140 | + exit(1); | ||
141 | + } | ||
142 | + | ||
143 | + if ((gtk_major_version != $gtk_config_major_version) || | ||
144 | + (gtk_minor_version != $gtk_config_minor_version) || | ||
145 | + (gtk_micro_version != $gtk_config_micro_version)) | ||
146 | + { | ||
147 | + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", | ||
148 | + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, | ||
149 | + gtk_major_version, gtk_minor_version, gtk_micro_version); | ||
150 | + printf ("*** was found! If gtk-config was correct, then it is best\n"); | ||
151 | + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); | ||
152 | + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | ||
153 | + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | ||
154 | + printf("*** required on your system.\n"); | ||
155 | + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); | ||
156 | + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); | ||
157 | + printf("*** before re-running configure\n"); | ||
158 | + } | ||
159 | +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) | ||
160 | + else if ((gtk_major_version != GTK_MAJOR_VERSION) || | ||
161 | + (gtk_minor_version != GTK_MINOR_VERSION) || | ||
162 | + (gtk_micro_version != GTK_MICRO_VERSION)) | ||
163 | + { | ||
164 | + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", | ||
165 | + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); | ||
166 | + printf("*** library (version %d.%d.%d)\n", | ||
167 | + gtk_major_version, gtk_minor_version, gtk_micro_version); | ||
168 | + } | ||
169 | +#endif /* defined (GTK_MAJOR_VERSION) ... */ | ||
170 | + else | ||
171 | + { | ||
172 | + if ((gtk_major_version > major) || | ||
173 | + ((gtk_major_version == major) && (gtk_minor_version > minor)) || | ||
174 | + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) | ||
175 | + { | ||
176 | + return 0; | ||
177 | + } | ||
178 | + else | ||
179 | + { | ||
180 | + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", | ||
181 | + gtk_major_version, gtk_minor_version, gtk_micro_version); | ||
182 | + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", | ||
183 | + major, minor, micro); | ||
184 | + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); | ||
185 | + printf("***\n"); | ||
186 | + printf("*** If you have already installed a sufficiently new version, this error\n"); | ||
187 | + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); | ||
188 | + printf("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
189 | + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); | ||
190 | + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); | ||
191 | + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | ||
192 | + printf("*** so that the correct libraries are found at run-time))\n"); | ||
193 | + } | ||
194 | + } | ||
195 | + return 1; | ||
196 | +} | ||
197 | +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
198 | + CFLAGS="$ac_save_CFLAGS" | ||
199 | + LIBS="$ac_save_LIBS" | ||
200 | + fi | ||
201 | + fi | ||
202 | + if test "x$no_gtk" = x ; then | ||
203 | + AC_MSG_RESULT(yes) | ||
204 | + ifelse([$2], , :, [$2]) | ||
205 | + else | ||
206 | + AC_MSG_RESULT(no) | ||
207 | + if test "$GTK_CONFIG" = "no" ; then | ||
208 | + echo "*** The gtk-config script installed by GTK could not be found" | ||
209 | + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" | ||
210 | + echo "*** your path, or set the GTK_CONFIG environment variable to the" | ||
211 | + echo "*** full path to gtk-config." | ||
212 | + else | ||
213 | + if test -f conf.gtktest ; then | ||
214 | + : | ||
215 | + else | ||
216 | + echo "*** Could not run GTK test program, checking why..." | ||
217 | + CFLAGS="$CFLAGS $GTK_CFLAGS" | ||
218 | + LIBS="$LIBS $GTK_LIBS" | ||
219 | + AC_TRY_LINK([ | ||
220 | +#include <gtk/gtk.h> | ||
221 | +#include <stdio.h> | ||
222 | +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], | ||
223 | + [ echo "*** The test program compiled, but did not run. This usually means" | ||
224 | + echo "*** that the run-time linker is not finding GTK or finding the wrong" | ||
225 | + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" | ||
226 | + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
227 | + echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
228 | + echo "*** is required on your system" | ||
229 | + echo "***" | ||
230 | + echo "*** If you have an old version installed, it is best to remove it, although" | ||
231 | + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" | ||
232 | + echo "***" | ||
233 | + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" | ||
234 | + echo "*** came with the system with the command" | ||
235 | + echo "***" | ||
236 | + echo "*** rpm --erase --nodeps gtk gtk-devel" ], | ||
237 | + [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
238 | + echo "*** exact error that occured. This usually means GTK was incorrectly installed" | ||
239 | + echo "*** or that you have moved GTK since it was installed. In the latter case, you" | ||
240 | + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) | ||
241 | + CFLAGS="$ac_save_CFLAGS" | ||
242 | + LIBS="$ac_save_LIBS" | ||
243 | + fi | ||
244 | + fi | ||
245 | + GTK_CFLAGS="" | ||
246 | + GTK_LIBS="" | ||
247 | + ifelse([$3], , :, [$3]) | ||
248 | + fi | ||
249 | + AC_SUBST(GTK_CFLAGS) | ||
250 | + AC_SUBST(GTK_LIBS) | ||
251 | + rm -f conf.gtktest | ||
252 | +]) |