[Scummvm-cvs-logs] SF.net SVN: scummvm:[39841] residual/trunk

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sat Apr 4 16:43:23 CEST 2009


Revision: 39841
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39841&view=rev
Author:   aquadran
Date:     2009-04-04 14:43:23 +0000 (Sat, 04 Apr 2009)

Log Message:
-----------
update to scummvm changes

Modified Paths:
--------------
    residual/trunk/Makefile
    residual/trunk/Makefile.common
    residual/trunk/configure
    residual/trunk/ports.mk

Modified: residual/trunk/Makefile
===================================================================
--- residual/trunk/Makefile	2009-04-04 14:10:53 UTC (rev 39840)
+++ residual/trunk/Makefile	2009-04-04 14:43:23 UTC (rev 39841)
@@ -24,8 +24,8 @@
 # Turn off some annoying and not-so-useful warnings
 CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder -Wno-unused-parameter
 # Enable even more warnings...
-#CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wcast-align
-#CXXFLAGS+= -Wimplicit -Wundef -Wnon-virtual-dtor -Wwrite-strings
+#CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wcast-align
+#CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor -Wwrite-strings
 
 # Disable RTTI and exceptions, and enabled checking of pointers returned by "new"
 #CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new
@@ -61,7 +61,7 @@
 config.h config.mk: $(srcdir)/configure
 ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
 	@echo "Running $(srcdir)/configure with the last specified parameters"
-	@sleep 2s
+	@sleep 2
 	LDFLAGS="$(SAVED_LDFLAGS)" CXX="$(SAVED_CXX)" CXXFLAGS="$(SAVED_CXXFLAGS)" CPPFLAGS="$(SAVED_CPPFLAGS)" \
 		$(srcdir)/configure $(SAVED_CONFIGFLAGS)
 else

Modified: residual/trunk/Makefile.common
===================================================================
--- residual/trunk/Makefile.common	2009-04-04 14:10:53 UTC (rev 39840)
+++ residual/trunk/Makefile.common	2009-04-04 14:43:23 UTC (rev 39841)
@@ -87,19 +87,45 @@
 
 
 ######################################################################
-# Create the files that depend on the version
+# Get the current version information
 ######################################################################
 
-VERSION_FILES = \
-	$(srcdir)/dists/macosx/Info.plist
-#$(srcdir)/dists/iphone/Info.plist
-
-VERSION = $(shell cat "${srcdir}/engine/internal_version.h" | cut -d\" -f2)
+# AmigaOS4's grep has a problem with "./" in pathnames, so use cat.
+VERSION = $(shell cat "${srcdir}/engine/internal_version.h" | grep RESIDUAL_VERSION | cut -d\" -f2)
 VER_MAJOR = $(shell echo $(VERSION) | cut -d. -f 1)
 VER_MINOR = $(shell echo $(VERSION) | cut -d. -f 2)
 VER_PATCH = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c1)
 VER_EXTRA = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c2-)
 
+######################################################################
+# Get Subversion's working copy information
+######################################################################
+
+ifeq ($(shell LANG=C svn stat $(srcdir) 2>&1 | grep "is not a working copy"),)
+SVNROOT := $(srcdir)
+ifeq ($(origin SVNREV), undefined)
+# Get the working copy base revision
+VER_SVNREV := $(shell LANG=C svn info $(SVNROOT) | grep "^Revision" | cut -d ' ' -f 2)
+endif
+else
+SVNROOT := https://residual.svn.sourceforge.net/svnroot/scummvm/residual/trunk/
+endif
+
+# Define the Subversion revision if available, either autodetected or
+# specified by the user
+ifneq ($(origin VER_SVNREV), undefined)
+CXXFLAGS+= -DRESIDUAL_SVN_REVISION=\"$(VER_SVNREV)\"
+endif
+
+
+######################################################################
+# Create the files that depend on the version
+######################################################################
+
+VERSION_FILES = \
+	$(srcdir)/dists/iphone/Info.plist \
+	$(srcdir)/dists/macosx/Info.plist
+
 $(VERSION_FILES): %: %.in
 	@echo "Creating $@"
 	@cat $< | sed \
@@ -116,8 +142,12 @@
 ######################################################################
 
 ifeq ($(VER_EXTRA),svn)
+ifeq ($(origin VER_SVNREV), undefined)
 DISTVERSION = $(shell date '+%Y-%m-%d')
 else
+DISTVERSION = svn$(VER_SVNREV)
+endif
+else
 DISTVERSION = $(VERSION)
 endif
 
@@ -135,14 +165,20 @@
 	@$(RM_REC) $(DISTDIR)
 	@$(MKDIR) $(DISTDIR)
 	svn export $(SVNROOT) $(DISTDIR)/$(DISTNAME)
+ifneq ($(origin VER_SVNREV), undefined)
+	@# Use the current SVN revision as a default for the snapshot sources
+	@svn cat $(SVNROOT)/engine/internal_version.h | sed -e \
+		"s/^#define RESIDUAL_SVN_REVISION$$/#define RESIDUAL_SVN_REVISION \"$(VER_SVNREV)\"/g" \
+		> $(VERFILE)
+endif
 
-$(DISTDIR)/$(DISTNAME).tar.gz: 
+$(DISTDIR)/$(DISTNAME).tar.gz: $(VERFILE)
 	cd $(DISTDIR); tar zcf $(DISTNAME).tar.gz $(DISTNAME)
 
