| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 Import('env') | 6 Import('env') |
| 7 | 7 |
| 8 if not env.Bit('bitcode'): | 8 if not env.Bit('bitcode'): |
| 9 Return() | 9 Return() |
| 10 | 10 |
| 11 def GetPlatformSuffix(env): | |
| 12 platform = env.get('TARGET_FULLARCH') | |
| 13 assert platform in ['x86-32', 'x86-64', 'arm'] | |
| 14 # we do not like hyphens in file names | |
| 15 return platform.replace('-', '_') | |
| 16 | |
| 17 platform = GetPlatformSuffix(env) | |
| 18 | |
| 19 # NOTE: we make sure everything in this directory gets compiled | 11 # NOTE: we make sure everything in this directory gets compiled |
| 20 # all the way down into native code. | 12 # all the way down into native code. |
| 21 native_env = env.Clone() | 13 native_env = env.Clone() |
| 22 | 14 native_env.AddBiasForPNaCl() |
| 23 native_env.Replace(OBJSUFFIX='.o') | 15 native_env.PNaClForceNative() |
| 24 native_env.Replace(SHLIBSUFFIX='.so') | |
| 25 native_env.Replace(LINK=native_env['C_ONLY_LINK']) | 16 native_env.Replace(LINK=native_env['C_ONLY_LINK']) |
| 26 native_env.Append(CCFLAGS=['-arch', '${TARGET_FULLARCH}', | 17 native_env.Append(LINKFLAGS=[# TODO(pdox): This flag shouldn't be necessary, |
| 27 '--pnacl-allow-translate']) | |
| 28 native_env.Append(LINKFLAGS=['-arch', '${TARGET_FULLARCH}', | |
| 29 '--pnacl-allow-native', | |
| 30 # TODO(pdox): This flag shouldn't be necessary, | |
| 31 # the driver should be able to detect when there | 18 # the driver should be able to detect when there |
| 32 # are no bitcode inputs. | 19 # are no bitcode inputs. |
| 33 '--pnacl-native-hack']) | 20 '--pnacl-native-hack']) |
| 34 | 21 |
| 35 native_env.NaClSdkLibrary('libehsupport', ['unwind_support.c']) | 22 native_env.NaClSdkLibrary('libehsupport', ['unwind_support.c']) |
| 36 | 23 |
| 37 n = native_env.AddLibraryToSdk(['libehsupport'], is_platform=True) | 24 n = native_env.AddLibraryToSdk(['libehsupport'], is_platform=True) |
| 38 | 25 |
| 39 native_env.Alias('install_libehsupport', n) | 26 native_env.Alias('install_libehsupport', n) |
| OLD | NEW |