[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14803] branches/soc-2008-mxcurioni: soc-2008-mxcurioni: swig SConscript updated to compile under all configs except Win32 ( where binary is copied to build directory)

Maxime Curioni maxime.curioni at gmail.com
Sun May 11 23:49:05 CEST 2008


Revision: 14803
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14803
Author:   mxcurioni
Date:     2008-05-11 23:49:04 +0200 (Sun, 11 May 2008)

Log Message:
-----------
soc-2008-mxcurioni: swig SConscript updated to compile under all configs except Win32 (where binary is copied to build directory)

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/extern/freestyle/swig/SConscript
    branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript

Added Paths:
-----------
    branches/soc-2008-mxcurioni/extern/freestyle/swig/swig.exe

Modified: branches/soc-2008-mxcurioni/extern/freestyle/swig/SConscript
===================================================================
--- branches/soc-2008-mxcurioni/extern/freestyle/swig/SConscript	2008-05-11 21:13:54 UTC (rev 14802)
+++ branches/soc-2008-mxcurioni/extern/freestyle/swig/SConscript	2008-05-11 21:49:04 UTC (rev 14803)
@@ -6,14 +6,11 @@
 import re
 import time
 import string
+import shutil
 from distutils import sysconfig
 
-from sets import Set
-
 Import('env')
 
-
-
 root = "extern/freestyle/swig"
 root_build_dir = env['BF_BUILDDIR']
 
@@ -29,98 +26,22 @@
 platform_libpath = []
 platform_linkflags = []
 
-#============================================
-#  Makefile Functions
-#============================================
-makevardef = re.compile('^([a-zA-Z0-9_-]+)[ \t]*(\+?)=(.*)')
-makevarsubst = re.compile('\$\(([^\)]+)\)')
-makeifeq = re.compile('if(n?)eq \(([^,]*),([^\)]*)\)')
+if env['OURPLATFORM'] in ['win32-vc','win32-mingw']:
+	print "Under Windows, swig.exe is direcyly copied to build directory"
+	shutil.copy ( "#" + root + "/swig.exe", "#" + root_build_dir + os.sep + "/bin/")
+	Exit()
 
-def makeparseblock(fp, variables):
-    pendingline = ''
-    while 1:
-        line = fp.readline()
-        if pendingline:
-            line = pendingline + line
-            pendingline = ''
-        if not line:
-            return
-        if line.endswith('\\\n'):
-            pendingline = line[:-2]
-            continue 
-
-        i = line.find('#')
-        if i >= 0:
-            line = line[:i]
-
-        iter = makevarsubst.finditer(line[:])
-        for obj in iter:
-            (name) = obj.group(1)
-            s = ""
-            if name in variables:
-                s = variables[name]
-            line = line.replace('$(' + name + ')', s)
-
-        matchobj = makevardef.match(line)
-        if matchobj:
-            (name, op, value) = matchobj.group(1, 2, 3)
-
-            value = value.rstrip()
-
-            if op == '+' and name in variables:
-                 variables[name] += value
-            else:
-                 variables[name] = value
-            continue
-        matchobj = makeifeq.match(line)
-        if matchobj:
-            (op, name1, name2) = matchobj.group(1, 2, 3)
-            if (op == '' and name1 == name2) or (op == 'n' and name1 != name2):
-                makeparseblock(fp, variables)
-            else:
-                tempvars = {}
-                makeparseblock(fp, tempvars)
-            continue
-        line = line.strip()
-        if line == 'endif':
-            return
-                
-def getmakevars(filenames):
-    variables = { }
-    for filename in filenames:
-       fp = open(filename)
-       print "Processing makefile: " + filename
-       try:
-             makeparseblock(fp, variables)
-       finally:
-             fp.close()
-
-    return variables
-
-#============================================
 #  Configure
-#============================================
 print "Configuring swig..."
 
-# Configure
-os.chdir(root);
+cflags = ['-g', '-O2', '-Wall', '-W','-ansi','-pedantic']
+defines = ['-DHAVE_CONFIG_H']
 
-if not os.path.isfile("Makefile"):
-	os.system("sh -c './configure'")
-else:
-    print "(skipped, Makefile already exists)"
+swig_env.Append(CPPDEFINES = defines)
+swig_env.Append(CCFLAGS = cflags)
+swig_env.Append(CXXFLAGS = cflags)
 
-vars = getmakevars(['Source/Makefile'])
-
-cflags = vars['CFLAGS']
-cflags = list(Set(cflags.split()))
-
-defines = vars['DEFS']
-defines = list(Set(defines.split()))
-
-#============================================
 #  Compulation parameters
-#============================================
 
 swig_source_files_list = ([ 'CParse/cscanner.c',
 							'CParse/parser.y',
@@ -193,8 +114,6 @@
 for source_file in swig_source_files_list:
 	swig_source_files.append('Source/' + source_file)
 
-#=====
-
 includes = ['Source/CParse',
 			'Source/DOH',
 			'Source/Include',
@@ -202,24 +121,9 @@
 			'Source/Preprocessor',
 			'Source/Swig' ]
 
-swig_env.Append(CPPDEFINES = defines)
-swig_env.Append(CCFLAGS = cflags)
-swig_env.Append(CXXFLAGS = cflags)
-
 swig_env.BlenderProg(builddir="#"+root_build_dir+os.sep,
 					 progname='swig',
 					 sources=swig_source_files,
 					 includes=includes,
 					 libs=[],
-					 libpath='#'+root_build_dir+'/lib')
-
-# swig_env.BlenderLib (libname="extern_swig",
-# 					 sources=swig_source_files,
-#                      includes=includes,
-#                      defines=defines,
-#                      libtype=['blender'],
-#                      priority = [15],
-#                      compileflags = cflags)
-
-
-
+					 libpath='#'+root_build_dir+'/lib')
\ No newline at end of file

Added: branches/soc-2008-mxcurioni/extern/freestyle/swig/swig.exe
===================================================================
(Binary files differ)


Property changes on: branches/soc-2008-mxcurioni/extern/freestyle/swig/swig.exe
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript	2008-05-11 21:13:54 UTC (rev 14802)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript	2008-05-11 21:49:04 UTC (rev 14803)
@@ -7,7 +7,7 @@
 incs = ''
 
 incs += '../blenkernel ../blenlib ../imbuf ../makesdna'
-incs += ' #/extern/freestyle/lib3ds'
+incs += ' #/extern/freestyle/lib3ds' 
 incs += ' ' + env['BF_PYTHON_INC']
 incs += ' ' + env['BF_LIB3DS_INC']
 incs += ' ' + env['BF_PNG_INC']





More information about the Bf-blender-cvs mailing list