Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh27
1 files changed, 22 insertions, 5 deletions
diff --git a/version.sh b/version.sh
index 09a8eb291..ff902b152 100755
--- a/version.sh
+++ b/version.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# (C) 2012-2013 see Authors.txt
+# (C) 2012-2013, 2015 see Authors.txt
#
# This file is part of MPC-HC.
#
@@ -23,11 +23,11 @@ manifestfile="./src/mpc-hc/res/mpc-hc.exe.manifest"
# Read major, minor and patch version numbers from static version.h file
while read -r _ var value; do
if [[ $var == MPC_VERSION_MAJOR ]]; then
- ver_fixed_major=$value
+ ver_fixed_major=$(echo $value|tr -d '\r')
elif [[ $var == MPC_VERSION_MINOR ]]; then
- ver_fixed_minor=$value
+ ver_fixed_minor=$(echo $value|tr -d '\r')
elif [[ $var == MPC_VERSION_PATCH ]]; then
- ver_fixed_patch=$value
+ ver_fixed_patch=$(echo $value|tr -d '\r')
fi
done < "$versionfile_fixed"
ver_fixed="${ver_fixed_major}.${ver_fixed_minor}.${ver_fixed_patch}"
@@ -80,9 +80,26 @@ else
fi
fi
+gcc_exe=('gcc' 'x86_64-w64-mingw32-gcc')
+gcc_version_str=()
+
+for gcc in "${gcc_exe[@]}"; do
+ gcc_machine=$($gcc -dumpmachine)
+ if [ "$gcc_machine" != "" ];then
+ if [[ $gcc_machine == *"w64-mingw32" ]]; then
+ mingw_name="MinGW-w64"
+ elif [[ $gcc_machine == *"-mingw32" ]]; then
+ mingw_name="MinGW"
+ fi
+ gcc_version_str+=("$mingw_name GCC $($gcc -dumpversion)")
+ fi
+done
+
version_info+="#define MPCHC_HASH _T(\"$hash\")"$'\n'
version_info+="#define MPC_VERSION_REV $ver"$'\n'
-version_info+="#define MPC_VERSION_ADDITIONAL _T(\"${ver_additional}\")"
+version_info+="#define MPC_VERSION_ADDITIONAL _T(\"${ver_additional}\")"$'\n'
+version_info+="#define GCC32_VERSION _T(\"${gcc_version_str[0]}\")"$'\n'
+version_info+="#define GCC64_VERSION _T(\"${gcc_version_str[1]}\")"
# Update version_rev.h if it does not exist, or if version information was changed.