summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap78
1 files changed, 69 insertions, 9 deletions
diff --git a/bootstrap b/bootstrap
index 4db57e040b..eb6d4fc8f3 100755
--- a/bootstrap
+++ b/bootstrap
@@ -13,6 +13,9 @@
progname=`basename $0`
top_srcdir=`dirname $0`
+LC_ALL=C
+export LC_ALL
+
verbose=""
quiet="false"
mode="autoreconf"
@@ -26,7 +29,7 @@ usage()
echo "options:"
echo " -c .. clean, remove all aclocal/autoconf/automake generated files"
echo " -h .. display this message and exit"
- echo " -p .. regenerate preinstall.am files"
+ echo " -H .. regenerate headers.am files"
echo " -q .. quiet, don't display directories"
echo " -v .. verbose, pass -v to autotools"
echo
@@ -85,8 +88,8 @@ case $1 in
-f|--fo|--for|--forc|--force)
force=`expr $force + 1`
shift;;
--p|--pr|--pre|--prei|--prein|--preins|--preinst)
- mode="preinstall"
+-H|--headers)
+ mode="headers"
shift;;
-r|--re|--rec|--reco|--recon|--reconf)
mode="autoreconf"
@@ -102,13 +105,70 @@ esac
done
case $mode in
-preinstall)
- confs=`find . -name Makefile.am -exec grep -l 'include .*/preinstall\.am' {} \;`
- for i in $confs; do
- dir=$(dirname $i)
- test "$quite" = "true" || echo "Generating $dir/preinstall.am"
- ${top_srcdir}/ampolish3 "$dir/Makefile.am" > "$dir/preinstall.am"
+headers)
+ if test "." != "$top_srcdir"; then
+ echo "To generate the headers.am you must call the script via \"./$progname -H\""
+ exit 1
+ fi
+ base="$PWD"
+ tmp="$base/headers.am.new"
+ for i in cpukit/include cpukit/score/cpu/*/include bsps/include bsps/*/include bsps/*/*/include ; do
+ dir=""
+ am_dir=""
+ echo '## This file was generated by "./boostrap -H".' > "$tmp"
+ case $i in
+ cpukit/include)
+ hdr="../"
+ inc="include/"
+ ;;
+ cpukit/score/cpu/*/include)
+ hdr="../"
+ inc=`echo $i | cut -d'/' -f5-`
+ inc="$inc/"
+ ;;
+ bsps/*/*/include)
+ hdr="../"
+ inc="../../../../../../$i/"
+ ;;
+ bsps/*/include)
+ hdr="../"
+ inc="../../../../../$i/"
+ ;;
+ bsps/include)
+ hdr="../"
+ inc="../../$i/"
+ ;;
+ *)
+ hdr=""
+ inc=""
+ ;;
+ esac
+ cd $i
+ for b in `find -type d | sort` ; do
+ for j in `find $b -mindepth 1 -maxdepth 1 -name '*.h' -or -name '*.inc' | sed 's%^\.%%' | sed 's%^/%%' | sort` ; do
+ d=`dirname $j`
+ if test x$d != x$dir ; then
+ dir=$d
+ if test x$d != x. ; then
+ am_dir=`echo $dir | sed 's%[/-]%_%g'`
+ am_dir="_$am_dir"
+ echo -e "\ninclude${am_dir}dir = \$(includedir)/$dir" >> "$tmp"
+ else
+ am_dir=""
+ echo "" >> "$tmp"
+ fi
+ echo "include${am_dir}_HEADERS =" >> "$tmp"
+ fi
+ echo "include${am_dir}_HEADERS += $inc$j" >> "$tmp"
+ if test $j = bsp.h ; then
+ echo -e "include_HEADERS += include/bspopts.h" >> "$tmp"
+ fi
+ done
+ done
+ cd "$base"
+ diff -q "$tmp" "$i/${hdr}headers.am" || mv "$tmp" "$i/${hdr}headers.am"
done
+ rm -f "$tmp"
;;
generate)