make gx/cc savvy to ~/.tea/.loca/bin

Fixes https://github.com/teaxyz/cli/issues/610
This commit is contained in:
Max Howell 2023-06-09 09:32:36 -04:00
parent 4bfbe8d7f4
commit 3f7ce4e6fd
No known key found for this signature in database
GPG key ID: 741BB84EF5BB9EEC
3 changed files with 18 additions and 17 deletions

View file

@ -19,7 +19,7 @@ end.compact
# find next example of ourselves
# this will either pick the Apple provided clang or the tea one
exe_path = ENV['PATH'].split(":").filter { |path|
path != File.dirname(__FILE__)
path != File.dirname(__FILE__) && path != File.join($tea_prefix, ".local/bin")
}.map { |path|
"#{path}/#{exe}"
}.reject { |path|

View file

@ -1,10 +1,17 @@
#!/bin/sh
if test -z "$TEA_PREFIX"
then
echo 'TEA_PREFIX mysteriously unset' >&2
exit 1
fi
dir=$(dirname "$0")
exe=$(basename "$0")
# Remove us from our path
PATH=$(echo "$PATH" | tr ":" "\n" | grep -v "$dir" | tr "\n" ":")
PATH=$(echo "$PATH" | tr ":" "\n" | grep -v "$TEA_PREFIX/.local/bin" | tr "\n" ":")
# If we can find our specific name, e.g. `lld`,
# passthrough to that
@ -20,11 +27,6 @@ else
exit 127
fi
if test -z "$TEA_PREFIX"
then
echo 'TEA_PREFIX mysteriously unset' >&2
exit 1
else
# At a minimum, `ld` will complain if you mix the `-r` and `-rpath` flags,
# so if any argument to this script is `-r`, we just pass through without
# additions.
@ -34,4 +36,3 @@ else
fi
done
exec "$exe" "$@" -rpath "$TEA_PREFIX"
fi

View file

@ -3,7 +3,7 @@ distributable: ~
# FIXME we want the c version eg. c99
# or should that be some kind of option? so you specify you want a cc that support c99
versions:
- 0.1.4
- 0.1.5
dependencies:
linux: