#!/bin/sh # Make a OpenBSD shared library # contributed by thomas graichen (graichen@OpenBSD.org) # First argument is name of output library # Rest of arguments are object files set -x LIBRARY=`basename $1 .so` shift 1 OBJECTS=$* VERSION="2.2" echo "Building PIC library $LIBRARY" rm -f ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} ar cq ${LIBRARY}_pic.a ${OBJECTS} ranlib ${LIBRARY}_pic.a ld -x -Bshareable -Bforcearchive -o ${LIBRARY}.so.${VERSION} ${LIBRARY}_pic.a cp ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} ../lib ln -s ../lib/${LIBRARY}.so.${VERSION} ../lib/${LIBRARY}.so