[PATCH 09] bootstrap: handy --root switch for bootstrapping subdirs

Joel Sherrill joel.sherrill at OARcorp.com
Fri Feb 3 14:12:25 UTC 2012


My comments are (1) that it should take all short forms
of --root like the other commands do.

-r |--ro|--roo|--root)

(2) and the new argument should be added to usage message.

Any other comments?

On 02/02/2012 08:46 AM, Daniel Hellstrom wrote:
> Use the "--root DIR" to process only a subdir, for example
>   $ ./bootstrap --root c/src/lib/libbsp/sparc
> will only generate Makefiles for all SPARC BSPs, saves some
> time when working with a specific BSP.
>
> Signed-off-by: Daniel Hellstrom<daniel at gaisler.com>
> ---
>   bootstrap |   10 +++++++---
>   1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/bootstrap b/bootstrap
> index 1a2a424..472416d 100755
> --- a/bootstrap
> +++ b/bootstrap
> @@ -18,6 +18,7 @@ top_srcdir=`dirname $0`
>   verbose="";
>   quiet="false"
>   mode="autoreconf"
> +root=.
>
>   usage()
>   {
> @@ -92,6 +93,9 @@ case $1 in
>   -g|--ge|--gen|--gene|--gener|--genera|--generat|--generate)
>     mode="generate";
>     shift;;
> +--root)
> +  root=$2;
> +  shift 2;;
>   -*) echo "unknown option $1" ;
>     usage ;;
>   *) echo "invalid parameter $1" ;
> @@ -101,7 +105,7 @@ done
>
>   case $mode in
>   preinstall)
> -  confs=`find . -name Makefile.am -exec grep -l 'include .*/preinstall\.am' {} \;`
> +  confs=`find $root -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"
> @@ -141,7 +145,7 @@ generate)
>       ;;
>     esac
>
> -  confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
> +  confs=`find $root \( -name 'configure.in' -o -name 'configure.ac' \) -print`
>     for i in $confs; do
>     dir=`dirname $i`;
>     configure=`basename $i`;
> @@ -173,7 +177,7 @@ autoreconf)
>       exit 1
>     fi
>
> -  confs=`find . -name 'configure.ac' -print`
> +  confs=`find . -name 'configure.ac' -print $maxdepth`
>     for i in $confs; do
>     dir=`dirname $i`;
>     configure=`basename $i`;


-- 
Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985





More information about the devel mailing list