[xiph-commits] r14949 - trunk/ffmpeg2theora

j at svn.xiph.org j at svn.xiph.org
Fri May 23 10:55:54 PDT 2008


Author: j
Date: 2008-05-23 10:55:53 -0700 (Fri, 23 May 2008)
New Revision: 14949

Added:
   trunk/ffmpeg2theora/SConstruct
Modified:
   trunk/ffmpeg2theora/
Log:
add SConstruct


Property changes on: trunk/ffmpeg2theora
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2008-05-23 18:30:06.611999989 +0200
committer: j
properties: 
	branch-nick: ffmpeg2theora

   + timestamp: 2008-05-23 18:59:04.180999994 +0200
committer: j
properties: 
	branch-nick: ffmpeg2theora

Name: bzr:file-ids
   - 
   + SConstruct	sconstruct-20080523165848-8nlost8hilp0zdcm-1

Name: bzr:revision-id:v3-single1-dHJ1bmsvZmZtcGVnMnRoZW9yYQ..
   - 191 j-20080517230830-he5x8v2m8yrfiw35
192 j-20080518224037-pkmoctzf4qce7tog
193 j-20080518224409-6hbfp3k2ssn6egqa
194 j-20080520111939-dhi52qwbqe7a47cu
195 j-20080523092252-gj9k9db0s67vl7dw
196 j-20080523092420-l0850yrq1qkgz9t0
197 j-20080523093057-l5g0ezzy5geu0pey
198 j-20080523094343-kcno1dm2e1lr38q4
199 j-20080523163006-kjl6ewea5sxawmq2

   + 191 j-20080517230830-he5x8v2m8yrfiw35
192 j-20080518224037-pkmoctzf4qce7tog
193 j-20080518224409-6hbfp3k2ssn6egqa
194 j-20080520111939-dhi52qwbqe7a47cu
195 j-20080523092252-gj9k9db0s67vl7dw
196 j-20080523092420-l0850yrq1qkgz9t0
197 j-20080523093057-l5g0ezzy5geu0pey
198 j-20080523094343-kcno1dm2e1lr38q4
199 j-20080523163006-kjl6ewea5sxawmq2
200 j-20080523165904-l2vm52qae0hlqkhp


Added: trunk/ffmpeg2theora/SConstruct
===================================================================
--- trunk/ffmpeg2theora/SConstruct	                        (rev 0)
+++ trunk/ffmpeg2theora/SConstruct	2008-05-23 17:55:53 UTC (rev 14949)
@@ -0,0 +1,93 @@
+# SCons build specification
+from glob import glob
+import os
+
+import SCons
+
+
+pkg_version="0.21+svn"
+pkg_name="ffmpeg2theora"
+
+#parse config variables
+static = False
+
+env = Environment()
+pkg_flags="--cflags --libs"
+if static:
+  pkg_flags+=" --static"
+  env.Append(LINKFLAGS=["-static"])
+
+env.Append(CPPPATH=['.'])
+env.Append(CCFLAGS=[
+  '-DPACKAGE_VERSION=\\"%s\\"' %pkg_version,
+  '-DPACKAGE_STRING=\\"%s-%s\\"' %(pkg_name, pkg_version),
+  '-DPACKAGE=\\"%s\\"' % pkg_name,
+  '-DVERSION=\\"%s\\"' %pkg_version,
+])
+#if env['CC'] == 'gcc':
+#  env.Append(CCFLAGS=["-g", "-O2", "-Wall"])
+
+def CheckPKGConfig(context, version): 
+  context.Message( 'Checking for pkg-config... ' ) 
+  ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] 
+  context.Result( ret ) 
+  return ret 
+
+def CheckPKG(context, name): 
+  context.Message( 'Checking for %s... ' % name )
+  if os.environ.get('PKG_CONFIG_PATH', ''):
+    action = 'PKG_CONFIG_PATH=%s pkg-config --exists "%s"' % (os.environ['PKG_CONFIG_PATH'], name)
+  else:
+    action = 'pkg-config --exists "%s"' % name
+  ret = context.TryAction(action)[0]
+  context.Result( ret ) 
+  return ret
+
+conf = Configure(env, custom_tests = {
+  'CheckPKGConfig' : CheckPKGConfig,
+  'CheckPKG' : CheckPKG,
+  })
+  
+if not conf.CheckPKGConfig('0.15.0'): 
+   print 'pkg-config >= 0.15.0 not found.' 
+   Exit(1)
+
+XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theora >= 1.0beta1"
+
+if not conf.CheckPKG(XIPH_LIBS): 
+  print 'some xiph libs are missing, ffmpeg2theora depends on %s' % XIPH_LIBS
+  Exit(1) 
+env.ParseConfig('pkg-config %s "%s"' % (pkg_flags, XIPH_LIBS))
+
+FFMPEG_LIBS="libavformat libavcodec libavdevice libswscale libpostproc"
+if os.path.exists("./ffmpeg"):
+  os.environ['PKG_CONFIG_PATH'] = "./ffmpeg:" + os.environ.get('PKG_CONFIG_PATH', '')
+if not conf.CheckPKG(FFMPEG_LIBS): 
+  print """
+      Could not find %s.
+      You can install it via
+       sudo apt-get install %s
+      or update PKG_CONFIG_PATH to point to ffmpeg's source folder
+      or run ./get_ffmpeg_svn.sh (for more information see INSTALL)
+  """ %(FFMPEG_LIBS, " ".join(["%s-dev"%l for l in FFMPEG_LIBS.split()]))
+  Exit(1) 
+env.ParseConfig('pkg-config %s "%s"' % (pkg_flags, FFMPEG_LIBS))
+
+KATE_LIBS="oggkate"
+if os.path.exists("./libkate/pkg/pkgconfig"):
+  os.environ['PKG_CONFIG_PATH'] = "./libkate/pkg/pkgconfig:" + os.environ.get('PKG_CONFIG_PATH', '')
+if conf.CheckPKG(KATE_LIBS):
+  env.ParseConfig('pkg-config %s "%s"' % (pkg_flags, KATE_LIBS))
+  env.Append(CCFLAGS=['-DHAVE_KATE', '-DHAVE_OGGKATE'])
+else:
+  print """
+      Could not find %s.
+      update PKG_CONFIG_PATH to point to ffmpeg's source folder
+      or run ./get_libkate.sh (for more information see INSTALL)
+  """ % KATE_LIBS
+env = conf.Finish()
+
+# ffmpeg2theora 
+ffmpeg2theora = env.Copy()
+ffmpeg2theora_sources = glob('*.c')
+ffmpeg2theora.Program('ffmpeg2theora', ffmpeg2theora_sources)



More information about the commits mailing list