Fixed "dist" make target for newer versions of automake
authorSam Lantinga <slouken@libsdl.org>
Sun, 14 Dec 2003 06:25:53 +0000
changeset 754623b453a3219
parent 753 b14fdadd8311
child 755 b1595db396a7
Fixed "dist" make target for newer versions of automake
.cvsignore
Makefile.am
VisualC.zip
configure.in
install-sh
missing
mkinstalldirs
src/main/Makefile.am
src/main/arch.c
src/main/dummy.c
src/main/dummy/SDL_dummy_main.c
src/main/linux/SDL_Qtopia_main.cc
src/main/linux/SDL_main.c
src/main/qtopia/SDL_qtopia_main.cc
src/main/win32/SDL_main.c
src/main/win32/SDL_win32_main.c
src/thread/Makefile.am
src/timer/Makefile.am
src/timer/mint/SDL_systimer.c
test/.cvsignore
     1.1 --- a/.cvsignore	Wed Dec 10 12:35:56 2003 +0000
     1.2 +++ b/.cvsignore	Sun Dec 14 06:25:53 2003 +0000
     1.3 @@ -3,7 +3,7 @@
     1.4  aclocal.m4
     1.5  config.log
     1.6  config.cache
     1.7 -autom4te.cache
     1.8 +autom4te*
     1.9  depcomp
    1.10  libtool
    1.11  config.status
     2.1 --- a/Makefile.am	Wed Dec 10 12:35:56 2003 +0000
     2.2 +++ b/Makefile.am	Sun Dec 14 06:25:53 2003 +0000
     2.3 @@ -69,6 +69,7 @@
     2.4  exports:
     2.5  	(cd src/main/beos/exports; $(MAKE))
     2.6  	(cd src/main/macos/exports; $(MAKE))
     2.7 +	(cd src/main/macosx/exports; $(MAKE))
     2.8  	(cd src/main/win32/exports; $(MAKE))
     2.9  
    2.10  # Rule to build the Project Builder archive in MacOS X
    2.11 @@ -78,10 +79,6 @@
    2.12  	    tar zcvf $@ PBProjects; \
    2.13  	fi
    2.14  
    2.15 -# Rule to force automake to rebuild the library
    2.16 -changed:
    2.17 -	@echo "This build target is no longer necessary"
    2.18 -
    2.19  # Rule to install the libraries only - prevent rebuilding apps
    2.20  install-lib:
    2.21  	cd src && $(MAKE) install-libLTLIBRARIES
    2.22 @@ -93,6 +90,7 @@
    2.23  # Grab the test programs for the distribution:
    2.24  dist-hook:
    2.25  	if test -f test/Makefile; then (cd test; make distclean); fi
    2.26 +	rm -rf $(srcdir)/test/autom4te*
    2.27  	cp -rp $(srcdir)/test $(distdir)
    2.28  	rm -rf `find $(distdir) -type d -name CVS -print`
    2.29  
     3.1 Binary file VisualC.zip has changed
     4.1 --- a/configure.in	Wed Dec 10 12:35:56 2003 +0000
     4.2 +++ b/configure.in	Sun Dec 14 06:25:53 2003 +0000
     4.3 @@ -505,7 +505,7 @@
     4.4                    NASMFLAGS="-f aoutb"
     4.5                    ;;
     4.6                *)
     4.7 -                  NASMFLAGS="-f elf -D __NOU__"
     4.8 +                  NASMFLAGS="-f elf"
     4.9                    ;;
    4.10              esac
    4.11              AC_SUBST(NASMFLAGS)
    4.12 @@ -1331,9 +1331,6 @@
    4.13      if test x$use_pthreads = xyes -o x$use_clone = xyes; then
    4.14          # Basic thread creation functions
    4.15          COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
    4.16 -        if test x$use_clone = xyes; then
    4.17 -            COPY_ARCH_SRC(src/thread, linux, clone.S)
    4.18 -        fi
    4.19          COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
    4.20  
    4.21          # Semaphores
    4.22 @@ -1757,11 +1754,8 @@
    4.23          CheckPTHREAD
    4.24          # Set up files for the main() stub
    4.25          if test "x$video_qtopia" = "xyes"; then
    4.26 -          COPY_ARCH_SRC(src/main, linux, SDL_Qtopia_main.cc)
    4.27            SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
    4.28            SDL_LIBS="-lSDLmain $SDL_LIBS"
    4.29 -        else
    4.30 -          COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.31          fi
    4.32          # Set up files for the audio library
    4.33          # We use the OSS and ALSA API's, not the Sun audio API
    4.34 @@ -1833,8 +1827,6 @@
    4.35          CheckAAlib
    4.36          CheckOpenGL
    4.37          CheckPTHREAD
    4.38 -        # Set up files for the main() stub
    4.39 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.40          # Set up files for the audio library
    4.41          # We use the OSS and ALSA API's, not the Sun audio API
    4.42          #if test x$enable_audio = xyes; then
    4.43 @@ -1880,8 +1872,6 @@
    4.44          CheckOpenGL
    4.45          CheckPTHREAD
    4.46          CheckUSBHID
    4.47 -        # Set up files for the main() stub
    4.48 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.49          # Set up files for the audio library
    4.50          # We use the OSS and ALSA API's, not the Sun audio API
    4.51          #if test x$enable_audio = xyes; then
    4.52 @@ -1918,8 +1908,6 @@
    4.53          CheckOpenGL
    4.54          CheckPTHREAD
    4.55          CheckUSBHID
    4.56 -        # Set up files for the main() stub
    4.57 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.58          # Set up files for the audio library
    4.59          if test x$enable_audio = xyes; then
    4.60              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    4.61 @@ -1960,8 +1948,6 @@
    4.62          CheckOpenGL
    4.63          CheckPTHREAD
    4.64          CheckUSBHID
    4.65 -        # Set up files for the main() stub
    4.66 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.67          # Set up files for the audio library
    4.68          if test x$enable_audio = xyes; then
    4.69              CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
    4.70 @@ -2002,8 +1988,6 @@
    4.71          CheckAAlib
    4.72          CheckOpenGL
    4.73          CheckPTHREAD
    4.74 -        # Set up files for the main() stub
    4.75 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.76          # Set up files for the audio library
    4.77          if test x$enable_audio = xyes; then
    4.78              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    4.79 @@ -2045,8 +2029,6 @@
    4.80          CheckAAlib
    4.81          CheckOpenGL
    4.82          CheckPTHREAD
    4.83 -        # Set up files for the main() stub
    4.84 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.85          # Set up files for the audio library
    4.86          if test x$enable_audio = xyes; then
    4.87              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    4.88 @@ -2085,8 +2067,6 @@
    4.89          CheckAAlib
    4.90          CheckOpenGL
    4.91          CheckPTHREAD
    4.92 -        # Set up files for the main() stub
    4.93 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    4.94          # We use the dmedia audio API, not the Sun audio API
    4.95          #if test x$enable_audio = xyes; then
    4.96          #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    4.97 @@ -2137,8 +2117,6 @@
    4.98          CheckAAlib
    4.99          CheckOpenGL
   4.100          CheckPTHREAD
   4.101 -        # Set up files for the main() stub
   4.102 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.103          # Set up files for the audio library
   4.104          if test x$enable_audio = xyes; then
   4.105              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
   4.106 @@ -2178,8 +2156,6 @@
   4.107          CheckAAlib
   4.108          CheckOpenGL
   4.109          CheckPTHREAD
   4.110 -        # Set up files for the main() stub
   4.111 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.112          # Set up files for the audio library
   4.113          if test x$enable_audio = xyes; then
   4.114              AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
   4.115 @@ -2217,8 +2193,6 @@
   4.116          CheckOpenGL
   4.117          CheckPTHREAD
   4.118          SDL_LIBS="$SDL_LIBS -lrt"
   4.119 -        # Set up files for the main() stub
   4.120 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.121          # Set up files for the audio library
   4.122          if test x$enable_audio = xyes; then
   4.123              CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
   4.124 @@ -2257,8 +2231,6 @@
   4.125          CheckX11
   4.126          CheckOpenGL
   4.127          CheckPTHREAD
   4.128 -        # Set up files for the main() stub
   4.129 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.130          # Set up files for the audio library
   4.131          if test x$enable_audio = xyes; then
   4.132              CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
   4.133 @@ -2302,8 +2274,6 @@
   4.134          CheckWIN32
   4.135          CheckDIRECTX
   4.136          CheckNASM
   4.137 -        # Set up files for the main() stub
   4.138 -        COPY_ARCH_SRC(src/main, win32, SDL_main.c)
   4.139          # Set up files for the audio library
   4.140          if test x$enable_audio = xyes; then
   4.141              AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
   4.142 @@ -2360,10 +2330,6 @@
   4.143          CheckNASM
   4.144          CheckBWINDOW
   4.145          CheckBeGL
   4.146 -        # Set up files for the main() stub
   4.147 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.148 -        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
   4.149 -        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
   4.150          # Set up files for the audio library
   4.151          if test x$enable_audio = xyes; then
   4.152              AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
   4.153 @@ -2406,8 +2372,6 @@
   4.154          CheckDiskAudio
   4.155          CheckTOOLBOX
   4.156          CheckMacGL
   4.157 -        # Set up files for the main() stub
   4.158 -        COPY_ARCH_SRC(src/main, macos, SDL_main.c)
   4.159          # Set up files for the audio library
   4.160          if test x$enable_audio = xyes; then
   4.161              AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
   4.162 @@ -2452,9 +2416,6 @@
   4.163          CheckQUARTZ
   4.164          CheckMacGL
   4.165          CheckPTHREAD
   4.166 -        # Set up files for the main() stub
   4.167 -        COPY_ARCH_SRC(src/main, macosx, SDLMain.m)
   4.168 -        COPY_ARCH_SRC(src/main, macosx, SDLMain.h)
   4.169          # Set up files for the audio library
   4.170          if test x$enable_audio = xyes; then
   4.171              AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
   4.172 @@ -2498,8 +2459,6 @@
   4.173          CheckAtariAudio
   4.174          CheckAtariLdg
   4.175          CheckPTH
   4.176 -        # Set up files for the main() stub
   4.177 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.178          # Set up files for the audio library
   4.179          if test x$enable_threads = xyes -a x$enable_pth = xyes; then
   4.180              if test x$enable_audio = xyes; then
   4.181 @@ -2528,8 +2487,6 @@
   4.182                  COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
   4.183              else
   4.184                  COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
   4.185 -                COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
   4.186 -                COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
   4.187              fi
   4.188          fi
   4.189          # MiNT does not define "unix"
   4.190 @@ -2540,7 +2497,6 @@
   4.191          JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
   4.192          JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
   4.193          COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c)
   4.194 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   4.195          VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
   4.196          VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
   4.197          AUDIO_SUBDIRS="$AUDIO_SUBDIRS riscos"
   4.198 @@ -2648,7 +2604,6 @@
   4.199  CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
   4.200  CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
   4.201  CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
   4.202 -CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
   4.203  CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
   4.204  CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
   4.205  CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
     5.1 --- a/install-sh	Wed Dec 10 12:35:56 2003 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,251 +0,0 @@
     5.4 -#!/bin/sh
     5.5 -#
     5.6 -# install - install a program, script, or datafile
     5.7 -# This comes from X11R5 (mit/util/scripts/install.sh).
     5.8 -#
     5.9 -# Copyright 1991 by the Massachusetts Institute of Technology
    5.10 -#
    5.11 -# Permission to use, copy, modify, distribute, and sell this software and its
    5.12 -# documentation for any purpose is hereby granted without fee, provided that
    5.13 -# the above copyright notice appear in all copies and that both that
    5.14 -# copyright notice and this permission notice appear in supporting
    5.15 -# documentation, and that the name of M.I.T. not be used in advertising or
    5.16 -# publicity pertaining to distribution of the software without specific,
    5.17 -# written prior permission.  M.I.T. makes no representations about the
    5.18 -# suitability of this software for any purpose.  It is provided "as is"
    5.19 -# without express or implied warranty.
    5.20 -#
    5.21 -# Calling this script install-sh is preferred over install.sh, to prevent
    5.22 -# `make' implicit rules from creating a file called install from it
    5.23 -# when there is no Makefile.
    5.24 -#
    5.25 -# This script is compatible with the BSD install script, but was written
    5.26 -# from scratch.  It can only install one file at a time, a restriction
    5.27 -# shared with many OS's install programs.
    5.28 -
    5.29 -
    5.30 -# set DOITPROG to echo to test this script
    5.31 -
    5.32 -# Don't use :- since 4.3BSD and earlier shells don't like it.
    5.33 -doit="${DOITPROG-}"
    5.34 -
    5.35 -
    5.36 -# put in absolute paths if you don't have them in your path; or use env. vars.
    5.37 -
    5.38 -mvprog="${MVPROG-mv}"
    5.39 -cpprog="${CPPROG-cp}"
    5.40 -chmodprog="${CHMODPROG-chmod}"
    5.41 -chownprog="${CHOWNPROG-chown}"
    5.42 -chgrpprog="${CHGRPPROG-chgrp}"
    5.43 -stripprog="${STRIPPROG-strip}"
    5.44 -rmprog="${RMPROG-rm}"
    5.45 -mkdirprog="${MKDIRPROG-mkdir}"
    5.46 -
    5.47 -transformbasename=""
    5.48 -transform_arg=""
    5.49 -instcmd="$mvprog"
    5.50 -chmodcmd="$chmodprog 0755"
    5.51 -chowncmd=""
    5.52 -chgrpcmd=""
    5.53 -stripcmd=""
    5.54 -rmcmd="$rmprog -f"
    5.55 -mvcmd="$mvprog"
    5.56 -src=""
    5.57 -dst=""
    5.58 -dir_arg=""
    5.59 -
    5.60 -while [ x"$1" != x ]; do
    5.61 -    case $1 in
    5.62 -	-c) instcmd="$cpprog"
    5.63 -	    shift
    5.64 -	    continue;;
    5.65 -
    5.66 -	-d) dir_arg=true
    5.67 -	    shift
    5.68 -	    continue;;
    5.69 -
    5.70 -	-m) chmodcmd="$chmodprog $2"
    5.71 -	    shift
    5.72 -	    shift
    5.73 -	    continue;;
    5.74 -
    5.75 -	-o) chowncmd="$chownprog $2"
    5.76 -	    shift
    5.77 -	    shift
    5.78 -	    continue;;
    5.79 -
    5.80 -	-g) chgrpcmd="$chgrpprog $2"
    5.81 -	    shift
    5.82 -	    shift
    5.83 -	    continue;;
    5.84 -
    5.85 -	-s) stripcmd="$stripprog"
    5.86 -	    shift
    5.87 -	    continue;;
    5.88 -
    5.89 -	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
    5.90 -	    shift
    5.91 -	    continue;;
    5.92 -
    5.93 -	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
    5.94 -	    shift
    5.95 -	    continue;;
    5.96 -
    5.97 -	*)  if [ x"$src" = x ]
    5.98 -	    then
    5.99 -		src=$1
   5.100 -	    else
   5.101 -		# this colon is to work around a 386BSD /bin/sh bug
   5.102 -		:
   5.103 -		dst=$1
   5.104 -	    fi
   5.105 -	    shift
   5.106 -	    continue;;
   5.107 -    esac
   5.108 -done
   5.109 -
   5.110 -if [ x"$src" = x ]
   5.111 -then
   5.112 -	echo "install:	no input file specified"
   5.113 -	exit 1
   5.114 -else
   5.115 -	true
   5.116 -fi
   5.117 -
   5.118 -if [ x"$dir_arg" != x ]; then
   5.119 -	dst=$src
   5.120 -	src=""
   5.121 -	
   5.122 -	if [ -d $dst ]; then
   5.123 -		instcmd=:
   5.124 -		chmodcmd=""
   5.125 -	else
   5.126 -		instcmd=mkdir
   5.127 -	fi
   5.128 -else
   5.129 -
   5.130 -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
   5.131 -# might cause directories to be created, which would be especially bad 
   5.132 -# if $src (and thus $dsttmp) contains '*'.
   5.133 -
   5.134 -	if [ -f $src -o -d $src ]
   5.135 -	then
   5.136 -		true
   5.137 -	else
   5.138 -		echo "install:  $src does not exist"
   5.139 -		exit 1
   5.140 -	fi
   5.141 -	
   5.142 -	if [ x"$dst" = x ]
   5.143 -	then
   5.144 -		echo "install:	no destination specified"
   5.145 -		exit 1
   5.146 -	else
   5.147 -		true
   5.148 -	fi
   5.149 -
   5.150 -# If destination is a directory, append the input filename; if your system
   5.151 -# does not like double slashes in filenames, you may need to add some logic
   5.152 -
   5.153 -	if [ -d $dst ]
   5.154 -	then
   5.155 -		dst="$dst"/`basename $src`
   5.156 -	else
   5.157 -		true
   5.158 -	fi
   5.159 -fi
   5.160 -
   5.161 -## this sed command emulates the dirname command
   5.162 -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
   5.163 -
   5.164 -# Make sure that the destination directory exists.
   5.165 -#  this part is taken from Noah Friedman's mkinstalldirs script
   5.166 -
   5.167 -# Skip lots of stat calls in the usual case.
   5.168 -if [ ! -d "$dstdir" ]; then
   5.169 -defaultIFS='	
   5.170 -'
   5.171 -IFS="${IFS-${defaultIFS}}"
   5.172 -
   5.173 -oIFS="${IFS}"
   5.174 -# Some sh's can't handle IFS=/ for some reason.
   5.175 -IFS='%'
   5.176 -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
   5.177 -IFS="${oIFS}"
   5.178 -
   5.179 -pathcomp=''
   5.180 -
   5.181 -while [ $# -ne 0 ] ; do
   5.182 -	pathcomp="${pathcomp}${1}"
   5.183 -	shift
   5.184 -
   5.185 -	if [ ! -d "${pathcomp}" ] ;
   5.186 -        then
   5.187 -		$mkdirprog "${pathcomp}"
   5.188 -	else
   5.189 -		true
   5.190 -	fi
   5.191 -
   5.192 -	pathcomp="${pathcomp}/"
   5.193 -done
   5.194 -fi
   5.195 -
   5.196 -if [ x"$dir_arg" != x ]
   5.197 -then
   5.198 -	$doit $instcmd $dst &&
   5.199 -
   5.200 -	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
   5.201 -	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
   5.202 -	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
   5.203 -	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
   5.204 -else
   5.205 -
   5.206 -# If we're going to rename the final executable, determine the name now.
   5.207 -
   5.208 -	if [ x"$transformarg" = x ] 
   5.209 -	then
   5.210 -		dstfile=`basename $dst`
   5.211 -	else
   5.212 -		dstfile=`basename $dst $transformbasename | 
   5.213 -			sed $transformarg`$transformbasename
   5.214 -	fi
   5.215 -
   5.216 -# don't allow the sed command to completely eliminate the filename
   5.217 -
   5.218 -	if [ x"$dstfile" = x ] 
   5.219 -	then
   5.220 -		dstfile=`basename $dst`
   5.221 -	else
   5.222 -		true
   5.223 -	fi
   5.224 -
   5.225 -# Make a temp file name in the proper directory.
   5.226 -
   5.227 -	dsttmp=$dstdir/#inst.$$#
   5.228 -
   5.229 -# Move or copy the file name to the temp name
   5.230 -
   5.231 -	$doit $instcmd $src $dsttmp &&
   5.232 -
   5.233 -	trap "rm -f ${dsttmp}" 0 &&
   5.234 -
   5.235 -# and set any options; do chmod last to preserve setuid bits
   5.236 -
   5.237 -# If any of these fail, we abort the whole thing.  If we want to
   5.238 -# ignore errors from any of these, just make sure not to ignore
   5.239 -# errors from the above "$doit $instcmd $src $dsttmp" command.
   5.240 -
   5.241 -	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
   5.242 -	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
   5.243 -	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
   5.244 -	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
   5.245 -
   5.246 -# Now rename the file to the real destination.
   5.247 -
   5.248 -	$doit $rmcmd -f $dstdir/$dstfile &&
   5.249 -	$doit $mvcmd $dsttmp $dstdir/$dstfile 
   5.250 -
   5.251 -fi &&
   5.252 -
   5.253 -
   5.254 -exit 0
     6.1 --- a/missing	Wed Dec 10 12:35:56 2003 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,336 +0,0 @@
     6.4 -#! /bin/sh
     6.5 -# Common stub for a few missing GNU programs while installing.
     6.6 -# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
     6.7 -# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
     6.8 -
     6.9 -# This program is free software; you can redistribute it and/or modify
    6.10 -# it under the terms of the GNU General Public License as published by
    6.11 -# the Free Software Foundation; either version 2, or (at your option)
    6.12 -# any later version.
    6.13 -
    6.14 -# This program is distributed in the hope that it will be useful,
    6.15 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.16 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.17 -# GNU General Public License for more details.
    6.18 -
    6.19 -# You should have received a copy of the GNU General Public License
    6.20 -# along with this program; if not, write to the Free Software
    6.21 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    6.22 -# 02111-1307, USA.
    6.23 -
    6.24 -# As a special exception to the GNU General Public License, if you
    6.25 -# distribute this file as part of a program that contains a
    6.26 -# configuration script generated by Autoconf, you may include it under
    6.27 -# the same distribution terms that you use for the rest of that program.
    6.28 -
    6.29 -if test $# -eq 0; then
    6.30 -  echo 1>&2 "Try \`$0 --help' for more information"
    6.31 -  exit 1
    6.32 -fi
    6.33 -
    6.34 -run=:
    6.35 -
    6.36 -# In the cases where this matters, `missing' is being run in the
    6.37 -# srcdir already.
    6.38 -if test -f configure.ac; then
    6.39 -  configure_ac=configure.ac
    6.40 -else
    6.41 -  configure_ac=configure.in
    6.42 -fi
    6.43 -
    6.44 -case "$1" in
    6.45 ---run)
    6.46 -  # Try to run requested program, and just exit if it succeeds.
    6.47 -  run=
    6.48 -  shift
    6.49 -  "$@" && exit 0
    6.50 -  ;;
    6.51 -esac
    6.52 -
    6.53 -# If it does not exist, or fails to run (possibly an outdated version),
    6.54 -# try to emulate it.
    6.55 -case "$1" in
    6.56 -
    6.57 -  -h|--h|--he|--hel|--help)
    6.58 -    echo "\
    6.59 -$0 [OPTION]... PROGRAM [ARGUMENT]...
    6.60 -
    6.61 -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
    6.62 -error status if there is no known handling for PROGRAM.
    6.63 -
    6.64 -Options:
    6.65 -  -h, --help      display this help and exit
    6.66 -  -v, --version   output version information and exit
    6.67 -  --run           try to run the given command, and emulate it if it fails
    6.68 -
    6.69 -Supported PROGRAM values:
    6.70 -  aclocal      touch file \`aclocal.m4'
    6.71 -  autoconf     touch file \`configure'
    6.72 -  autoheader   touch file \`config.h.in'
    6.73 -  automake     touch all \`Makefile.in' files
    6.74 -  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
    6.75 -  flex         create \`lex.yy.c', if possible, from existing .c
    6.76 -  help2man     touch the output file
    6.77 -  lex          create \`lex.yy.c', if possible, from existing .c
    6.78 -  makeinfo     touch the output file
    6.79 -  tar          try tar, gnutar, gtar, then tar without non-portable flags
    6.80 -  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
    6.81 -    ;;
    6.82 -
    6.83 -  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
    6.84 -    echo "missing 0.4 - GNU automake"
    6.85 -    ;;
    6.86 -
    6.87 -  -*)
    6.88 -    echo 1>&2 "$0: Unknown \`$1' option"
    6.89 -    echo 1>&2 "Try \`$0 --help' for more information"
    6.90 -    exit 1
    6.91 -    ;;
    6.92 -
    6.93 -  aclocal*)
    6.94 -    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    6.95 -       # We have it, but it failed.
    6.96 -       exit 1
    6.97 -    fi
    6.98 -
    6.99 -    echo 1>&2 "\
   6.100 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.101 -         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
   6.102 -         to install the \`Automake' and \`Perl' packages.  Grab them from
   6.103 -         any GNU archive site."
   6.104 -    touch aclocal.m4
   6.105 -    ;;
   6.106 -
   6.107 -  autoconf)
   6.108 -    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   6.109 -       # We have it, but it failed.
   6.110 -       exit 1
   6.111 -    fi
   6.112 -
   6.113 -    echo 1>&2 "\
   6.114 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.115 -         you modified \`${configure_ac}'.  You might want to install the
   6.116 -         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
   6.117 -         archive site."
   6.118 -    touch configure
   6.119 -    ;;
   6.120 -
   6.121 -  autoheader)
   6.122 -    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   6.123 -       # We have it, but it failed.
   6.124 -       exit 1
   6.125 -    fi
   6.126 -
   6.127 -    echo 1>&2 "\
   6.128 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.129 -         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
   6.130 -         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
   6.131 -         from any GNU archive site."
   6.132 -    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
   6.133 -    test -z "$files" && files="config.h"
   6.134 -    touch_files=
   6.135 -    for f in $files; do
   6.136 -      case "$f" in
   6.137 -      *:*) touch_files="$touch_files "`echo "$f" |
   6.138 -				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
   6.139 -      *) touch_files="$touch_files $f.in";;
   6.140 -      esac
   6.141 -    done
   6.142 -    touch $touch_files
   6.143 -    ;;
   6.144 -
   6.145 -  automake*)
   6.146 -    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   6.147 -       # We have it, but it failed.
   6.148 -       exit 1
   6.149 -    fi
   6.150 -
   6.151 -    echo 1>&2 "\
   6.152 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.153 -         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
   6.154 -         You might want to install the \`Automake' and \`Perl' packages.
   6.155 -         Grab them from any GNU archive site."
   6.156 -    find . -type f -name Makefile.am -print |
   6.157 -	   sed 's/\.am$/.in/' |
   6.158 -	   while read f; do touch "$f"; done
   6.159 -    ;;
   6.160 -
   6.161 -  autom4te)
   6.162 -    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   6.163 -       # We have it, but it failed.
   6.164 -       exit 1
   6.165 -    fi
   6.166 -
   6.167 -    echo 1>&2 "\
   6.168 -WARNING: \`$1' is needed, and you do not seem to have it handy on your
   6.169 -         system.  You might have modified some files without having the
   6.170 -         proper tools for further handling them.
   6.171 -         You can get \`$1Help2man' as part of \`Autoconf' from any GNU
   6.172 -         archive site."
   6.173 -
   6.174 -    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
   6.175 -    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
   6.176 -    if test -f "$file"; then
   6.177 -	touch $file
   6.178 -    else
   6.179 -	test -z "$file" || exec >$file
   6.180 -	echo "#! /bin/sh"
   6.181 -	echo "# Created by GNU Automake missing as a replacement of"
   6.182 -	echo "#  $ $@"
   6.183 -	echo "exit 0"
   6.184 -	chmod +x $file
   6.185 -	exit 1
   6.186 -    fi
   6.187 -    ;;
   6.188 -
   6.189 -  bison|yacc)
   6.190 -    echo 1>&2 "\
   6.191 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.192 -         you modified a \`.y' file.  You may need the \`Bison' package
   6.193 -         in order for those modifications to take effect.  You can get
   6.194 -         \`Bison' from any GNU archive site."
   6.195 -    rm -f y.tab.c y.tab.h
   6.196 -    if [ $# -ne 1 ]; then
   6.197 -        eval LASTARG="\${$#}"
   6.198 -	case "$LASTARG" in
   6.199 -	*.y)
   6.200 -	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
   6.201 -	    if [ -f "$SRCFILE" ]; then
   6.202 -	         cp "$SRCFILE" y.tab.c
   6.203 -	    fi
   6.204 -	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
   6.205 -	    if [ -f "$SRCFILE" ]; then
   6.206 -	         cp "$SRCFILE" y.tab.h
   6.207 -	    fi
   6.208 -	  ;;
   6.209 -	esac
   6.210 -    fi
   6.211 -    if [ ! -f y.tab.h ]; then
   6.212 -	echo >y.tab.h
   6.213 -    fi
   6.214 -    if [ ! -f y.tab.c ]; then
   6.215 -	echo 'main() { return 0; }' >y.tab.c
   6.216 -    fi
   6.217 -    ;;
   6.218 -
   6.219 -  lex|flex)
   6.220 -    echo 1>&2 "\
   6.221 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.222 -         you modified a \`.l' file.  You may need the \`Flex' package
   6.223 -         in order for those modifications to take effect.  You can get
   6.224 -         \`Flex' from any GNU archive site."
   6.225 -    rm -f lex.yy.c
   6.226 -    if [ $# -ne 1 ]; then
   6.227 -        eval LASTARG="\${$#}"
   6.228 -	case "$LASTARG" in
   6.229 -	*.l)
   6.230 -	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
   6.231 -	    if [ -f "$SRCFILE" ]; then
   6.232 -	         cp "$SRCFILE" lex.yy.c
   6.233 -	    fi
   6.234 -	  ;;
   6.235 -	esac
   6.236 -    fi
   6.237 -    if [ ! -f lex.yy.c ]; then
   6.238 -	echo 'main() { return 0; }' >lex.yy.c
   6.239 -    fi
   6.240 -    ;;
   6.241 -
   6.242 -  help2man)
   6.243 -    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   6.244 -       # We have it, but it failed.
   6.245 -       exit 1
   6.246 -    fi
   6.247 -
   6.248 -    echo 1>&2 "\
   6.249 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.250 -	 you modified a dependency of a manual page.  You may need the
   6.251 -	 \`Help2man' package in order for those modifications to take
   6.252 -	 effect.  You can get \`Help2man' from any GNU archive site."
   6.253 -
   6.254 -    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
   6.255 -    if test -z "$file"; then
   6.256 -	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
   6.257 -    fi
   6.258 -    if [ -f "$file" ]; then
   6.259 -	touch $file
   6.260 -    else
   6.261 -	test -z "$file" || exec >$file
   6.262 -	echo ".ab help2man is required to generate this page"
   6.263 -	exit 1
   6.264 -    fi
   6.265 -    ;;
   6.266 -
   6.267 -  makeinfo)
   6.268 -    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
   6.269 -       # We have makeinfo, but it failed.
   6.270 -       exit 1
   6.271 -    fi
   6.272 -
   6.273 -    echo 1>&2 "\
   6.274 -WARNING: \`$1' is missing on your system.  You should only need it if
   6.275 -         you modified a \`.texi' or \`.texinfo' file, or any other file
   6.276 -         indirectly affecting the aspect of the manual.  The spurious
   6.277 -         call might also be the consequence of using a buggy \`make' (AIX,
   6.278 -         DU, IRIX).  You might want to install the \`Texinfo' package or
   6.279 -         the \`GNU make' package.  Grab either from any GNU archive site."
   6.280 -    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
   6.281 -    if test -z "$file"; then
   6.282 -      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
   6.283 -      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
   6.284 -    fi
   6.285 -    touch $file
   6.286 -    ;;
   6.287 -
   6.288 -  tar)
   6.289 -    shift
   6.290 -    if test -n "$run"; then
   6.291 -      echo 1>&2 "ERROR: \`tar' requires --run"
   6.292 -      exit 1
   6.293 -    fi
   6.294 -
   6.295 -    # We have already tried tar in the generic part.
   6.296 -    # Look for gnutar/gtar before invocation to avoid ugly error
   6.297 -    # messages.
   6.298 -    if (gnutar --version > /dev/null 2>&1); then
   6.299 -       gnutar "$@" && exit 0
   6.300 -    fi
   6.301 -    if (gtar --version > /dev/null 2>&1); then
   6.302 -       gtar "$@" && exit 0
   6.303 -    fi
   6.304 -    firstarg="$1"
   6.305 -    if shift; then
   6.306 -	case "$firstarg" in
   6.307 -	*o*)
   6.308 -	    firstarg=`echo "$firstarg" | sed s/o//`
   6.309 -	    tar "$firstarg" "$@" && exit 0
   6.310 -	    ;;
   6.311 -	esac
   6.312 -	case "$firstarg" in
   6.313 -	*h*)
   6.314 -	    firstarg=`echo "$firstarg" | sed s/h//`
   6.315 -	    tar "$firstarg" "$@" && exit 0
   6.316 -	    ;;
   6.317 -	esac
   6.318 -    fi
   6.319 -
   6.320 -    echo 1>&2 "\
   6.321 -WARNING: I can't seem to be able to run \`tar' with the given arguments.
   6.322 -         You may want to install GNU tar or Free paxutils, or check the
   6.323 -         command line arguments."
   6.324 -    exit 1
   6.325 -    ;;
   6.326 -
   6.327 -  *)
   6.328 -    echo 1>&2 "\
   6.329 -WARNING: \`$1' is needed, and you do not seem to have it handy on your
   6.330 -         system.  You might have modified some files without having the
   6.331 -         proper tools for further handling them.  Check the \`README' file,
   6.332 -         it often tells you about the needed prerequirements for installing
   6.333 -         this package.  You may also peek at any GNU archive site, in case
   6.334 -         some other package would contain this missing \`$1' program."
   6.335 -    exit 1
   6.336 -    ;;
   6.337 -esac
   6.338 -
   6.339 -exit 0
     7.1 --- a/mkinstalldirs	Wed Dec 10 12:35:56 2003 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,40 +0,0 @@
     7.4 -#! /bin/sh
     7.5 -# mkinstalldirs --- make directory hierarchy
     7.6 -# Author: Noah Friedman <friedman@prep.ai.mit.edu>
     7.7 -# Created: 1993-05-16
     7.8 -# Public domain
     7.9 -
    7.10 -# $Id$
    7.11 -
    7.12 -errstatus=0
    7.13 -
    7.14 -for file
    7.15 -do
    7.16 -   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    7.17 -   shift
    7.18 -
    7.19 -   pathcomp=
    7.20 -   for d
    7.21 -   do
    7.22 -     pathcomp="$pathcomp$d"
    7.23 -     case "$pathcomp" in
    7.24 -       -* ) pathcomp=./$pathcomp ;;
    7.25 -     esac
    7.26 -
    7.27 -     if test ! -d "$pathcomp"; then
    7.28 -        echo "mkdir $pathcomp"
    7.29 -
    7.30 -        mkdir "$pathcomp" || lasterr=$?
    7.31 -
    7.32 -        if test ! -d "$pathcomp"; then
    7.33 -  	  errstatus=$lasterr
    7.34 -        fi
    7.35 -     fi
    7.36 -
    7.37 -     pathcomp="$pathcomp/"
    7.38 -   done
    7.39 -done
    7.40 -
    7.41 -exit $errstatus
    7.42 -
    7.43 -# mkinstalldirs ends here
     8.1 --- a/src/main/Makefile.am	Wed Dec 10 12:35:56 2003 +0000
     8.2 +++ b/src/main/Makefile.am	Sun Dec 14 06:25:53 2003 +0000
     8.3 @@ -6,44 +6,40 @@
     8.4  
     8.5  ARCH_SUBDIRS = $(srcdir)/beos \
     8.6                 $(srcdir)/epoc \
     8.7 -               $(srcdir)/linux \
     8.8 +               $(srcdir)/dummy \
     8.9                 $(srcdir)/macos \
    8.10                 $(srcdir)/macosx \
    8.11 +               $(srcdir)/qtopia \
    8.12                 $(srcdir)/win32
    8.13  
    8.14  # Build a separate library containing the main() entry point.
    8.15  lib_LIBRARIES = libSDLmain.a
    8.16  
    8.17 +if TARGET_WIN32
    8.18 +MAINLIB_ARCH_SRCS = win32/SDL_win32_main.c
    8.19 +else
    8.20  if TARGET_MACOSX
    8.21 -MAINLIB_ARCH_SRCS = SDLMain.m SDLMain.h
    8.22 +MAINLIB_ARCH_SRCS = macosx/SDLMain.m macosx/SDLMain.h
    8.23  else
    8.24  if TARGET_QTOPIA
    8.25 -MAINLIB_ARCH_SRCS = SDL_Qtopia_main.cc
    8.26 +MAINLIB_ARCH_SRCS = qtopia/SDL_qtopia_main.cc
    8.27  else
    8.28 -MAINLIB_ARCH_SRCS = SDL_main.c
    8.29 -endif
    8.30 -endif
    8.31 +MAINLIB_ARCH_SRCS = dummy/SDL_dummy_main.c
    8.32 +endif !TARGET_QTOPIA
    8.33 +endif !TARGET_MACOSX
    8.34 +endif !TARGET_WIN32
    8.35  libSDLmain_a_SOURCES = $(MAINLIB_ARCH_SRCS)
    8.36  
    8.37  # Build an internal library of any special app setup functions
    8.38  noinst_LTLIBRARIES = libarch.la
    8.39  
    8.40  if TARGET_BEOS
    8.41 -ARCH_SRCS = SDL_BeApp.cc SDL_BeApp.h
    8.42 +ARCH_SRCS = beos/SDL_BeApp.cc beos/SDL_BeApp.h
    8.43  else
    8.44 -ARCH_SRCS = 
    8.45 +ARCH_SRCS = arch.c
    8.46  endif
    8.47  
    8.48 -# Include the architecture-independent sources
    8.49 -COMMON_SRCS = dummy.c
    8.50 -
    8.51 -libarch_la_SOURCES = $(COMMON_SRCS) $(ARCH_SRCS)
    8.52 -
    8.53 -## Let automake know that it shouldn't distribute linked sources
    8.54 -BUILT_SOURCES = $(MAINLIB_ARCH_SRCS) $(ARCH_SRCS)
    8.55 -
    8.56 -## Let automake know that it should remove these for distribution
    8.57 -DISTCLEANFILES = $(MAINLIB_ARCH_SRCS) $(ARCH_SRCS)
    8.58 +libarch_la_SOURCES = $(ARCH_SRCS)
    8.59  
    8.60  # The architecture specific directories need to be copied into place
    8.61  # when building a distribution.
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/src/main/arch.c	Sun Dec 14 06:25:53 2003 +0000
     9.3 @@ -0,0 +1,4 @@
     9.4 +
     9.5 +/* This is needed for automake, so that it can build an empty archive */
     9.6 +
     9.7 +int pointless_symbol_so_the_archive_doesnt_look_empty;
    10.1 --- a/src/main/dummy.c	Wed Dec 10 12:35:56 2003 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,4 +0,0 @@
    10.4 -
    10.5 -/* This is needed for automake, so that it can build an empty archive */
    10.6 -
    10.7 -int pointless_symbol_so_the_archive_doesnt_look_empty;
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/main/dummy/SDL_dummy_main.c	Sun Dec 14 06:25:53 2003 +0000
    11.3 @@ -0,0 +1,11 @@
    11.4 +
    11.5 +/* Include the SDL main definition header */
    11.6 +#include "SDL_main.h"
    11.7 +#ifdef main
    11.8 +#undef main
    11.9 +#endif
   11.10 +
   11.11 +int main(int argc, char *argv[])
   11.12 +{
   11.13 +	return(SDL_main(argc, argv));
   11.14 +}
    12.1 --- a/src/main/linux/SDL_Qtopia_main.cc	Wed Dec 10 12:35:56 2003 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,47 +0,0 @@
    12.4 -
    12.5 -/* Include the SDL main definition header */
    12.6 -#include "SDL_main.h"
    12.7 -#include <stdlib.h>
    12.8 -#include <unistd.h>
    12.9 -#ifdef main
   12.10 -#undef main
   12.11 -#endif
   12.12 -#ifdef QWS
   12.13 -#include <qpe/qpeapplication.h>
   12.14 -#include <qapplication.h>
   12.15 -#include <qpe/qpeapplication.h>
   12.16 -#include <stdlib.h>
   12.17 -
   12.18 -// Workaround for OPIE to remove taskbar icon. Also fixes
   12.19 -// some issues in Qtopia where there are left-over qcop files in /tmp/.
   12.20 -// I'm guessing this will also clean up the taskbar in the Sharp version
   12.21 -// of Qtopia.
   12.22 -static inline void cleanupQCop() {
   12.23 -  QString appname(qApp->argv()[0]);
   12.24 -  int slash = appname.findRev("/");
   12.25 -  if(slash != -1) {  appname = appname.mid(slash+1); }
   12.26 -  QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'";
   12.27 -  system(cmd.latin1());
   12.28 -  cmd = "/tmp/qcop-msg-"+appname;
   12.29 -  unlink(cmd.latin1());
   12.30 -}
   12.31 -
   12.32 -static QPEApplication *app;
   12.33 -#endif
   12.34 -
   12.35 -extern int SDL_main(int argc, char *argv[]);
   12.36 -
   12.37 -int main(int argc, char *argv[])
   12.38 -{
   12.39 -#ifdef QWS
   12.40 -  // This initializes the Qtopia application. It needs to be done here
   12.41 -  // because it parses command line options.
   12.42 -  app = new QPEApplication(argc, argv);
   12.43 -  QWidget dummy;
   12.44 -  app->showMainWidget(&dummy);
   12.45 -  atexit(cleanupQCop);
   12.46 -#endif
   12.47 -  // Exit here because if return is used, the application
   12.48 -  // doesn't seem to quit correctly.
   12.49 -  exit(SDL_main(argc, argv));
   12.50 -}
    13.1 --- a/src/main/linux/SDL_main.c	Wed Dec 10 12:35:56 2003 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,13 +0,0 @@
    13.4 -
    13.5 -/* Include the SDL main definition header */
    13.6 -#include "SDL_main.h"
    13.7 -#ifdef main
    13.8 -#undef main
    13.9 -#endif
   13.10 -
   13.11 -extern int SDL_main(int argc, char *argv[]);
   13.12 -
   13.13 -int main(int argc, char *argv[])
   13.14 -{
   13.15 -	return(SDL_main(argc, argv));
   13.16 -}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/main/qtopia/SDL_qtopia_main.cc	Sun Dec 14 06:25:53 2003 +0000
    14.3 @@ -0,0 +1,47 @@
    14.4 +
    14.5 +/* Include the SDL main definition header */
    14.6 +#include "SDL_main.h"
    14.7 +#include <stdlib.h>
    14.8 +#include <unistd.h>
    14.9 +#ifdef main
   14.10 +#undef main
   14.11 +#endif
   14.12 +#ifdef QWS
   14.13 +#include <qpe/qpeapplication.h>
   14.14 +#include <qapplication.h>
   14.15 +#include <qpe/qpeapplication.h>
   14.16 +#include <stdlib.h>
   14.17 +
   14.18 +// Workaround for OPIE to remove taskbar icon. Also fixes
   14.19 +// some issues in Qtopia where there are left-over qcop files in /tmp/.
   14.20 +// I'm guessing this will also clean up the taskbar in the Sharp version
   14.21 +// of Qtopia.
   14.22 +static inline void cleanupQCop() {
   14.23 +  QString appname(qApp->argv()[0]);
   14.24 +  int slash = appname.findRev("/");
   14.25 +  if(slash != -1) {  appname = appname.mid(slash+1); }
   14.26 +  QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'";
   14.27 +  system(cmd.latin1());
   14.28 +  cmd = "/tmp/qcop-msg-"+appname;
   14.29 +  unlink(cmd.latin1());
   14.30 +}
   14.31 +
   14.32 +static QPEApplication *app;
   14.33 +#endif
   14.34 +
   14.35 +extern int SDL_main(int argc, char *argv[]);
   14.36 +
   14.37 +int main(int argc, char *argv[])
   14.38 +{
   14.39 +#ifdef QWS
   14.40 +  // This initializes the Qtopia application. It needs to be done here
   14.41 +  // because it parses command line options.
   14.42 +  app = new QPEApplication(argc, argv);
   14.43 +  QWidget dummy;
   14.44 +  app->showMainWidget(&dummy);
   14.45 +  atexit(cleanupQCop);
   14.46 +#endif
   14.47 +  // Exit here because if return is used, the application
   14.48 +  // doesn't seem to quit correctly.
   14.49 +  exit(SDL_main(argc, argv));
   14.50 +}
    15.1 --- a/src/main/win32/SDL_main.c	Wed Dec 10 12:35:56 2003 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,361 +0,0 @@
    15.4 -/*
    15.5 -    SDL_main.c, placed in the public domain by Sam Lantinga  4/13/98
    15.6 -
    15.7 -    The WinMain function -- calls your program's main() function
    15.8 -*/
    15.9 -
   15.10 -#include <stdio.h>
   15.11 -#include <string.h>
   15.12 -#include <ctype.h>
   15.13 -#include <stdlib.h>
   15.14 -
   15.15 -#include <windows.h>
   15.16 -#include <malloc.h>			/* For _alloca() */
   15.17 -
   15.18 -#ifdef _WIN32_WCE
   15.19 -# define DIR_SEPERATOR TEXT("\\")
   15.20 -# define _getcwd(str,len)	wcscpy(str,DIR_SEPERATOR);
   15.21 -# define setbuf(x)
   15.22 -# define setvbuf(x)
   15.23 -# define fopen		_wfopen
   15.24 -# define freopen	_wfreopen
   15.25 -# define remove(x)	DeleteFile(x)
   15.26 -# define strcat		wcscat
   15.27 -#else
   15.28 -# define DIR_SEPERATOR TEXT("/")
   15.29 -# include <direct.h>
   15.30 -#endif
   15.31 -
   15.32 -/* Include the SDL main definition header */
   15.33 -#include "SDL.h"
   15.34 -#include "SDL_main.h"
   15.35 -
   15.36 -#ifdef main
   15.37 -# ifndef _WIN32_WCE_EMULATION
   15.38 -#  undef main
   15.39 -# endif /* _WIN32_WCE_EMULATION */
   15.40 -#endif /* main */
   15.41 -
   15.42 -/* The standard output files */
   15.43 -#define STDOUT_FILE	TEXT("stdout.txt")
   15.44 -#define STDERR_FILE	TEXT("stderr.txt")
   15.45 -
   15.46 -#ifndef NO_STDIO_REDIRECT
   15.47 -# ifdef _WIN32_WCE
   15.48 -  static wchar_t stdoutPath[MAX_PATH];
   15.49 -  static wchar_t stderrPath[MAX_PATH];
   15.50 -# else
   15.51 -  static char stdoutPath[MAX_PATH];
   15.52 -  static char stderrPath[MAX_PATH];
   15.53 -# endif
   15.54 -#endif
   15.55 -
   15.56 -#if defined(_WIN32_WCE) && _WIN32_WCE < 300
   15.57 -/* seems to be undefined in Win CE although in online help */
   15.58 -#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
   15.59 -
   15.60 -/* seems to be undefined in Win CE although in online help */
   15.61 -char *strrchr(char *str, int c)
   15.62 -{
   15.63 -	char *p;
   15.64 -
   15.65 -	/* Skip to the end of the string */
   15.66 -	p=str;
   15.67 -	while (*p)
   15.68 -		p++;
   15.69 -
   15.70 -	/* Look for the given character */
   15.71 -	while ( (p >= str) && (*p != (CHAR)c) )
   15.72 -		p--;
   15.73 -
   15.74 -	/* Return NULL if character not found */
   15.75 -	if ( p < str ) {
   15.76 -		p = NULL;
   15.77 -	}
   15.78 -	return p;
   15.79 -}
   15.80 -#endif /* _WIN32_WCE < 300 */
   15.81 -
   15.82 -/* Parse a command line buffer into arguments */
   15.83 -static int ParseCommandLine(char *cmdline, char **argv)
   15.84 -{
   15.85 -	char *bufp;
   15.86 -	int argc;
   15.87 -
   15.88 -	argc = 0;
   15.89 -	for ( bufp = cmdline; *bufp; ) {
   15.90 -		/* Skip leading whitespace */
   15.91 -		while ( isspace(*bufp) ) {
   15.92 -			++bufp;
   15.93 -		}
   15.94 -		/* Skip over argument */
   15.95 -		if ( *bufp == '"' ) {
   15.96 -			++bufp;
   15.97 -			if ( *bufp ) {
   15.98 -				if ( argv ) {
   15.99 -					argv[argc] = bufp;
  15.100 -				}
  15.101 -				++argc;
  15.102 -			}
  15.103 -			/* Skip over word */
  15.104 -			while ( *bufp && (*bufp != '"') ) {
  15.105 -				++bufp;
  15.106 -			}
  15.107 -		} else {
  15.108 -			if ( *bufp ) {
  15.109 -				if ( argv ) {
  15.110 -					argv[argc] = bufp;
  15.111 -				}
  15.112 -				++argc;
  15.113 -			}
  15.114 -			/* Skip over word */
  15.115 -			while ( *bufp && ! isspace(*bufp) ) {
  15.116 -				++bufp;
  15.117 -			}
  15.118 -		}
  15.119 -		if ( *bufp ) {
  15.120 -			if ( argv ) {
  15.121 -				*bufp = '\0';
  15.122 -			}
  15.123 -			++bufp;
  15.124 -		}
  15.125 -	}
  15.126 -	if ( argv ) {
  15.127 -		argv[argc] = NULL;
  15.128 -	}
  15.129 -	return(argc);
  15.130 -}
  15.131 -
  15.132 -/* Show an error message */
  15.133 -static void ShowError(const char *title, const char *message)
  15.134 -{
  15.135 -/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */
  15.136 -#ifdef USE_MESSAGEBOX
  15.137 -	MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK);
  15.138 -#else
  15.139 -	fprintf(stderr, "%s: %s\n", title, message);
  15.140 -#endif
  15.141 -}
  15.142 -
  15.143 -/* Pop up an out of memory message, returns to Windows */
  15.144 -static BOOL OutOfMemory(void)
  15.145 -{
  15.146 -	ShowError("Fatal Error", "Out of memory - aborting");
  15.147 -	return FALSE;
  15.148 -}
  15.149 -
  15.150 -/* Remove the output files if there was no output written */
  15.151 -static void __cdecl cleanup_output(void)
  15.152 -{
  15.153 -#ifndef NO_STDIO_REDIRECT
  15.154 -	FILE *file;
  15.155 -	int empty;
  15.156 -#endif
  15.157 -
  15.158 -	/* Flush the output in case anything is queued */
  15.159 -	fclose(stdout);
  15.160 -	fclose(stderr);
  15.161 -
  15.162 -#ifndef NO_STDIO_REDIRECT
  15.163 -	/* See if the files have any output in them */
  15.164 -	if ( stdoutPath[0] ) {
  15.165 -		file = fopen(stdoutPath, TEXT("rb"));
  15.166 -		if ( file ) {
  15.167 -			empty = (fgetc(file) == EOF) ? 1 : 0;
  15.168 -			fclose(file);
  15.169 -			if ( empty ) {
  15.170 -				remove(stdoutPath);
  15.171 -			}
  15.172 -		}
  15.173 -	}
  15.174 -	if ( stderrPath[0] ) {
  15.175 -		file = fopen(stderrPath, TEXT("rb"));
  15.176 -		if ( file ) {
  15.177 -			empty = (fgetc(file) == EOF) ? 1 : 0;
  15.178 -			fclose(file);
  15.179 -			if ( empty ) {
  15.180 -				remove(stderrPath);
  15.181 -			}
  15.182 -		}
  15.183 -	}
  15.184 -#endif
  15.185 -}
  15.186 -
  15.187 -#if defined(_MSC_VER) && !defined(_WIN32_WCE)
  15.188 -/* The VC++ compiler needs main defined */
  15.189 -#define console_main main
  15.190 -#endif
  15.191 -
  15.192 -/* This is where execution begins [console apps] */
  15.193 -int console_main(int argc, char *argv[])
  15.194 -{
  15.195 -	int n;
  15.196 -	char *bufp, *appname;
  15.197 -
  15.198 -	/* Get the class name from argv[0] */
  15.199 -	appname = argv[0];
  15.200 -	if ( (bufp=strrchr(argv[0], '\\')) != NULL ) {
  15.201 -		appname = bufp+1;
  15.202 -	} else
  15.203 -	if ( (bufp=strrchr(argv[0], '/')) != NULL ) {
  15.204 -		appname = bufp+1;
  15.205 -	}
  15.206 -
  15.207 -	if ( (bufp=strrchr(appname, '.')) == NULL )
  15.208 -		n = strlen(appname);
  15.209 -	else
  15.210 -		n = (bufp-appname);
  15.211 -
  15.212 -	bufp = (char *)alloca(n+1);
  15.213 -	if ( bufp == NULL ) {
  15.214 -		return OutOfMemory();
  15.215 -	}
  15.216 -	strncpy(bufp, appname, n);
  15.217 -	bufp[n] = '\0';
  15.218 -	appname = bufp;
  15.219 -
  15.220 -	/* Load SDL dynamic link library */
  15.221 -	if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) {
  15.222 -		ShowError("WinMain() error", SDL_GetError());
  15.223 -		return(FALSE);
  15.224 -	}
  15.225 -	atexit(cleanup_output);
  15.226 -	atexit(SDL_Quit);
  15.227 -
  15.228 -#ifndef DISABLE_VIDEO
  15.229 -#if 0
  15.230 -	/* Create and register our class *
  15.231 -	   DJM: If we do this here, the user nevers gets a chance to
  15.232 -	   putenv(SDL_WINDOWID).  This is already called later by
  15.233 -	   the (DIB|DX5)_CreateWindow function, so it should be
  15.234 -	   safe to comment it out here.
  15.235 -	if ( SDL_RegisterApp(appname, CS_BYTEALIGNCLIENT, 
  15.236 -	                     GetModuleHandle(NULL)) < 0 ) {
  15.237 -		ShowError("WinMain() error", SDL_GetError());
  15.238 -		exit(1);
  15.239 -	}*/
  15.240 -#else
  15.241 -	/* Sam:
  15.242 -	   We still need to pass in the application handle so that
  15.243 -	   DirectInput will initialize properly when SDL_RegisterApp()
  15.244 -	   is called later in the video initialization.
  15.245 -	 */
  15.246 -	SDL_SetModuleHandle(GetModuleHandle(NULL));
  15.247 -#endif /* 0 */
  15.248 -#endif /* !DISABLE_VIDEO */
  15.249 -
  15.250 -	/* Run the application main() code */
  15.251 -	SDL_main(argc, argv);
  15.252 -
  15.253 -	/* Exit cleanly, calling atexit() functions */
  15.254 -	exit(0);
  15.255 -
  15.256 -	/* Hush little compiler, don't you cry... */
  15.257 -	return(0);
  15.258 -}
  15.259 -
  15.260 -/* This is where execution begins [windowed apps] */
  15.261 -#ifdef _WIN32_WCE
  15.262 -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw)
  15.263 -#else
  15.264 -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
  15.265 -#endif
  15.266 -{
  15.267 -	HINSTANCE handle;
  15.268 -	char **argv;
  15.269 -	int argc;
  15.270 -	char *cmdline;
  15.271 -#ifdef _WIN32_WCE
  15.272 -	wchar_t *bufp;
  15.273 -	int nLen;
  15.274 -#else
  15.275 -	char *bufp;
  15.276 -#endif
  15.277 -#ifndef NO_STDIO_REDIRECT
  15.278 -	FILE *newfp;
  15.279 -#endif
  15.280 -
  15.281 -	/* Start up DDHELP.EXE before opening any files, so DDHELP doesn't
  15.282 -	   keep them open.  This is a hack.. hopefully it will be fixed 
  15.283 -	   someday.  DDHELP.EXE starts up the first time DDRAW.DLL is loaded.
  15.284 -	 */
  15.285 -	handle = LoadLibrary(TEXT("DDRAW.DLL"));
  15.286 -	if ( handle != NULL ) {
  15.287 -		FreeLibrary(handle);
  15.288 -	}
  15.289 -
  15.290 -#ifndef NO_STDIO_REDIRECT
  15.291 -	_getcwd( stdoutPath, sizeof( stdoutPath ) );
  15.292 -	strcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE );
  15.293 -    
  15.294 -	/* Redirect standard input and standard output */
  15.295 -	newfp = freopen(stdoutPath, TEXT("w"), stdout);
  15.296 -
  15.297 -#ifndef _WIN32_WCE
  15.298 -	if ( newfp == NULL ) {	/* This happens on NT */
  15.299 -#if !defined(stdout)
  15.300 -		stdout = fopen(stdoutPath, TEXT("w"));
  15.301 -#else
  15.302 -		newfp = fopen(stdoutPath, TEXT("w"));
  15.303 -		if ( newfp ) {
  15.304 -			*stdout = *newfp;
  15.305 -		}
  15.306 -#endif
  15.307 -	}
  15.308 -#endif /* _WIN32_WCE */
  15.309 -
  15.310 -	_getcwd( stderrPath, sizeof( stderrPath ) );
  15.311 -	strcat( stderrPath, DIR_SEPERATOR STDERR_FILE );
  15.312 -
  15.313 -	newfp = freopen(stderrPath, TEXT("w"), stderr);
  15.314 -#ifndef _WIN32_WCE
  15.315 -	if ( newfp == NULL ) {	/* This happens on NT */
  15.316 -#if !defined(stderr)
  15.317 -		stderr = fopen(stderrPath, TEXT("w"));
  15.318 -#else
  15.319 -		newfp = fopen(stderrPath, TEXT("w"));
  15.320 -		if ( newfp ) {
  15.321 -			*stderr = *newfp;
  15.322 -		}
  15.323 -#endif
  15.324 -	}
  15.325 -#endif /* _WIN32_WCE */
  15.326 -
  15.327 -	setvbuf(stdout, NULL, _IOLBF, BUFSIZ);	/* Line buffered */
  15.328 -	setbuf(stderr, NULL);			/* No buffering */
  15.329 -#endif /* !NO_STDIO_REDIRECT */
  15.330 -
  15.331 -#ifdef _WIN32_WCE
  15.332 -	nLen = wcslen(szCmdLine)+128+1;
  15.333 -	bufp = (wchar_t *)alloca(nLen*2);
  15.334 -	wcscpy (bufp, TEXT("\""));
  15.335 -	GetModuleFileName(NULL, bufp+1, 128-3);
  15.336 -	wcscpy (bufp+wcslen(bufp), TEXT("\" "));
  15.337 -	wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp));
  15.338 -	nLen = wcslen(bufp)+1;
  15.339 -	cmdline = (char *)alloca(nLen);
  15.340 -	if ( cmdline == NULL ) {
  15.341 -		return OutOfMemory();
  15.342 -	}
  15.343 -	WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL);
  15.344 -#else
  15.345 -	/* Grab the command line (use alloca() on Windows) */
  15.346 -	bufp = GetCommandLine();
  15.347 -	cmdline = (char *)alloca(strlen(bufp)+1);
  15.348 -	if ( cmdline == NULL ) {
  15.349 -		return OutOfMemory();
  15.350 -	}
  15.351 -	strcpy(cmdline, bufp);
  15.352 -#endif
  15.353 -
  15.354 -	/* Parse it into argv and argc */
  15.355 -	argc = ParseCommandLine(cmdline, NULL);
  15.356 -	argv = (char **)alloca((argc+1)*(sizeof *argv));
  15.357 -	if ( argv == NULL ) {
  15.358 -		return OutOfMemory();
  15.359 -	}
  15.360 -	ParseCommandLine(cmdline, argv);
  15.361 -
  15.362 -	/* Run the main program (after a little SDL initialization) */
  15.363 -	return(console_main(argc, argv));
  15.364 -}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/src/main/win32/SDL_win32_main.c	Sun Dec 14 06:25:53 2003 +0000
    16.3 @@ -0,0 +1,361 @@
    16.4 +/*
    16.5 +    SDL_main.c, placed in the public domain by Sam Lantinga  4/13/98
    16.6 +
    16.7 +    The WinMain function -- calls your program's main() function
    16.8 +*/
    16.9 +
   16.10 +#include <stdio.h>
   16.11 +#include <string.h>
   16.12 +#include <ctype.h>
   16.13 +#include <stdlib.h>
   16.14 +
   16.15 +#include <windows.h>
   16.16 +#include <malloc.h>			/* For _alloca() */
   16.17 +
   16.18 +#ifdef _WIN32_WCE
   16.19 +# define DIR_SEPERATOR TEXT("\\")
   16.20 +# define _getcwd(str,len)	wcscpy(str,DIR_SEPERATOR);
   16.21 +# define setbuf(x)
   16.22 +# define setvbuf(x)
   16.23 +# define fopen		_wfopen
   16.24 +# define freopen	_wfreopen
   16.25 +# define remove(x)	DeleteFile(x)
   16.26 +# define strcat		wcscat
   16.27 +#else
   16.28 +# define DIR_SEPERATOR TEXT("/")
   16.29 +# include <direct.h>
   16.30 +#endif
   16.31 +
   16.32 +/* Include the SDL main definition header */
   16.33 +#include "SDL.h"
   16.34 +#include "SDL_main.h"
   16.35 +
   16.36 +#ifdef main
   16.37 +# ifndef _WIN32_WCE_EMULATION
   16.38 +#  undef main
   16.39 +# endif /* _WIN32_WCE_EMULATION */
   16.40 +#endif /* main */
   16.41 +
   16.42 +/* The standard output files */
   16.43 +#define STDOUT_FILE	TEXT("stdout.txt")
   16.44 +#define STDERR_FILE	TEXT("stderr.txt")
   16.45 +
   16.46 +#ifndef NO_STDIO_REDIRECT
   16.47 +# ifdef _WIN32_WCE
   16.48 +  static wchar_t stdoutPath[MAX_PATH];
   16.49 +  static wchar_t stderrPath[MAX_PATH];
   16.50 +# else
   16.51 +  static char stdoutPath[MAX_PATH];
   16.52 +  static char stderrPath[MAX_PATH];
   16.53 +# endif
   16.54 +#endif
   16.55 +
   16.56 +#if defined(_WIN32_WCE) && _WIN32_WCE < 300
   16.57 +/* seems to be undefined in Win CE although in online help */
   16.58 +#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
   16.59 +
   16.60 +/* seems to be undefined in Win CE although in online help */
   16.61 +char *strrchr(char *str, int c)
   16.62 +{
   16.63 +	char *p;
   16.64 +
   16.65 +	/* Skip to the end of the string */
   16.66 +	p=str;
   16.67 +	while (*p)
   16.68 +		p++;
   16.69 +
   16.70 +	/* Look for the given character */
   16.71 +	while ( (p >= str) && (*p != (CHAR)c) )
   16.72 +		p--;
   16.73 +
   16.74 +	/* Return NULL if character not found */
   16.75 +	if ( p < str ) {
   16.76 +		p = NULL;
   16.77 +	}
   16.78 +	return p;
   16.79 +}
   16.80 +#endif /* _WIN32_WCE < 300 */
   16.81 +
   16.82 +/* Parse a command line buffer into arguments */
   16.83 +static int ParseCommandLine(char *cmdline, char **argv)
   16.84 +{
   16.85 +	char *bufp;
   16.86 +	int argc;
   16.87 +
   16.88 +	argc = 0;
   16.89 +	for ( bufp = cmdline; *bufp; ) {
   16.90 +		/* Skip leading whitespace */
   16.91 +		while ( isspace(*bufp) ) {
   16.92 +			++bufp;
   16.93 +		}
   16.94 +		/* Skip over argument */
   16.95 +		if ( *bufp == '"' ) {
   16.96 +			++bufp;
   16.97 +			if ( *bufp ) {
   16.98 +				if ( argv ) {
   16.99 +					argv[argc] = bufp;
  16.100 +				}
  16.101 +				++argc;
  16.102 +			}
  16.103 +			/* Skip over word */
  16.104 +			while ( *bufp && (*bufp != '"') ) {
  16.105 +				++bufp;
  16.106 +			}
  16.107 +		} else {
  16.108 +			if ( *bufp ) {
  16.109 +				if ( argv ) {
  16.110 +					argv[argc] = bufp;
  16.111 +				}
  16.112 +				++argc;
  16.113 +			}
  16.114 +			/* Skip over word */
  16.115 +			while ( *bufp && ! isspace(*bufp) ) {
  16.116 +				++bufp;
  16.117 +			}
  16.118 +		}
  16.119 +		if ( *bufp ) {
  16.120 +			if ( argv ) {
  16.121 +				*bufp = '\0';
  16.122 +			}
  16.123 +			++bufp;
  16.124 +		}
  16.125 +	}
  16.126 +	if ( argv ) {
  16.127 +		argv[argc] = NULL;
  16.128 +	}
  16.129 +	return(argc);
  16.130 +}
  16.131 +
  16.132 +/* Show an error message */
  16.133 +static void ShowError(const char *title, const char *message)
  16.134 +{
  16.135 +/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */
  16.136 +#ifdef USE_MESSAGEBOX
  16.137 +	MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK);
  16.138 +#else
  16.139 +	fprintf(stderr, "%s: %s\n", title, message);
  16.140 +#endif
  16.141 +}
  16.142 +
  16.143 +/* Pop up an out of memory message, returns to Windows */
  16.144 +static BOOL OutOfMemory(void)
  16.145 +{
  16.146 +	ShowError("Fatal Error", "Out of memory - aborting");
  16.147 +	return FALSE;
  16.148 +}
  16.149 +
  16.150 +/* Remove the output files if there was no output written */
  16.151 +static void __cdecl cleanup_output(void)
  16.152 +{
  16.153 +#ifndef NO_STDIO_REDIRECT
  16.154 +	FILE *file;
  16.155 +	int empty;
  16.156 +#endif
  16.157 +
  16.158 +	/* Flush the output in case anything is queued */
  16.159 +	fclose(stdout);
  16.160 +	fclose(stderr);
  16.161 +
  16.162 +#ifndef NO_STDIO_REDIRECT
  16.163 +	/* See if the files have any output in them */
  16.164 +	if ( stdoutPath[0] ) {
  16.165 +		file = fopen(stdoutPath, TEXT("rb"));
  16.166 +		if ( file ) {
  16.167 +			empty = (fgetc(file) == EOF) ? 1 : 0;
  16.168 +			fclose(file);
  16.169 +			if ( empty ) {
  16.170 +				remove(stdoutPath);
  16.171 +			}
  16.172 +		}
  16.173 +	}
  16.174 +	if ( stderrPath[0] ) {
  16.175 +		file = fopen(stderrPath, TEXT("rb"));
  16.176 +		if ( file ) {
  16.177 +			empty = (fgetc(file) == EOF) ? 1 : 0;
  16.178 +			fclose(file);
  16.179 +			if ( empty ) {
  16.180 +				remove(stderrPath);
  16.181 +			}
  16.182 +		}
  16.183 +	}
  16.184 +#endif
  16.185 +}
  16.186 +
  16.187 +#if defined(_MSC_VER) && !defined(_WIN32_WCE)
  16.188 +/* The VC++ compiler needs main defined */
  16.189 +#define console_main main
  16.190 +#endif
  16.191 +
  16.192 +/* This is where execution begins [console apps] */
  16.193 +int console_main(int argc, char *argv[])
  16.194 +{
  16.195 +	int n;
  16.196 +	char *bufp, *appname;
  16.197 +
  16.198 +	/* Get the class name from argv[0] */
  16.199 +	appname = argv[0];
  16.200 +	if ( (bufp=strrchr(argv[0], '\\')) != NULL ) {
  16.201 +		appname = bufp+1;
  16.202 +	} else
  16.203 +	if ( (bufp=strrchr(argv[0], '/')) != NULL ) {
  16.204 +		appname = bufp+1;
  16.205 +	}
  16.206 +
  16.207 +	if ( (bufp=strrchr(appname, '.')) == NULL )
  16.208 +		n = strlen(appname);
  16.209 +	else
  16.210 +		n = (bufp-appname);
  16.211 +
  16.212 +	bufp = (char *)alloca(n+1);
  16.213 +	if ( bufp == NULL ) {
  16.214 +		return OutOfMemory();
  16.215 +	}
  16.216 +	strncpy(bufp, appname, n);
  16.217 +	bufp[n] = '\0';
  16.218 +	appname = bufp;
  16.219 +
  16.220 +	/* Load SDL dynamic link library */
  16.221 +	if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) {
  16.222 +		ShowError("WinMain() error", SDL_GetError());
  16.223 +		return(FALSE);
  16.224 +	}
  16.225 +	atexit(cleanup_output);
  16.226 +	atexit(SDL_Quit);
  16.227 +
  16.228 +#ifndef DISABLE_VIDEO
  16.229 +#if 0
  16.230 +	/* Create and register our class *
  16.231 +	   DJM: If we do this here, the user nevers gets a chance to
  16.232 +	   putenv(SDL_WINDOWID).  This is already called later by
  16.233 +	   the (DIB|DX5)_CreateWindow function, so it should be
  16.234 +	   safe to comment it out here.
  16.235 +	if ( SDL_RegisterApp(appname, CS_BYTEALIGNCLIENT, 
  16.236 +	                     GetModuleHandle(NULL)) < 0 ) {
  16.237 +		ShowError("WinMain() error", SDL_GetError());
  16.238 +		exit(1);
  16.239 +	}*/
  16.240 +#else
  16.241 +	/* Sam:
  16.242 +	   We still need to pass in the application handle so that
  16.243 +	   DirectInput will initialize properly when SDL_RegisterApp()
  16.244 +	   is called later in the video initialization.
  16.245 +	 */
  16.246 +	SDL_SetModuleHandle(GetModuleHandle(NULL));
  16.247 +#endif /* 0 */
  16.248 +#endif /* !DISABLE_VIDEO */
  16.249 +
  16.250 +	/* Run the application main() code */
  16.251 +	SDL_main(argc, argv);
  16.252 +
  16.253 +	/* Exit cleanly, calling atexit() functions */
  16.254 +	exit(0);
  16.255 +
  16.256 +	/* Hush little compiler, don't you cry... */
  16.257 +	return(0);
  16.258 +}
  16.259 +
  16.260 +/* This is where execution begins [windowed apps] */
  16.261 +#ifdef _WIN32_WCE
  16.262 +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw)
  16.263 +#else
  16.264 +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
  16.265 +#endif
  16.266 +{
  16.267 +	HINSTANCE handle;
  16.268 +	char **argv;
  16.269 +	int argc;
  16.270 +	char *cmdline;
  16.271 +#ifdef _WIN32_WCE
  16.272 +	wchar_t *bufp;
  16.273 +	int nLen;
  16.274 +#else
  16.275 +	char *bufp;
  16.276 +#endif
  16.277 +#ifndef NO_STDIO_REDIRECT
  16.278 +	FILE *newfp;
  16.279 +#endif
  16.280 +
  16.281 +	/* Start up DDHELP.EXE before opening any files, so DDHELP doesn't
  16.282 +	   keep them open.  This is a hack.. hopefully it will be fixed 
  16.283 +	   someday.  DDHELP.EXE starts up the first time DDRAW.DLL is loaded.
  16.284 +	 */
  16.285 +	handle = LoadLibrary(TEXT("DDRAW.DLL"));
  16.286 +	if ( handle != NULL ) {
  16.287 +		FreeLibrary(handle);
  16.288 +	}
  16.289 +
  16.290 +#ifndef NO_STDIO_REDIRECT
  16.291 +	_getcwd( stdoutPath, sizeof( stdoutPath ) );
  16.292 +	strcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE );
  16.293 +    
  16.294 +	/* Redirect standard input and standard output */
  16.295 +	newfp = freopen(stdoutPath, TEXT("w"), stdout);
  16.296 +
  16.297 +#ifndef _WIN32_WCE
  16.298 +	if ( newfp == NULL ) {	/* This happens on NT */
  16.299 +#if !defined(stdout)
  16.300 +		stdout = fopen(stdoutPath, TEXT("w"));
  16.301 +#else
  16.302 +		newfp = fopen(stdoutPath, TEXT("w"));
  16.303 +		if ( newfp ) {
  16.304 +			*stdout = *newfp;
  16.305 +		}
  16.306 +#endif
  16.307 +	}
  16.308 +#endif /* _WIN32_WCE */
  16.309 +
  16.310 +	_getcwd( stderrPath, sizeof( stderrPath ) );
  16.311 +	strcat( stderrPath, DIR_SEPERATOR STDERR_FILE );
  16.312 +
  16.313 +	newfp = freopen(stderrPath, TEXT("w"), stderr);
  16.314 +#ifndef _WIN32_WCE
  16.315 +	if ( newfp == NULL ) {	/* This happens on NT */
  16.316 +#if !defined(stderr)
  16.317 +		stderr = fopen(stderrPath, TEXT("w"));
  16.318 +#else
  16.319 +		newfp = fopen(stderrPath, TEXT("w"));
  16.320 +		if ( newfp ) {
  16.321 +			*stderr = *newfp;
  16.322 +		}
  16.323 +#endif
  16.324 +	}
  16.325 +#endif /* _WIN32_WCE */
  16.326 +
  16.327 +	setvbuf(stdout, NULL, _IOLBF, BUFSIZ);	/* Line buffered */
  16.328 +	setbuf(stderr, NULL);			/* No buffering */
  16.329 +#endif /* !NO_STDIO_REDIRECT */
  16.330 +
  16.331 +#ifdef _WIN32_WCE
  16.332 +	nLen = wcslen(szCmdLine)+128+1;
  16.333 +	bufp = (wchar_t *)alloca(nLen*2);
  16.334 +	wcscpy (bufp, TEXT("\""));
  16.335 +	GetModuleFileName(NULL, bufp+1, 128-3);
  16.336 +	wcscpy (bufp+wcslen(bufp), TEXT("\" "));
  16.337 +	wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp));
  16.338 +	nLen = wcslen(bufp)+1;
  16.339 +	cmdline = (char *)alloca(nLen);
  16.340 +	if ( cmdline == NULL ) {
  16.341 +		return OutOfMemory();
  16.342 +	}
  16.343 +	WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL);
  16.344 +#else
  16.345 +	/* Grab the command line (use alloca() on Windows) */
  16.346 +	bufp = GetCommandLine();
  16.347 +	cmdline = (char *)alloca(strlen(bufp)+1);
  16.348 +	if ( cmdline == NULL ) {
  16.349 +		return OutOfMemory();
  16.350 +	}
  16.351 +	strcpy(cmdline, bufp);
  16.352 +#endif
  16.353 +
  16.354 +	/* Parse it into argv and argc */
  16.355 +	argc = ParseCommandLine(cmdline, NULL);
  16.356 +	argv = (char **)alloca((argc+1)*(sizeof *argv));
  16.357 +	if ( argv == NULL ) {
  16.358 +		return OutOfMemory();
  16.359 +	}
  16.360 +	ParseCommandLine(cmdline, argv);
  16.361 +
  16.362 +	/* Run the main program (after a little SDL initialization) */
  16.363 +	return(console_main(argc, argv));
  16.364 +}
    17.1 --- a/src/thread/Makefile.am	Wed Dec 10 12:35:56 2003 +0000
    17.2 +++ b/src/thread/Makefile.am	Sun Dec 14 06:25:53 2003 +0000
    17.3 @@ -16,7 +16,7 @@
    17.4  
    17.5  # Older versions of Linux require an asm clone() implementation
    17.6  if USE_CLONE
    17.7 -THREAD_ASM_SRC = clone.S
    17.8 +THREAD_ASM_SRC = linux/clone.S
    17.9  else
   17.10  THREAD_ASM_SRC =
   17.11  endif
    18.1 --- a/src/timer/Makefile.am	Wed Dec 10 12:35:56 2003 +0000
    18.2 +++ b/src/timer/Makefile.am	Sun Dec 14 06:25:53 2003 +0000
    18.3 @@ -18,7 +18,7 @@
    18.4  
    18.5  # Include the architecture-specific sources
    18.6  if TARGET_MINT
    18.7 -ARCH_SRCS = SDL_systimer.c SDL_vbltimer.S SDL_vbltimer_s.h
    18.8 +ARCH_SRCS = SDL_systimer.c mint/SDL_vbltimer.S mint/SDL_vbltimer_s.h
    18.9  else
   18.10  ARCH_SRCS = SDL_systimer.c
   18.11  endif
    19.1 --- a/src/timer/mint/SDL_systimer.c	Wed Dec 10 12:35:56 2003 +0000
    19.2 +++ b/src/timer/mint/SDL_systimer.c	Sun Dec 14 06:25:53 2003 +0000
    19.3 @@ -47,7 +47,7 @@
    19.4  #include "SDL_timer_c.h"
    19.5  #include "SDL_thread.h"
    19.6  
    19.7 -#include "SDL_vbltimer_s.h"
    19.8 +#include "mint/SDL_vbltimer_s.h"
    19.9  
   19.10  /* The first ticks value of the application */
   19.11  static Uint32 start;
    20.1 --- a/test/.cvsignore	Wed Dec 10 12:35:56 2003 +0000
    20.2 +++ b/test/.cvsignore	Sun Dec 14 06:25:53 2003 +0000
    20.3 @@ -4,6 +4,7 @@
    20.4  config.cache
    20.5  config.log
    20.6  config.status
    20.7 +autom4te*
    20.8  aclocal.m4
    20.9  checkkeys
   20.10  graywin