Import c99types.h and related probes from cdecl99.
[dxcommon.git] / snippet / exported.sh.in
blobf5ef7b09b63b85737d9a4aeb1180684a2c36a218
1 #!@SHELL@
3 # Copyright © 2011-2012, 2022 Nick Bowler
5 # Determine the list of exported symbols from archives or (libtool) object
6 # files.
8 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
9 # This is free software: you are free to do what the fuck you want to.
10 # There is NO WARRANTY, to the extent permitted by law.
12 OBJS=
14 for arg
16 case $arg in
17 *.lo)
18 case $arg in /*) :;; *) arg=./$arg ;; esac
20 non_pic_object=
21 pic_object=
22 . "$arg"
24 dir=`expr "$arg" : '\(.*\)/'`
25 if test x"$pic_object" != x"none"; then
26 OBJS="$OBJS $dir/$pic_object"
28 if test x"$non_pic_object" != x"none"; then
29 OBJS="$OBJS $dir/$non_pic_object"
33 OBJS="$OBJS $arg"
35 esac
36 done
38 set x $OBJS; shift
39 case $# in
40 0) : ;;
42 exec 4>&1
43 eval_cmd=`exec 3>&1
44 { { @NM@ $OBJS; } 3>&-
45 echo "(exit $?) || exit $?" >&3
46 } | { { @GLOBAL_SYMBOL_PIPE@; } 3>&-
47 echo "(exit $?) || exit $?" >&3
48 } | { { @SED@ 's/^.* //'; } 3>&-
49 echo "(exit $?) || exit $?" >&3
50 } | { { LC_ALL=C sort -u; } 3>&-
51 echo "(exit $?) || exit $?" >&3
52 } >&4`
53 exec 4>&-
54 eval "$eval_cmd"
56 esac