3 # Copyright (C) 2001 Manuel Novoa III <mjn3@uclibc.org>
4 # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
6 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9 # June 27, 2001 Manuel Novoa III
11 # This script expects CC (as used in the Makefiles) to be set
12 # in the environment, and outputs the appropriate bits/sysnum.h #
13 # corresponding to asm/unistd.h to stdout.
15 # Warning!!! This does _no_ error checking!!!
17 if [ "${KERNEL_HEADERS:-/}" != "/" ] ; then
18 INCLUDE_OPTS
="-nostdinc -I${KERNEL_HEADERS}"
20 # Let the toolchain use its configure paths.
25 *icc
*) CC_SYSNUM_ARGS
="-dM" ;;
26 *clang
*) CC_SYSNUM_ARGS
="-dM" ;;
27 *) CC_SYSNUM_ARGS
="-dN" ;;
30 ( echo "#include <asm/unistd.h>";
31 echo "#include <asm/unistd.h>" |
32 $CC -E $CC_SYSNUM_ARGS $INCLUDE_OPTS - |
34 -e 's/^[ ]*#define[ ]*(__ARM_NR_|__NR_)([A-Za-z0-9_]*).*/UCLIBC\1\2 \1\2/gp' \
35 -e 's/^[ ]*#undef[ ]*(__ARM_NR_|__NR_)([A-Za-z0-9_]*).*/UNDEFUCLIBC\1\2 \1\2/gp' # needed to strip out any kernel-internal defines
37 $CC -E $INCLUDE_OPTS - |
40 /* WARNING!!! AUTO-GENERATED FILE!!! DO NOT EDIT!!! */
41 /* See $0 for more information. */
43 #ifndef _BITS_SYSNUM_H
44 #define _BITS_SYSNUM_H
47 # error "Never use <bits/sysnum.h> directly; include <sys/syscall.h> instead."
51 sed -n -r -e 's/^UCLIBC(__ARM_NR_|__NR_)([A-Za-z0-9_]*) *(.*)/#undef \1\2\
53 #define SYS_\2 \1\2/gp' \
54 -e 's/^UNDEFUCLIBC(__ARM_NR_|__NR_)([A-Za-z0-9_]*).*/#undef \1\2\