|
75 | 75 | CMAKE_COMMON += -DCMAKE_RC_COMPILER="$$(which $(CROSS_COMPILE)windres)" |
76 | 76 | endif |
77 | 77 |
|
78 | | -# For now this is LLVM specific, but I expect it won't be in the future |
79 | 78 | ifeq ($(CMAKE_GENERATOR),Ninja) |
80 | 79 | CMAKE_GENERATOR_COMMAND := -G Ninja |
81 | 80 | else ifeq ($(CMAKE_GENERATOR),make) |
|
84 | 83 | $(error Unknown CMake generator '$(CMAKE_GENERATOR)'. Options are 'Ninja' and 'make') |
85 | 84 | endif |
86 | 85 |
|
87 | | -# Detect MSYS2 with cygwin CMake rather than MinGW cmake - the former fails to |
88 | | -# properly drive MinGW tools |
89 | 86 | ifneq (,$(findstring MINGW,$(RAW_BUILD_OS))) |
90 | 87 | ifneq (,$(shell ldd $(shell which cmake) | grep msys-2.0.dll)) |
| 88 | +# Detect MSYS2 with cygwin CMake rather than MinGW cmake - the former fails to |
| 89 | +# properly drive MinGW tools |
91 | 90 | override CMAKE := echo "ERROR: CMake is Cygwin CMake, not MinGW CMake. Build will fail. Use 'pacman -S mingw-w64-{i686,x86_64}-cmake'."; exit 1; $(CMAKE) |
92 | 91 | endif |
| 92 | +# In our setup, CMAKE_INSTALL_PREFIX is a relative path inside usr-staging. |
| 93 | +# We do not want this converted to a windows path, because our make system |
| 94 | +# assumes it to be relative to msys `/`. |
| 95 | +override CMAKE := MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX" $(CMAKE) |
93 | 96 | endif |
94 | 97 |
|
| 98 | +# Some dependencies' tarballs contains symlinks to non-existent targets. This breaks the |
| 99 | +# the default msys strategy `deepcopy` symlink strategy. To workaround this, |
| 100 | +# switch to `native` which tries native windows symlinks (possible if the |
| 101 | +# machine is in developer mode) - or if not, falls back to cygwin-style |
| 102 | +# symlinks. We don't particularly care either way - we just need to symlinks |
| 103 | +# to succeed. We could guard this by a uname check, but it's harmless elsewhere, |
| 104 | +# so let's not incur the additional overhead. |
| 105 | +MSYS_NONEXISTENT_SYMLINK_TARGET_FIX := export MSYS=winsymlinks:native |
| 106 | + |
95 | 107 | # If the top-level Makefile is called with environment variables, |
96 | 108 | # they will override the values passed above to ./configure |
97 | 109 | MAKE_COMMON := DESTDIR="" prefix=$(build_prefix) bindir=$(build_depsbindir) libdir=$(build_libdir) shlibdir=$(build_shlibdir) libexecdir=$(build_libexecdir) datarootdir=$(build_datarootdir) includedir=$(build_includedir) sysconfdir=$(build_sysconfdir) O= |
@@ -168,7 +180,7 @@ upper = $(shell echo $1 | tr a-z A-Z) |
168 | 180 | # this rule ensures that make install is more nearly atomic |
169 | 181 | # so it's harder to get half-installed (or half-reinstalled) dependencies |
170 | 182 | # # and enables sharing deps compiles, uninstall, and fast reinstall |
171 | | -MAKE_INSTALL = +$$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2" |
| 183 | +MAKE_INSTALL = MSYS2_ARG_CONV_EXCL="prefix=" $$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2" |
172 | 184 |
|
173 | 185 | define SHLIBFILE_INSTALL |
174 | 186 | mkdir -p $2/$$(build_shlibdir) |
|
0 commit comments