OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [extra/] [scripts/] [gen_bits_syscall_h.sh] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#!/bin/sh
2
#
3
# June 27, 2001         Manuel Novoa III
4
#
5
# This script expects TOPDIR and CC (as used in the Makefiles) to be set in
6
# the environment, and outputs the appropriate $TOPDIR/include/bits/sysnum.h
7
# corresponding to $TOPDIR/include/asm/unistd.h to stdout.
8
#
9
# Warning!!! This does _no_ error checking!!!
10
 
11
UNISTD_H_PATH=$TOPDIR/include/asm/unistd.h
12
INCLUDE_OPTS="-I$TOPDIR/include"
13
 
14
( echo "#include \"$UNISTD_H_PATH\"" ;
15
  $CC -E -dN $INCLUDE_OPTS $UNISTD_H_PATH | # needed to strip out any kernel-internal defines
16
  sed -ne 's/^[ ]*#define[ ]*__NR_\([A-Za-z0-9_]*\).*/UCLIBC_\1 __NR_\1/gp'
17
) |
18
$CC -E $INCLUDE_OPTS - |
19
( echo "/* WARNING!!! AUTO-GENERATED FILE!!! DO NOT EDIT!!! */" ; echo ;
20
  echo "#ifndef _BITS_SYSNUM_H" ;
21
  echo "#define _BITS_SYSNUM_H" ;
22
  echo ;
23
  echo "#ifndef _SYSCALL_H" ;
24
  echo "# error \"Never use <bits/sysnum.h> directly; include <sys/syscall.h> instead.\"" ;
25
  echo "#endif" ; echo ;
26
  sed -ne 's/^UCLIBC_\([A-Za-z0-9_]*\) *\(.*\)/#undef __NR_\1\
27
#define __NR_\1 \2\
28
#define SYS_\1 __NR_\1/gp'
29
  echo ;
30
  echo "#endif" ;
31
)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.