1 --- uClibc-0.9.28/extra/scripts/gen_bits_syscall_h.sh.orig 2005-09-18 02:20:04.441119651 -0700
2 +++ uClibc-0.9.28/extra/scripts/gen_bits_syscall_h.sh 2005-09-18 03:17:58.287715035 -0700
4 UNISTD_H_PATH=$TOPDIR/include/asm/unistd.h
5 INCLUDE_OPTS="-I$TOPDIR/include"
7 +# This test is added to avoid mangling the (variable) syscall base value on
9 +if echo "#if defined __arm__ || defined __thumb__
11 +#endif" | $CC -E $INCLUDE_OPTS - | grep xyzzy >/dev/null
13 + echo '/* WARNING!!! AUTO-GENERATED FILE!!! DO NOT EDIT!!! */
14 +#ifndef _BITS_SYSNUM_H
15 +#define _BITS_SYSNUM_H
18 +# error "Never use <bits/sysnum.h> directly; include <sys/syscall.h> instead."
20 + # arm case, assume unistd.h conforms to the one in 2.6.x, if not
21 + # go into a corner and sulk (fix this script) The sed rune below
22 + # expects items of the form UCLIBC_foo at the start of the line
23 + # for each syscall number, the arm syscalls all start with lower
24 + # case alpha and the all-important __NR_SYSCALL_BASE does not...
25 + sed -n -e '/__sys2/Q' -e '/^[ ]*#include/,${
26 + s/^[ ]*#include.*$//
28 + s/^[ ]*#define[ ]*__NR_\([a-z][A-Za-z0-9_]*\)[ ]*\(.*\)[ ]*$/#undef __NR_\1\
29 +#define SYS_\1 __NR_\1/p
33 + # i.e. this relies on the __sys2 definition coming after the last
34 + # sys number define (and #include preceding all useful definitions)
38 ( echo "#include \"$UNISTD_H_PATH\"" ;
39 $CC -E -dN $INCLUDE_OPTS $UNISTD_H_PATH | # needed to strip out any kernel-internal defines
40 sed -ne 's/^[ ]*#define[ ]*__NR_\([A-Za-z0-9_]*\).*/UCLIBC_\1 __NR_\1/gp'