annotate acinclude.m4 @ 9776:1e5ef71c9583

[gaim-migrate @ 10644] A patch from Daniel Atallah that should fix sf bug 1008489: "Windows Messenger BOT Crashes Gaim" Someone MSN-savvy should check this to make sure it's a valid fix. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 19 Aug 2004 01:13:58 +0000
parents f15fcdbecf0a
children c143a3fac58d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4563
d6491dc2b7b2 [gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents: 4561
diff changeset
1 dnl Added by setup-gettext. Do not remove this
d6491dc2b7b2 [gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents: 4561
diff changeset
2 dnl unless you know what you are doing.
3410
3fd9f8e2c463 [gaim-migrate @ 3429]
Christian Hammond <chipx86@chipx86.com>
parents: 3357
diff changeset
3 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
4563
d6491dc2b7b2 [gaim-migrate @ 4844]
Christian Hammond <chipx86@chipx86.com>
parents: 4561
diff changeset
4
3661
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
5 # Configure paths for GLIB
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
6 # Owen Taylor 1997-2001
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
7
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
8 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
9 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
10 dnl gthread is specified in MODULES, pass to pkg-config
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
11 dnl
8992
f15fcdbecf0a [gaim-migrate @ 9767]
Ethan Blanton <elb@pidgin.im>
parents: 7201
diff changeset
12 AC_DEFUN([AM_PATH_GLIB_2_0],
3661
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
13 [dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
14 dnl Get the cflags and libraries from pkg-config
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
15 dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
16 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
17 , enable_glibtest=yes)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
18
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
19 pkg_config_args=glib-2.0
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
20 for module in . $4
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
21 do
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
22 case "$module" in
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
23 gmodule)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
24 pkg_config_args="$pkg_config_args gmodule-2.0"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
25 ;;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
26 gobject)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
27 pkg_config_args="$pkg_config_args gobject-2.0"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
28 ;;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
29 gthread)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
30 pkg_config_args="$pkg_config_args gthread-2.0"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
31 ;;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
32 esac
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
33 done
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
34
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
35 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
36
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
37 no_glib=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
38
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
39 if test x$PKG_CONFIG != xno ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
40 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
41 :
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
42 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
43 echo *** pkg-config too old; version 0.7 or better required.
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
44 no_glib=yes
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
45 PKG_CONFIG=no
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
46 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
47 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
48 no_glib=yes
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
49 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
50
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
51 min_glib_version=ifelse([$1], ,2.0.0,$1)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
52 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
53
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
54 if test x$PKG_CONFIG != xno ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
55 ## don't try to run the test against uninstalled libtool libs
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
56 if $PKG_CONFIG --uninstalled $pkg_config_args; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
57 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
58 enable_glibtest=no
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
59 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
60
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
61 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
62 :
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
63 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
64 no_glib=yes
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
65 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
66 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
67
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
68 if test x"$no_glib" = x ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
69 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
70 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
71 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
72
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
73 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
74 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
75 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
76 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
77 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
78 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
79 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
80 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
81 if test "x$enable_glibtest" = "xyes" ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
82 ac_save_CFLAGS="$CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
83 ac_save_LIBS="$LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
84 CFLAGS="$CFLAGS $GLIB_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
85 LIBS="$GLIB_LIBS $LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
86 dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
87 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
88 dnl checks the results of pkg-config to some extent)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
89 dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
90 rm -f conf.glibtest
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
91 AC_TRY_RUN([
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
92 #include <glib.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
93 #include <stdio.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
94 #include <stdlib.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
95
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
96 int
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
97 main ()
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
98 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
99 int major, minor, micro;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
100 char *tmp_version;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
101
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
102 system ("touch conf.glibtest");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
103
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
104 /* HP/UX 9 (%@#!) writes to sscanf strings */
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
105 tmp_version = g_strdup("$min_glib_version");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
106 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
107 printf("%s, bad version string\n", "$min_glib_version");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
108 exit(1);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
109 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
110
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
111 if ((glib_major_version != $glib_config_major_version) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
112 (glib_minor_version != $glib_config_minor_version) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
113 (glib_micro_version != $glib_config_micro_version))
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
114 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
115 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
116 $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
117 glib_major_version, glib_minor_version, glib_micro_version);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
118 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
119 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
120 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
121 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
122 printf("*** required on your system.\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
123 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
124 printf("*** to point to the correct configuration files\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
125 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
126 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
127 (glib_minor_version != GLIB_MINOR_VERSION) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
128 (glib_micro_version != GLIB_MICRO_VERSION))
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
129 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
130 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
131 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
132 printf("*** library (version %d.%d.%d)\n",
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
133 glib_major_version, glib_minor_version, glib_micro_version);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
134 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
135 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
136 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
137 if ((glib_major_version > major) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
138 ((glib_major_version == major) && (glib_minor_version > minor)) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
139 ((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
140 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
141 return 0;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
142 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
143 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
144 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
145 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
146 glib_major_version, glib_minor_version, glib_micro_version);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
147 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
148 major, minor, micro);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
149 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
150 printf("***\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
151 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
152 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
153 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
154 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
155 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
156 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
157 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
158 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
159 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
160 return 1;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
161 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
162 ],, 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
163 CFLAGS="$ac_save_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
164 LIBS="$ac_save_LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
165 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
166 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
167 if test "x$no_glib" = x ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
168 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
169 ifelse([$2], , :, [$2])
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
170 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
171 AC_MSG_RESULT(no)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
172 if test "$PKG_CONFIG" = "no" ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
173 echo "*** A new enough version of pkg-config was not found."
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
174 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
175 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
176 if test -f conf.glibtest ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
177 :
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
178 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
179 echo "*** Could not run GLIB test program, checking why..."
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
180 ac_save_CFLAGS="$CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
181 ac_save_LIBS="$LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
182 CFLAGS="$CFLAGS $GLIB_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
183 LIBS="$LIBS $GLIB_LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
184 AC_TRY_LINK([
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
185 #include <glib.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
186 #include <stdio.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
187 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
188 [ 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
189 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
190 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
191 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
192 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
193 echo "*** is required on your system"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
194 echo "***"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
195 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
196 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
197 [ 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
198 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
199 CFLAGS="$ac_save_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
200 LIBS="$ac_save_LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
201 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
202 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
203 GLIB_CFLAGS=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
204 GLIB_LIBS=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
205 GLIB_GENMARSHAL=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
206 GOBJECT_QUERY=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
207 GLIB_MKENUMS=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
208 ifelse([$3], , :, [$3])
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
209 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
210 AC_SUBST(GLIB_CFLAGS)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
211 AC_SUBST(GLIB_LIBS)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
212 AC_SUBST(GLIB_GENMARSHAL)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
213 AC_SUBST(GOBJECT_QUERY)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
214 AC_SUBST(GLIB_MKENUMS)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
215 rm -f conf.glibtest
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
216 ])
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
217 # Configure paths for GTK+
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
218 # Owen Taylor 1997-2001
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
219
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
220 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
221 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
222 dnl pass to pkg-config
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
223 dnl
8992
f15fcdbecf0a [gaim-migrate @ 9767]
Ethan Blanton <elb@pidgin.im>
parents: 7201
diff changeset
224 AC_DEFUN([AM_PATH_GTK_2_0],
3661
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
225 [dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
226 dnl Get the cflags and libraries from pkg-config
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
227 dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
228 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
229 , enable_gtktest=yes)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
230
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
231 pkg_config_args=gtk+-2.0
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
232 for module in . $4
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
233 do
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
234 case "$module" in
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
235 gthread)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
236 pkg_config_args="$pkg_config_args gthread-2.0"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
237 ;;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
238 esac
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
239 done
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
240
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
241 no_gtk=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
242
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
243 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
244
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
245 if test x$PKG_CONFIG != xno ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
246 if pkg-config --atleast-pkgconfig-version 0.7 ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
247 :
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
248 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
249 echo *** pkg-config too old; version 0.7 or better required.
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
250 no_gtk=yes
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
251 PKG_CONFIG=no
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
252 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
253 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
254 no_gtk=yes
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
255 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
256
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
257 min_gtk_version=ifelse([$1], ,2.0.0,$1)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
258 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
259
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
260 if test x$PKG_CONFIG != xno ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
261 ## don't try to run the test against uninstalled libtool libs
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
262 if $PKG_CONFIG --uninstalled $pkg_config_args; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
263 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
264 enable_gtktest=no
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
265 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
266
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
267 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
268 :
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
269 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
270 no_gtk=yes
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
271 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
272 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
273
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
274 if test x"$no_gtk" = x ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
275 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
276 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
277 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
278 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
279 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
280 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
281 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
282 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
283 if test "x$enable_gtktest" = "xyes" ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
284 ac_save_CFLAGS="$CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
285 ac_save_LIBS="$LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
286 CFLAGS="$CFLAGS $GTK_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
287 LIBS="$GTK_LIBS $LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
288 dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
289 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
290 dnl checks the results of pkg-config to some extent)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
291 dnl
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
292 rm -f conf.gtktest
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
293 AC_TRY_RUN([
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
294 #include <gtk/gtk.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
295 #include <stdio.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
296 #include <stdlib.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
297
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
298 int
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
299 main ()
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
300 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
301 int major, minor, micro;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
302 char *tmp_version;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
303
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
304 system ("touch conf.gtktest");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
305
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
306 /* HP/UX 9 (%@#!) writes to sscanf strings */
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
307 tmp_version = g_strdup("$min_gtk_version");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
308 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
309 printf("%s, bad version string\n", "$min_gtk_version");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
310 exit(1);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
311 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
312
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
313 if ((gtk_major_version != $gtk_config_major_version) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
314 (gtk_minor_version != $gtk_config_minor_version) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
315 (gtk_micro_version != $gtk_config_micro_version))
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
316 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
317 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
318 $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
319 gtk_major_version, gtk_minor_version, gtk_micro_version);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
320 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
321 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
322 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
323 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
324 printf("*** required on your system.\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
325 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
326 printf("*** to point to the correct configuration files\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
327 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
328 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
329 (gtk_minor_version != GTK_MINOR_VERSION) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
330 (gtk_micro_version != GTK_MICRO_VERSION))
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
331 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
332 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
333 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
334 printf("*** library (version %d.%d.%d)\n",
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
335 gtk_major_version, gtk_minor_version, gtk_micro_version);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
336 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
337 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
338 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
339 if ((gtk_major_version > major) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
340 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
341 ((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
342 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
343 return 0;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
344 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
345 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
346 {
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
347 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
348 gtk_major_version, gtk_minor_version, gtk_micro_version);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
349 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
350 major, minor, micro);
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
351 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
352 printf("***\n");
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
353 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
354 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
355 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
356 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
357 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
358 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
359 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
360 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
361 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
362 return 1;
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
363 }
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
364 ],, 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
365 CFLAGS="$ac_save_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
366 LIBS="$ac_save_LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
367 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
368 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
369 if test "x$no_gtk" = x ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
370 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
371 ifelse([$2], , :, [$2])
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
372 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
373 AC_MSG_RESULT(no)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
374 if test "$PKG_CONFIG" = "no" ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
375 echo "*** A new enough version of pkg-config was not found."
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
376 echo "*** See http://pkgconfig.sourceforge.net"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
377 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
378 if test -f conf.gtktest ; then
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
379 :
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
380 else
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
381 echo "*** Could not run GTK+ test program, checking why..."
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
382 ac_save_CFLAGS="$CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
383 ac_save_LIBS="$LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
384 CFLAGS="$CFLAGS $GTK_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
385 LIBS="$LIBS $GTK_LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
386 AC_TRY_LINK([
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
387 #include <gtk/gtk.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
388 #include <stdio.h>
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
389 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
390 [ 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
391 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
392 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
393 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
394 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
395 echo "*** is required on your system"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
396 echo "***"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
397 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
398 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
399 [ 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
400 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
401 CFLAGS="$ac_save_CFLAGS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
402 LIBS="$ac_save_LIBS"
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
403 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
404 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
405 GTK_CFLAGS=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
406 GTK_LIBS=""
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
407 ifelse([$3], , :, [$3])
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
408 fi
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
409 AC_SUBST(GTK_CFLAGS)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
410 AC_SUBST(GTK_LIBS)
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
411 rm -f conf.gtktest
de4c62f656ee [gaim-migrate @ 3790]
Christian Hammond <chipx86@chipx86.com>
parents: 3410
diff changeset
412 ])
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
413
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
414 dnl This is XIPH_PATH_AO renamed to GAIM_PATH_AO to prevent conflicts.
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
415 dnl It's a long story. --elb
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
416
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
417 # ao.m4
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
418 # Configure paths for libao
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
419 # Jack Moffitt <jack@icecast.org> 10-21-2000
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
420 # Shamelessly stolen from Owen Taylor and Manish Singh
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
421
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
422 dnl GAIM_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
423 dnl Test for libao, and define AO_CFLAGS and AO_LIBS
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
424 dnl
8992
f15fcdbecf0a [gaim-migrate @ 9767]
Ethan Blanton <elb@pidgin.im>
parents: 7201
diff changeset
425 AC_DEFUN([GAIM_PATH_AO],
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
426 [dnl
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
427 dnl Get the cflags and libraries
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
428 dnl
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
429 AC_ARG_WITH(ao,[ --with-ao=PFX Prefix where libao is installed (optional)], ao_prefix="$withval", ao_prefix="")
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
430 AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao library is installed (optional)], ao_libraries="$withval", ao_libraries="")
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
431 AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="")
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
432 AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
433
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
434
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
435 if test "x$ao_libraries" != "x" ; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
436 AO_LIBS="-L$ao_libraries"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
437 elif test "x$ao_prefix" != "x"; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
438 AO_LIBS="-L$ao_prefix/lib"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
439 elif test "x$prefix" != "xNONE"; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
440 AO_LIBS="-L$prefix/lib"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
441 fi
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
442
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
443 if test "x$ao_includes" != "x" ; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
444 AO_CFLAGS="-I$ao_includes"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
445 elif test "x$ao_prefix" != "x"; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
446 AO_CFLAGS="-I$ao_prefix/include"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
447 elif test "x$prefix" != "xNONE"; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
448 AO_CFLAGS="-I$prefix/include"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
449 fi
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
450
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
451 # see where dl* and friends live
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
452 AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
453 AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
454 AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
455 your system may not be supported.])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
456 ])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
457 ])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
458
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
459 AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
460
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
461 AC_MSG_CHECKING(for ao)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
462 no_ao=""
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
463
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
464
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
465 if test "x$enable_aotest" = "xyes" ; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
466 ac_save_CFLAGS="$CFLAGS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
467 ac_save_LIBS="$LIBS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
468 CFLAGS="$CFLAGS $AO_CFLAGS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
469 LIBS="$LIBS $AO_LIBS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
470 dnl
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
471 dnl Now check if the installed ao is sufficiently new.
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
472 dnl
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
473 rm -f conf.aotest
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
474 AC_TRY_RUN([
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
475 #include <stdio.h>
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
476 #include <stdlib.h>
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
477 #include <string.h>
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
478 #include <ao/ao.h>
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
479
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
480 int main ()
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
481 {
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
482 system("touch conf.aotest");
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
483 return 0;
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
484 }
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
485
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
486 ],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
487 CFLAGS="$ac_save_CFLAGS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
488 LIBS="$ac_save_LIBS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
489 fi
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
490
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
491 if test "x$no_ao" = "x" ; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
492 AC_MSG_RESULT(yes)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
493 ifelse([$1], , :, [$1])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
494 else
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
495 AC_MSG_RESULT(no)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
496 if test -f conf.aotest ; then
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
497 :
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
498 else
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
499 echo "*** Could not run ao test program, checking why..."
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
500 CFLAGS="$CFLAGS $AO_CFLAGS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
501 LIBS="$LIBS $AO_LIBS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
502 AC_TRY_LINK([
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
503 #include <stdio.h>
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
504 #include <ao/ao.h>
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
505 ], [ return 0; ],
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
506 [ echo "*** The test program compiled, but did not run. This usually means"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
507 echo "*** that the run-time linker is not finding ao or finding the wrong"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
508 echo "*** version of ao. If it is not finding ao, you'll need to set your"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
509 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
510 echo "*** to the installed location Also, make sure you have run ldconfig if that"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
511 echo "*** is required on your system"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
512 echo "***"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
513 echo "*** If you have an old version installed, it is best to remove it, although"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
514 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
515 [ echo "*** The test program failed to compile or link. See the file config.log for the"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
516 echo "*** exact error that occured. This usually means ao was incorrectly installed"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
517 echo "*** or that you have moved ao since it was installed." ])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
518 CFLAGS="$ac_save_CFLAGS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
519 LIBS="$ac_save_LIBS"
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
520 fi
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
521 AO_CFLAGS=""
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
522 AO_LIBS=""
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
523 ifelse([$2], , :, [$2])
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
524 fi
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
525 AC_SUBST(AO_CFLAGS)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
526 AC_SUBST(AO_LIBS)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
527 rm -f conf.aotest
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 3661
diff changeset
528 ])
4564
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
529
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
530 dnl audiofile.m4, included here for those people who don't have audiofile
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
531 dnl installed but would like to build CVS.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
532
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
533 # Configure paths for the Audio File Library
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
534 # Bertrand Guiheneuf 98-10-21
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
535 # stolen from esd.m4 in esound :
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
536 # Manish Singh 98-9-30
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
537 # stolen back from Frank Belew
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
538 # stolen from Manish Singh
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
539 # Shamelessly stolen from Owen Taylor
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
540
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
541 dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
542 dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
543 dnl
8992
f15fcdbecf0a [gaim-migrate @ 9767]
Ethan Blanton <elb@pidgin.im>
parents: 7201
diff changeset
544 AC_DEFUN([AM_PATH_AUDIOFILE],
4564
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
545 [dnl
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
546 dnl Get compiler flags and libraries from the audiofile-config script.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
547 dnl
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
548 AC_ARG_WITH(audiofile-prefix,[ --with-audiofile-prefix=PFX Prefix where Audio File Library is installed (optional)],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
549 audiofile_prefix="$withval", audiofile_prefix="")
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
550 AC_ARG_WITH(audiofile-exec-prefix,[ --with-audiofile-exec-prefix=PFX Exec prefix where Audio File Library is installed (optional)],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
551 audiofile_exec_prefix="$withval", audiofile_exec_prefix="")
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
552 AC_ARG_ENABLE(audiofiletest, [ --disable-audiofiletest Do not try to compile and run a test Audio File Library program], , enable_audiofiletest=yes)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
553
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
554 if test x$audiofile_exec_prefix != x ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
555 audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
556 if test x${AUDIOFILE_CONFIG+set} != xset ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
557 AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
558 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
559 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
560 if test x$audiofile_prefix != x ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
561 audiofile_args="$audiofile_args --prefix=$audiofile_prefix"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
562 if test x${AUDIOFILE_CONFIG+set} != xset ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
563 AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
564 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
565 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
566
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
567 AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
568 min_audiofile_version=ifelse([$1], ,0.2.5,$1)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
569 AC_MSG_CHECKING(for Audio File Library - version >= $min_audiofile_version)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
570 no_audiofile=""
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
571 if test "$AUDIOFILE_CONFIG" = "no" ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
572 no_audiofile=yes
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
573 else
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
574 AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs`
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
575 AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags`
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
576 audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
577 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
578 audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
579 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
580 audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
581 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
582 if test "x$enable_audiofiletest" = "xyes" ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
583 AC_LANG_SAVE
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
584 AC_LANG_C
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
585 ac_save_CFLAGS="$CFLAGS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
586 ac_save_LIBS="$LIBS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
587 CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
588 LIBS="$LIBS $AUDIOFILE_LIBS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
589 dnl
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
590 dnl Now check if the installed Audio File Library is sufficiently new.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
591 dnl (Also checks the sanity of the results of audiofile-config to some extent.)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
592 dnl
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
593 rm -f conf.audiofiletest
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
594 AC_TRY_RUN([
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
595 #include <stdio.h>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
596 #include <stdlib.h>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
597 #include <string.h>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
598 #include <audiofile.h>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
599
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
600 char*
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
601 my_strdup (char *str)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
602 {
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
603 char *new_str;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
604
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
605 if (str)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
606 {
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
607 new_str = malloc ((strlen (str) + 1) * sizeof(char));
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
608 strcpy (new_str, str);
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
609 }
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
610 else
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
611 new_str = NULL;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
612
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
613 return new_str;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
614 }
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
615
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
616 int main ()
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
617 {
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
618 int major, minor, micro;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
619 char *tmp_version;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
620
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
621 system ("touch conf.audiofiletest");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
622
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
623 /* HP/UX 9 (%@#!) writes to sscanf strings */
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
624 tmp_version = my_strdup("$min_audiofile_version");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
625 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
626 printf("%s, bad version string\n", "$min_audiofile_version");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
627 exit(1);
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
628 }
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
629
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
630 if (($audiofile_major_version > major) ||
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
631 (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) ||
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
632 (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro)))
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
633 {
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
634 return 0;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
635 }
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
636 else
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
637 {
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
638 printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version);
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
639 printf("*** of the Audio File Library required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro);
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
640 printf("*** best to upgrade to the required version.\n");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
641 printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
642 printf("*** to point to the correct copy of audiofile-config, and remove the file\n");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
643 printf("*** config.cache before re-running configure\n");
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
644 return 1;
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
645 }
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
646 }
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
647
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
648 ],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
649 CFLAGS="$ac_save_CFLAGS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
650 LIBS="$ac_save_LIBS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
651 AC_LANG_RESTORE
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
652 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
653 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
654 if test "x$no_audiofile" = x ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
655 AC_MSG_RESULT(yes)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
656 ifelse([$2], , :, [$2])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
657 else
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
658 AC_MSG_RESULT(no)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
659 if test "$AUDIOFILE_CONFIG" = "no" ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
660 cat <<END
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
661 *** The audiofile-config script installed by the Audio File Library could
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
662 *** not be found. If the Audio File Library was installed in PREFIX, make
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
663 *** sure PREFIX/bin is in your path, or set the AUDIOFILE_CONFIG
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
664 *** environment variable to the full path to audiofile-config.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
665 END
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
666 else
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
667 if test -f conf.audiofiletest ; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
668 :
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
669 else
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
670 echo "*** Could not run Audio File Library test program; checking why..."
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
671 AC_LANG_SAVE
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
672 AC_LANG_C
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
673 CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
674 LIBS="$LIBS $AUDIOFILE_LIBS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
675 AC_TRY_LINK([
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
676 #include <stdio.h>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
677 #include <audiofile.h>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
678 ], [ return 0; ],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
679 [ cat <<END
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
680 *** The test program compiled, but did not run. This usually means that
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
681 *** the run-time linker is not finding Audio File Library or finding the
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
682 *** wrong version of Audio File Library.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
683 ***
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
684 *** If it is not finding Audio File Library, you'll need to set your
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
685 *** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
686 *** to the installed location. Also, make sure you have run ldconfig if
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
687 *** that is required on your system.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
688 ***
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
689 *** If you have an old version installed, it is best to remove it, although
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
690 *** you may also be able to get things to work by modifying
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
691 *** LD_LIBRARY_PATH.
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
692 END
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
693 ],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
694 [ echo "*** The test program failed to compile or link. See the file config.log"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
695 echo "*** for the exact error that occured. This usually means the Audio File"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
696 echo "*** Library was incorrectly installed or that you have moved the Audio"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
697 echo "*** File Library since it was installed. In the latter case, you may want"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
698 echo "*** to edit the audiofile-config script: $AUDIOFILE_CONFIG" ])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
699 CFLAGS="$ac_save_CFLAGS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
700 LIBS="$ac_save_LIBS"
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
701 AC_LANG_RESTORE
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
702 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
703 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
704 AUDIOFILE_CFLAGS=""
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
705 AUDIOFILE_LIBS=""
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
706 ifelse([$3], , :, [$3])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
707 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
708 AC_SUBST(AUDIOFILE_CFLAGS)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
709 AC_SUBST(AUDIOFILE_LIBS)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
710 rm -f conf.audiofiletest
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
711 ])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
712
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
713 dnl ac_var_timeszone_externals.m4
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
714
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
715 # Define 'timezone', 'altzone' and 'daylight'
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
716 # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
717 # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
718 # the external timezone variables 'timezone', 'altzone' and 'daylight' exist,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
719 # defining 'HAVE_TIMEZONE', 'HAVE_ALTZONE' and 'HAVE_DAYLIGHT' respectively
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
720 # (as well as gaining the macros defined by 'AC_STRUCT_TIMEZONE').
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
721 # Mark R.Bannister <markb@freedomware.co.uk>
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
722 AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
723 [ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
724 AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
725 [ AC_TRY_LINK([#include <time.h>], [return (int)timezone;],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
726 mb_cv_var_timezone=yes,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
727 mb_cv_var_timezone=no)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
728 ])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
729 AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
730 [ AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
731 mb_cv_var_altzone=yes,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
732 mb_cv_var_altzone=no)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
733 ])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
734 AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
735 [ AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
736 mb_cv_var_daylight=yes,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
737 mb_cv_var_daylight=no)
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
738 ])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
739 if test $mb_cv_var_timezone = yes; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
740 AC_DEFINE([HAVE_TIMEZONE], 1,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
741 [Define if you have the external 'timezone' variable.])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
742 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
743 if test $mb_cv_var_altzone = yes; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
744 AC_DEFINE([HAVE_ALTZONE], 1,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
745 [Define if you have the external 'altzone' variable.])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
746 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
747 if test $mb_cv_var_daylight = yes; then
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
748 AC_DEFINE([HAVE_DAYLIGHT], 1,
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
749 [Define if you have the external 'daylight' variable.])
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
750 fi
27354602734d [gaim-migrate @ 4845]
Nathan Walp <nwalp@pidgin.im>
parents: 4563
diff changeset
751 ])
7201
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
752
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
753 dnl Available from the GNU Autoconf Macro Archive at:
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
754 dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_perl_modules.html
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
755 dnl
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
756 AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
757 ac_perl_modules="$1"
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
758 # Make sure we have perl
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
759 if test -z "$PERL"; then
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
760 AC_CHECK_PROG(PERL,perl,perl)
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
761 fi
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
762
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
763 if test "x$PERL" != x; then
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
764 ac_perl_modules_failed=0
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
765 for ac_perl_module in $ac_perl_modules; do
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
766 AC_MSG_CHECKING(for perl module $ac_perl_module)
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
767
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
768 # Would be nice to log result here, but can't rely on autoconf internals
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
769 $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
770 if test $? -ne 0; then
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
771 AC_MSG_RESULT(no);
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
772 ac_perl_modules_failed=1
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
773 else
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
774 AC_MSG_RESULT(ok);
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
775 fi
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
776 done
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
777
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
778 # Run optional shell commands
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
779 if test "$ac_perl_modules_failed" = 0; then
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
780 :
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
781 $2
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
782 else
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
783 :
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
784 $3
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
785 fi
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
786 else
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
787 AC_MSG_WARN(could not find perl)
35f92559a4a1 [gaim-migrate @ 7770]
Christian Hammond <chipx86@chipx86.com>
parents: 4564
diff changeset
788 fi])dnl