Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / build_tools / build_sdk.py
index ccc52b7..c03afb0 100755 (executable)
@@ -56,8 +56,8 @@ NACL_TOOLCHAINTARS_DIR = os.path.join(NACL_TOOLCHAIN_DIR, '.tars')
 CYGTAR = os.path.join(BUILD_DIR, 'cygtar.py')
 PKGVER = os.path.join(BUILD_DIR, 'package_version', 'package_version.py')
 
-NACLPORTS_URL = 'https://naclports.googlecode.com/svn/trunk/src'
-NACLPORTS_REV = 1293
+NACLPORTS_URL = 'https://chromium.googlesource.com/external/naclports.git'
+NACLPORTS_REV = '99f2417'
 
 GYPBUILD_DIR = 'gypbuild'
 
@@ -76,7 +76,7 @@ TOOLCHAIN_PACKAGE_MAP = {
 def GetToolchainNaClInclude(tcname, tcpath, arch):
   if arch == 'x86':
     if tcname == 'pnacl':
-      return os.path.join(tcpath, 'sdk', 'include')
+      return os.path.join(tcpath, 'le32-nacl', 'include')
     return os.path.join(tcpath, 'x86_64-nacl', 'include')
   elif arch == 'arm':
     return os.path.join(tcpath, 'arm-nacl', 'include')
@@ -102,7 +102,7 @@ def GetGypBuiltLib(tcname, xarch=None):
 
 def GetToolchainNaClLib(tcname, tcpath, xarch):
   if tcname == 'pnacl':
-    return os.path.join(tcpath, 'sdk', 'lib')
+    return os.path.join(tcpath, 'le32-nacl', 'lib')
   elif xarch == '32':
     return os.path.join(tcpath, 'x86_64-nacl', 'lib32')
   elif xarch == '64':
@@ -259,6 +259,9 @@ NACL_HEADER_MAP = {
       ('native_client/src/untrusted/valgrind/dynamic_annotations.h', 'nacl/'),
       ('ppapi/nacl_irt/public/irt_ppapi.h', ''),
   ],
+  'bionic': [
+      ('ppapi/nacl_irt/public/irt_ppapi.h', ''),
+  ],
   'host': []
 }
 
@@ -565,9 +568,11 @@ def BuildStepBuildToolchains(pepperdir, toolchains):
   glibcdir = os.path.join(pepperdir, 'toolchain', platform + '_x86_glibc')
   armdir = os.path.join(pepperdir, 'toolchain', platform + '_arm_newlib')
   pnacldir = os.path.join(pepperdir, 'toolchain', platform + '_pnacl')
+  bionicdir = os.path.join(pepperdir, 'toolchain', platform + '_arm_bionic')
 
   if set(toolchains) & set(['glibc', 'newlib']):
     GypNinjaBuild_PPAPI('ia32', GYPBUILD_DIR)
+    GypNinjaBuild_PPAPI('x64', GYPBUILD_DIR)
 
   if 'arm' in toolchains:
     GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR + '-arm')
@@ -586,6 +591,10 @@ def BuildStepBuildToolchains(pepperdir, toolchains):
     InstallNaClHeaders(GetToolchainNaClInclude('newlib', armdir, 'arm'),
                        'arm')
 
+  if 'bionic' in toolchains:
+    InstallNaClHeaders(GetToolchainNaClInclude('bionic', bionicdir, 'arm'),
+                       'bionic')
+
   if 'pnacl' in toolchains:
     # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default.
     for arch in ('ia32', 'arm'):
@@ -797,15 +806,25 @@ def BuildStepArchiveSDKTools():
 def BuildStepSyncNaClPorts():
   """Pull the pinned revision of naclports from SVN."""
   buildbot_common.BuildStep('Sync naclports')
+
+  # In case a previous svn checkout exists, remove it.
+  # TODO(sbc): remove this once all the build machines
+  # have removed the old checkout
+  if (os.path.exists(NACLPORTS_DIR) and
+      not os.path.exists(os.path.join(NACLPORTS_DIR, '.git'))):
+    buildbot_common.RemoveDir(NACLPORTS_DIR)
+
   if not os.path.exists(NACLPORTS_DIR):
     # checkout new copy of naclports
-    cmd = ['svn', 'checkout', '-q', '-r', str(NACLPORTS_REV), NACLPORTS_URL,
-           'naclports']
+    cmd = ['git', 'clone', NACLPORTS_URL, 'naclports']
     buildbot_common.Run(cmd, cwd=os.path.dirname(NACLPORTS_DIR))
   else:
-    # sync existing copy to pinned revision.
-    cmd = ['svn', 'update', '-r', str(NACLPORTS_REV)]
-    buildbot_common.Run(cmd, cwd=NACLPORTS_DIR)
+    # checkout new copy of naclports
+    buildbot_common.Run(['git', 'fetch'], cwd=NACLPORTS_DIR)
+
+  # sync to required revision
+  cmd = ['git', 'checkout', str(NACLPORTS_REV)]
+  buildbot_common.Run(cmd, cwd=NACLPORTS_DIR)
 
 
 def BuildStepBuildNaClPorts(pepper_ver, pepperdir):
@@ -935,10 +954,15 @@ def main(args):
   if buildbot_common.IsSDKBuilder():
     options.archive = True
     options.build_ports = True
-    options.build_app_engine = True
+    # TODO(binji): re-enable app_engine build when the linux builder stops
+    # breaking when trying to git clone from github.
+    # See http://crbug.com/412969.
+    options.build_app_engine = False
     options.tar = True
 
-  toolchains = ['newlib', 'glibc', 'arm', 'pnacl', 'host']
+  # NOTE: order matters here. This will be the order that is specified in the
+  # Makefiles; the first toolchain will be the default.
+  toolchains = ['pnacl', 'newlib', 'glibc', 'arm', 'host']
 
   # Changes for experimental bionic builder
   if options.bionic: