configure.in
changeset 2112 024af473e643
parent 2104 a76e8b9f3d2e
child 2125 fab12febc0f9
equal deleted inserted replaced
2111:874162355be5 2112:024af473e643
   639     dnl Check for NASM (for assembly blit routines)
   639     dnl Check for NASM (for assembly blit routines)
   640     AC_ARG_ENABLE(nasm,
   640     AC_ARG_ENABLE(nasm,
   641 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
   641 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
   642                   , enable_nasm=yes)
   642                   , enable_nasm=yes)
   643     if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
   643     if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
       
   644         CompileNASM()
       
   645         {
       
   646             # Usage: CompileNASM <filename>
       
   647             AC_MSG_CHECKING(to see if $NASM supports $1)
       
   648             if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
       
   649                 CompileNASM_ret="yes"
       
   650             else
       
   651                 CompileNASM_ret="no"
       
   652             fi
       
   653             rm -f $1 $1.o
       
   654             AC_MSG_RESULT($CompileNASM_ret)
       
   655             test "$CompileNASM_ret" = "yes"
       
   656         }
       
   657 
       
   658         if test x"$NASMFLAGS" = x; then
       
   659             case $ARCH in
       
   660               win32)
       
   661                   NASMFLAGS="-f win32"
       
   662                   ;;
       
   663               openbsd)
       
   664                   NASMFLAGS="-f aoutb"
       
   665                   ;;
       
   666               macosx)
       
   667                   NASMFLAGS="-f macho"
       
   668                   ;;
       
   669               *)
       
   670                   NASMFLAGS="-f elf"
       
   671                   ;;
       
   672             esac
       
   673         fi
       
   674 
   644         AC_PATH_PROG(NASM, yasm)
   675         AC_PATH_PROG(NASM, yasm)
       
   676         echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
       
   677         echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
       
   678         echo "%endif" >> unquoted-sections
       
   679         CompileNASM unquoted-sections || NASM=""
       
   680 
   645         if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
   681         if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
       
   682             $as_unset ac_cv_path_NASM
   646             AC_PATH_PROG(NASM, nasm)
   683             AC_PATH_PROG(NASM, nasm)
   647         fi
   684         fi
   648         if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
   685         if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
   649             AC_DEFINE(SDL_HERMES_BLITTERS)
   686             AC_DEFINE(SDL_HERMES_BLITTERS)
   650             SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
   687             SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
   651             if test x"$NASMFLAGS" = x; then
       
   652                 case $ARCH in
       
   653                   win32)
       
   654                       NASMFLAGS="-f win32"
       
   655                       ;;
       
   656                   openbsd)
       
   657                       NASMFLAGS="-f aoutb"
       
   658                       ;;
       
   659                   macosx)
       
   660                       NASMFLAGS="-f macho"
       
   661                       ;;
       
   662                   *)
       
   663                       NASMFLAGS="-f elf"
       
   664                       ;;
       
   665                 esac
       
   666             fi
       
   667             NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
   688             NASMFLAGS="$NASMFLAGS -i $srcdir/src/hermes/"
   668 
   689 
   669             dnl See if hidden visibility is supported
   690             dnl See if hidden visibility is supported
   670             echo "GLOBAL _bar:function hidden" > nasm_vis.asm
   691             echo "GLOBAL _bar:function hidden" > symbol-visibility
   671             echo "_bar:" >>nasm_vis.asm
   692             echo "_bar:" >> symbol-visibility
   672             if $NASM $NASMFLAGS nasm_vis.asm -o nasm_vis.o >&AS_MESSAGE_LOG_FD 2>&1; then
   693             CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
   673                 NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
       
   674             fi
       
   675             rm -f nasm_vis.asm nasm_vis.o
       
   676 
   694 
   677             AC_SUBST(NASM)
   695             AC_SUBST(NASM)
   678             AC_SUBST(NASMFLAGS)
   696             AC_SUBST(NASMFLAGS)
   679 
   697 
   680             case "$host" in
   698             case "$host" in