Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

scons buils scripts for linux

port to gcc 4.3
  • Loading branch information...
commit e0df15525dacdcb4954f15e0d646205d6d7abc9f 1 parent cb0a8fc
opencollada-sebastian opencollada-sebastian authored
Showing with 663 additions and 220 deletions.
  1. +28 −0 COLLADABaseUtils/SConscript
  2. +1 −1  COLLADABaseUtils/include/Math/COLLADABUMathVector3.h
  3. +26 −0 COLLADAFramework/SConscript
  4. +1 −0  COLLADAFramework/include/COLLADAFWArrayPrimitiveType.h
  5. +46 −0 COLLADASaxFrameworkLoader/SConscript
  6. +24 −0 COLLADAStreamWriter/SConscript
  7. +1 −0  COLLADAStreamWriter/include/COLLADASWBuffer.h
  8. +1 −0  COLLADAStreamWriter/include/COLLADASWStreamWriter.h
  9. +59 −0 COLLADAValidator/SConscript
  10. +149 −149 COLLADAValidator/include/Writer.h
  11. +2 −0  COLLADAValidator/src/ValidationErrorHandler.cpp
  12. +10 −5 COLLADAValidator/src/main.cpp
  13. +21 −0 Externals/LibXML/SConscript
  14. +27 −0 Externals/MathMLSolver/SConscript
  15. +2 −0  Externals/MathMLSolver/src/MathMLSymbolTable.cpp
  16. +24 −0 Externals/UTF/SConscript
  17. +23 −0 Externals/expat/SConscript
  18. +22 −0 Externals/pcre/SConscript
  19. +40 −0 Externals/pcre/include/config_linux.h
  20. +5 −3 Externals/pcre/src/pcre_chartables.c
  21. +5 −3 Externals/pcre/src/pcre_compile.c
  22. +5 −3 Externals/pcre/src/pcre_exec.c
  23. +5 −3 Externals/pcre/src/pcre_globals.c
  24. +5 −3 Externals/pcre/src/pcre_newline.c
  25. +5 −3 Externals/pcre/src/pcre_tables.c
  26. +4 −2 Externals/pcre/src/pcre_try_flipped.c
  27. +42 −0 GeneratedSaxParser/SConscript
  28. +80 −45 SConstruct
