148 lines
4.0 KiB
Bash
148 lines
4.0 KiB
Bash
|
#! /bin/bash
|
|||
|
|
|||
|
###############################################
|
|||
|
### See if we have a busybox.def.h.ORG file ###
|
|||
|
### If not, create it... ###
|
|||
|
###############################################
|
|||
|
if [ ! -e "busybox.def.h.ORG" ]; then
|
|||
|
echo "Creating busybox.def.h.ORG"
|
|||
|
cp busybox.def.h busybox.def.h.ORG
|
|||
|
if [ ! -e "busybox.def.h.ORG" ]; then
|
|||
|
echo "$0: ABORTING: Unable to create busybox.def.h.ORG"
|
|||
|
exit
|
|||
|
fi
|
|||
|
fi
|
|||
|
|
|||
|
###############################################################
|
|||
|
### See if we have a bb.def.h file. If not, extract the ###
|
|||
|
### unchangeable portion of busybox.def.h.ORG into bb.def.h ###
|
|||
|
###############################################################
|
|||
|
if [ ! -e "bb.def.h" ]; then
|
|||
|
echo "Creating bb.def.h"
|
|||
|
POSITION=`grep -n "Nothing beyond this point should ever be touched" \
|
|||
|
busybox.def.h.ORG | cut -d: -f1`
|
|||
|
TOTALLINES=`cat busybox.def.h.ORG | wc -l`
|
|||
|
NUMLINES=$[${TOTALLINES}-${POSITION}+2]
|
|||
|
tail -n ${NUMLINES} busybox.def.h.ORG > bb.def.h
|
|||
|
if [ ! -e "bb.def.h" ]; then
|
|||
|
echo "$0: ABORTING: Unable to create bb.def.h"
|
|||
|
exit
|
|||
|
fi
|
|||
|
fi
|
|||
|
|
|||
|
#####################################################################
|
|||
|
### See if we have a bb.OptionsAndFeatures file. If not, extract ###
|
|||
|
### all the BB_xxx options and features into a unique sorted list ###
|
|||
|
### and stuff them into bb.OptionsAndFeatures. ###
|
|||
|
#####################################################################
|
|||
|
if [ ! -e "bb.OptionsAndFeatures" ]; then
|
|||
|
echo "Creating bb.OptionsAndFeatures"
|
|||
|
grep BB_ *.[ch] \
|
|||
|
| tr ' ,(){}|&' ' |