3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- /dev/null 2003-09-23 18:19:32.000000000 -0400
7 +++ smpeg/m4/gtk.m4 2004-03-05 07:57:39.000000000 -0500
9 +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
10 +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
12 +AC_DEFUN([AM_PATH_GTK],
14 +dnl Get the cflags and libraries from the pkg-config script
16 +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK 2.0 is installed (optional)],
17 + gtk_config_prefix="$withval", gtk_config_prefix="")
18 +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK 2.0 is installed (optional)],
19 + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
20 +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK 2.0 program],
21 + , enable_gtktest=yes)
27 + gtk_config_args="$gtk_config_args gthread-2.0"
32 + if test x$gtk_config_exec_prefix != x ; then
33 + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
34 + if test x${PKG_CONFIG+set} != xset ; then
35 + PKG_CONFIG=$gtk_config_exec_prefix/bin/pkg-config
38 + if test x$gtk_config_prefix != x ; then
39 + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
40 + if test x${PKG_CONFIG+set} != xset ; then
41 + PKG_CONFIG=$gtk_config_prefix/bin/pkg-config
45 + AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
46 + min_gtk_version=ifelse([$1], ,2.0,$1)
47 + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
49 + if test "$PKG_CONFIG" = "no" ; then
52 + GTK_CFLAGS=`$PKG_CONFIG $gtk_config_args --cflags gtk+-2.0`
53 + GTK_LIBS=`$PKG_CONFIG $gtk_config_args --libs gtk+-2.0`
54 + gtk_config_major_version=`$PKG_CONFIG $gtk_config_args --modversion gtk+-2.0 | \
55 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
56 + gtk_config_minor_version=`$PKG_CONFIG $gtk_config_args --modversion gtk+-2.0 | \
57 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
58 + gtk_config_micro_version=`$PKG_CONFIG $gtk_config_args --modversion gtk+-2.0 | \
59 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
60 + if test "x$enable_gtktest" = "xyes" ; then
61 + ac_save_CFLAGS="$CFLAGS"
62 + ac_save_LIBS="$LIBS"
63 + CFLAGS="$CFLAGS $GTK_CFLAGS"
64 + LIBS="$GTK_LIBS $LIBS"
66 +dnl Now check if the installed GTK is sufficiently new. (Also sanity
67 +dnl checks the results of pkg-config to some extent
78 + int major, minor, micro;
81 + system ("touch conf.gtktest");
83 + /* HP/UX 9 (%@#!) writes to sscanf strings */
84 + tmp_version = g_strdup("$min_gtk_version");
85 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
86 + printf("%s, bad version string\n", "$min_gtk_version");
90 + if ((gtk_major_version != $gtk_config_major_version) ||
91 + (gtk_minor_version != $gtk_config_minor_version) ||
92 + (gtk_micro_version != $gtk_config_micro_version))
94 + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
95 + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
96 + gtk_major_version, gtk_minor_version, gtk_micro_version);
97 + printf ("*** was found! If pkg-config was correct, then it is best\n");
98 + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
99 + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
100 + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
101 + printf("*** required on your system.\n");
102 + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG\n");
103 + printf("*** to point to the correct copy of pkg-config, and remove the file config.cache\n");
104 + printf("*** before re-running configure\n");
106 +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
107 + else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
108 + (gtk_minor_version != GTK_MINOR_VERSION) ||
109 + (gtk_micro_version != GTK_MICRO_VERSION))
111 + printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
112 + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
113 + printf("*** library (version %d.%d.%d)\n",
114 + gtk_major_version, gtk_minor_version, gtk_micro_version);
116 +#endif /* defined (GTK_MAJOR_VERSION) ... */
119 + if ((gtk_major_version > major) ||
120 + ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
121 + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
127 + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
128 + gtk_major_version, gtk_minor_version, gtk_micro_version);
129 + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
130 + major, minor, micro);
131 + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
133 + printf("*** If you have already installed a sufficiently new version, this error\n");
134 + printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
135 + printf("*** being found. The easiest way to fix this is to remove the old version\n");
136 + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
137 + printf("*** correct copy of pkg-config. (In this case, you will have to\n");
138 + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
139 + printf("*** so that the correct libraries are found at run-time))\n");
144 +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
145 + CFLAGS="$ac_save_CFLAGS"
146 + LIBS="$ac_save_LIBS"
149 + if test "x$no_gtk" = x ; then
151 + ifelse([$2], , :, [$2])
154 + if test "$PKG_CONFIG" = "no" ; then
155 + echo "*** The pkg-config script installed by GTK could not be found"
156 + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
157 + echo "*** your path, or set the PKG_CONFIG environment variable to the"
158 + echo "*** full path to pkg-config."
160 + if test -f conf.gtktest ; then
163 + echo "*** Could not run GTK 2.0 test program, checking why..."
164 + CFLAGS="$CFLAGS $GTK_CFLAGS"
165 + LIBS="$LIBS $GTK_LIBS"
167 +#include <gtk/gtk.h>
169 +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
170 + [ echo "*** The test program compiled, but did not run. This usually means"
171 + echo "*** that the run-time linker is not finding GTK or finding the wrong"
172 + echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
173 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
174 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
175 + echo "*** is required on your system"
177 + echo "*** If you have an old version installed, it is best to remove it, although"
178 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
180 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
181 + echo "*** exact error that occured. This usually means GTK was incorrectly installed"
182 + echo "*** or that you have moved GTK since it was installed. In the latter case, you"
183 + echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
184 + CFLAGS="$ac_save_CFLAGS"
185 + LIBS="$ac_save_LIBS"
190 + ifelse([$3], , :, [$3])
192 + AC_SUBST(GTK_CFLAGS)
196 --- /dev/null 2003-09-23 18:19:32.000000000 -0400
197 +++ smpeg/m4/sdl.m4 2004-03-05 07:53:32.000000000 -0500
199 +# Configure paths for SDL
200 +# Sam Lantinga 9/21/99
201 +# stolen from Manish Singh
202 +# stolen back from Frank Belew
203 +# stolen from Manish Singh
204 +# Shamelessly stolen from Owen Taylor
206 +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
207 +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
209 +AC_DEFUN([AM_PATH_SDL],
211 +dnl Get the cflags and libraries from the sdl-config script
213 +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
214 + sdl_prefix="$withval", sdl_prefix="")
215 +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
216 + sdl_exec_prefix="$withval", sdl_exec_prefix="")
217 +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
218 + , enable_sdltest=yes)
220 + if test x$sdl_exec_prefix != x ; then
221 + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
222 + if test x${SDL_CONFIG+set} != xset ; then
223 + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
226 + if test x$sdl_prefix != x ; then
227 + sdl_args="$sdl_args --prefix=$sdl_prefix"
228 + if test x${SDL_CONFIG+set} != xset ; then
229 + SDL_CONFIG=$sdl_prefix/bin/sdl-config
233 + AC_REQUIRE([AC_CANONICAL_TARGET])
234 + PATH="$prefix/bin:$prefix/usr/bin:$PATH"
235 + AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
236 + min_sdl_version=ifelse([$1], ,0.11.0,$1)
237 + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
239 + if test "$SDL_CONFIG" = "no" ; then
242 + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
243 + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
245 + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
246 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
247 + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
248 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
249 + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
250 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
251 + if test "x$enable_sdltest" = "xyes" ; then
252 + ac_save_CFLAGS="$CFLAGS"
253 + ac_save_LIBS="$LIBS"
254 + CFLAGS="$CFLAGS $SDL_CFLAGS"
255 + LIBS="$LIBS $SDL_LIBS"
257 +dnl Now check if the installed SDL is sufficiently new. (Also sanity
258 +dnl checks the results of sdl-config to some extent
268 +my_strdup (char *str)
274 + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
275 + strcpy (new_str, str);
283 +int main (int argc, char *argv[])
285 + int major, minor, micro;
288 + /* This hangs on some systems (?)
289 + system ("touch conf.sdltest");
291 + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
293 + /* HP/UX 9 (%@#!) writes to sscanf strings */
294 + tmp_version = my_strdup("$min_sdl_version");
295 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
296 + printf("%s, bad version string\n", "$min_sdl_version");
300 + if (($sdl_major_version > major) ||
301 + (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
302 + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
308 + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
309 + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
310 + printf("*** best to upgrade to the required version.\n");
311 + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
312 + printf("*** to point to the correct copy of sdl-config, and remove the file\n");
313 + printf("*** config.cache before re-running configure\n");
318 +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
319 + CFLAGS="$ac_save_CFLAGS"
320 + LIBS="$ac_save_LIBS"
323 + if test "x$no_sdl" = x ; then
325 + ifelse([$2], , :, [$2])
328 + if test "$SDL_CONFIG" = "no" ; then
329 + echo "*** The sdl-config script installed by SDL could not be found"
330 + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
331 + echo "*** your path, or set the SDL_CONFIG environment variable to the"
332 + echo "*** full path to sdl-config."
334 + if test -f conf.sdltest ; then
337 + echo "*** Could not run SDL test program, checking why..."
338 + CFLAGS="$CFLAGS $SDL_CFLAGS"
339 + LIBS="$LIBS $SDL_LIBS"
344 +int main(int argc, char *argv[])
347 +#define main K_and_R_C_main
349 + [ echo "*** The test program compiled, but did not run. This usually means"
350 + echo "*** that the run-time linker is not finding SDL or finding the wrong"
351 + echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
352 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
353 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
354 + echo "*** is required on your system"
356 + echo "*** If you have an old version installed, it is best to remove it, although"
357 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
358 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
359 + echo "*** exact error that occured. This usually means SDL was incorrectly installed"
360 + echo "*** or that you have moved SDL since it was installed. In the latter case, you"
361 + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
362 + CFLAGS="$ac_save_CFLAGS"
363 + LIBS="$ac_save_LIBS"
368 + ifelse([$3], , :, [$3])
370 + AC_SUBST(SDL_CFLAGS)
374 --- /dev/null 2003-09-23 18:19:32.000000000 -0400
375 +++ smpeg/m4/socklen.m4 2004-03-05 08:05:22.000000000 -0500
377 +AH_TEMPLATE(socklen_t, [The type for socklen])
378 +AC_DEFUN([AC_TYPE_SOCKLEN_T],
379 +[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
382 + [#include <sys/types.h>
383 + #include <sys/socket.h>],
384 + [socklen_t len = 42; return 0;],
385 + ac_cv_type_socklen_t=yes,
386 + ac_cv_type_socklen_t=no)
388 + if test $ac_cv_type_socklen_t != yes; then
389 + AC_DEFINE(socklen_t, int)