mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Begin remove old LLVM configuration code
This commit is contained in:
parent
a0ff3db258
commit
225f50ea96
70
configure
vendored
70
configure
vendored
@ -306,43 +306,12 @@ fi
|
|||||||
|
|
||||||
if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
|
if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
|
||||||
then
|
then
|
||||||
CFG_LLVM_CONFIG="$CFG_LLVM_ROOT/bin/llvm-config"
|
step_msg "using custom LLVM"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "$CFG_LLVM_ROOT" -a -z "$CFG_LLVM_CONFIG" ]
|
LLVM_CONFIG="$CFG_LLVM_ROOT/bin/llvm-config"
|
||||||
then
|
LLVM_VERSION=$($CFG_LLVM_CONFIG --version)
|
||||||
CFG_LLVM_INCDIR="$CFG_LLVM_ROOT/include"
|
|
||||||
CFG_LLVM_BINDIR="$CFG_LLVM_ROOT/bin"
|
|
||||||
CFG_LLVM_LIBDIR="$CFG_LLVM_ROOT/lib"
|
|
||||||
CFG_LLVM_CXXFLAGS="-I$CFG_LLVM_INCDIR"
|
|
||||||
CFG_LLVM_LDFLAGS=""
|
|
||||||
CFG_LLVM_LIBS=$(find "$CFG_LLVM_LIBDIR" \
|
|
||||||
-name '*.lib' \
|
|
||||||
-exec echo '\"{}\"' ';' \
|
|
||||||
| xargs echo)
|
|
||||||
CFG_LLVM_VERSION=$("$CFG_LLVM_BINDIR/llc" \
|
|
||||||
--version \
|
|
||||||
| grep version \
|
|
||||||
| cut -d ' ' -f 5-)
|
|
||||||
CFG_LLVM_TRIPLE=$("$CFG_LLVM_BINDIR/llc" \
|
|
||||||
--version \
|
|
||||||
| grep Host: \
|
|
||||||
| cut -d ' ' -f 4-)
|
|
||||||
elif [ ! -z "$CFG_LLVM_CONFIG" ]
|
|
||||||
then
|
|
||||||
CFG_LLVM_VERSION=$($CFG_LLVM_CONFIG --version)
|
|
||||||
CFG_LLVM_INCDIR=$($CFG_LLVM_CONFIG --includedir)
|
|
||||||
CFG_LLVM_BINDIR=$($CFG_LLVM_CONFIG --bindir)
|
|
||||||
CFG_LLVM_LIBDIR=$($CFG_LLVM_CONFIG --libdir)
|
|
||||||
CFG_LLVM_CXXFLAGS=$($CFG_LLVM_CONFIG --cxxflags)
|
|
||||||
CFG_LLVM_LDFLAGS=$($CFG_LLVM_CONFIG --ldflags)
|
|
||||||
CFG_LLVM_LIBS=$($CFG_LLVM_CONFIG --libs)
|
|
||||||
CFG_LLVM_TRIPLE=$($CFG_LLVM_CONFIG --host-target)
|
|
||||||
else
|
|
||||||
err "no llvm-config found and no --llvm-root specified"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $CFG_LLVM_VERSION in
|
case $LLVM_VERSION in
|
||||||
(3.0svn | 3.0 | 3.1svn)
|
(3.0svn | 3.0 | 3.1svn)
|
||||||
step_msg "found ok version of LLVM: $CFG_LLVM_VERSION"
|
step_msg "found ok version of LLVM: $CFG_LLVM_VERSION"
|
||||||
;;
|
;;
|
||||||
@ -350,6 +319,7 @@ case $CFG_LLVM_VERSION in
|
|||||||
err "bad LLVM version: $CFG_LLVM_VERSION, need >=3.0svn"
|
err "bad LLVM version: $CFG_LLVM_VERSION, need >=3.0svn"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_ENABLE_CLANG" ]
|
if [ ! -z "$CFG_ENABLE_CLANG" ]
|
||||||
then
|
then
|
||||||
@ -381,18 +351,6 @@ then
|
|||||||
CFG_PREFIX=/usr/local
|
CFG_PREFIX=/usr/local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_LLVM_TRIPLE" ]
|
|
||||||
then
|
|
||||||
if [ $CFG_HOST_TRIPLE != $CFG_LLVM_TRIPLE ]
|
|
||||||
then
|
|
||||||
warn "LLVM host-triple $CFG_LLVM_TRIPLE differs from"
|
|
||||||
warn "detected host triple $CFG_HOST_TRIPLE"
|
|
||||||
warn "choosing LLVM host-triple instead"
|
|
||||||
msg ""
|
|
||||||
CFG_HOST_TRIPLE=$CFG_LLVM_TRIPLE
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$CFG_TARGET_TRIPLES" ]
|
if [ -z "$CFG_TARGET_TRIPLES" ]
|
||||||
then
|
then
|
||||||
CFG_TARGET_TRIPLES="${CFG_HOST_TRIPLE}"
|
CFG_TARGET_TRIPLES="${CFG_HOST_TRIPLE}"
|
||||||
@ -405,14 +363,6 @@ putvar CFG_C_COMPILER
|
|||||||
putvar CFG_PREFIX
|
putvar CFG_PREFIX
|
||||||
|
|
||||||
putvar CFG_LLVM_ROOT
|
putvar CFG_LLVM_ROOT
|
||||||
putvar CFG_LLVM_CONFIG
|
|
||||||
putvar CFG_LLVM_INCDIR
|
|
||||||
putvar CFG_LLVM_BINDIR
|
|
||||||
putvar CFG_LLVM_LIBDIR
|
|
||||||
putvar CFG_LLVM_CXXFLAGS
|
|
||||||
putvar CFG_LLVM_LDFLAGS
|
|
||||||
putvar CFG_LLVM_LIBS
|
|
||||||
putvar CFG_LLVM_TRIPLE
|
|
||||||
|
|
||||||
step_msg "making directories"
|
step_msg "making directories"
|
||||||
|
|
||||||
@ -494,13 +444,15 @@ msg
|
|||||||
|
|
||||||
|
|
||||||
# Configure llvm. Here we go...
|
# Configure llvm. Here we go...
|
||||||
step_msg "configuring LLVM"
|
|
||||||
|
|
||||||
CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm
|
CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm
|
||||||
CFG_LLVM_BUILD_DIR=${CFG_BUILD_DIR}/llvm
|
CFG_LLVM_BUILD_DIR=${CFG_BUILD_DIR}/llvm
|
||||||
# Just use LLVM straight from its build directory to avoid 'make install' time
|
# Just use LLVM straight from its build directory to avoid 'make install' time
|
||||||
CFG_LLVM_INST_DIR=${CFG_LLVM_BUILD_DIR}/Release+Asserts
|
CFG_LLVM_INST_DIR=${CFG_LLVM_BUILD_DIR}/Release+Asserts
|
||||||
|
|
||||||
|
if [ -z $CFG_LLVM_ROOT ]
|
||||||
|
then
|
||||||
|
step_msg "configuring LLVM"
|
||||||
|
|
||||||
LLVM_TARGETS="--enable-targets=x86,x86_64"
|
LLVM_TARGETS="--enable-targets=x86,x86_64"
|
||||||
LLVM_BUILD="--build=${CFG_HOST_TRIPLE}"
|
LLVM_BUILD="--build=${CFG_HOST_TRIPLE}"
|
||||||
LLVM_HOST="--host=${CFG_HOST_TRIPLE}"
|
LLVM_HOST="--host=${CFG_HOST_TRIPLE}"
|
||||||
@ -541,6 +493,10 @@ cd $CFG_LLVM_BUILD_DIR
|
|||||||
# FIXME: This won't work if CFG_SRC_DIR is absolute
|
# FIXME: This won't work if CFG_SRC_DIR is absolute
|
||||||
${CFG_BUILD_DIR}/${CFG_LLVM_SRC_DIR}/configure $LLVM_FLAGS
|
${CFG_BUILD_DIR}/${CFG_LLVM_SRC_DIR}/configure $LLVM_FLAGS
|
||||||
cd $CFG_BUILD_DIR
|
cd $CFG_BUILD_DIR
|
||||||
|
else
|
||||||
|
# The user is using their own LLVM
|
||||||
|
CFG_LLVM_INST_DIR=$CFG_LLVM_ROOT
|
||||||
|
fi
|
||||||
|
|
||||||
putvar CFG_LLVM_SRC_DIR
|
putvar CFG_LLVM_SRC_DIR
|
||||||
putvar CFG_LLVM_BUILD_DIR
|
putvar CFG_LLVM_BUILD_DIR
|
||||||
|
Loading…
Reference in New Issue
Block a user