28 COLLADABaseUtils/SConscript
View
@@ -0,0 +1,28 @@
+
+Import('env')
+
+libName = 'OpenCOLLADABaseUtils'
+
+
+srcDirs = [ 'src/', 'src/Math/']
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/', 'include/Math/', '../Externals/UTF/include/']
+
+if not env['PCRENATIVE']:
+ incDirs += ['../Externals/pcre/include']
+
+
+src = []
+for srcDir in srcDirs:
+ src += [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+ VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
2  COLLADABaseUtils/include/Math/COLLADABUMathVector3.h
View
@@ -516,7 +516,7 @@ namespace COLLADABU
Real dot = dotProduct( rhs );
Real angle_radian = acos( dot );
- return abs( angle_radian ) <= tolerance_radian;
+ return fabs( angle_radian ) <= tolerance_radian;
}
26 COLLADAFramework/SConscript
View
@@ -0,0 +1,26 @@
+
+Import('env')
+
+libName = 'OpenCOLLADAFramework'
+
+
+srcDir = 'src/'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/',
+ '../COLLADABaseUtils/include/',
+ '../Externals/MathMLSolver/include/',
+ '../Externals/MathMLSolver/include/AST']
+
+src = [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+
1  COLLADAFramework/include/COLLADAFWArrayPrimitiveType.h
View
@@ -15,6 +15,7 @@ for details please see LICENSE file or the website
#include "COLLADAFWArray.h"
#include <string.h>
#include <cassert>
+#include <stdlib.h>
namespace COLLADAFW
46 COLLADASaxFrameworkLoader/SConscript
View
@@ -0,0 +1,46 @@
+
+Import('env')
+
+libName = 'OpenCOLLADASaxFrameworkLoader'
+
+
+srcDirs = [ 'src/',
+ 'src/generated14/',
+ 'src/generated15/']
+
+variantDir = env['objDir'] + env['configurationBaseName'] + env['xmlParserConfName'] + env['validationConfName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + env['xmlParserConfName'] + env['validationConfName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = [ 'include',
+ 'include/generated14',
+ 'include/generated15',
+ '../COLLADABaseUtils/include',
+ '../GeneratedSaxParser/include',
+ '../COLLADAFramework/include',
+ '../Externals/LibXML/include',
+ '../Externals/MathMLSolver/include',
+ '../Externals/MathMLSolver/include/AST']
+
+if not env['PCRENATIVE']:
+ incDirs += ['../Externals/pcre/include']
+
+src = []
+for srcDir in srcDirs:
+ src += [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+ VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if (env['XMLPARSER'] == 'expat') or (env['XMLPARSER'] == 'expatnative'):
+ env['CPPFLAGS'] += ' -DGENERATEDSAXPARSER_XMLPARSER_EXPAT'
+else:
+ env['CPPFLAGS'] += ' -DGENERATEDSAXPARSER_XMLPARSER_LIBXML'
+
+if not env['NOVALIDATION']:
+ env['CPPFLAGS'] += ' -DGENERATEDSAXPARSER_VALIDATION'
+
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
24 COLLADAStreamWriter/SConscript
View
@@ -0,0 +1,24 @@
+
+Import('env')
+
+libName = 'OpenCOLLADAStreamWriter'
+
+
+srcDir = 'src/'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/',
+ '../COLLADABaseUtils/include/']
+
+src = [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+
1  COLLADAStreamWriter/include/COLLADASWBuffer.h
View
@@ -15,6 +15,7 @@
#include "COLLADASWIBufferFlusher.h"
+#include <string.h>
namespace COLLADASW
{
1  COLLADAStreamWriter/include/COLLADASWStreamWriter.h
View
@@ -25,6 +25,7 @@
#include <vector>
#include <limits>
#include <algorithm>
+#include <string.h>
#define WHITESPACESTRINGLENGTH 1000
59 COLLADAValidator/SConscript
View
@@ -0,0 +1,59 @@
+
+Import('env')
+
+progName = 'OpenCOLLADAValidator'
+
+
+srcDir = 'src/'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + env['xmlParserConfName'] + env['validationConfName'] + '/'
+outputDir = env['binDir'] + env['configurationBaseName'] + env['xmlParserConfName'] + env['validationConfName'] + '/'
+targetPath = outputDir + progName
+
+incDirs = [ 'include',
+ '../COLLADABaseUtils/include',
+ '../COLLADAFramework/include',
+ '../COLLADASaxFrameworkLoader/include',
+ '../GeneratedSaxParser/include']
+
+src = [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+libs = [ 'OpenCOLLADASaxFrameworkLoader',
+ 'MathMLSolver',
+ 'OpenCOLLADAFramework',
+ 'OpenCOLLADABaseUtils',
+ 'GeneratedSaxParser',
+ 'pcre',
+ 'UTF' ]
+
+libPath = [ '../COLLADABaseUtils/' + env['libDir'] + env['configurationBaseName'],
+ '../COLLADAFramework/' + env['libDir'] + env['configurationBaseName'],
+ '../Externals/MathMLSolver/' + env['libDir'] + env['configurationBaseName'],
+ '../Externals/UTF/' + env['libDir'] + env['configurationBaseName'],
+ '../COLLADASaxFrameworkLoader/' + env['libDir'] + env['configurationBaseName'] + env['xmlParserConfName'] + env['validationConfName'],
+ '../GeneratedSaxParser/' + env['libDir'] + env['configurationBaseName'] + env['xmlParserConfName'] ]
+
+if not env['PCRENATIVE']:
+ libPath += '../Externals/pcre/' + env['libDir'] + env['configurationBaseName'],
+
+if (env['XMLPARSER'] == 'expat') or (env['XMLPARSER'] == 'expatnative'):
+ env['CPPFLAGS'] += ' -DXMLPARSER_EXPAT'
+ libs += ['expat']
+ if env['XMLPARSER'] == 'expat':
+ libPath += ['../Externals/expat/' + env['libDir'] + env['configurationBaseName']]
+else:
+ env['CPPFLAGS'] += ' -DXMLPARSER_LIBXML'
+ if env['XMLPARSER'] == 'libxml':
+ libPath += ['../Externals/libxml/' + env['libDir'] + env['configurationBaseName']]
+ libs += ['xml']
+ else:
+ libs += ['xml2']
+
+if env['PG']:
+ linkFlags = ['-pg']
+else:
+ linkFlags = []
+
+Program(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'], LIBS=libs, LIBPATH=libPath, LINKFLAGS=linkFlags)
+
298 COLLADAValidator/include/Writer.h
View
@@ -10,155 +10,155 @@ namespace COLLADAFW
class Formula;
}
- class Writer : public COLLADAFW::IWriter
+class Writer : public COLLADAFW::IWriter
+{
+ // member declarations
+private:
+
+ // public function declarations
+public:
+ Writer() : IWriter() {}
+ virtual ~Writer(){}
+
+ /** This method will be called if an error in the loading process occurred and the loader cannot
+ continue to to load. The writer should undo all operations that have been performed.
+ @param errorMessage A message containing informations about the error that occurred.
+ */
+ virtual void cancel(const COLLADAFW::String& errorMessage){}
+
+ /** This is the method called. The writer hast to prepare to receive data.*/
+ virtual void start(){}
+
+ /** This method is called after the last write* method. No other methods will be called after this.*/
+ virtual void finish(){}
+
+ /** When this method is called, the writer must write the global document asset.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeGlobalAsset ( const COLLADAFW::FileInfo* asset )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the entire visual scene.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeScene ( const COLLADAFW::Scene* scene )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the entire visual scene.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeVisualScene ( const COLLADAFW::VisualScene* visualScene )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must handle all nodes contained in the
+ library nodes.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeLibraryNodes ( const COLLADAFW::LibraryNodes* libraryNodes )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the geometry.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeGeometry ( const COLLADAFW::Geometry* geometry )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the material.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeMaterial( const COLLADAFW::Material* material )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the effect.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeEffect( const COLLADAFW::Effect* effect )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the camera.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeCamera( const COLLADAFW::Camera* camera )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the image.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeImage( const COLLADAFW::Image* image )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the light.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeLight( const COLLADAFW::Light* light )
{
- // member declarations
- private:
-
- // public function declarations
- public:
- Writer() : IWriter() {}
- virtual ~Writer(){}
-
- /** This method will be called if an error in the loading process occurred and the loader cannot
- continue to to load. The writer should undo all operations that have been performed.
- @param errorMessage A message containing informations about the error that occurred.
- */
- virtual void cancel(const COLLADAFW::String& errorMessage){}
-
- /** This is the method called. The writer hast to prepare to receive data.*/
- virtual void start(){}
-
- /** This method is called after the last write* method. No other methods will be called after this.*/
- virtual void finish(){}
-
- /** When this method is called, the writer must write the global document asset.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeGlobalAsset ( const COLLADAFW::FileInfo* asset )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the entire visual scene.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeScene ( const COLLADAFW::Scene* scene )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the entire visual scene.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeVisualScene ( const COLLADAFW::VisualScene* visualScene )
- {
- return true;
- }
-
- /** When this method is called, the writer must handle all nodes contained in the
- library nodes.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeLibraryNodes ( const COLLADAFW::LibraryNodes* libraryNodes )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the geometry.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeGeometry ( const COLLADAFW::Geometry* geometry )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the material.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeMaterial( const COLLADAFW::Material* material )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the effect.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeEffect( const COLLADAFW::Effect* effect )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the camera.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeCamera( const COLLADAFW::Camera* camera )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the image.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeImage( const COLLADAFW::Image* image )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the light.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeLight( const COLLADAFW::Light* light )
- {
- return true;
- }
-
- /** Writes the animation.
- @return True on succeeded, false otherwise.*/
- virtual bool writeAnimation( const COLLADAFW::Animation* animation )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the AnimationList.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeAnimationList( const COLLADAFW::AnimationList* animationList )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the skin controller data.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeSkinControllerData( const COLLADAFW::SkinControllerData* skinControllerData )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the controller.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeController( const COLLADAFW::Controller* controller )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the formula.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeFormulas( const COLLADAFW::Formulas* formulas )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the formula.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeFormula( const COLLADAFW::Formula* formulas )
- {
- return true;
- }
-
- /** When this method is called, the writer must write the kinematics scene.
- @return The writer should return true, if writing succeeded, false otherwise.*/
- virtual bool writeKinematicsScene( const COLLADAFW::KinematicsScene* kinematicsScene )
- {
- return true;
- }
-
- // private function declarations
- private:
- /** Disable default copy ctor. */
- Writer( const Writer& pre );
- /** Disable default assignment operator. */
- const Writer& operator= ( const Writer& pre );
-
- };
+ return true;
+ }
+
+ /** Writes the animation.
+ @return True on succeeded, false otherwise.*/
+ virtual bool writeAnimation( const COLLADAFW::Animation* animation )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the AnimationList.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeAnimationList( const COLLADAFW::AnimationList* animationList )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the skin controller data.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeSkinControllerData( const COLLADAFW::SkinControllerData* skinControllerData )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the controller.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeController( const COLLADAFW::Controller* controller )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the formula.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeFormulas( const COLLADAFW::Formulas* formulas )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the formula.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeFormula( const COLLADAFW::Formula* formulas )
+ {
+ return true;
+ }
+
+ /** When this method is called, the writer must write the kinematics scene.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeKinematicsScene( const COLLADAFW::KinematicsScene* kinematicsScene )
+ {
+ return true;
+ }
+
+ // private function declarations
+private:
+/** Disable default copy ctor. */
+ Writer( const Writer& pre );
+/** Disable default assignment operator. */
+ const Writer& operator= ( const Writer& pre );
+
+};
#endif // ___WRITER_H__
2  COLLADAValidator/src/ValidationErrorHandler.cpp
View
@@ -7,6 +7,8 @@
#include "GeneratedSaxParserParserError.h"
+#include <string.h>
+
//--------------------------------------------------------------------
ValidationErrorHandler::ValidationErrorHandler()
: mHasHandledSaxParserError(false)
15 COLLADAValidator/src/main.cpp
View
@@ -12,14 +12,19 @@
#include "COLLADAFWRoot.h"
-#if defined(XMLPARSER_LIBXML)
-const char* programName = "COLLADAValidator_LibXML.exe";
-#elif defined(XMLPARSER_EXPAT)
-const char* programName = "COLLADAValidator_Expat.exe";
+#ifdef WIN32
+# if defined(XMLPARSER_LIBXML)
+ const char* programName = "COLLADAValidator_LibXML.exe";
+# elif defined(XMLPARSER_EXPAT)
+ const char* programName = "COLLADAValidator_Expat.exe";
+# else
+# error "No prepocesser flag set to chose the xml parser to use"
+# endif
#else
-# error "No prepocesser flag set to chose the xml parser to use"
+ const char* programName = "COLLADAValidator.exe";
#endif
+
bool hasHandledSaxParserError = false;
bool hasHandledSaxFWLError = false;
COLLADASaxFWL::COLLADAVersion version = COLLADASaxFWL::COLLADA_UNKNOWN;
21 Externals/LibXML/SConscript
View
@@ -0,0 +1,21 @@
+
+Import('env')
+
+libName = 'xml'
+
+srcDir = './'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+incDirs = ['include/']
+
+src = [ variantDir + str(p) for p in Glob('*.c') ]
+VariantDir(variant_dir=variantDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+
27 Externals/MathMLSolver/SConscript
View
@@ -0,0 +1,27 @@
+
+Import('env')
+
+libName = 'MathMLSolver'
+
+
+srcDirs = [ 'src/',
+ 'src/AST/']
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = [ 'include',
+ 'include/AST']
+
+src = []
+for srcDir in srcDirs:
+ src += [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+ VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
2  Externals/MathMLSolver/src/MathMLSymbolTable.cpp
View
@@ -3,6 +3,8 @@
#include "MathMLASTConstantExpression.h"
#include "MathMLError.h"
+#include <string.h>
+
namespace MathML
{
//---------------------------------------------------------------------------------
24 Externals/UTF/SConscript
View
@@ -0,0 +1,24 @@
+
+Import('env')
+
+libName = 'UTF'
+
+
+srcDirs = [ 'src/']
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/']
+
+src = []
+for srcDir in srcDirs:
+ src += [ variantDir + str(p) for p in Glob(srcDir + '*.c')]
+ VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
23 Externals/expat/SConscript
View
@@ -0,0 +1,23 @@
+
+Import('env')
+
+libName = 'expat'
+
+
+srcDir = 'lib/'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/']
+
+src = [ variantDir + str(p) for p in Glob(srcDir + '*.c')]
+VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+
22 Externals/pcre/SConscript
View
@@ -0,0 +1,22 @@
+
+Import('env')
+
+libName = 'pcre'
+
+
+srcDir = 'src/'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/']
+
+src = [ variantDir + str(p) for p in Glob(srcDir + '*.c')]
+VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
40 Externals/pcre/include/config_linux.h
View
@@ -0,0 +1,40 @@
+/* #undef HAVE_DIRENT_H */
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TYPES_H 1
+/* #undef HAVE_UNISTD_H */
+#define HAVE_WINDOWS_H 0
+
+/* #undef HAVE_TYPE_TRAITS_H */
+/* #undef HAVE_BITS_TYPE_TRAITS_H */
+
+/* #undef HAVE_BCOPY */
+#define HAVE_MEMMOVE 1
+#define HAVE_STRERROR 1
+/* #undef HAVE_STRTOLL */
+/* #undef HAVE_STRTOQ */
+#define HAVE__STRTOI64 1
+
+#define PCRE_STATIC 1
+
+/* #undef SUPPORT_UTF8 */
+/* #undef SUPPORT_UCP */
+/* #undef EBCDIC */
+/* #undef BSR_ANYCRLF */
+/* #undef NO_RECURSE */
+
+#define HAVE_LONG_LONG 1
+#define HAVE_UNSIGNED_LONG_LONG 1
+
+/* #undef SUPPORT_LIBBZ2 */
+/* #undef SUPPORT_LIBZ */
+/* #undef SUPPORT_LIBREADLINE */
+
+#define NEWLINE 10
+#define POSIX_MALLOC_THRESHOLD 10
+#define LINK_SIZE 2
+#define MATCH_LIMIT 10000000
+#define MATCH_LIMIT_RECURSION MATCH_LIMIT
+
+
+#define MAX_NAME_SIZE 32
+#define MAX_NAME_COUNT 10000
8 Externals/pcre/src/pcre_chartables.c
View
@@ -20,12 +20,14 @@ and dead code stripping is activated. This leads to link errors. Pulling in the
header ensures that the array gets flagged as "someone outside this compilation
unit might reference this" and so it will always be supplied to the linker. */
-#if (defined(WIN64) || defined(WIN32))
-# include "config_win.h"
+#if (defined(WIN64) || defined(WIN32))
+# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
#include "pcre_internal.h"
8 Externals/pcre/src/pcre_compile.c
View
@@ -41,12 +41,14 @@ POSSIBILITY OF SUCH DAMAGE.
/* This module contains the external function pcre_compile(), along with
supporting internal functions that are not used by other modules. */
-#if (defined(WIN64) || defined(WIN32))
-# include "config_win.h"
+#if (defined(WIN64) || defined(WIN32))
+# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
8 Externals/pcre/src/pcre_exec.c
View
@@ -42,12 +42,14 @@ POSSIBILITY OF SUCH DAMAGE.
pattern matching using an NFA algorithm, trying to mimic Perl as closely as
possible. There are also some static supporting functions. */
-#if (defined(WIN64) || defined(WIN32))
-# include "config_win.h"
+#if (defined(WIN64) || defined(WIN32))
+# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
8 Externals/pcre/src/pcre_globals.c
View
@@ -46,12 +46,14 @@ indirection. These values can be changed by the caller, but are shared between
all threads. However, when compiling for Virtual Pascal, things are done
differently, and global variables are not used (see pcre.in). */
-#if (defined(WIN64) || defined(WIN32))
-# include "config_win.h"
+#if (defined(WIN64) || defined(WIN32))
+# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
8 Externals/pcre/src/pcre_newline.c
View
@@ -47,12 +47,14 @@ and NLTYPE_ANY. The full list of Unicode newline characters is taken from
http://unicode.org/unicode/reports/tr18/. */
-#if (defined(WIN64) || defined(WIN32))
-# include "config_win.h"
+#if (defined(WIN64) || defined(WIN32))
+# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
8 Externals/pcre/src/pcre_tables.c
View
@@ -44,12 +44,14 @@ uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name
clashes with the library. */
-#if (defined(WIN64) || defined(WIN32))
-# include "config_win.h"
+#if (defined(WIN64) || defined(WIN32))
+# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
6 Externals/pcre/src/pcre_try_flipped.c
View
@@ -43,12 +43,14 @@ see if it was compiled with the opposite endianness. If so, it uses an
auxiliary local function to flip the appropriate bytes. */
-#if (defined(WIN64) || defined(WIN32))
+#if (defined(WIN64) || defined(WIN32))
# include "config_win.h"
#elif (defined(__APPLE__) || defined(OSMac_))
# include "config_mac.h"
+#elif defined(__linux__) || defined(__linux)
+# include "config_linux.h"
#elif defined(HAVE_CONFIG_H)
-# include "config.h"
+# include "config.h"
#endif
42 GeneratedSaxParser/SConscript
View
@@ -0,0 +1,42 @@
+
+Import('env')
+
+libName = 'GeneratedSaxParser'
+
+
+srcDir = 'src/'
+
+variantDir = env['objDir'] + env['configurationBaseName'] + env['xmlParserConfName']+ '/'
+outputDir = env['libDir'] + env['configurationBaseName'] + env['xmlParserConfName']+ '/'
+targetPath = outputDir + libName
+
+
+incDirs = ['include/',
+ '../COLLADABaseUtils/include/']
+
+src = [ variantDir + str(p) for p in Glob(srcDir + '*.cpp')]
+VariantDir(variant_dir=variantDir + srcDir, src_dir=srcDir, duplicate=False)
+
+# set xml parser specitic settings
+if (env['XMLPARSER'] == 'expat') or (env['XMLPARSER'] == 'expatnative'):
+ for f in src:
+ if f.endswith('GeneratedSaxParserLibxmlSaxParser.cpp'):
+ src.remove(f)
+else:
+ for f in src:
+ if f.endswith('GeneratedSaxParserExpatSaxParser.cpp'):
+ src.remove(f)
+
+if env['XMLPARSER'] == 'expat':
+ incDirs += ['../Externals/expat/lib/']
+elif env['XMLPARSER'] == 'libxml':
+ incDirs += ['../Externals/LibXML/include/']
+elif env['XMLPARSER'] == 'libxmlnative':
+ incDirs += ['/usr/include/libxml2']
+
+
+if env['SHAREDLIB']:
+ SharedLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+else:
+ StaticLibrary(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'])
+
125 SConstruct
View
@@ -1,45 +1,80 @@
-debug = True
-expat = True
-
-builddir = 'scons-build'
-
-srcdir = ['COLLADABaseUtils/src',
- 'COLLADABaseUtils/src/Math',
- 'COLLADAStreamWriter/src',
- 'COLLADAFramework/src',
- 'COLLADASaxFrameworkLoader/src',
- 'COLLADASaxFrameworkLoader/src/generated14',
- 'COLLADASaxFrameworkLoader/src/generated15',
- 'GeneratedSaxParser/src',
- 'Externals/MathMLSolver/src',
- 'Externals/MathMLSolver/src/AST',
- 'Externals/UTF/src']
-
-incdir = ['COLLADABaseUtils/include',
- 'COLLADAStreamWriter/include',
- 'COLLADAFramework/include',
- 'COLLADASaxFrameworkLoader/include',
- 'COLLADASaxFrameworkLoader/include/generated14',
- 'COLLADASaxFrameworkLoader/include/generated15',
- 'GeneratedSaxParser/include',
- 'Externals/MathMLSolver/include',
- 'Externals/MathMLSolver/include/AST',
- 'Externals/UTF/include']
-
-src = []
-for d in srcdir:
- src += [builddir + '/' + str(p) for p in Glob(d + '/*.cpp') + Glob(d + '/*.c')]
- BuildDir(build_dir=builddir + '/' + d, src_dir=d, duplicate=False)
-
-excl = ['COLLADASWSurface.cpp', 'MathMLASTFactory.cpp', 'GeneratedSaxParserLibxmlSaxParser.cpp' if expat else 'GeneratedSaxParserExpatSaxParser.cpp']
-for f in src:
- for e in excl:
- if f.endswith(e):
- src.remove(f)
-
-ccflags = ['-DGENERATEDSAXPARSER_XMLPARSER_EXPAT' if expat else '-DGENERATEDSAXPARSER_XMLPARSER_LIBXML', '-fsigned-char']
-
-if debug:
- ccflags += ['-O0', '-g3', '-ggdb3', '-fno-inline']
-
-Library(target='OpenCollada', source=src, CPPPATH=incdir, CCFLAGS=ccflags)
+import platform #Requiered to detect the current plattform
+
+
+Decider('MD5-timestamp')
+
+
+# define the variables the user can set on the command line
+vars = Variables('custom.py')
+vars.Add(BoolVariable('RELEASE', 'Set to build for release', 0))
+vars.Add(BoolVariable('PG', 'Set to build with -pg set for gcc for profiling', 0))
+vars.Add(BoolVariable('SHAREDLIB', 'Set to build shared libraries instead of static ones (untested).', 0))
+vars.Add(BoolVariable('PCRENATIVE',
+"""Set to build using the systems native pcre lib instead of the delivered lib. Uses same configuration dir for both configurations.
+""", 1))
+vars.Add(EnumVariable('XMLPARSER',
+"""Selects the xml parser to be used
+ libxml: Use libXML contained in OpenCOLLADA external sources
+ expat: Use expat contained in OpenCOLLADA external sources
+ libxmlNative: Use libXML deliverd with your OS. libXML and the corresponding development files need to be installed
+ expatNative: Use expat deliverd with your OS. expat and the corresponding development files need to be installed
+
+"""
+, 'libxmlnative', allowed_values=('libxml', 'expat', 'libxmlnative', 'expatnative'), ignorecase=2))
+vars.Add(BoolVariable('NOVALIDATION', 'Set to disable shema validation in sax frame work loader', 0))
+
+env=Environment( variables=vars )
+Help(vars.GenerateHelpText(env))
+
+if env['RELEASE']:
+ configurationName = 'release'
+ env['CPPFLAGS'] = ' -O2 -DNDEBUG'
+else:
+ configurationName = 'debug'
+ env['CPPFLAGS'] = ' -O0 -g3 -ggdb3 -fno-inline'
+
+if env['PG']:
+ configurationName += 'Pg'
+ env['CPPFLAGS'] += ' -pg'
+
+env['platformDir'] = env['PLATFORM'] + '/'
+env['architectureDir'] = platform.machine() + '/'
+env['configurationBaseName'] = env['platformDir'] + env['architectureDir'] + configurationName
+
+if (env['XMLPARSER'] == 'expat') or (env['XMLPARSER'] == 'expatnative'):
+ env['xmlParserConfName'] = 'expat'
+else:
+ env['xmlParserConfName'] = 'libxml'
+
+if env['NOVALIDATION']:
+ env['validationConfName'] = 'Novalidation'
+else:
+ env['validationConfName'] = ''
+
+env['objDir'] = 'obj/'
+env['libDir'] = 'lib/'
+env['binDir'] = 'bin/'
+
+
+SConscript(['COLLADABaseUtils/SConscript'], exports = 'env')
+SConscript(['Externals/MathMLSolver/SConscript'], exports = 'env')
+SConscript(['Externals/UTF/SConscript'], exports = 'env')
+if not env['PCRENATIVE']:
+ SConscript(['Externals/pcre/SConscript'], exports = 'env')
+
+
+if env['XMLPARSER'] == 'expat':
+ SConscript(['Externals/expat/SConscript'], exports = 'env')
+elif env['XMLPARSER'] == 'libxml':
+ SConscript(['Externals/LibXML/SConscript'], exports = 'env')
+
+SConscript(['COLLADAFramework/SConscript'], exports = 'env')
+
+SConscript(['GeneratedSaxParser/SConscript'], exports = 'env')
+SConscript(['COLLADASaxFrameworkLoader/SConscript'], exports = 'env')
+SConscript(['COLLADAStreamWriter/SConscript'], exports = 'env')
+
+SConscript(['COLLADAValidator/SConscript'], exports = 'env')
+
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.