3 # Builds a shared library, incorporating the random portability work that we
4 # have to do. Gets the basic information from Autoconf and knows how to find
5 # the appropriate system-specific map or version file and set library SONAMEs.
7 # This is not libtool. If it appears to be in danger of evolving into
8 # libtool, please shoot it and start over, possibly by rewriting AFS in Ada.
10 # We take the following regular arguments: -d <srcdir>, -f <filename>, -l
11 # <library>, -M <major>, and -m <minor>. If -f is given, it overrides -l and
12 # specifies the complete filename of the shared library to build. We then
13 # expect a -- option indicating the end of our arguments and the rest of the
14 # arguments are passed along verbatim to the linker.
18 linker="@SHLIB_LINKER@"
19 suffix="@SHLIB_SUFFIX@"
20 sysname="@AFS_SYSNAME@"
27 while [ -z "$done" ] && [ $# -gt 0 ] ; do
59 echo 'Usage: shlib-build -l <lib> -M <major> -m <minor> -- ...' >&2
64 if [ -z "$library" ] ; then
65 echo 'Usage: shlib-install -l <lib> -M <major> -m <minor>' >&2
69 # Print out what we're doing while we do it for debugging.
71 if [ -z "$filename" ] ; then
72 if [ -z "$major" ] ; then
73 filename="$library.$suffix"
76 filename="$library.$suffix.$major.$minor"
77 soname="$library.$suffix.$major"
82 if [ -f "$srcdir/$library.exp" ] ; then
83 export="-bE:$srcdir/$library.exp"
85 echo "$linker $export -o $filename $*"
86 $linker $export -o "$filename" "$@"
89 if [ -f "$srcdir/$library.map" ] ; then
90 export="-Wl,-M$srcdir/$library.map"
92 if [ -z "$soname" ] ; then
93 echo "$linker $export -o $filename $*"
94 $linker $export -o "$filename" "$@"
96 echo "$linker $export -h $soname -o $filename $*"
97 $linker $export -h "$soname" -o "$filename" "$@"
101 if [ -f "$srcdir/$library.map" ] ; then
102 export="-Wl,--version-script=$srcdir/$library.map"
104 if [ -z "$soname" ] ; then
105 echo "$linker $export -o $filename $*"
106 $linker $export -o "$filename" "$@"
108 echo "$linker $export -Wl,-h,$soname -o $filename $*"
109 $linker $export -Wl,-h,"$soname" -o "$filename" "$@"
113 if [ -f "$srcdir/$library.hp" ] ; then
114 export="-c $srcdir/$library.hp"
116 echo "$linker $export -o $filename $*"
117 $linker $export -o "$filename" "$@"
120 echo "$linker -o $filename $*"
121 $linker -o "$filename" "$@"