Brian Paul | 2d550f6 | 1999-08-19 13:52:56 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Make a Solaris shared library |
| 4 | # contributed by Arno Hahma (arno@nitro.pp.utu.fi) |
| 5 | |
| 6 | #--identification------------------------------------------------------ |
| 7 | |
Brian Paul | d9bb106 | 1999-09-15 15:10:20 +0000 | [diff] [blame] | 8 | # $Id: mklib.solaris,v 1.2 1999/09/15 15:10:20 brianp Exp $ |
Brian Paul | 2d550f6 | 1999-08-19 13:52:56 +0000 | [diff] [blame] | 9 | |
| 10 | # $Log: mklib.solaris,v $ |
Brian Paul | d9bb106 | 1999-09-15 15:10:20 +0000 | [diff] [blame] | 11 | # Revision 1.2 1999/09/15 15:10:20 brianp |
| 12 | # added third, tiny version number to arguments |
| 13 | # |
Brian Paul | 2d550f6 | 1999-08-19 13:52:56 +0000 | [diff] [blame] | 14 | # Revision 1.1 1999/08/19 13:53:06 brianp |
| 15 | # initial check-in (post-crash) |
| 16 | # |
| 17 | |
| 18 | |
| 19 | #--common-------------------------------------------------------------- |
| 20 | |
Brian Paul | 2d550f6 | 1999-08-19 13:52:56 +0000 | [diff] [blame] | 21 | LIBRARY=$1 |
| 22 | shift 1 |
| 23 | |
| 24 | MAJOR=$1 |
| 25 | shift 1 |
| 26 | |
| 27 | MINOR=$1 |
| 28 | shift 1 |
| 29 | |
Brian Paul | d9bb106 | 1999-09-15 15:10:20 +0000 | [diff] [blame] | 30 | TINY=$1 |
| 31 | shift 1 |
| 32 | |
Brian Paul | 2d550f6 | 1999-08-19 13:52:56 +0000 | [diff] [blame] | 33 | OBJECTS=$* |
| 34 | |
| 35 | #--platform------------------------------------------------------------- |
| 36 | |
| 37 | set -x |
| 38 | |
| 39 | LIBRARY=`basename $LIBRARY .a` |
| 40 | |
| 41 | VERSION=$MAJOR.$MINOR |
| 42 | |
| 43 | echo "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a" |
| 44 | rm -f ${LIBRARY}.a ${LIBRARY}.so.${VERSION} |
| 45 | ar ruv ${LIBRARY}.a ${OBJECTS} |
| 46 | |
| 47 | ld -G -o ${LIBRARY}.so.${VERSION} ${OBJECTS} |
| 48 | |
| 49 | cp ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ../lib |
| 50 | cd ../lib |
| 51 | ln -s ${LIBRARY}.so.${VERSION} ${LIBRARY}.so |
| 52 | |