blob: 68dbf216262a6cd6a6f64d24a4cbe1c94b62108b [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
Bernhard Reutner-Fischer193bcf32006-11-17 13:17:04 +000013CONFIG_H=${1:-include/autoconf.h}
Eric Andersen3cd27602001-10-24 07:58:02 +000014APPLETS_H=${2:-include/applets.h}
Bernhard Reutner-Fischerf00680e2005-12-29 16:53:47 +000015$HOSTCC -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
Eric Andersen868c0572000-12-02 00:44:48 +000016 awk '/^[ \t]*LINK/{
Bernd Jendrissek55988ae2011-02-20 05:50:04 +010017 dir=substr($2,7)
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 }'