aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure23
1 files changed, 11 insertions, 12 deletions
diff --git a/configure b/configure
index 01a2cbf1e..4fe3c1ff3 100755
--- a/configure
+++ b/configure
@@ -13,7 +13,7 @@ prefix=/usr/local
libdirsuffix=lib/ghdl
libdirreverse=../..
gcc_src_dir=
-gcc_version=unknown
+gcc_ortho_lang=unknown
llvm_config=
backtrace_lib=
llvm_be=llvm
@@ -26,7 +26,7 @@ PIC_FLAGS=-fPIC
show_help=no
progname=$0
-subst_vars="CC CXX 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 default_pie"
+subst_vars="CC CXX GNATMAKE CFLAGS LDFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir gcc_ortho_lang llvm_config llvm_be llvm_be_ver backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pie"
# Find srcdir
srcdir=`dirname $progname`
@@ -43,10 +43,6 @@ else
echoc=
fi
-# Read required gcc version from BUILD.txt file
-gcc_version=`grep '^gcc version' $srcdir/BUILD.txt |
- sed -e 's/gcc version \([0-9.]*\) \[.*\]\.$/\1/'`
-
# Check $1 is a prefix of $2
check_version()
{
@@ -91,7 +87,7 @@ Usage: configure [options]
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-gcc=DIR use gcc backend from DIR
--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).
@@ -144,11 +140,14 @@ if test $backend = gcc; then
exit 1
fi
base_ver=`cat $gcc_src_dir/gcc/BASE-VER`
- if ! check_version $gcc_version $base_ver; then
- echo "Mismatch gcc version from $gcc_src_dir"
- echo "Need gcc version $gcc_version"
- exit 1
- fi
+ case $base_ver in
+ 4.9*) gcc_ortho_lang=ortho-lang.c ;;
+ 5.*) gcc_ortho_lang=ortho-lang-5.c ;;
+ 6.*) gcc_ortho_lang=ortho-lang-6.c ;;
+ *) echo "Mismatch gcc version from $gcc_src_dir"
+ echo "Need gcc version 4.9.x, 5.x or 6.x"
+ exit 1 ;;
+ esac
if test "x$backtrace_lib" = x ; then
# Automatically use libbacktrace from gcc.
backtrace_lib="$prefix/$libdirsuffix/libbacktrace.a"