#!/bin/sh

# Make a library file for BeOS on x86

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

# $Id: mklib.beos-x86,v 3.0 1998/07/30 23:50:11 brianp Exp $

# $Log: mklib.beos-x86,v $
# Revision 3.0  1998/07/30 23:50:11  brianp
# initial rev
#

#--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-------------------------------------------------------------

# build system library pathnames
SYSLIBNAMES="libroot.so.LIB libbe.so.LIB glue-noinit.a init_term_dyn.o start_dyn.o lib3DfxGlide2X.so.LIB"

for i in `echo $BELIBRARIES | sed "s/;/ /g"`
do
	for j in $SYSLIBNAMES
	do
		if [ -e $i/$j ] ; then SYSLIBS="$SYSLIBS $i/$j" ; fi
	done
done

# remove previous library before linking to avoid duplicate symbols
rm ../lib/$LIBRARY 2>/dev/null

# Other libraries which we may be dependent on.  Since we make the libraries
# in the order libMesaGL.a, libMesaGLU.a, libMesatk.a, libMesaaux.a each
# just depends on its predecessor.
# (code picked up from mklib.aix)
OTHERLIBS=`ls ../lib/*.so.LIB 2>/dev/null`

mwccx86 -sharedlibrary -pragma 'export on'  $SYSLIBS $OTHERLIBS -o $LIBRARY $OBJECTS
