VirtualBox

Changeset 20962 in vbox for trunk/src/bldprogs


Ignore:
Timestamp:
Jun 26, 2009 9:23:18 AM (15 years ago)
Author:
vboxsync
Message:

checkUndefined.sh: for solaris too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bldprogs/checkUndefined.sh

    r20934 r20962  
    2828}
    2929
    30 target=$1
    31 symbols=$2
    32 static=$3
     30hostos=$1
     31target=$2
     32symbols=$3
     33static=$4
    3334
    34 if [ $# -lt 2 -o $# -gt 3 -o ! -r $target -o ! -r $symbols ]
    35 then
    36   if [ ! -r $target ]
    37   then
    38     echoerr "$0: $target not readable"
    39   elif [ ! -r $symbols ]
    40   then
    41     echoerr "$0: $symbols not readable"
     35if test $# -lt 3 || test $# -gt 4 || test ! -r "$target" || test ! -r "$symbols"; then
     36  if test ! -r "$target"; then
     37    echoerr "$0: '$target' not readable"
     38  elif test ! -r "$symbols"; then
     39    echoerr "$0: '$symbols' not readable"
    4240  else
    4341    echoerr "$0: Wrong number of arguments"
     
    4644fi
    4745
    48 if [ $# -eq 3 -a ! "$static" = "--static" ]
    49 then
     46if test $# -eq 4 && test "$static" != "--static"; then
    5047  args_ok="no"
    5148fi
    5249
    53 if [ "$args_ok" = "no" ]
    54 then
     50if test "$args_ok" = "no"; then
    5551  echoerr "Usage: $0 <object> <allowed undefined symbols> [--static]"
    5652  exit 1
    5753fi
    5854
     55if test "$hostos" = "solaris"; then
     56    objdumpbin=/usr/sfw/bin/gobjdump
     57    grepbin=/usr/sfw/bin/ggrep
     58elif test "$hostos" = "linux"; then
     59    objdumpbin=`which objdump`
     60    grepbin=`which grep`
     61else
     62    echoerr "$0: '$hostos' not a valid hostos string. supported 'linux' 'solaris'"
     63    exit 1
     64fi
     65
    5966command="-T"
    60 if [ "$static" = "--static" ]
    61 then
     67if test "$static" = "--static"; then
    6268  command="-t"
    6369fi
    6470
    65 undefined=`objdump $command $target | grep '*UND*' | grep -v -f $symbols | sed -e 's/^.*[       ]\(.*\)/\1/'`
     71if test ! -x "$objdumpbin"; then
     72    echoerr "$0: '$objdumpbin' not found or not executable."
     73    exit 1
     74fi
     75
     76undefined=`$objdumpbin $command $target | $grepbin '*UND*' | $grepbin -v -f $symbols | sed -e 's/^.*[   ]\(.*\)/\1/'`
    6677num_undef=`echo $undefined | wc -w`
    6778
    68 if [ $num_undef -ne 0 ]
    69 then
     79if test $num_undef -ne 0; then
    7080  echoerr "$0: following symbols not defined in $symbols:"
    7181  echoerr "$undefined"
     82  exit 1
    7283fi
    7384# Return code
    74 [ $num_undef -eq 0 ]
     85exit 0
     86
     87
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette