platform_external_mksh/Android.bp

159 lines
4.1 KiB
Text
Raw Normal View History

// Copyright © 2010, 2013
// Thorsten Glaser <t.glaser@tarent.de>
// This file is provided under the same terms as mksh.
cc_defaults {
name: "sh-defaults",
srcs: [
"src/lalloc.c",
"src/edit.c",
"src/eval.c",
"src/exec.c",
"src/expr.c",
"src/funcs.c",
"src/histrap.c",
"src/jobs.c",
"src/lex.c",
"src/main.c",
"src/misc.c",
"src/shf.c",
"src/syn.c",
"src/tree.c",
"src/var.c",
],
local_include_dirs: ["src"],
cflags: [
// Compiler flags...
"-Wall",
"-Werror",
"-Wno-deprecated-declarations",
"-fno-asynchronous-unwind-tables",
"-fno-strict-aliasing",
"-fwrapv",
// ...various options we choose
"-DDEBUG_LEAKS",
"-DMKSH_ASSUME_UTF8",
"-DMKSH_DONT_EMIT_IDSTRING",
"-DKSH_VERSIONNAME_VENDOR_EXT=\" Android\"",
// ...and the defines from Build.sh.
"-DMKSH_BUILDSH",
"-D_GNU_SOURCE",
"-DSETUID_CAN_FAIL_WITH_EAGAIN",
"-DHAVE_STRING_POOLING=1",
"-DHAVE_ATTRIBUTE_BOUNDED=1",
"-DHAVE_ATTRIBUTE_FORMAT=1",
"-DHAVE_ATTRIBUTE_NORETURN=1",
"-DHAVE_ATTRIBUTE_PURE=1",
"-DHAVE_ATTRIBUTE_UNUSED=1",
"-DHAVE_ATTRIBUTE_USED=1",
"-DHAVE_SYS_TIME_H=1",
"-DHAVE_TIME_H=1",
"-DHAVE_BOTH_TIME_H=1",
"-DHAVE_SYS_BSDTYPES_H=0",
"-DHAVE_SYS_FILE_H=1",
"-DHAVE_SYS_MKDEV_H=0",
"-DHAVE_SYS_MMAN_H=1",
"-DHAVE_SYS_PARAM_H=1",
"-DHAVE_SYS_RESOURCE_H=1",
"-DHAVE_SYS_SELECT_H=1",
"-DHAVE_SYS_SYSMACROS_H=1",
"-DHAVE_BSTRING_H=0",
"-DHAVE_GRP_H=1",
"-DHAVE_IO_H=0",
"-DHAVE_LIBGEN_H=1",
"-DHAVE_LIBUTIL_H=0",
"-DHAVE_PATHS_H=1",
"-DHAVE_STDINT_H=1",
"-DHAVE_STRINGS_H=1",
"-DHAVE_TERMIOS_H=1",
"-DHAVE_ULIMIT_H=0",
"-DHAVE_VALUES_H=0",
"-DHAVE_CAN_INTTYPES=1",
"-DHAVE_CAN_UCBINTS=1",
"-DHAVE_CAN_INT8TYPE=1",
"-DHAVE_CAN_UCBINT8=1",
"-DHAVE_RLIM_T=1",
"-DHAVE_SIG_T=1",
"-DHAVE_SYS_ERRLIST=0",
"-DHAVE_SYS_SIGNAME=1",
"-DHAVE_SYS_SIGLIST=1",
"-DHAVE_FLOCK=1",
"-DHAVE_LOCK_FCNTL=1",
"-DHAVE_GETRUSAGE=1",
"-DHAVE_GETSID=1",
"-DHAVE_GETTIMEOFDAY=1",
"-DHAVE_KILLPG=1",
"-DHAVE_MEMMOVE=1",
"-DHAVE_MKNOD=0",
"-DHAVE_MMAP=1",
"-DHAVE_FTRUNCATE=1",
"-DHAVE_NICE=1",
"-DHAVE_REVOKE=0",
"-DHAVE_SETLOCALE_CTYPE=1",
"-DHAVE_LANGINFO_CODESET=1",
"-DHAVE_SELECT=1",
"-DHAVE_SETRESUGID=1",
"-DHAVE_SETGROUPS=1",
"-DHAVE_STRERROR=1",
"-DHAVE_STRSIGNAL=0",
"-DHAVE_STRLCPY=1",
"-DHAVE_FLOCK_DECL=1",
"-DHAVE_REVOKE_DECL=1",
"-DHAVE_SYS_ERRLIST_DECL=0",
"-DHAVE_SYS_SIGLIST_DECL=1",
"-DHAVE_PERSISTENT_HISTORY=0",
Upgrade to mksh R57. R57 rolls up bugfixes, with few hard changes: [gecko2] Update operating environment reporting for the Macintosh [Martijn Dekker] make ${foo#'bar'} in here document behave like ksh93 [Martijn Dekker] quote empty strings for re-entry into shell [tg, G.raud Meyer] Improve documentation, especially for tty states [tg] Protect against entering line editing with bad saved tty state [tg] Fix set -o allexport for arrays (which we apparently do) [tg] Handle lseek(2) returning -1 as pointed out by Coverity Scan [tg] Fix left-padding UTF-8 strings [tg, G.raud Meyer] Fix using the “-m” flag on the command line [tg] Update to UCD 11.0.0 [multiplexd] Fix a segfault using ^W during search in Vi mode [tg] Fix an error message; add a test for controlling tty [tg] Permit unsetting LINES and COLUMNS, for those who need it [tg] Fix manpage bug (RedHat BZ#1612173) [tg] Minor spelling cleanup [tg] Unbreak high-bit7 (nōn-ASCII) heredoc separators (LP#1779179) [tg] Allow dumping high-bit7-char-containing strings in DEBUG mode [tg] Add some testcases for behaviour questions popped up in IRC [tg] Trick a GCC warning, to make up for it ignoring lint(1) hints [tg] Add O_MAYEXEC support for CLIP OS [tg] Make dup-to-self with ksh-style fd≥3 closing work; catern via IRC [tg] Add compat glue for newer GNU groff mdoc to the manpages [tg] Trigger EXIT trap after single-command subshells (Debian #910276) [tg] Document set -eo pipefail caveat (LP#1804504) [tg] Fix MKSH_EARLY_LOCALE_TRACKING warning [tg] Document that, when your Unix is broken, GIGO applies (LP#1817959) [tg] Improve error message for inaccessible executables (LP#1817789) Test: treehugger Change-Id: Ib5447fc474e509698bd04cdf70ed14b54e84d27a
2019-03-26 20:34:31 +01:00
"-DMKSH_BUILD_R=571",
// Additional flags
"-DMKSH_DEFAULT_PROFILEDIR=\"/system/etc\"",
"-DMKSHRC_PATH=\"/system/etc/mkshrc\"",
"-DMKSH_DEFAULT_EXECSHELL=\"/system/bin/sh\"",
"-DMKSH_DEFAULT_TMPDIR=\"/data/local\"",
],
stl: "none",
system_shared_libs: ["libc"],
}
cc_binary {
name: "sh",
defaults: ["sh-defaults"],
recovery_available: true,
}
cc_binary {
name: "sh_vendor",
defaults: ["sh-defaults"],
stem: "sh",
vendor: true,
cflags: [
// Additional flags for vendor variant
"-UMKSH_DEFAULT_PROFILEDIR",
"-UMKSHRC_PATH",
"-UMKSH_DEFAULT_EXECSHELL",
"-DMKSH_DEFAULT_PROFILEDIR=\"/vendor/etc\"",
"-DMKSHRC_PATH=\"/vendor/etc/mkshrc\"",
"-DMKSH_DEFAULT_EXECSHELL=\"/vendor/bin/sh\"",
"-DMKSH_DEFPATH_OVERRIDE=\"/vendor/bin:/vendor/xbin\"",
],
}
// /system/etc/mkshrc
prebuilt_etc {
name: "mkshrc",
src: "mkshrc",
}
// /vendor/etc/mkshrc
prebuilt_etc {
name: "mkshrc_vendor",
src: "mkshrc_vendor",
filename: "mkshrc",
soc_specific: true,
}