Mercurial > pidgin
annotate acinclude.m4 @ 4563:d6491dc2b7b2
[gaim-migrate @ 4844]
Add a comment for the thing we add to acinclude.m4. This way, Paco-Paco
will stop randomly deleting it.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sun, 09 Feb 2003 19:08:07 +0000 |
| parents | 9df99116840a |
| children | 27354602734d |
| rev | line source |
|---|---|
| 3357 | 1 # Configure paths for GLIB |
| 2 # Owen Taylor 97-11-3 | |
| 3 | |
| 4 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | |
| 5 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or | |
| 6 dnl gthread is specified in MODULES, pass to glib-config | |
| 7 dnl | |
| 8 AC_DEFUN(AM_PATH_GLIB, | |
| 9 [dnl | |
| 10 dnl Get the cflags and libraries from the glib-config script | |
| 11 dnl | |
| 12 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], | |
| 13 glib_config_prefix="$withval", glib_config_prefix="") | |
| 14 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], | |
| 15 glib_config_exec_prefix="$withval", glib_config_exec_prefix="") | |
| 16 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], | |
| 17 , enable_glibtest=yes) | |
| 18 | |
| 19 if test x$glib_config_exec_prefix != x ; then | |
| 20 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" | |
| 21 if test x${GLIB_CONFIG+set} != xset ; then | |
| 22 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config | |
| 23 fi | |
| 24 fi | |
| 25 if test x$glib_config_prefix != x ; then | |
| 26 glib_config_args="$glib_config_args --prefix=$glib_config_prefix" | |
| 27 if test x${GLIB_CONFIG+set} != xset ; then | |
| 28 GLIB_CONFIG=$glib_config_prefix/bin/glib-config | |
| 29 fi | |
| 30 fi | |
| 31 | |
| 32 for module in . $4 | |
| 33 do | |
| 34 case "$module" in | |
| 35 gmodule) | |
| 36 glib_config_args="$glib_config_args gmodule" | |
| 37 ;; | |
| 38 gthread) | |
| 39 glib_config_args="$glib_config_args gthread" | |
| 40 ;; | |
| 41 esac | |
| 42 done | |
| 43 | |
| 44 AC_PATH_PROG(GLIB_CONFIG, glib-config, no) | |
| 45 min_glib_version=ifelse([$1], ,0.99.7,$1) | |
| 46 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) | |
| 47 no_glib="" | |
| 48 if test "$GLIB_CONFIG" = "no" ; then | |
| 49 no_glib=yes | |
| 50 else | |
| 51 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` | |
| 52 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` | |
| 53 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ | |
| 54 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
| 55 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ | |
| 56 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
| 57 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ | |
| 58 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
| 59 if test "x$enable_glibtest" = "xyes" ; then | |
| 60 ac_save_CFLAGS="$CFLAGS" | |
| 61 ac_save_LIBS="$LIBS" | |
| 62 CFLAGS="$CFLAGS $GLIB_CFLAGS" | |
| 63 LIBS="$GLIB_LIBS $LIBS" | |
| 64 dnl | |
| 65 dnl Now check if the installed GLIB is sufficiently new. (Also sanity | |
| 66 dnl checks the results of glib-config to some extent | |
| 67 dnl | |
| 68 rm -f conf.glibtest | |
| 69 AC_TRY_RUN([ | |
| 70 #include <glib.h> | |
| 71 #include <stdio.h> | |
| 72 #include <stdlib.h> | |
| 73 | |
| 74 int | |
| 75 main () | |
| 76 { | |
| 77 int major, minor, micro; | |
| 78 char *tmp_version; | |
| 79 | |
| 80 system ("touch conf.glibtest"); | |
| 81 | |
| 82 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
| 83 tmp_version = g_strdup("$min_glib_version"); | |
| 84 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
| 85 printf("%s, bad version string\n", "$min_glib_version"); | |
| 86 exit(1); | |
| 87 } | |
| 88 | |
| 89 if ((glib_major_version != $glib_config_major_version) || | |
| 90 (glib_minor_version != $glib_config_minor_version) || | |
| 91 (glib_micro_version != $glib_config_micro_version)) | |
| 92 { | |
| 93 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", | |
| 94 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, | |
| 95 glib_major_version, glib_minor_version, glib_micro_version); | |
| 96 printf ("*** was found! If glib-config was correct, then it is best\n"); | |
| 97 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); | |
| 98 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | |
| 99 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | |
| 100 printf("*** required on your system.\n"); | |
| 101 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); | |
| 102 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); | |
| 103 printf("*** before re-running configure\n"); | |
| 104 } | |
| 105 else if ((glib_major_version != GLIB_MAJOR_VERSION) || | |
| 106 (glib_minor_version != GLIB_MINOR_VERSION) || | |
| 107 (glib_micro_version != GLIB_MICRO_VERSION)) | |
| 108 { | |
| 109 printf("*** GLIB header files (version %d.%d.%d) do not match\n", | |
| 110 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); | |
| 111 printf("*** library (version %d.%d.%d)\n", | |
| 112 glib_major_version, glib_minor_version, glib_micro_version); | |
| 113 } | |
| 114 else | |
| 115 { | |
| 116 if ((glib_major_version > major) || | |
| 117 ((glib_major_version == major) && (glib_minor_version > minor)) || | |
| 118 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) | |
| 119 { | |
| 120 return 0; | |
| 121 } | |
| 122 else | |
| 123 { | |
| 124 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", | |
| 125 glib_major_version, glib_minor_version, glib_micro_version); | |
| 126 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", | |
| 127 major, minor, micro); | |
| 128 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); | |
| 129 printf("***\n"); | |
| 130 printf("*** If you have already installed a sufficiently new version, this error\n"); | |
| 131 printf("*** probably means that the wrong copy of the glib-config shell script is\n"); | |
| 132 printf("*** being found. The easiest way to fix this is to remove the old version\n"); | |
| 133 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); | |
| 134 printf("*** correct copy of glib-config. (In this case, you will have to\n"); | |
| 135 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | |
| 136 printf("*** so that the correct libraries are found at run-time))\n"); | |
| 137 } | |
| 138 } | |
| 139 return 1; | |
| 140 } | |
| 141 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
| 142 CFLAGS="$ac_save_CFLAGS" | |
| 143 LIBS="$ac_save_LIBS" | |
| 144 fi | |
| 145 fi | |
| 146 if test "x$no_glib" = x ; then | |
| 147 AC_MSG_RESULT(yes) | |
| 148 ifelse([$2], , :, [$2]) | |
| 149 else | |
| 150 AC_MSG_RESULT(no) | |
| 151 if test "$GLIB_CONFIG" = "no" ; then | |
| 152 echo "*** The glib-config script installed by GLIB could not be found" | |
| 153 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" | |
| 154 echo "*** your path, or set the GLIB_CONFIG environment variable to the" | |
| 155 echo "*** full path to glib-config." | |
| 156 else | |
| 157 if test -f conf.glibtest ; then | |
| 158 : | |
| 159 else | |
| 160 echo "*** Could not run GLIB test program, checking why..." | |
| 161 CFLAGS="$CFLAGS $GLIB_CFLAGS" | |
| 162 LIBS="$LIBS $GLIB_LIBS" | |
| 163 AC_TRY_LINK([ | |
| 164 #include <glib.h> | |
| 165 #include <stdio.h> | |
| 166 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], | |
| 167 [ echo "*** The test program compiled, but did not run. This usually means" | |
| 168 echo "*** that the run-time linker is not finding GLIB or finding the wrong" | |
| 169 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" | |
| 170 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
| 171 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
| 172 echo "*** is required on your system" | |
| 173 echo "***" | |
| 174 echo "*** If you have an old version installed, it is best to remove it, although" | |
| 175 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" | |
| 176 echo "***" | |
| 177 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" | |
| 178 echo "*** came with the system with the command" | |
| 179 echo "***" | |
| 180 echo "*** rpm --erase --nodeps gtk gtk-devel" ], | |
| 181 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
| 182 echo "*** exact error that occured. This usually means GLIB was incorrectly installed" | |
| 183 echo "*** or that you have moved GLIB since it was installed. In the latter case, you" | |
| 184 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) | |
| 185 CFLAGS="$ac_save_CFLAGS" | |
| 186 LIBS="$ac_save_LIBS" | |
| 187 fi | |
| 188 fi | |
| 189 GLIB_CFLAGS="" | |
| 190 GLIB_LIBS="" | |
| 191 ifelse([$3], , :, [$3]) | |
| 192 fi | |
| 193 AC_SUBST(GLIB_CFLAGS) | |
| 194 AC_SUBST(GLIB_LIBS) | |
| 195 rm -f conf.glibtest | |
| 196 ]) | |
| 197 # Configure paths for GTK+ | |
| 198 # Owen Taylor 97-11-3 | |
| 199 | |
| 200 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | |
| 201 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS | |
| 202 dnl | |
| 203 AC_DEFUN(AM_PATH_GTK, | |
| 204 [dnl | |
| 205 dnl Get the cflags and libraries from the gtk-config script | |
| 206 dnl | |
| 207 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], | |
| 208 gtk_config_prefix="$withval", gtk_config_prefix="") | |
| 209 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], | |
| 210 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") | |
| 211 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], | |
| 212 , enable_gtktest=yes) | |
| 213 | |
| 214 for module in . $4 | |
| 215 do | |
| 216 case "$module" in | |
| 217 gthread) | |
| 218 gtk_config_args="$gtk_config_args gthread" | |
| 219 ;; | |
| 220 esac | |
| 221 done | |
| 222 | |
| 223 if test x$gtk_config_exec_prefix != x ; then | |
| 224 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" | |
| 225 if test x${GTK_CONFIG+set} != xset ; then | |
| 226 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config | |
| 227 fi | |
| 228 fi | |
| 229 if test x$gtk_config_prefix != x ; then | |
| 230 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" | |
| 231 if test x${GTK_CONFIG+set} != xset ; then | |
| 232 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config | |
| 233 fi | |
| 234 fi | |
| 235 | |
| 236 AC_PATH_PROG(GTK_CONFIG, gtk-config, no) | |
| 237 min_gtk_version=ifelse([$1], ,0.99.7,$1) | |
| 238 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) | |
| 239 no_gtk="" | |
| 240 if test "$GTK_CONFIG" = "no" ; then | |
| 241 no_gtk=yes | |
| 242 else | |
| 243 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` | |
| 244 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` | |
| 245 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ | |
| 246 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
| 247 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ | |
| 248 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
| 249 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ | |
| 250 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
| 251 if test "x$enable_gtktest" = "xyes" ; then | |
| 252 ac_save_CFLAGS="$CFLAGS" | |
| 253 ac_save_LIBS="$LIBS" | |
| 254 CFLAGS="$CFLAGS $GTK_CFLAGS" | |
| 255 LIBS="$GTK_LIBS $LIBS" | |
| 256 dnl | |
| 257 dnl Now check if the installed GTK is sufficiently new. (Also sanity | |
| 258 dnl checks the results of gtk-config to some extent | |
| 259 dnl | |
| 260 rm -f conf.gtktest | |
| 261 AC_TRY_RUN([ | |
| 262 #include <gtk/gtk.h> | |
| 263 #include <stdio.h> | |
| 264 #include <stdlib.h> | |
| 265 | |
| 266 int | |
| 267 main () | |
| 268 { | |
| 269 int major, minor, micro; | |
| 270 char *tmp_version; | |
| 271 | |
| 272 system ("touch conf.gtktest"); | |
| 273 | |
| 274 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
| 275 tmp_version = g_strdup("$min_gtk_version"); | |
| 276 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
| 277 printf("%s, bad version string\n", "$min_gtk_version"); | |
| 278 exit(1); | |
| 279 } | |
| 280 | |
| 281 if ((gtk_major_version != $gtk_config_major_version) || | |
| 282 (gtk_minor_version != $gtk_config_minor_version) || | |
| 283 (gtk_micro_version != $gtk_config_micro_version)) | |
| 284 { | |
| 285 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", | |
| 286 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, | |
| 287 gtk_major_version, gtk_minor_version, gtk_micro_version); | |
| 288 printf ("*** was found! If gtk-config was correct, then it is best\n"); | |
| 289 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); | |
| 290 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | |
| 291 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | |
| 292 printf("*** required on your system.\n"); | |
| 293 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); | |
| 294 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); | |
| 295 printf("*** before re-running configure\n"); | |
| 296 } | |
| 297 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) | |
| 298 else if ((gtk_major_version != GTK_MAJOR_VERSION) || | |
| 299 (gtk_minor_version != GTK_MINOR_VERSION) || | |
| 300 (gtk_micro_version != GTK_MICRO_VERSION)) | |
| 301 { | |
| 302 printf("*** GTK+ header files (version %d.%d.%d) do not match\n", | |
| 303 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); | |
| 304 printf("*** library (version %d.%d.%d)\n", | |
| 305 gtk_major_version, gtk_minor_version, gtk_micro_version); | |
| 306 } | |
| 307 #endif /* defined (GTK_MAJOR_VERSION) ... */ | |
| 308 else | |
| 309 { | |
| 310 if ((gtk_major_version > major) || | |
| 311 ((gtk_major_version == major) && (gtk_minor_version > minor)) || | |
| 312 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) | |
| 313 { | |
| 314 return 0; | |
| 315 } | |
| 316 else | |
| 317 { | |
| 318 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", | |
| 319 gtk_major_version, gtk_minor_version, gtk_micro_version); | |
| 320 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", | |
| 321 major, minor, micro); | |
| 322 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); | |
| 323 printf("***\n"); | |
| 324 printf("*** If you have already installed a sufficiently new version, this error\n"); | |
| 325 printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); | |
| 326 printf("*** being found. The easiest way to fix this is to remove the old version\n"); | |
| 327 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); | |
| 328 printf("*** correct copy of gtk-config. (In this case, you will have to\n"); | |
| 329 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | |
| 330 printf("*** so that the correct libraries are found at run-time))\n"); | |
| 331 } | |
| 332 } | |
| 333 return 1; | |
| 334 } | |
| 335 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
| 336 CFLAGS="$ac_save_CFLAGS" | |
| 337 LIBS="$ac_save_LIBS" | |
| 338 fi | |
| 339 fi | |
| 340 if test "x$no_gtk" = x ; then | |
| 341 AC_MSG_RESULT(yes) | |
| 342 ifelse([$2], , :, [$2]) | |
| 343 else | |
| 344 AC_MSG_RESULT(no) | |
| 345 if test "$GTK_CONFIG" = "no" ; then | |
| 346 echo "*** The gtk-config script installed by GTK could not be found" | |
| 347 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" | |
| 348 echo "*** your path, or set the GTK_CONFIG environment variable to the" | |
| 349 echo "*** full path to gtk-config." | |
| 350 else | |
| 351 if test -f conf.gtktest ; then | |
| 352 : | |
| 353 else | |
| 354 echo "*** Could not run GTK test program, checking why..." | |
| 355 CFLAGS="$CFLAGS $GTK_CFLAGS" | |
| 356 LIBS="$LIBS $GTK_LIBS" | |
| 357 AC_TRY_LINK([ | |
| 358 #include <gtk/gtk.h> | |
| 359 #include <stdio.h> | |
| 360 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], | |
| 361 [ echo "*** The test program compiled, but did not run. This usually means" | |
| 362 echo "*** that the run-time linker is not finding GTK or finding the wrong" | |
| 363 echo "*** version of GTK. If it is not finding GTK, you'll need to set your" | |
| 364 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
| 365 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
| 366 echo "*** is required on your system" | |
| 367 echo "***" | |
| 368 echo "*** If you have an old version installed, it is best to remove it, although" | |
| 369 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" | |
| 370 echo "***" | |
| 371 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" | |
| 372 echo "*** came with the system with the command" | |
| 373 echo "***" | |
| 374 echo "*** rpm --erase --nodeps gtk gtk-devel" ], | |
| 375 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
| 376 echo "*** exact error that occured. This usually means GTK was incorrectly installed" | |
| 377 echo "*** or that you have moved GTK since it was installed. In the latter case, you" | |
| 378 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) | |
| 379 CFLAGS="$ac_save_CFLAGS" | |
| 380 LIBS="$ac_save_LIBS" | |
| 381 fi | |
| 382 fi | |
| 383 GTK_CFLAGS="" | |
| 384 GTK_LIBS="" | |
| 385 ifelse([$3], , :, [$3]) | |
| 386 fi | |
| 387 AC_SUBST(GTK_CFLAGS) | |
| 388 AC_SUBST(GTK_LIBS) | |
| 389 rm -f conf.gtktest | |
| 390 ]) | |
|
3410
3fd9f8e2c463
[gaim-migrate @ 3429]
Christian Hammond <chipx86@chipx86.com>
parents:
3357
diff
changeset
|
391 |
|
4563
d6491dc2b7b2
[gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents:
4561
diff
changeset
|
392 dnl Added by setup-gettext. Do not remove this |
|
d6491dc2b7b2
[gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents:
4561
diff
changeset
|
393 dnl unless you know what you are doing. |
|
3410
3fd9f8e2c463
[gaim-migrate @ 3429]
Christian Hammond <chipx86@chipx86.com>
parents:
3357
diff
changeset
|
394 AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |
|
4563
d6491dc2b7b2
[gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents:
4561
diff
changeset
|
395 |
|
3661
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
396 # Configure paths for GLIB |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
397 # Owen Taylor 1997-2001 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
398 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
399 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
400 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
401 dnl gthread is specified in MODULES, pass to pkg-config |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
402 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
403 AC_DEFUN(AM_PATH_GLIB_2_0, |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
404 [dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
405 dnl Get the cflags and libraries from pkg-config |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
406 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
407 AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
408 , enable_glibtest=yes) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
409 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
410 pkg_config_args=glib-2.0 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
411 for module in . $4 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
412 do |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
413 case "$module" in |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
414 gmodule) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
415 pkg_config_args="$pkg_config_args gmodule-2.0" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
416 ;; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
417 gobject) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
418 pkg_config_args="$pkg_config_args gobject-2.0" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
419 ;; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
420 gthread) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
421 pkg_config_args="$pkg_config_args gthread-2.0" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
422 ;; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
423 esac |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
424 done |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
425 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
426 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
427 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
428 no_glib="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
429 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
430 if test x$PKG_CONFIG != xno ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
431 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
432 : |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
433 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
434 echo *** pkg-config too old; version 0.7 or better required. |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
435 no_glib=yes |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
436 PKG_CONFIG=no |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
437 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
438 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
439 no_glib=yes |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
440 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
441 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
442 min_glib_version=ifelse([$1], ,2.0.0,$1) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
443 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
444 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
445 if test x$PKG_CONFIG != xno ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
446 ## don't try to run the test against uninstalled libtool libs |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
447 if $PKG_CONFIG --uninstalled $pkg_config_args; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
448 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
449 enable_glibtest=no |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
450 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
451 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
452 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
453 : |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
454 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
455 no_glib=yes |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
456 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
457 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
458 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
459 if test x"$no_glib" = x ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
460 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
461 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
462 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
463 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
464 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
465 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
466 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
467 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
468 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
469 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
470 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
471 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
472 if test "x$enable_glibtest" = "xyes" ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
473 ac_save_CFLAGS="$CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
474 ac_save_LIBS="$LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
475 CFLAGS="$CFLAGS $GLIB_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
476 LIBS="$GLIB_LIBS $LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
477 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
478 dnl Now check if the installed GLIB is sufficiently new. (Also sanity |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
479 dnl checks the results of pkg-config to some extent) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
480 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
481 rm -f conf.glibtest |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
482 AC_TRY_RUN([ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
483 #include <glib.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
484 #include <stdio.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
485 #include <stdlib.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
486 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
487 int |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
488 main () |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
489 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
490 int major, minor, micro; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
491 char *tmp_version; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
492 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
493 system ("touch conf.glibtest"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
494 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
495 /* HP/UX 9 (%@#!) writes to sscanf strings */ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
496 tmp_version = g_strdup("$min_glib_version"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
497 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
498 printf("%s, bad version string\n", "$min_glib_version"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
499 exit(1); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
500 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
501 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
502 if ((glib_major_version != $glib_config_major_version) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
503 (glib_minor_version != $glib_config_minor_version) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
504 (glib_micro_version != $glib_config_micro_version)) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
505 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
506 printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
507 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
508 glib_major_version, glib_minor_version, glib_micro_version); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
509 printf ("*** was found! If pkg-config was correct, then it is best\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
510 printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
511 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
512 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
513 printf("*** required on your system.\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
514 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
515 printf("*** to point to the correct configuration files\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
516 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
517 else if ((glib_major_version != GLIB_MAJOR_VERSION) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
518 (glib_minor_version != GLIB_MINOR_VERSION) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
519 (glib_micro_version != GLIB_MICRO_VERSION)) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
520 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
521 printf("*** GLIB header files (version %d.%d.%d) do not match\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
522 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
523 printf("*** library (version %d.%d.%d)\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
524 glib_major_version, glib_minor_version, glib_micro_version); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
525 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
526 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
527 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
528 if ((glib_major_version > major) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
529 ((glib_major_version == major) && (glib_minor_version > minor)) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
530 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
531 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
532 return 0; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
533 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
534 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
535 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
536 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
537 glib_major_version, glib_minor_version, glib_micro_version); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
538 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
539 major, minor, micro); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
540 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
541 printf("***\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
542 printf("*** If you have already installed a sufficiently new version, this error\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
543 printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
544 printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
545 printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
546 printf("*** correct copy of pkg-config. (In this case, you will have to\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
547 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
548 printf("*** so that the correct libraries are found at run-time))\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
549 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
550 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
551 return 1; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
552 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
553 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
554 CFLAGS="$ac_save_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
555 LIBS="$ac_save_LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
556 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
557 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
558 if test "x$no_glib" = x ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
559 AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
560 ifelse([$2], , :, [$2]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
561 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
562 AC_MSG_RESULT(no) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
563 if test "$PKG_CONFIG" = "no" ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
564 echo "*** A new enough version of pkg-config was not found." |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
565 echo "*** See http://www.freedesktop.org/software/pkgconfig/" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
566 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
567 if test -f conf.glibtest ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
568 : |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
569 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
570 echo "*** Could not run GLIB test program, checking why..." |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
571 ac_save_CFLAGS="$CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
572 ac_save_LIBS="$LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
573 CFLAGS="$CFLAGS $GLIB_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
574 LIBS="$LIBS $GLIB_LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
575 AC_TRY_LINK([ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
576 #include <glib.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
577 #include <stdio.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
578 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
579 [ echo "*** The test program compiled, but did not run. This usually means" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
580 echo "*** that the run-time linker is not finding GLIB or finding the wrong" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
581 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
582 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
583 echo "*** to the installed location Also, make sure you have run ldconfig if that" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
584 echo "*** is required on your system" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
585 echo "***" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
586 echo "*** If you have an old version installed, it is best to remove it, although" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
587 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
588 [ echo "*** The test program failed to compile or link. See the file config.log for the" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
589 echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
590 CFLAGS="$ac_save_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
591 LIBS="$ac_save_LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
592 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
593 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
594 GLIB_CFLAGS="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
595 GLIB_LIBS="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
596 GLIB_GENMARSHAL="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
597 GOBJECT_QUERY="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
598 GLIB_MKENUMS="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
599 ifelse([$3], , :, [$3]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
600 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
601 AC_SUBST(GLIB_CFLAGS) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
602 AC_SUBST(GLIB_LIBS) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
603 AC_SUBST(GLIB_GENMARSHAL) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
604 AC_SUBST(GOBJECT_QUERY) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
605 AC_SUBST(GLIB_MKENUMS) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
606 rm -f conf.glibtest |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
607 ]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
608 # Configure paths for GTK+ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
609 # Owen Taylor 1997-2001 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
610 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
611 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
612 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
613 dnl pass to pkg-config |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
614 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
615 AC_DEFUN(AM_PATH_GTK_2_0, |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
616 [dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
617 dnl Get the cflags and libraries from pkg-config |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
618 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
619 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
620 , enable_gtktest=yes) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
621 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
622 pkg_config_args=gtk+-2.0 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
623 for module in . $4 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
624 do |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
625 case "$module" in |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
626 gthread) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
627 pkg_config_args="$pkg_config_args gthread-2.0" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
628 ;; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
629 esac |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
630 done |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
631 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
632 no_gtk="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
633 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
634 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
635 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
636 if test x$PKG_CONFIG != xno ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
637 if pkg-config --atleast-pkgconfig-version 0.7 ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
638 : |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
639 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
640 echo *** pkg-config too old; version 0.7 or better required. |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
641 no_gtk=yes |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
642 PKG_CONFIG=no |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
643 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
644 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
645 no_gtk=yes |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
646 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
647 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
648 min_gtk_version=ifelse([$1], ,2.0.0,$1) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
649 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
650 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
651 if test x$PKG_CONFIG != xno ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
652 ## don't try to run the test against uninstalled libtool libs |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
653 if $PKG_CONFIG --uninstalled $pkg_config_args; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
654 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
655 enable_gtktest=no |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
656 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
657 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
658 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
659 : |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
660 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
661 no_gtk=yes |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
662 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
663 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
664 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
665 if test x"$no_gtk" = x ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
666 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
667 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
668 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
669 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
670 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
671 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
672 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
673 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
674 if test "x$enable_gtktest" = "xyes" ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
675 ac_save_CFLAGS="$CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
676 ac_save_LIBS="$LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
677 CFLAGS="$CFLAGS $GTK_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
678 LIBS="$GTK_LIBS $LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
679 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
680 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
681 dnl checks the results of pkg-config to some extent) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
682 dnl |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
683 rm -f conf.gtktest |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
684 AC_TRY_RUN([ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
685 #include <gtk/gtk.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
686 #include <stdio.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
687 #include <stdlib.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
688 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
689 int |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
690 main () |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
691 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
692 int major, minor, micro; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
693 char *tmp_version; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
694 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
695 system ("touch conf.gtktest"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
696 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
697 /* HP/UX 9 (%@#!) writes to sscanf strings */ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
698 tmp_version = g_strdup("$min_gtk_version"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
699 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
700 printf("%s, bad version string\n", "$min_gtk_version"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
701 exit(1); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
702 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
703 |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
704 if ((gtk_major_version != $gtk_config_major_version) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
705 (gtk_minor_version != $gtk_config_minor_version) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
706 (gtk_micro_version != $gtk_config_micro_version)) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
707 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
708 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
709 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
710 gtk_major_version, gtk_minor_version, gtk_micro_version); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
711 printf ("*** was found! If pkg-config was correct, then it is best\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
712 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
713 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
714 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
715 printf("*** required on your system.\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
716 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
717 printf("*** to point to the correct configuration files\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
718 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
719 else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
720 (gtk_minor_version != GTK_MINOR_VERSION) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
721 (gtk_micro_version != GTK_MICRO_VERSION)) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
722 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
723 printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
724 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
725 printf("*** library (version %d.%d.%d)\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
726 gtk_major_version, gtk_minor_version, gtk_micro_version); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
727 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
728 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
729 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
730 if ((gtk_major_version > major) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
731 ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
732 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
733 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
734 return 0; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
735 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
736 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
737 { |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
738 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
739 gtk_major_version, gtk_minor_version, gtk_micro_version); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
740 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
741 major, minor, micro); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
742 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
743 printf("***\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
744 printf("*** If you have already installed a sufficiently new version, this error\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
745 printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
746 printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
747 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
748 printf("*** correct copy of pkg-config. (In this case, you will have to\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
749 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
750 printf("*** so that the correct libraries are found at run-time))\n"); |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
751 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
752 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
753 return 1; |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
754 } |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
755 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
756 CFLAGS="$ac_save_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
757 LIBS="$ac_save_LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
758 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
759 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
760 if test "x$no_gtk" = x ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
761 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
762 ifelse([$2], , :, [$2]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
763 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
764 AC_MSG_RESULT(no) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
765 if test "$PKG_CONFIG" = "no" ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
766 echo "*** A new enough version of pkg-config was not found." |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
767 echo "*** See http://pkgconfig.sourceforge.net" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
768 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
769 if test -f conf.gtktest ; then |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
770 : |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
771 else |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
772 echo "*** Could not run GTK+ test program, checking why..." |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
773 ac_save_CFLAGS="$CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
774 ac_save_LIBS="$LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
775 CFLAGS="$CFLAGS $GTK_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
776 LIBS="$LIBS $GTK_LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
777 AC_TRY_LINK([ |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
778 #include <gtk/gtk.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
779 #include <stdio.h> |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
780 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
781 [ echo "*** The test program compiled, but did not run. This usually means" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
782 echo "*** that the run-time linker is not finding GTK+ or finding the wrong" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
783 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
784 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
785 echo "*** to the installed location Also, make sure you have run ldconfig if that" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
786 echo "*** is required on your system" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
787 echo "***" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
788 echo "*** If you have an old version installed, it is best to remove it, although" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
789 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
790 [ echo "*** The test program failed to compile or link. See the file config.log for the" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
791 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
792 CFLAGS="$ac_save_CFLAGS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
793 LIBS="$ac_save_LIBS" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
794 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
795 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
796 GTK_CFLAGS="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
797 GTK_LIBS="" |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
798 ifelse([$3], , :, [$3]) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
799 fi |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
800 AC_SUBST(GTK_CFLAGS) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
801 AC_SUBST(GTK_LIBS) |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
802 rm -f conf.gtktest |
|
de4c62f656ee
[gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents:
3410
diff
changeset
|
803 ]) |
| 4561 | 804 |
| 805 dnl This is XIPH_PATH_AO renamed to GAIM_PATH_AO to prevent conflicts. | |
| 806 dnl It's a long story. --elb | |
| 807 | |
| 808 # ao.m4 | |
| 809 # Configure paths for libao | |
| 810 # Jack Moffitt <jack@icecast.org> 10-21-2000 | |
| 811 # Shamelessly stolen from Owen Taylor and Manish Singh | |
| 812 | |
| 813 dnl GAIM_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) | |
| 814 dnl Test for libao, and define AO_CFLAGS and AO_LIBS | |
| 815 dnl | |
| 816 AC_DEFUN(GAIM_PATH_AO, | |
| 817 [dnl | |
| 818 dnl Get the cflags and libraries | |
| 819 dnl | |
| 820 AC_ARG_WITH(ao,[ --with-ao=PFX Prefix where libao is installed (optional)], ao_prefix="$withval", ao_prefix="") | |
| 821 AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao library is installed (optional)], ao_libraries="$withval", ao_libraries="") | |
| 822 AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="") | |
| 823 AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes) | |
| 824 | |
| 825 | |
| 826 if test "x$ao_libraries" != "x" ; then | |
| 827 AO_LIBS="-L$ao_libraries" | |
| 828 elif test "x$ao_prefix" != "x"; then | |
| 829 AO_LIBS="-L$ao_prefix/lib" | |
| 830 elif test "x$prefix" != "xNONE"; then | |
| 831 AO_LIBS="-L$prefix/lib" | |
| 832 fi | |
| 833 | |
| 834 if test "x$ao_includes" != "x" ; then | |
| 835 AO_CFLAGS="-I$ao_includes" | |
| 836 elif test "x$ao_prefix" != "x"; then | |
| 837 AO_CFLAGS="-I$ao_prefix/include" | |
| 838 elif test "x$prefix" != "xNONE"; then | |
| 839 AO_CFLAGS="-I$prefix/include" | |
| 840 fi | |
| 841 | |
| 842 # see where dl* and friends live | |
| 843 AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [ | |
| 844 AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [ | |
| 845 AC_MSG_WARN([could not find dlopen() needed by libao sound drivers | |
| 846 your system may not be supported.]) | |
| 847 ]) | |
| 848 ]) | |
| 849 | |
| 850 AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS" | |
| 851 | |
| 852 AC_MSG_CHECKING(for ao) | |
| 853 no_ao="" | |
| 854 | |
| 855 | |
| 856 if test "x$enable_aotest" = "xyes" ; then | |
| 857 ac_save_CFLAGS="$CFLAGS" | |
| 858 ac_save_LIBS="$LIBS" | |
| 859 CFLAGS="$CFLAGS $AO_CFLAGS" | |
| 860 LIBS="$LIBS $AO_LIBS" | |
| 861 dnl | |
| 862 dnl Now check if the installed ao is sufficiently new. | |
| 863 dnl | |
| 864 rm -f conf.aotest | |
| 865 AC_TRY_RUN([ | |
| 866 #include <stdio.h> | |
| 867 #include <stdlib.h> | |
| 868 #include <string.h> | |
| 869 #include <ao/ao.h> | |
| 870 | |
| 871 int main () | |
| 872 { | |
| 873 system("touch conf.aotest"); | |
| 874 return 0; | |
| 875 } | |
| 876 | |
| 877 ],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
| 878 CFLAGS="$ac_save_CFLAGS" | |
| 879 LIBS="$ac_save_LIBS" | |
| 880 fi | |
| 881 | |
| 882 if test "x$no_ao" = "x" ; then | |
| 883 AC_MSG_RESULT(yes) | |
| 884 ifelse([$1], , :, [$1]) | |
| 885 else | |
| 886 AC_MSG_RESULT(no) | |
| 887 if test -f conf.aotest ; then | |
| 888 : | |
| 889 else | |
| 890 echo "*** Could not run ao test program, checking why..." | |
| 891 CFLAGS="$CFLAGS $AO_CFLAGS" | |
| 892 LIBS="$LIBS $AO_LIBS" | |
| 893 AC_TRY_LINK([ | |
| 894 #include <stdio.h> | |
| 895 #include <ao/ao.h> | |
| 896 ], [ return 0; ], | |
| 897 [ echo "*** The test program compiled, but did not run. This usually means" | |
| 898 echo "*** that the run-time linker is not finding ao or finding the wrong" | |
| 899 echo "*** version of ao. If it is not finding ao, you'll need to set your" | |
| 900 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
| 901 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
| 902 echo "*** is required on your system" | |
| 903 echo "***" | |
| 904 echo "*** If you have an old version installed, it is best to remove it, although" | |
| 905 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
| 906 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
| 907 echo "*** exact error that occured. This usually means ao was incorrectly installed" | |
| 908 echo "*** or that you have moved ao since it was installed." ]) | |
| 909 CFLAGS="$ac_save_CFLAGS" | |
| 910 LIBS="$ac_save_LIBS" | |
| 911 fi | |
| 912 AO_CFLAGS="" | |
| 913 AO_LIBS="" | |
| 914 ifelse([$2], , :, [$2]) | |
| 915 fi | |
| 916 AC_SUBST(AO_CFLAGS) | |
| 917 AC_SUBST(AO_LIBS) | |
| 918 rm -f conf.aotest | |
| 919 ]) |
