def make(src_dir, modules): old_cur = os.getcwd() print("boost-headers...") base.cmd("./bootstrap.sh", ["--with-libraries=system"]) base.cmd("./b2", ["--prefix=./../build/android", "headers", "install"]) for module in modules: print("boost-module: " + module + " ...") module_dir = src_dir + "/libs/" + module os.chdir(module_dir) pro_file_content = [] pro_file_content.append("QT -= core gui") pro_file_content.append("TARGET = boost_" + module) pro_file_content.append("TEMPLATE = lib") pro_file_content.append("CONFIG += staticlib") pro_file_content.append("") pro_file_content.append("CORE_ROOT_DIR = $$PWD/../../../../../..") pro_file_content.append("PWD_ROOT_DIR = $$PWD") pro_file_content.append("include($$PWD/../../../../../base.pri)") pro_file_content.append("") pro_file_content.append("MAKEFILE=$$PWD/makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX") pro_file_content.append("core_debug:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_debug_\")") pro_file_content.append("build_xp:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_xp\")") pro_file_content.append("OO_BRANDING_SUFFIX = $$(OO_BRANDING)") pro_file_content.append("!isEmpty(OO_BRANDING_SUFFIX):MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"$$OO_BRANDING_SUFFIX\")") pro_file_content.append("") pro_file_content.append("BOOST_SOURCES=$$PWD/../..") pro_file_content.append("INCLUDEPATH += $$BOOST_SOURCES") pro_file_content.append("INCLUDEPATH += $$PWD/include") pro_file_content.append("") pro_file_content.append("SOURCES += $$files($$PWD/src/*.cpp, true)") pro_file_content.append("") pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX") base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content) build.make_pro_file(module_dir + "/makefiles", module_dir + "/" + module + ".pro") os.chdir(old_cur) return
def make_xp(): if not is_xp_platform(): return print("[fetch & build]: v8_xp") old_env = dict(os.environ) base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8/v8_xp" old_cur = os.getcwd() os.chdir(base_dir) if ("windows" == base.host_platform()): base.set_env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0") base.set_env("GYP_MSVS_VERSION", "2015") base.common_check_version("v8", "1", clean) if not base.is_dir("win_64") and not base.is_dir("win_32"): clean() if not base.is_dir("depot_tools"): base.cmd( "git", ["clone", "http://120.92.49.206:3232/chromiumsrc/depot_tools.git"]) if ("windows" == base.host_platform()): # hack for 32 bit system!!! if base.is_file("depot_tools/cipd.ps1"): base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64") os.environ["PATH"] = os.pathsep.join([ base_dir + "/depot_tools", base_dir + "/depot_tools/win_tools-2_7_13_chromium7_bin/python/bin", config.option("vs-path") + "/../Common7/IDE", os.environ["PATH"] ]) # -------------------------------------------------------------------------- # fetch if not base.is_dir("v8"): base.cmd("./depot_tools/fetch", ["v8"], True) base.cmd("./depot_tools/gclient", ["sync", "-r", "4.10.253"], True) base.delete_dir_with_access_error("v8/buildtools/win") base.cmd("git", ["config", "--system", "core.longpaths", "true"]) base.cmd("gclient", ["sync", "--force"], True) # save common py script base.save_as_script("v8/build/common_xp.py", [ "import os", "def replaceInFile(path, text, textReplace):", " filedata = '';", " with open(path, 'r') as file:", " filedata = file.read()", " filedata = filedata.replace(text, textReplace)", " os.remove(path)", " with open(path, 'w') as file:", " file.write(filedata)", " return", "", "projects = ['v8/tools/gyp/v8_base_0.vcxproj', 'v8/tools/gyp/v8_base_1.vcxproj', 'v8/tools/gyp/v8_base_2.vcxproj', 'v8/tools/gyp/v8_base_3.vcxproj',", "'v8/tools/gyp/v8_libbase.vcxproj', 'v8/tools/gyp/v8_libplatform.vcxproj', 'v8/tools/gyp/v8_nosnapshot.vcxproj', 'v8/tools/gyp/mksnapshot.vcxproj',", "'v8/third_party/icu/icui18n.vcxproj', 'v8/third_party/icu/icuuc.vcxproj']", "", "for file in projects:", " replaceInFile(file, '<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>')", " replaceInFile(file, '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')", ]) if config.check_option("platform", "win_64_xp"): if not base.is_dir("win_64/release"): base.run_as_bat([ "call python v8/build/gyp_v8 -Dtarget_arch=x64", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Release" ]) base.create_dir("win_64/release") base.copy_files("v8/build/Release/lib/*", "win_64/release/") base.copy_file("v8/build/Release/icudt.dll", "win_64/release/icudt.dll") if (-1 != config.option("config").lower().find("debug") ) and not base.is_dir("win_64/debug"): base.run_as_bat([ "call python v8/build/gyp_v8 -Dtarget_arch=x64", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Debug" ]) base.create_dir("win_64/debug") base.copy_files("v8/build/Debug/lib/*", "win_64/debug/") base.copy_file("v8/build/Debug/icudt.dll", "win_64/debug/icudt.dll") if config.check_option("platform", "win_32_xp"): if not base.is_dir("win_32/release"): base.run_as_bat([ "call python v8/build/gyp_v8", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Release" ]) base.create_dir("win_32/release") base.copy_files("v8/build/Release/lib/*", "win_32/release/") base.copy_file("v8/build/Release/icudt.dll", "win_32/release/icudt.dll") if (-1 != config.option("config").lower().find("debug") ) and not base.is_dir("win_32/debug"): base.run_as_bat([ "call python v8/build/gyp_v8", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Debug" ]) base.create_dir("win_32/debug") base.copy_files("v8/build/Debug/lib/*", "win_32/debug/") base.copy_file("v8/build/Debug/icudt.dll", "win_32/debug/icudt.dll") os.chdir(old_cur) os.environ.clear() os.environ.update(old_env) return