#!/bin/sh

# Make a FreeBSD shared library
# contributed by Mark Diekhans <markd@grizzly.com>

#--identification------------------------------------------------------

# $Id: mklib.freebsd,v 1.1 2001/02/22 20:55:34 philippe Exp $

# $Log: mklib.freebsd,v $
# Revision 1.1  2001/02/22 20:55:34  philippe
# xrml 0.5.0 initial commit
#
# Revision 1.2  1999/09/15 15:10:20  brianp
# added third, tiny version number to arguments
#
# Revision 1.1  1999/08/19 13:52:59  brianp
# initial check-in (post-crash)
#


#--common--------------------------------------------------------------

LIBRARY=$1
shift 1

MAJOR=$1
shift 1

MINOR=$1
shift 1

TINY=$1
shift 1

OBJECTS=$*

#--platform------------------------------------------------------------

VERSION=$MAJOR.$MINOR

BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"`
SHLIB=${BASENAME}.so.${VERSION}
STLIB=${BASENAME}.a

rm -f ${SHLIB} ${STLIB}

ar cq ${STLIB} ${OBJECTS}
ranlib ${STLIB}
ld -Bshareable -o ${SHLIB} ${OBJECTS}

mv ${SHLIB} ../lib
