mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Begin remove old LLVM configuration code
This commit is contained in:
parent
a0ff3db258
commit
225f50ea96
150
configure
vendored
150
configure
vendored
@ -306,50 +306,20 @@ 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"
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
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,53 +444,59 @@ 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
|
||||||
|
|
||||||
LLVM_TARGETS="--enable-targets=x86,x86_64"
|
if [ -z $CFG_LLVM_ROOT ]
|
||||||
LLVM_BUILD="--build=${CFG_HOST_TRIPLE}"
|
then
|
||||||
LLVM_HOST="--host=${CFG_HOST_TRIPLE}"
|
step_msg "configuring LLVM"
|
||||||
LLVM_TARGET="--target=${CFG_HOST_TRIPLE}"
|
|
||||||
LLVM_OPTS="--enable-optimized --disable-docs"
|
|
||||||
|
|
||||||
LLVM_CXX_32="g++ -m32"
|
LLVM_TARGETS="--enable-targets=x86,x86_64"
|
||||||
LLVM_CC_32="gcc -m32"
|
LLVM_BUILD="--build=${CFG_HOST_TRIPLE}"
|
||||||
LLVM_CFLAGS_32="-m32"
|
LLVM_HOST="--host=${CFG_HOST_TRIPLE}"
|
||||||
LLVM_CXXFLAGS_32="-m32"
|
LLVM_TARGET="--target=${CFG_HOST_TRIPLE}"
|
||||||
LLVM_LDFLAGS_32="-m32"
|
LLVM_OPTS="--enable-optimized --disable-docs"
|
||||||
|
|
||||||
# FIXME: Need to change flags for x64
|
LLVM_CXX_32="g++ -m32"
|
||||||
LLVM_CXX=$LLVM_CXX_32
|
LLVM_CC_32="gcc -m32"
|
||||||
LLVM_CC=$LLVM_CC_32
|
LLVM_CFLAGS_32="-m32"
|
||||||
LLVM_CFLAGS=$LLVM_CFLAGS_32
|
LLVM_CXXFLAGS_32="-m32"
|
||||||
LLVM_CXXFLAGS=$LLVM_CXXFLAGS_32
|
LLVM_LDFLAGS_32="-m32"
|
||||||
LLVM_LDFLAGS=$LLVM_LDFLAGS_32
|
|
||||||
|
|
||||||
CXX=$LLVM_CXX
|
# FIXME: Need to change flags for x64
|
||||||
CC=$LLVM_CC
|
LLVM_CXX=$LLVM_CXX_32
|
||||||
CFLAGS=$LLVM_CFLAGS
|
LLVM_CC=$LLVM_CC_32
|
||||||
CXXFLAGS=$LLVM_CXXFLAGS
|
LLVM_CFLAGS=$LLVM_CFLAGS_32
|
||||||
LDFLAGS=$LLVM_LDFLAGS
|
LLVM_CXXFLAGS=$LLVM_CXXFLAGS_32
|
||||||
|
LLVM_LDFLAGS=$LLVM_LDFLAGS_32
|
||||||
|
|
||||||
LLVM_FLAGS="$LLVM_TARGETS $LLVM_OPTS $LLVM_BUILD $LLVM_HOST $LLVM_TARGET"
|
CXX=$LLVM_CXX
|
||||||
|
CC=$LLVM_CC
|
||||||
|
CFLAGS=$LLVM_CFLAGS
|
||||||
|
CXXFLAGS=$LLVM_CXXFLAGS
|
||||||
|
LDFLAGS=$LLVM_LDFLAGS
|
||||||
|
|
||||||
msg "configuring LLVM with:"
|
LLVM_FLAGS="$LLVM_TARGETS $LLVM_OPTS $LLVM_BUILD $LLVM_HOST $LLVM_TARGET"
|
||||||
msg "$LLVM_FLAGS"
|
|
||||||
|
|
||||||
export CXX
|
msg "configuring LLVM with:"
|
||||||
export CC
|
msg "$LLVM_FLAGS"
|
||||||
export CFLAGS
|
|
||||||
export CXXFLAGS
|
|
||||||
export LDFLAGS
|
|
||||||
|
|
||||||
cd $CFG_LLVM_BUILD_DIR
|
export CXX
|
||||||
# FIXME: This won't work if CFG_SRC_DIR is absolute
|
export CC
|
||||||
${CFG_BUILD_DIR}/${CFG_LLVM_SRC_DIR}/configure $LLVM_FLAGS
|
export CFLAGS
|
||||||
cd $CFG_BUILD_DIR
|
export CXXFLAGS
|
||||||
|
export LDFLAGS
|
||||||
|
|
||||||
|
cd $CFG_LLVM_BUILD_DIR
|
||||||
|
# FIXME: This won't work if CFG_SRC_DIR is absolute
|
||||||
|
${CFG_BUILD_DIR}/${CFG_LLVM_SRC_DIR}/configure $LLVM_FLAGS
|
||||||
|
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