This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
lsts_glued/pktoolchain.bash
2017-01-16 10:30:25 +00:00

53 lines
2.2 KiB
Bash
Executable File

#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or (at #
# your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA #
# 02110-1301 USA. #
###########################################################################
# Author: Ricardo Martins #
###########################################################################
# Check shell type.
if [ -z "$BASH_VERSION" ]; then
echo "ERROR: you must use bash to run this script."
exit 1
fi
if [ $# -ne 1 ]; then
echo "Usage: $0 <config>"
exit 1
fi
if ! [ -f "$1" ]; then
echo "ERROR: configuration file '$1' does not exist."
exit 1
fi
source "$1"
toolchain_prefix="glued-$cfg_glued_version-$cfg_sys_family-toolchain-$cfg_host_canonical-$cfg_target_canonical"
tar \
-v \
-j \
-c \
--transform="s,^\./,$toolchain_prefix/," \
-C "$cfg_dir_toolchain" \
-f "$cfg_toolchain_tar" \
.