diff configure.in @ 371:db0cc6034336

Added David Hedbor's Qtopia patches
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 May 2002 20:06:01 +0000
parents 8c1f8c4d2dd1
children 6089cd59e3ca
line wrap: on
line diff
--- a/configure.in	Sun May 19 19:54:01 2002 +0000
+++ b/configure.in	Sun May 19 20:06:01 2002 +0000
@@ -322,15 +322,15 @@
 [  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
                   , enable_esd=yes)
     if test x$enable_audio = xyes -a x$enable_esd = xyes; then
-	use_esd=no
+        use_esd=no
         AM_PATH_ESD(0.2.8, use_esd=yes)
-	if test x$use_esd = xyes; then
+        if test x$use_esd = xyes; then
             AC_ARG_ENABLE(esd-shared,
 [  --enable-esd-shared     dynamically load ESD audio support [default=no]],
                           , enable_esd_shared=no)
             esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
-	    esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
-	    echo "-- $esd_lib_spec -> $esd_lib"
+            esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
+            echo "-- $esd_lib_spec -> $esd_lib"
             if test x$enable_dlopen != xyes && \
                test x$enable_esd_shared = xyes; then
                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
@@ -338,7 +338,7 @@
             if test x$enable_dlopen = xyes && \
                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
                 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
-		AC_SUBST(esd_lib)
+                AC_SUBST(esd_lib)
             else
                 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
                 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
@@ -379,8 +379,8 @@
 [  --enable-arts-shared     dynamically load aRts audio support [default=no]],
                               , enable_arts_shared=no)
                 arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libartsc.so.*/'`
-	        arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
-	        echo "-- $arts_lib_spec -> $arts_lib"
+                arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
+                echo "-- $arts_lib_spec -> $arts_lib"
                 if test x$enable_dlopen != xyes && \
                    test x$enable_arts_shared = xyes; then
                     AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
@@ -388,7 +388,7 @@
                 if test x$enable_dlopen = xyes && \
                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
                     CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
-		    AC_SUBST(arts_lib)
+                    AC_SUBST(arts_lib)
                 else
                     CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
                     SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
@@ -1165,7 +1165,7 @@
               #include <pthread.h>
             ],[
               pthread_mutexattr_t attr;
-              #ifdef linux
+              #if defined(linux) && !(defined(__arm__) && defined(QWS))
               pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
               #else
               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
@@ -1349,6 +1349,36 @@
     VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
 }
 
+dnl Set up the QTopia video driver if enabled
+CheckQtopia()
+{
+    AC_ARG_ENABLE(video-qtopia,
+[  --enable-video-qtopia   use Qtopia video driver [default=no]],
+                  , enable_video_qtopia=no)
+    if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
+        AC_MSG_CHECKING(for Qtopia support)
+        video_qtopia=no
+        AC_LANG_CPLUSPLUS
+        OLD_CXX="$CXXFLAGS"
+        CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
+        AC_TRY_COMPILE([
+         #include <qpe/qpeapplication.h>
+        ],[
+        ],[
+        video_qtopia=yes
+        ])
+        CXXFLAGS="$OLD_CXX"
+        AC_MSG_RESULT($video_qtopia)
+        if test x$video_qtopia = xyes; then
+            CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
+            SYSTEM_LIBS="$SYSTEM_LIBS -:${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
+            VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
+            VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
+        fi
+        AC_LANG_C
+    fi
+}
+
 dnl Set up the Mac toolbox video driver for Mac OS 7-9
 CheckTOOLBOX()
 {
@@ -1420,7 +1450,7 @@
         ARCH=linux
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNASM
         CheckOSS
         CheckALSA
@@ -1436,11 +1466,18 @@
         CheckGGI
         CheckSVGA
         CheckAAlib
+        CheckQtopia
         CheckOpenGL
         CheckInputEvents
         CheckPTHREAD
         # Set up files for the main() stub
-        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
+        if test "x$video_qtopia" = "xyes"; then
+          COPY_ARCH_SRC(src/main, linux, SDL_Qtopia_main.cc)
+          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
+          SDL_LIBS="-lSDLmain $SDL_LIBS"
+        else
+          COPY_ARCH_SRC(src/main, linux, SDL_main.c)
+        fi
         # Set up files for the audio library
         # We use the OSS and ALSA API's, not the Sun audio API
         #if test x$enable_audio = xyes; then
@@ -1479,7 +1516,11 @@
             else
                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
-                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
+                if test x$has_recursive_mutexes != xyes; then
+                    COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
+                else
+                    COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
+                fi
                 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
             fi
         fi
@@ -1492,7 +1533,7 @@
         ARCH=bsdi
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNASM
         CheckOSS
         CheckARTSC
@@ -1544,7 +1585,7 @@
         ARCH=freebsd
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckVGL
         CheckNASM
         CheckOSS
@@ -1601,7 +1642,7 @@
         ARCH=netbsd
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNASM
         CheckOSS
         CheckARTSC
@@ -1656,7 +1697,7 @@
         ARCH=openbsd
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNASM
         CheckOSS
         CheckARTSC
@@ -1715,7 +1756,7 @@
         ARCH=sysv5
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNASM
         CheckOSS
         CheckARTSC
@@ -1765,7 +1806,7 @@
         CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNASM
         CheckOSS
         CheckARTSC
@@ -1814,7 +1855,7 @@
         ARCH=irix
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckDMEDIA
         CheckESD
         CheckNAS
@@ -1877,7 +1918,7 @@
         ARCH=hpux
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckOSS
         CheckNAS
         CheckX11
@@ -1925,7 +1966,7 @@
         ARCH=aix
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckOSS
         CheckNAS
         CheckX11
@@ -1971,7 +2012,7 @@
         ARCH=osf
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNAS
         CheckX11
         CheckGGI
@@ -2018,7 +2059,7 @@
         ARCH=qnx
         CheckDummyVideo
         CheckDiskAudio
-	CheckDLOPEN
+        CheckDLOPEN
         CheckNAS
         CheckPHOTON
         CheckX11
@@ -2330,6 +2371,7 @@
 
 # Set the conditional variables for this target
 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
+AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes")
 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
@@ -2486,6 +2528,7 @@
 src/video/ataricommon/Makefile
 src/video/xbios/Makefile
 src/video/gem/Makefile
+src/video/qtopia/Makefile
 src/events/Makefile
 src/joystick/Makefile
 src/joystick/amigaos/Makefile