diff --git a/Makefile b/Makefile index d74eba889..6a1bab97f 100644 --- a/Makefile +++ b/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 --- diff --git a/build/config.mk.in b/build/config.mk.in index e7a3f3235..ef2ccfc70 100644 --- a/build/config.mk.in +++ b/build/config.mk.in @@ -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@ diff --git a/configure b/configure index 7aabc5b78..9edfaa98b 100755 --- a/configure +++ b/configure @@ -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" \