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

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Tue Mar 14 04:19:01 CET 2006


Revision: 21280
Author:   vinterstum
Date:     2006-03-14 04:18:04 -0800 (Tue, 14 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21280&view=rev

Log Message:
-----------
Adds support for building on Intel Macs, using a modified
version of patch 1448395 by Aubin and some of my 
own changes.

Notably:
* Two elements of a struct in backends/midi/quicktime.cpp
needed to be forced to BE.
* NASM set to build Mach-O binaries
* configure now checks for Altivec support on Darwin hosts,
instead of assuming it. Altivec support can also be disabled (not 100% sure if t
his is actually needed, but might be handy for crosscompiling).
* The aliasing of the symbols contained in the .asm files
done on Windows were also needed on MacOS.

Note that while the asm code is properly compiled and linked
in, HQ2/3x support will still not work properly on Intel macs
if NASM is enabled.

Modified Paths:
--------------
    scummvm/trunk/backends/midi/quicktime.cpp
    scummvm/trunk/configure
    scummvm/trunk/graphics/scaler/hq2x.cpp
    scummvm/trunk/graphics/scaler/hq3x.cpp
    scummvm/trunk/graphics/scaler.cpp
Modified: scummvm/trunk/backends/midi/quicktime.cpp
===================================================================
--- scummvm/trunk/backends/midi/quicktime.cpp	2006-03-14 12:13:27 UTC (rev 21279)
+++ scummvm/trunk/backends/midi/quicktime.cpp	2006-03-14 12:18:04 UTC (rev 21280)
@@ -84,8 +84,8 @@
 		goto bail;
 
 	simpleNoteRequest.info.flags = 0;
-	simpleNoteRequest.info.polyphony = 11;	// simultaneous tones
-	simpleNoteRequest.info.typicalPolyphony = 0x00010000;
+	WRITE_BE_UINT16(& simpleNoteRequest.info.polyphony, 11);        // simultaneous tones
+	WRITE_BE_UINT16(& simpleNoteRequest.info.typicalPolyphony, 0x00010000);
 
 	qtErr = NAStuffToneDescription(qtNoteAllocator, 1, &simpleNoteRequest.tone);
 	if (qtErr != noErr)

Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure	2006-03-14 12:13:27 UTC (rev 21279)
+++ scummvm/trunk/configure	2006-03-14 12:18:04 UTC (rev 21280)
@@ -62,6 +62,7 @@
 _need_memalign=no
 _build_plugins=no
 _nasm=auto
+_altivec=auto
 _build_hq_scalers=yes
 _build_scalers=yes
 # more defaults
@@ -248,6 +249,9 @@
 			mingw* | cygwin*)
 				NASMFLAGS="-f win32"
 			;;
+			darwin*)
+				NASMFLAGS="-f macho"
+			;;
 			*)
 				NASMFLAGS="-f elf"
 			;;
@@ -343,6 +347,7 @@
 
   --with-nasm-prefix=DIR   Prefix where nasm executable is installed (optional)
   --disable-nasm           disable assembly language optimizations [autodetect]
+  --disable-altivec        disable altivec optimizations [autodetect]
 
 Some influential environment variables:
   LDFLAGS   linker flags, e.g. -L<lib dir> if you have libraries in a
@@ -395,6 +400,7 @@
       --enable-plugins)         _build_plugins=yes ;;
       --enable-mt32emu)         _mt32emu=yes    ;;
       --disable-mt32emu)        _mt32emu=no     ;;
+      --disable-altivec)        _altivec=no     ;;
       --with-fluidsynth-prefix=*)
         arg=`echo $ac_option | cut -d '=' -f 2`
         FLUIDSYNTH_CFLAGS="-I$arg/include"
@@ -782,9 +788,6 @@
 		darwin*)
 			DEFINES="$DEFINES -DUNIX -DMACOSX"
 			LIBS="$LIBS -framework QuickTime -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
-			# TODO: Add proper check for Altivec support in the compiler...
-			DEFINES="$DEFINES -DHAS_ALTIVEC"
-			CXXFLAGS="$CXXFLAGS -faltivec"
 			;;
 		mingw*)
 			DEFINES="$DEFINES -DWIN32"
@@ -1230,6 +1233,30 @@
 test -z "$_mandir" && _mandir="$_prefix/man"
 
 #
+# Check for Altivec, if on MacOS X
+#
+case $_host_os in
+	darwin*)
+		echocheck "Altivec"
+		if test "$_altivec" = auto ; then
+			_altivec=no
+			cat > $TMPC << EOF
+int main(void) { return 0; }
+EOF
+			cc_check $LDFLAGS $CXXFLAGS -maltivec && _altivec=yes
+		fi
+		if test "$_altivec" = yes ; then
+				DEFINES="$DEFINES -DHAS_ALTIVEC"
+				CXXFLAGS="$CXXFLAGS -faltivec"
+				CFLAGS="$CFLAGS -faltivec"
+		fi  
+		echo "$_altivec"
+		rm -f $TMPC $TMPO$EXEEXT
+	;;
+esac
+
+
+#
 # Check which engines ("frontends") are to be built
 #
 echo

Modified: scummvm/trunk/graphics/scaler/hq2x.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/hq2x.cpp	2006-03-14 12:13:27 UTC (rev 21279)
+++ scummvm/trunk/graphics/scaler/hq2x.cpp	2006-03-14 12:18:04 UTC (rev 21280)
@@ -29,8 +29,10 @@
 extern "C" {
 
 #ifndef _WIN32
+#ifndef MACOSX
 #define hq2x_16 _hq2x_16
 #endif
+#endif
 
 void hq2x_16(const byte *, byte *, uint32, uint32, uint32, uint32);
 

Modified: scummvm/trunk/graphics/scaler/hq3x.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/hq3x.cpp	2006-03-14 12:13:27 UTC (rev 21279)
+++ scummvm/trunk/graphics/scaler/hq3x.cpp	2006-03-14 12:18:04 UTC (rev 21280)
@@ -29,8 +29,10 @@
 extern "C" {
 
 #ifndef _WIN32
+#ifndef MACOSX
 #define hq3x_16 _hq3x_16
 #endif
+#endif
 
 void hq3x_16(const byte *, byte *, uint32, uint32, uint32, uint32);
 

Modified: scummvm/trunk/graphics/scaler.cpp
===================================================================
--- scummvm/trunk/graphics/scaler.cpp	2006-03-14 12:13:27 UTC (rev 21279)
+++ scummvm/trunk/graphics/scaler.cpp	2006-03-14 12:18:04 UTC (rev 21280)
@@ -37,9 +37,11 @@
 //       condition here
 
 #ifndef _WIN32
+#ifndef MACOSX
 #define RGBtoYUV _RGBtoYUV
 #define LUT16to32 _LUT16to32
 #endif
+#endif
 
 #endif
 


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