diff options
author | Pixel <pixel@nobis-crew.org> | 2008-12-21 06:58:32 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2008-12-21 06:58:32 -0800 |
commit | 343f717c1d03b99cc25e27402cefddf6860525f6 (patch) | |
tree | d64763ec98513f26facf90a7351de0961e43c666 /src | |
parent | 15256486b01e45dc851d1dae5c7048f9d6f600fc (diff) |
Adding the glue system for OpenGL - this time, it should work properly.
Diffstat (limited to 'src')
-rwxr-xr-x | src/generate-gl-glue.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/generate-gl-glue.sh b/src/generate-gl-glue.sh new file mode 100755 index 0000000..b5ba951 --- /dev/null +++ b/src/generate-gl-glue.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +base="/Users/pixel/sources/Mesa-7.2/include/GL" + +files="gl.h glu.h" + +os=`uname` + +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" + +else + +cat tmp-symbol-list.txt | while read symbol ; do + echo ".globl m$symbol" + echo ".type m$symbol, @function" + echo "jmp $symbol" + echo ".size m$symbol, .-m$symbol" +done + +fi + +rm tmp-symbol-list.txt |