aboutsummaryrefslogtreecommitdiff
path: root/projects/crossgcc/crossgcc-helper
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-10-02 02:08:48 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-10-02 02:26:05 -0400
commit86ee7170368b2234cbd993da2504c38837ef1b45 (patch)
tree0379a42ca7d6471ee0454cbf4fc2fbf7cadba963 /projects/crossgcc/crossgcc-helper
parent4996135284edab0dbd54c3c09acc849919c7a74f (diff)
downloadlibrebootfr-86ee7170368b2234cbd993da2504c38837ef1b45.tar.gz
librebootfr-86ee7170368b2234cbd993da2504c38837ef1b45.zip
Conditionally bootstrap CrossGCC build
It's possible that a compilation failure will occur if there's a difference in major versions between the host GCC compiler and the one being built. To avoid this, bootstrapping can be used. The method for bootstrapping is simply passing the '-b' flag to Make; the Makefile takes care of the rest.
Diffstat (limited to 'projects/crossgcc/crossgcc-helper')
-rwxr-xr-xprojects/crossgcc/crossgcc-helper15
1 files changed, 15 insertions, 0 deletions
diff --git a/projects/crossgcc/crossgcc-helper b/projects/crossgcc/crossgcc-helper
index 5c4072d2..3891a15c 100755
--- a/projects/crossgcc/crossgcc-helper
+++ b/projects/crossgcc/crossgcc-helper
@@ -15,6 +15,21 @@
# 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 install_path="$sources_path/util/crossgcc/tarballs/"