blob: 4e15e1611a5aa6889047f74c8e18f2ced81320ef [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 Andersen868c0572000-12-02 00:44:48 +000013CONFIG_H=${1:-Config.h}
14APPLETS_H=${2:-applets.h}
15gcc -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 }'