summarylogtreecommitdiffstats
path: root/proton-unfuck_makefile.patch
blob: ff24bab79da125949faeb93360555a8f2cc71a2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
diff --git a/build/makefile_base.mak b/build/makefile_base.mak
index 40c6bbc..5522982 100644
--- a/build/makefile_base.mak
+++ b/build/makefile_base.mak
@@ -90,6 +90,8 @@ SELECT_DOCKER_IMAGE :=
 ifneq ($(CONTAINER_SHELL32)$(CONTAINER_SHELL64),)
 	SUBMAKE_JOBS ?= 36
 	MAKE := make -j$(SUBMAKE_JOBS)
+else
+	MAKE := make -j$(SUBMAKE_JOBS)
 endif
 
 # Use default shell if no STEAMRT_ variables setup a container to invoke.  Commands will just run natively.
@@ -156,7 +158,7 @@ endif
 WINE32_AUTOCONF :=
 WINE64_AUTOCONF :=
 
-OPTIMIZE_FLAGS := -O2 -march=nocona $(call cc-option,$(CC),-mtune=core-avx2,) -mfpmath=sse
+OPTIMIZE_FLAGS := $(CFLAGS) -mfpmath=sse
 SANITY_FLAGS   := -fwrapv -fno-strict-aliasing
 COMMON_FLAGS   := $(OPTIMIZE_FLAGS) $(SANITY_FLAGS)
 
@@ -198,6 +200,8 @@ FFMPEG_CROSS_LDFLAGS :=
 FAUDIO := $(SRCDIR)/FAudio
 FAUDIO_OBJ32 := ./obj-faudio32
 FAUDIO_OBJ64 := ./obj-faudio64
+FAUDIO_DEPS32 :=
+FAUDIO_DEPS64 :=
 
 LSTEAMCLIENT := $(SRCDIR)/lsteamclient
 LSTEAMCLIENT32 := ./syn-lsteamclient32/lsteamclient
@@ -214,6 +218,8 @@ WINE_DST32 := ./dist-wine32
 WINE_OBJ32 := ./obj-wine32
 WINE_OBJ64 := ./obj-wine64
 WINEMAKER := $(abspath $(WINE)/tools/winemaker/winemaker)
+WINE_DEPS32 := faudio32
+WINE_DEPS64 := faudio64
 
 # Wine outputs that need to exist for other steps (dist)
 WINE_OUT_BIN := $(DST_DIR)/bin/wine64
@@ -221,9 +227,11 @@ WINE_OUT_SERVER := $(DST_DIR)/bin/wineserver
 WINE_OUT := $(WINE_OUT_BIN) $(WINE_OUT_SERVER)
 # Tool-only build outputs needed for other projects
 WINEGCC32 := $(TOOLS_DIR32)/bin/winegcc
+WINEGXX32 := $(TOOLS_DIR32)/bin/wineg++
 WINEBUILD32 := $(TOOLS_DIR32)/bin/winebuild
 WINE_BUILDTOOLS32 := $(WINEGCC32) $(WINEBUILD32)
 WINEGCC64 := $(TOOLS_DIR64)/bin/winegcc
+WINEGXX64 := $(TOOLS_DIR64)/bin/wineg++
 WINEBUILD64 := $(TOOLS_DIR64)/bin/winebuild
 WINE_BUILDTOOLS64 := $(WINEGCC64) $(WINEBUILD64)
 
@@ -261,11 +269,16 @@ VKD3D := $(SRCDIR)/vkd3d
 VKD3D_OBJ32 := ./obj-vkd3d32
 VKD3D_OBJ64 := ./obj-vkd3d64
 
+ifneq ($(STEAMRT_PATH),) # Don't build cmake in native mode
 CMAKE := $(SRCDIR)/cmake
-CMAKE_OBJ32 := ./obj-cmake32
-CMAKE_OBJ64 := ./obj-cmake64
+CMAKE_OBJ32 := ../obj-cmake32
+CMAKE_OBJ64 := ../obj-cmake64
 CMAKE_BIN32 := $(CMAKE_OBJ32)/built/bin/cmake
 CMAKE_BIN64 := $(CMAKE_OBJ64)/built/bin/cmake