-$(DISTDIR)/$(DISTNAME).tar.bz2: 
+$(DISTDIR)/$(DISTNAME).tar.bz2: $(VERFILE)
 	cd $(DISTDIR); tar jcf $(DISTNAME).tar.bz2 $(DISTNAME)
 
-$(DISTDIR)/$(DISTNAME).zip: 
+$(DISTDIR)/$(DISTNAME).zip: $(VERFILE)
 	cd $(DISTDIR); zip -qr9 $(DISTNAME).zip $(DISTNAME)
 
 dist-src: \

Modified: residual/trunk/configure
===================================================================
--- residual/trunk/configure	2009-04-04 14:10:53 UTC (rev 39840)
+++ residual/trunk/configure	2009-04-04 14:43:23 UTC (rev 39841)
@@ -30,7 +30,7 @@
 SAVED_CXXFLAGS=$CXXFLAGS
 SAVED_CPPFLAGS=$CPPFLAGS
 
-# use environment vars if set
+# Use environment vars if set
 CXXFLAGS="$CXXFLAGS $CPPFLAGS"
 
 # Backslashes into forward slashes:
@@ -54,27 +54,36 @@
 	unset ac_TEMP_PATH
 fi
 
-
-# default lib behaviour yes/no/auto
+#
+# Default settings
+#
+# Default lib behaviour yes/no/auto
 _vorbis=auto
 _tremor=auto
 _flac=auto
 _mad=auto
-
+# Default platform settings
+_backend=sdl
 _endian=unknown
 _need_memalign=no
 _have_x86=no
-
-# more defaults
-_backend=sdl
+# Default commands
 _ranlib=ranlib
+_strip=strip
 _ar="ar cru"
 _windres=windres
 _win32path="C:/residual"
 _aos4path="Games:Residual"
+_staticlibpath=/sw
 _sdlconfig=sdl-config
 _sdlpath="$PATH"
 _prefix=/usr/local
+# For cross compiling
+_host=""
+_host_cpu=""
+_host_vendor=""
+_host_os=""
+_host_alias=""
 
 _srcdir=`dirname $0`
 
@@ -82,31 +91,32 @@
 if type mktemp > /dev/null 2>&1 ; then
 	TMPO=`mktemp /tmp/scummvm-conf.XXXXXXXXXX`
 else
-	TMPO=residual-conf
+	TMPO=./residual-conf
 fi
 TMPC=${TMPO}.cpp
 TMPLOG=config.log
 
-# For cross compiling
-_host=""
-_host_cpu=""
-_host_vendor=""
-_host_os=""
-
 cc_check() {
 	echo >> "$TMPLOG"
 	cat "$TMPC" >> "$TMPLOG"
 	echo >> "$TMPLOG"
-	echo "$CXX $TMPC -o $TMPO$EXEEXT $@" >> "$TMPLOG"
-	rm -f "$TMPO$EXEEXT"
+	echo "$CXX $TMPC -o $TMPO$HOSTEXEEXT $@" >> "$TMPLOG"
+	rm -f "$TMPO$HOSTEXEEXT"
 	rm -rf "$TMPO.dSYM"
-	( $CXX $CXXFLAGS "$TMPC" -o "$TMPO$EXEEXT" "$@" ) >> "$TMPLOG" 2>&1
+	( $CXX $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
 	TMP="$?"
 	echo >> "$TMPLOG"
 	return "$TMP"
 }
 
-echocheck () {
+#
+# Function to provide echo -n for bourne shells that don't have it
+#
+echo_n() {
+	printf "$@"
+}
+
+echocheck() {
 	echo_n "Checking for $@... "
 }
 
@@ -155,37 +165,10 @@
 }
 
 #
-# Check whether the given command is a working C++ compiler
-#
-test_compiler ()
-{
-cat <<EOF >tmp_cxx_compiler.cpp
-class Foo {
-	int a;
-};
-int main(int argc, char **argv)
-{
-	Foo *a = new Foo();
-	delete a;
-	return 0;
-}
-EOF
-
-if test -n "$_host"; then
-	# In cross-compiling mode, we cannot run the result
-	eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && rm -rf tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp tmp_cxx_compiler.dSYM
-else
-	eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "./tmp_cxx_compiler$EXEEXT 2> /dev/null" && rm -rf tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp tmp_cxx_compiler.dSYM
-fi
-}
-
-#
 # Determine sdl-config
 #
 # TODO: small bit of code to test sdl useability
-find_sdlconfig()
-{
-
+find_sdlconfig() {
 	echo_n "Looking for sdl-config... "
 	sdlconfigs="$_sdlconfig:sdl-config:sdl11-config:sdl12-config"
 	_sdlconfig=
@@ -218,58 +201,38 @@
 }
 
 #
-# Function to provide echo -n for bourne shells that don't have it
+# Determine extension used for executables
 #
-echo_n()
-{
-	printf "$@"
+get_system_exe_extension() {
+	case $1 in
+	mingw* | os2-emx*)
+		_exeext=".exe"
+		;;
+	arm-riscos)
+		_exeext=",ff8"
+		;;
+	gp2x-linux)
+		_exeext=".gp2x"
+		;;
+	dreamcast | wii | gamecube | psp)
+		_exeext=".elf"
+		;;
+	*)
+		_exeext=""
+		;;
+	esac
 }
 
 #
-# Determine a data type with the given length
+# Generic options functions
 #
