1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53

build / config / nacl / config.gni [blame]

# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

declare_args() {
  # Native Client supports multiple toolchains:
  #   - nacl_glibc, based on gcc and glibc.
  #   - pnacl_newlib, based on llvm 3.7 and newlib (default).
  #   - saigo_newlib, based on llvm 12+ and newlib.

  # True if nacl_glibc is used.
  is_nacl_glibc = false

  # True if saigo_newlib is used.
  is_nacl_saigo = false
}

nacl_toolchain_dir = "//native_client/toolchain/${host_os}_x86"

if (is_nacl_glibc) {
  if (current_cpu == "x86" || current_cpu == "x64") {
    nacl_toolchain_package = "nacl_x86_glibc"
  } else if (current_cpu == "arm") {
    nacl_toolchain_package = "nacl_arm_glibc"
  }
} else {
  nacl_toolchain_package = "pnacl_newlib"
}

if (current_cpu == "pnacl") {
  _nacl_tuple = "pnacl"
} else if (current_cpu == "x86" || current_cpu == "x64") {
  _nacl_tuple = "x86_64-nacl"
} else if (current_cpu == "arm") {
  _nacl_tuple = "arm-nacl"
} else if (current_cpu == "mipsel") {
  _nacl_tuple = "mipsel-nacl"
} else {
  # In order to allow this file to be included unconditionally
  # from build files that can't depend on //components/nacl/features.gni
  # we provide a dummy value that should be harmless if nacl isn't needed.
  # If nacl *is* needed this will result in a real error, indicating that
  # people need to set the toolchain path correctly.
  _nacl_tuple = "unknown"
}

nacl_toolchain_bindir = "${nacl_toolchain_dir}/${nacl_toolchain_package}/bin"
nacl_toolchain_tooldir =
    "${nacl_toolchain_dir}/${nacl_toolchain_package}/${_nacl_tuple}"
nacl_toolprefix = "${nacl_toolchain_bindir}/${_nacl_tuple}-"

nacl_irt_toolchain = "//build/toolchain/nacl:irt_" + current_cpu
is_nacl_irt = current_toolchain == nacl_irt_toolchain