+else
+CMAKE_BIN32 := cmake
+CMAKE_BIN64 := cmake
+endif # ifneq ($(STEAMRT_PATH),)
 
 BISON_VER = 3.3.2
 BISON_TARBALL := bison-$(BISON_VER).tar.xz
@@ -373,11 +386,20 @@ DIST_GECKO64 := $(DIST_GECKO_DIR)/$(GECKO64_MSI)
 DIST_WINEMONO_DIR := $(DST_DIR)/share/wine/mono
 DIST_WINEMONO := $(DIST_WINEMONO_DIR)/wine-mono-$(WINEMONO_VER)
 DIST_FONTS := $(DST_DIR)/share/fonts
+DIST_DEPS := wine vrclient lsteamclient steam
 
 DIST_TARGETS := $(DIST_COPY_TARGETS) $(DIST_OVR32) $(DIST_OVR64) \
-                $(DIST_GECKO32) $(DIST_GECKO64) $(DIST_WINEMONO) \
                 $(DIST_COMPAT_MANIFEST) $(DIST_LICENSE) $(DIST_FONTS)
 
+ifneq ($(SYSTEM_MONO),1) # May be disabled by configure
+DIST_TARGETS += $(DIST_WINEMONO)
+endif # ifneq ($(SYSTEM_MONO),1)
+
+ifneq ($(SYSTEM_GECKO),1) # May be disabled by configure
+DIST_TARGETS += $(DIST_GECKO32)
+DIST_TARGETS += $(DIST_GECKO64)
+endif # ifneq ($(SYSTEM_GECKO),1)
+
 DEPLOY_COPY_TARGETS := $(DIST_COPY_TARGETS) $(DIST_VERSION) $(DIST_LICENSE)
 REDIST_COPY_TARGETS := $(DEPLOY_COPY_TARGETS) $(DIST_COMPAT_MANIFEST)
 
@@ -403,7 +425,7 @@ $(DIST_GECKO_DIR):
 
 $(DIST_GECKO64): | $(DIST_GECKO_DIR)
 	if [ -e "$(SRCDIR)/../gecko/$(GECKO64_MSI)" ]; then \
-		cp "$(SRCDIR)/../gecko/$(GECKO64_MSI)" "$@"; \
+		cp -L "$(SRCDIR)/../gecko/$(GECKO64_MSI)" "$@"; \
 	else \
 		mkdir -p $(SRCDIR)/contrib/; \
 		if [ ! -e "$(SRCDIR)/contrib/$(GECKO64_MSI)" ]; then \
@@ -415,7 +437,7 @@ $(DIST_GECKO64): | $(DIST_GECKO_DIR)
 
 $(DIST_GECKO32): | $(DIST_GECKO_DIR)
 	if [ -e "$(SRCDIR)/../gecko/$(GECKO32_MSI)" ]; then \
-		cp "$(SRCDIR)/../gecko/$(GECKO32_MSI)" "$@"; \
+		cp -L "$(SRCDIR)/../gecko/$(GECKO32_MSI)" "$@"; \
 	else \
 		mkdir -p $(SRCDIR)/contrib/; \
 		if [ ! -e "$(SRCDIR)/contrib/$(GECKO32_MSI)" ]; then \
@@ -451,7 +473,7 @@ $(DIST_FONTS): fonts
 ALL_TARGETS += dist
 GOAL_TARGETS += dist
 
-dist: $(DIST_TARGETS) wine vrclient lsteamclient steam dxvk d9vk | $(DST_DIR)
+dist: $(DIST_TARGETS) $(DIST_DEPS) | $(DST_DIR)
 	echo `date '+%s'` `GIT_DIR=$(abspath $(SRCDIR)/.git) git describe --tags` > $(DIST_VERSION)
 	cp $(DIST_VERSION) $(DST_BASE)/
 	rm -rf $(abspath $(DIST_PREFIX)) && \
