657cae1
# Probe system for multilib information.
657cae1
# Copyright (C) 2016 Red Hat, Inc.
657cae1
# Written by Pavel Raiskup <praiskup@redhat.com>
657cae1
#
657cae1
# This program is free software; you can redistribute it and/or modify
657cae1
# it under the terms of the GNU General Public License as published by
657cae1
# the Free Software Foundation; either version 2 of the License, or
657cae1
# (at your option) any later version.
657cae1
#
657cae1
# This program is distributed in the hope that it will be useful,
657cae1
# but WITHOUT ANY WARRANTY; without even the implied warranty of
657cae1
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
657cae1
# GNU General Public License for more details.
657cae1
#
657cae1
# You should have received a copy of the GNU General Public License along
657cae1
# with this program; if not, write to the Free Software Foundation, Inc.,
657cae1
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
657cae1
657cae1
@LIB@
657cae1
657cae1
opt_multilib_capable=false
657cae1
657cae1
print_help ()
657cae1
{
657cae1
    _h_exit=false
657cae1
    test -n "$1" && _h_exit=:
657cae1
657cae1
    cat <
657cae1
Usage: $progname [OPTIONS]
657cae1
657cae1
Probe system for interesting multilib information.
657cae1
657cae1
--multilib-capable   could package built on this box play some role on multilib
657cae1
                capable system?  Prints 'true' or 'false'.
657cae1
--arch          override arch detection (mostly for testing purposes)
657cae1
EOF
657cae1
    $_h_exit && exit "$1"
657cae1
}
657cae1
657cae1
while test $# -gt 0
657cae1
do
657cae1
    _opt=$1 ; shift
657cae1
    case $_opt in
657cae1
        --arch)
657cae1
            _raw_opt=$(echo "$_opt" | sed -e 's/^--//' -e 's/-/_/g')
657cae1
            eval "opt_$_raw_opt=\$1"
657cae1
            shift || die "$_opt requires argument"
657cae1
            ;;
657cae1
        --multilib-capable)
657cae1
            _raw_opt=$(echo "$_opt" | sed -e 's/^--//' -e 's/-/_/g')
657cae1
            eval "opt_$_raw_opt=:"
657cae1
            ;;
657cae1
        --help)
657cae1
            print_help 0
657cae1
            ;;
657cae1
        *)
657cae1
            error "unexpected '$_opt' program argument"
657cae1
            ;;
657cae1
    esac
657cae1
done
657cae1
$error_occurred && print_help 1
657cae1
fix_arch opt_arch
657cae1
657cae1
$opt_multilib_capable && {
657cae1
    if is_multilib "$opt_arch"; then
657cae1
        echo true
657cae1
    else
657cae1
        echo false
657cae1
    fi
657cae1
    exit 0
657cae1
}
657cae1
657cae1
print_help 1