-find_type_with_size ()
-{
-for datatype in int short char long 'long long' unknown; do
-cat <<EOF >tmp_find_type_with_size.cpp
-typedef $datatype ac__type_sizeof_;
-int main() {
-	static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == $1)];
-	test_array [0] = 0;
-	return 0;
-}
-EOF
-if $CXX $CXXFLAGS -c -o tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp 2>/dev/null ; then
-	break
-else
-	if test "$datatype" = "unknown"; then
-		echo "couldn't find data type with $1 bytes"
-		exit 1
-	fi
-	continue
-fi
-done
-rm -f tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp
-echo $datatype
-}
 
-#
-# Determine a size of pointer type
-#
-find_pointer_size ()
-{
-cat <<EOF >tmp_find_pointer_size.cpp
-int main() {
-	void *p;
-	int v = (int)p;
-	return 0;
+# Show an error about an unknown option
+option_error() {
+	echo "error: unrecognised option: $ac_option
+Try \`$0 --help' for more information." >&2
+	exit 1
 }
-EOF
-$CXX $CXXFLAGS -c -o tmp_find_pointer_size$EXEEXT tmp_find_pointer_size.cpp 2>/dev/null
-status=$?
-rm -f tmp_find_pointer_size$EXEEXT tmp_find_pointer_size.cpp
-return $status
-}
 
 # Show the configure help line for an option
 option_help() {
@@ -281,7 +244,6 @@
 #
 # Greet user
 #
-
 echo "Running Residual configure..."
 echo "Configure run on" `date` > $TMPLOG
 
@@ -302,7 +264,7 @@
 
 Configuration:
   -h, --help             display this help and exit
-  --backend=BACKEND      backend to build (sdl, morphos, dc, gp2x, iphone, null) [sdl]
+  --backend=BACKEND      backend to build (sdl, morphos, dc, gp2x, iphone, wii, psp, null) [sdl]
 
 Installation directories:
   --prefix=DIR           use this prefix for installing Residual [/usr/local]
@@ -314,6 +276,11 @@
 Special configuration feature:
   --host=HOST            cross-compile to target HOST (arm-linux, ...)
                          special targets: linupy for Yopy PDA
+                                          dreamcast for Sega Dreamcast
+                                          wii for Nintendo Wii
+                                          gamecube for Nintendo Gamecube
+                                          iphone for Apple iPhone
+                                          psp for PlayStation Portable
 
 Optional Features:
   --disable-debug          disable building with debugging symbols
@@ -354,12 +321,6 @@
 
 DEBFLAGS="-g"
 
-option_error() {
-	echo "error: unrecognised option: $ac_option
-Try \`$0 --help' for more information." >&2
-	exit 1
-}
-
 for ac_option in $@; do
 	case "$ac_option" in
 	--enable-vorbis)          _vorbis=yes     ;;
@@ -423,6 +384,9 @@
 		arg=`echo $ac_option | cut -d '=' -f 2`
 		_sdlpath="$arg:$arg/bin"
 		;;
+	--with-staticlib-prefix=*)
+		_staticlibpath=`echo $ac_option | cut -d '=' -f 2`
+		;;
 	--host=*)
 		_host=`echo $ac_option | cut -d '=' -f 2`
 		;;
@@ -455,6 +419,10 @@
 
 CXXFLAGS="$CXXFLAGS $DEBFLAGS"
 
+guessed_host=`$_srcdir/config.guess`
+get_system_exe_extension $guessed_host
+NATIVEEXEEXT=$_exeext
+
 case $_host in
 linupy)
 	_host_os=linux
@@ -468,6 +436,11 @@
 	_host_os=amigaos
 	_host_cpu=ppc
 	;;
+gp2x)
+	_host_os=gp2x-linux
+	_host_cpu=arm
+	_host_alias=arm-open2x-linux
+	;;
 i586-mingw32msvc)
 	_host_os=mingw32msvc
 	_host_cpu=i586
@@ -475,36 +448,54 @@
 iphone)
 	_host_os=iphone
 	_host_cpu=arm
+	_host_alias=arm-apple-darwin9
 	;;
+neuros)
+	_host_os=linux
+	_host_cpu=arm
+	;;
+dreamcast)
+	_host_os=dreamcast
+	_host_cpu=sh
+	_host_alias=sh-elf
+	CXXFLAGS="$CXXFLAGS -ml -m4-single-only"
+	LDFLAGS="$LDFLAGS -ml -m4-single-only"
+	;;
+wii)
+	_host_os=wii
+	_host_cpu=ppc
+	_host_alias=powerpc-gekko
+	;;
+psp)
+	_host_os=psp
+	_host_cpu=mipsallegrexel
+	_host_alias=psp
+	LDFLAGS="$LDFLAGS -L$PSPDEV/psp/sdk/lib -specs=$_srcdir/engine/backend/platform/psp/psp.spec"
+	;;
+gamecube)
+	_host_os=gamecube
+	_host_cpu=ppc
+	_host_alias=powerpc-gekko
+	;;
 *)
-	if test -z "$_host"; then
-		guessed_host=`$_srcdir/config.guess`
-	else
+	if test -n "$_host"; then
 		guessed_host=`$_srcdir/config.sub $_host`
 	fi
 	_host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+	_host_vendor=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 	_host_os=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-	_host_vendor=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 	;;
 esac
 
+if test -z "$_host_alias"; then
+	_host_alias="$_host_cpu-$_host_os"
+fi
+
 #
 # Determine extension used for executables
 #
-case $_host_os in
-mingw* | cygwin* | os2-emx*)
-	EXEEXT=".exe"
-	;;
-arm-riscos)
-	EXEEXT=",ff8"
-	;;
-gp2x-linux)
-	EXEEXT=".gp2x"
-	;;
-*)
-	EXEEXT=""
-	;;
-esac
+get_system_exe_extension $_host_os 
+HOSTEXEEXT=$_exeext
 
 #
 # Determine separator used for $PATH
@@ -519,23 +510,69 @@
 esac
 
 #
+# Platform specific sanity checks
+#
+case $_host_os in
+wii | gamecube)
+	if test -z "$DEVKITPRO"; then
+		echo "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to devkitPRO>"
+		exit 1
+	fi
+	;;
+psp)
+	if test -z "$PSPDEV"; then
+		echo "Please set PSPDEV in your environment. export PSPDEV=<path to psp toolchain>"
+		exit 1
+	fi
+	;;
+*)
+	;;
+esac
+
+#
 # Determine the C++ compiler
 #
 echo_n "Looking for C++ compiler... "
-if test -n "$_host"; then
-	compilers="$CXX $_host_cpu-$_host_os-g++ $_host_cpu-$_host_os-c++ $_host-g++ $_host-c++"
+
+# Check whether the given command is a working C++ compiler
+test_compiler() {
+	cat <<EOF >tmp_cxx_compiler.cpp
+	class Foo { int a; };
+	int main(int argc, char **argv) {
+		Foo *a = new Foo(); delete a; return 0;
+	}
+EOF
+
+	if test -n "$_host"; then
+		# In cross-compiling mode, we cannot run the result
+		eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$HOSTEXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && rm -f tmp_cxx_compiler$HOSTEXEEXT tmp_cxx_compiler.cpp
+	else
+		eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$HOSTEXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "./tmp_cxx_compiler$HOSTEXEEXT 2> /dev/null" && rm -f tmp_cxx_compiler$HOSTEXEEXT tmp_cxx_compiler.cpp
+	fi
+}
+
+# Prepare a list of candidates for the C++ compiler
+if test -n "$CXX" && test_compiler "$CXX"; then
+	# Use the compiler specified in CXX
+	echo $CXX
 else
-	compilers="$CXX g++ c++"
+	if test -n "$_host"; then
+		compilers="$_host_alias-g++ $_host_alias-c++ $_host-g++ $_host-c++"
+	else
+		compilers="g++ c++"
+	fi
+
+	# Iterate over all candidates, pick the first working one
+	CXX=
+	for compiler in $compilers; do
+		if test_compiler $compiler; then
+			CXX=$compiler
+			echo $CXX
+			break
+		fi
+	done
 fi
 
-CXX=
-for compiler in $compilers; do
-	if test_compiler $compiler; then
-	CXX=$compiler
-	echo $CXX
-	break
-	fi
-done
 if test -z "$CXX"; then
 	echo "none found!"
 	exit 1
@@ -543,22 +580,9 @@
 
 #
 # Determine the compiler version
-
+#
 echocheck "compiler version"
 
-case $_host_os in
-	# On Solaris, use Unix-compliant tail
-	solaris*)
-		tail=/usr/xpg4/bin/tail
-		;;
-
-	# All other OSes: use the tail in PATH
-	*)
-		tail=tail
-		;;
-esac
-
-
 cxx_version=`( $CXX -dumpversion ) 2>&1`
 if test "$?" -gt 0; then
 	cxx_version="not found"
@@ -601,28 +625,6 @@
 fi
 
 #
-# Do CXXFLAGS now we know the compiler version
-#
-
-if test "$_cxx_major" -ge "3" ; then
-	case $_host_os in
-	mingw* | cygwin*)
-		CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter"
-		;;
-	*)
-		CXXFLAGS="$CXXFLAGS -ansi -W -Wno-unused-parameter"
-		;;
-	esac
-	add_line_to_config_mk 'HAVE_GCC3 = 1'
-fi;
-
-if test "$_cxx_major" -ge "4" && test "$_cxx_minor" -ge "3" ; then
-	CXXFLAGS="$CXXFLAGS -Wno-parentheses -Wno-empty-body"
-else
-	CXXFLAGS="$CXXFLAGS -Wconversion"
-fi;
-
-#
 # Check for endianness
 #
 echo_n "Checking endianness... "
@@ -645,13 +647,51 @@
 rm -f tmp_endianness_check.o tmp_endianness_check.cpp
 
 #
+# Determine a data type with the given length
+#
+find_type_with_size() {
+	for datatype in int short char long 'long long' unknown; do
+	cat <<EOF >tmp_find_type_with_size.cpp
+typedef $datatype ac__type_sizeof_;
+int main() {
+	static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == $1)];
+	test_array [0] = 0;
+	return 0;
+}
+EOF
+if $CXX $CXXFLAGS -c -o tmp_find_type_with_size$HOSTEXEEXT tmp_find_type_with_size.cpp 2>/dev/null ; then
+	break
+else
+	if test "$datatype" = "unknown"; then
+		echo "couldn't find data type with $1 bytes"
+		exit 1
+	fi
+	continue
+fi
+done
+rm -f tmp_find_type_with_size$HOSTEXEEXT tmp_find_type_with_size.cpp
+echo $datatype
+}
+
+#
+# Determine a size of pointer type
+#
+find_pointer_size() {
+	cat <<EOF >tmp_find_pointer_size.cpp
+int main() {
+	void *p;
+	int v = (int)p;
+	return 0;
+}
+EOF
+	$CXX $CXXFLAGS -c -o tmp_find_pointer_size$HOSTEXEEXT tmp_find_pointer_size.cpp 2>/dev/null
+	status=$?
+	rm -f tmp_find_pointer_size$HOSTEXEEXT tmp_find_pointer_size.cpp
+	return $status
+}
+
+#
 # Determine data type sizes
-# TODO: proper error checking
-# TODO: Actually, we should check individually for both signed & unsigned
-# data types - there are systems on which the size of an unsigned int
-# differs from that of a signed int!
-# However, so far we haven't encountered one of those, so we can live with
-# the limited check for now.
 #
 echo_n "Type with 1 byte... "
 type_1_byte=`find_type_with_size 1`
@@ -693,7 +733,7 @@
 #
 # Check whether we can use x86 asm routines
 #
-echo_n "Running on x86... "
+echo_n "Compiling for x86... "
 case $_host_cpu in
 	i386|i486|i586|i686|x86_64)
 		_have_x86=yes
@@ -749,11 +789,6 @@
 		LIBS="$LIBS -lmingw32 -lopengl32 -lglu32"
 		OBJS="$OBJS residualico.o"
 		;;
-	cygwin*)
-		DEFINES="$DEFINES -mno-cygwin -DWIN32 -D__USE_MINGW_ANSI_STDIO=0"
-		LIBS="$LIBS -mno-cygwin -lmingw32 -lopengl32 -lglu32"
-		OBJS="$OBJS residualico.o"
-		;;
 	os2-emx*)
 		DEFINES="$DEFINES -DUNIX"
 		;;
@@ -762,8 +797,31 @@
 		;;
 	amigaos*)
 		DEFINES="$DEFINES -DMINIGL"
+		CXXFLAGS="$CXXFLAGS -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400"
+		LDFLAGS="$LDFLAGS -mcrt=newlib -use-dynld -Lsobjs:"
 		LIBS="$LIBS -lGL -lGLU"
+		type_1_byte='char'
+		type_2_byte='short'
+		type_4_byte='long'
 		;;
+	dreamcast)
+		DEFINES="$DEFINES -D__DC__ -DNONSTANDARD_PORT"
+		;;
+	wii)
+		CXXFLAGS="$CXXFLAGS -Os -mrvl -mcpu=750 -meabi -mhard-float"
+		CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fmodulo-sched"
+		CXXFLAGS="$CXXFLAGS -I$DEVKITPRO/libogc/include"
+		LDFLAGS="$LDFLAGS -mrvl -mcpu=750 -L$DEVKITPRO/libogc/lib/wii"
+		;;
+	gamecube)
+		CXXFLAGS="$CXXFLAGS -Os -mogc -mcpu=750 -meabi -mhard-float"
+		CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fmodulo-sched"
+		CXXFLAGS="$CXXFLAGS -I$DEVKITPRO/libogc/include"
+		LDFLAGS="$LDFLAGS -mogc -mcpu=750 -L$DEVKITPRO/libogc/lib/cube"
+		;;
+	psp)
+		CXXFLAGS="$CXXFLAGS -O2 -G0 -I$PSPDEV/psp/sdk/include -D_PSP_FW_VERSION=150"
+		;;
 	# given this is a shell script assume some type of unix
 	*)
 		echo "WARNING: could not establish system type, assuming unix like"
@@ -798,17 +856,36 @@
 		bfin*)
 			_need_memalign=yes
 			;;
+		*darwin*)
+			_ranlib=$_host-ranlib
+			_strip=$_host-strip
+			;;
 		gp2x)
 			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
 			DEFINES="$DEFINES -DUNIX -DGP2X -DUSE_ARM_SOUND_ASM"
+			CXXFLAGS="$CXXFLAGS -march=armv4t"
+			LDFLAGS="$LDFLAGS -static"
 			_endian=little
 			_need_memalign=yes
 			type_1_byte='char'
 			type_2_byte='short'
 			type_4_byte='int'
+			_ar="$_host_alias-ar cru"
+			_ranlib=$_host_alias-ranlib
 			add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
 			_backend="gp2x"
 			;;
+		neuros)
+			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+			DEFINES="$DEFINES -DUNIX"
+			_endian=little
+			_need_memalign=yes
+			add_line_to_config_h "#define NEUROS"
+			type_1_byte='char'
+			type_2_byte='short'
+			type_4_byte='int'
+			_backend='null'
+			;;
 		ppc-amigaos)
 			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
 			_endian=big
@@ -816,8 +893,6 @@
 			type_1_byte='char'
 			type_2_byte='short'
 			type_4_byte='long'
-			CXXFLAGS="$CFLAGS -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400"
-			LDFLAGS="$LDFLAGS -mcrt=newlib"
 			;;
 		m68k-atari-mint)
 			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
@@ -833,7 +908,6 @@
 		*mingw32*)
 			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
 			_endian=little
-			_have_x86=yes
 			type_1_byte='char'
 			type_2_byte='short'
 			type_4_byte='int'
@@ -841,6 +915,7 @@
 			_windres=$_host-windres
 			_ar="$_host-ar cru"
 			_ranlib=$_host-ranlib
+			_strip=$_host-strip
 			;;
 		iphone)
 			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
@@ -852,7 +927,68 @@
 			type_4_byte='int'
 			add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
 			_backend="iphone"
+			_ar="$_host_alias-ar cru"
+			_ranlib=$_host_alias-ranlib
+			_strip=$_host_alias-strip
 			;;
+		dreamcast)
+			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+			DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE"
+			CXXFLAGS="$CXXFLAGS -O3 -Wno-multichar -funroll-loops -fschedule-insns2 -fomit-frame-pointer -fdelete-null-pointer-checks -fno-exceptions"
+			_endian=little
+			_need_memalign=yes
+			type_1_byte='char'
+			type_2_byte='short'
+			type_4_byte='int'
+			_backend="dc"
+			_build_scalers="no"
+			_ar="$_host_alias-ar cru"
+			_ranlib=$_host_alias-ranlib
+			add_line_to_config_mk 'include $(srcdir)/backends/platform/dc/dreamcast.mk'
+			;;
+		wii)
+			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+			_endian=big
+			_need_memalign=yes
+			type_1_byte='char'
+			type_2_byte='short'
+			type_4_byte='int'
+			_ar="$_host_alias-ar cru"
+			_ranlib=$_host_alias-ranlib
+			_backend="wii"
+			add_line_to_config_mk 'include $(srcdir)/backends/platform/wii/wii.mk'
+			add_line_to_config_h "#define DEBUG_WII_USBGECKO"
+			add_line_to_config_h "/* #define DEBUG_WII_MEMSTATS */"
+			add_line_to_config_h "/* #define DEBUG_WII_GDB */"
+			add_line_to_config_h "#define USE_WII_DI"
+			add_line_to_config_h "#define USE_WII_KBD"
+			;;
+		gamecube)
+			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+			_endian=big
+			_need_memalign=yes
+			type_1_byte='char'
+			type_2_byte='short'
+			type_4_byte='int'
+			_ar="$_host_alias-ar cru"
+			_ranlib=$_host_alias-ranlib
+			_backend="wii"
+			add_line_to_config_mk 'include $(srcdir)/backends/platform/wii/wii.mk'
+			add_line_to_config_h "/* #define DEBUG_WII_USBGECKO */"
+			add_line_to_config_h "/* #define DEBUG_WII_MEMSTATS */"
+			add_line_to_config_h "/* #define DEBUG_WII_GDB */"
+			;;
+		psp)
+			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
+			_endian=little
+			_need_memalign=yes
+			type_1_byte='char'
+			type_2_byte='short'
+			type_4_byte='int'
+			_ar="$_host_alias-ar cru"
+			_ranlib=$_host_alias-ranlib
+			_backend="psp"
+			;;
 		*)
 			echo "Continuing with auto-detected values ... if you have problems, please add your target to configure."
 			;;
@@ -888,8 +1024,7 @@
 			cat > $TMPC << EOF
 #include <stdlib.h>
 #include <signal.h>
-int main(int argc, char **argv)
-{
+int main(int argc, char **argv) {
 	unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 };
 	signal(SIGBUS, exit);
 	signal(SIGABRT, exit);
@@ -901,7 +1036,7 @@
 }
 EOF
 			_need_memalign=yes
-			cc_check && $TMPO$EXEEXT && _need_memalign=no
+			cc_check && $TMPO$HOSTEXEEXT && _need_memalign=no
 			;;
 	esac
 	echo "$_need_memalign"
@@ -934,7 +1069,7 @@
 cat > $TMPC << EOF
 int main(void) { return 0; }
 EOF
-cc_check $LDFLAGS $CXXFLAGS && LDFLAGS="$LDFLAGS"
+cc_check $LDFLAGS $CXXFLAGS -lm && LDFLAGS="$LDFLAGS -lm"
 
 #
 # Check for Ogg Vorbis
@@ -967,7 +1102,7 @@
 	_tremor=no
 	cat > $TMPC << EOF
 #include <tremor/ivorbiscodec.h>
-int main(void) { vorbis_packet_blocksize(0,0); return 0; }
+int main(void) { vorbis_info_init(0); return 0; }
 EOF
 	cc_check $LDFLAGS $CXXFLAGS $TREMOR_CFLAGS $TREMOR_LIBS -lvorbisidec && \
 	_tremor=yes
@@ -996,8 +1131,13 @@
 #include <FLAC/format.h>
 int main(void) { return FLAC__STREAM_SYNC_LEN >> 30; /* guaranteed to be 0 */ }
 EOF
-	cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \
-		-lFLAC -logg && _flac=yes
+	if test "$_vorbis" = yes ; then
+		cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \
+			-lFLAC -logg && _flac=yes
+	else
+		cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS \
+			-lFLAC && _flac=yes
+	fi
 fi
 if test "$_flac" = yes ; then
 	_def_flac='#define USE_FLAC'
@@ -1021,7 +1161,7 @@
 	_mad=no
 	cat > $TMPC << EOF
 #include <mad.h>
-int main(void) {return 0; }
+int main(void) { return 0; }
 EOF
 	cc_check $LDFLAGS $CXXFLAGS $MAD_CFLAGS $MAD_LIBS -lmad && _mad=yes
 fi
@@ -1065,7 +1205,7 @@
 rm -rf $TMPC $TMPO$EXEEXT $TMPO.dSYM
 
 #
-# figure out installation directories
+# Figure out installation directories
 #
 test -z "$_bindir" && _bindir="$_prefix/bin"
 test -z "$_mandir" && _mandir="$_prefix/share/man"
@@ -1084,7 +1224,6 @@
 		INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`"
 		LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
 		DEFINES="$DEFINES -DSDL_BACKEND"
-		MODULES="$MODULES engine/backend/platform/sdl"
 		;;
 	gp2x)
 		find_sdlconfig
@@ -1092,20 +1231,72 @@
 		LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
 		LDFLAGS="$LDFLAGS -static"
 		CXXFLAGS="$CXXFLAGS -march=armv4t"
-		MODULES="$MODULES backend/gp2x"
 		;;
 	iphone)
 		OBJCFLAGS="$OBJCFLAGS --std=c99"
-		LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework CoreSurface -framework LayerKit -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio"
-		DEFINES="$DEFINES -DIPHONE_BACKEND"
-		MODULES="$MODULES backend/iphone"
+		LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework CoreSurface -framework QuartzCore -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio"
 		;;
+	dc)
+		INCLUDES="$INCLUDES "'-I$(srcdir)/engine/backend/platform/dc -isystem $(ronindir)/include'
+		LDFLAGS="$LDFLAGS -Wl,-Ttext,0x8c010000 -nostartfiles "'$(ronindir)/lib/crt0.o -L$(ronindir)/lib'
+		LIBS="$LIBS -lronin -lm"
+		;;
+	wii)
+		DEFINES="$DEFINES -D__WII__ -DGEKKO"
+		case $_host_os in
+		gamecube)
+			DEFINES="$DEFINES -DGAMECUBE"
+			LIBS="$LIBS -lfat -logc -ldb"
+			;;
+		*)
+			LIBS="$LIBS -ldi -lfat -lwiiuse -lbte -logc -lwiikeyboard -ldb"
+			;;
+		esac
+		;;
+	psp)
+		DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE"
+		INCLUDES="$INCLUDES -I$PSPDEV/psp/include/SDL"
+		LIBS="$LIBS -lSDL"
+		;;
 	*)
 		echo "support for $_backend backend not implemented in configure script yet"
 		exit 1
 		;;
 esac
