Revision: 85
Author: roman_yakovenko
Date: 2006-05-14 01:02:37 -0700 (Sun, 14 May 2006)
ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=85&view=rev
Log Message:
-----------
switching to centralized build of all pyboost example
Modified Paths:
--------------
pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py
Added Paths:
-----------
pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py
pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript
Removed Paths:
-------------
pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconstruct
pyplusplus_dev/examples/pyboost_dev/pyboost/random/settings.py
Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py
===================================================================
--- pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-14 07:49:58 UTC (rev 84)
+++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-14 08:02:37 UTC (rev 85)
@@ -9,7 +9,7 @@
import sys
import time
import shutil
-import settings
+import random_settings
from pygccxml import parser
from pygccxml import declarations
from pyplusplus import code_creators
@@ -23,16 +23,17 @@
class code_generator_t(object):
def __init__(self):
- self.__file = os.path.join( settings.boost.include
+ self.__file = os.path.join( random_settings.boost.include
, 'libs', 'random', 'random_test.cpp' )
self.__mb = module_builder.module_builder_t(
[ parser.create_cached_source_fc(
self.__file
- , os.path.join( settings.generated_files_dir, 'random_test.xml' ) ) ]
- , gccxml_path=settings.gccxml.executable
- , include_paths=[settings.boost.include]
- , undefine_symbols=settings.undefined_symbols)
-
+ , os.path.join( random_settings.generated_files_dir, 'random_test.xml' ) ) ]
+ , gccxml_path=random_settings.gccxml.executable
+ , include_paths=[random_settings.boost.include]
+ , define_symbols=random_settings.defined_symbols
+ , undefine_symbols=random_settings.undefined_symbols)
+
def filter_declarations(self ):
self.__mb.global_ns.exclude()
boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False )
@@ -41,18 +42,23 @@
for cls in boost_ns.namespace( 'random' ).classes():
if cls.ignore:
continue
+ if cls.name.startswith( 'const_mod' ):
+ cls.exclude()
+ continue
+ aliases = set([ t.name for t in cls.typedefs ])
+ for alias in [ 'engine_value_type', 'value_type', 'base_type', 'engine_type' ]:
+ if alias in aliases:
+ aliases.remove( alias )
+ if len( aliases ) == 1:
+ cls.alias = list( aliases )[0]
else:
- aliases = set([ t.name for t in cls.typedefs ])
- for alias in [ 'engine_value_type', 'value_type', 'base_type', 'engine_type' ]:
- if alias in aliases:
- aliases.remove( alias )
- if len( aliases ) == 1:
- cls.alias = list( aliases )[0]
- else:
- print cls.name
- for t in aliases:
- print ' ', t
-
+ print cls.name
+ for t in aliases:
+ print ' ', t
+ if cls.alias == 'ecuyer1988':
+ seed = cls.member_function( 'seed', arg_types=[None, None] )
+ seed.exclude()
+
boost_ns.free_functions( "lessthan_signed_unsigned" ).exclude()
boost_ns.free_functions( "equal_signed_unsigned" ).exclude()
@@ -61,26 +67,42 @@
position = extmodule.last_include_index() + 1
extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' )
, position )
+ self.__mb.calldefs().create_with_signature = True
+ def replace_include_directives( self ):
+ extmodule = self.__mb.code_creator
+ includes = filter( lambda creator: isinstance( creator, code_creators.include_t )
+ , extmodule.creators )
+ includes = includes[1:] #all includes except boost\python.hpp
+ map( lambda creator: extmodule.remove_creator( creator ), includes )
+ for include_header in ['boost/random.hpp', 'boost/nondet_random.hpp' ]:
+ extmodule.adopt_include( code_creators.include_t( header=include_header ) )
+
def customize_extmodule( self ):
global LICENSE
extmodule = self.__mb.code_creator
#beautifying include code generation
extmodule.license = LICENSE
- extmodule.user_defined_directories.append( settings.boost.include )
- extmodule.user_defined_directories.append( settings.working_dir )
- extmodule.user_defined_directories.append( settings.generated_files_dir )
+ extmodule.user_defined_directories.append( random_settings.boost.include )
+ extmodule.user_defined_directories.append( random_settings.working_dir )
+ extmodule.user_defined_directories.append( random_settings.generated_files_dir )
extmodule.precompiled_header = 'boost/python.hpp'
+ self.replace_include_directives()
self.beautify_code( )
+
+#include "boost/random.hpp"
+#include "boost/nondet_random.hpp"
+
+
def write_files( self ):
- self.__mb.write_module( os.path.join( settings.generated_files_dir, 'random.pypp.cpp' ) )
+ self.__mb.write_module( os.path.join( random_settings.generated_files_dir, 'random.pypp.cpp' ) )
def create(self):
start_time = time.clock()
self.filter_declarations()
- self.__mb.build_code_creator( settings.module_name )
+ self.__mb.build_code_creator( random_settings.module_name )
self.customize_extmodule()
self.write_files( )
Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py (from rev 63, pyplusplus_dev/examples/pyboost_dev/pyboost/random/settings.py)
===================================================================
--- pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py (rev 0)
+++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py 2006-05-14 08:02:37 UTC (rev 85)
@@ -0,0 +1,27 @@
+#! /usr/bin/python
+# Copyright 2004 Roman Yakovenko.
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+import os
+import sys
+
+_script_dir = os.path.abspath( os.getcwd() )
+environment_path = os.path.realpath( os.path.join( _script_dir, '..', '..', '..', '..' ) )
+sys.path.append( environment_path )
+
+from environment import boost, scons, gccxml, python
+
+module_name = '_random_'
+working_dir = _script_dir
+generated_files_dir = os.path.join( _script_dir, 'generated' )
+unittests_dir = os.path.join( _script_dir, '..', '..', 'unittests', 'random' )
+
+defined_symbols = [ 'BOOST_NO_INCLASS_MEMBER_INITIALIZATION', 'BOOST_NO_INT64_T' ]
+undefined_symbols = [ '__MINGW32__' ]
+#defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT']
+#if sys.platform == 'win32':
+ #defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] )
+
+
\ No newline at end of file
Added: pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript
===================================================================
--- pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript (rev 0)
+++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript 2006-05-14 08:02:37 UTC (rev 85)
@@ -0,0 +1,35 @@
+#! /usr/bin/python
+# Copyright 2004 Roman Yakovenko.
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+import os
+import sys
+import random_settings
+
+Import( 'env' )
+
+def get_ccflags():
+ if sys.platform == 'win32':
+ return random_settings.scons.ccflags \
+ + map( lambda ds: '/D%s' % ds, random_settings.defined_symbols )
+ else:
+ return map( lambda ds: '-D' + ds, random_settings.defined_symbols )
+
+def get_source_files():
+ source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(random_settings.generated_files_dir) )
+ return map( lambda fname: os.path.join( random_settings.generated_files_dir, fname ), source_files )
+
+def get_target():
+ return os.path.join( random_settings.generated_files_dir
+ , random_settings.module_name + random_settings.scons.suffix )
+
+local_env = env.Copy()
+local_env.Append( CPPPATH=[ random_settings.generated_files_dir ] )
+local_env.Append( CCFLAGS=get_ccflags() )
+
+_random_ = local_env.SharedLibrary( target=random_settings.module_name
+ , source=get_source_files() )
+
+local_env.Install( '#unittests/random', _random_ )
Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconstruct
===================================================================
--- pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconstruct 2006-05-14 07:49:58 UTC (rev 84)
+++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconstruct 2006-05-14 08:02:37 UTC (rev 85)
@@ -1,54 +0,0 @@
-#! /usr/bin/python
-# Copyright 2004 Roman Yakovenko.
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-
-import os
-import sys
-from environment import settings
-
-def get_shlibsuffix():
- if sys.platform == 'win32':
- return '.pyd'
- else:
- return '.so'
-
-def get_ccflags():
- if sys.platform == 'win32':
- return [ '/MD'
- , '/EHsc'
- , '/GR'
- , '/Zc:wchar_t'
- , '/Zc:forScope'
- , '/GR' ] \
- + map( lambda ds: '/D%s' % ds, settings.defined_symbols )
- else:
- return map( lambda ds: '-D' + ds, settings.defined_symbols )
-
-def get_py_date_time_files():
- source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(settings.generated_files_dir) )
- return map( lambda fname: os.path.join( settings.generated_files_dir, fname ), source_files )
-
-def get_libs():
- if sys.platform == 'win32':
- return ['boost_python' ] #python24.lib
- else:
- return ['boost_python', 'libboost_date_time-gcc-1_34']
-
-def get_target():
- return os.path.join( settings.unittests_dir
- , settings.module_name + get_shlibsuffix() )
-
-SharedLibrary( target=get_target()
- , source=get_py_date_time_files()
- , LIBS=get_libs()
- , LIBPATH=[ settings.boost_libs_path, settings.python_libs_path ]
- , CPPPATH=[ settings.boost_path
- , settings.working_dir
- , settings.python_include_path
- , settings.generated_files_dir ]
- , CCFLAGS=get_ccflags()
- , SHLIBPREFIX=''
- , SHLIBSUFFIX=get_shlibsuffix()
-)
Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/random/settings.py
===================================================================
--- pyplusplus_dev/examples/pyboost_dev/pyboost/random/settings.py 2006-05-14 07:49:58 UTC (rev 84)
+++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/settings.py 2006-05-14 08:02:37 UTC (rev 85)
@@ -1,25 +0,0 @@
-#! /usr/bin/python
-# Copyright 2004 Roman Yakovenko.
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-
-import os
-import sys
-
-_script_dir = os.path.split( os.path.abspath( sys.argv[0] ) )[0]
-environment_path = os.path.normpath( os.path.join( _script_dir, '..', '..', '..', '..' ) )
-
-sys.path.append( environment_path )
-
-from environment import boost, scons, gccxml
-
-module_name = '_random_'
-working_dir = _script_dir
-generated_files_dir = os.path.join( _script_dir, 'generated' )
-unittests_dir = os.path.join( _script_dir, '..', '..', 'unittests', 'random' )
-
-undefined_symbols = [ '__MINGW32__' ]
-#defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT']
-#if sys.platform == 'win32':
- #defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] )
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|