@@ -514,13 +536,15 @@ $(FFMPEG_CONFIGURE_FILES64): $(FFMPEG)/configure $(MAKEFILE_DEP) | $(FFMPEG_OBJ6
 		$(abspath $(FFMPEG))/configure \
 			--cc=$(CC_QUOTED) --cxx=$(CXX_QUOTED) \
 			--prefix=$(abspath $(TOOLS_DIR64)) \
+			--extra-cflags="$(COMMON_FLAGS)" \
+			--extra-ldflags="$(LDFLAGS)" \
+			--disable-debug \
 			--disable-static \
 			--enable-shared \
 			--disable-programs \
 			--disable-doc \
 			--disable-avdevice \
 			--disable-avformat \
-			--disable-swresample \
 			--disable-swscale \
 			--disable-postproc \
 			--disable-avfilter \
@@ -546,17 +570,19 @@ $(FFMPEG_CONFIGURE_FILES64): $(FFMPEG)/configure $(MAKEFILE_DEP) | $(FFMPEG_OBJ6
 $(FFMPEG_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
 $(FFMPEG_CONFIGURE_FILES32): $(FFMPEG)/configure $(MAKEFILE_DEP) | $(FFMPEG_OBJ32)
 	cd $(dir $@) && \
+        export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" && \
 		$(abspath $(FFMPEG))/configure \
 			--cc=$(CC_QUOTED) --cxx=$(CXX_QUOTED) \
 			--prefix=$(abspath $(TOOLS_DIR32)) \
-			--extra-cflags=$(FFMPEG_CROSS_CFLAGS) --extra-ldflags=$(FFMPEG_CROSS_LDFLAGS) \
+			--extra-cflags="$(COMMON_FLAGS) -m32" \
+			--extra-ldflags="$(LDFLAGS) -m32" \
+			--disable-debug \
 			--disable-static \
 			--enable-shared \
 			--disable-programs \
 			--disable-doc \
 			--disable-avdevice \
 			--disable-avformat \
-			--disable-swresample \
 			--disable-swscale \
 			--disable-postproc \
 			--disable-avfilter \
@@ -599,14 +625,17 @@ ffmpeg64: $(FFMPEG_CONFIGURE_FILES64)
 	+$(MAKE) -C $(FFMPEG_OBJ64)
 	+$(MAKE) -C $(FFMPEG_OBJ64) install
 	mkdir -pv $(DST_DIR)/lib64
-	cp -a $(TOOLS_DIR64)/lib/{libavcodec,libavutil}* $(DST_DIR)/lib64
+	cp -a $(TOOLS_DIR64)/lib/{libavcodec,libavutil,libswresample}* $(DST_DIR)/lib64
 
 ffmpeg32: SHELL = $(CONTAINER_SHELL32)
 ffmpeg32: $(FFMPEG_CONFIGURE_FILES32)
 	+$(MAKE) -C $(FFMPEG_OBJ32)
 	+$(MAKE) -C $(FFMPEG_OBJ32) install
 	mkdir -pv $(DST_DIR)/lib
-	cp -a $(TOOLS_DIR32)/lib/{libavcodec,libavutil}* $(DST_DIR)/lib
+	cp -a $(TOOLS_DIR32)/lib/{libavcodec,libavutil,libswresample}* $(DST_DIR)/lib
+
+FAUDIO_DEPS32 += ffmpeg32
+FAUDIO_DEPS64 += ffmpeg64
 
 endif # ifeq ($(WITH_FFMPEG),1)
 
@@ -632,19 +661,22 @@ FAUDIO_CONFIGURE_FILES32 := $(FAUDIO_OBJ32)/Makefile
 FAUDIO_CONFIGURE_FILES64 := $(FAUDIO_OBJ64)/Makefile
 
 $(FAUDIO_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
-$(FAUDIO_CONFIGURE_FILES32): $(FAUDIO)/CMakeLists.txt $(MAKEFILE_DEP) $(CMAKE_BIN32) | $(FAUDIO_OBJ32)
+$(FAUDIO_CONFIGURE_FILES32): $(FAUDIO)/CMakeLists.txt $(MAKEFILE_DEP) $(FAUDIO_DEPS32) | $(FAUDIO_OBJ32)
 	cd $(dir $@) && \
-		../$(CMAKE_BIN32) $(abspath $(FAUDIO)) \
+		$(CMAKE_BIN32) $(abspath $(FAUDIO)) \
 			-DCMAKE_INSTALL_PREFIX="$(abspath $(TOOLS_DIR32))" \
+			-DFFmpeg_INCLUDE_DIR="$(abspath $(TOOLS_DIR32))/include" \
 			$(FAUDIO_CMAKE_FLAGS) \
-			-DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32"
+			-DCMAKE_C_FLAGS="$(COMMON_FLAGS) -m32" -DCMAKE_CXX_FLAGS="$(COMMON_FLAGS) -m32"
 
 $(FAUDIO_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
-$(FAUDIO_CONFIGURE_FILES64): $(FAUDIO)/CMakeLists.txt $(MAKEFILE_DEP) $(CMAKE_BIN64) | $(FAUDIO_OBJ64)
+$(FAUDIO_CONFIGURE_FILES64): $(FAUDIO)/CMakeLists.txt $(MAKEFILE_DEP) $(FAUDIO_DEPS64) | $(FAUDIO_OBJ64)
 	cd $(dir $@) && \
-		../$(CMAKE_BIN64) $(abspath $(FAUDIO)) \
+		$(CMAKE_BIN64) $(abspath $(FAUDIO)) \
 			-DCMAKE_INSTALL_PREFIX="$(abspath $(TOOLS_DIR64))" \
-			$(FAUDIO_CMAKE_FLAGS)
+			-DFFmpeg_INCLUDE_DIR="$(abspath $(TOOLS_DIR64))/include" \
+			$(FAUDIO_CMAKE_FLAGS) \
+			-DCMAKE_C_FLAGS="$(COMMON_FLAGS)" -DCMAKE_CXX_FLAGS="$(COMMON_FLAGS)"
 
 faudio32: SHELL = $(CONTAINER_SHELL32)
 faudio32: $(FAUDIO_CONFIGURE_FILES32)
@@ -834,35 +866,41 @@ WINE32_MAKE_ARGS := \
 
 # 64bit-configure
 $(WINE_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
-$(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | faudio64 vkd3d64 $(WINE_OBJ64) bison64
+$(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINE_DEPS64) $(WINE_OBJ64)
 	cd $(dir $@) && \
 		STRIP=$(STRIP_QUOTED) \
-		PATH="$(dir $(abspath $(BISON_BIN64))):$(PATH)" \
+		PATH="$(dir $(WINE_BISONPATH64)):$(PATH)" \
 		CFLAGS="-I$(abspath $(TOOLS_DIR64))/include -g $(COMMON_FLAGS)" \
 		CXXFLAGS="-I$(abspath $(TOOLS_DIR64))/include -g $(COMMON_FLAGS) -fno-gnu-unique -std=c++17" \
-		LDFLAGS=-L$(abspath $(TOOLS_DIR64))/lib \
-		PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR64))/lib/pkgconfig \
+		LDFLAGS="-L$(abspath $(TOOLS_DIR64))/lib -Wl,-rpath-link,$(abspath $(TOOLS_DIR64))/lib" \
+		PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR64))/lib/pkgconfig:/usr/lib/pkgconfig \
 		CC=$(CC_QUOTED) \
 		CXX=$(CXX_QUOTED) \
 		../$(WINE)/configure \
 			$(WINE64_AUTOCONF) \
+			--with-x \
+			--with-gstreamer \
+            --without-mingw \
 			--without-curses \
 			--enable-win64 --disable-tests --prefix=$(abspath $(DST_DIR))
 
 # 32-bit configure
 $(WINE_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
-$(WINE_CONFIGURE_FILES32): $(MAKEFILE_DEP) | faudio32 vkd3d32 $(WINE_OBJ32) bison32
+$(WINE_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINE_DEPS32) $(WINE_OBJ32)
 	cd $(dir $@) && \
 		STRIP=$(STRIP_QUOTED) \
-		PATH="$(dir $(abspath $(BISON_BIN32))):$(PATH)" \
+		PATH="$(dir $(WINE_BISONPATH32)):$(PATH)" \
 		CFLAGS="-I$(abspath $(TOOLS_DIR32))/include -g $(COMMON_FLAGS)" \
 		CXXFLAGS="-I$(abspath $(TOOLS_DIR32))/include -g $(COMMON_FLAGS) -fno-gnu-unique -std=c++17" \
-		LDFLAGS=-L$(abspath $(TOOLS_DIR32))/lib \
-		PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR32))/lib/pkgconfig \
+		LDFLAGS="-L$(abspath $(TOOLS_DIR32))/lib -Wl,-rpath-link,$(abspath $(TOOLS_DIR32))/lib" \
+		PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR32))/lib/pkgconfig:/usr/lib32/pkgconfig \
 		CC=$(CC_QUOTED) \
 		CXX=$(CXX_QUOTED) \
 		../$(WINE)/configure \
 			$(WINE32_AUTOCONF) \
