blob: 5b6677d03bdc921cdd038026dea28bc9cd503db0 [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001#!/bin/sh
Erik Andersenfac10d72000-02-07 05:29:42 +00002# Make busybox links list file.
Eric Andersencc8ed391999-10-05 16:24:54 +00003
Eric Andersena68b21a2001-01-26 20:31:02 +00004# input $1: full path to Config.h
5# input $2: full path to applets.h
6# output (stdout): list of pathnames that should be linked to busybox
7
8# Maintainer: Larry Doolittle <ldoolitt@recycle.lbl.gov>
9
Eric Andersen39eea892001-03-08 21:42:11 +000010export LC_ALL=POSIX
11export LC_CTYPE=POSIX
12
Eric Andersen3cd27602001-10-24 07:58:02 +000013CONFIG_H=${1:-include/config.h}
14APPLETS_H=${2:-include/applets.h}
Eric Andersen868c0572000-12-02 00:44:48 +000015gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
16 awk '/^[ \t]*LINK/{
Eric Andersena68b21a2001-01-26 20:31:02 +000017 dir=substr($2,8)
Eric Andersen868c0572000-12-02 00:44:48 +000018 gsub("_","/",dir)
19 if(dir=="/ROOT") dir=""
20 file=$3
21 gsub("\"","",file)
22 if (file=="busybox") next
23 print tolower(dir) "/" file
24 }'