]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | #! /bin/sh |
2 | ||
3 | #LIBRARY_BASE=`echo $1 | sed 's/.a/.so/'` | |
4 | COMPILER=$1 | |
5 | LIBRARY_BASE=$2 | |
6 | LIBRARY_MAJOR=$3 | |
7 | LIBRARY_MINOR=$4 | |
8 | shift 3 | |
9 | LIBRARY_OBJS= | |
10 | while (test $# -ne 1) do | |
11 | shift; | |
12 | LIBRARY_OBJS="$LIBRARY_OBJS $1sh"; | |
13 | done | |
14 | ||
15 | LIBRARY_NAME=`basename $LIBRARY_BASE` | |
16 | LIBRARY_FILE=$LIBRARY_BASE.$LIBRARY_MAJOR.$LIBRARY_MINOR | |
17 | ||
18 | echo "Creating shared library: $LIBRARY_FILE" | |
19 | ||
20 | if test "x$COMPILER" = xgcc ; then | |
21 | gcc -shared -o $LIBRARY_FILE $LIBRARY_OBJS | |
22 | else | |
23 | CC -Bshareable -Bforcearchive -o $LIBRARY_FILE $LIBRARY_OBJS | |
24 | fi | |
25 | chmod a+x $LIBRARY_FILE | |
26 | rm -f $LIBRARY_BASE.$LIBRARY_MAJOR | |
27 | ln -s $LIBRARY_NAME.$LIBRARY_MAJOR.$LIBRARY_MINOR $LIBRARY_BASE.$LIBRARY_MAJOR | |
28 | rm -f $LIBRARY_BASE | |
29 | ln -s $LIBRARY_NAME.$LIBRARY_MAJOR $LIBRARY_BASE | |
30 | ||
31 | ||
32 | ||
33 |