diff options
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | README | 8 | ||||
-rwxr-xr-x | configure | 29 |
3 files changed, 21 insertions, 20 deletions
diff --git a/Makefile.in b/Makefile.in index 70732b1..b9914e5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -24,7 +24,7 @@ backend=@backend@ libdirsuffix=@libdirsuffix@ libdirreverse=@libdirreverse@ gcc_src_dir=@gcc_src_dir@ -llvm_prefix=@llvm_prefix@ +LLVM_CONFIG=@llvm_config@ LDFLAGS=@LDFLAGS@ LIBBACKTRACE=@backtrace_lib@ @@ -183,8 +183,6 @@ oread-gcc: force #################### For llvm backend ############################## -LLVM_CONFIG=$(llvm_prefix)/bin/llvm-config - GHDL_LLVM_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/grt -aI$(srcdir)/src/ortho -aI$(srcdir)/src/ortho/llvm all.llvm: ghdl1-llvm ghdl_llvm grt-all libs.vhdl.llvm @@ -131,9 +131,11 @@ Building with the llvm backend You need to build and install llvm version 3.5 [do not modify this line as this is read by scripts]. -First configure ghdl and specify where llvm is installed -$ ./configure --with-llvm=PREFIX - where PREFIX/bin/llvm-config is present +First configure ghdl with '--with-llvm-config' +$ ./configure --with-llvm-config + +If llvm-config is not in your path, you can specify it: +$ ./configure --with-llvm-config=LLVM_INSTALL/bin/llvm-config If you want to have stack backtraces on errors (like assert failure or index of out bounds), you need to configure and build libbacktrace from gcc @@ -13,14 +13,14 @@ libdirsuffix=lib/ghdl libdirreverse=../.. gcc_src_dir= gcc_version=unknown -llvm_prefix= +llvm_config= backtrace_lib= build= show_help=no progname=$0 -subst_vars="CC GNATMAKE CFLAGS LDFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_prefix backtrace_lib" +subst_vars="CC GNATMAKE CFLAGS LDFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config backtrace_lib" # Find srcdir srcdir=`dirname $progname` @@ -68,7 +68,10 @@ for opt do --prefix=*) prefix="$optarg";; --srcdir=*) srcdir="$optarg";; --with-gcc=*) gcc_src_dir="$optarg"; backend=gcc;; - --with-llvm=*) llvm_prefix="$optarg"; backend=llvm;; + --with-llvm=*) echo "--with-llvm is deprecated, use --with-llvm-config"; + llvm_config="$optarg/bin/llvm-config"; backend=llvm;; + --with-llvm-config) llvm_config="llvm-config"; backend=llvm;; + --with-llvm-config=*) llvm_config="$optarg"; backend=llvm;; --with-backtrace-lib=*) backtrace_lib="$optarg";; -h|-help|--help) show_help=yes;; *) echo "$0: unknown option $opt; try $0 --help" @@ -83,13 +86,12 @@ cat <<EOF 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-llvm=DIR use llvm installed in DIR (needs llvm $llvm_version) - --with-backtrace-lib=LIB.a - link with libbacktrace LIB.a to display a backtrace on - errors (only for llvm). + --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-backtrace-lib=LIB.a link with libbacktrace LIB.a to display a + backtrace on errors (only for llvm). EOF exit 0 fi @@ -142,14 +144,13 @@ fi # For llvm backend, check llvm-config if test $backend = llvm; then - llvm_cmd="$llvm_prefix/bin/llvm-config --version" - llvm_ver=`$llvm_cmd 2>/dev/null` + llvm_ver=`"$llvm_config" --version 2>/dev/null` if [ $? != 0 ]; then - echo "cannot run $llvm_cmd" + echo "cannot run $llvm_config" exit 1 fi if ! check_version $llvm_version $llvm_ver; then - echo "Mismatch llvm version $llvm_ver from $llvm_prefix" + echo "Mismatch llvm version $llvm_ver from $llvm_config" echo "Need llvm version $llvm_version" exit 1 fi |