From 31fe51430af0d365d79bfe7b63748e3d25c602f0 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 27 Sep 2019 14:28:02 -0500 Subject: [PATCH] build: Add UNSTRIPPED_BUILD option to avoid stripping binaries --- Makefile | 20 +++++++++++++------- build/makefile_base.mak | 25 +++++++++++++++++-------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index cbe31b5f..c8ea3074 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,11 @@ ifneq ($(module),) endif endif +ifneq ($(unstripped),) + UNSTRIPPED := UNSTRIPPED_BUILD=1 + DEPLOY_DIR := $(DEPLOY_DIR)_unstripped +endif + CONFIGURE_CMD := ../proton/configure.sh \ --steam-runtime64=docker:steam-proton-dev --steam-runtime32=docker:steam-proton-dev32 \ --steam-runtime="$$HOME"/steam-runtime/runtime/ \ @@ -57,6 +62,7 @@ help: @echo " will be created for each build_name, so if you override this," @echo " remember to always set it!" @echo " Current build name: $(_build_name)" + @echo " unstripped - Set to non-empty to avoid stripping installed library files." @echo "" @echo "Development targets:" @echo " vagrant - Start Vagrant VM" @@ -95,23 +101,23 @@ configure: vagrant @vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads' proton: configure - vagrant ssh -c 'make -C $(BUILD_DIR)/ dist' + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) dist' echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build." install: configure - vagrant ssh -c 'make -C $(BUILD_DIR)/ STEAM_DIR=/vagrant/ install' + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) STEAM_DIR=/vagrant/ install' mkdir -p $(STEAM_DIR)/compatibilitytools.d/ cp -R vagrant_share/compatibilitytools.d/$(_build_name) $(STEAM_DIR)/compatibilitytools.d/ echo "Proton installed to your local Steam installation" deploy: configure mkdir -p vagrant_share/$(DEPLOY_DIR) - vagrant ssh -c 'make -C $(BUILD_DIR)/ deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)' + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)' echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)" module: configure mkdir -p vagrant_share/$(module)/lib/wine/ vagrant_share/$(module)/lib64/wine/ - vagrant ssh -c 'make -C $(BUILD_DIR)/ module=$(module) module && \ + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) module=$(module) module && \ cp $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib/wine/ && \ cp $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib64/wine/' rm -f vagrant_share/$(module)/lib*/wine/*.fake @@ -119,20 +125,20 @@ module: configure dxvk: configure mkdir -p vagrant_share/dxvk/lib/wine/dxvk/ mkdir -p vagrant_share/dxvk/lib64/wine/dxvk/ - vagrant ssh -c 'make -C $(BUILD_DIR)/ dxvk && \ + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) dxvk && \ cp $(BUILD_DIR)/dist/dist/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \ cp $(BUILD_DIR)/dist/dist/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/' lsteamclient: configure mkdir -p vagrant_share/lsteamclient/lib/wine mkdir -p vagrant_share/lsteamclient/lib64/wine - vagrant ssh -c 'make -C $(BUILD_DIR)/ lsteamclient && \ + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) lsteamclient && \ cp $(BUILD_DIR)/dist/dist/lib/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib/wine && \ cp $(BUILD_DIR)/dist/dist/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/wine' vrclient: configure mkdir -p vagrant_share/vrclient/lib/wine mkdir -p vagrant_share/vrclient/lib64/wine - vagrant ssh -c 'make -C $(BUILD_DIR)/ vrclient && \ + vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) vrclient && \ cp $(BUILD_DIR)/dist/dist/lib/wine/vrclient.dll.so /vagrant/vrclient/lib/wine && \ cp $(BUILD_DIR)/dist/dist/lib64/wine/vrclient_x64.dll.so /vagrant/vrclient/lib64/wine' diff --git a/build/makefile_base.mak b/build/makefile_base.mak index 9df1efc3..47d25fbf 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -130,9 +130,6 @@ DST_BASE := ./dist DST_DIR := $(DST_BASE)/dist DEPLOY_DIR := ./deploy -# TODO Release/debug configuration -INSTALL_PROGRAM_FLAGS := - # All top level goals. Lazy evaluated so they can be added below. GOAL_TARGETS = $(GOAL_TARGETS_LIBS) # Excluding goals like wine and dist that are either long running or slow per invocation @@ -144,7 +141,15 @@ ALL_TARGETS = ## Platform-specific variables ## -STRIP := strip +ifneq ($(UNSTRIPPED_BUILD),) + STRIP := + INSTALL_PROGRAM_FLAGS := + MESON_STRIP_ARG := +else + STRIP := strip + INSTALL_PROGRAM_FLAGS := -s + MESON_STRIP_ARG := --strip +endif WINE32_AUTOCONF := WINE64_AUTOCONF := @@ -852,6 +857,8 @@ wine64-intermediate: $(WINE_CONFIGURE_FILES64) +$(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 + if [ "$(UNSTRIPPED_BUILD)" != "" ]; then make -C $(WINE_OBJ64) $(WINE64_MAKE_ARGS) install-cross-debug; cp -a $(TOOLS_DIR64)/lib64/wine/.debug $(DST_DIR)/lib64/wine/; fi rm -f $(DST_DIR)/bin/{msiexec,notepad,regedit,regsvr32,wineboot,winecfg,wineconsole,winedbg,winefile,winemine,winepath} rm -rf $(DST_DIR)/share/man/ @@ -868,6 +875,8 @@ wine32-intermediate: $(WINE_CONFIGURE_FILES32) cp -a $(WINE_DST32)/lib $(DST_DIR)/ cp -a $(WINE_DST32)/bin/wine $(DST_DIR)/bin/ cp -a $(WINE_DST32)/bin/wine-preloader $(DST_DIR)/bin/ + if [ "$(UNSTRIPPED_BUILD)" == "" ]; then rm -rf $(DST_DIR)/lib/wine/.debug; fi + if [ "$(UNSTRIPPED_BUILD)" != "" ]; then make -C $(WINE_OBJ32) $(WINE32_MAKE_ARGS) install-cross-debug; cp -a $(TOOLS_DIR32)/lib/wine/.debug $(DST_DIR)/lib/wine/; fi ## ## vrclient @@ -1112,7 +1121,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" --strip --buildtype=release "$(abspath $(DXVK_OBJ64))" + meson --prefix="$(abspath $(DXVK_OBJ64))" --cross-file "$(abspath $(DXVK))/build-win64.txt" $(MESON_STRIP_ARG) --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) @@ -1121,7 +1130,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" --strip --buildtype=release "$(abspath $(DXVK_OBJ32))" + meson --prefix="$(abspath $(DXVK_OBJ32))" --cross-file "$(abspath $(DXVK))/build-win32.txt" $(MESON_STRIP_ARG) --buildtype=release "$(abspath $(DXVK_OBJ32))" ## dxvk goals DXVK_TARGETS = dxvk dxvk_configure dxvk32 dxvk64 dxvk_configure32 dxvk_configure64 @@ -1170,7 +1179,7 @@ $(D9VK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(D9VK)/build-win64.txt | $(D9VK_OBJ6 fi cd "$(abspath $(D9VK))" && \ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \ - meson --prefix="$(abspath $(D9VK_OBJ64))" --cross-file "$(abspath $(D9VK))/build-win64.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ64))" + meson --prefix="$(abspath $(D9VK_OBJ64))" --cross-file "$(abspath $(D9VK))/build-win64.txt" $(MESON_STRIP_ARG) --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ64))" # 32-bit configure. Remove coredata file if already configured (due to e.g. makefile changing) $(D9VK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(D9VK)/build-win32.txt | $(D9VK_OBJ32) @@ -1179,7 +1188,7 @@ $(D9VK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(D9VK)/build-win32.txt | $(D9VK_OBJ3 fi cd "$(abspath $(D9VK))" && \ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \ - meson --prefix="$(abspath $(D9VK_OBJ32))" --cross-file "$(abspath $(D9VK))/build-win32.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ32))" + meson --prefix="$(abspath $(D9VK_OBJ32))" --cross-file "$(abspath $(D9VK))/build-win32.txt" $(MESON_STRIP_ARG) --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ32))" ## d9vk goals D9VK_TARGETS = d9vk d9vk_configure d9vk32 d9vk64 d9vk_configure32 d9vk_configure64