diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-04-19 20:43:06 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-04-19 20:48:25 +0200 |
commit | de3595192bb0c192c66380b92977ea17c49fd792 (patch) | |
tree | 82899ed3446a04c5338a5ede225c7ade3d2676a3 | |
parent | 3609230c853c2e7b99884ebd2325d9bc68ee61a3 (diff) | |
download | ghdl-de3595192bb0c192c66380b92977ea17c49fd792.tar.gz ghdl-de3595192bb0c192c66380b92977ea17c49fd792.tar.bz2 ghdl-de3595192bb0c192c66380b92977ea17c49fd792.zip |
configure: set abs_srcdir
-rw-r--r-- | Makefile.in | 3 | ||||
-rwxr-xr-x | configure | 22 |
2 files changed, 23 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index f68ff33a4..4403478c6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,6 +19,7 @@ CC=@CC@ CXX=@CXX@ build=@build@ srcdir=@srcdir@ +abs_srcdir=@abs_srcdir@ GNATMAKE=@GNATMAKE@ prefix=@prefix@ backend=@backend@ @@ -107,7 +108,7 @@ Makefile: $(srcdir)/Makefile.in GHDL_COMMON_INCFLAGS=-aI$(srcdir)/src -aI$(srcdir)/src/vhdl -aI$(srcdir)/src/grt -aI$(srcdir)/src/psl -aI$(srcdir)/src/vhdl/translate -GRTSRCDIR=$(srcdir)/src/grt +GRTSRCDIR=$(abs_srcdir)/src/grt include $(GRTSRCDIR)/Makefile.inc version.tmp: $(srcdir)/src/version.in force @@ -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" |