1 Include GTK-1 autoconf directives in build system.
2 Applied-Upstream: http://lame.cvs.sf.net/viewvc/lame/lame/acinclude.m4?r1=1.5&r2=1.6
5 http://lame.cvs.sf.net/viewvc/lame/lame/acinclude.m4?r1=1.5&r2=1.6&view=patch
9 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
11 --- a/acinclude.m4 2006/12/21 09:03:03 1.5
12 +++ b/acinclude.m4 2012/06/18 20:51:05 1.6
14 [AC_MSG_WARN(can't check for IEEE854 compliant 80 bit floats)]
15 )])]) # alex_IEEE854_FLOAT80
17 +# Configure paths for GTK+
18 +# Owen Taylor 97-11-3
20 +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
21 +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
23 +AC_DEFUN([AM_PATH_GTK],
25 +dnl Get the cflags and libraries from the gtk-config script
27 +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
28 + gtk_config_prefix="$withval", gtk_config_prefix="")
29 +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
30 + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
31 +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
32 + , enable_gtktest=yes)
38 + gtk_config_args="$gtk_config_args gthread"
43 + if test x$gtk_config_exec_prefix != x ; then
44 + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
45 + if test x${GTK_CONFIG+set} != xset ; then
46 + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
49 + if test x$gtk_config_prefix != x ; then
50 + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
51 + if test x${GTK_CONFIG+set} != xset ; then
52 + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
56 + AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
57 + min_gtk_version=ifelse([$1], ,0.99.7,$1)
58 + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
60 + if test "$GTK_CONFIG" = "no" ; then
63 + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
64 + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
65 + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
66 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
67 + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
68 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
69 + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
70 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
71 + if test "x$enable_gtktest" = "xyes" ; then
72 + ac_save_CFLAGS="$CFLAGS"
73 + ac_save_LIBS="$LIBS"
74 + CFLAGS="$CFLAGS $GTK_CFLAGS"
75 + LIBS="$GTK_LIBS $LIBS"
77 +dnl Now check if the installed GTK is sufficiently new. (Also sanity
78 +dnl checks the results of gtk-config to some extent
89 + int major, minor, micro;
92 + system ("touch conf.gtktest");
94 + /* HP/UX 9 (%@#!) writes to sscanf strings */
95 + tmp_version = g_strdup("$min_gtk_version");
96 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
97 + printf("%s, bad version string\n", "$min_gtk_version");
101 + if ((gtk_major_version != $gtk_config_major_version) ||
102 + (gtk_minor_version != $gtk_config_minor_version) ||
103 + (gtk_micro_version != $gtk_config_micro_version))
105 + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
106 + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
107 + gtk_major_version, gtk_minor_version, gtk_micro_version);
108 + printf ("*** was found! If gtk-config was correct, then it is best\n");
109 + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
110 + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
111 + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
112 + printf("*** required on your system.\n");
113 + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
114 + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
115 + printf("*** before re-running configure\n");
117 +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
118 + else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
119 + (gtk_minor_version != GTK_MINOR_VERSION) ||
120 + (gtk_micro_version != GTK_MICRO_VERSION))
122 + printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
123 + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
124 + printf("*** library (version %d.%d.%d)\n",
125 + gtk_major_version, gtk_minor_version, gtk_micro_version);
127 +#endif /* defined (GTK_MAJOR_VERSION) ... */
130 + if ((gtk_major_version > major) ||
131 + ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
132 + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
138 + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
139 + gtk_major_version, gtk_minor_version, gtk_micro_version);
140 + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
141 + major, minor, micro);
142 + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
144 + printf("*** If you have already installed a sufficiently new version, this error\n");
145 + printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
146 + printf("*** being found. The easiest way to fix this is to remove the old version\n");
147 + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
148 + printf("*** correct copy of gtk-config. (In this case, you will have to\n");
149 + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
150 + printf("*** so that the correct libraries are found at run-time))\n");
155 +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
156 + CFLAGS="$ac_save_CFLAGS"
157 + LIBS="$ac_save_LIBS"
160 + if test "x$no_gtk" = x ; then
162 + ifelse([$2], , :, [$2])
165 + if test "$GTK_CONFIG" = "no" ; then
166 + echo "*** The gtk-config script installed by GTK could not be found"
167 + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
168 + echo "*** your path, or set the GTK_CONFIG environment variable to the"
169 + echo "*** full path to gtk-config."
171 + if test -f conf.gtktest ; then
174 + echo "*** Could not run GTK test program, checking why..."
175 + CFLAGS="$CFLAGS $GTK_CFLAGS"
176 + LIBS="$LIBS $GTK_LIBS"
178 +#include <gtk/gtk.h>
180 +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
181 + [ echo "*** The test program compiled, but did not run. This usually means"
182 + echo "*** that the run-time linker is not finding GTK or finding the wrong"
183 + echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
184 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
185 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
186 + echo "*** is required on your system"
188 + echo "*** If you have an old version installed, it is best to remove it, although"
189 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
191 + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
192 + echo "*** came with the system with the command"
194 + echo "*** rpm --erase --nodeps gtk gtk-devel" ],
195 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
196 + echo "*** exact error that occured. This usually means GTK was incorrectly installed"
197 + echo "*** or that you have moved GTK since it was installed. In the latter case, you"
198 + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
199 + CFLAGS="$ac_save_CFLAGS"
200 + LIBS="$ac_save_LIBS"
205 + ifelse([$3], , :, [$3])
207 + AC_SUBST(GTK_CFLAGS)