X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/2e5b48374d80959256e535bc1973f032158bde9e..HEAD:/snippet/exported.sh.in diff --git a/snippet/exported.sh.in b/snippet/exported.sh.in index 762600a..f5ef7b0 100644 --- a/snippet/exported.sh.in +++ b/snippet/exported.sh.in @@ -1,6 +1,6 @@ #!@SHELL@ # -# Copyright © 2011 Nick Bowler +# Copyright © 2011-2012, 2022 Nick Bowler # # Determine the list of exported symbols from archives or (libtool) object # files. @@ -11,34 +11,46 @@ OBJS= -while test $# -gt 0 +for arg do - case $1 in - /*) arg=$1 ;; - *) arg=./$1 ;; - esac + case $arg in + *.lo) + case $arg in /*) :;; *) arg=./$arg ;; esac - if expr "$arg" : '.*\.lo' >/dev/null; then - non_pic_object= - pic_object= - . "$arg" + non_pic_object= + pic_object= + . "$arg" - dir=`expr "$arg" : '\(.*\)/'` - if test x"$pic_object" != x"none"; then - OBJS="$OBJS $dir/$pic_object" - fi - if test x"$non_pic_object" != x"none"; then - OBJS="$OBJS $dir/$non_pic_object" - fi - else - OBJS="$OBJS $arg" - fi - - shift + dir=`expr "$arg" : '\(.*\)/'` + if test x"$pic_object" != x"none"; then + OBJS="$OBJS $dir/$pic_object" + fi + if test x"$non_pic_object" != x"none"; then + OBJS="$OBJS $dir/$non_pic_object" + fi + ;; + *) + OBJS="$OBJS $arg" + ;; + esac done set x $OBJS; shift case $# in 0) : ;; -*) @NM@ $OBJS | @GLOBAL_SYMBOL_PIPE@ | @SED@ 's/^.* //' | sort | uniq ;; +*) + exec 4>&1 + eval_cmd=`exec 3>&1 + { { @NM@ $OBJS; } 3>&- + echo "(exit $?) || exit $?" >&3 + } | { { @GLOBAL_SYMBOL_PIPE@; } 3>&- + echo "(exit $?) || exit $?" >&3 + } | { { @SED@ 's/^.* //'; } 3>&- + echo "(exit $?) || exit $?" >&3 + } | { { LC_ALL=C sort -u; } 3>&- + echo "(exit $?) || exit $?" >&3 + } >&4` + exec 4>&- + eval "$eval_cmd" +;; esac