comparison configure.in @ 3950:9d9e15ab1697 SDL-1.2

Check if yasm supports a nasm-specific syntax we use (it doesn't in 0.5.0, which is still common in Linux distros, and does in 0.6.0). Disable it if we don't, attempting to fallback to using nasm. Thanks to Mike Frysinger for the patch. Fixes Bugzilla #393.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 04 Jun 2007 11:06:48 +0000
parents 42e83d81224b
children d22892eaa1cf
comparison
equal deleted inserted replaced
3949:70dac8976f94 3950:9d9e15ab1697
660 dnl Check for NASM (for assembly blit routines) 660 dnl Check for NASM (for assembly blit routines)
661 AC_ARG_ENABLE(nasm, 661 AC_ARG_ENABLE(nasm,
662 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]), 662 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
663 , enable_nasm=yes) 663 , enable_nasm=yes)
664 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then 664 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
665 CompileNASM()
666 {
667 # Usage: CompileNASM <filename>
668 AC_MSG_CHECKING(to see if $NASM supports $1)
669 if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
670 CompileNASM_ret="yes"
671 else
672 CompileNASM_ret="no"
673 fi
674 rm -f $1 $1.o
675 AC_MSG_RESULT($CompileNASM_ret)
676 test "$CompileNASM_ret" = "yes"
677 }
678
679 if test x"$NASMFLAGS" = x; then
680 case $ARCH in
681 win32)
682 NASMFLAGS="-f win32"
683 ;;
684 openbsd)
685 NASMFLAGS="-f aoutb"
686 ;;
687 macosx)
688 NASMFLAGS="-f macho"
689 ;;
690 *)
691 NASMFLAGS="-f elf"
692 ;;
693 esac
694 fi
695
665 AC_PATH_PROG(NASM, yasm) 696 AC_PATH_PROG(NASM, yasm)
697 echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
698 echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
699 echo "%endif" >> unquoted-sections
700 CompileNASM unquoted-sections || NASM=""
701
666 if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then 702 if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
703 $as_unset ac_cv_path_NASM
667 AC_PATH_PROG(NASM, nasm) 704 AC_PATH_PROG(NASM, nasm)
668 fi 705 fi
669 if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then 706 if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
670 AC_DEFINE(SDL_HERMES_BLITTERS) 707 AC_DEFINE(SDL_HERMES_BLITTERS)
671 SOURCES="$SOURCES $srcdir/src/hermes/*.asm" 708 SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
672 if test x"$NASMFLAGS" = x; then
673 case $ARCH in
674 win32)
675 NASMFLAGS="-f win32"
676 ;;
677 openbsd)
678 NASMFLAGS="-f aoutb"
679 ;;
680 macosx)
681 NASMFLAGS="-f macho"
682 ;;
683 *)
684 NASMFLAGS="-f elf"
685 ;;
686 esac
687 fi
688 NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/" 709 NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
689 710
690 dnl See if hidden visibility is supported 711 dnl See if hidden visibility is supported
691 echo "GLOBAL _bar:function hidden" > nasm_vis.asm 712 echo "GLOBAL _bar:function hidden" > symbol-visibility
692 echo "_bar:" >>nasm_vis.asm 713 echo "_bar:" >> symbol-visibility
693 if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD 2>&1; then 714 CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
694 NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
695 fi
696 rm -f nasm_vis.asm nasm_vis.o
697 715
698 AC_SUBST(NASM) 716 AC_SUBST(NASM)
699 AC_SUBST(NASMFLAGS) 717 AC_SUBST(NASMFLAGS)
700 718
701 case "$host" in 719 case "$host" in