aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-28 20:57:21 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-28 20:57:21 +0200
commite0804ba4455959de401446178df553dc1e2d287a (patch)
treeec20c6afc434b7df55ad692e9fedfa580a3953c0 /configure
parent108a813198c4078b14ef2d69e16a34d423fa0b35 (diff)
downloadghdl-e0804ba4455959de401446178df553dc1e2d287a.tar.gz
ghdl-e0804ba4455959de401446178df553dc1e2d287a.tar.bz2
ghdl-e0804ba4455959de401446178df553dc1e2d287a.zip
Fix llvm link on darwin (set no_compat_unwind).
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure23
1 files changed, 15 insertions, 8 deletions
diff --git a/configure b/configure
index 875a238b8..a5be5d6bb 100755
--- a/configure
+++ b/configure
@@ -7,6 +7,7 @@ backend=mcode
CC=${CC:-gcc}
CFLAGS=${CFLAGS:--g}
GNATMAKE=${GNATMAKE:-gnatmake}
+LDFLAGS=
prefix=/usr/local
libdirsuffix=lib/ghdl
libdirreverse=../..
@@ -18,7 +19,7 @@ build=
show_help=no
progname=$0
-subst_vars="CC GNATMAKE CFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_prefix"
+subst_vars="CC GNATMAKE CFLAGS LDFLAGS build srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_prefix"
# Find srcdir
srcdir=`dirname $progname`
@@ -86,6 +87,12 @@ if ! $CC -v 2> /dev/null; then
exit 1
fi
+# Compute build machine
+if test x$build = x; then
+ build=`$CC $CFLAGS -dumpmachine`
+fi
+echo "Build machine is: $build"
+
# For mcode, check that gcc emits i386
if test $backend = mcode; then
if ! $CC $CFLAGS -dumpmachine | grep -q "[3-6]86"; then
@@ -111,18 +118,18 @@ fi
# For llvm backend, check llvm-config
if test $backend = llvm; then
llvm_cmd="$llvm_prefix/bin/llvm-config --version"
- if ! $llvm_cmd 2> /dev/null; then
+ if ! $llvm_cmd > /dev/null 2>&1; then
echo "cannot run $llvm_cmd"
exit 1
fi
+ # For llvm, the c++ compiler is for linking so that the standard c++
+ # library is included. However, the linker needs the no_compact_unwind
+ # flag because code generated by gcc is not compatible with compact unwind.
+ case "$build" in
+ *darwin*) LDFLAGS="$LDFLAGS -Wl,-no_compact_unwind" ;;
+ esac
fi
-# Compute build machine
-if test x$build = x; then
- build=`$CC $CFLAGS -dumpmachine`
-fi
-echo "Build machine is: $build"
-
# Generate config.status
rm -f config.status
{