head	1.1;
access;
symbols
	experimental-1:1.1.0.4
	autoconf:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	99.05.14.14.04.15;	author brianp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@initial check-in
@
text
@#!/bin/sh

# Make a BSD/OS 4.x shared library
# contributed by David MacKenzie <djm@@uu.net>

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


# $Log$


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

# Usage:  mklib libname major minor file.o ...
#
# First argument is name of output library (LIBRARY)
# Second arg is major version number (MAJOR)
# Third arg is minor version number (MINOR)
# Rest of arguments are object files (OBJECTS)

LIBRARY=$1
shift 1

MAJOR=$1
shift 1

MINOR=$1
shift 1

OBJECTS=$*

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

VERSION=$MAJOR.$MINOR

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

rm -f ${SHLIB} ${STLIB}

ar cq ${STLIB} ${OBJECTS}
ranlib ${STLIB}
gcc -shared -Wl,-h,${SHLIB} -o ${SHLIB} ${OBJECTS}

mv ${SHLIB} ../lib@
