2000-08-22 04:31:20 +05:30
|
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
|
|
###############################################
|
2001-01-25 03:39:46 +05:30
|
|
|
|
### See if we have a Config.h.ORG file ###
|
2000-08-22 04:31:20 +05:30
|
|
|
|
### If not, create it... ###
|
|
|
|
|
###############################################
|
2001-01-25 03:39:46 +05:30
|
|
|
|
if [ ! -e "Config.h.ORG" ]; then
|
|
|
|
|
echo "Creating Config.h.ORG"
|
|
|
|
|
cp Config.h Config.h.ORG
|
|
|
|
|
if [ ! -e "Config.h.ORG" ]; then
|
|
|
|
|
echo "$0: ABORTING: Unable to create Config.h.ORG"
|
2000-08-22 04:31:20 +05:30
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
###############################################################
|
|
|
|
|
### See if we have a bb.def.h file. If not, extract the ###
|
2001-01-25 03:39:46 +05:30
|
|
|
|
### unchangeable portion of Config.h.ORG into bb.def.h ###
|
2000-08-22 04:31:20 +05:30
|
|
|
|
###############################################################
|
|
|
|
|
if [ ! -e "bb.def.h" ]; then
|
|
|
|
|
echo "Creating bb.def.h"
|
|
|
|
|
POSITION=`grep -n "Nothing beyond this point should ever be touched" \
|
2001-01-25 03:39:46 +05:30
|
|
|
|
Config.h.ORG | cut -d: -f1`
|
|
|
|
|
TOTALLINES=`cat Config.h.ORG | wc -l`
|
2000-08-22 04:31:20 +05:30
|
|
|
|
NUMLINES=$[${TOTALLINES}-${POSITION}+2]
|
2001-01-25 03:39:46 +05:30
|
|
|
|
tail -n ${NUMLINES} Config.h.ORG > bb.def.h
|
2000-08-22 04:31:20 +05:30
|
|
|
|
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 ' ,(){}|&' ' |