Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-chemistry/coot/files: gtk.m4 glib.m4
Date: Sat, 06 Feb 2010 00:15:04
Message-Id: E1NdYKE-0001TP-7B@stork.gentoo.org
1 jlec 10/02/06 00:15:02
2
3 Added: gtk.m4 glib.m4
4 Log:
5 Version bump and removed old, broken ebuilds
6 (Portage version: 2.2_rc62/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 sci-chemistry/coot/files/gtk.m4
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/coot/files/gtk.m4?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/coot/files/gtk.m4?rev=1.1&content-type=text/plain
13
14 Index: gtk.m4
15 ===================================================================
16 # Configure paths for GTK+
17 # Owen Taylor 97-11-3
18 AC_DEFUN([GTK_AC_DIVERT_BEFORE_HELP],
19 [ifdef([m4_divert_text], [m4_divert_text([NOTICE],[$1])],
20 [ifdef([AC_DIVERT], [AC_DIVERT([NOTICE],[$1])],
21 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
22 $1
23 AC_DIVERT_POP()])])])
24 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
25 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
26 dnl
27 AC_DEFUN([AM_PATH_GTK],
28 [dnl
29 dnl Get the cflags and libraries from the gtk-config script
30 dnl
31 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
32 gtk_config_prefix="$withval", gtk_config_prefix="")
33 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
34 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
35 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
36 , enable_gtktest=yes)
37
38 for module in . $4
39 do
40 case "$module" in
41 gthread)
42 gtk_config_args="$gtk_config_args gthread"
43 ;;
44 esac
45 done
46
47 if test x$gtk_config_exec_prefix != x ; then
48 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
49 if test x${GTK_CONFIG+set} != xset ; then
50 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
51 fi
52 fi
53 if test x$gtk_config_prefix != x ; then
54 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
55 if test x${GTK_CONFIG+set} != xset ; then
56 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
57 fi
58 fi
59
60 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
61 min_gtk_version=ifelse([$1], ,0.99.7,$1)
62 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
63 no_gtk=""
64 if test "$GTK_CONFIG" = "no" ; then
65 no_gtk=yes
66 else
67 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
68 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
69 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
70 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
71 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
72 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
73 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
74 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
75 if test "x$enable_gtktest" = "xyes" ; then
76 ac_save_CFLAGS="$CFLAGS"
77 ac_save_LIBS="$LIBS"
78 CFLAGS="$CFLAGS $GTK_CFLAGS"
79 LIBS="$GTK_LIBS $LIBS"
80 dnl
81 dnl Now check if the installed GTK is sufficiently new. (Also sanity
82 dnl checks the results of gtk-config to some extent
83 dnl
84 rm -f conf.gtktest
85 AC_TRY_RUN([
86 #include <gtk/gtk.h>
87 #include <stdio.h>
88 #include <stdlib.h>
89
90 int
91 main ()
92 {
93 int major, minor, micro;
94 char *tmp_version;
95
96 system ("touch conf.gtktest");
97
98 /* HP/UX 9 (%@#!) writes to sscanf strings */
99 tmp_version = g_strdup("$min_gtk_version");
100 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
101 printf("%s, bad version string\n", "$min_gtk_version");
102 exit(1);
103 }
104
105 if ((gtk_major_version != $gtk_config_major_version) ||
106 (gtk_minor_version != $gtk_config_minor_version) ||
107 (gtk_micro_version != $gtk_config_micro_version))
108 {
109 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
110 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
111 gtk_major_version, gtk_minor_version, gtk_micro_version);
112 printf ("*** was found! If gtk-config was correct, then it is best\n");
113 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
114 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
115 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
116 printf("*** required on your system.\n");
117 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
118 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
119 printf("*** before re-running configure\n");
120 }
121 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
122 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
123 (gtk_minor_version != GTK_MINOR_VERSION) ||
124 (gtk_micro_version != GTK_MICRO_VERSION))
125 {
126 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
127 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
128 printf("*** library (version %d.%d.%d)\n",
129 gtk_major_version, gtk_minor_version, gtk_micro_version);
130 }
131 #endif /* defined (GTK_MAJOR_VERSION) ... */
132 else
133 {
134 if ((gtk_major_version > major) ||
135 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
136 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
137 {
138 return 0;
139 }
140 else
141 {
142 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
143 gtk_major_version, gtk_minor_version, gtk_micro_version);
144 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
145 major, minor, micro);
146 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
147 printf("***\n");
148 printf("*** If you have already installed a sufficiently new version, this error\n");
149 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
150 printf("*** being found. The easiest way to fix this is to remove the old version\n");
151 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
152 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
153 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
154 printf("*** so that the correct libraries are found at run-time))\n");
155 }
156 }
157 return 1;
158 }
159 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
160 CFLAGS="$ac_save_CFLAGS"
161 LIBS="$ac_save_LIBS"
162 fi
163 fi
164 if test "x$no_gtk" = x ; then
165 AC_MSG_RESULT(yes)
166 ifelse([$2], , :, [$2])
167 else
168 AC_MSG_RESULT(no)
169 if test "$GTK_CONFIG" = "no" ; then
170 echo "*** The gtk-config script installed by GTK could not be found"
171 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
172 echo "*** your path, or set the GTK_CONFIG environment variable to the"
173 echo "*** full path to gtk-config."
174 else
175 if test -f conf.gtktest ; then
176 :
177 else
178 echo "*** Could not run GTK test program, checking why..."
179 CFLAGS="$CFLAGS $GTK_CFLAGS"
180 LIBS="$LIBS $GTK_LIBS"
181 AC_TRY_LINK([
182 #include <gtk/gtk.h>
183 #include <stdio.h>
184 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
185 [ echo "*** The test program compiled, but did not run. This usually means"
186 echo "*** that the run-time linker is not finding GTK or finding the wrong"
187 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
188 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
189 echo "*** to the installed location Also, make sure you have run ldconfig if that"
190 echo "*** is required on your system"
191 echo "***"
192 echo "*** If you have an old version installed, it is best to remove it, although"
193 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
194 echo "***"
195 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
196 echo "*** came with the system with the command"
197 echo "***"
198 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
199 [ echo "*** The test program failed to compile or link. See the file config.log for the"
200 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
201 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
202 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
203 CFLAGS="$ac_save_CFLAGS"
204 LIBS="$ac_save_LIBS"
205 fi
206 fi
207 GTK_CFLAGS=""
208 GTK_LIBS=""
209 ifelse([$3], , :, [$3])
210 fi
211 AC_SUBST(GTK_CFLAGS)
212 AC_SUBST(GTK_LIBS)
213 rm -f conf.gtktest
214 ])
215
216
217
218 1.1 sci-chemistry/coot/files/glib.m4
219
220 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/coot/files/glib.m4?rev=1.1&view=markup
221 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/coot/files/glib.m4?rev=1.1&content-type=text/plain
222
223 Index: glib.m4
224 ===================================================================
225 # Configure paths for GLIB
226 # Owen Taylor 97-11-3
227
228 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
229 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
230 dnl gthread is specified in MODULES, pass to glib-config
231 dnl
232 AC_DEFUN([AM_PATH_GLIB],
233 [dnl
234 dnl Get the cflags and libraries from the glib-config script
235 dnl
236 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
237 glib_config_prefix="$withval", glib_config_prefix="")
238 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
239 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
240 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
241 , enable_glibtest=yes)
242
243 if test x$glib_config_exec_prefix != x ; then
244 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
245 if test x${GLIB_CONFIG+set} != xset ; then
246 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
247 fi
248 fi
249 if test x$glib_config_prefix != x ; then
250 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
251 if test x${GLIB_CONFIG+set} != xset ; then
252 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
253 fi
254 fi
255
256 for module in . $4
257 do
258 case "$module" in
259 gmodule)
260 glib_config_args="$glib_config_args gmodule"
261 ;;
262 gthread)
263 glib_config_args="$glib_config_args gthread"
264 ;;
265 esac
266 done
267
268 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
269 min_glib_version=ifelse([$1], ,0.99.7,$1)
270 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
271 no_glib=""
272 if test "$GLIB_CONFIG" = "no" ; then
273 no_glib=yes
274 else
275 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
276 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
277 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
278 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
279 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
280 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
281 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
282 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
283 if test "x$enable_glibtest" = "xyes" ; then
284 ac_save_CFLAGS="$CFLAGS"
285 ac_save_LIBS="$LIBS"
286 CFLAGS="$CFLAGS $GLIB_CFLAGS"
287 LIBS="$GLIB_LIBS $LIBS"
288 dnl
289 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
290 dnl checks the results of glib-config to some extent
291 dnl
292 rm -f conf.glibtest
293 AC_TRY_RUN([
294 #include <glib.h>
295 #include <stdio.h>
296 #include <stdlib.h>
297
298 int
299 main ()
300 {
301 int major, minor, micro;
302 char *tmp_version;
303
304 system ("touch conf.glibtest");
305
306 /* HP/UX 9 (%@#!) writes to sscanf strings */
307 tmp_version = g_strdup("$min_glib_version");
308 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
309 printf("%s, bad version string\n", "$min_glib_version");
310 exit(1);
311 }
312
313 if ((glib_major_version != $glib_config_major_version) ||
314 (glib_minor_version != $glib_config_minor_version) ||
315 (glib_micro_version != $glib_config_micro_version))
316 {
317 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
318 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
319 glib_major_version, glib_minor_version, glib_micro_version);
320 printf ("*** was found! If glib-config was correct, then it is best\n");
321 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
322 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
323 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
324 printf("*** required on your system.\n");
325 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
326 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
327 printf("*** before re-running configure\n");
328 }
329 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
330 (glib_minor_version != GLIB_MINOR_VERSION) ||
331 (glib_micro_version != GLIB_MICRO_VERSION))
332 {
333 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
334 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
335 printf("*** library (version %d.%d.%d)\n",
336 glib_major_version, glib_minor_version, glib_micro_version);
337 }
338 else
339 {
340 if ((glib_major_version > major) ||
341 ((glib_major_version == major) && (glib_minor_version > minor)) ||
342 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
343 {
344 return 0;
345 }
346 else
347 {
348 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
349 glib_major_version, glib_minor_version, glib_micro_version);
350 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
351 major, minor, micro);
352 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
353 printf("***\n");
354 printf("*** If you have already installed a sufficiently new version, this error\n");
355 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
356 printf("*** being found. The easiest way to fix this is to remove the old version\n");
357 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
358 printf("*** correct copy of glib-config. (In this case, you will have to\n");
359 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
360 printf("*** so that the correct libraries are found at run-time))\n");
361 }
362 }
363 return 1;
364 }
365 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
366 CFLAGS="$ac_save_CFLAGS"
367 LIBS="$ac_save_LIBS"
368 fi
369 fi
370 if test "x$no_glib" = x ; then
371 AC_MSG_RESULT(yes)
372 ifelse([$2], , :, [$2])
373 else
374 AC_MSG_RESULT(no)
375 if test "$GLIB_CONFIG" = "no" ; then
376 echo "*** The glib-config script installed by GLIB could not be found"
377 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
378 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
379 echo "*** full path to glib-config."
380 else
381 if test -f conf.glibtest ; then
382 :
383 else
384 echo "*** Could not run GLIB test program, checking why..."
385 CFLAGS="$CFLAGS $GLIB_CFLAGS"
386 LIBS="$LIBS $GLIB_LIBS"
387 AC_TRY_LINK([
388 #include <glib.h>
389 #include <stdio.h>
390 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
391 [ echo "*** The test program compiled, but did not run. This usually means"
392 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
393 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
394 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
395 echo "*** to the installed location Also, make sure you have run ldconfig if that"
396 echo "*** is required on your system"
397 echo "***"
398 echo "*** If you have an old version installed, it is best to remove it, although"
399 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
400 echo "***"
401 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
402 echo "*** came with the system with the command"
403 echo "***"
404 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
405 [ echo "*** The test program failed to compile or link. See the file config.log for the"
406 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
407 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
408 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
409 CFLAGS="$ac_save_CFLAGS"
410 LIBS="$ac_save_LIBS"
411 fi
412 fi
413 GLIB_CFLAGS=""
414 GLIB_LIBS=""
415 ifelse([$3], , :, [$3])
416 fi
417 AC_SUBST(GLIB_CFLAGS)
418 AC_SUBST(GLIB_LIBS)
419 rm -f conf.glibtest
420 ])