mirror of
https://github.com/amd/blis.git
synced 2026-07-17 09:07:31 +00:00
Added --force-version=STRING option to configure.
Details: - Added an option to configure that allows the user to force an arbitrary version string at configure-time. The help text also now describes the usage information. - Changed the way the version string is communicated to the Makefile. Previously, it was read into the VERSION variable from the 'version' file via $(shell cat ...). Now, the VERSION variable is instead set in config.mk (via a configure-substituted anchor from config.mk.in).
This commit is contained in:
4
Makefile
4
Makefile
@@ -85,9 +85,6 @@ TESTSUITE_CONF_GEN := input.general
|
||||
TESTSUITE_CONF_OPS := input.operations
|
||||
TESTSUITE_OUT_FILE := output.testsuite
|
||||
|
||||
# The name of the file where the version string is stored.
|
||||
VERSION_FILE := version
|
||||
|
||||
# The name of the "special" directories, which contain source code that
|
||||
# use non-standard compiler flags.
|
||||
NOOPT_DIR := noopt
|
||||
@@ -141,7 +138,6 @@ BASE_LIB_PATH := ./$(LIB_DIR)/$(CONFIG_NAME)
|
||||
|
||||
# Construct the architecture-version string, which will be used to name the
|
||||
# library upon installation.
|
||||
VERSION := $(shell cat $(DIST_PATH)/$(VERSION_FILE))
|
||||
VERS_CONF := $(VERSION)-$(CONFIG_NAME)
|
||||
|
||||
# --- Library names ---
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
ifndef CONFIG_MK_INCLUDED
|
||||
CONFIG_MK_INCLUDED := yes
|
||||
|
||||
# The version string. This could be the official string or a custom
|
||||
# string forced at configure-time.
|
||||
VERSION := @version@
|
||||
|
||||
# The name of the configuration sub-directory.
|
||||
CONFIG_NAME := @config_name@
|
||||
|
||||
|
||||
36
configure
vendored
36
configure
vendored
@@ -123,6 +123,12 @@ print_usage()
|
||||
echo " compatibility layer. This automatically enables the"
|
||||
echo " BLAS compatibility layer as well."
|
||||
echo " "
|
||||
echo " --force-version=STRING"
|
||||
echo " "
|
||||
echo " Force configure to use an arbitrary version string"
|
||||
echo " STRING. This option may be useful when repackaging"
|
||||
echo " custom versions of BLIS by outside organizations."
|
||||
echo " "
|
||||
echo " -h, --help Output this information and quit."
|
||||
echo " "
|
||||
echo " Environment Variables:"
|
||||
@@ -232,6 +238,7 @@ main()
|
||||
blas2blis_int_type_size=32
|
||||
enable_blas2blis='yes'
|
||||
enable_cblas='no'
|
||||
force_version='no'
|
||||
|
||||
# The path to the auto-detection script.
|
||||
auto_detect_sh="${build_dirpath}/auto-detect/auto-detect.sh"
|
||||
@@ -247,14 +254,6 @@ main()
|
||||
dummy_file='_blis_dir_detect.tmp'
|
||||
|
||||
|
||||
# Check whether we need to update the version file.
|
||||
${update_version_file_sh} -o "${script_name}" "${version_filepath}"
|
||||
|
||||
|
||||
# Query which version of BLIS this is.
|
||||
version=$(cat ${version_filepath})
|
||||
|
||||
|
||||
# Process our command line options.
|
||||
while getopts ":hp:d:t:qi:b:-:" opt; do
|
||||
case $opt in
|
||||
@@ -323,6 +322,9 @@ main()
|
||||
disable-cblas)
|
||||
enable_cblas='no'
|
||||
;;
|
||||
force-version=*)
|
||||
force_version=${OPTARG#*=}
|
||||
;;
|
||||
*)
|
||||
print_usage
|
||||
;;
|
||||
@@ -375,10 +377,27 @@ main()
|
||||
done
|
||||
|
||||
|
||||
# Check whether we need to update the version file.
|
||||
${update_version_file_sh} -o "${script_name}" "${version_filepath}"
|
||||
|
||||
|
||||
# Query which version of BLIS this is.
|
||||
version=$(cat ${version_filepath})
|
||||
|
||||
|
||||
# Initial message.
|
||||
echo "${script_name}: starting configuration of BLIS ${version}."
|
||||
|
||||
|
||||
# Check if the user requested a custom version string.
|
||||
if [ "x${force_version}" = "xno" ]; then
|
||||
echo "${script_name}: configuring with official version string."
|
||||
else
|
||||
echo "${script_name}: configuring with custom version string '${force_version}'."
|
||||
version="${force_version}"
|
||||
fi
|
||||
|
||||
|
||||
# Set config_name based on the number of arguments leftover (after command
|
||||
# line option processing).
|
||||
if [ $# = "0" ]; then
|
||||
@@ -574,6 +593,7 @@ main()
|
||||
# to config_mk_out.
|
||||
echo "${script_name}: creating ${config_mk_out_path} from ${config_mk_in_path}"
|
||||
cat "${config_mk_in_path}" \
|
||||
| sed "s/@version@/${version}/g" \
|
||||
| sed "s/@config_name@/${config_name}/g" \
|
||||
| sed "s/@dist_path@/${dist_path_esc}/g" \
|
||||
| sed "s/@CC@/${cc_esc}/g" \
|
||||
|
||||
Reference in New Issue
Block a user