annotate acinclude.m4 @ 4464:e926d3bdfd14

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