improve compatibility with mingw, patch by Alain Frisch
authorChris Lattner <sabre@nondot.org>
Tue, 15 Jan 2008 22:50:50 +0000 (22:50 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 Jan 2008 22:50:50 +0000 (22:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46026 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.config.in
lib/VMCore/Makefile

index d066e772cbb0186781cf386646904bf8fcd00887..94dce300bbf37647b564510fa74b65d324b14ef9 100644 (file)
@@ -265,3 +265,11 @@ BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
 ALL_BINDINGS      := @ALL_BINDINGS@
 OCAML_LIBDIR      := @OCAML_LIBDIR@
 
+# When compiling under Mingw/Cygwin, executables such as tblgen
+# expect Windows paths, whereas the build system uses Unix paths.
+# The function SYSPATH transforms Unix paths into Windows paths.
+ifneq (,$(findstring -mno-cygwin, $(CXX)))
+  SYSPATH = $(shell echo $(1) | cygpath -m -f -)
+else
+  SYSPATH = $(1)
+endif
index 2e283ec10cd74b0008f8d187e2653df80fbc1624..35ef865b8f151afe3f0659375af0804878a76a66 100644 (file)
@@ -21,7 +21,7 @@ INTRINSICTDS := $(wildcard $(PROJ_SRC_ROOT)/include/llvm/Intrinsics*.td)
 
 $(ObjDir)/Intrinsics.gen.tmp: $(ObjDir)/.dir $(INTRINSICTDS) $(TBLGEN)
        $(Echo) Building Intrinsics.gen.tmp from Intrinsics.td
-       $(Verb) $(TableGen) $(INTRINSICTD) -o $@ -gen-intrinsic
+       $(Verb) $(TableGen) $(call SYSPATH, $(INTRINSICTD)) -o $(call SYSPATH, $@) -gen-intrinsic
 
 $(GENFILE): $(ObjDir)/Intrinsics.gen.tmp
        $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \