mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
Make llvmdo and llvmgrep invulnerable to where they are run from by getting
the llvm source root from the llvm-config command. The dependency now is that the correct llvm-config command is in the path. For most developers this is the case. llvm-svn: 29630
This commit is contained in:
parent
9cd0b87af3
commit
c8a4b914d4
13
utils/llvmdo
13
utils/llvmdo
@ -27,8 +27,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
if test $# -lt 1 ; then
|
||||
echo "Usage: llvmdo [-dirs "DIRNAMES..."] PROGRAM ARGS...";
|
||||
exit 1;
|
||||
echo "Usage: llvmdo [-dirs "DIRNAMES..."] PROGRAM ARGS..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test "$1" = "-dirs" ; then
|
||||
@ -37,13 +37,20 @@ if test "$1" = "-dirs" ; then
|
||||
elif test -z "$LLVMDO_DIRS" ; then
|
||||
LLVMDO_DIRS="include lib tools utils runtime autoconf docs test examples projects"
|
||||
fi
|
||||
if test "$1" = "" ; then
|
||||
echo "Missing program name to run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROGRAM=`which $1`
|
||||
if test ! -x "$PROGRAM" ; then
|
||||
echo "Can't execute $1"
|
||||
exit 1
|
||||
fi
|
||||
shift;
|
||||
TOPDIR=`pwd | sed -e 's#\(.*/llvm[0-9]*\).*#\1#'`
|
||||
|
||||
TOPDIR=`llvm-config --src-root`
|
||||
|
||||
if test -d "$TOPDIR" ; then
|
||||
cd $TOPDIR
|
||||
case `uname -s` in
|
||||
|
@ -18,8 +18,7 @@
|
||||
# details.
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
TOPDIR=`pwd | sed -e 's#\(.*/llvm[0-9]*\).*#\1#'`
|
||||
echo $TOPDIR
|
||||
TOPDIR=`llvm-config --src-root`
|
||||
if test -d "$TOPDIR" ; then
|
||||
cd $TOPDIR
|
||||
case `uname -s` in
|
||||
|
Loading…
Reference in New Issue
Block a user