#!/bin/sh base=`pwd`/../Mesa-7.4.2/include/GL files="gl.h glu.h" if [ "$1" != "" ] ; then os=$1 fi if [ "$os" == "" ] ; then os=`uname` 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 > tmp-symbol-list.txt echo ".text" if [ "$os" == "Darwin" ] ; then cat tmp-symbol-list.txt | while read symbol ; do echo ".globl _m$symbol" echo "_m$symbol:" echo "jmp L_$symbol\$stub" done echo ".section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5" cat tmp-symbol-list.txt | while read symbol ; do echo "L_$symbol\$stub:" echo ".indirect_symbol _$symbol" echo "hlt; hlt; hlt; hlt; hlt;" done echo ".subsections_via_symbols" elif [ "$os" == "Linux" ] ; then cat tmp-symbol-list.txt | 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 [ "$os" == "mingw32" ] ; then cat tmp-symbol-list.txt | 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 tmp-symbol-list.txt | while read symbol ; do echo ".def _$symbol; .scl 2; .type 32; .endef;" done fi rm tmp-symbol-list.txt