#!/bin/sh

# **************************** LICENSE START ***********************************
#
# Copyright 2012 ECMWF and INPE. This software is distributed under the terms
# of the Apache License version 2.0. In applying this license, ECMWF does not
# waive the privileges and immunities granted to it by virtue of its status as
# an Intergovernmental Organization or submit itself to any jurisdiction.
#
# ***************************** LICENSE END ************************************

#
# a simple script to search library files in the current directory
# for a given function/external/etc name.
#
#  first parameter is the name of a missing external to look for
#
#  second parameter - if given - should be an accepted 'grep' flag,
#  e.g. -w if you want to search for words only (see 'man grep')
#
#                                              vk Oct1997/Sep2003

if [ X$1 = X ]
then
   echo
   echo " usage: `basename $0` missing_external [grep_flag]"
   echo
   exit
fi

for filnam in `ls *.a *.so`
do
  echo " "
  echo "_____________________________________________________________ $filnam"
  nm $filnam | grep $2 $1
done
