Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
600 lines (565 sloc) 18.6 KB
#! -*- python -*-
#
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import make_nacl_env
import nacl_utils
import shutil
import os
nacl_env = make_nacl_env.NaClEnvironment(
use_c_plus_plus_libs=True,
nacl_platform=os.getenv('NACL_TARGET_PLATFORM'))
fmod_include = os.getenv('FMOD_CHROME_SDK_ROOT') + '/api/inc';
fmod_library = os.getenv('FMOD_CHROME_SDK_ROOT') + '/api/lib/' + os.getenv('NACL_TARGET_PLATFORM') + '/win_x86_newlib/x86-';
Repository ( "../3rdparty", "../src", "src" )
lua_sources = [ os.path.join( 'lua-5.1.3/src', src_file ) for src_file in [
'lapi.c',
'lauxlib.c',
'lbaselib.c',
'lcode.c',
'ldblib.c',
'ldebug.c',
'ldo.c',
'ldump.c',
'lfunc.c',
'lgc.c',
'linit.c',
'liolib.c',
'llex.c',
'lmathlib.c',
'lmem.c',
'loadlib.c',
'lobject.c',
'lopcodes.c',
'loslib.c',
'lparser.c',
'lstate.c',
'lstring.c',
'lstrlib.c',
'ltable.c',
'ltablib.c',
'ltm.c',
'lundump.c',
'lvm.c',
'lzio.c',
'print.c',
]]
freetype_sources = [ os.path.join( 'freetype-2.4.4/src', src_file ) for src_file in [
'autofit/autofit.c',
'bdf/bdf.c',
'cff/cff.c',
'base/ftbase.c',
'base/ftbitmap.c',
'cache/ftcache.c',
'base/ftfstype.c',
'base/ftgasp.c',
'base/ftglyph.c',
'gzip/ftgzip.c',
'base/ftinit.c',
'lzw/ftlzw.c',
'base/ftstroke.c',
'base/ftsystem.c',
'smooth/smooth.c',
'base/ftbbox.c',
'base/ftgxval.c',
'base/ftlcdfil.c',
'base/ftmm.c',
'base/ftotval.c',
'base/ftpatent.c',
'base/ftpfr.c',
'base/ftsynth.c',
'base/fttype1.c',
'base/ftwinfnt.c',
'base/ftxf86.c',
'pcf/pcf.c',
'pfr/pfr.c',
'psaux/psaux.c',
'pshinter/pshinter.c',
'psnames/psmodule.c',
'raster/raster.c',
'sfnt/sfnt.c',
'truetype/truetype.c',
'type1/type1.c',
'cid/type1cid.c',
'type42/type42.c',
'winfonts/winfnt.c',
]]
zlib_sources = [ os.path.join( 'zlib-1.2.3', src_file ) for src_file in [
'adler32.c' ,
'compress.c' ,
'crc32.c' ,
'deflate.c' ,
'gzio.c' ,
'infback.c' ,
'inffast.c' ,
'inflate.c' ,
'inftrees.c' ,
'trees.c' ,
'uncompr.c' ,
'zutil.c' ,
]]
tinyxml_sources = [ os.path.join( 'tinyxml', src_file ) for src_file in [
'tinystr.cpp',
'tinyxml.cpp',
'tinyxmlerror.cpp',
'tinyxmlparser.cpp',
]]
jansson_sources = [ os.path.join( 'jansson-2.1/src', src_file ) for src_file in [
'dump.c',
'error.c',
'hashtable.c',
'load.c',
'memory.c',
'pack_unpack.c',
'strbuffer.c',
'utf.c',
'value.c',
]]
expat_sources = [ os.path.join( 'expat-2.0.1/lib', src_file ) for src_file in [
'xmlparse.c',
'xmlrole.c',
'xmltok.c',
'xmltok_impl.c',
'xmltok_ns.c',
]]
libpng_sources = [ os.path.join( 'lpng140', src_file ) for src_file in [
'example.c' ,
'png.c' ,
'pngerror.c',
'pngget.c' ,
'pngmem.c' ,
'pngpread.c',
'pngread.c' ,
'pngrio.c' ,
'pngrtran.c',
'pngrutil.c',
'pngset.c' ,
'pngtrans.c',
'pngwio.c' ,
'pngwrite.c',
'pngwtran.c',
'pngwutil.c',
]]
libjpg_sources = [ os.path.join( 'jpeg-8c', src_file ) for src_file in [
'jcapimin.c' ,
'jcapistd.c' ,
'jdapimin.c' ,
'jdapistd.c' ,
'jcomapi.c' ,
'jcparam.c' ,
'jctrans.c' ,
'jdtrans.c' ,
'jcinit.c' ,
'jcmaster.c' ,
'jcmainct.c' ,
'jcprepct.c' ,
'jccoefct.c' ,
'jccolor.c' ,
'jcsample.c' ,
'jcdctmgr.c' ,
'jfdctint.c' ,
'jfdctfst.c' ,
'jfdctflt.c' ,
'jchuff.c' ,
'jcarith.c' ,
'jcmarker.c' ,
'jdatadst.c' ,
'jdmaster.c' ,
'jdinput.c' ,
'jdmainct.c' ,
'jdcoefct.c' ,
'jdpostct.c' ,
'jdmarker.c' ,
'jdhuff.c' ,
'jdarith.c' ,
'jddctmgr.c' ,
'jidctint.c' ,
'jidctfst.c' ,
'jidctflt.c' ,
'jdsample.c' ,
'jdcolor.c' ,
'jdmerge.c' ,
'jquant1.c' ,
'jquant2.c' ,
'jdatasrc.c' ,
'jaricom.c' ,
'jerror.c' ,
'jmemmgr.c' ,
'jutils.c' ,
'jmemnobs.c' ,
]]
contrib_sources = [ os.path.join( 'contrib', src_file ) for src_file in [
'utf8.c' ,
'whirlpool.c',
]]
tlsf_sources = [ os.path.join( 'tlsf-2.0', src_file ) for src_file in [
'tlsf.c' ,
]]
zlcore_sources = [ os.path.join( 'zlcore', src_file ) for src_file in [
'zl_mutex.cpp',
'zl_util.cpp',
'zl_vfscanf.cpp',
'zlcore.cpp',
'ZLDirectoryItr.cpp',
'ZLFile.cpp',
'ZLFileSystem.cpp',
'ZLVirtualPath.cpp',
'ZLZipArchive.cpp',
'ZLZipStream.cpp',
]]
box2d_path = os.path.join( 'box2d-2.2.1', 'Box2D' )
box2d_sources = [ os.path.join( box2d_path, src_file ) for src_file in [
'Collision/b2BroadPhase.cpp',
'Collision/b2CollideCircle.cpp',
'Collision/b2CollideEdge.cpp',
'Collision/b2CollidePolygon.cpp',
'Collision/b2Collision.cpp',
'Collision/b2Distance.cpp',
'Collision/b2DynamicTree.cpp',
'Collision/b2TimeOfImpact.cpp',
'Collision/Shapes/b2ChainShape.cpp',
'Collision/Shapes/b2CircleShape.cpp',
'Collision/Shapes/b2EdgeShape.cpp',
'Collision/Shapes/b2PolygonShape.cpp',
'Common/b2BlockAllocator.cpp',
'Common/b2Draw.cpp',
'Common/b2Math.cpp',
'Common/b2Settings.cpp',
'Common/b2StackAllocator.cpp',
'Common/b2Timer.cpp',
'Dynamics/b2Body.cpp',
'Dynamics/b2ContactManager.cpp',
'Dynamics/b2Fixture.cpp',
'Dynamics/b2Island.cpp',
'Dynamics/b2World.cpp',
'Dynamics/b2WorldCallbacks.cpp',
'Dynamics/Joints/b2DistanceJoint.cpp',
'Dynamics/Joints/b2FrictionJoint.cpp',
'Dynamics/Joints/b2GearJoint.cpp',
'Dynamics/Joints/b2Joint.cpp',
'Dynamics/Joints/b2MouseJoint.cpp',
'Dynamics/Joints/b2PrismaticJoint.cpp',
'Dynamics/Joints/b2PulleyJoint.cpp',
'Dynamics/Joints/b2RevoluteJoint.cpp',
'Dynamics/Joints/b2RopeJoint.cpp',
'Dynamics/Joints/b2WeldJoint.cpp',
'Dynamics/Joints/b2WheelJoint.cpp',
'Dynamics/Contacts/b2ChainAndCircleContact.cpp',
'Dynamics/Contacts/b2ChainAndPolygonContact.cpp',
'Dynamics/Contacts/b2CircleContact.cpp',
'Dynamics/Contacts/b2Contact.cpp',
'Dynamics/Contacts/b2ContactSolver.cpp',
'Dynamics/Contacts/b2EdgeAndCircleContact.cpp',
'Dynamics/Contacts/b2EdgeAndPolygonContact.cpp',
'Dynamics/Contacts/b2PolygonAndCircleContact.cpp',
'Dynamics/Contacts/b2PolygonContact.cpp',
'Rope/b2Rope.cpp',
]]
uslcore_sources = [ os.path.join( 'uslscore', src_file ) for src_file in [
'STLString.cpp' ,
'USAdapterInfo_posix.cpp' ,
'USBase64Reader.cpp' ,
'USBase64Writer.cpp' ,
'USBase64Encoder.cpp' ,
'USBox.cpp' ,
'USByteStream.cpp' ,
'USCgt.cpp' ,
'USColor.cpp' ,
'USCurve.cpp' ,
'USData.cpp' ,
'USDataIOTask.cpp' ,
'USDeflateReader.cpp' ,
'USDeflateWriter.cpp' ,
'USDeviceTime_nacl.cpp' ,
'USDirectoryItr.cpp' ,
'USDistance.cpp' ,
'USFileStream.cpp' ,
'USFileSys.cpp' ,
'USFrustum.cpp' ,
'USHashWriterWhirlpool.cpp',
'USHashWriterSHA512.cpp' ,
'USHashWriterSHA384.cpp' ,
'USHashWriterSHA256.cpp' ,
'USHashWriterSHA224.cpp' ,
'USHashWriterSHA1.cpp' ,
'USHashWriterMD5.cpp' ,
'USHashWriterCRC32.cpp' ,
'USHashWriterAdler32.cpp' ,
'USHashWriter.cpp' ,
'USHexWriter.cpp' ,
'USHexReader.cpp' ,
'USHexDump.cpp' ,
'USInterpolate.cpp' ,
'USIntersect.cpp' ,
'USLexStream.cpp' ,
'USLog.cpp' ,
'uslscore-pch.cpp' ,
'USMemStream.cpp' ,
'USMercator.cpp' ,
'USMutex.cpp' ,
'USMutex_posix.cpp' ,
'USParser.cpp' ,
'USPlane.cpp' ,
'USPolar.cpp' ,
'USPrism.cpp' ,
'USQuad.cpp' ,
'USQuadCoord.cpp' ,
'USQuaternion.cpp' ,
'USRhombus.cpp' ,
'USStream.cpp' ,
'USStreamReader.cpp' ,
'USStreamWriter.cpp' ,
'USSurface2D.cpp' ,
'USSyntaxNode.cpp' ,
'USSyntaxScanner.cpp' ,
'USTask.cpp' ,
'USTaskThread.cpp' ,
'USThread.cpp' ,
'USThread_posix.cpp' ,
'USTrig.cpp' ,
'USTypedPtr.cpp' ,
'USUnique_linux.cpp' ,
'USXmlReader.cpp' ,
'USZip.cpp' ,
'USZipFile.cpp' ,
]]
aku_sources = [ os.path.join('aku', src_file) for src_file in [
'AKU.cpp',
'AKU-fmod-ex.cpp',
]]
moai_sources = [ os.path.join('moaicore', src_file) for src_file in [
'MOAIAction.cpp' ,
'MOAIActionMgr.cpp' ,
'MOAIAnim.cpp' ,
'MOAIAnimCurve.cpp' ,
'MOAIAnimCurveBase.cpp' ,
'MOAIAnimCurveQuat.cpp' ,
'MOAIAnimCurveVec.cpp' ,
'MOAIBitmapFontReader.cpp' ,
'MOAIBlendMode.cpp' ,
'MOAIBlocker.cpp' ,
'MOAIBoundsDeck.cpp' ,
'MOAIBox2DArbiter.cpp' ,
'MOAIBox2DBody.cpp' ,
'MOAIBox2DDebugDraw.cpp' ,
'MOAIBox2DDistanceJoint.cpp' ,
'MOAIBox2DFixture.cpp' ,
'MOAIBox2DFrictionJoint.cpp' ,
'MOAIBox2DGearJoint.cpp' ,
'MOAIBox2DJoint.cpp' ,
'MOAIBox2DMouseJoint.cpp' ,
'MOAIBox2DPrismaticJoint.cpp' ,
'MOAIBox2DPulleyJoint.cpp' ,
'MOAIBox2DRevoluteJoint.cpp' ,
'MOAIBox2DRopeJoint.cpp' ,
'MOAIBox2DWeldJoint.cpp' ,
'MOAIBox2DWheelJoint.cpp' ,
'MOAIBox2DWorld.cpp' ,
'MOAIButtonSensor.cpp' ,
'MOAICamera.cpp' ,
'MOAICameraAnchor2D.cpp' ,
'MOAICameraFitter2D.cpp' ,
'MOAICanary.cpp' ,
'MOAIColor.cpp' ,
'MOAICompassSensor.cpp' ,
'moaicore-pch.cpp' ,
'moaicore.cpp' ,
'MOAICp.cpp' ,
'MOAICpArbiter.cpp' ,
'MOAICpBody.cpp' ,
'MOAICpConstraint.cpp' ,
'MOAICpDebugDraw.cpp' ,
'MOAICpShape.cpp' ,
'MOAICpSpace.cpp' ,
'MOAIDataBuffer.cpp' ,
'MOAIDataBufferStream.cpp' ,
'MOAIDataIOAction.cpp' ,
'MOAIDebugLines.cpp' ,
'MOAIDeck.cpp' ,
'MOAIDeckRemapper.cpp' ,
'MOAIDeserializer.cpp' ,
'MOAIDraw.cpp' ,
'MOAIEaseDriver.cpp' ,
'MOAIEaseType.cpp' ,
'MOAIEnvironment.cpp' ,
'MOAIEventSource.cpp' ,
'MOAIFileStream.cpp' ,
'MOAIFileSystem.cpp' ,
'MOAIFont.cpp' ,
'MOAIFont_bmfont.cpp' ,
'MOAIFoo.cpp' ,
'MOAIFooMgr.cpp' ,
'MOAIFontReader.cpp' ,
'MOAIFrameBuffer.cpp' ,
'MOAIFreeTypeFontReader.cpp' ,
'MOAIGfxDevice.cpp' ,
'MOAIGfxQuad2D.cpp' ,
'MOAIGfxQuadDeck2D.cpp' ,
'MOAIGfxQuadListDeck2D.cpp' ,
'MOAIGfxResource.cpp' ,
'MOAIGlobals.cpp' ,
'MOAIGlyph.cpp' ,
'MOAIGlyphCache.cpp' ,
'MOAIGlyphCacheBase.cpp' ,
'MOAIGlyphCachePage.cpp' ,
'MOAIGlyphSet.cpp' ,
'MOAIGrid.cpp' ,
'MOAIGridDeck2D.cpp' ,
'MOAIGridPathGraph.cpp' ,
'MOAIGridSpace.cpp' ,
'MOAIHashWriter.cpp' ,
'MOAIHttpTaskBase.cpp' ,
'MOAIHttpTaskNaCl.cpp' ,
'MOAIImage.cpp' ,
'MOAIImageTexture.cpp' ,
'MOAIImage-jpg.cpp' ,
'MOAIImage-png.cpp' ,
'MOAIIndexBuffer.cpp' ,
'MOAIInputDevice.cpp' ,
'MOAIInputMgr.cpp' ,
'MOAIJoystickSensor.cpp' ,
'MOAIJsonParser.cpp' ,
'MOAIKeyboardSensor.cpp' ,
'MOAILayer.cpp' ,
'MOAILayerBridge.cpp' ,
'MOAILayoutFrame.cpp' ,
'MOAILocationSensor.cpp' ,
'MOAILogMessages.cpp' ,
'MOAILogMgr.cpp' ,
'MOAILuaObject.cpp' ,
'MOAILuaRef.cpp' ,
'MOAILuaRuntime.cpp' ,
'MOAILuaState.cpp' ,
'MOAILuaStateHandle.cpp' ,
'MOAIMesh.cpp' ,
'MOAIMemStream.cpp' ,
'MOAIMotionSensor.cpp' ,
'MOAIMultiTexture.cpp' ,
'MOAINode.cpp' ,
'MOAINodeMgr.cpp' ,
'MOAIObject.cpp' ,
'MOAIParser.cpp' ,
'MOAIParticleCallbackPlugin.cpp' ,
'MOAIParticleDistanceEmitter.cpp',
'MOAIParticleEmitter.cpp' ,
'MOAIParticleForce.cpp' ,
'MOAIParticlePexPlugin.cpp' ,
'MOAIParticlePlugin.cpp' ,
'MOAIParticleScript.cpp' ,
'MOAIParticleState.cpp' ,
'MOAIParticleSystem.cpp' ,
'MOAIParticleTimedEmitter.cpp' ,
'MOAIPartition.cpp' ,
'MOAIPartitionCell.cpp' ,
'MOAIPartitionLevel.cpp' ,
'MOAIPartitionResultBuffer.cpp' ,
'MOAIPartitionResultMgr.cpp' ,
'MOAIPathFinder.cpp' ,
'MOAIPathGraph.cpp' ,
'MOAIPathTerrainDeck.cpp' ,
'MOAIPointerSensor.cpp' ,
'MOAIProp.cpp' ,
'MOAIQuadBrush.cpp' ,
'MOAIRenderMgr.cpp' ,
'MOAIRenderable.cpp' ,
'MOAIRtti.cpp' ,
'MOAIScissorRect.cpp' ,
'MOAIScriptDeck.cpp' ,
'MOAIScriptNode.cpp' ,
'MOAISensor.cpp' ,
'MOAISerializer.cpp' ,
'MOAISerializerBase.cpp' ,
'MOAIShader.cpp' ,
'MOAIShaderMgr.cpp' ,
'MOAISim.cpp' ,
'MOAIStaticGlyphCache.cpp' ,
'MOAIStretchPatch2D.cpp' ,
'MOAIStream.cpp' ,
'MOAIStreamReader.cpp' ,
'MOAIStreamWriter.cpp' ,
'MOAISurfaceDeck2D.cpp' ,
'MOAISurfaceSampler2D.cpp' ,
'MOAITextBox.cpp' ,
'MOAITextBundle.cpp' ,
'MOAITextDesigner.cpp' ,
'MOAITextStyle.cpp' ,
'MOAITextStyler.cpp' ,
'MOAITexture.cpp' ,
'MOAITextureBase.cpp' ,
'MOAICoroutine.cpp' ,
'MOAITileDeck2D.cpp' ,
'MOAITileFlags.cpp' ,
'MOAITimer.cpp' ,
'MOAITouchSensor.cpp' ,
'MOAITransform.cpp' ,
'MOAITransformBase.cpp' ,
'MOAIUrlMgrNaCl.cpp' ,
'MOAIVertexBuffer.cpp' ,
'MOAIVertexFormat.cpp' ,
'MOAIVertexFormatMgr.cpp' ,
'MOAIViewport.cpp' ,
'MOAIWheelSensor.cpp' ,
'MOAIXmlParser.cpp' ,
]]
moaiextuntz_sources = [ os.path.join('moaiext-untz', src_file) for src_file in [
'MOAIUntzSystem.cpp' ,
]]
moaiextfmod_sources = [ os.path.join('moaiext-fmod-ex', src_file) for src_file in [
'MOAIFmodEx.cpp' ,
'MOAIFmodExChannel.cpp' ,
'MOAIFmodExSound.cpp' ,
]]
nacl_moai_sources = [ 'NaClHost.cpp',
'geturl_handler.cc',
'NaClFileSystem.cpp',
'NaClFile.cpp',
'opengl_context.cc',
'MOAIApp.cpp',
]
sources = nacl_moai_sources + zlib_sources + tinyxml_sources + libjpg_sources + jansson_sources + tlsf_sources + expat_sources + libpng_sources + contrib_sources + zlcore_sources + box2d_sources + uslcore_sources + aku_sources + moaiextfmod_sources + moai_sources
nacl_env.Append ( LIBS=['m','nacl_dyncode','c', 'g', 'nacl', 'ppapi_gles2','fmodex', 'ppapi', 'ppapi_cpp', 'pthread', 'nosys' ] )
nacl_env.Append ( CPPDEFINES=['MOAI_OS_NACL','HAVE_MEMMOVE','__linux', 'NACL', 'USE_CURL=0','USE_CHIPMUNK=0','USE_OPENGLES1=0','USE_SQL=0', 'USE_OPENSSL=0','FT2_BUILD_LIBRARY'] )
nacl_env["CPPPATH"] = [ 'lua-5.1.3/src',
'ooid-0.99',
'box2d-2.2.1',
'chipmunk-5.3.4/include',
'physfs-2.0.2',
'sqlite-3.6.16',
'expat-2.0.1/lib',
'tinyxml',
'lpng140',
'zlib-1.2.3',
'hmac_sha1',
'jansson-2.1/src',
fmod_include,
'openssl-1.0.0d/include-android',
'openssl-1.0.0d/crypto',
'freetype-2.4.4/include',
'tlsf-2.0',
'jpeg-8c',
'zlcore',
'config-default',
'.' ]
nacl_env.Append ( LIBPATH = ['lib-x86-32/opt','lib-x86-64/opt','x86-32','x86-64',fmod_library+'32', fmod_library+'64'] )
nacl_env.NaClStaticLibraries ( zlib_sources, 'zlib', is_debug=False )
nacl_env.Append ( LIBS=[ 'zlib' ] )
nacl_env.Append ( CCFLAGS = ['-include','zl_replace.h'] )
nacl_env.NaClStaticLibraries ( box2d_sources, 'box2d', is_debug=False )
nacl_env.NaClStaticLibraries ( tinyxml_sources, 'tinyxml', is_debug=False )
nacl_env.NaClStaticLibraries ( libjpg_sources, 'libjpg', is_debug=False )
nacl_env.NaClStaticLibraries ( jansson_sources, 'jansson', is_debug=False )
nacl_env.NaClStaticLibraries ( expat_sources, 'expat', is_debug=False )
nacl_env.NaClStaticLibraries ( libpng_sources, 'libpng', is_debug=False )
nacl_env.NaClStaticLibraries ( contrib_sources, 'contrib', is_debug=False )
nacl_env.NaClStaticLibraries ( lua_sources, 'lua', is_debug=False )
nacl_env.NaClStaticLibraries ( freetype_sources, 'freetype', is_debug=False )
nacl_env.FilterOut ( CCFLAGS = ['-include','zl_replace.h'] )
nacl_env.FilterOut( LIBS=['nosys'] )
nacl_env.Append ( LIBS=['zlib','freetype','box2d','lua','tinyxml','libjpg','jansson','expat','libpng','contrib','lua','nosys'] )
module_name = 'moai'
opt_nexes = nacl_env.NaClModules( tlsf_sources + zlcore_sources + uslcore_sources + aku_sources + moaiextfmod_sources + moai_sources + nacl_moai_sources , module_name, is_debug=False )
nacl_env.GenerateNmf(target='%s.nmf' % module_name,
source=opt_nexes,
nexes={'x86-32': '%s_x86_32.nexe' % module_name,
'x86-64': '%s_x86_64.nexe' % module_name})
Something went wrong with that request. Please try again.