summarylogtreecommitdiffstats
path: root/proton-unfuck_makefile.patch
blob: f156e1c9ebb2b9e454e8040e90972f601b1bc1bb (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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
diff --git a/build/makefile_base.mak b/build/makefile_base.mak
index 1b02135..34ca827 100644
--- a/build/makefile_base.mak
+++ b/build/makefile_base.mak
@@ -89,8 +89,8 @@ SELECT_DOCKER_IMAGE :=
 # controllable by SUBMAKE_JOBS.  Not ideal.
 ifneq ($(CONTAINER_SHELL32)$(CONTAINER_SHELL64),)
 	SUBMAKE_JOBS ?= 36
-	MAKE := make -j$(SUBMAKE_JOBS)
 endif
+MAKE := make -j$(SUBMAKE_JOBS)
 
 # Use default shell if no STEAMRT_ variables setup a container to invoke.  Commands will just run natively.
 ifndef CONTAINER_SHELL64
@@ -154,7 +154,8 @@ else
     VKD3D_INSTALL_TARGET := install-strip
 endif
 
-OPTIMIZE_FLAGS := -O2 -march=nocona $(call cc-option,$(CC),-mtune=core-avx2,) -mfpmath=sse
+CFLAGS ?= -O2 -march=nocona $(call cc-option,$(CC),-mtune=core-avx2,)
+OPTIMIZE_FLAGS := $(CFLAGS) -mfpmath=sse
 SANITY_FLAGS   := -fwrapv -fno-strict-aliasing
 COMMON_FLAGS   := $(OPTIMIZE_FLAGS) $(SANITY_FLAGS)
 
@@ -213,6 +214,16 @@ GST_GOOD_OBJ64 := ./obj-gst-good64
 FAUDIO := $(SRCDIR)/FAudio
 FAUDIO_OBJ32 := ./obj-faudio32
 FAUDIO_OBJ64 := ./obj-faudio64
+FAUDIO_DEPS32 :=
+FAUDIO_DEPS64 :=
+ifneq ($(STEAMRT_PATH),) # Don't build cmake in native mode
+	FAUDIO_DEPS32 += cmake32
+	FAUDIO_DEPS64 += cmake64
+endif # STEAMRT_PATH
+ifeq ($(WITH_FFMPEG),1)
+	FAUDIO_DEPS32 += ffmpeg32
+	FAUDIO_DEPS64 += ffmpeg64
+endif # WITH_FFMPEG
 
 LSTEAMCLIENT := $(SRCDIR)/lsteamclient
 LSTEAMCLIENT32 := ./syn-lsteamclient32/lsteamclient
@@ -229,6 +240,12 @@ WINE_DST32 := ./dist-wine32
 WINE_OBJ32 := ./obj-wine32
 WINE_OBJ64 := ./obj-wine64
 WINEMAKER := $(abspath $(WINE)/tools/winemaker/winemaker)
+WINE_DEPS32 := faudio32 vkd3d32
+WINE_DEPS64 := faudio64 vkd3d64
+ifneq ($(STEAMRT_PATH),) # Don't build gstreamer/bison in native mode
+	WINE_DEPS32 += gst_base32 bison32
+	WINE_DEPS64 += gst_base64 bison64
+endif # STEAMRT_PATH
 
 # Wine outputs that need to exist for other steps (dist)
 WINE_OUT_BIN := $(DST_DIR)/bin/wine64
@@ -236,9 +253,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)
 
@@ -246,6 +265,12 @@ WINEWIDL_OBJ32 := ./obj-widl32
 WINEWIDL_OBJ64 := ./obj-widl64
 WINEWIDL32 := $(WINEWIDL_OBJ32)/tools/widl/widl
 WINEWIDL64 := $(WINEWIDL_OBJ64)/tools/widl/widl
+WINEWIDL_DEPS32 :=
+WINEWIDL_DEPS64 :=
+ifneq ($(STEAMRT_PATH),) # Don't build bison in native mode
+	WINEWIDL_DEPS32 += bison32
+	WINEWIDL_DEPS64 += bison64
+endif # STEAMRT_PATH
 
 VRCLIENT := $(SRCDIR)/vrclient_x64
 VRCLIENT32 := ./syn-vrclient32
