# This requires the DLL tools to be installed, and gcc >= 2.5.8.
# Shared image and stubs are placed in sharedlib/ directory. Do make install
# to install them.

export VERSION='1.2.4'
export PATH=/usr/dll/bin:$PATH

make installheaders
echo If there might be static library object files lying around, stop this.
export JUMP_DIR=`pwd`/jump/
export JUMP_LIB=libvga
export DLLFLAGS=-B/usr/dll/jump/	# used by makefiles
cd src
make libvga.a || exit
cd ../gl
make libvgagl.a || exit
cd ..
mv -f src/libvga.a .	# Stupid mkstubs syntax makes this necessary
mv -f gl/libvgagl.a .
mkstubs -a 0x63b00000 -l libvga -v $VERSION -j 0x00001000 -g 4096 \
	-- libvga
mkstubs -a 0x63b00000 -l libvga -v $VERSION -j 0x00001000 -g 4096 \
	-- libvgagl
mkimage -a 0x63b00000 -l libvga -v $VERSION -j 0x00001000 -g 4096 \
	-- libvga.a libvgagl.a `gcc --print-libgcc-file-name` -lc
rm -f libvga.a
rm -f libvgagl.a
strip libvga.so.$VERSION
mv -f libvga.so.$VERSION sharedlib/libvga.so.$VERSION
mv -f libvga.sa sharedlib/libvga.sa
mv -f libvgagl.sa sharedlib/libvgagl.sa

echo Shared library files are now in sharedlib/. Be sure to do a make clean
echo everywhere before building static libraries.
