Magellan Linux

Contents of /trunk/libsdl/patches/libsdl-1.2.11-yasm-checks.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (show annotations) (download)
Tue May 8 20:06:05 2007 UTC (17 years ago) by niro
File size: 3226 byte(s)
-import

1 make sure the yasm we have supports all the required features
2
3 http://bugs.gentoo.org/163053
4 http://bugzilla.libsdl.org/show_bug.cgi?id=393
5
6 Index: configure.in
7 ===================================================================
8 --- configure.in (revision 2987)
9 +++ configure.in (working copy)
10 @@ -640,38 +640,56 @@ CheckNASM()
11 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
12 , enable_nasm=yes)
13 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
14 + CompileNASM()
15 + {
16 + # Usage: CompileNASM <filename>
17 + AC_MSG_CHECKING(to see if $NASM supports $1)
18 + if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
19 + CompileNASM_ret="yes"
20 + else
21 + CompileNASM_ret="no"
22 + fi
23 + rm -f $1 $1.o
24 + AC_MSG_RESULT($CompileNASM_ret)
25 + test "$CompileNASM_ret" = "yes"
26 + }
27 +
28 + if test x"$NASMFLAGS" = x; then
29 + case $ARCH in
30 + win32)
31 + NASMFLAGS="-f win32"
32 + ;;
33 + openbsd)
34 + NASMFLAGS="-f aoutb"
35 + ;;
36 + macosx)
37 + NASMFLAGS="-f macho"
38 + ;;
39 + *)
40 + NASMFLAGS="-f elf"
41 + ;;
42 + esac
43 + fi
44 +
45 AC_PATH_PROG(NASM, yasm)
46 + echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
47 + echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
48 + echo "%endif" >> unquoted-sections
49 + CompileNASM unquoted-sections || NASM=""
50 +
51 if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
52 + $as_unset ac_cv_path_NASM
53 AC_PATH_PROG(NASM, nasm)
54 fi
55 if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
56 AC_DEFINE(SDL_HERMES_BLITTERS)
57 SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
58 - if test x"$NASMFLAGS" = x; then
59 - case $ARCH in
60 - win32)
61 - NASMFLAGS="-f win32"
62 - ;;
63 - openbsd)
64 - NASMFLAGS="-f aoutb"
65 - ;;
66 - macosx)
67 - NASMFLAGS="-f macho"
68 - ;;
69 - *)
70 - NASMFLAGS="-f elf"
71 - ;;
72 - esac
73 - fi
74 NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
75
76 dnl See if hidden visibility is supported
77 - echo "GLOBAL _bar:function hidden" > nasm_vis.asm
78 - echo "_bar:" >>nasm_vis.asm
79 - if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD 2>&1; then
80 - NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
81 - fi
82 - rm -f nasm_vis.asm nasm_vis.o
83 + echo "GLOBAL _bar:function hidden" > symbol-visibility
84 + echo "_bar:" >> symbol-visibility
85 + CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
86
87 AC_SUBST(NASM)
88 AC_SUBST(NASMFLAGS)