diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-01-18 03:32:30 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-01-18 03:32:30 +0000 |
commit | f20b6c3ff9201916f2b969c042e8eb16ec57f988 (patch) | |
tree | 5b52d5d6b36ddb68b78d72e6dc861a8d3e0ca0f3 /scripts | |
parent | 64dc82eab0b2963698042f250eca44fcb3bba4f0 (diff) | |
download | upstream-f20b6c3ff9201916f2b969c042e8eb16ec57f988.tar.gz upstream-f20b6c3ff9201916f2b969c042e8eb16ec57f988.tar.bz2 upstream-f20b6c3ff9201916f2b969c042e8eb16ec57f988.zip |
ext-toolchain.sh: - use GCC's own idea of the target name (-dumpmachine) - display help if called without args - add copyright foo - remove some leftover flag handling code
SVN-Revision: 29769
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ext-toolchain.sh | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index de5d676bd5..7283bf9cc0 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -1,6 +1,23 @@ #!/usr/bin/env bash -# Script to copy a toolchain from given source to given -# destination directory. +# +# Script for various external toolchain tasks, refer to +# the --help output for more information. +# +# Copyright (C) 2012 Jo-Philipp Wich <jow@openwrt.org> +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA CC="" CXX="" @@ -289,21 +306,6 @@ probe_libc() { while [ -n "$1" ]; do arg="$1"; shift case "$arg" in - -l|--libs) - [ -n "$1" ] || { - echo "No library given, specify one of:"$(echo "$LIB_SPECS" | sed -ne 's#:.*$##p') >&1 - exit 1 - } - FINDLIB="$1"; shift - ;; - -b|--bins) - [ -n "$1" ] || { - echo "No binary given, specify one of:"$(echo "$BIN_SPECS" | sed -ne 's#:.*$##p') >&1 - exit 1 - } - FINDBIN="$1"; shift - ;; - --toolchain) [ -d "$1" ] || { echo "Toolchain directory '$1' does not exist." >&2 @@ -328,9 +330,7 @@ while [ -n "$1" ]; do --print-target) if probe_cc; then - CC="${CC##*/}" - echo "${CC%-*}" - exit 0 + exec "$CC" $CFLAGS -dumpmachine fi echo "No C compiler found in '$TOOLCHAIN'." >&2 exit 1 @@ -407,4 +407,4 @@ while [ -n "$1" ]; do esac done -exit 0 +exec $0 --help |