|
|
1.1.1.5 ! root 1: # generated automatically by aclocal 1.8.5 -*- Autoconf -*- 1.1.1.3 root 2: 3: # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 4: # Free Software Foundation, Inc. 5: # This file is free software; the Free Software Foundation 6: # gives unlimited permission to copy and/or distribute it, 7: # with or without modifications, as long as this notice is preserved. 8: 9: # This program is distributed in the hope that it will be useful, 10: # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11: # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12: # PARTICULAR PURPOSE. 13: 1.1 root 14: # Configure paths for GTK+ 1.1.1.4 root 15: # Owen Taylor 1997-2001 1.1 root 16: 1.1.1.4 root 17: dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) 18: dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 19: dnl pass to pkg-config 1.1 root 20: dnl 1.1.1.4 root 21: AC_DEFUN([AM_PATH_GTK_2_0], 1.1 root 22: [dnl 1.1.1.4 root 23: dnl Get the cflags and libraries from pkg-config 1.1 root 24: dnl 1.1.1.4 root 25: AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], 1.1 root 26: , enable_gtktest=yes) 27: 1.1.1.4 root 28: pkg_config_args=gtk+-2.0 1.1.1.3 root 29: for module in . $4 30: do 31: case "$module" in 32: gthread) 1.1.1.4 root 33: pkg_config_args="$pkg_config_args gthread-2.0" 1.1.1.3 root 34: ;; 35: esac 36: done 37: 1.1.1.4 root 38: no_gtk="" 39: 40: AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 41: 42: if test x$PKG_CONFIG != xno ; then 43: if pkg-config --atleast-pkgconfig-version 0.7 ; then 44: : 45: else 1.1.1.5 ! root 46: echo "*** pkg-config too old; version 0.7 or better required." 1.1.1.4 root 47: no_gtk=yes 48: PKG_CONFIG=no 49: fi 50: else 51: no_gtk=yes 1.1 root 52: fi 1.1.1.4 root 53: 54: min_gtk_version=ifelse([$1], ,2.0.0,$1) 55: AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) 56: 57: if test x$PKG_CONFIG != xno ; then 58: ## don't try to run the test against uninstalled libtool libs 59: if $PKG_CONFIG --uninstalled $pkg_config_args; then 60: echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" 61: enable_gtktest=no 62: fi 63: 64: if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then 65: : 66: else 67: no_gtk=yes 68: fi 1.1 root 69: fi 70: 1.1.1.4 root 71: if test x"$no_gtk" = x ; then 72: GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` 73: GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` 74: gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ 1.1 root 75: sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 1.1.1.4 root 76: gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ 1.1 root 77: sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 1.1.1.4 root 78: gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ 1.1 root 79: sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 80: if test "x$enable_gtktest" = "xyes" ; then 81: ac_save_CFLAGS="$CFLAGS" 82: ac_save_LIBS="$LIBS" 83: CFLAGS="$CFLAGS $GTK_CFLAGS" 1.1.1.3 root 84: LIBS="$GTK_LIBS $LIBS" 1.1 root 85: dnl 1.1.1.4 root 86: dnl Now check if the installed GTK+ is sufficiently new. (Also sanity 87: dnl checks the results of pkg-config to some extent) 1.1 root 88: dnl 89: rm -f conf.gtktest 90: AC_TRY_RUN([ 91: #include <gtk/gtk.h> 92: #include <stdio.h> 1.1.1.3 root 93: #include <stdlib.h> 1.1 root 94: 95: int 96: main () 97: { 98: int major, minor, micro; 1.1.1.3 root 99: char *tmp_version; 1.1 root 100: 101: system ("touch conf.gtktest"); 102: 1.1.1.3 root 103: /* HP/UX 9 (%@#!) writes to sscanf strings */ 104: tmp_version = g_strdup("$min_gtk_version"); 105: if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { 1.1 root 106: printf("%s, bad version string\n", "$min_gtk_version"); 107: exit(1); 108: } 109: 110: if ((gtk_major_version != $gtk_config_major_version) || 111: (gtk_minor_version != $gtk_config_minor_version) || 112: (gtk_micro_version != $gtk_config_micro_version)) 113: { 1.1.1.4 root 114: printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 1.1 root 115: $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, 116: gtk_major_version, gtk_minor_version, gtk_micro_version); 1.1.1.4 root 117: printf ("*** was found! If pkg-config was correct, then it is best\n"); 1.1 root 118: printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); 119: printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); 120: printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); 121: printf("*** required on your system.\n"); 1.1.1.4 root 122: printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); 123: printf("*** to point to the correct configuration files\n"); 1.1 root 124: } 1.1.1.3 root 125: else if ((gtk_major_version != GTK_MAJOR_VERSION) || 126: (gtk_minor_version != GTK_MINOR_VERSION) || 127: (gtk_micro_version != GTK_MICRO_VERSION)) 128: { 129: printf("*** GTK+ header files (version %d.%d.%d) do not match\n", 130: GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); 131: printf("*** library (version %d.%d.%d)\n", 132: gtk_major_version, gtk_minor_version, gtk_micro_version); 133: } 1.1 root 134: else 135: { 136: if ((gtk_major_version > major) || 137: ((gtk_major_version == major) && (gtk_minor_version > minor)) || 138: ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) 139: { 140: return 0; 141: } 142: else 143: { 144: printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", 145: gtk_major_version, gtk_minor_version, gtk_micro_version); 146: printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", 147: major, minor, micro); 148: printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); 149: printf("***\n"); 150: printf("*** If you have already installed a sufficiently new version, this error\n"); 1.1.1.4 root 151: printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); 1.1 root 152: printf("*** being found. The easiest way to fix this is to remove the old version\n"); 1.1.1.4 root 153: printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); 154: printf("*** correct copy of pkg-config. (In this case, you will have to\n"); 1.1 root 155: printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); 156: printf("*** so that the correct libraries are found at run-time))\n"); 157: } 158: } 159: return 1; 160: } 161: ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) 162: CFLAGS="$ac_save_CFLAGS" 163: LIBS="$ac_save_LIBS" 164: fi 165: fi 166: if test "x$no_gtk" = x ; then 1.1.1.4 root 167: AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) 1.1 root 168: ifelse([$2], , :, [$2]) 169: else 170: AC_MSG_RESULT(no) 1.1.1.4 root 171: if test "$PKG_CONFIG" = "no" ; then 172: echo "*** A new enough version of pkg-config was not found." 173: echo "*** See http://pkgconfig.sourceforge.net" 1.1 root 174: else 175: if test -f conf.gtktest ; then 176: : 177: else 1.1.1.4 root 178: echo "*** Could not run GTK+ test program, checking why..." 179: ac_save_CFLAGS="$CFLAGS" 180: ac_save_LIBS="$LIBS" 1.1 root 181: CFLAGS="$CFLAGS $GTK_CFLAGS" 182: LIBS="$LIBS $GTK_LIBS" 183: AC_TRY_LINK([ 184: #include <gtk/gtk.h> 185: #include <stdio.h> 186: ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], 187: [ echo "*** The test program compiled, but did not run. This usually means" 1.1.1.4 root 188: echo "*** that the run-time linker is not finding GTK+ or finding the wrong" 189: echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" 1.1 root 190: echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" 191: echo "*** to the installed location Also, make sure you have run ldconfig if that" 192: echo "*** is required on your system" 193: echo "***" 194: echo "*** If you have an old version installed, it is best to remove it, although" 1.1.1.4 root 195: echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], 1.1 root 196: [ echo "*** The test program failed to compile or link. See the file config.log for the" 1.1.1.4 root 197: echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) 1.1 root 198: CFLAGS="$ac_save_CFLAGS" 199: LIBS="$ac_save_LIBS" 200: fi 201: fi 202: GTK_CFLAGS="" 203: GTK_LIBS="" 204: ifelse([$3], , :, [$3]) 205: fi 206: AC_SUBST(GTK_CFLAGS) 207: AC_SUBST(GTK_LIBS) 208: rm -f conf.gtktest 209: ]) 1.1.1.2 root 210:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.