configure.sh: Add --enable-bear for autotools builds.

With --enable-bear all autotools projects will be built via bear so
compile_commands.json are generated.
This commit is contained in:
Arkadiusz Hiler 2023-09-04 16:12:40 +03:00
parent d78cb3c0da
commit 90cc4f1075
4 changed files with 20 additions and 6 deletions

View File

@ -62,6 +62,12 @@ ifneq ($(SUPPRESS_WARNINGS),)
COMMON_FLAGS += -w COMMON_FLAGS += -w
endif endif
ifeq ($(ENABLE_BEAR),1)
BEAR := bear --append --
else
BEAR :=
endif
$(DST_DIR): $(DST_DIR):
mkdir -p $@ mkdir -p $@
@ -1127,10 +1133,10 @@ redist: all
.PHONY: module32 module64 module .PHONY: module32 module64 module
module32: | all-source wine-configure32 module32: | all-source wine-configure32
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ32)/dlls/$(module) +$(BEAR) $(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ32)/dlls/$(module)
module64: | all-source wine-configure64 module64: | all-source wine-configure64
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ64)/dlls/$(module) +$(BEAR) $(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ64)/dlls/$(module)
module: | all-source wine-configure module: | all-source wine-configure
module: module32 module64 module: module32 module64

View File

@ -170,6 +170,9 @@ function configure() {
if [[ -n "$arg_enable_ccache" ]]; then if [[ -n "$arg_enable_ccache" ]]; then
echo "ENABLE_CCACHE := 1" echo "ENABLE_CCACHE := 1"
fi fi
if [[ -n "$arg_enable_bear" ]]; then
echo "ENABLE_BEAR := 1"
fi
# Include base # Include base
echo "" echo ""
@ -190,6 +193,7 @@ arg_container_engine=""
arg_docker_opts="" arg_docker_opts=""
arg_relabel_volumes="" arg_relabel_volumes=""
arg_enable_ccache="" arg_enable_ccache=""
arg_enable_bear=""
arg_help="" arg_help=""
invalid_args="" invalid_args=""
function parse_args() { function parse_args() {
@ -236,6 +240,8 @@ function parse_args() {
arg_relabel_volumes="1" arg_relabel_volumes="1"
elif [[ $arg = --enable-ccache ]]; then elif [[ $arg = --enable-ccache ]]; then
arg_enable_ccache="1" arg_enable_ccache="1"
elif [[ $arg = --enable-bear ]]; then
arg_enable_bear="1"
elif [[ $arg = --proton-sdk-image ]]; then elif [[ $arg = --proton-sdk-image ]]; then
val_used=1 val_used=1
arg_protonsdk_image="$val" arg_protonsdk_image="$val"
@ -291,6 +297,8 @@ usage() {
"$1" "" "$1" ""
"$1" " --enable-ccache Mount \$CCACHE_DIR or \$HOME/.ccache inside of the container and use ccache for the build." "$1" " --enable-ccache Mount \$CCACHE_DIR or \$HOME/.ccache inside of the container and use ccache for the build."
"$1" "" "$1" ""
"$1" " --enable-bear Invokes make via bear creating compile_commands.json."
"$1" ""
"$1" " Steam Runtime" "$1" " Steam Runtime"
"$1" " Proton builds that are to be installed & run under the steam client must be built with" "$1" " Proton builds that are to be installed & run under the steam client must be built with"
"$1" " the Steam Runtime SDK to ensure compatibility. See README.md for more information." "$1" " the Steam Runtime SDK to ensure compatibility. See README.md for more information."

View File

@ -31,8 +31,8 @@ $$(OBJ)/.$(1)-configure$(3): $$(OBJ)/.$(1)-pre-configure
$$(OBJ)/.$(1)-build$(3): $$(OBJ)/.$(1)-build$(3):
@echo ":: building $(3)bit $(1)..." >&2 @echo ":: building $(3)bit $(1)..." >&2
cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ +cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
$$(MAKE) $$(BEAR) $$(MAKE)
cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
$$(MAKE) install $$(MAKE) install
touch $$@ touch $$@

View File

@ -24,8 +24,8 @@ $$(OBJ)/.$(1)-configure$(3):
$$(OBJ)/.$(1)-build$(3): $$(OBJ)/.$(1)-build$(3):
@echo ":: building $(3)bit $(1)..." >&2 @echo ":: building $(3)bit $(1)..." >&2
cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ +cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
$$(MAKE) $$(BEAR) $$(MAKE)
cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
$$(MAKE) install $$(MAKE) install
touch $$@ touch $$@