+MODULES="$MODULES backends/platform/$_backend"
 
+#
+# Do CXXFLAGS now we know the compiler version
+#
+if test "$_cxx_major" -ge "3" ; then
+	case $_host_os in
+	# newlib-based system include files suppress non-C89 function 
+	# declarations under __STRICT_ANSI__
+	mingw* | dreamcast | wii | gamecube | psp | amigaos*)
+		CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter"
+		;;
+	*)
+		CXXFLAGS="$CXXFLAGS -ansi -W -Wno-unused-parameter"
+		;;
+	esac
+	add_line_to_config_mk 'HAVE_GCC3 = 1'
+fi;
+
+if test "$_cxx_major" -ge "4" && test "$_cxx_minor" -ge "3" ; then
+	CXXFLAGS="$CXXFLAGS -Wno-empty-body"
+else
+	CXXFLAGS="$CXXFLAGS -Wconversion"
+fi;
+
+# Some platforms use certain GNU extensions in header files
+case $_host_os in
+wii | gamecube | psp)
+	;;
+*)
+	CXXFLAGS="$CXXFLAGS -pedantic"
+	;;
+esac
+
 echo
 echo "Creating config.h"
 cat > config.h << EOF
@@ -1147,15 +1338,17 @@
 CXXFLAGS := $CXXFLAGS
 LIBS += $LIBS
 RANLIB := $_ranlib
