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

53 lines
2.2 KiB
Bash
Raw Normal View History

2013-07-13 17:19:22 +01:00
#! /bin/bash
2014-02-02 04:04:03 +00:00
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
2019-02-11 10:50:52 +00:00
# Copyright (C) 2007-2019 Universidade do Porto - Faculdade de Engenharia #
2014-02-02 04:04:03 +00:00
# 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 #
###########################################################################
2013-07-13 17:19:22 +01:00
# 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"
2013-07-13 17:19:22 +01:00
tar \
-v \
-j \
-c \
--transform="s,^\./,$toolchain_prefix/," \
2013-07-13 17:19:22 +01:00
-C "$cfg_dir_toolchain" \
-f "$cfg_toolchain_tar" \
.