10f66f451Sopenharmony_ci# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
20f66f451Sopenharmony_ci# Must do steps below manually after getting the sources code
30f66f451Sopenharmony_ci# from official website:
40f66f451Sopenharmony_ci# 1. make defconfig or make menuconfig
50f66f451Sopenharmony_ci#   ==> To generate .config file.
60f66f451Sopenharmony_ci# 2. NOBUILD=1 scripts/make.sh
70f66f451Sopenharmony_ci#   ==> To generate neccesary files like heades in generated
80f66f451Sopenharmony_ci# direcotory.
90f66f451Sopenharmony_ci
100f66f451Sopenharmony_ci# To add a toy:
110f66f451Sopenharmony_ci# 1. Edit .config to enable the toy you want to add.
120f66f451Sopenharmony_ci# 2. Edit toybox'sources below if neccesary.
130f66f451Sopenharmony_ci# e. Add th toy to the symlinks.
140f66f451Sopenharmony_ciif (defined(ohos_lite)) {
150f66f451Sopenharmony_ci  executable("toybox") {
160f66f451Sopenharmony_ci    # from middleware file build.sh
170f66f451Sopenharmony_ci    sources = [
180f66f451Sopenharmony_ci      "lib/args.c",
190f66f451Sopenharmony_ci      "lib/commas.c",
200f66f451Sopenharmony_ci      "lib/deflate.c",
210f66f451Sopenharmony_ci      "lib/dirtree.c",
220f66f451Sopenharmony_ci      "lib/env.c",
230f66f451Sopenharmony_ci      "lib/help.c",
240f66f451Sopenharmony_ci      "lib/lib.c",
250f66f451Sopenharmony_ci      "lib/linestack.c",
260f66f451Sopenharmony_ci      "lib/llist.c",
270f66f451Sopenharmony_ci      "lib/net.c",
280f66f451Sopenharmony_ci      "lib/password.c",
290f66f451Sopenharmony_ci      "lib/portability.c",
300f66f451Sopenharmony_ci      "lib/tty.c",
310f66f451Sopenharmony_ci      "lib/xwrap.c",
320f66f451Sopenharmony_ci      "main.c",
330f66f451Sopenharmony_ci      "toys/android/sendevent.c",
340f66f451Sopenharmony_ci      "toys/lsb/dmesg.c",
350f66f451Sopenharmony_ci      "toys/lsb/gzip.c",
360f66f451Sopenharmony_ci      "toys/lsb/hostname.c",
370f66f451Sopenharmony_ci      "toys/lsb/killall.c",
380f66f451Sopenharmony_ci      "toys/lsb/md5sum.c",
390f66f451Sopenharmony_ci      "toys/lsb/mknod.c",
400f66f451Sopenharmony_ci      "toys/lsb/mktemp.c",
410f66f451Sopenharmony_ci      "toys/lsb/mount.c",
420f66f451Sopenharmony_ci      "toys/lsb/passwd.c",
430f66f451Sopenharmony_ci      "toys/lsb/pidof.c",
440f66f451Sopenharmony_ci      "toys/lsb/seq.c",
450f66f451Sopenharmony_ci      "toys/lsb/su.c",
460f66f451Sopenharmony_ci      "toys/lsb/sync.c",
470f66f451Sopenharmony_ci      "toys/lsb/umount.c",
480f66f451Sopenharmony_ci      "toys/net/ftpget.c",
490f66f451Sopenharmony_ci      "toys/net/ifconfig.c",
500f66f451Sopenharmony_ci      "toys/net/microcom.c",
510f66f451Sopenharmony_ci      "toys/net/netcat.c",
520f66f451Sopenharmony_ci      "toys/net/netstat.c",
530f66f451Sopenharmony_ci      "toys/net/ping.c",
540f66f451Sopenharmony_ci      "toys/net/rfkill.c",
550f66f451Sopenharmony_ci      "toys/net/sntp.c",
560f66f451Sopenharmony_ci      "toys/net/tunctl.c",
570f66f451Sopenharmony_ci      "toys/other/acpi.c",
580f66f451Sopenharmony_ci      "toys/other/ascii.c",
590f66f451Sopenharmony_ci      "toys/other/base64.c",
600f66f451Sopenharmony_ci      "toys/other/blkid.c",
610f66f451Sopenharmony_ci      "toys/other/blockdev.c",
620f66f451Sopenharmony_ci      "toys/other/bzcat.c",
630f66f451Sopenharmony_ci      "toys/other/chroot.c",
640f66f451Sopenharmony_ci      "toys/other/chrt.c",
650f66f451Sopenharmony_ci      "toys/other/chvt.c",
660f66f451Sopenharmony_ci      "toys/other/clear.c",
670f66f451Sopenharmony_ci      "toys/other/count.c",
680f66f451Sopenharmony_ci      "toys/other/devmem.c",
690f66f451Sopenharmony_ci      "toys/other/dos2unix.c",
700f66f451Sopenharmony_ci      "toys/other/eject.c",
710f66f451Sopenharmony_ci      "toys/other/factor.c",
720f66f451Sopenharmony_ci      "toys/other/fallocate.c",
730f66f451Sopenharmony_ci      "toys/other/flock.c",
740f66f451Sopenharmony_ci      "toys/other/fmt.c",
750f66f451Sopenharmony_ci      "toys/other/free.c",
760f66f451Sopenharmony_ci      "toys/other/freeramdisk.c",
770f66f451Sopenharmony_ci      "toys/other/fsfreeze.c",
780f66f451Sopenharmony_ci      "toys/other/fsync.c",
790f66f451Sopenharmony_ci      "toys/other/help.c",
800f66f451Sopenharmony_ci      "toys/other/hexedit.c",
810f66f451Sopenharmony_ci      "toys/other/hwclock.c",
820f66f451Sopenharmony_ci      "toys/other/i2ctools.c",
830f66f451Sopenharmony_ci      "toys/other/inotifyd.c",
840f66f451Sopenharmony_ci      "toys/other/insmod.c",
850f66f451Sopenharmony_ci      "toys/other/ionice.c",
860f66f451Sopenharmony_ci      "toys/other/login.c",
870f66f451Sopenharmony_ci      "toys/other/losetup.c",
880f66f451Sopenharmony_ci      "toys/other/lsattr.c",
890f66f451Sopenharmony_ci      "toys/other/lsmod.c",
900f66f451Sopenharmony_ci      "toys/other/lspci.c",
910f66f451Sopenharmony_ci      "toys/other/lsusb.c",
920f66f451Sopenharmony_ci      "toys/other/makedevs.c",
930f66f451Sopenharmony_ci      "toys/other/mcookie.c",
940f66f451Sopenharmony_ci      "toys/other/mix.c",
950f66f451Sopenharmony_ci      "toys/other/mkpasswd.c",
960f66f451Sopenharmony_ci      "toys/other/mkswap.c",
970f66f451Sopenharmony_ci      "toys/other/modinfo.c",
980f66f451Sopenharmony_ci      "toys/other/mountpoint.c",
990f66f451Sopenharmony_ci      "toys/other/nbd_client.c",
1000f66f451Sopenharmony_ci      "toys/other/nsenter.c",
1010f66f451Sopenharmony_ci      "toys/other/oneit.c",
1020f66f451Sopenharmony_ci      "toys/other/partprobe.c",
1030f66f451Sopenharmony_ci      "toys/other/pivot_root.c",
1040f66f451Sopenharmony_ci      "toys/other/pmap.c",
1050f66f451Sopenharmony_ci      "toys/other/printenv.c",
1060f66f451Sopenharmony_ci      "toys/other/pwdx.c",
1070f66f451Sopenharmony_ci      "toys/other/readahead.c",
1080f66f451Sopenharmony_ci      "toys/other/readlink.c",
1090f66f451Sopenharmony_ci      "toys/other/realpath.c",
1100f66f451Sopenharmony_ci      "toys/other/reboot.c",
1110f66f451Sopenharmony_ci      "toys/other/reset.c",
1120f66f451Sopenharmony_ci      "toys/other/rev.c",
1130f66f451Sopenharmony_ci      "toys/other/rmmod.c",
1140f66f451Sopenharmony_ci      "toys/other/setfattr.c",
1150f66f451Sopenharmony_ci      "toys/other/setsid.c",
1160f66f451Sopenharmony_ci      "toys/other/shred.c",
1170f66f451Sopenharmony_ci      "toys/other/stat.c",
1180f66f451Sopenharmony_ci      "toys/other/swapoff.c",
1190f66f451Sopenharmony_ci      "toys/other/swapon.c",
1200f66f451Sopenharmony_ci      "toys/other/switch_root.c",
1210f66f451Sopenharmony_ci      "toys/other/sysctl.c",
1220f66f451Sopenharmony_ci      "toys/other/tac.c",
1230f66f451Sopenharmony_ci      "toys/other/taskset.c",
1240f66f451Sopenharmony_ci      "toys/other/timeout.c",
1250f66f451Sopenharmony_ci      "toys/other/truncate.c",
1260f66f451Sopenharmony_ci      "toys/other/uptime.c",
1270f66f451Sopenharmony_ci      "toys/other/usleep.c",
1280f66f451Sopenharmony_ci      "toys/other/uuidgen.c",
1290f66f451Sopenharmony_ci      "toys/other/vconfig.c",
1300f66f451Sopenharmony_ci      "toys/other/vmstat.c",
1310f66f451Sopenharmony_ci      "toys/other/w.c",
1320f66f451Sopenharmony_ci      "toys/other/watch.c",
1330f66f451Sopenharmony_ci      "toys/other/which.c",
1340f66f451Sopenharmony_ci      "toys/other/xxd.c",
1350f66f451Sopenharmony_ci      "toys/other/yes.c",
1360f66f451Sopenharmony_ci      "toys/pending/bootchartd.c",
1370f66f451Sopenharmony_ci      "toys/pending/dd.c",
1380f66f451Sopenharmony_ci      "toys/pending/diff.c",
1390f66f451Sopenharmony_ci      "toys/pending/getty.c",
1400f66f451Sopenharmony_ci      "toys/pending/lsof.c",
1410f66f451Sopenharmony_ci      "toys/pending/mdev.c",
1420f66f451Sopenharmony_ci      "toys/pending/more.c",
1430f66f451Sopenharmony_ci      "toys/pending/route.c",
1440f66f451Sopenharmony_ci      "toys/pending/telnetd.c",
1450f66f451Sopenharmony_ci      "toys/posix/basename.c",
1460f66f451Sopenharmony_ci      "toys/posix/cal.c",
1470f66f451Sopenharmony_ci      "toys/posix/cat.c",
1480f66f451Sopenharmony_ci      "toys/posix/chgrp.c",
1490f66f451Sopenharmony_ci      "toys/posix/chmod.c",
1500f66f451Sopenharmony_ci      "toys/posix/cksum.c",
1510f66f451Sopenharmony_ci      "toys/posix/cmp.c",
1520f66f451Sopenharmony_ci      "toys/posix/comm.c",
1530f66f451Sopenharmony_ci      "toys/posix/cp.c",
1540f66f451Sopenharmony_ci      "toys/posix/cpio.c",
1550f66f451Sopenharmony_ci      "toys/posix/cut.c",
1560f66f451Sopenharmony_ci      "toys/posix/date.c",
1570f66f451Sopenharmony_ci      "toys/posix/df.c",
1580f66f451Sopenharmony_ci      "toys/posix/dirname.c",
1590f66f451Sopenharmony_ci      "toys/posix/du.c",
1600f66f451Sopenharmony_ci      "toys/posix/echo.c",
1610f66f451Sopenharmony_ci      "toys/posix/env.c",
1620f66f451Sopenharmony_ci      "toys/posix/expand.c",
1630f66f451Sopenharmony_ci      "toys/posix/false.c",
1640f66f451Sopenharmony_ci      "toys/posix/file.c",
1650f66f451Sopenharmony_ci      "toys/posix/find.c",
1660f66f451Sopenharmony_ci      "toys/posix/getconf.c",
1670f66f451Sopenharmony_ci      "toys/posix/grep.c",
1680f66f451Sopenharmony_ci      "toys/posix/head.c",
1690f66f451Sopenharmony_ci      "toys/posix/iconv.c",
1700f66f451Sopenharmony_ci      "toys/posix/id.c",
1710f66f451Sopenharmony_ci      "toys/posix/kill.c",
1720f66f451Sopenharmony_ci      "toys/posix/link.c",
1730f66f451Sopenharmony_ci      "toys/posix/ln.c",
1740f66f451Sopenharmony_ci      "toys/posix/logger.c",
1750f66f451Sopenharmony_ci      "toys/posix/ls.c",
1760f66f451Sopenharmony_ci      "toys/posix/mkdir.c",
1770f66f451Sopenharmony_ci      "toys/posix/mkfifo.c",
1780f66f451Sopenharmony_ci      "toys/posix/nice.c",
1790f66f451Sopenharmony_ci      "toys/posix/nl.c",
1800f66f451Sopenharmony_ci      "toys/posix/nohup.c",
1810f66f451Sopenharmony_ci      "toys/posix/od.c",
1820f66f451Sopenharmony_ci      "toys/posix/paste.c",
1830f66f451Sopenharmony_ci      "toys/posix/patch.c",
1840f66f451Sopenharmony_ci      "toys/posix/printf.c",
1850f66f451Sopenharmony_ci      "toys/posix/ps.c",
1860f66f451Sopenharmony_ci      "toys/posix/pwd.c",
1870f66f451Sopenharmony_ci      "toys/posix/renice.c",
1880f66f451Sopenharmony_ci      "toys/posix/rm.c",
1890f66f451Sopenharmony_ci      "toys/posix/rmdir.c",
1900f66f451Sopenharmony_ci      "toys/posix/sed.c",
1910f66f451Sopenharmony_ci      "toys/posix/sleep.c",
1920f66f451Sopenharmony_ci      "toys/posix/sort.c",
1930f66f451Sopenharmony_ci      "toys/posix/split.c",
1940f66f451Sopenharmony_ci      "toys/posix/strings.c",
1950f66f451Sopenharmony_ci      "toys/posix/tail.c",
1960f66f451Sopenharmony_ci      "toys/posix/tar.c",
1970f66f451Sopenharmony_ci      "toys/posix/tee.c",
1980f66f451Sopenharmony_ci      "toys/posix/test.c",
1990f66f451Sopenharmony_ci      "toys/posix/time.c",
2000f66f451Sopenharmony_ci      "toys/posix/touch.c",
2010f66f451Sopenharmony_ci      "toys/posix/true.c",
2020f66f451Sopenharmony_ci      "toys/posix/tty.c",
2030f66f451Sopenharmony_ci      "toys/posix/ulimit.c",
2040f66f451Sopenharmony_ci      "toys/posix/uname.c",
2050f66f451Sopenharmony_ci      "toys/posix/uniq.c",
2060f66f451Sopenharmony_ci      "toys/posix/unlink.c",
2070f66f451Sopenharmony_ci      "toys/posix/uudecode.c",
2080f66f451Sopenharmony_ci      "toys/posix/uuencode.c",
2090f66f451Sopenharmony_ci      "toys/posix/wc.c",
2100f66f451Sopenharmony_ci      "toys/posix/who.c",
2110f66f451Sopenharmony_ci      "toys/posix/xargs.c",
2120f66f451Sopenharmony_ci    ]
2130f66f451Sopenharmony_ci
2140f66f451Sopenharmony_ci    include_dirs = [ "./" ]
2150f66f451Sopenharmony_ci
2160f66f451Sopenharmony_ci    defines = [
2170f66f451Sopenharmony_ci      "_DEFAULT_SOURCE",
2180f66f451Sopenharmony_ci      "OHOS_LITE",
2190f66f451Sopenharmony_ci    ]
2200f66f451Sopenharmony_ci
2210f66f451Sopenharmony_ci    configs -= [ "//build/lite/config:language_c" ]
2220f66f451Sopenharmony_ci    cflags_c = [
2230f66f451Sopenharmony_ci      "-std=gnu11",
2240f66f451Sopenharmony_ci      "-Wall",
2250f66f451Sopenharmony_ci      "-Wundef",
2260f66f451Sopenharmony_ci      "-Wno-char-subscripts",
2270f66f451Sopenharmony_ci      "-Wno-implicit-function-declaration",
2280f66f451Sopenharmony_ci      "-Wno-unused-variable",
2290f66f451Sopenharmony_ci      "-Wno-unused-value",
2300f66f451Sopenharmony_ci      "-Wno-incompatible-pointer-types",
2310f66f451Sopenharmony_ci      "-Wno-int-conversion",
2320f66f451Sopenharmony_ci      "-Wno-sign-compare",
2330f66f451Sopenharmony_ci      "-Wno-format",
2340f66f451Sopenharmony_ci      "-Wno-unused-result",
2350f66f451Sopenharmony_ci      "-Os",
2360f66f451Sopenharmony_ci      "-ffunction-sections",
2370f66f451Sopenharmony_ci      "-fdata-sections",
2380f66f451Sopenharmony_ci      "-fno-asynchronous-unwind-tables",
2390f66f451Sopenharmony_ci      "-fPIE",
2400f66f451Sopenharmony_ci      "-funsigned-char",
2410f66f451Sopenharmony_ci    ]
2420f66f451Sopenharmony_ci
2430f66f451Sopenharmony_ci    ldflags = [
2440f66f451Sopenharmony_ci      "-pie",
2450f66f451Sopenharmony_ci      "-Wl,-z,relro",
2460f66f451Sopenharmony_ci      "-Wl,-z,now",
2470f66f451Sopenharmony_ci      "-Wl,-z,noexecstack",
2480f66f451Sopenharmony_ci      "-lm",
2490f66f451Sopenharmony_ci      "-lcrypt",
2500f66f451Sopenharmony_ci    ]
2510f66f451Sopenharmony_ci  }
2520f66f451Sopenharmony_ci
2530f66f451Sopenharmony_ci  cmd_long_path = [
2540f66f451Sopenharmony_ci    "bin/chmod",
2550f66f451Sopenharmony_ci    "bin/chown",
2560f66f451Sopenharmony_ci    "bin/chroot",
2570f66f451Sopenharmony_ci    "bin/chrt",
2580f66f451Sopenharmony_ci    "bin/chvt",
2590f66f451Sopenharmony_ci    "bin/cksum",
2600f66f451Sopenharmony_ci    "bin/clear",
2610f66f451Sopenharmony_ci    "bin/cmp",
2620f66f451Sopenharmony_ci    "bin/comm",
2630f66f451Sopenharmony_ci    "bin/count",
2640f66f451Sopenharmony_ci    "bin/cp",
2650f66f451Sopenharmony_ci    "bin/cpio",
2660f66f451Sopenharmony_ci    "bin/crc32",
2670f66f451Sopenharmony_ci    "bin/cut",
2680f66f451Sopenharmony_ci    "bin/date",
2690f66f451Sopenharmony_ci    "bin/devmem",
2700f66f451Sopenharmony_ci    "bin/df",
2710f66f451Sopenharmony_ci    "bin/diff",
2720f66f451Sopenharmony_ci    "bin/dirname",
2730f66f451Sopenharmony_ci    "bin/dmesg",
2740f66f451Sopenharmony_ci    "bin/dnsdomainname",
2750f66f451Sopenharmony_ci    "bin/dos2unix",
2760f66f451Sopenharmony_ci    "bin/du",
2770f66f451Sopenharmony_ci    "bin/echo",
2780f66f451Sopenharmony_ci    "bin/egrep",
2790f66f451Sopenharmony_ci    "bin/eject",
2800f66f451Sopenharmony_ci    "bin/env",
2810f66f451Sopenharmony_ci    "bin/expand",
2820f66f451Sopenharmony_ci    "bin/factor",
2830f66f451Sopenharmony_ci    "bin/fallocate",
2840f66f451Sopenharmony_ci    "bin/false",
2850f66f451Sopenharmony_ci    "bin/fgrep",
2860f66f451Sopenharmony_ci    "bin/file",
2870f66f451Sopenharmony_ci    "bin/find",
2880f66f451Sopenharmony_ci    "bin/flock",
2890f66f451Sopenharmony_ci    "bin/fmt",
2900f66f451Sopenharmony_ci    "bin/free",
2910f66f451Sopenharmony_ci    "bin/freeramdisk",
2920f66f451Sopenharmony_ci    "bin/fsfreeze",
2930f66f451Sopenharmony_ci    "bin/fstype",
2940f66f451Sopenharmony_ci    "bin/fsync",
2950f66f451Sopenharmony_ci    "bin/ftpget",
2960f66f451Sopenharmony_ci    "bin/ftpput",
2970f66f451Sopenharmony_ci    "bin/getconf",
2980f66f451Sopenharmony_ci    "sbin/getty",
2990f66f451Sopenharmony_ci    "bin/grep",
3000f66f451Sopenharmony_ci    "bin/groups",
3010f66f451Sopenharmony_ci    "bin/gunzip",
3020f66f451Sopenharmony_ci    "bin/halt",
3030f66f451Sopenharmony_ci    "bin/head",
3040f66f451Sopenharmony_ci    "bin/help",
3050f66f451Sopenharmony_ci    "bin/hexedit",
3060f66f451Sopenharmony_ci    "bin/hostname",
3070f66f451Sopenharmony_ci    "bin/hwclock",
3080f66f451Sopenharmony_ci    "bin/i2cdetect",
3090f66f451Sopenharmony_ci    "bin/i2cdump",
3100f66f451Sopenharmony_ci    "bin/i2cget",
3110f66f451Sopenharmony_ci    "bin/i2cset",
3120f66f451Sopenharmony_ci    "bin/iconv",
3130f66f451Sopenharmony_ci    "bin/id",
3140f66f451Sopenharmony_ci    "bin/ifconfig",
3150f66f451Sopenharmony_ci    "bin/inotifyd",
3160f66f451Sopenharmony_ci    "bin/insmod",
3170f66f451Sopenharmony_ci    "bin/install",
3180f66f451Sopenharmony_ci    "bin/ionice",
3190f66f451Sopenharmony_ci    "bin/iorenice",
3200f66f451Sopenharmony_ci    "bin/iotop",
3210f66f451Sopenharmony_ci    "bin/kill",
3220f66f451Sopenharmony_ci    "bin/killall",
3230f66f451Sopenharmony_ci    "bin/killall5",
3240f66f451Sopenharmony_ci    "bin/link",
3250f66f451Sopenharmony_ci    "bin/ln",
3260f66f451Sopenharmony_ci    "bin/logger",
3270f66f451Sopenharmony_ci    "bin/login",
3280f66f451Sopenharmony_ci    "bin/logname",
3290f66f451Sopenharmony_ci    "bin/losetup",
3300f66f451Sopenharmony_ci    "bin/ls",
3310f66f451Sopenharmony_ci    "bin/lsattr",
3320f66f451Sopenharmony_ci    "bin/lsmod",
3330f66f451Sopenharmony_ci    "bin/lsof",
3340f66f451Sopenharmony_ci    "bin/lspci",
3350f66f451Sopenharmony_ci    "bin/lsusb",
3360f66f451Sopenharmony_ci    "bin/makedevs",
3370f66f451Sopenharmony_ci    "bin/mcookie",
3380f66f451Sopenharmony_ci    "bin/md5sum",
3390f66f451Sopenharmony_ci    "bin/microcom",
3400f66f451Sopenharmony_ci    "bin/mix",
3410f66f451Sopenharmony_ci    "bin/mkdir",
3420f66f451Sopenharmony_ci    "bin/mkfifo",
3430f66f451Sopenharmony_ci    "bin/mknod",
3440f66f451Sopenharmony_ci    "bin/mkpasswd",
3450f66f451Sopenharmony_ci    "bin/mkswap",
3460f66f451Sopenharmony_ci    "bin/mktemp",
3470f66f451Sopenharmony_ci    "bin/modinfo",
3480f66f451Sopenharmony_ci    "bin/more",
3490f66f451Sopenharmony_ci    "bin/mount",
3500f66f451Sopenharmony_ci    "bin/mountpoint",
3510f66f451Sopenharmony_ci    "bin/mv",
3520f66f451Sopenharmony_ci    "bin/nbd-client",
3530f66f451Sopenharmony_ci    "bin/nc",
3540f66f451Sopenharmony_ci    "bin/netcat",
3550f66f451Sopenharmony_ci    "bin/netstat",
3560f66f451Sopenharmony_ci    "bin/nice",
3570f66f451Sopenharmony_ci    "bin/nl",
3580f66f451Sopenharmony_ci    "bin/nohup",
3590f66f451Sopenharmony_ci    "bin/nproc",
3600f66f451Sopenharmony_ci    "bin/nsenter",
3610f66f451Sopenharmony_ci    "bin/od",
3620f66f451Sopenharmony_ci    "bin/oneit",
3630f66f451Sopenharmony_ci    "bin/partprobe",
3640f66f451Sopenharmony_ci    "bin/passwd",
3650f66f451Sopenharmony_ci    "bin/paste",
3660f66f451Sopenharmony_ci    "bin/patch",
3670f66f451Sopenharmony_ci    "bin/pgrep",
3680f66f451Sopenharmony_ci    "bin/pidof",
3690f66f451Sopenharmony_ci    "bin/ping",
3700f66f451Sopenharmony_ci    "bin/ping6",
3710f66f451Sopenharmony_ci    "bin/pivot_root",
3720f66f451Sopenharmony_ci    "bin/pkill",
3730f66f451Sopenharmony_ci    "bin/pmap",
3740f66f451Sopenharmony_ci    "bin/poweroff",
3750f66f451Sopenharmony_ci    "bin/printenv",
3760f66f451Sopenharmony_ci    "bin/printf",
3770f66f451Sopenharmony_ci    "bin/prlimit",
3780f66f451Sopenharmony_ci    "bin/ps",
3790f66f451Sopenharmony_ci    "bin/pwd",
3800f66f451Sopenharmony_ci    "bin/pwdx",
3810f66f451Sopenharmony_ci    "bin/readahead",
3820f66f451Sopenharmony_ci    "bin/readlink",
3830f66f451Sopenharmony_ci    "bin/realpath",
3840f66f451Sopenharmony_ci    "bin/reboot",
3850f66f451Sopenharmony_ci    "bin/renice",
3860f66f451Sopenharmony_ci    "bin/reset",
3870f66f451Sopenharmony_ci    "bin/rev",
3880f66f451Sopenharmony_ci    "bin/rfkill",
3890f66f451Sopenharmony_ci    "bin/rm",
3900f66f451Sopenharmony_ci    "bin/rmdir",
3910f66f451Sopenharmony_ci    "bin/rmmod",
3920f66f451Sopenharmony_ci    "bin/sed",
3930f66f451Sopenharmony_ci    "bin/seq",
3940f66f451Sopenharmony_ci    "bin/setfattr",
3950f66f451Sopenharmony_ci    "bin/setsid",
3960f66f451Sopenharmony_ci    "bin/shalsum",
3970f66f451Sopenharmony_ci    "bin/shred",
3980f66f451Sopenharmony_ci    "bin/sleep",
3990f66f451Sopenharmony_ci    "bin/sntp",
4000f66f451Sopenharmony_ci    "bin/sort",
4010f66f451Sopenharmony_ci    "bin/split",
4020f66f451Sopenharmony_ci    "bin/stat",
4030f66f451Sopenharmony_ci    "bin/strings",
4040f66f451Sopenharmony_ci    "bin/su",
4050f66f451Sopenharmony_ci    "bin/swapoff",
4060f66f451Sopenharmony_ci    "bin/swapon",
4070f66f451Sopenharmony_ci    "bin/switch_root",
4080f66f451Sopenharmony_ci    "bin/sync",
4090f66f451Sopenharmony_ci    "bin/sysctrl",
4100f66f451Sopenharmony_ci    "bin/tac",
4110f66f451Sopenharmony_ci    "bin/tail",
4120f66f451Sopenharmony_ci    "bin/tar",
4130f66f451Sopenharmony_ci    "bin/taskset",
4140f66f451Sopenharmony_ci    "bin/tee",
4150f66f451Sopenharmony_ci    "bin/test",
4160f66f451Sopenharmony_ci    "bin/time",
4170f66f451Sopenharmony_ci    "bin/timeout",
4180f66f451Sopenharmony_ci    "bin/top",
4190f66f451Sopenharmony_ci    "bin/touch",
4200f66f451Sopenharmony_ci    "bin/true",
4210f66f451Sopenharmony_ci    "bin/truncate",
4220f66f451Sopenharmony_ci    "bin/tty",
4230f66f451Sopenharmony_ci    "bin/tunctl",
4240f66f451Sopenharmony_ci    "bin/ulimit",
4250f66f451Sopenharmony_ci    "bin/umount",
4260f66f451Sopenharmony_ci    "bin/uname",
4270f66f451Sopenharmony_ci    "bin/uniq",
4280f66f451Sopenharmony_ci    "bin/unix2dos",
4290f66f451Sopenharmony_ci    "bin/unlink",
4300f66f451Sopenharmony_ci    "bin/unshare",
4310f66f451Sopenharmony_ci    "bin/uptime",
4320f66f451Sopenharmony_ci    "bin/usleep",
4330f66f451Sopenharmony_ci    "bin/uudecode",
4340f66f451Sopenharmony_ci    "bin/uuencode",
4350f66f451Sopenharmony_ci    "bin/uuidgen",
4360f66f451Sopenharmony_ci    "bin/vconfig",
4370f66f451Sopenharmony_ci    "bin/vmstat",
4380f66f451Sopenharmony_ci    "bin/w",
4390f66f451Sopenharmony_ci    "bin/watch",
4400f66f451Sopenharmony_ci    "bin/wc",
4410f66f451Sopenharmony_ci    "bin/which",
4420f66f451Sopenharmony_ci    "bin/who",
4430f66f451Sopenharmony_ci    "bin/whoami",
4440f66f451Sopenharmony_ci    "bin/xargs",
4450f66f451Sopenharmony_ci    "bin/xxd",
4460f66f451Sopenharmony_ci    "bin/yes",
4470f66f451Sopenharmony_ci    "bin/zcat",
4480f66f451Sopenharmony_ci    "bin/mdev",
4490f66f451Sopenharmony_ci    "bin/telnetd",
4500f66f451Sopenharmony_ci    "bin/route",
4510f66f451Sopenharmony_ci  ]
4520f66f451Sopenharmony_ci
4530f66f451Sopenharmony_ci  foreach(path, cmd_long_path) {
4540f66f451Sopenharmony_ci    exec_script("install.py",
4550f66f451Sopenharmony_ci                [
4560f66f451Sopenharmony_ci                  "--long_path",
4570f66f451Sopenharmony_ci                  path,
4580f66f451Sopenharmony_ci                  "--out_dir",
4590f66f451Sopenharmony_ci                  rebase_path("$root_out_dir"),
4600f66f451Sopenharmony_ci                ])
4610f66f451Sopenharmony_ci  }
4620f66f451Sopenharmony_ci} else {
4630f66f451Sopenharmony_ci  import("//build/ohos.gni")
4640f66f451Sopenharmony_ci  import("toybox.gni")
4650f66f451Sopenharmony_ci
4660f66f451Sopenharmony_ci  ohos_executable("su") {
4670f66f451Sopenharmony_ci    sources = [ "openharmony/su.c" ]
4680f66f451Sopenharmony_ci
4690f66f451Sopenharmony_ci    include_dirs = [ "./openharmony" ]
4700f66f451Sopenharmony_ci
4710f66f451Sopenharmony_ci    cflags_c = [
4720f66f451Sopenharmony_ci      "-std=gnu11",
4730f66f451Sopenharmony_ci      "-Wall",
4740f66f451Sopenharmony_ci      "-Wundef",
4750f66f451Sopenharmony_ci      "-Wno-char-subscripts",
4760f66f451Sopenharmony_ci      "-Wno-implicit-function-declaration",
4770f66f451Sopenharmony_ci      "-Wno-unused-variable",
4780f66f451Sopenharmony_ci      "-Wno-unused-value",
4790f66f451Sopenharmony_ci      "-Wno-incompatible-pointer-types",
4800f66f451Sopenharmony_ci      "-Wno-int-conversion",
4810f66f451Sopenharmony_ci      "-Wno-sign-compare",
4820f66f451Sopenharmony_ci      "-Wno-format",
4830f66f451Sopenharmony_ci      "-Wno-unused-result",
4840f66f451Sopenharmony_ci      "-Os",
4850f66f451Sopenharmony_ci      "-ffunction-sections",
4860f66f451Sopenharmony_ci      "-fdata-sections",
4870f66f451Sopenharmony_ci      "-fno-asynchronous-unwind-tables",
4880f66f451Sopenharmony_ci      "-fPIE",
4890f66f451Sopenharmony_ci      "-funsigned-char",
4900f66f451Sopenharmony_ci      "-Wno-string-plus-int",
4910f66f451Sopenharmony_ci      "-Wno-tautological-constant-compare",
4920f66f451Sopenharmony_ci      "-Wno-string-conversion",
4930f66f451Sopenharmony_ci      "-Wno-unused-but-set-variable",
4940f66f451Sopenharmony_ci    ]
4950f66f451Sopenharmony_ci
4960f66f451Sopenharmony_ci    ldflags = [
4970f66f451Sopenharmony_ci      "-pie",
4980f66f451Sopenharmony_ci      "-Wl,-z,relro",
4990f66f451Sopenharmony_ci      "-Wl,-z,now",
5000f66f451Sopenharmony_ci      "-Wl,-z,noexecstack",
5010f66f451Sopenharmony_ci      "-lm",
5020f66f451Sopenharmony_ci      "-lcrypt",
5030f66f451Sopenharmony_ci    ]
5040f66f451Sopenharmony_ci
5050f66f451Sopenharmony_ci    part_name = "toybox"
5060f66f451Sopenharmony_ci    subsystem_name = "thirdparty"
5070f66f451Sopenharmony_ci    install_images = [ "eng_system" ]
5080f66f451Sopenharmony_ci    install_enable = true
5090f66f451Sopenharmony_ci  }
5100f66f451Sopenharmony_ci
5110f66f451Sopenharmony_ci  ohos_executable("toybox") {
5120f66f451Sopenharmony_ci    sources = [
5130f66f451Sopenharmony_ci      "lib/args.c",
5140f66f451Sopenharmony_ci      "lib/commas.c",
5150f66f451Sopenharmony_ci      "lib/deflate.c",
5160f66f451Sopenharmony_ci      "lib/dirtree.c",
5170f66f451Sopenharmony_ci      "lib/env.c",
5180f66f451Sopenharmony_ci      "lib/help.c",
5190f66f451Sopenharmony_ci      "lib/lib.c",
5200f66f451Sopenharmony_ci      "lib/linestack.c",
5210f66f451Sopenharmony_ci      "lib/llist.c",
5220f66f451Sopenharmony_ci      "lib/net.c",
5230f66f451Sopenharmony_ci      "lib/password.c",
5240f66f451Sopenharmony_ci      "lib/portability.c",
5250f66f451Sopenharmony_ci      "lib/tty.c",
5260f66f451Sopenharmony_ci      "lib/xwrap.c",
5270f66f451Sopenharmony_ci      "main.c",
5280f66f451Sopenharmony_ci      "toys/android/sendevent.c",
5290f66f451Sopenharmony_ci      "toys/lsb/dmesg.c",
5300f66f451Sopenharmony_ci      "toys/lsb/gzip.c",
5310f66f451Sopenharmony_ci      "toys/lsb/hostname.c",
5320f66f451Sopenharmony_ci      "toys/lsb/killall.c",
5330f66f451Sopenharmony_ci      "toys/lsb/md5sum.c",
5340f66f451Sopenharmony_ci      "toys/lsb/mknod.c",
5350f66f451Sopenharmony_ci      "toys/lsb/mktemp.c",
5360f66f451Sopenharmony_ci      "toys/lsb/mount.c",
5370f66f451Sopenharmony_ci      "toys/lsb/passwd.c",
5380f66f451Sopenharmony_ci      "toys/lsb/pidof.c",
5390f66f451Sopenharmony_ci      "toys/lsb/seq.c",
5400f66f451Sopenharmony_ci      "toys/lsb/sync.c",
5410f66f451Sopenharmony_ci      "toys/lsb/umount.c",
5420f66f451Sopenharmony_ci      "toys/net/ftpget.c",
5430f66f451Sopenharmony_ci      "toys/net/ifconfig.c",
5440f66f451Sopenharmony_ci      "toys/net/microcom.c",
5450f66f451Sopenharmony_ci      "toys/net/netcat.c",
5460f66f451Sopenharmony_ci      "toys/net/netstat.c",
5470f66f451Sopenharmony_ci      "toys/net/ping.c",
5480f66f451Sopenharmony_ci      "toys/net/rfkill.c",
5490f66f451Sopenharmony_ci      "toys/net/sntp.c",
5500f66f451Sopenharmony_ci      "toys/net/tunctl.c",
5510f66f451Sopenharmony_ci      "toys/other/acpi.c",
5520f66f451Sopenharmony_ci      "toys/other/ascii.c",
5530f66f451Sopenharmony_ci      "toys/other/base64.c",
5540f66f451Sopenharmony_ci      "toys/other/blkid.c",
5550f66f451Sopenharmony_ci      "toys/other/blockdev.c",
5560f66f451Sopenharmony_ci      "toys/other/bzcat.c",
5570f66f451Sopenharmony_ci      "toys/other/chroot.c",
5580f66f451Sopenharmony_ci      "toys/other/chrt.c",
5590f66f451Sopenharmony_ci      "toys/other/chvt.c",
5600f66f451Sopenharmony_ci      "toys/other/clear.c",
5610f66f451Sopenharmony_ci      "toys/other/count.c",
5620f66f451Sopenharmony_ci      "toys/other/devmem.c",
5630f66f451Sopenharmony_ci      "toys/other/dos2unix.c",
5640f66f451Sopenharmony_ci      "toys/other/eject.c",
5650f66f451Sopenharmony_ci      "toys/other/factor.c",
5660f66f451Sopenharmony_ci      "toys/other/fallocate.c",
5670f66f451Sopenharmony_ci      "toys/other/flock.c",
5680f66f451Sopenharmony_ci      "toys/other/fmt.c",
5690f66f451Sopenharmony_ci      "toys/other/free.c",
5700f66f451Sopenharmony_ci      "toys/other/freeramdisk.c",
5710f66f451Sopenharmony_ci      "toys/other/fsfreeze.c",
5720f66f451Sopenharmony_ci      "toys/other/fsync.c",
5730f66f451Sopenharmony_ci      "toys/other/help.c",
5740f66f451Sopenharmony_ci      "toys/other/hexedit.c",
5750f66f451Sopenharmony_ci      "toys/other/hwclock.c",
5760f66f451Sopenharmony_ci      "toys/other/i2ctools.c",
5770f66f451Sopenharmony_ci      "toys/other/inotifyd.c",
5780f66f451Sopenharmony_ci      "toys/other/insmod.c",
5790f66f451Sopenharmony_ci      "toys/other/ionice.c",
5800f66f451Sopenharmony_ci      "toys/other/login.c",
5810f66f451Sopenharmony_ci      "toys/other/losetup.c",
5820f66f451Sopenharmony_ci      "toys/other/lsattr.c",
5830f66f451Sopenharmony_ci      "toys/other/lsmod.c",
5840f66f451Sopenharmony_ci      "toys/other/lspci.c",
5850f66f451Sopenharmony_ci      "toys/other/lsusb.c",
5860f66f451Sopenharmony_ci      "toys/other/makedevs.c",
5870f66f451Sopenharmony_ci      "toys/other/mcookie.c",
5880f66f451Sopenharmony_ci      "toys/other/mix.c",
5890f66f451Sopenharmony_ci      "toys/other/mkpasswd.c",
5900f66f451Sopenharmony_ci      "toys/other/mkswap.c",
5910f66f451Sopenharmony_ci      "toys/other/modinfo.c",
5920f66f451Sopenharmony_ci      "toys/other/mountpoint.c",
5930f66f451Sopenharmony_ci      "toys/other/nbd_client.c",
5940f66f451Sopenharmony_ci      "toys/other/nsenter.c",
5950f66f451Sopenharmony_ci      "toys/other/oneit.c",
5960f66f451Sopenharmony_ci      "toys/other/partprobe.c",
5970f66f451Sopenharmony_ci      "toys/other/pivot_root.c",
5980f66f451Sopenharmony_ci      "toys/other/pmap.c",
5990f66f451Sopenharmony_ci      "toys/other/printenv.c",
6000f66f451Sopenharmony_ci      "toys/other/pwdx.c",
6010f66f451Sopenharmony_ci      "toys/other/readahead.c",
6020f66f451Sopenharmony_ci      "toys/other/readlink.c",
6030f66f451Sopenharmony_ci      "toys/other/realpath.c",
6040f66f451Sopenharmony_ci      "toys/other/reboot.c",
6050f66f451Sopenharmony_ci      "toys/other/reset.c",
6060f66f451Sopenharmony_ci      "toys/other/rev.c",
6070f66f451Sopenharmony_ci      "toys/other/rmmod.c",
6080f66f451Sopenharmony_ci      "toys/other/setfattr.c",
6090f66f451Sopenharmony_ci      "toys/other/setsid.c",
6100f66f451Sopenharmony_ci      "toys/other/shred.c",
6110f66f451Sopenharmony_ci      "toys/other/stat.c",
6120f66f451Sopenharmony_ci      "toys/other/swapoff.c",
6130f66f451Sopenharmony_ci      "toys/other/swapon.c",
6140f66f451Sopenharmony_ci      "toys/other/switch_root.c",
6150f66f451Sopenharmony_ci      "toys/other/sysctl.c",
6160f66f451Sopenharmony_ci      "toys/other/tac.c",
6170f66f451Sopenharmony_ci      "toys/other/taskset.c",
6180f66f451Sopenharmony_ci      "toys/other/timeout.c",
6190f66f451Sopenharmony_ci      "toys/other/truncate.c",
6200f66f451Sopenharmony_ci      "toys/other/uptime.c",
6210f66f451Sopenharmony_ci      "toys/other/usleep.c",
6220f66f451Sopenharmony_ci      "toys/other/uuidgen.c",
6230f66f451Sopenharmony_ci      "toys/other/vconfig.c",
6240f66f451Sopenharmony_ci      "toys/other/vmstat.c",
6250f66f451Sopenharmony_ci      "toys/other/w.c",
6260f66f451Sopenharmony_ci      "toys/other/watch.c",
6270f66f451Sopenharmony_ci      "toys/other/which.c",
6280f66f451Sopenharmony_ci      "toys/other/xxd.c",
6290f66f451Sopenharmony_ci      "toys/other/yes.c",
6300f66f451Sopenharmony_ci      "toys/pending/bootchartd.c",
6310f66f451Sopenharmony_ci      "toys/pending/dd.c",
6320f66f451Sopenharmony_ci      "toys/pending/getty.c",
6330f66f451Sopenharmony_ci      "toys/pending/lsof.c",
6340f66f451Sopenharmony_ci      "toys/pending/mdev.c",
6350f66f451Sopenharmony_ci      "toys/pending/more.c",
6360f66f451Sopenharmony_ci      "toys/pending/route.c",
6370f66f451Sopenharmony_ci      "toys/pending/telnetd.c",
6380f66f451Sopenharmony_ci      "toys/posix/basename.c",
6390f66f451Sopenharmony_ci      "toys/posix/cal.c",
6400f66f451Sopenharmony_ci      "toys/posix/cat.c",
6410f66f451Sopenharmony_ci      "toys/posix/chgrp.c",
6420f66f451Sopenharmony_ci      "toys/posix/chmod.c",
6430f66f451Sopenharmony_ci      "toys/posix/cksum.c",
6440f66f451Sopenharmony_ci      "toys/posix/cmp.c",
6450f66f451Sopenharmony_ci      "toys/posix/comm.c",
6460f66f451Sopenharmony_ci      "toys/posix/cp.c",
6470f66f451Sopenharmony_ci      "toys/posix/cpio.c",
6480f66f451Sopenharmony_ci      "toys/posix/cut.c",
6490f66f451Sopenharmony_ci      "toys/posix/date.c",
6500f66f451Sopenharmony_ci      "toys/posix/df.c",
6510f66f451Sopenharmony_ci      "toys/posix/dirname.c",
6520f66f451Sopenharmony_ci      "toys/posix/du.c",
6530f66f451Sopenharmony_ci      "toys/posix/echo.c",
6540f66f451Sopenharmony_ci      "toys/posix/env.c",
6550f66f451Sopenharmony_ci      "toys/posix/expand.c",
6560f66f451Sopenharmony_ci      "toys/posix/false.c",
6570f66f451Sopenharmony_ci      "toys/posix/file.c",
6580f66f451Sopenharmony_ci      "toys/posix/find.c",
6590f66f451Sopenharmony_ci      "toys/posix/getconf.c",
6600f66f451Sopenharmony_ci      "toys/posix/grep.c",
6610f66f451Sopenharmony_ci      "toys/posix/head.c",
6620f66f451Sopenharmony_ci      "toys/posix/iconv.c",
6630f66f451Sopenharmony_ci      "toys/posix/id.c",
6640f66f451Sopenharmony_ci      "toys/posix/kill.c",
6650f66f451Sopenharmony_ci      "toys/posix/link.c",
6660f66f451Sopenharmony_ci      "toys/posix/ln.c",
6670f66f451Sopenharmony_ci      "toys/posix/logger.c",
6680f66f451Sopenharmony_ci      "toys/posix/ls.c",
6690f66f451Sopenharmony_ci      "toys/posix/mkdir.c",
6700f66f451Sopenharmony_ci      "toys/posix/mkfifo.c",
6710f66f451Sopenharmony_ci      "toys/posix/nice.c",
6720f66f451Sopenharmony_ci      "toys/posix/nl.c",
6730f66f451Sopenharmony_ci      "toys/posix/nohup.c",
6740f66f451Sopenharmony_ci      "toys/posix/od.c",
6750f66f451Sopenharmony_ci      "toys/posix/paste.c",
6760f66f451Sopenharmony_ci      "toys/posix/patch.c",
6770f66f451Sopenharmony_ci      "toys/posix/printf.c",
6780f66f451Sopenharmony_ci      "toys/posix/ps.c",
6790f66f451Sopenharmony_ci      "toys/posix/pwd.c",
6800f66f451Sopenharmony_ci      "toys/posix/renice.c",
6810f66f451Sopenharmony_ci      "toys/posix/rm.c",
6820f66f451Sopenharmony_ci      "toys/posix/rmdir.c",
6830f66f451Sopenharmony_ci      "toys/posix/sed.c",
6840f66f451Sopenharmony_ci      "toys/posix/sleep.c",
6850f66f451Sopenharmony_ci      "toys/posix/sort.c",
6860f66f451Sopenharmony_ci      "toys/posix/split.c",
6870f66f451Sopenharmony_ci      "toys/posix/strings.c",
6880f66f451Sopenharmony_ci      "toys/posix/tail.c",
6890f66f451Sopenharmony_ci      "toys/posix/tar.c",
6900f66f451Sopenharmony_ci      "toys/posix/tee.c",
6910f66f451Sopenharmony_ci      "toys/posix/test.c",
6920f66f451Sopenharmony_ci      "toys/posix/time.c",
6930f66f451Sopenharmony_ci      "toys/posix/touch.c",
6940f66f451Sopenharmony_ci      "toys/posix/true.c",
6950f66f451Sopenharmony_ci      "toys/posix/tty.c",
6960f66f451Sopenharmony_ci      "toys/posix/ulimit.c",
6970f66f451Sopenharmony_ci      "toys/posix/uname.c",
6980f66f451Sopenharmony_ci      "toys/posix/uniq.c",
6990f66f451Sopenharmony_ci      "toys/posix/unlink.c",
7000f66f451Sopenharmony_ci      "toys/posix/uudecode.c",
7010f66f451Sopenharmony_ci      "toys/posix/uuencode.c",
7020f66f451Sopenharmony_ci      "toys/posix/wc.c",
7030f66f451Sopenharmony_ci      "toys/posix/who.c",
7040f66f451Sopenharmony_ci      "toys/posix/xargs.c",
7050f66f451Sopenharmony_ci    ]
7060f66f451Sopenharmony_ci
7070f66f451Sopenharmony_ci    include_dirs = [ "./" ]
7080f66f451Sopenharmony_ci
7090f66f451Sopenharmony_ci    cflags_c = [
7100f66f451Sopenharmony_ci      "-std=gnu11",
7110f66f451Sopenharmony_ci      "-Wall",
7120f66f451Sopenharmony_ci      "-Wundef",
7130f66f451Sopenharmony_ci      "-Wno-char-subscripts",
7140f66f451Sopenharmony_ci      "-Wno-implicit-function-declaration",
7150f66f451Sopenharmony_ci      "-Wno-unused-variable",
7160f66f451Sopenharmony_ci      "-Wno-unused-value",
7170f66f451Sopenharmony_ci      "-Wno-incompatible-pointer-types",
7180f66f451Sopenharmony_ci      "-Wno-int-conversion",
7190f66f451Sopenharmony_ci      "-Wno-sign-compare",
7200f66f451Sopenharmony_ci      "-Wno-format",
7210f66f451Sopenharmony_ci      "-Wno-unused-result",
7220f66f451Sopenharmony_ci      "-Os",
7230f66f451Sopenharmony_ci      "-ffunction-sections",
7240f66f451Sopenharmony_ci      "-fdata-sections",
7250f66f451Sopenharmony_ci      "-fno-asynchronous-unwind-tables",
7260f66f451Sopenharmony_ci      "-fPIE",
7270f66f451Sopenharmony_ci      "-funsigned-char",
7280f66f451Sopenharmony_ci      "-Wno-string-plus-int",
7290f66f451Sopenharmony_ci      "-Wno-tautological-constant-compare",
7300f66f451Sopenharmony_ci      "-Wno-string-conversion",
7310f66f451Sopenharmony_ci      "-Wno-unused-but-set-variable",
7320f66f451Sopenharmony_ci    ]
7330f66f451Sopenharmony_ci
7340f66f451Sopenharmony_ci    ldflags = [
7350f66f451Sopenharmony_ci      "-pie",
7360f66f451Sopenharmony_ci      "-Wl,-z,relro",
7370f66f451Sopenharmony_ci      "-Wl,-z,now",
7380f66f451Sopenharmony_ci      "-Wl,-z,noexecstack",
7390f66f451Sopenharmony_ci      "-lm",
7400f66f451Sopenharmony_ci      "-lcrypt",
7410f66f451Sopenharmony_ci    ]
7420f66f451Sopenharmony_ci
7430f66f451Sopenharmony_ci    if (build_selinux) {
7440f66f451Sopenharmony_ci      cflags_c += [
7450f66f451Sopenharmony_ci        "-D_GUN_SOURCE",
7460f66f451Sopenharmony_ci        "-DUSE_PCRE2",
7470f66f451Sopenharmony_ci        "-w",
7480f66f451Sopenharmony_ci        "-DWITH_SELINUX",
7490f66f451Sopenharmony_ci        "-DCUSTOM_GET_CONTEXT",
7500f66f451Sopenharmony_ci      ]
7510f66f451Sopenharmony_ci    }
7520f66f451Sopenharmony_ci
7530f66f451Sopenharmony_ci    symlink_target_name = [
7540f66f451Sopenharmony_ci      "acpi",
7550f66f451Sopenharmony_ci      "arch",
7560f66f451Sopenharmony_ci      "ascii",
7570f66f451Sopenharmony_ci      "base64",
7580f66f451Sopenharmony_ci      "basename",
7590f66f451Sopenharmony_ci      "blockdev",
7600f66f451Sopenharmony_ci      "bunzip2",
7610f66f451Sopenharmony_ci      "bzcat",
7620f66f451Sopenharmony_ci      "cal",
7630f66f451Sopenharmony_ci      "cat",
7640f66f451Sopenharmony_ci      "chattr",
7650f66f451Sopenharmony_ci      "chcon",
7660f66f451Sopenharmony_ci      "chgrp",
7670f66f451Sopenharmony_ci      "chmod",
7680f66f451Sopenharmony_ci      "chown",
7690f66f451Sopenharmony_ci      "chroot",
7700f66f451Sopenharmony_ci      "chrt",
7710f66f451Sopenharmony_ci      "chvt",
7720f66f451Sopenharmony_ci      "cksum",
7730f66f451Sopenharmony_ci      "clear",
7740f66f451Sopenharmony_ci      "cmp",
7750f66f451Sopenharmony_ci      "comm",
7760f66f451Sopenharmony_ci      "count",
7770f66f451Sopenharmony_ci      "cp",
7780f66f451Sopenharmony_ci      "cpio",
7790f66f451Sopenharmony_ci      "crc32",
7800f66f451Sopenharmony_ci      "cut",
7810f66f451Sopenharmony_ci      "date",
7820f66f451Sopenharmony_ci      "dd",
7830f66f451Sopenharmony_ci      "devmem",
7840f66f451Sopenharmony_ci      "df",
7850f66f451Sopenharmony_ci      "dirname",
7860f66f451Sopenharmony_ci      "dmesg",
7870f66f451Sopenharmony_ci      "dnsdomainname",
7880f66f451Sopenharmony_ci      "dos2unix",
7890f66f451Sopenharmony_ci      "du",
7900f66f451Sopenharmony_ci      "echo",
7910f66f451Sopenharmony_ci      "egrep",
7920f66f451Sopenharmony_ci      "eject",
7930f66f451Sopenharmony_ci      "env",
7940f66f451Sopenharmony_ci      "expand",
7950f66f451Sopenharmony_ci      "factor",
7960f66f451Sopenharmony_ci      "fallocate",
7970f66f451Sopenharmony_ci      "false",
7980f66f451Sopenharmony_ci      "fgrep",
7990f66f451Sopenharmony_ci      "file",
8000f66f451Sopenharmony_ci      "find",
8010f66f451Sopenharmony_ci      "flock",
8020f66f451Sopenharmony_ci      "fmt",
8030f66f451Sopenharmony_ci      "free",
8040f66f451Sopenharmony_ci      "freeramdisk",
8050f66f451Sopenharmony_ci      "fsfreeze",
8060f66f451Sopenharmony_ci      "fstype",
8070f66f451Sopenharmony_ci      "fsync",
8080f66f451Sopenharmony_ci      "ftpget",
8090f66f451Sopenharmony_ci      "ftpput",
8100f66f451Sopenharmony_ci      "getconf",
8110f66f451Sopenharmony_ci      "grep",
8120f66f451Sopenharmony_ci      "groups",
8130f66f451Sopenharmony_ci      "gunzip",
8140f66f451Sopenharmony_ci      "gzip",
8150f66f451Sopenharmony_ci      "halt",
8160f66f451Sopenharmony_ci      "head",
8170f66f451Sopenharmony_ci      "help",
8180f66f451Sopenharmony_ci      "hexedit",
8190f66f451Sopenharmony_ci      "hostname",
8200f66f451Sopenharmony_ci      "hwclock",
8210f66f451Sopenharmony_ci      "i2cdetect",
8220f66f451Sopenharmony_ci      "i2cdump",
8230f66f451Sopenharmony_ci      "i2cget",
8240f66f451Sopenharmony_ci      "i2cset",
8250f66f451Sopenharmony_ci      "iconv",
8260f66f451Sopenharmony_ci      "id",
8270f66f451Sopenharmony_ci      "ifconfig",
8280f66f451Sopenharmony_ci      "inotifyd",
8290f66f451Sopenharmony_ci      "insmod",
8300f66f451Sopenharmony_ci      "install",
8310f66f451Sopenharmony_ci      "ionice",
8320f66f451Sopenharmony_ci      "iorenice",
8330f66f451Sopenharmony_ci      "iotop",
8340f66f451Sopenharmony_ci      "kill",
8350f66f451Sopenharmony_ci      "killall",
8360f66f451Sopenharmony_ci      "killall5",
8370f66f451Sopenharmony_ci      "link",
8380f66f451Sopenharmony_ci      "ln",
8390f66f451Sopenharmony_ci      "logger",
8400f66f451Sopenharmony_ci      "login",
8410f66f451Sopenharmony_ci      "logname",
8420f66f451Sopenharmony_ci      "losetup",
8430f66f451Sopenharmony_ci      "ls",
8440f66f451Sopenharmony_ci      "lsattr",
8450f66f451Sopenharmony_ci      "lsmod",
8460f66f451Sopenharmony_ci      "lsof",
8470f66f451Sopenharmony_ci      "lspci",
8480f66f451Sopenharmony_ci      "lsusb",
8490f66f451Sopenharmony_ci      "makedevs",
8500f66f451Sopenharmony_ci      "mcookie",
8510f66f451Sopenharmony_ci      "md5sum",
8520f66f451Sopenharmony_ci      "microcom",
8530f66f451Sopenharmony_ci      "mix",
8540f66f451Sopenharmony_ci      "mkdir",
8550f66f451Sopenharmony_ci      "mkfifo",
8560f66f451Sopenharmony_ci      "mknod",
8570f66f451Sopenharmony_ci      "mkpasswd",
8580f66f451Sopenharmony_ci      "mkswap",
8590f66f451Sopenharmony_ci      "mktemp",
8600f66f451Sopenharmony_ci      "modinfo",
8610f66f451Sopenharmony_ci      "more",
8620f66f451Sopenharmony_ci      "mount",
8630f66f451Sopenharmony_ci      "mountpoint",
8640f66f451Sopenharmony_ci      "mv",
8650f66f451Sopenharmony_ci      "nbd-client",
8660f66f451Sopenharmony_ci      "netstat",
8670f66f451Sopenharmony_ci      "nice",
8680f66f451Sopenharmony_ci      "nl",
8690f66f451Sopenharmony_ci      "nohup",
8700f66f451Sopenharmony_ci      "nproc",
8710f66f451Sopenharmony_ci      "nsenter",
8720f66f451Sopenharmony_ci      "od",
8730f66f451Sopenharmony_ci      "oneit",
8740f66f451Sopenharmony_ci      "partprobe",
8750f66f451Sopenharmony_ci      "passwd",
8760f66f451Sopenharmony_ci      "paste",
8770f66f451Sopenharmony_ci      "patch",
8780f66f451Sopenharmony_ci      "pgrep",
8790f66f451Sopenharmony_ci      "pidof",
8800f66f451Sopenharmony_ci      "ping",
8810f66f451Sopenharmony_ci      "ping6",
8820f66f451Sopenharmony_ci      "pivot_root",
8830f66f451Sopenharmony_ci      "pkill",
8840f66f451Sopenharmony_ci      "pmap",
8850f66f451Sopenharmony_ci      "poweroff",
8860f66f451Sopenharmony_ci      "printenv",
8870f66f451Sopenharmony_ci      "printf",
8880f66f451Sopenharmony_ci      "prlimit",
8890f66f451Sopenharmony_ci      "ps",
8900f66f451Sopenharmony_ci      "pwd",
8910f66f451Sopenharmony_ci      "pwdx",
8920f66f451Sopenharmony_ci      "readahead",
8930f66f451Sopenharmony_ci      "readlink",
8940f66f451Sopenharmony_ci      "realpath",
8950f66f451Sopenharmony_ci      "renice",
8960f66f451Sopenharmony_ci      "reset",
8970f66f451Sopenharmony_ci      "restorecon",
8980f66f451Sopenharmony_ci      "rev",
8990f66f451Sopenharmony_ci      "rfkill",
9000f66f451Sopenharmony_ci      "rm",
9010f66f451Sopenharmony_ci      "rmdir",
9020f66f451Sopenharmony_ci      "rmmod",
9030f66f451Sopenharmony_ci      "sed",
9040f66f451Sopenharmony_ci      "sendevent",
9050f66f451Sopenharmony_ci      "seq",
9060f66f451Sopenharmony_ci      "setfattr",
9070f66f451Sopenharmony_ci      "setsid",
9080f66f451Sopenharmony_ci      "sha1sum",
9090f66f451Sopenharmony_ci      "sha256sum",
9100f66f451Sopenharmony_ci      "shred",
9110f66f451Sopenharmony_ci      "sleep",
9120f66f451Sopenharmony_ci      "sntp",
9130f66f451Sopenharmony_ci      "sort",
9140f66f451Sopenharmony_ci      "split",
9150f66f451Sopenharmony_ci      "stat",
9160f66f451Sopenharmony_ci      "strings",
9170f66f451Sopenharmony_ci      "swapoff",
9180f66f451Sopenharmony_ci      "swapon",
9190f66f451Sopenharmony_ci      "switch_root",
9200f66f451Sopenharmony_ci      "sync",
9210f66f451Sopenharmony_ci      "sysctl",
9220f66f451Sopenharmony_ci      "tac",
9230f66f451Sopenharmony_ci      "tail",
9240f66f451Sopenharmony_ci      "tar",
9250f66f451Sopenharmony_ci      "taskset",
9260f66f451Sopenharmony_ci      "tee",
9270f66f451Sopenharmony_ci      "test",
9280f66f451Sopenharmony_ci      "time",
9290f66f451Sopenharmony_ci      "timeout",
9300f66f451Sopenharmony_ci      "top",
9310f66f451Sopenharmony_ci      "touch",
9320f66f451Sopenharmony_ci      "true",
9330f66f451Sopenharmony_ci      "truncate",
9340f66f451Sopenharmony_ci      "tty",
9350f66f451Sopenharmony_ci      "tunctl",
9360f66f451Sopenharmony_ci      "ulimit",
9370f66f451Sopenharmony_ci      "umount",
9380f66f451Sopenharmony_ci      "uname",
9390f66f451Sopenharmony_ci      "uniq",
9400f66f451Sopenharmony_ci      "unix2dos",
9410f66f451Sopenharmony_ci      "unlink",
9420f66f451Sopenharmony_ci      "unshare",
9430f66f451Sopenharmony_ci      "uptime",
9440f66f451Sopenharmony_ci      "usleep",
9450f66f451Sopenharmony_ci      "uudecode",
9460f66f451Sopenharmony_ci      "uuencode",
9470f66f451Sopenharmony_ci      "uuidgen",
9480f66f451Sopenharmony_ci      "vconfig",
9490f66f451Sopenharmony_ci      "vmstat",
9500f66f451Sopenharmony_ci      "w",
9510f66f451Sopenharmony_ci      "watch",
9520f66f451Sopenharmony_ci      "wc",
9530f66f451Sopenharmony_ci      "which",
9540f66f451Sopenharmony_ci      "who",
9550f66f451Sopenharmony_ci      "whoami",
9560f66f451Sopenharmony_ci      "xargs",
9570f66f451Sopenharmony_ci      "xxd",
9580f66f451Sopenharmony_ci      "yes",
9590f66f451Sopenharmony_ci      "zcat",
9600f66f451Sopenharmony_ci    ]
9610f66f451Sopenharmony_ci
9620f66f451Sopenharmony_ci    deps = []
9630f66f451Sopenharmony_ci    defines = [ "_DEFAULT_SOURCE" ]
9640f66f451Sopenharmony_ci
9650f66f451Sopenharmony_ci    if (build_selinux) {
9660f66f451Sopenharmony_ci      sources += [ "toys/other/chcon.c" ]
9670f66f451Sopenharmony_ci      external_deps = [
9680f66f451Sopenharmony_ci        "openssl:libcrypto_shared",
9690f66f451Sopenharmony_ci        "openssl:libssl_shared",
9700f66f451Sopenharmony_ci        "selinux:libselinux",
9710f66f451Sopenharmony_ci      ]
9720f66f451Sopenharmony_ci      symlink_target_name += [ "chcon" ]
9730f66f451Sopenharmony_ci      symlink_target_name -= [ "restorecon" ]
9740f66f451Sopenharmony_ci
9750f66f451Sopenharmony_ci      if (toybox_extended_cmd) {
9760f66f451Sopenharmony_ci        defines += [ "TOYBOX_EXTENDED_CMD" ]
9770f66f451Sopenharmony_ci        sources += [
9780f66f451Sopenharmony_ci          "toys/pending/awk.c",
9790f66f451Sopenharmony_ci          "toys/pending/diff.c",
9800f66f451Sopenharmony_ci          "toys/pending/telnet.c",
9810f66f451Sopenharmony_ci          "toys/pending/traceroute.c",
9820f66f451Sopenharmony_ci          "toys/pending/wget.c",
9830f66f451Sopenharmony_ci        ]
9840f66f451Sopenharmony_ci        symlink_target_name += [
9850f66f451Sopenharmony_ci          "traceroute",
9860f66f451Sopenharmony_ci          "traceroute6",
9870f66f451Sopenharmony_ci          "telnet",
9880f66f451Sopenharmony_ci          "wget",
9890f66f451Sopenharmony_ci          "awk",
9900f66f451Sopenharmony_ci          "diff",
9910f66f451Sopenharmony_ci        ]
9920f66f451Sopenharmony_ci      }
9930f66f451Sopenharmony_ci
9940f66f451Sopenharmony_ci      if (build_variant == "user") {
9950f66f451Sopenharmony_ci        defines += [ "TOYBOX_BUILD_USER" ]
9960f66f451Sopenharmony_ci      }
9970f66f451Sopenharmony_ci    }
9980f66f451Sopenharmony_ci
9990f66f451Sopenharmony_ci    part_name = "toybox"
10000f66f451Sopenharmony_ci    subsystem_name = "thirdparty"
10010f66f451Sopenharmony_ci    install_images = [
10020f66f451Sopenharmony_ci      "system",
10030f66f451Sopenharmony_ci      "ramdisk",
10040f66f451Sopenharmony_ci      "updater",
10050f66f451Sopenharmony_ci    ]
10060f66f451Sopenharmony_ci    install_enable = true
10070f66f451Sopenharmony_ci  }
10080f66f451Sopenharmony_ci}
1009