+STRIP := $_strip
 AR := $_ar
 WINDRES := $_windres
 WIN32PATH=$_win32path
 AOS4PATH=$_aos4path
+STATICLIBPATH=$_staticlibpath
 
 BACKEND := $_backend
 MODULES += $MODULES
 MODULE_DIRS += $MODULE_DIRS
-EXEEXT := $EXEEXT
+EXEEXT := $HOSTEXEEXT
 
 PREFIX := $_prefix
 BINDIR := $_bindir
@@ -1195,6 +1388,7 @@
 vpath %.m \$(srcdir)
 vpath %.asm \$(srcdir)
 vpath %.s \$(srcdir)
+vpath %.S \$(srcdir)
 include \$(srcdir)/Makefile
 EOF
 

Modified: residual/trunk/ports.mk
===================================================================
--- residual/trunk/ports.mk	2009-04-04 14:10:53 UTC (rev 39840)
+++ residual/trunk/ports.mk	2009-04-04 14:43:23 UTC (rev 39841)
@@ -10,7 +10,7 @@
 #
 install: all
 	$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
-	$(INSTALL) -c -s -m 755 "$(srcdir)/residual$(EXEEXT)" "$(DESTDIR)$(BINDIR)/residual$(EXEEXT)"
+	$(INSTALL) -c -s -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(BINDIR)/$(EXECUTABLE)"
 	#$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man6/"
 	#$(INSTALL) -c -m 644 "$(srcdir)/dists/residual.6" "$(DESTDIR)$(MANDIR)/man6/residual.6"
 	$(INSTALL) -d "$(DESTDIR)$(PREFIX)/share/pixmaps/"
