Skip to content

Commit

Permalink
build: Allow ./configure --version=X.Y.Z
Browse files Browse the repository at this point in the history
  • Loading branch information
tavianator committed Aug 28, 2024
1 parent 97849b8 commit 4a278d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ gen/vars.mk::
@printf 'MKDIR := %s\n' "$$XMKDIR" >>$@
@printf 'PKG_CONFIG := %s\n' "$$XPKG_CONFIG" >>$@
@printf 'RM := %s\n' "$$XRM" >>$@
@test -z "$$VERSION" || printf 'export VERSION=%s\n' "$$VERSION" >>$@
${VCAT} $@

# Sets the build flags. This depends on vars.mk and uses a recursive make so
Expand Down
12 changes: 7 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

set -eu

# Get the relative path to the source tree based on how the script was run
DIR=$(dirname -- "$0")

# Print the help message
help() {
cat <<EOF
Expand Down Expand Up @@ -57,6 +60,8 @@ Packaging:
Set the installation prefix (default: /usr)
--mandir=/path
Set the man page directory (default: \$PREFIX/share/man)
--version=X.Y.Z
Set the version string (default: $("$DIR/build/version.sh"))
This script is a thin wrapper around a makefile-based configuration system.
Any other arguments will be passed directly to the $MAKE invocation, e.g.
Expand Down Expand Up @@ -134,7 +139,7 @@ for arg; do
printf 'warning: Treating "%s" like "%s"\n' "$old" "$arg" >&2
;;
esac
;;
;;
esac

case "$arg" in
Expand Down Expand Up @@ -165,7 +170,7 @@ for arg; do
esac
;;

--prefix=*|--mandir=*)
--prefix=*|--mandir=*|--version=*)
set -- "$@" "$NAME=$value"
;;

Expand All @@ -188,9 +193,6 @@ for arg; do
esac
done

# Get the relative path to the source tree based on how the script was run
DIR=$(dirname -- "$0")

# Set up symbolic links for out-of-tree builds
for f in Makefile build completions docs src tests; do
test -e "$f" || ln -s "$DIR/$f" "$f"
Expand Down

0 comments on commit 4a278d3

Please sign in to comment.