Skip to content

Commit

Permalink
Added David Hedbor's Qtopia patches
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed May 19, 2002
1 parent 6eff731 commit dc6a123
Show file tree
Hide file tree
Showing 20 changed files with 1,613 additions and 25 deletions.
89 changes: 66 additions & 23 deletions configure.in
Expand Up @@ -322,23 +322,23 @@ CheckESD()
[ --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])
fi
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"
Expand Down Expand Up @@ -379,16 +379,16 @@ CheckARTSC()
[ --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])
fi
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"
Expand Down Expand Up @@ -1165,7 +1165,7 @@ CheckPTHREAD()
#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);
Expand Down Expand Up @@ -1349,6 +1349,36 @@ CheckBWINDOW()
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()
{
Expand Down Expand Up @@ -1420,7 +1450,7 @@ case "$target" in
ARCH=linux
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNASM
CheckOSS
CheckALSA
Expand All @@ -1436,11 +1466,18 @@ case "$target" in
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
Expand Down Expand Up @@ -1479,7 +1516,11 @@ case "$target" in
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
Expand All @@ -1492,7 +1533,7 @@ case "$target" in
ARCH=bsdi
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNASM
CheckOSS
CheckARTSC
Expand Down Expand Up @@ -1544,7 +1585,7 @@ case "$target" in
ARCH=freebsd
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckVGL
CheckNASM
CheckOSS
Expand Down Expand Up @@ -1601,7 +1642,7 @@ case "$target" in
ARCH=netbsd
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNASM
CheckOSS
CheckARTSC
Expand Down Expand Up @@ -1656,7 +1697,7 @@ case "$target" in
ARCH=openbsd
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNASM
CheckOSS
CheckARTSC
Expand Down Expand Up @@ -1715,7 +1756,7 @@ case "$target" in
ARCH=sysv5
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNASM
CheckOSS
CheckARTSC
Expand Down Expand Up @@ -1765,7 +1806,7 @@ case "$target" in
CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNASM
CheckOSS
CheckARTSC
Expand Down Expand Up @@ -1814,7 +1855,7 @@ case "$target" in
ARCH=irix
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckDMEDIA
CheckESD
CheckNAS
Expand Down Expand Up @@ -1877,7 +1918,7 @@ case "$target" in
ARCH=hpux
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckOSS
CheckNAS
CheckX11
Expand Down Expand Up @@ -1925,7 +1966,7 @@ case "$target" in
ARCH=aix
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckOSS
CheckNAS
CheckX11
Expand Down Expand Up @@ -1971,7 +2012,7 @@ case "$target" in
ARCH=osf
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNAS
CheckX11
CheckGGI
Expand Down Expand Up @@ -2018,7 +2059,7 @@ case "$target" in
ARCH=qnx
CheckDummyVideo
CheckDiskAudio
CheckDLOPEN
CheckDLOPEN
CheckNAS
CheckPHOTON
CheckX11
Expand Down Expand Up @@ -2330,6 +2371,7 @@ AC_SUBST(ARCH)

# 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)
Expand Down Expand Up @@ -2486,6 +2528,7 @@ src/video/dummy/Makefile
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
Expand Down
3 changes: 2 additions & 1 deletion include/SDL_main.h
Expand Up @@ -31,7 +31,8 @@ static char rcsid =
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */

#if defined(WIN32) || (defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(macintosh) || defined(__APPLE__) || defined(__SYMBIAN32__)
defined(macintosh) || defined(__APPLE__) || defined(__SYMBIAN32__) || \
defined(QWS)

#ifdef __cplusplus
#define C_LINKAGE "C"
Expand Down
5 changes: 4 additions & 1 deletion src/main/Makefile.am
Expand Up @@ -17,9 +17,12 @@ lib_LIBRARIES = libSDLmain.a
if TARGET_MACOSX
MAINLIB_ARCH_SRCS = SDLMain.m SDLMain.h
else
if TARGET_QTOPIA
MAINLIB_ARCH_SRCS = SDL_Qtopia_main.cc
else
MAINLIB_ARCH_SRCS = SDL_main.c
endif

endif
libSDLmain_a_SOURCES = $(MAINLIB_ARCH_SRCS)

# Build an internal library of any special app setup functions
Expand Down
24 changes: 24 additions & 0 deletions src/main/linux/SDL_Qtopia_main.cc
@@ -0,0 +1,24 @@

/* Include the SDL main definition header */
#include "SDL_main.h"
#ifdef main
#undef main
#endif
#ifdef QWS
#include <qpe/qpeapplication.h>
#include <qapplication.h>
#endif

extern int SDL_main(int argc, char *argv[]);

int main(int argc, char *argv[])
{
#ifdef QWS
// This initializes the Qtopia application. It needs to be done here
// because it parses command line options.
QPEApplication *app = new QPEApplication(argc, argv);
QWidget dummy;
app->showMainWidget(&dummy);
#endif
return(SDL_main(argc, argv));
}
3 changes: 3 additions & 0 deletions src/video/SDL_sysvideo.h
Expand Up @@ -398,6 +398,9 @@ extern VideoBootStrap XBIOS_bootstrap;
#ifdef ENABLE_GEM
extern VideoBootStrap GEM_bootstrap;
#endif
#ifdef ENABLE_QTOPIA
extern VideoBootStrap Qtopia_bootstrap;
#endif
/* This is the current video device */
extern SDL_VideoDevice *current_video;

Expand Down
3 changes: 3 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -110,6 +110,9 @@ static VideoBootStrap *bootstrap[] = {
#endif
#ifdef ENABLE_GEM
&GEM_bootstrap,
#endif
#ifdef ENABLE_QTOPIA
&Qtopia_bootstrap,
#endif
NULL
};
Expand Down
6 changes: 6 additions & 0 deletions src/video/qtopia/.cvsignore
@@ -0,0 +1,6 @@
Makefile.in
Makefile
.libs
*.o
*.lo
*.la
20 changes: 20 additions & 0 deletions src/video/qtopia/Makefile.am
@@ -0,0 +1,20 @@

## Makefile.am for SDL using the Qtopia backend

noinst_LTLIBRARIES = libvideo_qtopia.la
libvideo_qtopia_la_SOURCES = $(QTOPIA_SRCS)

# The SDL BWindow video driver sources
QTOPIA_SRCS = \
SDL_QWin.h \
SDL_QWin.cc \
SDL_QPEApp.h \
SDL_QPEApp.cc \
SDL_lowvideo.h \
SDL_sysmouse.cc \
SDL_sysmouse_c.h \
SDL_sysvideo.cc \
SDL_syswm.cc \
SDL_syswm_c.h \
SDL_sysevents.cc \
SDL_sysevents_c.h

0 comments on commit dc6a123

Please sign in to comment.