aboutsummaryrefslogtreecommitdiff
path: root/gen_syscalls.sh
diff options
context:
space:
mode:
authorJorge Lucangeli Obes <jorgelo@google.com>2015-07-18 17:53:12 +0000
committerJorge Lucangeli Obes <jorgelo@google.com>2015-07-18 17:53:12 +0000
commit20ac22848f02ab78c2be42367722afc204d9774e (patch)
tree1d3cac91f5cc2357a1f5533668082c1de8a40fcc /gen_syscalls.sh
parentb9a322d86635c5b1358af0d46a8be1021f4ddb60 (diff)
downloadminijail-20ac22848f02ab78c2be42367722afc204d9774e.tar.gz
Revert "Add 'Android.mk' file, fix compile on Android."
Fails compile on x86_64, arm64, mips64. Failures have been identified, will re-upload on Monday. This reverts commit b9a322d86635c5b1358af0d46a8be1021f4ddb60. Change-Id: I14b35a3aae618da4ff108328a499505893c15568
Diffstat (limited to 'gen_syscalls.sh')
-rwxr-xr-xgen_syscalls.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/gen_syscalls.sh b/gen_syscalls.sh
index a01d500..3121b42 100755
--- a/gen_syscalls.sh
+++ b/gen_syscalls.sh
@@ -12,13 +12,18 @@
set -e
-if [ $# -ne 2 ]; then
- echo "Usage: $(basename "$0") CC OUTFILE"
+if [ $# -ne 1 ] && [ $# -ne 3 ]; then
+ echo "Usage: $(basename "$0") OUTFILE"
+ echo "Usage: $(basename "$0") CC CFLAGS OUTFILE"
exit 1
fi
-CC="$1"
-shift
+if [ $# -eq 3 ]; then
+ CC="$1"
+ shift
+ CFLAGS="$1"
+ shift
+fi
OUTFILE="$1"
# sed expression which extracts system calls that are
@@ -38,7 +43,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} ${CFLAGS} -dD - -E | sed -rne "${SED_MULTILINE}")
{ NULL, -1 },
};
EOF