diff options
author | Maarten Thibaut <murphy@gentoo.org> | 2002-04-18 01:13:34 +0000 |
---|---|---|
committer | Maarten Thibaut <murphy@gentoo.org> | 2002-04-18 01:13:34 +0000 |
commit | fd85e3d578743a23fa62a59d81b82a9cb9859458 (patch) | |
tree | 64452181653faa266e35c9be3b4a721f390f25db /sys-kernel/linux-sources | |
parent | adding developer version (diff) | |
download | historical-fd85e3d578743a23fa62a59d81b82a9cb9859458.tar.gz historical-fd85e3d578743a23fa62a59d81b82a9cb9859458.tar.bz2 historical-fd85e3d578743a23fa62a59d81b82a9cb9859458.zip |
Debian utility for generating /usr/include/asm-sparc* header stubs.
Diffstat (limited to 'sys-kernel/linux-sources')
-rw-r--r-- | sys-kernel/linux-sources/files/generate-asm-sparc | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/sys-kernel/linux-sources/files/generate-asm-sparc b/sys-kernel/linux-sources/files/generate-asm-sparc new file mode 100644 index 000000000000..c0e8f901c42d --- /dev/null +++ b/sys-kernel/linux-sources/files/generate-asm-sparc @@ -0,0 +1,72 @@ +#!/bin/sh -e +# +# $Id: generate-asm-sparc,v 1.1 2002/04/18 01:13:34 murphy Exp $ +# +# Scipt borrowed entirely from Debian Sparc libc6-dev package + +# Idea borrowed from RedHat's kernel package + +if [ -n "$1" ]; then + if [ ! -d "$1" ]; then + echo "$1" does not exist, or is not a directory + exit 1 + fi + cd $1 +else + cd /usr/include +fi + +if [ ! -d asm-sparc -o ! -d asm-sparc64 ] ; then + echo E: asm-sparc and asm-sparc64 must exist, or you will have problems + exit 1 +fi + +rm -rf asm +mkdir asm + +for h in `( ls asm-sparc; ls asm-sparc64 ) | grep '\.h$' | sort -u`; do + name=`echo $h | tr a-z. A-Z_` + # common header + cat > asm/$h << EOF +/* All asm/ files are generated and point to the corresponding + * file in asm-sparc or asm-sparc64. To regenerate, run "generate-asm" + */ + +#ifndef __SPARCSTUB__${name}__ +#define __SPARCSTUB__${name}__ + +EOF + + # common for sparc and sparc64 + if [ -f asm-sparc/$h -a -f asm-sparc64/$h ]; then + cat >> asm/$h <<EOF +#ifdef __arch64__ +#include <asm-sparc64/$h> +#else +#include <asm-sparc/$h> +#endif +EOF + + # sparc only + elif [ -f asm-sparc/$h ]; then + cat >> asm/$h <<EOF +#ifndef __arch64__ +#include <asm-sparc/$h> +#endif +EOF + # sparc64 only + else + cat >> asm/$h <<EOF +#ifdef __arch64__ +#include <asm-sparc64/$h> +#endif +EOF + fi + + # common footer + cat >> asm/$h <<EOF + +#endif /* !__SPARCSTUB__${name}__ */ +EOF + +done |