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
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 @@
# { "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 @@
#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