@@ -19,7 +19,7 @@
 	$(INSTALL) -c -m 644 "$(srcdir)/AUTHORS" "$(srcdir)/COPYING.LGPL" "$(srcdir)/COPYING.GPL" "$(srcdir)/NEWS" "$(srcdir)/README" "$(srcdir)/TODO" "$(DESTDIR)$(PREFIX)/share/doc/residual/"
 
 uninstall:
-	rm -f "$(DESTDIR)$(BINDIR)/residual$(EXEEXT)"
+	rm -f "$(DESTDIR)$(BINDIR)/$(EXECUTABLE)"
 	#rm -f "$(DESTDIR)$(MANDIR)/man6/residual.6"
 	rm -f "$(DESTDIR)$(PREFIX)/share/pixmaps/residual.xpm"
 	rm -rf "$(DESTDIR)$(PREFIX)/share/doc/residual/"
@@ -56,36 +56,38 @@
 OSXOPT=/sw
 
 # Location of static libs for the iPhone
-ifeq ($(BACKEND), iphone)
-OSXOPT=/usr/local/arm-apple-darwin
-else
-# Static libaries, used for the residual-static and iphone targets
-OSX_STATIC_LIBS := `$(OSXOPT)/bin/sdl-config --static-libs`
+ifneq ($(BACKEND), iphone)
+# Static libaries, used for the scummvm-static and iphone targets
+OSX_STATIC_LIBS := `$(STATICLIBPATH)/bin/sdl-config --static-libs`
 endif
 
 ifdef USE_VORBIS
 OSX_STATIC_LIBS += \
