[xiph-commits] r11436 - trunk/theora

giles at svn.xiph.org giles at svn.xiph.org
Fri May 26 20:10:53 PDT 2006


Author: giles
Date: 2006-05-26 20:10:52 -0700 (Fri, 26 May 2006)
New Revision: 11436

Modified:
   trunk/theora/SConstruct
Log:
Update the scons build to work with the new gcc asm support.


Modified: trunk/theora/SConstruct
===================================================================
--- trunk/theora/SConstruct	2006-05-26 23:33:54 UTC (rev 11435)
+++ trunk/theora/SConstruct	2006-05-27 03:10:52 UTC (rev 11436)
@@ -10,9 +10,11 @@
   dct_encode.c encode.c encoder_toplevel.c
   blockmap.c
   comment.c
+  cpu.c
   dct.c
   dct_decode.c
   decode.c
+  dsp.c
   frarray.c
   frinit.c
   huffman.c
@@ -32,10 +34,62 @@
   env.Append(CCFLAGS=["-g", "-O2", "-Wall"])
 #  env.Append(CCFLAGS=["-g", "-Wall"])
 
+# check for appropriate inline asm support
+host_x86_32_test = """
+    int main(int argc, char **argv) {
+#if !defined(__i386__)
+	#error __i386__ not defined
+#endif
+	return 0;
+    }
+    """
+def CheckHost_x86_32(context):
+        context.Message('Checking for an x86_32 host...')
+        result = context.TryCompile(host_x86_32_test, '.c')
+        context.Result(result)
+        return result
+
+host_x86_64_test = """
+    int main(int argc, char **argv) {
+#if !defined(__x86_64__)
+	#error __x86_64__ not defined
+#endif
+	return 0;
+    }
+    """
+def CheckHost_x86_64(context):
+        context.Message('Checking for an x86_64 host...')
+        result = context.TryCompile(host_x86_64_test, '.c')
+        context.Result(result)
+        return result
+
+conf = Configure(env, custom_tests = {
+	'CheckHost_x86_32' : CheckHost_x86_32,
+	'CheckHost_x86_64' : CheckHost_x86_64
+	})
+if conf.CheckHost_x86_32():
+  libtheora_Sources += Split("""
+    x86_32/dsp_mmx.c
+    x86_32/dsp_mmxext.c
+    x86_32/recon_mmx.c
+    x86_32/fdct_mmx.c
+  """)
+elif conf.CheckHost_x86_64():
+  libtheora_Sources += Split("""
+    x86_64/dsp_mmx.c
+    x86_64/dsp_mmxext.c
+    x86_64/recon_mmx.c
+    x86_64/fdct_mmx.c
+  """)
+env = conf.Finish()
+
 env.Append(CPPPATH=['lib', 'include'])
 
 env.Library('theora', path('lib', libtheora_Sources))
 
+
+# example programs
+
 examples = env.Copy()
 
 examples.Append(LIBPATH=['.'])



More information about the commits mailing list