aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure2
-rw-r--r--src/grt/Makefile.inc15
2 files changed, 12 insertions, 5 deletions
diff --git a/configure b/configure
index 36ae4e415..59687800c 100755
--- a/configure
+++ b/configure
@@ -104,7 +104,7 @@ case $srcdir in
*)
# Use a Windows path on windows.
case "$OS" in
- Windows_NT) abs_srcdir=`pwd -W`/$srcdir ;;
+ Windows_NT) abs_srcdir="`pwd -W`/$srcdir" ;;
*) abs_srcdir=`pwd`/$srcdir ;;
esac
;;
diff --git a/src/grt/Makefile.inc b/src/grt/Makefile.inc
index 8e6a19648..feca70475 100644
--- a/src/grt/Makefile.inc
+++ b/src/grt/Makefile.inc
@@ -88,6 +88,13 @@ ifneq ($(LIBBACKTRACE),)
GRT_LIBBACKTRACE=libbacktrace.a
endif
+# MSYS2 tries to be clever with paths in command line: it replaces msys2 paths
+# by Windows paths. So for example, /bin/ls becomes c:/mingw64/bin/ls
+# However, this is not always obvious to detect paths. In our case, msys2
+# transformed -aIc:/dir to -aIc:c:/dir, which was not understood by gnatmake.
+# So tell MSYS2 not try transform paths that follow -aI or -gnatec
+MSYS2_ARG=MSYS2_ARG_CONV_EXCL="-aI;-gnatec"
+
# Configuration pragmas.
# -gnatdY is required to force the use of __gnat_last_chance_handler.
GRT_PRAGMA_FLAG=-gnatec$(GRTSRCDIR)/grt.adc -gnat05 -gnatdY
@@ -104,8 +111,8 @@ $(libdirsuffix)/libgrt.a: $(GRT_ADD_OBJS) grt/run-bind.o grt/main.o grt/grt-file
$(GRT_RANLIB) $@
grt/run-bind.adb: grt $(GRT_SRC_DEPS) grt-force
- cd grt; $(GNATMAKE) -c -aI$(GRTSRCDIR) -aI.. $(GRT_PRAGMA_FLAG) \
- ghdl_main $(GRT_ADAFLAGS) -cargs $(GRT_FLAGS)
+ cd grt; $(MSYS2_ARG) $(GNATMAKE) -c -aI$(GRTSRCDIR) -aI.. \
+ $(GRT_PRAGMA_FLAG) ghdl_main $(GRT_ADAFLAGS) -cargs $(GRT_FLAGS)
# Set No Run-Time flag to suppress references to standard gnat library.
sed -e '/^P /s/P /P NR /' < grt/ghdl_main.ali > grt/ghdl_main-tmp.ali
$(MV) grt/ghdl_main-tmp.ali grt/ghdl_main.ali
@@ -115,10 +122,10 @@ grt:
mkdir grt
grt/run-bind.o: grt/run-bind.adb
- cd grt; $(GRT_ADACOMPILE) -o run-bind.o run-bind.adb
+ cd grt; $(MSYS2_ARG) $(GRT_ADACOMPILE) -o run-bind.o run-bind.adb
grt/main.o: $(GRTSRCDIR)/main.adb
- cd grt; $(GRT_ADACOMPILE) -o main.o $< -Igrt
+ cd grt; $(MSYS2_ARG) $(GRT_ADACOMPILE) -o main.o $< -Igrt
GRT_C_COMPILE = $(CC) -c $(GRT_FLAGS) -o $@ $<
GRT_C_COMPILE_PIC = $(CC) -c $(GRT_FLAGS) $(PIC_FLAGS) -o $@ $<