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