comparison configure.in @ 3390:802e5d85b90c

Debian patch: 050_altivec_detection.diff
author Sam Lantinga <slouken@libsdl.org>
date Tue, 13 Oct 2009 06:33:46 +0000
parents be67ddef6617
children 188fc5ecc58c
comparison
equal deleted inserted replaced
3389:3fe2248fde37 3390:802e5d85b90c
466 466
467 AC_ARG_ENABLE(altivec, 467 AC_ARG_ENABLE(altivec,
468 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]), 468 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
469 , enable_altivec=yes) 469 , enable_altivec=yes)
470 if test x$enable_altivec = xyes; then 470 if test x$enable_altivec = xyes; then
471 have_altivec_h_hdr=no
472 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
473
474 save_CFLAGS="$CFLAGS" 471 save_CFLAGS="$CFLAGS"
475 have_gcc_altivec=no 472 have_gcc_altivec=no
476 AC_MSG_CHECKING(for Altivec with GCC -maltivec option) 473 have_altivec_h_hdr=no
477 altivec_CFLAGS="-maltivec" 474 altivec_CFLAGS="-maltivec"
478 CFLAGS="$save_CFLAGS $altivec_CFLAGS" 475 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
479 476
480 if test x$have_altivec_h_hdr = xyes; then 477 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
481 AC_TRY_COMPILE([ 478 AC_TRY_COMPILE([
482 #include <altivec.h> 479 #include <altivec.h>
483 vector unsigned int vzero() { 480 vector unsigned int vzero() {
484 return vec_splat_u32(0); 481 return vec_splat_u32(0);
485 } 482 }
486 ],[ 483 ],[
487 ],[ 484 ],[
488 have_gcc_altivec=yes 485 have_gcc_altivec=yes
489 ]) 486 have_altivec_h_hdr=yes
490 AC_MSG_RESULT($have_gcc_altivec) 487 ])
491 else 488 AC_MSG_RESULT($have_gcc_altivec)
492 AC_TRY_COMPILE([ 489
493 vector unsigned int vzero() { 490 if test x$have_gcc_altivec = xno; then
494 return vec_splat_u32(0); 491 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
495 } 492 AC_TRY_COMPILE([
496 ],[ 493 vector unsigned int vzero() {
497 ],[ 494 return vec_splat_u32(0);
498 have_gcc_altivec=yes 495 }
499 ]) 496 ],[
500 AC_MSG_RESULT($have_gcc_altivec) 497 ],[
501 fi 498 have_gcc_altivec=yes
499 ])
500 AC_MSG_RESULT($have_gcc_altivec)
501 fi
502
503 if test x$have_gcc_altivec = xno; then
504 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
505 altivec_CFLAGS="-faltivec"
506 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
507 AC_TRY_COMPILE([
508 #include <altivec.h>
509 vector unsigned int vzero() {
510 return vec_splat_u32(0);
511 }
512 ],[
513 ],[
514 have_gcc_altivec=yes
515 have_altivec_h_hdr=yes
516 ])
517 AC_MSG_RESULT($have_gcc_altivec)
518 fi
502 519
503 if test x$have_gcc_altivec = xno; then 520 if test x$have_gcc_altivec = xno; then
504 AC_MSG_CHECKING(for Altivec with GCC -faltivec option) 521 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
505 altivec_CFLAGS="-faltivec" 522 AC_TRY_COMPILE([
506 CFLAGS="$save_CFLAGS $altivec_CFLAGS" 523 vector unsigned int vzero() {
507 if test x$have_altivec_h_hdr = xyes; then 524 return vec_splat_u32(0);
508 AC_TRY_COMPILE([ 525 }
509 #include <altivec.h> 526 ],[
510 vector unsigned int vzero() { 527 ],[
511 return vec_splat_u32(0); 528 have_gcc_altivec=yes
512 } 529 ])
513 ],[ 530 AC_MSG_RESULT($have_gcc_altivec)
514 ],[
515 have_gcc_altivec=yes
516 ])
517 AC_MSG_RESULT($have_gcc_altivec)
518 else
519 AC_TRY_COMPILE([
520 vector unsigned int vzero() {
521 return vec_splat_u32(0);
522 }
523 ],[
524 ],[
525 have_gcc_altivec=yes
526 ])
527 AC_MSG_RESULT($have_gcc_altivec)
528 fi
529 fi 531 fi
530 CFLAGS="$save_CFLAGS" 532 CFLAGS="$save_CFLAGS"
531 533
532 if test x$have_gcc_altivec = xyes; then 534 if test x$have_gcc_altivec = xyes; then
533 AC_DEFINE(SDL_ALTIVEC_BLITTERS) 535 AC_DEFINE(SDL_ALTIVEC_BLITTERS)