+			--with-x \
+			--with-gstreamer \
+            --without-mingw \
 			--without-curses \
 			--disable-tests --prefix=$(abspath $(WINE_DST32))
 
@@ -891,7 +929,7 @@ $(WINE_BUILDTOOLS64) $(WINE_OUT) wine64: wine64-intermediate
 
 wine64-intermediate: SHELL = $(CONTAINER_SHELL64)
 wine64-intermediate: $(WINE_CONFIGURE_FILES64)
-	+PATH="$(dir $(abspath $(BISON_BIN64))):$(PATH)" $(MAKE) -C $(WINE_OBJ64) $(WINE_COMMON_MAKE_ARGS)
+	+PATH="$(dir $(WINE_BISONPATH64)):$(PATH)" $(MAKE) -C $(WINE_OBJ64) $(WINE_COMMON_MAKE_ARGS)
 	+$(MAKE) -C $(WINE_OBJ64) $(WINE_COMMON_MAKE_ARGS) install-lib
 	+$(MAKE) -C $(WINE_OBJ64) $(WINE64_MAKE_ARGS) install-lib install-dev
 	if [ "$(UNSTRIPPED_BUILD)" == "" ]; then rm -rf $(DST_DIR)/lib64/wine/.debug; fi
@@ -905,7 +943,7 @@ $(WINE_BUILDTOOLS32) wine32: wine32-intermediate
 
 wine32-intermediate: SHELL = $(CONTAINER_SHELL32)
 wine32-intermediate: $(WINE_CONFIGURE_FILES32)
