diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -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 { |