@@ -261,22 +286,38 @@ VULKAN_H_OBJ32 := ./obj-vulkan-headers32
 VULKAN_H_OBJ64 := ./obj-vulkan-headers64
 VULKAN_H32 := $(TOOLS_DIR32)/include/vulkan/vulkan.h
 VULKAN_H64 := $(TOOLS_DIR64)/include/vulkan/vulkan.h
+VULKAN_H_DEPS32 :=
+VULKAN_H_DEPS64 :=
+ifneq ($(STEAMRT_PATH),) # Don't build cmake in native mode
+	VULKAN_H_DEPS32 += cmake32
+	VULKAN_H_DEPS64 += cmake64
+endif # STEAMRT_PATH
 
 SPIRV_HEADERS := $(SRCDIR)/SPIRV-Headers
 SPIRV_H_OBJ32 := ./obj-spirv-headers32
 SPIRV_H_OBJ64 := ./obj-spirv-headers64
 SPIRV_H32 := $(TOOLS_DIR32)/include/spirv/spirv.h
 SPIRV_H64 := $(TOOLS_DIR64)/include/spirv/spirv.h
+SPIRV_H_DEPS32 :=
+SPIRV_H_DEPS64 :=
+ifneq ($(STEAMRT_PATH),) # Don't build cmake in native mode
+	SPIRV_H_DEPS32 += cmake32
+	SPIRV_H_DEPS64 += cmake64
+endif # STEAMRT_PATH
 
 VKD3D := $(SRCDIR)/vkd3d
 VKD3D_OBJ32 := ./obj-vkd3d32
 VKD3D_OBJ64 := ./obj-vkd3d64
 
+CMAKE_BIN32 := cmake
+CMAKE_BIN64 := cmake
+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
+endif # STEAMRT_PATH
 
 BISON_VER = 3.3.2
 BISON_TARBALL := bison-$(BISON_VER).tar.xz
@@ -285,6 +326,10 @@ BISON_OBJ32 := ./obj-bison32
 BISON_OBJ64 := ./obj-bison64
 BISON_BIN32 := $(BISON_OBJ32)/built/bin/bison
 BISON_BIN64 := $(BISON_OBJ64)/built/bin/bison
+ifneq ($(STEAMRT_PATH),) # Don't build bison in native mode
+	WINE_BISON32 = BISON=$(abspath $(BISON_BIN32))
+	WINE_BISON64 = BISON=$(abspath $(BISON_BIN64))
+endif # STEAMRT_PATH
 
 
 FONTS := $(SRCDIR)/fonts
@@ -388,11 +433,26 @@ DIST_GECKO64 := $(DIST_GECKO_DIR)/wine-gecko-$(GECKO_VER)-x86_64
 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
+ifneq ($(STEAMRT_PATH),) # Don't build gstreamer in native mode
+	DIST_DEPS += gst_good
+endif # STEAMRT_PATH
+ifneq ($(NO_DXVK),1) # May be disabled by configure
+	DIST_DEPS += dxvk
+endif # NO_DXVK
 
 DIST_TARGETS := $(DIST_COPY_TARGETS) $(DIST_OVR32) $(DIST_OVR64) \
-                $(DIST_GECKO32) $(DIST_GECKO64) $(DIST_WINEMONO) \
                 $(DIST_COMPAT_MANIFEST) $(DIST_LICENSE) $(DIST_OFL_LICENSE) $(DIST_FONTS)
 
+ifneq ($(SYSTEM_GECKO),1) # May be disabled by configure
+	DIST_TARGETS += $(DIST_GECKO32)
+	DIST_TARGETS += $(DIST_GECKO64)
+endif # SYSTEM_GECKO
+
+ifneq ($(SYSTEM_MONO),1) # May be disabled by configure
+	DIST_TARGETS += $(DIST_WINEMONO)
+endif # SYSTEM_MONO
+
 DEPLOY_COPY_TARGETS := $(DIST_COPY_TARGETS) $(DIST_VERSION) $(DIST_LICENSE) $(DIST_OFL_LICENSE)
 REDIST_COPY_TARGETS := $(DEPLOY_COPY_TARGETS) $(DIST_COMPAT_MANIFEST)
 
