+out_base = None
+if ext.endswith(".glext"):
+ fn = ext
+ ext = None
+ ver = None
+ secondary = []
+ for line in open(fn):
+ parts = line.split()
+ if parts[0]=="extension":
+ ext = parts[1]
+ elif parts[0]=="core_version":
+ ver = parts[1]
+ elif parts[0]=="secondary":
+ secondary.append(parts[1])
+ if len(sys.argv)>=3:
+ out_base = os.path.splitext(sys.argv[2])[0]
+else:
+ secondary = sys.argv[2:]
+ ver = None
+ if secondary and secondary[0][0].isdigit():
+ ver = secondary.pop(0)
+