Improve glgen
+ gen script is really a bash script rather than a sh script,
so declare that to be true. (For example, it uses pushd,
which is a part of bash, but not a part of sh. Not sure
how this worked until now. Possibly gen was only run in
environments where /bin/sh was really bash.
+ Check the results of the java compile of the code generator,
and abort the script if the compile fails.
+ Turn on the bash shell option that guards against using
uninitialized variables in the script.
+ Remove the generated class files.
Refactor JniCodeEmitter into two classes: a general-purpose
JniCodeEmitter and a specific Jsr239CodeEmitter. The hope is
to use JniCodeEmitter as a base for emitting static OpenGL ES
bindings.
diff --git a/opengl/tools/glgen/src/GenerateGL.java b/opengl/tools/glgen/src/GenerateGL.java
index afe1bb6..accb16e 100644
--- a/opengl/tools/glgen/src/GenerateGL.java
+++ b/opengl/tools/glgen/src/GenerateGL.java
@@ -23,7 +23,6 @@
PrintStream glImplStream,
PrintStream cStream) throws Exception {
String s = null;
- int counter = 0;
while ((s = specReader.readLine()) != null) {
if (s.trim().startsWith("//")) {
continue;
@@ -120,7 +119,7 @@
ParameterChecker checker = new ParameterChecker(checksReader);
CodeEmitter emitter =
- new JniCodeEmitter(classPathName,
+ new Jsr239CodeEmitter(classPathName,
checker,
gl10Stream, gl10ExtStream,
gl11Stream, gl11ExtStream, gl11ExtPackStream,