rename packages/ to recipes/ per earlier agreement
[openembedded.git] / recipes / smpeg / smpeg / m4.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
6 --- /dev/null   2003-09-23 18:19:32.000000000 -0400
7 +++ smpeg/m4/gtk.m4     2004-03-05 07:57:39.000000000 -0500
8 @@ -0,0 +1,187 @@
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
11 +dnl
12 +AC_DEFUN([AM_PATH_GTK],
13 +[dnl 
14 +dnl Get the cflags and libraries from the pkg-config script
15 +dnl
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)
22 +
23 +  for module in . $4
24 +  do
25 +      case "$module" in
26 +         gthread-2.0) 
27 +             gtk_config_args="$gtk_config_args gthread-2.0"
28 +         ;;
29 +      esac
30 +  done
31 +
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
36 +     fi
37 +  fi
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
42 +     fi
43 +  fi
44 +
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)
48 +  no_gtk=""
49 +  if test "$PKG_CONFIG" = "no" ; then
50 +    no_gtk=yes
51 +  else
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"
65 +dnl
66 +dnl Now check if the installed GTK is sufficiently new. (Also sanity
67 +dnl checks the results of pkg-config to some extent
68 +dnl
69 +      rm -f conf.gtktest
70 +      AC_TRY_RUN([
71 +#include <gtk/gtk.h>
72 +#include <stdio.h>
73 +#include <stdlib.h>
74 +
75 +int 
76 +main ()
77 +{
78 +  int major, minor, micro;
79 +  char *tmp_version;
80 +
81 +  system ("touch conf.gtktest");
82 +
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, &micro) != 3) {
86 +     printf("%s, bad version string\n", "$min_gtk_version");
87 +     exit(1);
88 +   }
89 +
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))
93 +    {
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");
105 +    } 
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))
110 +    {
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);
115 +    }
116 +#endif /* defined (GTK_MAJOR_VERSION) ... */
117 +  else
118 +    {
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)))
122 +      {
123 +        return 0;
124 +       }
125 +     else
126 +      {
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");
132 +        printf("***\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");
140 +      }
141 +    }
142 +  return 1;
143 +}
144 +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
145 +       CFLAGS="$ac_save_CFLAGS"
146 +       LIBS="$ac_save_LIBS"
147 +     fi
148 +  fi
149 +  if test "x$no_gtk" = x ; then
150 +     AC_MSG_RESULT(yes)
151 +     ifelse([$2], , :, [$2])     
152 +  else
153 +     AC_MSG_RESULT(no)
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."
159 +     else
160 +       if test -f conf.gtktest ; then
161 +        :
162 +       else
163 +          echo "*** Could not run GTK 2.0 test program, checking why..."
164 +          CFLAGS="$CFLAGS $GTK_CFLAGS"
165 +          LIBS="$LIBS $GTK_LIBS"
166 +          AC_TRY_LINK([
167 +#include <gtk/gtk.h>
168 +#include <stdio.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"
176 +         echo "***"
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"
179 +          echo "***" ],
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"
186 +       fi
187 +     fi
188 +     GTK_CFLAGS=""
189 +     GTK_LIBS=""
190 +     ifelse([$3], , :, [$3])
191 +  fi
192 +  AC_SUBST(GTK_CFLAGS)
193 +  AC_SUBST(GTK_LIBS)
194 +  rm -f conf.gtktest
195 +])
196 --- /dev/null   2003-09-23 18:19:32.000000000 -0400
197 +++ smpeg/m4/sdl.m4     2004-03-05 07:53:32.000000000 -0500
198 @@ -0,0 +1,175 @@
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
205 +
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
208 +dnl
209 +AC_DEFUN([AM_PATH_SDL],
210 +[dnl 
211 +dnl Get the cflags and libraries from the sdl-config script
212 +dnl
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)
219 +
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
224 +     fi
225 +  fi
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
230 +     fi
231 +  fi
232 +
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)
238 +  no_sdl=""
239 +  if test "$SDL_CONFIG" = "no" ; then
240 +    no_sdl=yes
241 +  else
242 +    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
243 +    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
244 +
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"
256 +dnl
257 +dnl Now check if the installed SDL is sufficiently new. (Also sanity
258 +dnl checks the results of sdl-config to some extent
259 +dnl
260 +      rm -f conf.sdltest
261 +      AC_TRY_RUN([
262 +#include <stdio.h>
263 +#include <stdlib.h>
264 +#include <string.h>
265 +#include "SDL.h"
266 +
267 +char*
268 +my_strdup (char *str)
269 +{
270 +  char *new_str;
271 +  
272 +  if (str)
273 +    {
274 +      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
275 +      strcpy (new_str, str);
276 +    }
277 +  else
278 +    new_str = NULL;
279 +  
280 +  return new_str;
281 +}
282 +
283 +int main (int argc, char *argv[])
284 +{
285 +  int major, minor, micro;
286 +  char *tmp_version;
287 +
288 +  /* This hangs on some systems (?)
289 +  system ("touch conf.sdltest");
290 +  */
291 +  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
292 +
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, &micro) != 3) {
296 +     printf("%s, bad version string\n", "$min_sdl_version");
297 +     exit(1);
298 +   }
299 +
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)))
303 +    {
304 +      return 0;
305 +    }
306 +  else
307 +    {
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");
314 +      return 1;
315 +    }
316 +}
317 +
318 +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
319 +       CFLAGS="$ac_save_CFLAGS"
320 +       LIBS="$ac_save_LIBS"
321 +     fi
322 +  fi
323 +  if test "x$no_sdl" = x ; then
324 +     AC_MSG_RESULT(yes)
325 +     ifelse([$2], , :, [$2])     
326 +  else
327 +     AC_MSG_RESULT(no)
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."
333 +     else
334 +       if test -f conf.sdltest ; then
335 +        :
336 +       else
337 +          echo "*** Could not run SDL test program, checking why..."
338 +          CFLAGS="$CFLAGS $SDL_CFLAGS"
339 +          LIBS="$LIBS $SDL_LIBS"
340 +          AC_TRY_LINK([
341 +#include <stdio.h>
342 +#include "SDL.h"
343 +
344 +int main(int argc, char *argv[])
345 +{ return 0; }
346 +#undef  main
347 +#define main K_and_R_C_main
348 +],      [ return 0; ],
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"
355 +         echo "***"
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"
364 +       fi
365 +     fi
366 +     SDL_CFLAGS=""
367 +     SDL_LIBS=""
368 +     ifelse([$3], , :, [$3])
369 +  fi
370 +  AC_SUBST(SDL_CFLAGS)
371 +  AC_SUBST(SDL_LIBS)
372 +  rm -f conf.sdltest
373 +])
374 --- /dev/null   2003-09-23 18:19:32.000000000 -0400
375 +++ smpeg/m4/socklen.m4 2004-03-05 08:05:22.000000000 -0500
376 @@ -0,0 +1,15 @@
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,
380 +[
381 +  AC_TRY_COMPILE(
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)
387 +])
388 +  if test $ac_cv_type_socklen_t != yes; then
389 +    AC_DEFINE(socklen_t, int)
390 +  fi
391 +])