Changeset 29769


Ignore:
Timestamp:
2012-01-18T04:32:30+01:00 (6 years ago)
Author:
jow
Message:

[scripts] 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/ext-toolchain.sh

    r29765 r29769  
    11#!/usr/bin/env bash 
    2 # Script to copy a toolchain from given source to given 
    3 # destination directory. 
     2# 
     3#   Script for various external toolchain tasks, refer to 
     4#   the --help output for more information. 
     5# 
     6#   Copyright (C) 2012 Jo-Philipp Wich <jow@openwrt.org> 
     7# 
     8#   This program is free software; you can redistribute it and/or modify 
     9#   it under the terms of the GNU General Public License as published by 
     10#   the Free Software Foundation; either version 2 of the License, or 
     11#   (at your option) any later version. 
     12# 
     13#   This program is distributed in the hope that it will be useful, 
     14#   but WITHOUT ANY WARRANTY; without even the implied warranty of 
     15#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     16#   GNU General Public License for more details. 
     17# 
     18#   You should have received a copy of the GNU General Public License 
     19#   along with this program; if not, write to the Free Software 
     20#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    421 
    522CC="" 
     
    290307        arg="$1"; shift 
    291308        case "$arg" in 
    292                 -l|--libs) 
    293                         [ -n "$1" ] || { 
    294                                 echo "No library given, specify one of:"$(echo "$LIB_SPECS" | sed -ne 's#:.*$##p') >&1 
    295                                 exit 1 
    296                         } 
    297                         FINDLIB="$1"; shift 
    298                 ;; 
    299                 -b|--bins) 
    300                         [ -n "$1" ] || { 
    301                                 echo "No binary given, specify one of:"$(echo "$BIN_SPECS" | sed -ne 's#:.*$##p') >&1 
    302                                 exit 1 
    303                         } 
    304                         FINDBIN="$1"; shift 
    305                 ;; 
    306  
    307309                --toolchain) 
    308310                        [ -d "$1" ] || { 
     
    329331                --print-target) 
    330332                        if probe_cc; then 
    331                                 CC="${CC##*/}" 
    332                                 echo "${CC%-*}" 
    333                                 exit 0 
     333                                exec "$CC" $CFLAGS -dumpmachine 
    334334                        fi 
    335335                        echo "No C compiler found in '$TOOLCHAIN'." >&2 
     
    408408done 
    409409 
    410 exit 0 
     410exec $0 --help 
Note: See TracChangeset for help on using the changeset viewer.