218665708af9ff1e9b254c52405012656e33c5a1
[mesa.git] / bin / mklib.solaris
1 #!/bin/sh
2
3 # Make a Solaris shared library
4 # contributed by Arno Hahma (arno@nitro.pp.utu.fi)
5
6 #--identification------------------------------------------------------
7
8 # $Id: mklib.solaris,v 1.1 1999/08/19 13:53:06 brianp Exp $
9
10 # $Log: mklib.solaris,v $
11 # Revision 1.1 1999/08/19 13:53:06 brianp
12 # initial check-in (post-crash)
13 #
14
15
16 #--common--------------------------------------------------------------
17
18 # Usage: mklib libname major minor file.o ...
19 #
20 # First argument is name of output library (LIBRARY)
21 # Second arg is major version number (MAJOR)
22 # Third arg is minor version number (MINOR)
23 # Rest of arguments are object files (OBJECTS)
24
25 LIBRARY=$1
26 shift 1
27
28 MAJOR=$1
29 shift 1
30
31 MINOR=$1
32 shift 1
33
34 OBJECTS=$*
35
36 #--platform-------------------------------------------------------------
37
38 set -x
39
40 LIBRARY=`basename $LIBRARY .a`
41
42 VERSION=$MAJOR.$MINOR
43
44 echo "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a"
45 rm -f ${LIBRARY}.a ${LIBRARY}.so.${VERSION}
46 ar ruv ${LIBRARY}.a ${OBJECTS}
47
48 ld -G -o ${LIBRARY}.so.${VERSION} ${OBJECTS}
49
50 cp ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ../lib
51 cd ../lib
52 ln -s ${LIBRARY}.so.${VERSION} ${LIBRARY}.so
53