diff options
Diffstat (limited to 'unix/ldAix')
-rwxr-xr-x | unix/ldAix | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -10,7 +10,7 @@ # symbols exported by those files, and then invokes "ldCmd" to # perform the real link. # -# RCS: @(#) $Id: ldAix,v 1.2 1998/09/14 18:40:16 stanton Exp $ +# RCS: @(#) $Id: ldAix,v 1.3 1999/03/10 05:52:52 stanton Exp $ # Extract from the arguments the names of all of the object files. @@ -23,6 +23,9 @@ for i do fi done +# Extract the name of the object file that we're linking. +outputFile=`echo $args | sed -e 's/.*-o \([^ ]*\).*/\1/'` + # Create the export file from all of the object files, using nm followed # by sed editing. Here are some tricky aspects of this: # @@ -49,13 +52,12 @@ if test $osver -eq 3; then nmopts="-e" fi rm -f lib.exp -echo "#! " >lib.exp +echo "#! $outputFile" >lib.exp /usr/ccs/bin/nm $nmopts -h $ofiles | sed -e '/:$/d' -e '/ U /d' -e '/[ ]0|extern/d' -e '/unamex/d' -e 's/^\.//' -e 's/[ |].*//' | sort | uniq >>lib.exp -# Extract the name of the object file that we're linking. If it's a .a -# file, then link all the objects together into a single file "shr.o" -# and then put that into the archive. Otherwise link the object files -# directly into the .a file. +# If we're linking a .a file, then link all the objects together into a +# single file "shr.o" and then put that into the archive. Otherwise link +# the object files directly into the .a file. outputFile=`echo $args | sed -e 's/.*-o \([^ ]*\).*/\1/'` noDotA=`echo $outputFile | sed -e '/\.a$/d'` |