configure.in
changeset 11472 f31b73040ea3
parent 11457 3db9f2a42870
child 11480 e7a79b236dc0
equal deleted inserted replaced
11471:510e461e584a 11472:f31b73040ea3
  1552         SUMMARY_video="${SUMMARY_video} nacl opengles2"
  1552         SUMMARY_video="${SUMMARY_video} nacl opengles2"
  1553         ])
  1553         ])
  1554 }
  1554 }
  1555 
  1555 
  1556 
  1556 
       
  1557 CheckRPI()
       
  1558 {
       
  1559     AC_ARG_ENABLE(video-rpi,
       
  1560 AC_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=yes]]]),
       
  1561                   , enable_video_rpi=yes)
       
  1562     if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
       
  1563         if test x$ARCH = xnetbsd; then
       
  1564             RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
       
  1565             RPI_LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
       
  1566         else
       
  1567             RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
       
  1568             RPI_LDFLAGS="-L/opt/vc/lib -lbcm_host"
       
  1569         fi
       
  1570 
       
  1571         # Save the original compiler flags and libraries
       
  1572         ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
       
  1573 
       
  1574         # Add the Raspberry Pi compiler flags and libraries
       
  1575         CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LDFLAGS"
       
  1576 
       
  1577         AC_MSG_CHECKING(for Raspberry Pi)
       
  1578         have_video_rpi=no
       
  1579         AC_TRY_LINK([
       
  1580           #include <bcm_host.h>
       
  1581         ],[
       
  1582           bcm_host_init();
       
  1583         ],[
       
  1584         have_video_rpi=yes
       
  1585         ],[
       
  1586         ])
       
  1587         AC_MSG_RESULT($have_video_rpi)
       
  1588 
       
  1589         # Restore the compiler flags and libraries
       
  1590         CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
       
  1591         
       
  1592         if test x$have_video_rpi = xyes; then
       
  1593             CFLAGS="$CFLAGS $RPI_CFLAGS"
       
  1594             SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
       
  1595             EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
       
  1596             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LDFLAGS"
       
  1597             SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
       
  1598             AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
       
  1599             SUMMARY_video="${SUMMARY_video} rpi"
       
  1600         fi
       
  1601     fi
       
  1602 }
       
  1603 
  1557 dnl Find the X11 include and library directories
  1604 dnl Find the X11 include and library directories
  1558 CheckX11()
  1605 CheckX11()
  1559 {
  1606 {
  1560 
       
  1561 
       
  1562     AC_ARG_ENABLE(video-x11,
  1607     AC_ARG_ENABLE(video-x11,
  1563 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
  1608 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
  1564                   , enable_video_x11=yes)
  1609                   , enable_video_x11=yes)
  1565     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
  1610     if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
  1566         case "$host" in
  1611         case "$host" in
  3193 
  3238 
  3194 dnl Set up the configuration based on the host platform!
  3239 dnl Set up the configuration based on the host platform!
  3195 case "$host" in
  3240 case "$host" in
  3196     *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
  3241     *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
  3197         case "$host" in
  3242         case "$host" in
  3198             *-raspberry-linux*)
       
  3199                 # Raspberry Pi
       
  3200                 ARCH=linux
       
  3201                 RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
       
  3202                 CFLAGS="$CFLAGS $RPI_CFLAGS"
       
  3203                 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
       
  3204                 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
       
  3205                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/vc/lib -lbcm_host -ldl"
       
  3206 
       
  3207                 if test x$enable_video = xyes; then
       
  3208                     SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
       
  3209                     # FIXME: confdefs? Not AC_DEFINE?
       
  3210                     $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
       
  3211                     SUMMARY_video="${SUMMARY_video} rpi"
       
  3212                 fi
       
  3213                 ;;
       
  3214             *-*-androideabi*)
  3243             *-*-androideabi*)
  3215                 # Android
  3244                 # Android
  3216                 ARCH=android
  3245                 ARCH=android
  3217                 ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
  3246                 ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
  3218                 CFLAGS="$CFLAGS $ANDROID_CFLAGS"
  3247                 CFLAGS="$CFLAGS $ANDROID_CFLAGS"
  3235             *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  3264             *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
  3236             *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  3265             *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
  3237             *-*-bsdi*)          ARCH=bsdi ;;
  3266             *-*-bsdi*)          ARCH=bsdi ;;
  3238             *-*-freebsd*)       ARCH=freebsd ;;
  3267             *-*-freebsd*)       ARCH=freebsd ;;
  3239             *-*-dragonfly*)     ARCH=freebsd ;;
  3268             *-*-dragonfly*)     ARCH=freebsd ;;
  3240             *-raspberry-netbsd*)
       
  3241                 # Raspberry Pi
       
  3242                 ARCH=netbsd
       
  3243                 RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
       
  3244                 CFLAGS="$CFLAGS $RPI_CFLAGS"
       
  3245                 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
       
  3246                 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
       
  3247                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host -ldl"
       
  3248 
       
  3249                 if test x$enable_video = xyes; then
       
  3250                     SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
       
  3251                     $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
       
  3252                     SUMMARY_video="${SUMMARY_video} raspberry"
       
  3253                 fi
       
  3254                 ;;
       
  3255             *-*-netbsd*)        ARCH=netbsd ;;
  3269             *-*-netbsd*)        ARCH=netbsd ;;
  3256             *-*-openbsd*)       ARCH=openbsd ;;
  3270             *-*-openbsd*)       ARCH=openbsd ;;
  3257             *-*-sysv5*)         ARCH=sysv5 ;;
  3271             *-*-sysv5*)         ARCH=sysv5 ;;
  3258             *-*-solaris*)       ARCH=solaris ;;
  3272             *-*-solaris*)       ARCH=solaris ;;
  3259             *-*-hpux*)          ARCH=hpux ;;
  3273             *-*-hpux*)          ARCH=hpux ;;
  3277         CheckESD
  3291         CheckESD
  3278         CheckNAS
  3292         CheckNAS
  3279         CheckSNDIO
  3293         CheckSNDIO
  3280         CheckFusionSound
  3294         CheckFusionSound
  3281         CheckLibSampleRate
  3295         CheckLibSampleRate
       
  3296         # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
       
  3297         CheckRPI
  3282         CheckX11
  3298         CheckX11
  3283         CheckDirectFB
  3299         CheckDirectFB
  3284         CheckKMSDRM
  3300         CheckKMSDRM
  3285         CheckOpenGLX11
  3301         CheckOpenGLX11
  3286         CheckOpenGLESX11
  3302         CheckOpenGLESX11