[xiph-commits] r9121 - trunk/dryice

arc at motherfish-iii.xiph.org arc at motherfish-iii.xiph.org
Thu Apr 7 04:18:09 PDT 2005


Author: arc
Date: 2005-04-07 04:18:08 -0700 (Thu, 07 Apr 2005)
New Revision: 9121

Added:
   trunk/dryice/Makefile
   trunk/dryice/configure
Modified:
   trunk/dryice/SConstruct
Log:
Adding a configure script and Makefile instead of serious work.
.. so you could say I'm either lazy or obsessive... or a little of both.


Added: trunk/dryice/Makefile
===================================================================
--- trunk/dryice/Makefile	2005-04-07 10:18:29 UTC (rev 9120)
+++ trunk/dryice/Makefile	2005-04-07 11:18:08 UTC (rev 9121)
@@ -0,0 +1,4 @@
+all: 
+	@scons -Q do=build
+install:
+	@scons -Q do=install

Modified: trunk/dryice/SConstruct
===================================================================
--- trunk/dryice/SConstruct	2005-04-07 10:18:29 UTC (rev 9120)
+++ trunk/dryice/SConstruct	2005-04-07 11:18:08 UTC (rev 9121)
@@ -21,7 +21,7 @@
 
 # Shouldn't have to edit anything below this line
 
-def checkdeps(ds, l):
+def checkdeps(ds, l, checks):
   for dep in ds :
     for check in checks:
       if deps[dep].has_key(check) :
@@ -31,27 +31,69 @@
           if check == 'libs' : l.append(test)
   return None
 
-env = Environment()
-conf = Configure(env)
-checks = {'funcs':conf.CheckFunc, 
-          'libs':conf.CheckLib, 
-          'headers':conf.CheckCHeader}
+def configure():
+  global env
+  conf = Configure(env)
+  checks = {'funcs':conf.CheckFunc, 
+            'libs':conf.CheckLib, 
+            'headers':conf.CheckCHeader}
+  test = checkdeps(('libogg','libvorbis','libtheora','libshout'), 
+                   libs, checks)
+  if test:
+    print 'Could not find %s, exiting.' % test
+    Exit(1)
+  for module in modules:
+    test = checkdeps(moduledeps[module], modulelibs[module], checks)
+    if test:
+      print 'Could not find %s, not building %s module' % (test, module)
+      modules.remove(module)
+  env = conf.Finish()
 
-test = checkdeps(('libogg','libvorbis','libtheora','libshout'), libs)
-if test:
-  print 'Could not find %s, exiting.' % test
-  Exit(1)
+def saveconfig():
+  f = open('config.cache','w')
+  f.write('libs=%s\n' % str(libs))
+  f.write('cpppath=%s\n' % str(cpppath))
+  f.write('modules=%s\n' % str(modules))
+  f.close()
 
-for module in modules:
-  test = checkdeps(moduledeps[module], modulelibs[module])
-  if test:
-    print 'Could not find %s, not building %s module' % (test, module)
-    modules.remove(module)
+def loadconfig():
+  # There has *GOT* to be a simpler way to do this!
+  # ... but at least it's more secure.
+  local_libs = []
+  local_cpppath = ['include']
+  local_modules = []
+  from os.path import exists
+  if exists('config.cache'):
+    f = open('config.cache','r')
+    b = f.read().splitlines()
+    for l in b:
+      exec 'local_'+l
+    f.close()
+    global libs, cpppath, modules
+    libs = local_libs
+    cpppath = local_cpppath
+    modules = local_modules
+  else :
+    configure()
 
-env = conf.Finish()
+def build():
+  Program('dryice', 'src/core.c', CPPPATH=cpppath, LIBS=libs)
+  for module in modules:
+    Library(module, modulesrcs[module], 
+            CPPPATH=cpppath, LIBS=modulelibs[module])
 
-Program('dryice', 'src/core.c', CPPPATH=cpppath, LIBS=libs)
-for module in modules:
-  Library(module, modulesrcs[module], 
-          CPPPATH=cpppath, LIBS=modulelibs[module])
+env = Environment()
+do = ARGUMENTS.get('do', None)
 
+if do=='config' :
+  configure()
+  saveconfig()
+
+elif do=='build' :
+  loadconfig()
+  build()
+
+else :
+  configure()
+  saveconfig()
+  build()

Added: trunk/dryice/configure
===================================================================
--- trunk/dryice/configure	2005-04-07 10:18:29 UTC (rev 9120)
+++ trunk/dryice/configure	2005-04-07 11:18:08 UTC (rev 9121)
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+echo 'DryIce uses SCons instead of a traditional GNU Autotools environment.'
+echo ''
+echo 'You will need to have SCons installed in order to compile it, and you'
+echo 'can save yourself some time by running "scons" by itself instead of a'
+echo '"./configure" then "make" (which mearly run scons for you in pieces).'
+echo ''
+scons -Q do=config


Property changes on: trunk/dryice/configure
___________________________________________________________________
Name: svn:executable
   + *



More information about the commits mailing list