Support for devtoolset-2, clang and c++11 improvement.
This commit is contained in:
parent
b98e6a968a
commit
37c8498962
|
@ -34,6 +34,7 @@ class Builder:
|
||||||
self._doBuild = True
|
self._doBuild = True
|
||||||
self._noCache = False
|
self._noCache = False
|
||||||
self._ninja = False
|
self._ninja = False
|
||||||
|
self._clang = False
|
||||||
self._devtoolset2 = False
|
self._devtoolset2 = False
|
||||||
self._qt5 = False
|
self._qt5 = False
|
||||||
self._enableShared = "ON"
|
self._enableShared = "ON"
|
||||||
|
@ -58,6 +59,7 @@ class Builder:
|
||||||
elif attribute == "doBuild": self._doBuild = value
|
elif attribute == "doBuild": self._doBuild = value
|
||||||
elif attribute == "noCache": self._noCache = value
|
elif attribute == "noCache": self._noCache = value
|
||||||
elif attribute == "ninja": self._ninja = value
|
elif attribute == "ninja": self._ninja = value
|
||||||
|
elif attribute == "clang": self._clang = value
|
||||||
elif attribute == "devtoolset2": self._devtoolset2 = value
|
elif attribute == "devtoolset2": self._devtoolset2 = value
|
||||||
elif attribute == "qt5": self._qt5 = value
|
elif attribute == "qt5": self._qt5 = value
|
||||||
elif attribute == "enableDoc": self._enableDoc = value
|
elif attribute == "enableDoc": self._enableDoc = value
|
||||||
|
@ -340,6 +342,9 @@ class Builder:
|
||||||
|
|
||||||
|
|
||||||
def _commandTemplate ( self, tools, projects, command ):
|
def _commandTemplate ( self, tools, projects, command ):
|
||||||
|
if self._clang:
|
||||||
|
self._environment[ 'CC' ] = '/usr/bin/clang'
|
||||||
|
self._environment[ 'CXX' ] = '/usr/bin/clang++'
|
||||||
if self._devtoolset2:
|
if self._devtoolset2:
|
||||||
self._environment[ 'BOOST_INCLUDEDIR' ] = '/opt/rh/devtoolset-2/root/usr/include'
|
self._environment[ 'BOOST_INCLUDEDIR' ] = '/opt/rh/devtoolset-2/root/usr/include'
|
||||||
self._environment[ 'BOOST_LIBRARYDIR' ] = '/opt/rh/devtoolset-2/root/usr/lib'
|
self._environment[ 'BOOST_LIBRARYDIR' ] = '/opt/rh/devtoolset-2/root/usr/lib'
|
||||||
|
|
|
@ -186,6 +186,7 @@ parser.add_option ( "--rm-build" , action="store_true" ,
|
||||||
parser.add_option ( "--devtoolset-2", action="store_true" , dest="devtoolset2" , help="Build against TUV Dev Toolset 2." )
|
parser.add_option ( "--devtoolset-2", action="store_true" , dest="devtoolset2" , help="Build against TUV Dev Toolset 2." )
|
||||||
parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." )
|
parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." )
|
||||||
parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." )
|
parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." )
|
||||||
|
parser.add_option ( "--clang" , action="store_true" , dest="clang" , help="Force use of Clang C/C++ compiler instead of system default." )
|
||||||
parser.add_option ( "--make" , action="store" , type="string", dest="makeArguments", help="Arguments to pass to make (ex: \"-j4 install\")." )
|
parser.add_option ( "--make" , action="store" , type="string", dest="makeArguments", help="Arguments to pass to make (ex: \"-j4 install\")." )
|
||||||
parser.add_option ( "--project" , action="append" , type="string", dest="projects" , help="The name of a project to build (may appears any number of time)." )
|
parser.add_option ( "--project" , action="append" , type="string", dest="projects" , help="The name of a project to build (may appears any number of time)." )
|
||||||
parser.add_option ( "-t", "--tool" , action="append" , type="string", dest="tools" , help="The name of a tool to build (may appears any number of time)." )
|
parser.add_option ( "-t", "--tool" , action="append" , type="string", dest="tools" , help="The name of a tool to build (may appears any number of time)." )
|
||||||
|
@ -257,6 +258,7 @@ else:
|
||||||
if options.noCache: builder.noCache = True
|
if options.noCache: builder.noCache = True
|
||||||
if options.rmBuild: builder.rmBuild = True
|
if options.rmBuild: builder.rmBuild = True
|
||||||
if options.ninja: builder.ninja = True
|
if options.ninja: builder.ninja = True
|
||||||
|
if options.clang: builder.clang = True
|
||||||
if options.devtoolset2: builder.devtoolset2 = True
|
if options.devtoolset2: builder.devtoolset2 = True
|
||||||
if options.qt5: builder.qt5 = True
|
if options.qt5: builder.qt5 = True
|
||||||
if options.makeArguments: builder.makeArguments = options.makeArguments
|
if options.makeArguments: builder.makeArguments = options.makeArguments
|
||||||
|
|
|
@ -32,6 +32,7 @@ def stripPath ( pathName ):
|
||||||
|
|
||||||
|
|
||||||
def guessOs ():
|
def guessOs ():
|
||||||
|
useDevtoolset2 = False
|
||||||
osSlsoc6x_64 = re.compile (".*Linux.*el6.*x86_64.*")
|
osSlsoc6x_64 = re.compile (".*Linux.*el6.*x86_64.*")
|
||||||
osSlsoc6x = re.compile (".*Linux.*(el|slsoc)6.*")
|
osSlsoc6x = re.compile (".*Linux.*(el|slsoc)6.*")
|
||||||
osSLSoC5x_64 = re.compile (".*Linux.*el5.*x86_64.*")
|
osSLSoC5x_64 = re.compile (".*Linux.*el5.*x86_64.*")
|
||||||
|
@ -54,12 +55,15 @@ def guessOs ():
|
||||||
|
|
||||||
libDir="lib"
|
libDir="lib"
|
||||||
if osSlsoc6x_64.match(lines[0]):
|
if osSlsoc6x_64.match(lines[0]):
|
||||||
osType = "Linux.slsoc6x_64"
|
osType = "Linux.slsoc6x_64"
|
||||||
libDir = "lib64"
|
libDir = "lib64"
|
||||||
elif osSlsoc6x.match(lines[0]): osType = "Linux.slsoc6x"
|
useDevtoolset2 = True
|
||||||
|
elif osSlsoc6x.match(lines[0]):
|
||||||
|
osType = "Linux.slsoc6x"
|
||||||
|
useDevtoolset2 = True
|
||||||
elif osSLSoC5x_64.match(lines[0]):
|
elif osSLSoC5x_64.match(lines[0]):
|
||||||
osType = "Linux.SLSoC5x_64"
|
osType = "Linux.SLSoC5x_64"
|
||||||
libDir = "lib64"
|
libDir = "lib64"
|
||||||
elif osSLSoC5x.match(lines[0]):
|
elif osSLSoC5x.match(lines[0]):
|
||||||
osType = "Linux.SLSoC5x"
|
osType = "Linux.SLSoC5x"
|
||||||
elif osUbuntu1004.match(lines[0]):
|
elif osUbuntu1004.match(lines[0]):
|
||||||
|
@ -99,17 +103,17 @@ def guessOs ():
|
||||||
#print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1]
|
#print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1]
|
||||||
#print " (using: \"%s\")" % osType
|
#print " (using: \"%s\")" % osType
|
||||||
|
|
||||||
return (osType,libDir)
|
return (osType,libDir,useDevtoolset2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
(osType,libDir) = guessOs()
|
osType,libDir,useDevtoolset2 = guessOs()
|
||||||
buildType = "Release"
|
buildType = "Release"
|
||||||
linkType = "Shared"
|
linkType = "Shared"
|
||||||
rootDir = None
|
rootDir = None
|
||||||
|
|
||||||
parser = optparse.OptionParser ()
|
parser = optparse.OptionParser ()
|
||||||
# Build relateds.
|
# Build relateds.
|
||||||
|
@ -136,23 +140,21 @@ if __name__ == "__main__":
|
||||||
strippedPythonPath = stripPath ( "PYTHONPATH" )
|
strippedPythonPath = stripPath ( "PYTHONPATH" )
|
||||||
|
|
||||||
shellScriptSh = \
|
shellScriptSh = \
|
||||||
'echo "%(MESSAGE)s";\n' \
|
'echo "%(MESSAGE)s";' \
|
||||||
'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \
|
'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \
|
||||||
'PATH="%(PATH)s";\n' \
|
'PATH="%(PATH)s";' \
|
||||||
'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n' \
|
'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";' \
|
||||||
'CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n' \
|
'CORIOLIS_TOP="%(CORIOLIS_TOP)s";' \
|
||||||
'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \
|
'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";' \
|
||||||
'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n' \
|
'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;'
|
||||||
'hash -r;\n'
|
|
||||||
|
|
||||||
shellScriptCsh = \
|
shellScriptCsh = \
|
||||||
'echo "%(MESSAGE)s";\n' \
|
'echo "%(MESSAGE)s";' \
|
||||||
'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \
|
'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \
|
||||||
'setenv PATH "%(PATH)s";\n' \
|
'setenv PATH "%(PATH)s";' \
|
||||||
'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n' \
|
'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";' \
|
||||||
'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n' \
|
'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";' \
|
||||||
'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \
|
'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";'
|
||||||
'rehash\n;'
|
|
||||||
|
|
||||||
buildDir = buildType + "." + linkType
|
buildDir = buildType + "." + linkType
|
||||||
scriptDir = os.path.dirname ( os.path.abspath(__file__) )
|
scriptDir = os.path.dirname ( os.path.abspath(__file__) )
|
||||||
|
@ -197,31 +199,35 @@ if __name__ == "__main__":
|
||||||
strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath
|
strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath
|
||||||
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
|
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
|
||||||
|
|
||||||
shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \
|
shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";' \
|
||||||
'export PYTHONPATH;\n'
|
'export PYTHONPATH;'
|
||||||
shellScriptCsh += 'setenv PYTHONPATH "%(PYTHONPATH)s";'
|
shellScriptCsh += 'setenv PYTHONPATH "%(PYTHONPATH)s";'
|
||||||
|
|
||||||
if osType == "Darwin":
|
if osType == "Darwin":
|
||||||
shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \
|
shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' \
|
||||||
'export DYLD_LIBRARY_PATH;\n'
|
'export DYLD_LIBRARY_PATH;'
|
||||||
shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n'
|
shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";'
|
||||||
else:
|
else:
|
||||||
shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \
|
shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' \
|
||||||
'export LD_LIBRARY_PATH;\n'
|
'export LD_LIBRARY_PATH;'
|
||||||
shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n'
|
shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";'
|
||||||
|
|
||||||
shellScriptSh += "hash -r;\n"
|
shellScriptSh += "hash -r;"
|
||||||
shellScriptCsh += "rehash;\n"
|
shellScriptCsh += "rehash;"
|
||||||
|
|
||||||
if options.csh: shellScript = shellScriptCsh
|
if options.csh: shellScript = shellScriptCsh
|
||||||
else: shellScript = shellScriptSh
|
else: shellScript = shellScriptSh
|
||||||
|
|
||||||
print shellScript % { "PATH" : strippedPath
|
evalScript = shellScript % { "PATH" : strippedPath
|
||||||
, "LD_LIBRARY_PATH" : strippedLibraryPath
|
, "LD_LIBRARY_PATH" : strippedLibraryPath
|
||||||
, "PYTHONPATH" : strippedPythonPath
|
, "PYTHONPATH" : strippedPythonPath
|
||||||
, "BOOTSTRAP_TOP" : coriolisTop
|
, "BOOTSTRAP_TOP" : coriolisTop
|
||||||
, "CORIOLIS_TOP" : coriolisTop
|
, "CORIOLIS_TOP" : coriolisTop
|
||||||
, "SYSCONF_DIR" : sysconfDir
|
, "SYSCONF_DIR" : sysconfDir
|
||||||
, "MESSAGE" : shellMessage
|
, "MESSAGE" : shellMessage
|
||||||
, "buildDir" : buildDir
|
, "buildDir" : buildDir
|
||||||
}
|
}
|
||||||
|
if useDevtoolset2:
|
||||||
|
evalScript = '%s scl enable devtoolset-2 ${SHELL}' % evalScript
|
||||||
|
|
||||||
|
print evalScript
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2012-2010, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
|
@ -154,7 +153,7 @@ extern "C" {
|
||||||
// // we allocate dynamically (so it doesn't get destructed at the function's
|
// // we allocate dynamically (so it doesn't get destructed at the function's
|
||||||
// // exit).
|
// // exit).
|
||||||
// DrawingStyle* empty = new DrawingStyle();
|
// DrawingStyle* empty = new DrawingStyle();
|
||||||
// memcpy((void*)&(pyDs->_object),(void*)empty,sizeof(tr1::shared_ptr<RawDrawingStyle>));
|
// memcpy((void*)&(pyDs->_object),(void*)empty,sizeof(shared_ptr<RawDrawingStyle>));
|
||||||
|
|
||||||
// //cerr << "ptr:" << pyDs->_object.get()
|
// //cerr << "ptr:" << pyDs->_object.get()
|
||||||
// // << " use_count:" << pyDs->_object.use_count() << endl;
|
// // << " use_count:" << pyDs->_object.use_count() << endl;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <tr1/memory>
|
#include <memory>
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
@ -54,7 +54,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::unary_function;
|
using std::unary_function;
|
||||||
using std::tr1::shared_ptr;
|
using std::shared_ptr;
|
||||||
|
|
||||||
class Technology;
|
class Technology;
|
||||||
class BasicLayer;
|
class BasicLayer;
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// +-----------------------------------------------------------------+
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
// | V L S I B a c k e n d D a t a - B a s e |
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
// | |
|
// | |
|
||||||
|
@ -17,16 +11,13 @@
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Header : "./Ruler.h" |
|
// | C++ Header : "./Ruler.h" |
|
||||||
// | *************************************************************** |
|
// +-----------------------------------------------------------------+
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __HURRICANE_RULER__
|
#ifndef HURRICANE_RULER_H
|
||||||
#define __HURRICANE_RULER__
|
#define HURRICANE_RULER_H
|
||||||
|
|
||||||
#include <tr1/memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "hurricane/Point.h"
|
#include "hurricane/Point.h"
|
||||||
|
@ -63,7 +54,7 @@ namespace Hurricane {
|
||||||
inline void Ruler::setExtremity ( const Point& extremity ) { _extremity = extremity; }
|
inline void Ruler::setExtremity ( const Point& extremity ) { _extremity = extremity; }
|
||||||
inline bool Ruler::intersect ( const Box& area ) const { return area.intersect(Box(_origin,getAngle())); }
|
inline bool Ruler::intersect ( const Box& area ) const { return area.intersect(Box(_origin,getAngle())); }
|
||||||
|
|
||||||
typedef std::set< std::tr1::shared_ptr<Ruler> > RulerSet;
|
typedef std::set< std::shared_ptr<Ruler> > RulerSet;
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// +-----------------------------------------------------------------+
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | H U R R I C A N E |
|
// | H U R R I C A N E |
|
||||||
// | V L S I B a c k e n d D a t a - B a s e |
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
// | |
|
// | |
|
||||||
|
@ -17,14 +11,11 @@
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Header : "./RulerCommand.h" |
|
// | C++ Header : "./RulerCommand.h" |
|
||||||
// | *************************************************************** |
|
// +-----------------------------------------------------------------+
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __HURRICANE_RULER_COMMAND__
|
#ifndef HURRICANE_RULER_COMMAND_H
|
||||||
#define __HURRICANE_RULER_COMMAND__
|
#define HURRICANE_RULER_COMMAND_H
|
||||||
|
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
|
@ -48,9 +39,9 @@ namespace Hurricane {
|
||||||
RulerCommand ( const RulerCommand& );
|
RulerCommand ( const RulerCommand& );
|
||||||
RulerCommand& operator= ( const RulerCommand& );
|
RulerCommand& operator= ( const RulerCommand& );
|
||||||
private:
|
private:
|
||||||
static string _name;
|
static string _name;
|
||||||
std::tr1::shared_ptr<Ruler> _ruler;
|
std::shared_ptr<Ruler> _ruler;
|
||||||
bool _drawing;
|
bool _drawing;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ namespace Utilities {
|
||||||
|
|
||||||
Path& Path::operator= ( const Path& other )
|
Path& Path::operator= ( const Path& other )
|
||||||
{
|
{
|
||||||
vector<std::string>().swap( _elements );
|
_elements.swap( vector<std::string>() );
|
||||||
_elements = other._elements;
|
_elements = other._elements;
|
||||||
_flags = other._flags;
|
_flags = other._flags;
|
||||||
_pathcache = other._pathcache;
|
_pathcache = other._pathcache;
|
||||||
|
|
Loading…
Reference in New Issue