aboutsummaryrefslogtreecommitdiff
path: root/projects/crossgcc/crossgcc-helper
diff options
context:
space:
mode:
Diffstat (limited to 'projects/crossgcc/crossgcc-helper')
-rwxr-xr-xprojects/crossgcc/crossgcc-helper23
1 files changed, 19 insertions, 4 deletions
diff --git a/projects/crossgcc/crossgcc-helper b/projects/crossgcc/crossgcc-helper
index 5c4072d2..94e445bf 100755
--- a/projects/crossgcc/crossgcc-helper
+++ b/projects/crossgcc/crossgcc-helper
@@ -15,10 +15,25 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+crossgcc_same_major_version_test() {
+ local buildgcc_path="$sources_path/util/crossgcc/buildgcc"
+ local sources_path="$(project_sources_path "$project" "$repository" "$@")"
+
+ local crossgcc_version="$(sed -rne 's/^GCC_VERSION=(.*)$/\1/p' "$buildgcc_path")"
+ local host_gcc_version="$(gcc -dumpversion)"
+
+ if [[ "${host_gcc_version%%.*}" -eq "${crossgcc_version%%.*}" ]]; then
+
+ return 0
+ else
+ return 1
+ fi
+}
+
crossgcc_tarballs() {
- local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local sources_path=$(project_sources_path "$project" "$repository" "$@")
local install_path="$sources_path/util/crossgcc/tarballs/"
- local tarballs=$( ls "$sources_path/util/crossgcc/sum" | sed "s/.cksum$//" )
+ local tarballs=$(ls "$sources_path/util/crossgcc/sum" | sed "s/.cksum$//")
printf '%s\n' "$tarballs"
}
@@ -35,7 +50,7 @@ crossgcc_tarball_install_path() {
local tarball=$1
shift
- local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local sources_path=$(project_sources_path "$project" "$repository" "$@")
local install_path="$sources_path/util/crossgcc/tarballs/"
local tarball_install_path="$install_path/$tarball"
@@ -46,7 +61,7 @@ crossgcc_tarball_release_path() {
local tarball=$1
shift
- local release_path=$( project_release_path "$project" "$SOURCES" "$@" )
+ local release_path=$(project_release_path "$project" "$SOURCES" "$@")
local tarball_release_path="$release_path/$tarball"
printf '%s\n' "$tarball_release_path"