busybox.mkll 582 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. # Make busybox links list file.
  3. # input $1: full path to Config.h
  4. # input $2: full path to applets.h
  5. # output (stdout): list of pathnames that should be linked to busybox
  6. # Maintainer: Larry Doolittle <ldoolitt@recycle.lbl.gov>
  7. export LC_ALL=POSIX
  8. export LC_CTYPE=POSIX
  9. CONFIG_H=${1:-include/autoconf.h}
  10. APPLETS_H=${2:-include/applets.h}
  11. $HOSTCC -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
  12. awk '/^[ \t]*LINK/{
  13. dir=substr($2,8)
  14. gsub("_","/",dir)
  15. if(dir=="/ROOT") dir=""
  16. file=$3
  17. gsub("\"","",file)
  18. if (file=="busybox") next
  19. print tolower(dir) "/" file
  20. }'