summaryrefslogtreecommitdiff
path: root/src/generate-gl-glue.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/generate-gl-glue.sh')
-rwxr-xr-xsrc/generate-gl-glue.sh39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/generate-gl-glue.sh b/src/generate-gl-glue.sh
index b0c5fbb..9a58334 100755
--- a/src/generate-gl-glue.sh
+++ b/src/generate-gl-glue.sh
@@ -1,8 +1,9 @@
#!/bin/sh
-base=`pwd`/../Mesa-7.4.2/include/GL
+base=`pwd`/../Mesa-7.4.4/include/GL
files="gl.h glu.h"
+arch=i386
if [ "$1" != "" ] ; then
os=$1
@@ -12,6 +13,10 @@ if [ "$os" == "" ] ; then
os=`uname`
fi
+if [ "$2" != "" ] ; then
+ arch=$2
+fi
+
for f in $files ; do cat $base/$f ; done |
grep ^GLAPI.*ENTRY |
sed 's/GLAPI\ .*\ .*ENTRY\ \([^\ ]*\)\ *(.*/\1/' |
@@ -20,15 +25,43 @@ for f in $files ; do cat $base/$f ; done |
grep -v EXT\$ |
sort -u > tmp-symbol-list.txt
+if [ "$arch" == "ppc" ] || [ "$arch" == "ppc64" ] ; 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 [ "$os" == "Darwin" ] ; then
+if [ "$arch" == "ppc" ] || [ "$arch" == "ppc64" ] ; then
+ echo ".p2align 4,,15"
+fi
+
cat tmp-symbol-list.txt | while read symbol ; do
+ if [ "$arch" != "i386" ] ; then
+ echo ".globl _$symbol"
+ fi
echo ".globl _m$symbol"
echo "_m$symbol:"
- echo "jmp L_$symbol\$stub"
+ case "$arch" in
+ x86_64)
+ echo "jmp _$symbol"
+ ;;
+ i386)
+ echo "jmp L_$symbol\$stub"
+ ;;
+ *)
+ echo "b _$symbol"
+ esac
done
+if [ "$arch" == "i386" ] ; then
+
echo ".section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5"
cat tmp-symbol-list.txt | while read symbol ; do
@@ -39,6 +72,8 @@ done
echo ".subsections_via_symbols"
+fi
+
elif [ "$os" == "Linux" ] ; then
cat tmp-symbol-list.txt | while read symbol ; do