#!/bin/sh base=`pwd`/../Mesa-7.4.4/include/GL symlist=tmp-symbol-list-$$.txt files="gl.h glu.h" arch=i386 if [ "x$1" != "x" ] ; then os=$1 fi if [ "x$os" = "x" ] ; then os=`uname` fi if [ "x$2" != "x" ] ; then arch=$2 fi for f in $files ; do cat $base/$f ; done | grep ^GLAPI.*ENTRY | sed 's/GLAPI\ .*\ .*ENTRY\ \([^\ ]*\)\ *(.*/\1/' | grep -v MESA\$ | grep -v ATI\$ | grep -v EXT\$ | sort -u > $symlist if [ "x$arch" = "xppc" ] || [ "x$arch" = "xppc64" ] ; then echo ".section __TEXT,__text,regular,pure_instructions" echo ".section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32" if [ "$arch" = "ppc" ] ; then echo ".machine ppc7400" else echo ".machine ppc64" fi fi echo ".text" if [ "x$os" = "xDarwin" ] ; then if [ "x$arch" = "xppc" ] || [ "x$arch" = "xppc64" ] ; then echo ".p2align 4,,15" fi cat $symlist | while read symbol ; do if [ "x$arch" != "xi386" ] ; then echo ".globl _$symbol" fi echo ".globl _m$symbol" echo "_m$symbol:" case "$arch" in i386 | x86_64) echo "jmp _$symbol" ;; *) echo "b _$symbol" esac done elif [ "x$os" = "xLinux" ] ; then cat $symlist | while read symbol ; do echo ".globl m$symbol" echo ".type m$symbol, @function" echo "m$symbol:" echo "jmp $symbol" echo ".size m$symbol, .-m$symbol" done elif [ "x$os" = "xmingw32" ] ; then cat $symlist | while read symbol ; do echo ".globl _m$symbol" echo ".def _m$symbol; .scl 2; .type 32; .endef;" echo "_m$symbol:" echo "jmp _$symbol" done cat $symlist | while read symbol ; do echo ".def _$symbol; .scl 2; .type 32; .endef;" done fi rm $symlist