aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-09-17 13:59:41 +0200
committerTristan Gingold <tgingold@free.fr>2016-09-17 13:59:41 +0200
commit295084718d1b9307d7adac59f6396b740807155a (patch)
tree8c0c2a02d771976fe45ec15789ce9c05c4c5057b /configure
parent4b8917f8ddc7edb89143b81f6f91c96f9f4febf9 (diff)
downloadghdl-295084718d1b9307d7adac59f6396b740807155a.tar.gz
ghdl-295084718d1b9307d7adac59f6396b740807155a.tar.bz2
ghdl-295084718d1b9307d7adac59f6396b740807155a.zip
Add suport for llvm 3.6 - 3.9
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure28
1 files changed, 19 insertions, 9 deletions
diff --git a/configure b/configure
index 49ce69380..fed905e2e 100755
--- a/configure
+++ b/configure
@@ -25,7 +25,7 @@ PIC_FLAGS=-fPIC
show_help=no
progname=$0
-subst_vars="CC GNATMAKE CFLAGS LDFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config llvm_be backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS"
+subst_vars="CC GNATMAKE CFLAGS LDFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config llvm_be llvm_be_ver backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS"
# Find srcdir
srcdir=`dirname $progname`
@@ -46,9 +46,6 @@ fi
gcc_version=`grep '^gcc version' $srcdir/BUILD.txt |
sed -e 's/gcc version \([0-9.]*\) \[.*\]\.$/\1/'`
-# Read required llvm version from BUILD.txt file
-llvm_version=`grep '^llvm version' $srcdir/BUILD.txt | cut -d ' ' -f 3`
-
# Check $1 is a prefix of $2
check_version()
{
@@ -94,7 +91,7 @@ Options [defaults in brackets]:
--prefix=PREFIX install in PREFIX [$prefix]
--srcdir=SRCDIR source code path [$srcdir]
--with-gcc=DIR use gcc backend from DIR (needs gcc $gcc_version)
- --with-llvm-config=PATH use llvm from PATH (needs llvm $llvm_version)
+ --with-llvm-config=PATH use llvm from PATH (needs llvm 3.5 - 3.9)
--with-backtrace-lib=LIB.a link with libbacktrace LIB.a to display a
backtrace on errors (only for llvm).
EOF
@@ -159,15 +156,28 @@ fi
# For llvm backend, check llvm-config
if test $backend = llvm; then
- llvm_ver=`"$llvm_config" --version 2>/dev/null`
+ llvm_version=`"$llvm_config" --version 2>/dev/null`
if [ $? != 0 ]; then
echo "cannot run $llvm_config"
exit 1
fi
- if ! check_version $llvm_version $llvm_ver; then
- echo "Mismatch llvm version $llvm_ver from $llvm_config"
- echo "Debugging is not enabled"
+ if check_version 3.5 $llvm_version; then
+ llvm_be=llvm
+ elif check_version 3.6 $llvm_version ||
+ check_version 3.7 $llvm_version ||
+ check_version 3.8 $llvm_version;
+ then
+ echo "Debugging is not enabled with llvm $llvm_version"
+ llvm_be=llvm-nodebug
+ # Tested with llvm 3.5, so assume 3.6, 3.7 and 3.8
+ llvm_be_ver=35
+ elif check_version 3.9 $llvm_version; then
+ echo "Debugging is not enabled with llvm $llvm_version"
llvm_be=llvm-nodebug
+ llvm_be_ver=39
+ else
+ echo "Unhandled version llvm $llvm_version"
+ exit 1
fi
# For llvm, the c++ compiler is used for linking so that the standard c++
# library is included. However, the linker needs the no_compact_unwind