| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| executable("dash") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| output_name = "sh" |
| sources = [ |
| "src/alias.c", |
| "src/arith_yacc.c", |
| "src/arith_yylex.c", |
| "src/bltin/printf.c", |
| "src/bltin/test.c", |
| "src/bltin/times.c", |
| "src/bltin/zircon.c", |
| "src/builtins.c", |
| "src/cd.c", |
| "src/error.c", |
| "src/eval.c", |
| "src/exec.c", |
| "src/expand.c", |
| "src/init.c", |
| "src/input.c", |
| "src/jobs.c", |
| "src/main.c", |
| "src/memalloc.c", |
| "src/miscbltin.c", |
| "src/mystring.c", |
| "src/nodes.c", |
| "src/options.c", |
| "src/output.c", |
| "src/output.h", |
| "src/parser.c", |
| "src/process.c", |
| "src/pty_fuchsia.cc", |
| "src/redir.c", |
| "src/show.c", |
| "src/signames.c", |
| "src/syntax.c", |
| "src/system.c", |
| "src/tab.c", |
| "src/trap.c", |
| "src/var.c", |
| ] |
| configs += [ |
| ":config", |
| "//build/config/fuchsia:static_cpp_standard_library", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_c", |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_c", |
| "//sdk/fidl/fuchsia.hardware.pty:fuchsia.hardware.pty_c", |
| "//sdk/fidl/fuchsia.hardware.pty:fuchsia.hardware.pty_llcpp", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_c", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk:ddk-device-headers", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/pretty", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/system/ulib/fidl:fidl_base", |
| "//zircon/third_party/ulib/linenoise", |
| ] |
| |
| # TODO(41901): UBSan has found an instance of undefined behavior in this target. |
| # Disable UBSan for this target temporarily until it is migrated into CI/CQ. |
| configs += [ "//build/config:temporarily_disable_ubsan_do_not_use" ] |
| |
| configs += [ "//build/config:Wno-unused-function" ] |
| configs += [ "//build/config:Wno-conversion" ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| source_set("output_h") { |
| public = [ "src/output.h" ] |
| } |
| |
| config("config") { |
| visibility = [ ":*" ] |
| defines = [ |
| "BSD", |
| "DEBUG", |
| "FLUSHERR", |
| "IFS_BROKEN", |
| "JOBS=0", |
| "SHELL", |
| "USE_GLIBC_STDIO", |
| "USE_LINENOISE", |
| "_GNU_SOURCE", |
| ] |
| include_dirs = [ "src" ] |
| cflags = [ |
| "-include", |
| rebase_path("config.h", root_build_dir), |
| ] |
| |
| # TODO: Fix Warnings |
| cflags_c = [ |
| "-Wno-strict-prototypes", |
| "-Wno-sign-compare", |
| "-Wno-logical-not-parentheses", |
| ] |
| if (false) { # is_gcc |
| cflags_c += [ "-Wno-discarded-qualifiers" ] |
| } else { |
| cflags_c += [ |
| "-Wno-incompatible-pointer-types-discards-qualifiers", |
| "-Wno-gnu-designator", |
| "-Wno-format-security", |
| "-Wno-string-plus-int", |
| ] |
| } |
| } |