glsl2: Conditionally allow optional extensions to be enabled

The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 2e17c4c..fc3f9e9 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -27,6 +27,7 @@
 
 extern "C" {
 #include <talloc.h>
+#include "main/mtypes.h"
 }
 
 #include "ast.h"
@@ -135,6 +136,11 @@
    } else if (strcmp(name, "GL_ARB_texture_rectangle") == 0) {
       state->ARB_texture_rectangle_enable = (ext_mode != extension_disable);
       state->ARB_texture_rectangle_warn = (ext_mode == extension_warn);
+   } else if (strcmp(name, "GL_EXT_texture_array") == 0) {
+      state->EXT_texture_array_enable = (ext_mode != extension_disable);
+      state->EXT_texture_array_warn = (ext_mode == extension_warn);
+
+      unsupported = !state->extensions->EXT_texture_array;
    } else {
       unsupported = true;
    }