3 # Patch managed by http://www.holgerschurig.de/patcher.html
7 +++ TraceToolkit-0.9.6pre2/m4/gtk.m4
9 +# Configure paths for GTK+
10 +# Owen Taylor 97-11-3
12 +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
13 +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
15 +AC_DEFUN(AM_PATH_GTK,
17 +dnl Get the cflags and libraries from the gtk-config script
19 +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
20 + gtk_config_prefix="$withval", gtk_config_prefix="")
21 +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
22 + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
23 +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
24 + , enable_gtktest=yes)
30 + gtk_config_args="$gtk_config_args gthread"
35 + if test x$gtk_config_exec_prefix != x ; then
36 + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
37 + if test x${GTK_CONFIG+set} != xset ; then
38 + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
41 + if test x$gtk_config_prefix != x ; then
42 + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
43 + if test x${GTK_CONFIG+set} != xset ; then
44 + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
48 + AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
49 + min_gtk_version=ifelse([$1], ,0.99.7,$1)
50 + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
52 + if test "$GTK_CONFIG" = "no" ; then
55 + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
56 + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
57 + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
58 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
59 + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
60 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
61 + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
62 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
63 + if test "x$enable_gtktest" = "xyes" ; then
64 + ac_save_CFLAGS="$CFLAGS"
65 + ac_save_LIBS="$LIBS"
66 + CFLAGS="$CFLAGS $GTK_CFLAGS"
67 + LIBS="$GTK_LIBS $LIBS"
69 +dnl Now check if the installed GTK is sufficiently new. (Also sanity
70 +dnl checks the results of gtk-config to some extent
81 + int major, minor, micro;
84 + system ("touch conf.gtktest");
86 + /* HP/UX 9 (%@#!) writes to sscanf strings */
87 + tmp_version = g_strdup("$min_gtk_version");
88 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
89 + printf("%s, bad version string\n", "$min_gtk_version");
93 + if ((gtk_major_version != $gtk_config_major_version) ||
94 + (gtk_minor_version != $gtk_config_minor_version) ||
95 + (gtk_micro_version != $gtk_config_micro_version))
97 + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
98 + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
99 + gtk_major_version, gtk_minor_version, gtk_micro_version);
100 + printf ("*** was found! If gtk-config was correct, then it is best\n");
101 + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
102 + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
103 + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
104 + printf("*** required on your system.\n");
105 + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
106 + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
107 + printf("*** before re-running configure\n");
109 +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
110 + else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
111 + (gtk_minor_version != GTK_MINOR_VERSION) ||
112 + (gtk_micro_version != GTK_MICRO_VERSION))
114 + printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
115 + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
116 + printf("*** library (version %d.%d.%d)\n",
117 + gtk_major_version, gtk_minor_version, gtk_micro_version);
119 +#endif /* defined (GTK_MAJOR_VERSION) ... */
122 + if ((gtk_major_version > major) ||
123 + ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
124 + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
130 + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
131 + gtk_major_version, gtk_minor_version, gtk_micro_version);
132 + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
133 + major, minor, micro);
134 + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
136 + printf("*** If you have already installed a sufficiently new version, this error\n");
137 + printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
138 + printf("*** being found. The easiest way to fix this is to remove the old version\n");
139 + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
140 + printf("*** correct copy of gtk-config. (In this case, you will have to\n");
141 + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
142 + printf("*** so that the correct libraries are found at run-time))\n");
147 +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
148 + CFLAGS="$ac_save_CFLAGS"
149 + LIBS="$ac_save_LIBS"
152 + if test "x$no_gtk" = x ; then
154 + ifelse([$2], , :, [$2])
157 + if test "$GTK_CONFIG" = "no" ; then
158 + echo "*** The gtk-config script installed by GTK could not be found"
159 + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
160 + echo "*** your path, or set the GTK_CONFIG environment variable to the"
161 + echo "*** full path to gtk-config."
163 + if test -f conf.gtktest ; then
166 + echo "*** Could not run GTK test program, checking why..."
167 + CFLAGS="$CFLAGS $GTK_CFLAGS"
168 + LIBS="$LIBS $GTK_LIBS"
170 +#include <gtk/gtk.h>
172 +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
173 + [ echo "*** The test program compiled, but did not run. This usually means"
174 + echo "*** that the run-time linker is not finding GTK or finding the wrong"
175 + echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
176 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
177 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
178 + echo "*** is required on your system"
180 + echo "*** If you have an old version installed, it is best to remove it, although"
181 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
183 + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
184 + echo "*** came with the system with the command"
186 + echo "*** rpm --erase --nodeps gtk gtk-devel" ],
187 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
188 + echo "*** exact error that occured. This usually means GTK was incorrectly installed"
189 + echo "*** or that you have moved GTK since it was installed. In the latter case, you"
190 + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
191 + CFLAGS="$ac_save_CFLAGS"
192 + LIBS="$ac_save_LIBS"
197 + ifelse([$3], , :, [$3])
199 + AC_SUBST(GTK_CFLAGS)
204 +++ TraceToolkit-0.9.6pre2/m4/glib.m4
206 +# Configure paths for GLIB
207 +# Owen Taylor 97-11-3
209 +dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
210 +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
211 +dnl gthread is specified in MODULES, pass to glib-config
213 +AC_DEFUN(AM_PATH_GLIB,
215 +dnl Get the cflags and libraries from the glib-config script
217 +AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
218 + glib_config_prefix="$withval", glib_config_prefix="")
219 +AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
220 + glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
221 +AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
222 + , enable_glibtest=yes)
224 + if test x$glib_config_exec_prefix != x ; then
225 + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
226 + if test x${GLIB_CONFIG+set} != xset ; then
227 + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
230 + if test x$glib_config_prefix != x ; then
231 + glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
232 + if test x${GLIB_CONFIG+set} != xset ; then
233 + GLIB_CONFIG=$glib_config_prefix/bin/glib-config
241 + glib_config_args="$glib_config_args gmodule"
244 + glib_config_args="$glib_config_args gthread"
249 + AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
250 + min_glib_version=ifelse([$1], ,0.99.7,$1)
251 + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
253 + if test "$GLIB_CONFIG" = "no" ; then
256 + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
257 + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
258 + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
259 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
260 + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
261 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
262 + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
263 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
264 + if test "x$enable_glibtest" = "xyes" ; then
265 + ac_save_CFLAGS="$CFLAGS"
266 + ac_save_LIBS="$LIBS"
267 + CFLAGS="$CFLAGS $GLIB_CFLAGS"
268 + LIBS="$GLIB_LIBS $LIBS"
270 +dnl Now check if the installed GLIB is sufficiently new. (Also sanity
271 +dnl checks the results of glib-config to some extent
273 + rm -f conf.glibtest
282 + int major, minor, micro;
285 + system ("touch conf.glibtest");
287 + /* HP/UX 9 (%@#!) writes to sscanf strings */
288 + tmp_version = g_strdup("$min_glib_version");
289 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
290 + printf("%s, bad version string\n", "$min_glib_version");
294 + if ((glib_major_version != $glib_config_major_version) ||
295 + (glib_minor_version != $glib_config_minor_version) ||
296 + (glib_micro_version != $glib_config_micro_version))
298 + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
299 + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
300 + glib_major_version, glib_minor_version, glib_micro_version);
301 + printf ("*** was found! If glib-config was correct, then it is best\n");
302 + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
303 + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
304 + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
305 + printf("*** required on your system.\n");
306 + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
307 + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
308 + printf("*** before re-running configure\n");
310 + else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
311 + (glib_minor_version != GLIB_MINOR_VERSION) ||
312 + (glib_micro_version != GLIB_MICRO_VERSION))
314 + printf("*** GLIB header files (version %d.%d.%d) do not match\n",
315 + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
316 + printf("*** library (version %d.%d.%d)\n",
317 + glib_major_version, glib_minor_version, glib_micro_version);
321 + if ((glib_major_version > major) ||
322 + ((glib_major_version == major) && (glib_minor_version > minor)) ||
323 + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
329 + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
330 + glib_major_version, glib_minor_version, glib_micro_version);
331 + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
332 + major, minor, micro);
333 + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
335 + printf("*** If you have already installed a sufficiently new version, this error\n");
336 + printf("*** probably means that the wrong copy of the glib-config shell script is\n");
337 + printf("*** being found. The easiest way to fix this is to remove the old version\n");
338 + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
339 + printf("*** correct copy of glib-config. (In this case, you will have to\n");
340 + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
341 + printf("*** so that the correct libraries are found at run-time))\n");
346 +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
347 + CFLAGS="$ac_save_CFLAGS"
348 + LIBS="$ac_save_LIBS"
351 + if test "x$no_glib" = x ; then
353 + ifelse([$2], , :, [$2])
356 + if test "$GLIB_CONFIG" = "no" ; then
357 + echo "*** The glib-config script installed by GLIB could not be found"
358 + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
359 + echo "*** your path, or set the GLIB_CONFIG environment variable to the"
360 + echo "*** full path to glib-config."
362 + if test -f conf.glibtest ; then
365 + echo "*** Could not run GLIB test program, checking why..."
366 + CFLAGS="$CFLAGS $GLIB_CFLAGS"
367 + LIBS="$LIBS $GLIB_LIBS"
371 +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
372 + [ echo "*** The test program compiled, but did not run. This usually means"
373 + echo "*** that the run-time linker is not finding GLIB or finding the wrong"
374 + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
375 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
376 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
377 + echo "*** is required on your system"
379 + echo "*** If you have an old version installed, it is best to remove it, although"
380 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
382 + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
383 + echo "*** came with the system with the command"
385 + echo "*** rpm --erase --nodeps gtk gtk-devel" ],
386 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
387 + echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
388 + echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
389 + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
390 + CFLAGS="$ac_save_CFLAGS"
391 + LIBS="$ac_save_LIBS"
396 + ifelse([$3], , :, [$3])
398 + AC_SUBST(GLIB_CFLAGS)
399 + AC_SUBST(GLIB_LIBS)
400 + rm -f conf.glibtest