#! /bin/sh # Copyright (C) 2006 Ralf Wildenhues # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. usage () { echo "\ libtool-nm [OPTIONS-FOR-NM] LIBTOOL-OBJECT|LIBTOOL-LIBRARY... libtool-nm [--help|--version] Use NM on libtool (or non-libtool) object files or libraries." exit $? } version () { echo "libtool-nm 0.1" exit $? } : ${LIBTOOL=libtool} eval `$LIBTOOL --config | grep '^NM='` eval `$LIBTOOL --config | grep '^objdir='` list= for arg do file=$arg case $arg in --help) usage ;; --version) version ;; -*) ;; *.la) dir=`dirname "$file"` test "$dir" = . && arg=./$file library_names= old_library= installed=no . "$arg" 2>/dev/null set x $library_names $old_library if test -z "$2"; then echo "could not parse libtool library $arg" >&2 exit 1 fi if test "$installed" = yes; then file=$dir/$2 else file=$dir/$objdir/$2 fi ;; *.lo) dir=`dirname "$file"` test "$dir" = . && arg=./$file pic_object= non_pic_object= . "$arg" 2>/dev/null if test "$pic_object" != none; then file=$dir/$pic_object elif test "$non_pic_object" != none; then file=$dir/$non_pic_object else echo "could not parse libtool object $arg" >&2 exit 1 fi ;; esac list="$list $file" done exec $NM $list exit 1