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.sh38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/generate-gl-glue.sh b/src/generate-gl-glue.sh
index 9a58334..d141e99 100755
--- a/src/generate-gl-glue.sh
+++ b/src/generate-gl-glue.sh
@@ -2,18 +2,20 @@
base=`pwd`/../Mesa-7.4.4/include/GL
+symlist=tmp-symbol-list-$$.txt
+
files="gl.h glu.h"
arch=i386
-if [ "$1" != "" ] ; then
+if [ "x$1" != "x" ] ; then
os=$1
fi
-if [ "$os" == "" ] ; then
+if [ "x$os" = "x" ] ; then
os=`uname`
fi
-if [ "$2" != "" ] ; then
+if [ "x$2" != "x" ] ; then
arch=$2
fi
@@ -23,12 +25,12 @@ for f in $files ; do cat $base/$f ; done |
grep -v MESA\$ |
grep -v ATI\$ |
grep -v EXT\$ |
- sort -u > tmp-symbol-list.txt
+ sort -u > $symlist
-if [ "$arch" == "ppc" ] || [ "$arch" == "ppc64" ] ; then
+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
+ if [ "$arch" = "ppc" ] ; then
echo ".machine ppc7400"
else
echo ".machine ppc64"
@@ -37,13 +39,13 @@ fi
echo ".text"
-if [ "$os" == "Darwin" ] ; then
-if [ "$arch" == "ppc" ] || [ "$arch" == "ppc64" ] ; then
+if [ "x$os" = "xDarwin" ] ; then
+if [ "x$arch" = "xppc" ] || [ "x$arch" = "xppc64" ] ; then
echo ".p2align 4,,15"
fi
-cat tmp-symbol-list.txt | while read symbol ; do
- if [ "$arch" != "i386" ] ; then
+cat $symlist | while read symbol ; do
+ if [ "x$arch" != "xi386" ] ; then
echo ".globl _$symbol"
fi
echo ".globl _m$symbol"
@@ -60,11 +62,11 @@ cat tmp-symbol-list.txt | while read symbol ; do
esac
done
-if [ "$arch" == "i386" ] ; then
+if [ "x$arch" = "xi386" ] ; then
echo ".section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5"
-cat tmp-symbol-list.txt | while read symbol ; do
+cat $symlist | while read symbol ; do
echo "L_$symbol\$stub:"
echo ".indirect_symbol _$symbol"
echo "hlt; hlt; hlt; hlt; hlt;"
@@ -74,9 +76,9 @@ echo ".subsections_via_symbols"
fi
-elif [ "$os" == "Linux" ] ; then
+elif [ "x$os" = "xLinux" ] ; then
-cat tmp-symbol-list.txt | while read symbol ; do
+cat $symlist | while read symbol ; do
echo ".globl m$symbol"
echo ".type m$symbol, @function"
echo "m$symbol:"
@@ -84,19 +86,19 @@ cat tmp-symbol-list.txt | while read symbol ; do
echo ".size m$symbol, .-m$symbol"
done
-elif [ "$os" == "mingw32" ] ; then
+elif [ "x$os" = "xmingw32" ] ; then
-cat tmp-symbol-list.txt | while read symbol ; do
+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 tmp-symbol-list.txt | while read symbol ; do
+cat $symlist | while read symbol ; do
echo ".def _$symbol; .scl 2; .type 32; .endef;"
done
fi
-rm tmp-symbol-list.txt
+rm $symlist