mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.3 KiB

  1. #!/bin/sh -e
  2. # Idea borrowed from RedHat's kernel package
  3. # Feb 02 2003: borrowed from Debian GNU/Linux for ROCK Linux
  4. if [ -n "$1" ]; then
  5. if [ ! -d "$1" ]; then
  6. echo "$1" does not exist, or is not a directory
  7. exit 1
  8. fi
  9. cd $1
  10. echo directory: "$1"
  11. else
  12. cd /usr/include
  13. fi
  14. if [ ! -d asm-sparc -o ! -d asm-sparc64 ] ; then
  15. echo E: asm-sparc and asm-sparc64 must exist, or you will have problems
  16. exit 1
  17. fi
  18. rm -rf asm
  19. mkdir asm
  20. for h in `( ls asm-sparc; ls asm-sparc64 ) | grep '\.h$' | sort -u`; do
  21. name=`echo $h | tr a-z. A-Z_`
  22. # common header
  23. cat > asm/$h << EOF
  24. /* All asm/ files are generated and point to the corresponding
  25. * file in asm-sparc or asm-sparc64. To regenerate, run "generate-asm"
  26. */
  27. #ifndef __SPARCSTUB__${name}__
  28. #define __SPARCSTUB__${name}__
  29. EOF
  30. # common for sparc and sparc64
  31. if [ -f asm-sparc/$h -a -f asm-sparc64/$h ]; then
  32. cat >> asm/$h <<EOF
  33. #ifdef __arch64__
  34. #include <asm-sparc64/$h>
  35. #else
  36. #include <asm-sparc/$h>
  37. #endif
  38. EOF
  39. # sparc only
  40. elif [ -f asm-sparc/$h ]; then
  41. cat >> asm/$h <<EOF
  42. #ifndef __arch64__
  43. #include <asm-sparc/$h>
  44. #endif
  45. EOF
  46. # sparc64 only
  47. else
  48. cat >> asm/$h <<EOF
  49. #ifdef __arch64__
  50. #include <asm-sparc64/$h>
  51. #endif
  52. EOF
  53. fi
  54. # common footer
  55. cat >> asm/$h <<EOF
  56. #endif /* !__SPARCSTUB__${name}__ */
  57. EOF
  58. done