From de3595192bb0c192c66380b92977ea17c49fd792 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 19 Apr 2017 20:43:06 +0200 Subject: configure: set abs_srcdir --- configure | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index ff35d7441..2bb5ce7c1 100755 --- a/configure +++ b/configure @@ -25,7 +25,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 backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pie" +subst_vars="CC CXX GNATMAKE CFLAGS LDFLAGS build srcdir abs_srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config llvm_be backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pie" # Find srcdir srcdir=`dirname $progname` @@ -94,7 +94,27 @@ EOF exit 0 fi +# Set abs_srcdir (absolute srcdir) +case $srcdir in + /*) abs_srcdir=$srcdir;; + *) abs_srcdir=`pwd`/$srcdir ;; +esac + # Sanity checks +# Check srcdir +pat="2019802090ed76fc5c54cec58f22a2c1" +if ! grep $pat $srcdir/configure > /dev/null 2>&1; then + echo "Incorrect srcdir; try with --srcdir=xx" + echo "srcdir=$srcdir" + exit 1 +fi + +if ! cmp $srcdir/configure $abs_srcdir/configure > /dev/null 2>&1; then + echo "Cannot compute absolute source dir (or incorrect srcdir)" + echo "srcdir=$srcdir" + echo "abs_srcdir=$abs_srcdir" + exit 1 +fi # Check that gnatmake exists if ! $GNATMAKE --version >/dev/null 2>&1; then echo "Sorry, you need GNAT to build GHDL. See the README" -- cgit v1.2.3