build: Add --build-name to configure.sh step

This commit is contained in:
John Schoenick 2018-08-28 15:22:44 -07:00
parent 0b192a548a
commit 30ea538cef
2 changed files with 23 additions and 8 deletions

View File

@ -27,6 +27,7 @@ else # (Rest of the file is the else)
# We expect the configure script to conditionally set the following:
# SRCDIR - Path to source
# BUILD_NAME - Name of the build for manifests etc.
# NO_DXVK - 1 if skipping DXVK steps
# OSX - 1 if OS X build
# STEAMRT64_MODE - 'docker' or '' for automatic Steam Runtime container
@ -49,10 +50,6 @@ endif
export CC
export CXX
# Local name of this build, for dist/install steps
# TODO Let configure.sh set/propagate this
BUILD_NAME ?= proton-localbuild
# Selected container mode shell
DOCKER_SHELL_BASE = sudo docker run --rm --init -v $(HOME):$(HOME) -w $(CURDIR) \
-v /etc/passwd:/etc/passwd:ro -u $(shell id -u):$(shell id -g) -h $(shell hostname) \

View File

@ -3,6 +3,7 @@
set -eu
SRCDIR="$(dirname "$0")"
DEFAULT_BUILD_NAME="proton-localbuild" # If no --build-name specified
# Output helpers
COLOR_ERR=""
@ -77,6 +78,16 @@ function configure() {
local srcdir="$(dirname "$0")"
# Build name
local build_name="$arg_build_name"
if [[ -n $build_name ]]; then
info "Configuring with build name: $build_name"
else
build_name="$DEFAULT_BUILD_NAME"
info "No build name specified, using default: $build_name"
fi
## Write out config
# Don't die after this point or we'll have rather unhelpfully deleted the Makefile
[[ ! -e "$MAKEFILE" ]] || rm "$MAKEFILE"
@ -84,6 +95,7 @@ function configure() {
echo >> "$MAKEFILE" "# Generated by: $THIS_COMMAND"
echo >> "$MAKEFILE" ""
echo >> "$MAKEFILE" "SRCDIR := $(escape_for_make "$srcdir")"
echo >> "$MAKEFILE" "BUILD_NAME := $(escape_for_make "$build_name")"
# DXVK?
if [[ -n $OSX && ! -n $arg_force_dxvk ]]; then
@ -117,6 +129,7 @@ arg_steamrt32=""
arg_steamrt64=""
arg_no_steamrt=""
arg_force_dxvk=""
arg_build_name=""
invalid_args=""
function parse_args() {
local arg;
@ -147,7 +160,10 @@ function parse_args() {
fi
# The args
if [[ $arg = --osx-force-dxvk ]]; then
if [[ $arg = --build-name ]]; then
arg_build_name="$val"
val_used=1
elif [[ $arg = --osx-force-dxvk ]]; then
arg_force_dxvk=1
elif [[ $arg = --steam-runtime32 ]]; then
val_used=1
@ -196,6 +212,8 @@ usage() {
"$1" " out-of-tree build directories (e.g. mkdir mybuild && cd mybuild && ../configure.sh)"
"$1" ""
"$1" " Options"
"$1" " --build-name=<name> Set the name of the build that displays when used in Steam"
"$1" ""
"$1" " --osx-force-dxvk Attempt to build DXVK on OS X - not currently functioning,"
"$1" " development use"
"$1" ""