comparison configure.in @ 2247:93994f65c74c

Removed hermes since it's LGPL and not compatible with a commercial license. Prepping for using MMX and SSE intrinsics instead of inline assembly. .. except for memcpy equivalents which only get faster if they can exploit the parallelism of loading into multiple SIMD registers. :)
author Sam Lantinga <slouken@libsdl.org>
date Wed, 15 Aug 2007 08:21:10 +0000
parents 93ea84f77d83
children c20476d7d7b3
comparison
equal deleted inserted replaced
2246:75daa0792bd1 2247:93994f65c74c
274 AC_ARG_ENABLE(assembly, 274 AC_ARG_ENABLE(assembly,
275 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]), 275 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
276 , enable_assembly=yes) 276 , enable_assembly=yes)
277 if test x$enable_assembly = xyes; then 277 if test x$enable_assembly = xyes; then
278 AC_DEFINE(SDL_ASSEMBLY_ROUTINES) 278 AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
279
280 dnl Check for various instruction support
281 AC_ARG_ENABLE(mmx,
282 AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
283 , enable_mmx=yes)
284 if test x$enable_mmx = xyes; then
285 save_CFLAGS="$CFLAGS"
286 have_gcc_mmx=no
287 AC_MSG_CHECKING(for GCC -mmmx option)
288 mmx_CFLAGS="-mmmx"
289 CFLAGS="$save_CFLAGS $mmx_CFLAGS"
290
291 AC_TRY_COMPILE([
292 #include <mmintrin.h>
293 ],[
294 ],[
295 have_gcc_mmx=yes
296 ])
297 AC_MSG_RESULT($have_gcc_mmx)
298
299 if test x$have_gcc_mmx = xyes; then
300 EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
301 fi
302 fi
303
304 AC_ARG_ENABLE(sse,
305 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
306 , enable_sse=yes)
307 if test x$enable_sse = xyes; then
308 save_CFLAGS="$CFLAGS"
309 have_gcc_sse=no
310 AC_MSG_CHECKING(for GCC -msse option)
311 sse_CFLAGS="-msse"
312 CFLAGS="$save_CFLAGS $sse_CFLAGS"
313
314 AC_TRY_COMPILE([
315 #include <xmmintrin.h>
316 ],[
317 ],[
318 have_gcc_sse=yes
319 ])
320 AC_MSG_RESULT($have_gcc_sse)
321
322 if test x$have_gcc_sse = xyes; then
323 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
324 fi
325 fi
326
327 AC_ARG_ENABLE(altivec,
328 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
329 , enable_altivec=yes)
330 if test x$enable_altivec = xyes; then
331 have_altivec_h_hdr=no
332 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
333
334 save_CFLAGS="$CFLAGS"
335 have_gcc_altivec=no
336 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
337 altivec_CFLAGS="-maltivec"
338 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
339
340 if test x$have_altivec_h_hdr = xyes; then
341 AC_TRY_COMPILE([
342 #include <altivec.h>
343 vector unsigned int vzero() {
344 return vec_splat_u32(0);
345 }
346 ],[
347 ],[
348 have_gcc_altivec=yes
349 ])
350 AC_MSG_RESULT($have_gcc_altivec)
351 else
352 AC_TRY_COMPILE([
353 vector unsigned int vzero() {
354 return vec_splat_u32(0);
355 }
356 ],[
357 ],[
358 have_gcc_altivec=yes
359 ])
360 AC_MSG_RESULT($have_gcc_altivec)
361 fi
362
363 if test x$have_gcc_altivec = xno; then
364 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
365 altivec_CFLAGS="-faltivec"
366 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
367 if test x$have_altivec_h_hdr = xyes; then
368 AC_TRY_COMPILE([
369 #include <altivec.h>
370 vector unsigned int vzero() {
371 return vec_splat_u32(0);
372 }
373 ],[
374 ],[
375 have_gcc_altivec=yes
376 ])
377 AC_MSG_RESULT($have_gcc_altivec)
378 else
379 AC_TRY_COMPILE([
380 vector unsigned int vzero() {
381 return vec_splat_u32(0);
382 }
383 ],[
384 ],[
385 have_gcc_altivec=yes
386 ])
387 AC_MSG_RESULT($have_gcc_altivec)
388 fi
389 fi
390 CFLAGS="$save_CFLAGS"
391
392 if test x$have_gcc_altivec = xyes; then
393 AC_DEFINE(SDL_ALTIVEC_BLITTERS)
394 if test x$have_altivec_h_hdr = xyes; then
395 AC_DEFINE(HAVE_ALTIVEC_H)
396 fi
397 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
398 fi
399 fi
279 fi 400 fi
280 401
281 dnl See if the OSS audio interface is supported 402 dnl See if the OSS audio interface is supported
282 CheckOSS() 403 CheckOSS()
283 { 404 {
623 mintaudio=yes 744 mintaudio=yes
624 AC_DEFINE(SDL_AUDIO_DRIVER_MINT) 745 AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
625 SOURCES="$SOURCES $srcdir/src/audio/mint/*.c" 746 SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
626 SOURCES="$SOURCES $srcdir/src/audio/mint/*.S" 747 SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
627 have_audio=yes 748 have_audio=yes
628 fi
629 fi
630 }
631
632 dnl See if we can use x86 assembly blitters
633 # NASM is available from: http://nasm.sourceforge.net
634 CheckNASM()
635 {
636 dnl Make sure we are running on an x86 platform
637 case $host in
638 i?86*)
639 ;;
640 *)
641 # Nope, bail early.
642 return
643 ;;
644 esac
645 dnl Check for NASM (for assembly blit routines)
646 AC_ARG_ENABLE(nasm,
647 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
648 , enable_nasm=yes)
649 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
650 CompileNASM()
651 {
652 # Usage: CompileNASM <filename>
653 AC_MSG_CHECKING(to see if $NASM supports $1)
654 if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
655 CompileNASM_ret="yes"
656 else
657 CompileNASM_ret="no"
658 fi
659 rm -f $1 $1.o
660 AC_MSG_RESULT($CompileNASM_ret)
661 test "$CompileNASM_ret" = "yes"
662 }
663
664 if test x"$NASMFLAGS" = x; then
665 case $ARCH in
666 win32)
667 NASMFLAGS="-f win32"
668 ;;
669 openbsd)
670 NASMFLAGS="-f aoutb"
671 ;;
672 macosx)
673 NASMFLAGS="-f macho"
674 ;;
675 *)
676 NASMFLAGS="-f elf"
677 ;;
678 esac
679 fi
680
681 AC_PATH_PROG(NASM, yasm)
682 echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
683 echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
684 echo "%endif" >> unquoted-sections
685 CompileNASM unquoted-sections || NASM=""
686
687 if test "x$NASM" = x -o "x$NASM" = x'"$NASM"'; then
688 $as_unset ac_cv_path_NASM
689 AC_PATH_PROG(NASM, nasm)
690 fi
691 if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
692 AC_DEFINE(SDL_HERMES_BLITTERS)
693 SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
694 NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/"
695
696 dnl See if hidden visibility is supported
697 echo "GLOBAL _bar:function hidden" > symbol-visibility
698 echo "_bar:" >> symbol-visibility
699 CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
700
701 AC_SUBST(NASM)
702 AC_SUBST(NASMFLAGS)
703
704 case "$host" in
705 # this line is needed for QNX, because it's not defined the __ELF__
706 *-*-qnx*)
707 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
708 *-*-solaris*)
709 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
710 esac
711 fi
712 fi
713 }
714
715 dnl Check for altivec instruction support using gas syntax
716 CheckAltivec()
717 {
718 AC_ARG_ENABLE(altivec,
719 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
720 , enable_altivec=yes)
721 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
722 have_altivec_h_hdr=no
723 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
724
725 save_CFLAGS="$CFLAGS"
726 have_gcc_altivec=no
727 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
728 altivec_CFLAGS="-maltivec"
729 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
730
731 if test x$have_altivec_h_hdr = xyes; then
732 AC_TRY_COMPILE([
733 #include <altivec.h>
734 vector unsigned int vzero() {
735 return vec_splat_u32(0);
736 }
737 ],[
738 ],[
739 have_gcc_altivec=yes
740 ])
741 AC_MSG_RESULT($have_gcc_altivec)
742 else
743 AC_TRY_COMPILE([
744 vector unsigned int vzero() {
745 return vec_splat_u32(0);
746 }
747 ],[
748 ],[
749 have_gcc_altivec=yes
750 ])
751 AC_MSG_RESULT($have_gcc_altivec)
752 fi
753
754 if test x$have_gcc_altivec = xno; then
755 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
756 altivec_CFLAGS="-faltivec"
757 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
758 if test x$have_altivec_h_hdr = xyes; then
759 AC_TRY_COMPILE([
760 #include <altivec.h>
761 vector unsigned int vzero() {
762 return vec_splat_u32(0);
763 }
764 ],[
765 ],[
766 have_gcc_altivec=yes
767 ])
768 AC_MSG_RESULT($have_gcc_altivec)
769 else
770 AC_TRY_COMPILE([
771 vector unsigned int vzero() {
772 return vec_splat_u32(0);
773 }
774 ],[
775 ],[
776 have_gcc_altivec=yes
777 ])
778 AC_MSG_RESULT($have_gcc_altivec)
779 fi
780 fi
781 CFLAGS="$save_CFLAGS"
782
783 if test x$have_gcc_altivec = xyes; then
784 AC_DEFINE(SDL_ALTIVEC_BLITTERS)
785 if test x$have_altivec_h_hdr = xyes; then
786 AC_DEFINE(HAVE_ALTIVEC_H)
787 fi
788 EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
789 fi 749 fi
790 fi 750 fi
791 } 751 }
792 752
793 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually). 753 dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
2041 CheckVisibilityHidden 2001 CheckVisibilityHidden
2042 CheckDummyVideo 2002 CheckDummyVideo
2043 CheckDiskAudio 2003 CheckDiskAudio
2044 CheckDummyAudio 2004 CheckDummyAudio
2045 CheckDLOPEN 2005 CheckDLOPEN
2046 CheckNASM
2047 CheckAltivec
2048 CheckOSS 2006 CheckOSS
2049 CheckDMEDIA 2007 CheckDMEDIA
2050 CheckMME 2008 CheckMME
2051 CheckALSA 2009 CheckALSA
2052 CheckARTSC 2010 CheckARTSC
2151 *-*-qnx*) 2109 *-*-qnx*)
2152 ARCH=qnx 2110 ARCH=qnx
2153 CheckDummyVideo 2111 CheckDummyVideo
2154 CheckDiskAudio 2112 CheckDiskAudio
2155 CheckDummyAudio 2113 CheckDummyAudio
2156 # CheckNASM
2157 CheckDLOPEN 2114 CheckDLOPEN
2158 CheckNAS 2115 CheckNAS
2159 CheckPHOTON 2116 CheckPHOTON
2160 CheckX11 2117 CheckX11
2161 CheckOpenGLX11 2118 CheckOpenGLX11
2195 CheckDiskAudio 2152 CheckDiskAudio
2196 CheckDummyAudio 2153 CheckDummyAudio
2197 CheckWIN32 2154 CheckWIN32
2198 CheckWIN32GL 2155 CheckWIN32GL
2199 CheckDIRECTX 2156 CheckDIRECTX
2200 CheckNASM
2201 # Set up files for the video library 2157 # Set up files for the video library
2202 if test x$enable_video = xyes; then 2158 if test x$enable_video = xyes; then
2203 AC_DEFINE(SDL_VIDEO_DRIVER_WIN32) 2159 AC_DEFINE(SDL_VIDEO_DRIVER_WIN32)
2204 SOURCES="$SOURCES $srcdir/src/video/win32/*.c" 2160 SOURCES="$SOURCES $srcdir/src/video/win32/*.c"
2205 have_video=yes 2161 have_video=yes
2276 ARCH=beos 2232 ARCH=beos
2277 ac_default_prefix=/boot/develop/tools/gnupro 2233 ac_default_prefix=/boot/develop/tools/gnupro
2278 CheckDummyVideo 2234 CheckDummyVideo
2279 CheckDiskAudio 2235 CheckDiskAudio
2280 CheckDummyAudio 2236 CheckDummyAudio
2281 CheckNASM
2282 CheckBWINDOW 2237 CheckBWINDOW
2283 CheckBeGL 2238 CheckBeGL
2284 # Set up files for the audio library 2239 # Set up files for the audio library
2285 if test x$enable_audio = xyes; then 2240 if test x$enable_audio = xyes; then
2286 AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO) 2241 AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO)
2342 CheckVisibilityHidden 2297 CheckVisibilityHidden
2343 CheckDummyVideo 2298 CheckDummyVideo
2344 CheckDiskAudio 2299 CheckDiskAudio
2345 CheckDummyAudio 2300 CheckDummyAudio
2346 CheckDLOPEN 2301 CheckDLOPEN
2347 CheckNASM
2348 2302
2349 # Set up files for the shared object loading library 2303 # Set up files for the shared object loading library
2350 # (this needs to be done before the dynamic X11 check) 2304 # (this needs to be done before the dynamic X11 check)
2351 if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then 2305 if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
2352 AC_DEFINE(SDL_LOADSO_DLCOMPAT) 2306 AC_DEFINE(SDL_LOADSO_DLCOMPAT)
2357 CheckCOCOA 2311 CheckCOCOA
2358 CheckX11 2312 CheckX11
2359 CheckMacGL 2313 CheckMacGL
2360 CheckOpenGLX11 2314 CheckOpenGLX11
2361 CheckPTHREAD 2315 CheckPTHREAD
2362 CheckAltivec
2363 2316
2364 # Good optimization on Mac OS X, yes... 2317 # Good optimization on Mac OS X, yes...
2365 EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16" 2318 EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16"
2366 2319
2367 # Need this or things might misbuild on a G3. 2320 # Need this or things might misbuild on a G3.