[PATCH 8 of 9] scripts/build/internals.sh: Always use binary wrapper under BSD/MacOS

Arnaud Lacombe lacombar@gmail.com
Tue May 18 20:34:00 GMT 2010


Hi,

On Mon, May 17, 2010 at 8:27 AM, Titus von Boxberg <titus@v9g.de> wrote:
> # HG changeset patch
> # User Titus von Boxberg <titus@v9g.de>
> # Date 1274092243 -7200
> # Node ID 5bb202a2c952720288b6133bc3a6f20da5e6aae1
> # Parent  2294caf59a704064059a1a9c66c75b0708ac0409
> scripts/build/internals.sh: Always use binary wrapper under BSD/MacOS
>
> The shell wrapper script uses a nonportable call to readlink.
> Thus, always use the binary wrapper under BSD/MacOS.
>
> diff -r 2294caf59a70 -r 5bb202a2c952 scripts/build/internals.sh
> --- a/scripts/build/internals.sh        Mon May 17 12:27:32 2010 +0200
> +++ b/scripts/build/internals.sh        Mon May 17 12:30:43 2010 +0200
> @@ -42,6 +42,11 @@
>         CT_DoLog EXTRA "Installing toolchain wrappers"
>         CT_Pushd "${CT_PREFIX_DIR}/bin"
>
> +        if [ "$CT_SYS_OS" = "Darwin" -o "$CT_SYS_OS" = "FreeBSD" ] ; then
> +            # wrapper does not work (when using readlink -m)
> +            CT_DoLog EXTRA "Forcing usage of binary wrappers"
> +            CT_TOOLS_WRAPPER="exec"
> +        fi
rather than introducing (incomplete) special cases, it might be better
to remove the GNU readlink dependency once for all. There is 3
differents case to get the damn path, depending on ${0}:
 1) absolute path -> easy
 2) relative path -> test if ${PWD}/$0 is an executable file, then
fall back to (1)
 3) the binary is in the ${PATH}, well search exhaustively with a trivial:

for dir in $(echo ${PATH} | sed 's/:/ /g'); do test -x "${dir}/ls" &&
break; done; echo $dir

then fall back to (1)

 - Arnaud

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list