From: <mth...@us...> - 2009-05-31 23:53:38
|
Revision: 9946 http://openmsx.svn.sourceforge.net/openmsx/?rev=9946&view=rev Author: mthuurne Date: 2009-05-31 23:53:36 +0000 (Sun, 31 May 2009) Log Message: ----------- Replaced runTclConfigCommand() by evalTclConfigExpr(), since we only use it for evaluating expressions. Also use the "eval" statement to ensure results that contain ${TCL_SOMETHING} are expanded again. We assume one "eval" step is sufficient, as the rest of the world uses that as well. Modified Paths: -------------- openmsx/trunk/build/libraries.py Modified: openmsx/trunk/build/libraries.py =================================================================== --- openmsx/trunk/build/libraries.py 2009-05-31 19:27:38 UTC (rev 9945) +++ openmsx/trunk/build/libraries.py 2009-05-31 23:53:36 UTC (rev 9946) @@ -11,7 +11,7 @@ # Conclusion: We have to specify the full path to each library that should be # linked statically. -from executils import captureStdout +from executils import captureStdout, shjoin from os import listdir from os.path import isdir, isfile @@ -389,7 +389,7 @@ return tclConfig @classmethod - def runTclConfigCommand(cls, platform, distroRoot, command, description): + def evalTclConfigExpr(cls, platform, distroRoot, expr, description): tclConfig = cls.getTclConfig(platform, distroRoot) if tclConfig is None: return None @@ -398,9 +398,9 @@ print >> log, 'Getting Tcl %s...' % description text = captureStdout( log, - "sh -c '. %s && %s'" % ( - tclConfig, command - ) + shjoin([ + 'sh', '-c', '. %s && eval \'echo "%s"\'' % (tclConfig, expr) + ]) ) finally: log.close() @@ -408,10 +408,10 @@ @classmethod def getCompileFlags(cls, platform, linkStatic, distroRoot): - return cls.runTclConfigCommand( + return cls.evalTclConfigExpr( platform, distroRoot, - 'echo "${TCL_DEFS} ${TCL_INCLUDE_SPEC}"', + '${TCL_DEFS} ${TCL_INCLUDE_SPEC}', 'compile flags' ) @@ -420,10 +420,10 @@ # Tcl can be built as a shared or as a static library, but not both. # Check whether the library type of Tcl matches the one we want. wantShared = not linkStatic or cls.isSystemLibrary(platform) - tclShared = cls.runTclConfigCommand( + tclShared = cls.evalTclConfigExpr( platform, distroRoot, - 'echo "${TCL_SHARED_BUILD}"', + '${TCL_SHARED_BUILD}', 'library type (shared/static)' ) log = open('derived/tcl-search.log', 'a') @@ -453,27 +453,26 @@ # Now get the link flags. if wantShared: - return cls.runTclConfigCommand( + return cls.evalTclConfigExpr( platform, distroRoot, - 'echo "${TCL_LIB_SPEC}"', + '${TCL_LIB_SPEC}', 'dynamic link flags' ) else: - return cls.runTclConfigCommand( + return cls.evalTclConfigExpr( platform, distroRoot, - 'echo "${TCL_EXEC_PREFIX}/lib/${TCL_LIB_FILE} ${TCL_LIBS}"', + '${TCL_EXEC_PREFIX}/lib/${TCL_LIB_FILE} ${TCL_LIBS}', 'static link flags' ) @classmethod def getVersion(cls, platform, linkStatic, distroRoot): - return cls.runTclConfigCommand( + return cls.evalTclConfigExpr( platform, distroRoot, - 'echo "${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}' - '${TCL_PATCH_LEVEL}"', + '${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}', 'version' ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |