aboutsummaryrefslogtreecommitdiff
path: root/gen_syscalls.sh
diff options
context:
space:
mode:
authorScott James Remnant <keybuk@google.com>2015-09-24 14:35:31 -0700
committerScott James Remnant <keybuk@google.com>2015-09-24 17:07:32 -0700
commitae2aed82c60220ed73b3170a19eedb317672e1e0 (patch)
tree57c7368118db31bc43442cb0be205a5a84db459f /gen_syscalls.sh
parent34e227494fed804ebbc7054ef64472ab8c6d953b (diff)
downloadminijail-ae2aed82c60220ed73b3170a19eedb317672e1e0.tar.gz
minijail: Fix build on non-Linux hosts
Modifies the compiler to refer to the target C library headers (in the same manner used elsewhere within Android) rather than using the host's, and uses a portable equivalent of the previous sed expression. BUG=24112863 Change-Id: I060d869b779405d0c4e07c61790a0437f6043f0c
Diffstat (limited to 'gen_syscalls.sh')
-rwxr-xr-xgen_syscalls.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/gen_syscalls.sh b/gen_syscalls.sh
index a01d500..78ea89f 100755
--- a/gen_syscalls.sh
+++ b/gen_syscalls.sh
@@ -29,7 +29,8 @@ OUTFILE="$1"
# { "read", __NR_read },
# #endif
SED_MULTILINE='s/#define __(ARM_)?(NR_)([a-z0-9_]*) (.*)$/#ifdef __\1\2\3\
-{ "\1\3", __\1\2\3 },\n#endif/g p;'
+{ "\1\3", __\1\2\3 },\
+#endif/g p;'
cat <<-EOF > "${OUTFILE}"
/* GENERATED BY MAKEFILE */
@@ -38,7 +39,7 @@ cat <<-EOF > "${OUTFILE}"
#include "libsyscalls.h"
const struct syscall_entry syscall_table[] = {
$(echo '#include <asm/unistd.h>' | \
- ${CC} -dD - -E | sed -rne "${SED_MULTILINE}")
+ ${CC} -dD - -E | sed -Ene "${SED_MULTILINE}")
{ NULL, -1 },
};
EOF