[vlc-devel] [PATCH] Fix boostrap for OpenSolaris automake packages

Rémi Denis-Courmont remi at remlab.net
Tue Jun 23 21:51:31 CEST 2009


Le mardi 23 juin 2009 22:14:03 Francois Cartegnie, vous avez écrit :
> ---
>  bootstrap |   43 +++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 43 insertions(+), 0 deletions(-)
>
> diff --git a/bootstrap b/bootstrap
> index c32c183..45c195d 100755
> --- a/bootstrap
> +++ b/bootstrap
> @@ -30,6 +30,49 @@ cd "$(dirname "$0")"
>
>  ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
>
> +
> +## checks if $FOO or sets $FOO to /[s]bin/foo[.*]
> +var_check()
> +{
> +for varname in $@; do
> +  envvarname=`echo ${varname}|tr [a-z] [A-Z]`
> +  targetvalue=`eval echo \\\$\${envvarname}`
> +
> +  if test -z ${targetvalue}; then
> +    GUESS="`which ${varname} 2>/dev/null`"
> +    if test -z $GUESS; then
> +      for i in "`find /usr/bin/ /bin/ | grep '/'${varname}'.*$' | head -n
> 1`"; do +        if test -n $i -a -x $i; then
> +          GUESS=$i
> +          break
> +        fi
> +      done
> +      if test -n $GUESS; then
> +        echo "set ${envvarname} to: ${GUESS}"
> +        eval ${envvarname}=$GUESS
> +        export ${envvarname}
> +      else
> +        echo "Warning: ${varname} not found."
> +      fi
> +    fi
> +    unset GUESS
> +  else
> +	echo "${envvarname} is ${targetvalue}"
> +  fi
> +  unset envvarname
> +  unset targetvalue
> +done
> +}

Frankly, I don't feel bootstrap tasks should cover fixing incomplete PATH 
environment... You can always set ACLOCAL, AUTOMAKE, AUTOCONF and AUTOHEADER 
to the appropriate values before calling bootstrap if you want/need to. It's 
just like you need to set CC and CFLAGS before configure if you don't want the 
default toolchain.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list