Gentoo Archives: gentoo-commits

From: "Sergei Trofimovich (slyfox)" <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-misc/bb/files: bb-1.3.0_rc1-m4-stuff.patch
Date: Tue, 07 Feb 2012 08:10:53
Message-Id: 20120207081042.D30FC2004C@flycatcher.gentoo.org
1 slyfox 12/02/07 08:10:42
2
3 Added: bb-1.3.0_rc1-m4-stuff.patch
4 Log:
5 Fix aclocal failure on libmikmod-less systems (bundled .m4 bits).
6
7 (Portage version: 2.2.0_alpha84_p53/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-misc/bb/files/bb-1.3.0_rc1-m4-stuff.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/bb/files/bb-1.3.0_rc1-m4-stuff.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/bb/files/bb-1.3.0_rc1-m4-stuff.patch?rev=1.1&content-type=text/plain
14
15 Index: bb-1.3.0_rc1-m4-stuff.patch
16 ===================================================================
17 Fix aclocal failure on libmikmod-less systems
18
19 commit 55b86efdc3e2a1febb593169b10ab252c75fdb10
20 Author: Sergei Trofimovich <slyfox@g.o>
21 Date: Tue Feb 7 10:59:09 2012 +0300
22
23 bb-1.3.0_rc1: bundle m4 source
24
25 diff --git m4/aalib.m4 m4/aalib.m4
26 new file mode 100644
27 index 0000000..991fbda
28 --- /dev/null
29 +++ m4/aalib.m4
30 @@ -0,0 +1,169 @@
31 +# Configure paths for AALIB
32 +# Jan Hubicka 4/22/2001
33 +# stolen from Sam Lantinga 9/21/99
34 +# stolen from Manish Singh
35 +# stolen back from Frank Belew
36 +# stolen from Manish Singh
37 +# Shamelessly stolen from Owen Taylor
38 +
39 +dnl AM_PATH_AALIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
40 +dnl Test for AALIB, and define AALIB_CFLAGS and AALIB_LIBS
41 +dnl
42 +AC_DEFUN([AM_PATH_AALIB],
43 +[dnl
44 +dnl Get the cflags and libraries from the aalib-config script
45 +dnl
46 +AC_ARG_WITH(aalib-prefix,[ --with-aalib-prefix=PFX Prefix where AALIB is installed (optional)],
47 + aalib_prefix="$withval", aalib_prefix="")
48 +AC_ARG_WITH(aalib-exec-prefix,[ --with-aalib-exec-prefix=PFX Exec prefix where AALIB is installed (optional)],
49 + aalib_exec_prefix="$withval", aalib_exec_prefix="")
50 +AC_ARG_ENABLE(aalibtest, [ --disable-aalibtest Do not try to compile and run a test AALIB program],
51 + , enable_aalibtest=yes)
52 +
53 + if test x$aalib_exec_prefix != x ; then
54 + aalib_args="$aalib_args --exec-prefix=$aalib_exec_prefix"
55 + if test x${AALIB_CONFIG+set} != xset ; then
56 + AALIB_CONFIG=$aalib_exec_prefix/bin/aalib-config
57 + fi
58 + fi
59 + if test x$aalib_prefix != x ; then
60 + aalib_args="$aalib_args --prefix=$aalib_prefix"
61 + if test x${AALIB_CONFIG+set} != xset ; then
62 + AALIB_CONFIG=$aalib_prefix/bin/aalib-config
63 + fi
64 + fi
65 +
66 + AC_PATH_PROG(AALIB_CONFIG, aalib-config, no)
67 + min_aalib_version=ifelse([$1], ,0.11.0,$1)
68 + AC_MSG_CHECKING(for AALIB - version >= $min_aalib_version)
69 + no_aalib=""
70 + if test "$AALIB_CONFIG" = "no" ; then
71 + no_aalib=yes
72 + else
73 + AALIB_CFLAGS=`$AALIB_CONFIG $aalibconf_args --cflags`
74 + AALIB_LIBS=`$AALIB_CONFIG $aalibconf_args --libs`
75 +
76 + aalib_major_version=`$AALIB_CONFIG $aalib_args --version | \
77 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
78 + aalib_minor_version=`$AALIB_CONFIG $aalib_args --version | \
79 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
80 + aalib_micro_version=`$AALIB_CONFIG $aalib_config_args --version | \
81 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
82 + if test "x$enable_aalibtest" = "xyes" ; then
83 + ac_save_CFLAGS="$CFLAGS"
84 + ac_save_LIBS="$LIBS"
85 + CFLAGS="$CFLAGS $AALIB_CFLAGS"
86 + LIBS="$LIBS $AALIB_LIBS"
87 +dnl
88 +dnl Now check if the installed AALIB is sufficiently new. (Also sanity
89 +dnl checks the results of aalib-config to some extent
90 +dnl
91 + rm -f conf.aalibtest
92 + AC_TRY_RUN([
93 +#include <stdio.h>
94 +#include <stdlib.h>
95 +#include <string.h>
96 +#include "aalib.h"
97 +
98 +char*
99 +my_strdup (char *str)
100 +{
101 + char *new_str;
102 +
103 + if (str)
104 + {
105 + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
106 + strcpy (new_str, str);
107 + }
108 + else
109 + new_str = NULL;
110 +
111 + return new_str;
112 +}
113 +
114 +int main (int argc, char *argv[])
115 +{
116 + int major, minor, micro;
117 + char *tmp_version;
118 +
119 + /* This hangs on some systems (?)
120 + system ("touch conf.aalibtest");
121 + */
122 + { FILE *fp = fopen("conf.aalibtest", "a"); if ( fp ) fclose(fp); }
123 +
124 + /* HP/UX 9 (%@#!) writes to sscanf strings */
125 + tmp_version = my_strdup("$min_aalib_version");
126 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
127 + printf("%s, bad version string\n", "$min_aalib_version");
128 + exit(1);
129 + }
130 +
131 + if (($aalib_major_version > major) ||
132 + (($aalib_major_version == major) && ($aalib_minor_version > minor)) ||
133 + (($aalib_major_version == major) && ($aalib_minor_version == minor) && ($aalib_micro_version >= micro)))
134 + {
135 + return 0;
136 + }
137 + else
138 + {
139 + printf("\n*** 'aalib-config --version' returned %d.%d.%d, but the minimum version\n", $aalib_major_version, $aalib_minor_version, $aalib_micro_version);
140 + printf("*** of AALIB required is %d.%d.%d. If aalib-config is correct, then it is\n", major, minor, micro);
141 + printf("*** best to upgrade to the required version.\n");
142 + printf("*** If aalib-config was wrong, set the environment variable AALIB_CONFIG\n");
143 + printf("*** to point to the correct copy of aalib-config, and remove the file\n");
144 + printf("*** config.cache before re-running configure\n");
145 + return 1;
146 + }
147 +}
148 +
149 +],, no_aalib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
150 + CFLAGS="$ac_save_CFLAGS"
151 + LIBS="$ac_save_LIBS"
152 + fi
153 + fi
154 + if test "x$no_aalib" = x ; then
155 + AC_MSG_RESULT(yes)
156 + ifelse([$2], , :, [$2])
157 + else
158 + AC_MSG_RESULT(no)
159 + if test "$AALIB_CONFIG" = "no" ; then
160 + echo "*** The aalib-config script installed by AALIB could not be found"
161 + echo "*** If AALIB was installed in PREFIX, make sure PREFIX/bin is in"
162 + echo "*** your path, or set the AALIB_CONFIG environment variable to the"
163 + echo "*** full path to aalib-config."
164 + else
165 + if test -f conf.aalibtest ; then
166 + :
167 + else
168 + echo "*** Could not run AALIB test program, checking why..."
169 + CFLAGS="$CFLAGS $AALIB_CFLAGS"
170 + LIBS="$LIBS $AALIB_LIBS"
171 + AC_TRY_LINK([
172 +#include <stdio.h>
173 +#include "AALIB.h"
174 +], [ return 0; ],
175 + [ echo "*** The test program compiled, but did not run. This usually means"
176 + echo "*** that the run-time linker is not finding AALIB or finding the wrong"
177 + echo "*** version of AALIB. If it is not finding AALIB, you'll need to set your"
178 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
179 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
180 + echo "*** is required on your system"
181 + echo "***"
182 + echo "*** If you have an old version installed, it is best to remove it, although"
183 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
184 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
185 + echo "*** exact error that occured. This usually means AALIB was incorrectly installed"
186 + echo "*** or that you have moved AALIB since it was installed. In the latter case, you"
187 + echo "*** may want to edit the aalib-config script: $AALIB_CONFIG" ])
188 + CFLAGS="$ac_save_CFLAGS"
189 + LIBS="$ac_save_LIBS"
190 + fi
191 + fi
192 + AALIB_CFLAGS=""
193 + AALIB_LIBS=""
194 + ifelse([$3], , :, [$3])
195 + fi
196 + AC_SUBST(AALIB_CFLAGS)
197 + AC_SUBST(AALIB_LIBS)
198 + rm -f conf.aalibtest
199 +])
200 diff --git m4/libmikmod.m4 m4/libmikmod.m4
201 new file mode 100644
202 index 0000000..18feebe
203 --- /dev/null
204 +++ m4/libmikmod.m4
205 @@ -0,0 +1,207 @@
206 +# Configure paths for libmikmod
207 +#
208 +# Derived from glib.m4 (Owen Taylor 97-11-3)
209 +# Improved by Chris Butler
210 +#
211 +
212 +dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
213 +dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
214 +dnl LIBMIKMOD_LDADD
215 +dnl
216 +AC_DEFUN([AM_PATH_LIBMIKMOD],
217 +[dnl
218 +dnl Get the cflags and libraries from the libmikmod-config script
219 +dnl
220 +AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)],
221 + libmikmod_config_prefix="$withval", libmikmod_config_prefix="")
222 +AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)],
223 + libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="")
224 +AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program],
225 + , enable_libmikmodtest=yes)
226 +
227 + if test x$libmikmod_config_exec_prefix != x ; then
228 + libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix"
229 + if test x${LIBMIKMOD_CONFIG+set} != xset ; then
230 + LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config
231 + fi
232 + fi
233 + if test x$libmikmod_config_prefix != x ; then
234 + libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix"
235 + if test x${LIBMIKMOD_CONFIG+set} != xset ; then
236 + LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config
237 + fi
238 + fi
239 +
240 + AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no)
241 + min_libmikmod_version=ifelse([$1], ,3.1.5,$1)
242 + AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version)
243 + no_libmikmod=""
244 + if test "$LIBMIKMOD_CONFIG" = "no" ; then
245 + no_libmikmod=yes
246 + else
247 + LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`
248 + LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`
249 + LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`
250 + libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
251 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
252 + libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
253 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
254 + libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
255 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
256 + if test "x$enable_libmikmodtest" = "xyes" ; then
257 + ac_save_CFLAGS="$CFLAGS"
258 + ac_save_LIBS="$LIBS"
259 + AC_LANG_SAVE
260 + AC_LANG_C
261 + CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD"
262 + LIBS="$LIBMIKMOD_LIBS $LIBS"
263 +dnl
264 +dnl Now check if the installed libmikmod is sufficiently new. (Also sanity
265 +dnl checks the results of libmikmod-config to some extent
266 +dnl
267 + rm -f conf.mikmodtest
268 + AC_TRY_RUN([
269 +#include <mikmod.h>
270 +#include <stdio.h>
271 +#include <stdlib.h>
272 +
273 +char* my_strdup (char *str)
274 +{
275 + char *new_str;
276 +
277 + if (str) {
278 + new_str = malloc ((strlen (str) + 1) * sizeof(char));
279 + strcpy (new_str, str);
280 + } else
281 + new_str = NULL;
282 +
283 + return new_str;
284 +}
285 +
286 +int main()
287 +{
288 + int major,minor,micro;
289 + int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version;
290 + char *tmp_version;
291 +
292 + system("touch conf.mikmodtest");
293 +
294 + /* HP/UX 9 (%@#!) writes to sscanf strings */
295 + tmp_version = my_strdup("$min_libmikmod_version");
296 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
297 + printf("%s, bad version string\n", "$min_libmikmod_version");
298 + exit(1);
299 + }
300 +
301 + libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255;
302 + libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255;
303 + libmikmod_micro_version=(MikMod_GetVersion() ) & 255;
304 +
305 + if ((libmikmod_major_version != $libmikmod_config_major_version) ||
306 + (libmikmod_minor_version != $libmikmod_config_minor_version) ||
307 + (libmikmod_micro_version != $libmikmod_config_micro_version))
308 + {
309 + printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n",
310 + $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version,
311 + libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
312 + printf ("*** was found! If libmikmod-config was correct, then it is best\n");
313 + printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n");
314 + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
315 + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
316 + printf("*** required on your system.\n");
317 + printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n");
318 + printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n");
319 + printf("*** before re-running configure\n");
320 + }
321 + else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) ||
322 + (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) ||
323 + (libmikmod_micro_version != LIBMIKMOD_REVISION))
324 + {
325 + printf("*** libmikmod header files (version %d.%d.%d) do not match\n",
326 + LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION);
327 + printf("*** library (version %d.%d.%d)\n",
328 + libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
329 + }
330 + else
331 + {
332 + if ((libmikmod_major_version > major) ||
333 + ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) ||
334 + ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro)))
335 + {
336 + return 0;
337 + }
338 + else
339 + {
340 + printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n",
341 + libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
342 + printf("*** You need a version of libmikmod newer than %d.%d.%d.\n",
343 + major, minor, micro);
344 + printf("***\n");
345 + printf("*** If you have already installed a sufficiently new version, this error\n");
346 + printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n");
347 + printf("*** being found. The easiest way to fix this is to remove the old version\n");
348 + printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n");
349 + printf("*** correct copy of libmikmod-config. (In this case, you will have to\n");
350 + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
351 + printf("*** so that the correct libraries are found at run-time))\n");
352 + }
353 + }
354 + return 1;
355 +}
356 +],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
357 + CFLAGS="$ac_save_CFLAGS"
358 + LIBS="$ac_save_LIBS"
359 + AC_LANG_RESTORE
360 + fi
361 + fi
362 + if test "x$no_libmikmod" = x ; then
363 + AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`])
364 + ifelse([$2], , :, [$2])
365 + else
366 + AC_MSG_RESULT(no)
367 + if test "$LIBMIKMOD_CONFIG" = "no" ; then
368 + echo "*** The libmikmod-config script installed by libmikmod could not be found"
369 + echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in"
370 + echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the"
371 + echo "*** full path to libmikmod-config."
372 + else
373 + if test -f conf.mikmodtest ; then
374 + :
375 + else
376 + echo "*** Could not run libmikmod test program, checking why..."
377 + CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
378 + LIBS="$LIBS $LIBMIKMOD_LIBS"
379 + AC_LANG_SAVE
380 + AC_LANG_C
381 + AC_TRY_LINK([
382 +#include <mikmod.h>
383 +#include <stdio.h>
384 +], [ return (MikMod_GetVersion()!=0); ],
385 + [ echo "*** The test program compiled, but did not run. This usually means"
386 + echo "*** that the run-time linker is not finding libmikmod or finding the wrong"
387 + echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your"
388 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
389 + echo "*** to the installed location. Also, make sure you have run ldconfig if that"
390 + echo "*** is required on your system."
391 + echo "***"
392 + echo "*** If you have an old version installed, it is best to remove it, although"
393 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
394 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
395 + echo "*** exact error that occured. This usually means libmikmod was incorrectly installed"
396 + echo "*** or that you have moved libmikmod since it was installed. In the latter case, you"
397 + echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ])
398 + CFLAGS="$ac_save_CFLAGS"
399 + LIBS="$ac_save_LIBS"
400 + AC_LANG_RESTORE
401 + fi
402 + fi
403 + LIBMIKMOD_CFLAGS=""
404 + LIBMIKMOD_LIBS=""
405 + LIBMIKMOD_LDADD=""
406 + ifelse([$3], , :, [$3])
407 + fi
408 + AC_SUBST(LIBMIKMOD_CFLAGS)
409 + AC_SUBST(LIBMIKMOD_LIBS)
410 + AC_SUBST(LIBMIKMOD_LDADD)
411 + rm -f conf.mikmodtest
412 +])