-	+PATH="$(dir $(abspath $(BISON_BIN32))):$(PATH)" $(MAKE) -C $(WINE_OBJ32) $(WINE_COMMON_MAKE_ARGS)
+	+PATH="$(dir $(WINE_BISONPATH32)):$(PATH)" $(MAKE) -C $(WINE_OBJ32) $(WINE_COMMON_MAKE_ARGS)
 	+$(MAKE) -C $(WINE_OBJ32) $(WINE_COMMON_MAKE_ARGS) install-lib
 	+$(MAKE) -C $(WINE_OBJ32) $(WINE32_MAKE_ARGS) install-lib install-dev
 	mkdir -p $(DST_DIR)/{lib,bin}
@@ -1017,6 +1055,8 @@ vrclient32: $(VRCLIENT_CONFIGURE_FILES32) | $(WINE_BUILDTOOLS32) $(filter $(MAKE
 
 ## Create & configure object directory for cmake
 
+ifneq ($(STEAMRT_PATH),) # Don't build cmake in native mode
+
 CMAKE_CONFIGURE_FILES32 := $(CMAKE_OBJ32)/Makefile
 CMAKE_CONFIGURE_FILES64 := $(CMAKE_OBJ64)/Makefile
 
@@ -1068,6 +1108,13 @@ cmake32-intermediate: $(CMAKE_CONFIGURE_FILES32) $(filter $(MAKECMDGOALS),cmake3
 	+$(MAKE) -C $(CMAKE_OBJ32) install
 	touch $(CMAKE_BIN32)
 
+FAUDIO_DEPS32 += cmake32
+FAUDIO_DEPS64 += cmake64
+
+endif # ifneq ($(STEAMRT_PATH),)
+
+ifneq ($(STEAMRT_PATH),) # Don't build bison in native mode
+
 ##
 ## bison -- necessary for wine, steam runtime version too old
 ##
@@ -1138,6 +1185,13 @@ bison32-intermediate: $(BISON_CONFIGURE_FILES32) $(filter $(MAKECMDGOALS),bison3
 	+$(MAKE) -C $(BISON_OBJ32) install
 	touch $(BISON_BIN32)
 
+WINE_DEPS32 += bison32
+WINE_DEPS64 += bison64
+WINE_BISONPATH32 := $(abspath $(BISON_BIN32))
+WINE_BISONPATH64 := $(abspath $(BISON_BIN64))
+
+endif # ifneq ($(STEAMRT_PATH),)
+
 ##
 ## dxvk
 ##
@@ -1150,6 +1204,8 @@ ifneq ($(NO_DXVK),1) # May be disabled by configure
 
 DXVK_CONFIGURE_FILES32 := $(DXVK_OBJ32)/build.ninja
 DXVK_CONFIGURE_FILES64 := $(DXVK_OBJ64)/build.ninja
+COMMA := ,
+MESON_CFLAGS := $(subst $() $(),'$(COMMA)',$(CFLAGS))
 
 # 64bit-configure.  Remove coredata file if already configured (due to e.g. makefile changing)
 $(DXVK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(DXVK)/build-win64.txt | $(DXVK_OBJ64)
@@ -1206,6 +1262,8 @@ dxvk32: $(DXVK_CONFIGURE_FILES32)
 	cp "$(DXVK_OBJ32)"/bin/d3d10core.dll "$(DST_DIR)"/lib/wine/dxvk/
 	if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- dxvk ) > "$(DST_DIR)"/lib/wine/dxvk/version; fi
 
+DIST_DEPS += dxvk
+
 D9VK_CONFIGURE_FILES32 := $(D9VK_OBJ32)/build.ninja
 D9VK_CONFIGURE_FILES64 := $(D9VK_OBJ64)/build.ninja
 
@@ -1256,8 +1314,12 @@ d9vk32: $(D9VK_CONFIGURE_FILES32)
 	cp "$(D9VK_OBJ32)"/bin/d3d9.dll "$(DST_DIR)"/lib/wine/dxvk/
 	if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- d9vk ) > "$(DST_DIR)"/lib/wine/dxvk/d9vk_version; fi
 
+DIST_DEPS += d9vk
+
 endif # NO_DXVK
 
+ifneq ($(STEAMRT_PATH),) # Don't build bison in native mode
+
 # Vulkan-Headers
 
 VULKAN_H_CONFIGURE_FILES32 := $(VULKAN_H_OBJ32)/Makefile
@@ -1317,7 +1379,7 @@ $(WINEWIDL_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
 $(WINEWIDL_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINEWIDL_OBJ32) bison32
 	cd $(dir $@) && \
 		STRIP=$(STRIP_QUOTED) \
-		BISON=$(abspath $(BISON_BIN32)) \
+		BISON=$(WINE_BISONPATH32) \ \
 		CFLAGS=-I$(abspath $(TOOLS_DIR64))"/include -g $(COMMON_FLAGS)" \
 		LDFLAGS=-L$(abspath $(TOOLS_DIR32))/lib \
 		PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR32))/lib/pkgconfig \
@@ -1337,7 +1399,7 @@ $(WINEWIDL_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
 $(WINEWIDL_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINEWIDL_OBJ64) bison64
 	cd $(dir $@) && \
 		STRIP=$(STRIP_QUOTED) \
-		BISON=$(abspath $(BISON_BIN64)) \
+		BISON=$(WINE_BISONPATH64) \ \
 		CFLAGS=-I$(abspath $(TOOLS_DIR64))"/include -g $(COMMON_FLAGS)" \
 		LDFLAGS=-L$(abspath $(TOOLS_DIR64))/lib \
 		PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR64))/lib/pkgconfig \
@@ -1395,6 +1457,11 @@ vkd3d64: $(VKD3D_CONFIGURE_FILES64)
 
 vkd3d: vkd3d32 vkd3d64
 
+WINE_DEPS32 += vkd3d32
+WINE_DEPS64 += vkd3d64
+
+endif # ifneq ($(STEAMRT_PATH),)
+
 # TODO Tests
 #  build_vrclient64_tests
 #  build_vrclient32_tests