@@ -468,7 +528,7 @@ $(DIST_FONTS): fonts
 ALL_TARGETS += dist
 GOAL_TARGETS += dist
 
-dist: $(DIST_TARGETS) wine gst_good vrclient lsteamclient steam dxvk | $(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)) && \
@@ -515,6 +575,8 @@ module64:
 
 module: module32 module64
 
+ifneq ($(STEAMRT_PATH),) # Don't build gstreamer in native mode
+
 ##
 ## glib
 ##
@@ -846,6 +908,7 @@ gst_good32: $(GST_GOOD_CONFIGURE_FILES32)
 	cp -a $(TOOLS_DIR32)/lib/libgst* $(DST_DIR)/lib/ && \
 	cp -a $(TOOLS_DIR32)/lib/gstreamer-1.0 $(DST_DIR)/lib/
 
+endif # ifneq ($(STEAMRT_PATH),)
 
 ##
 ## ffmpeg
@@ -863,13 +926,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 \
@@ -895,17 +960,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 \
@@ -948,14 +1015,14 @@ 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
 
 endif # ifeq ($(WITH_FFMPEG),1)
 
@@ -981,19 +1048,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)
@@ -1183,36 +1253,48 @@ WINE32_MAKE_ARGS := \
 
 # 64bit-configure
 $(WINE_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
-$(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | faudio64 vkd3d64 gst_base64 $(WINE_OBJ64) bison64
+$(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINE_DEPS64) $(WINE_OBJ64)
 	cd $(dir $@) && \
 		../$(WINE)/configure \
+			--with-x \
+			--with-gstreamer \
+			--without-mingw \
 			--without-curses \
+			--without-oss \
+			--disable-winemenubuilder \
+			--disable-win16 \
 			--enable-win64 \
 			--disable-tests \
 			--prefix=$(abspath $(DST_DIR)) \
 			STRIP=$(STRIP_QUOTED) \
-			BISON=$(abspath $(BISON_BIN64)) \
+			$(WINE_BISON64) \
 			CFLAGS="-I$(abspath $(TOOLS_DIR64))/include -g $(COMMON_FLAGS)" \
 			CXXFLAGS="-I$(abspath $(TOOLS_DIR64))/include -g $(COMMON_FLAGS) -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)
 
 # 32-bit configure
 $(WINE_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
-$(WINE_CONFIGURE_FILES32): $(MAKEFILE_DEP) | faudio32 vkd3d32 gst_base32 $(WINE_OBJ32) bison32
+$(WINE_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINE_DEPS32) $(WINE_OBJ32)
 	cd $(dir $@) && \
 		../$(WINE)/configure \
+			--with-x \
+			--with-gstreamer \
+			--without-mingw \
 			--without-curses \
+			--without-oss \
+			--disable-winemenubuilder \
+			--disable-win16 \
 			--disable-tests \
 			--prefix=$(abspath $(WINE_DST32)) \
 			STRIP=$(STRIP_QUOTED) \
-			BISON=$(abspath $(BISON_BIN32)) \
+			$(WINE_BISON32) \
 			CFLAGS="-I$(abspath $(TOOLS_DIR32))/include -g $(COMMON_FLAGS)" \
 			CXXFLAGS="-I$(abspath $(TOOLS_DIR32))/include -g $(COMMON_FLAGS) -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)
 
@@ -1367,6 +1449,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
 
@@ -1418,12 +1502,16 @@ cmake32-intermediate: $(CMAKE_CONFIGURE_FILES32) $(filter $(MAKECMDGOALS),cmake3
 	+$(MAKE) -C $(CMAKE_OBJ32) install
 	touch $(CMAKE_BIN32)
 
+endif # ifneq ($(STEAMRT_PATH),)
+
 ##
 ## bison -- necessary for wine, steam runtime version too old
 ##
 
 # TODO Don't bother with this in native mode
 
+ifneq ($(STEAMRT_PATH),) # Don't build bison in native mode
+
 $(BISON):
 	if [ -e "$(SRCDIR)/../bison/$(BISON_TARBALL)" ]; then \
 		mkdir -p $(dir $@); \
@@ -1488,6 +1576,8 @@ bison32-intermediate: $(BISON_CONFIGURE_FILES32) $(filter $(MAKECMDGOALS),bison3
 	+$(MAKE) -C $(BISON_OBJ32) install
 	touch $(BISON_BIN32)
 
+endif # ifneq ($(STEAMRT_PATH),)
+
 ##
 ## dxvk
 ##
@@ -1508,7 +1598,7 @@ $(DXVK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(DXVK)/build-win64.txt | $(DXVK_OBJ6
 	fi
 	cd "$(abspath $(DXVK))" && \
 	PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
-		meson --prefix="$(abspath $(DXVK_OBJ64))" --cross-file "$(abspath $(DXVK))/build-win64.txt" $(MESON_STRIP_ARG) --buildtype=release "$(abspath $(DXVK_OBJ64))"
+		meson --prefix="$(abspath $(DXVK_OBJ64))" --cross-file "$(abspath $(DXVK))/build-win64.txt" $(MESON_STRIP_ARG) --optimization=3 --buildtype=release "$(abspath $(DXVK_OBJ64))"
 
 # 32-bit configure.  Remove coredata file if already configured (due to e.g. makefile changing)
 $(DXVK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(DXVK)/build-win32.txt | $(DXVK_OBJ32)
@@ -1517,7 +1607,7 @@ $(DXVK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(DXVK)/build-win32.txt | $(DXVK_OBJ3
 	fi
 	cd "$(abspath $(DXVK))" && \
 	PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
-		meson --prefix="$(abspath $(DXVK_OBJ32))" --cross-file "$(abspath $(DXVK))/build-win32.txt" $(MESON_STRIP_ARG) --buildtype=release "$(abspath $(DXVK_OBJ32))"
+		meson --prefix="$(abspath $(DXVK_OBJ32))" --cross-file "$(abspath $(DXVK))/build-win32.txt" $(MESON_STRIP_ARG) --optimization=3 --buildtype=release "$(abspath $(DXVK_OBJ32))"
 
 ## dxvk goals
 DXVK_TARGETS = dxvk dxvk_configure dxvk32 dxvk64 dxvk_configure32 dxvk_configure64
@@ -1536,7 +1626,7 @@ dxvk_configure32: $(DXVK_CONFIGURE_FILES32)
 dxvk: dxvk32 dxvk64
 
 dxvk64: $(DXVK_CONFIGURE_FILES64)
-	env PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" ninja -C "$(DXVK_OBJ64)" install
+	env PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" ninja -C "$(DXVK_OBJ64)" -v install
 	mkdir -p "$(DST_DIR)/lib64/wine/dxvk"
 	cp "$(DXVK_OBJ64)"/bin/dxgi.dll "$(DST_DIR)"/lib64/wine/dxvk
 	cp "$(DXVK_OBJ64)"/bin/d3d11.dll "$(DST_DIR)"/lib64/wine/dxvk
@@ -1549,7 +1639,7 @@ dxvk64: $(DXVK_CONFIGURE_FILES64)
 
 
 dxvk32: $(DXVK_CONFIGURE_FILES32)
-	env PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" ninja -C "$(DXVK_OBJ32)" install
+	env PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" ninja -C "$(DXVK_OBJ32)" -v install
 	mkdir -p "$(DST_DIR)"/lib/wine/dxvk
 	cp "$(DXVK_OBJ32)"/bin/dxgi.dll "$(DST_DIR)"/lib/wine/dxvk/
 	cp "$(DXVK_OBJ32)"/bin/d3d11.dll "$(DST_DIR)"/lib/wine/dxvk/
@@ -1568,24 +1658,24 @@ VULKAN_H_CONFIGURE_FILES32 := $(VULKAN_H_OBJ32)/Makefile
 VULKAN_H_CONFIGURE_FILES64 := $(VULKAN_H_OBJ64)/Makefile
 
 $(VULKAN_H_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
-$(VULKAN_H_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(CMAKE_BIN32) $(VULKAN_HEADERS)/CMakeLists.txt | $(VULKAN_H_OBJ32)
+$(VULKAN_H_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(VULKAN_H_DEPS32) $(VULKAN_HEADERS)/CMakeLists.txt | $(VULKAN_H_OBJ32)
 	cd $(abspath $(VULKAN_H_OBJ32)) && \
-	../$(CMAKE_BIN32) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR32)) $(abspath $(VULKAN_HEADERS))
+	$(CMAKE_BIN32) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR32)) $(abspath $(VULKAN_HEADERS))
 
 $(VULKAN_H_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
-$(VULKAN_H_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(CMAKE_BIN64) $(VULKAN_HEADERS)/CMakeLists.txt | $(VULKAN_H_OBJ64)
+$(VULKAN_H_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(VULKAN_H_DEPS64) $(VULKAN_HEADERS)/CMakeLists.txt | $(VULKAN_H_OBJ64)
 	cd $(abspath $(VULKAN_H_OBJ64)) && \
-	../$(CMAKE_BIN64) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR64)) $(abspath $(VULKAN_HEADERS))
+	$(CMAKE_BIN64) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR64)) $(abspath $(VULKAN_HEADERS))
 
 $(VULKAN_H32): SHELL = $(CONTAINER_SHELL32)
 $(VULKAN_H32): $(VULKAN_H_CONFIGURE_FILES32) | $(VULKAN_H_OBJ32)
 	cd $(abspath $(VULKAN_H_OBJ32)) && \
-	../$(CMAKE_BIN32) --build . --target install
+	$(CMAKE_BIN32) --build . --target install
 
 $(VULKAN_H64): SHELL = $(CONTAINER_SHELL64)
 $(VULKAN_H64): $(VULKAN_H_CONFIGURE_FILES64) | $(VULKAN_H_OBJ64)
 	cd $(abspath $(VULKAN_H_OBJ64)) && \
-	../$(CMAKE_BIN64) --build . --target install
+	$(CMAKE_BIN64) --build . --target install
 
 # SPIRV-Headers
 
@@ -1593,24 +1683,24 @@ SPIRV_H_CONFIGURE_FILES32 := $(SPIRV_H_OBJ32)/Makefile
 SPIRV_H_CONFIGURE_FILES64 := $(SPIRV_H_OBJ64)/Makefile
 
 $(SPIRV_H_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
-$(SPIRV_H_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(CMAKE_BIN32) $(SPIRV_HEADERS)/CMakeLists.txt | $(SPIRV_H_OBJ32)
+$(SPIRV_H_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(SPIRV_H_DEPS32) $(SPIRV_HEADERS)/CMakeLists.txt | $(SPIRV_H_OBJ32)
 	cd $(abspath $(SPIRV_H_OBJ32)) && \
-	../$(CMAKE_BIN32) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR32)) $(abspath $(SPIRV_HEADERS))
+	$(CMAKE_BIN32) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR32)) $(abspath $(SPIRV_HEADERS))
 
 $(SPIRV_H_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
-$(SPIRV_H_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(CMAKE_BIN64) $(SPIRV_HEADERS)/CMakeLists.txt | $(SPIRV_H_OBJ64)
+$(SPIRV_H_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(SPIRV_H_DEPS64) $(SPIRV_HEADERS)/CMakeLists.txt | $(SPIRV_H_OBJ64)
 	cd $(abspath $(SPIRV_H_OBJ64)) && \
-	../$(CMAKE_BIN64) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR64)) $(abspath $(SPIRV_HEADERS))
+	$(CMAKE_BIN64) -DCMAKE_INSTALL_PREFIX=$(abspath $(TOOLS_DIR64)) $(abspath $(SPIRV_HEADERS))
 
 $(SPIRV_H32): SHELL = $(CONTAINER_SHELL32)
 $(SPIRV_H32): $(SPIRV_H_CONFIGURE_FILES32)
 	cd $(abspath $(SPIRV_H_OBJ32)) && \
-	../$(CMAKE_BIN32) --build . --target install
+	$(CMAKE_BIN32) --build . --target install
 
 $(SPIRV_H64): SHELL = $(CONTAINER_SHELL64)
 $(SPIRV_H64): $(SPIRV_H_CONFIGURE_FILES64)
 	cd $(abspath $(SPIRV_H_OBJ64)) && \
-	../$(CMAKE_BIN64) --build . --target install
+	$(CMAKE_BIN64) --build . --target install
 
 # widl; required for vkd3d, which is built before wine
 
@@ -1618,16 +1708,22 @@ WINEWIDL_CONFIGURE_FILES64 := $(WINEWIDL_OBJ64)/Makefile
 WINEWIDL_CONFIGURE_FILES32 := $(WINEWIDL_OBJ32)/Makefile
 
 $(WINEWIDL_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
-$(WINEWIDL_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINEWIDL_OBJ32) bison32
+$(WINEWIDL_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINEWIDL_OBJ32) $(WINEWIDL_DEPS32)
 	cd $(dir $@) && \
 		../$(WINE)/configure \
+			--with-x \
+			--with-gstreamer \
+			--without-mingw \
 			--without-curses \
+			--without-oss \
+			--disable-winemenubuilder \
+			--disable-win16 \
 			--disable-tests \
 			STRIP=$(STRIP_QUOTED) \
-			BISON=$(abspath $(BISON_BIN32)) \
-			CFLAGS=-I$(abspath $(TOOLS_DIR64))"/include -g $(COMMON_FLAGS)" \
-			LDFLAGS=-L$(abspath $(TOOLS_DIR32))/lib \
-			PKG_CONFIG_PATH=$(abspath $(TOOLS_DIR32))/lib/pkgconfig \
+			$(WINE_BISON32) \
+			CFLAGS=-I$(abspath $(TOOLS_DIR32))"/include -g $(COMMON_FLAGS)" \
+			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)
 
@@ -1637,17 +1733,23 @@ $(WINEWIDL32): $(WINEWIDL_CONFIGURE_FILES32)
 	make tools/widl
 
 $(WINEWIDL_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
-$(WINEWIDL_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINEWIDL_OBJ64) bison64
+$(WINEWIDL_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINEWIDL_OBJ64) $(WINEWIDL_DEPS64)
 	cd $(dir $@) && \
 		../$(WINE)/configure \
+			--with-x \
+			--with-gstreamer \
+			--without-mingw \
 			--without-curses \
+			--without-oss \
+			--disable-winemenubuilder \
+			--disable-win16 \
 			--enable-win64 \
 			--disable-tests \
 			STRIP=$(STRIP_QUOTED) \
-			BISON=$(abspath $(BISON_BIN64)) \
+			$(WINE_BISON64) \
 			CFLAGS=-I$(abspath $(TOOLS_DIR64))"/include -g $(COMMON_FLAGS)" \
-			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)
 
@@ -1672,7 +1774,7 @@ $(VKD3D_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(VULKAN_H32) $(SPIRV_H32) $(VKD3D)/
 		$(abspath $(VKD3D))/configure \
 			--disable-tests \
 			--prefix=$(abspath $(TOOLS_DIR32)) \
-			CFLAGS="-I$(abspath $(TOOLS_DIR32))/include -g $(COMMON_FLAGS) -DNDEBUG" \
+			CFLAGS="-I$(abspath $(TOOLS_DIR32))/include -g $(COMMON_FLAGS) -m32 -DNDEBUG" \
 			LDFLAGS=-L$(abspath $(TOOLS_DIR32))/lib \
 			WIDL="$(abspath $(WINEWIDL32))"