head	1.4;
access;
symbols
	ansi-20040405-merged:1.3.4.1
	postmerge-20040405-ansi:1.3
	premerge-20040404-ansi:1.3
	postmerge-autoconf:1.3
	autoconf-freeze:1.1.6.4
	premerge-autoconf:1.3
	postmerge-20040315-windows:1.3
	premerge-20040315-windows:1.3
	windows-20040315-freeze:1.3.2.1
	autoconf-20031203:1.1.6.1
	autoconf-20031202:1.1
	autoconf-branch:1.1.0.6
	phong-branch:1.1.0.4
	photonmap-branch:1.1.0.2
	windows-branch:1.3.0.2
	ansi-branch:1.3.0.4;
locks; strict;
comment	@# @;


1.4
date	2004.05.21.18.05.08;	author morrison;	state dead;
branches;
next	1.3;

1.3
date	2004.03.04.19.47.22;	author morrison;	state Exp;
branches
	1.3.2.1
	1.3.4.1;
next	1.2;

1.2
date	2003.11.07.14.54.47;	author morrison;	state Exp;
branches;
next	1.1;

1.1
date	2003.03.13.19.18.44;	author jra;	state Exp;
branches
	1.1.6.1;
next	;

1.1.6.1
date	2003.12.03.16.24.53;	author erikg;	state Exp;
branches;
next	1.1.6.2;

1.1.6.2
date	2004.02.12.18.55.46;	author erikg;	state Exp;
branches;
next	1.1.6.3;

1.1.6.3
date	2004.03.15.12.06.45;	author erikg;	state Exp;
branches;
next	1.1.6.4;

1.1.6.4
date	2004.03.15.14.01.33;	author erikg;	state Exp;
branches;
next	;

1.3.2.1
date	2004.03.12.09.59.29;	author morrison;	state Exp;
branches;
next	;

1.3.4.1
date	2004.03.17.21.20.12;	author morrison;	state Exp;
branches;
next	;


desc
@@


1.4
log
@moved from top-level to src/other/.
@
text
@#!/bin/sh
#
# ldAix ldCmd ldArg ldArg ...
#
# This shell script provides a wrapper for ld under AIX in order to
# create the .exp file required for linking.  Its arguments consist
# of the name and arguments that would normally be provided to the
# ld command.  This script extracts the names of the object files
# from the argument list, creates a .exp file describing all of the
# symbols exported by those files, and then invokes "ldCmd" to
# perform the real link.
#
# RCS: @@(#) $Id: ldAix,v 1.3 2004/03/04 19:47:22 morrison Exp $

# Extract from the arguments the names of all of the object files.

args=$*
ofiles=""
for i do
    x=`echo $i | grep '[^.].o$'`
    if test "$x" != ""; then
	ofiles="$ofiles $i"
    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:
#
# 1. Nm produces different output under AIX 4.1 than under AIX 3.2.5;
#    the following statements handle both versions.
# 2. Use the -g switch to nm instead of -e under 4.1 (this shows just
#    externals, not statics;  -g isn't available under 3.2.5, though).
# 3. Use the -X32_64 switch to nm on AIX-4+ to handle 32 or 64bit compiles.
# 4. Eliminate lines that end in ":": these are the names of object
#    files (relevant in 4.1 only).
# 5. Eliminate entries with the "U" key letter;  these are undefined
#    symbols (relevant in 4.1 only).
# 6. Eliminate lines that contain the string "0|extern" preceded by space;
#    in 3.2.5, these are undefined symbols (address 0).
# 7. Eliminate lines containing the "unamex" symbol.  In 3.2.5, these
#    are also undefined symbols.
# 8. If a line starts with ".", delete the leading ".", since this will
#    just cause confusion later.
# 9. Eliminate everything after the first field in a line, so that we're
#    left with just the symbol name.

nmopts="-g -C"
osver=`uname -v`
if test $osver -eq 3; then
  nmopts="-e"
fi
if test $osver -gt 3; then
  nmopts="$nmopts -X32_64"
fi
rm -f 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

# 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'`
echo "noDotA=\"$noDotA\""
if test "$noDotA" = "" ; then
    linkArgs=`echo $args | sed -e 's/-o .*\.a /-o shr.o /'`
    echo $linkArgs
    eval $linkArgs
    echo ar cr $outputFile shr.o
    ar cr $outputFile shr.o
    rm -f shr.o
else
    eval $args
fi
@


1.3
log
@Updated to tcl 8.4.6
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: ldAix,v 1.4 2002/09/27 01:28:26 hobbs Exp $
@


1.3.4.1
log
@sync branch with HEAD
@
text
@d13 1
a13 1
# RCS: @@(#) $Id$
@


1.3.2.1
log
@merge from HEAD
@
text
@d13 1
a13 1
# RCS: @@(#) $Id$
@


1.2
log
@updated tcl to 8.4.4
@
text
@@


1.1
log
@*** empty log message ***
@
text
@@


1.1.6.1
log
@updates from HEAD, part 1
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: ldAix,v 1.2 2003/11/07 14:54:47 morrison Exp $
@


1.1.6.2
log
@merge from HEAD
@
text
@@


1.1.6.3
log
@merge from head
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: ldAix,v 1.3 2004/03/04 19:47:22 morrison Exp $
@


1.1.6.4
log
@merge from head...
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: ldAix,v 1.1.6.3 2004/03/15 12:06:45 erikg Exp $
@


