In /usr/bin/mergelib line 43:
if [ ! -f $fromlib ]; then
          ^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
if [ ! -f "$fromlib" ]; then


In /usr/bin/mergelib line 48:
if [ ! -f $tolib ]; then
          ^----^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
if [ ! -f "$tolib" ]; then


In /usr/bin/mergelib line 63:
trap "rm -rf $tmpdir; exit 1" 1 2 15
             ^-----^ SC2064: Use single quotes, otherwise this expands now rather than when signalled.


In /usr/bin/mergelib line 64:
trap "rm -rf $tmpdir; exit 0" 1 2 13
             ^-----^ SC2064: Use single quotes, otherwise this expands now rather than when signalled.
                                  ^-- SC2172: Trapping signals by number is not well defined. Prefer signal names.


In /usr/bin/mergelib line 69:
if [ $? -gt 0 -o ! -d $tmpdir ]; then
     ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
              ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.


In /usr/bin/mergelib line 90:
ar x ${upfrom}$fromlib
              ^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
ar x ${upfrom}"$fromlib"


In /usr/bin/mergelib line 92:
    mv $i ${objprefix}$i
       ^-- SC2086: Double quote to prevent globbing and word splitting.
          ^----------^ SC2086: Double quote to prevent globbing and word splitting.
                      ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
    mv "$i" "${objprefix}""$i"


In /usr/bin/mergelib line 99:
ar clq ${upto}$tolib *.o
              ^----^ SC2086: Double quote to prevent globbing and word splitting.
                     ^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.

Did you mean: 
ar clq ${upto}"$tolib" *.o


In /usr/bin/mergelib line 100:
ranlib ${upto}$tolib
              ^----^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
ranlib ${upto}"$tolib"


In /usr/bin/mergelib line 101:
cd $origdir
^---------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

Did you mean: 
cd $origdir || exit

For more information:
  https://www.shellcheck.net/wiki/SC2064 -- Use single quotes, otherwise this...
  https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |...
  https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] || [ q ] as [ p -o q...