-		$(OSXOPT)/lib/libvorbisfile.a \
-		$(OSXOPT)/lib/libvorbis.a \
-		$(OSXOPT)/lib/libogg.a
+		$(STATICLIBPATH)/lib/libvorbisfile.a \
+		$(STATICLIBPATH)/lib/libvorbis.a \
+		$(STATICLIBPATH)/lib/libogg.a
 endif
 
 ifdef USE_TREMOR
-OSX_STATIC_LIBS += $(OSXOPT)/lib/libvorbisidec.a
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libvorbisidec.a
 endif
 
 ifdef USE_FLAC
-OSX_STATIC_LIBS += $(OSXOPT)/lib/libFLAC.a
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libFLAC.a
 endif
 
 ifdef USE_MAD
-OSX_STATIC_LIBS += $(OSXOPT)/lib/libmad.a
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmad.a
 endif
 
 ifdef USE_MPEG2
-OSX_STATIC_LIBS += $(OSXOPT)/lib/libmpeg2.a
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmpeg2.a
 endif
 
+ifdef USE_ZLIB
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libz.a
+endif
+
 BUILD_DATE := `date +%y%m%d`
 #BUILD_DATE := rev`svn info | grep '^Revision' | sed -e 's/Revision: *//'`
 
@@ -97,15 +99,13 @@
 		-framework CoreMIDI \
 		$(OSX_STATIC_LIBS) \
 		-lSystemStubs \
-		-lz
-#		$(OSXOPT)/lib/libz.a
 
 # Special target to create a static linked binary for the iPhone
 iphone: $(OBJS)
 	$(CXX) $(LDFLAGS) -o residual $(OBJS) \
 		$(OSX_STATIC_LIBS) \
 		-framework UIKit -framework CoreGraphics -framework CoreSurface \
-		-framework LayerKit -framework GraphicsServices -framework CoreFoundation \
+		-framework GraphicsServices -framework CoreFoundation -framework QuartzCore \
 		-framework Foundation -framework AudioToolbox -framework CoreAudio \
 		-lobjc -lz
 
@@ -139,9 +139,9 @@
 	$(WINDRES) -I$(srcdir) $(srcdir)/dists/residual.rc residualico.o
 
 # Special target to create a win32 snapshot binary under Windows
-win32dist: residual$(EXEEXT)
+win32dist: $(EXECUTABLE)
 	mkdir -p $(WIN32PATH)
-	strip residual.exe -o $(WIN32PATH)/residual$(EXEEXT)
+	$(STRIP) $(EXECUTABLE) -o $(WIN32PATH)/$(EXECUTABLE)
 	cp $(srcdir)/AUTHORS $(WIN32PATH)/AUTHORS.txt
 	cp $(srcdir)/COPYING.LGPL $(WIN32PATH)/COPYING_LGPL.txt
 	cp $(srcdir)/COPYING.GPL $(WIN32PATH)/COPYING_GPL.txt
@@ -153,9 +153,9 @@
 	u2d $(WIN32PATH)/*.txt
 
 # Special target to create a win32 snapshot binary under Debian Linux using cross mingw32 toolchain
-crosswin32dist: residual$(EXEEXT)
+crosswin32dist: $(EXECUTABLE)
 	mkdir -p ResidualWin32
-	i586-mingw32msvc-strip residual.exe -o ResidualWin32/residual$(EXEEXT)
+	$(STRIP) $(EXECUTABLE) -o ResidualWin32/$(EXECUTABLE)
 	cp $(srcdir)/AUTHORS ResidualWin32/AUTHORS.txt
 	cp $(srcdir)/COPYING.LGPL ResidualWin32/COPYING_LGPL.txt
 	cp $(srcdir)/COPYING.GPL ResidualWin32/COPYING_GPL.txt
@@ -175,10 +175,10 @@
 #
 
 # Special target to create an AmigaOS snapshot installation
-aos4dist: residual
+aos4dist: $(EXECUTABLE)
 	mkdir -p $(AOS4PATH)
-	strip -R.comment $< -o $(AOS4PATH)/$<_SVN
-	cp icons/residual.info $(AOS4PATH)/$<_SVN.info
+	$(STRIP) $(EXECUTABLE) -o $(AOS4PATH)/$(EXECUTABLE)_SVN
+	cp icons/residual.info $(AOS4PATH)/$$(EXECUTABLE)_SVN.info
 	cp $(DIST_FILES_THEMES) $(AOS4PATH)/themes/
 	cp $(DIST_FILES_ENGINEDATA) $(AOS4PATH)/extras/
 	cp $(srcdir)/AUTHORS $(AOS4PATH)/AUTHORS.txt


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list