Some cmake options and features macros had form USE_${feature}, others
BUILD_${category}_TESTS. This patch consistently prefixes all such options
and macros with PIGLIT.

Piglit, be a good code citizen. Namespace your variables.

This patch was created with
  find . -type f  | xargs sed -i \
    -e 
's/\(^\|[^_]\)\(USE_\(GLX\|GLUT\|WAFFLE\|OPENGL\|OPENGL_ES1\|OPENGL_ES2\)\)\($\|[^_]\)/\1PIGLIT_\2\4/g'
 \
    -e 
's/\(^\|[^_]\)\(BUILD_\(CL\|GLX\|GLES1\|GLES2\)_TESTS\)\($\|[^_]\)/\1PIGLIT_\2\4/g'
 \

Signed-off-by: Chad Versace <chad.vers...@linux.intel.com>
---
 CMakeLists.txt                                     | 36 +++++++++++-----------
 cmake/target_api/CMakeLists.txt                    | 12 ++++----
 cmake/target_api/gl/CMakeLists.txt                 | 10 +++---
 cmake/target_api/gles1/CMakeLists.txt              |  2 +-
 cmake/target_api/gles2/CMakeLists.txt              |  2 +-
 src/CMakeLists.txt                                 |  4 +--
 src/piglit/gl_wrap.h                               |  8 ++---
 src/piglit/glut_wrap.h                             |  6 ++--
 tests/CMakeLists.txt                               |  4 +--
 tests/fbo/CMakeLists.gl.txt                        |  4 +--
 tests/general/CMakeLists.gl.txt                    |  4 +--
 tests/glslparsertest/glslparsertest.c              |  8 ++---
 tests/glx/CMakeLists.gl.txt                        |  8 ++---
 .../spec/glx_arb_create_context/CMakeLists.gl.txt  |  8 ++---
 .../spec/glx_ext_import_context/CMakeLists.gl.txt  |  8 ++---
 .../oes_compressed_paletted_texture-api.c          |  4 +--
 tests/util/CMakeLists.gl.txt                       |  6 ++--
 tests/util/piglit-framework-fbo.c                  | 18 +++++------
 tests/util/piglit-framework-glut.c                 | 14 ++++-----
 tests/util/piglit-shader-gl.c                      |  4 +--
 tests/util/piglit-shader-gles1.c                   |  4 +--
 tests/util/piglit-shader-gles2.c                   |  4 +--
 tests/util/piglit-shader.c                         |  2 +-
 tests/util/piglit-shader.h                         |  4 +--
 tests/util/piglit-util-gl-enum.c                   |  8 ++---
 tests/util/piglit-util-gles.c                      |  8 ++---
 tests/util/piglit_ktx.c                            |  6 ++--
 27 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ee28d2..224aa18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,37 +17,37 @@ find_package(PNG REQUIRED)
 find_package(X11)
 
 
-option(BUILD_GLES1_TESTS "Build tests for OpenGL ES1" OFF)
-option(BUILD_GLES2_TESTS "Build tests for OpenGL ES2" OFF)
-option(BUILD_CL_TESTS "Build tests for OpenCL" OFF)
+option(PIGLIT_BUILD_GLES1_TESTS "Build tests for OpenGL ES1" OFF)
+option(PIGLIT_BUILD_GLES2_TESTS "Build tests for OpenGL ES2" OFF)
+option(PIGLIT_BUILD_CL_TESTS "Build tests for OpenCL" OFF)
 
-option(USE_WAFFLE "Use Waffle in place of GLUT" OFF)
-if(USE_WAFFLE)
+option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" OFF)
+if(PIGLIT_USE_WAFFLE)
        pkg_check_modules(WAFFLE REQUIRED waffle-1>=1.0.1)
-       add_definitions(-DUSE_WAFFLE)
+       add_definitions(-DPIGLIT_USE_WAFFLE)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WAFFLE_CFLAGS}")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WAFFLE_CFLAGS}")
-endif(USE_WAFFLE)
+endif(PIGLIT_USE_WAFFLE)
 
-if(BUILD_GLES1_TESTS AND NOT USE_WAFFLE)
-       message(FATAL_ERROR "Option BUILD_GLES1_TESTS requires USE_WAFFLE")
-endif(BUILD_GLES1_TESTS AND NOT USE_WAFFLE)
+if(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
+       message(FATAL_ERROR "Option PIGLIT_BUILD_GLES1_TESTS requires 
PIGLIT_USE_WAFFLE")
+endif(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
 
-if(BUILD_GLES2_TESTS AND NOT USE_WAFFLE)
-       message(FATAL_ERROR "Option BUILD_GLES2_TESTS requires USE_WAFFLE")
-endif(BUILD_GLES2_TESTS AND NOT USE_WAFFLE)
+if(PIGLIT_BUILD_GLES2_TESTS AND NOT PIGLIT_USE_WAFFLE)
+       message(FATAL_ERROR "Option PIGLIT_BUILD_GLES2_TESTS requires 
PIGLIT_USE_WAFFLE")
+endif(PIGLIT_BUILD_GLES2_TESTS AND NOT PIGLIT_USE_WAFFLE)
 
-if(BUILD_CL_TESTS)
+if(PIGLIT_BUILD_CL_TESTS)
        find_package(OpenCL REQUIRED)
-endif(BUILD_CL_TESTS)
+endif(PIGLIT_BUILD_CL_TESTS)
 
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
        add_definitions(-DPIGLIT_HAS_X11)
-       option(BUILD_GLX_TESTS "Build tests that require GLX" ON)
+       option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" ON)
 ELSE()
-       option(BUILD_GLX_TESTS "Build tests that require GLX" OFF)
+       option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" OFF)
 ENDIF()
-IF(BUILD_GLX_TESTS)
+IF(PIGLIT_BUILD_GLX_TESTS)
        pkg_check_modules(GLPROTO REQUIRED glproto)
 ENDIF()
 
diff --git a/cmake/target_api/CMakeLists.txt b/cmake/target_api/CMakeLists.txt
index d3e23f9..c5e0b90 100644
--- a/cmake/target_api/CMakeLists.txt
+++ b/cmake/target_api/CMakeLists.txt
@@ -25,14 +25,14 @@ add_subdirectory(no_api)
 
 add_subdirectory(gl)
 
-if(BUILD_GLES1_TESTS)
+if(PIGLIT_BUILD_GLES1_TESTS)
        add_subdirectory(gles1)
-endif(BUILD_GLES1_TESTS)
+endif(PIGLIT_BUILD_GLES1_TESTS)
 
-if(BUILD_GLES2_TESTS)
+if(PIGLIT_BUILD_GLES2_TESTS)
        add_subdirectory(gles2)
-endif(BUILD_GLES2_TESTS)
+endif(PIGLIT_BUILD_GLES2_TESTS)
 
-if(BUILD_CL_TESTS)
+if(PIGLIT_BUILD_CL_TESTS)
        add_subdirectory(cl)
-endif(BUILD_CL_TESTS)
+endif(PIGLIT_BUILD_CL_TESTS)
diff --git a/cmake/target_api/gl/CMakeLists.txt 
b/cmake/target_api/gl/CMakeLists.txt
index ae67020..b13229d 100644
--- a/cmake/target_api/gl/CMakeLists.txt
+++ b/cmake/target_api/gl/CMakeLists.txt
@@ -1,19 +1,19 @@
 set(piglit_target_api "gl")
 add_definitions(
-       -DUSE_OPENGL
+       -DPIGLIT_USE_OPENGL
        )
 
-if(USE_WAFFLE)
+if(PIGLIT_USE_WAFFLE)
        link_libraries(glut_waffle)
-else(USE_WAFFLE)
-       add_definitions(-DUSE_GLUT)
+else(PIGLIT_USE_WAFFLE)
+       add_definitions(-DPIGLIT_USE_GLUT)
        include_directories(
                ${GLUT_INCLUDE_DIR}
                )
        link_libraries(
                ${GLUT_glut_LIBRARY}
                )
-endif(USE_WAFFLE)
+endif(PIGLIT_USE_WAFFLE)
 
 add_subdirectory(${piglit_SOURCE_DIR}/tests
        ${piglit_BINARY_DIR}/target_api/${piglit_target_api}/tests
diff --git a/cmake/target_api/gles1/CMakeLists.txt 
b/cmake/target_api/gles1/CMakeLists.txt
index 02ca906..b76d51b 100644
--- a/cmake/target_api/gles1/CMakeLists.txt
+++ b/cmake/target_api/gles1/CMakeLists.txt
@@ -1,7 +1,7 @@
 set(piglit_target_api "gles1")
 
 add_definitions(
-       -DUSE_OPENGL_ES1
+       -DPIGLIT_USE_OPENGL_ES1
        )
 link_libraries(glut_waffle)
 add_subdirectory(${piglit_SOURCE_DIR}/tests
diff --git a/cmake/target_api/gles2/CMakeLists.txt 
b/cmake/target_api/gles2/CMakeLists.txt
index 4dcfd17..b8cad20 100644
--- a/cmake/target_api/gles2/CMakeLists.txt
+++ b/cmake/target_api/gles2/CMakeLists.txt
@@ -1,7 +1,7 @@
 set(piglit_target_api "gles2")
 
 add_definitions(
-       -DUSE_OPENGL_ES2
+       -DPIGLIT_USE_OPENGL_ES2
        )
 link_libraries(glut_waffle)
 add_subdirectory(${piglit_SOURCE_DIR}/tests
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f1ba7c2..2cca584 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,3 @@
-if(USE_WAFFLE)
+if(PIGLIT_USE_WAFFLE)
        add_subdirectory(glut_waffle)
-endif(USE_WAFFLE)
+endif(PIGLIT_USE_WAFFLE)
diff --git a/src/piglit/gl_wrap.h b/src/piglit/gl_wrap.h
index 3ccc365..7f646cb 100644
--- a/src/piglit/gl_wrap.h
+++ b/src/piglit/gl_wrap.h
@@ -29,7 +29,7 @@
  * \brief Convenience header that includes the actual OpenGL headers.
  *
  * The actual OpenGL headers are chosen according to the macro definitions
- * USE_OPENGL, USE_OPENGL_ES1, and USE_OPENGL_ES2.
+ * PIGLIT_USE_OPENGL, PIGLIT_USE_OPENGL_ES1, and PIGLIT_USE_OPENGL_ES2.
  */
 
 #pragma once
@@ -42,10 +42,10 @@ extern "C" {
 #include <windows.h>
 #endif
 
-#if defined(USE_OPENGL)
+#if defined(PIGLIT_USE_OPENGL)
 #      include "piglit-dispatch.h"
 
-#elif defined(USE_OPENGL_ES1)
+#elif defined(PIGLIT_USE_OPENGL_ES1)
 #      include <GLES/gl.h>
 #      include <GLES/glext.h>
 
@@ -57,7 +57,7 @@ extern "C" {
 #       define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
 #       define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
 
-#elif defined(USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES2)
 #      include <GLES2/gl2.h>
 #      include <GLES2/gl2ext.h>
 #endif
diff --git a/src/piglit/glut_wrap.h b/src/piglit/glut_wrap.h
index a1bddc3..549059d 100644
--- a/src/piglit/glut_wrap.h
+++ b/src/piglit/glut_wrap.h
@@ -29,7 +29,7 @@
  * \brief Convenience header that includes the actual GLUT headers.
  *
  * The actual GLUT headers are chosen according to the macro definitions
- * USE_GLUT and USE_WAFFLE.
+ * PIGLIT_USE_GLUT and PIGLIT_USE_WAFFLE.
  */
 
 #pragma once
@@ -42,9 +42,9 @@ extern "C" {
 #include <windows.h>
 #endif
 
-#if defined(USE_WAFFLE)
+#if defined(PIGLIT_USE_WAFFLE)
 #      include <glut_waffle/glut_waffle.h>
-#elif defined(USE_GLUT)
+#elif defined(PIGLIT_USE_GLUT)
 #      ifdef __APPLE__
 #              include <GLUT/glut.h>
 
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 64f38c5..0a81851 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -25,9 +25,9 @@ IF(OPENGL_egl_LIBRARY)
        add_subdirectory (egl)
 ENDIF(OPENGL_egl_LIBRARY)
 
-IF(BUILD_CL_TESTS)
+IF(PIGLIT_BUILD_CL_TESTS)
        add_subdirectory (cl)
-ENDIF(BUILD_CL_TESTS)
+ENDIF(PIGLIT_BUILD_CL_TESTS)
 
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
        add_subdirectory (mesa)
diff --git a/tests/fbo/CMakeLists.gl.txt b/tests/fbo/CMakeLists.gl.txt
index d3e4bc9..cf2a268 100644
--- a/tests/fbo/CMakeLists.gl.txt
+++ b/tests/fbo/CMakeLists.gl.txt
@@ -11,10 +11,10 @@ link_libraries (
        ${OPENGL_glu_LIBRARY}
 )
 
-if(NOT USE_WAFFLE)
+if(NOT PIGLIT_USE_WAFFLE)
        # This test uses glutSolidSphere.
        piglit_add_executable (fbo-depth-sample-compare 
fbo-depth-sample-compare.c)
-endif(NOT USE_WAFFLE)
+endif(NOT PIGLIT_USE_WAFFLE)
 
 piglit_add_executable (fbo-1d fbo-1d.c)
 piglit_add_executable (fbo-alphatest-formats fbo-alphatest-formats.c)
diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
index 0e351ca..11da25f 100644
--- a/tests/general/CMakeLists.gl.txt
+++ b/tests/general/CMakeLists.gl.txt
@@ -10,10 +10,10 @@ link_libraries (
        ${OPENGL_glu_LIBRARY}
 )
 
-if(NOT USE_WAFFLE)
+if(NOT PIGLIT_USE_WAFFLE)
        # This test uses glutCreateSubWindow.
        piglit_add_executable (windowoverlap windowoverlap.c)
-endif(NOT USE_WAFFLE)
+endif(NOT PIGLIT_USE_WAFFLE)
 
 piglit_add_executable (array-stride array-stride.c)
 piglit_add_executable (bgra-vert-attrib-pointer bgra-vert-attrib-pointer.c)
diff --git a/tests/glslparsertest/glslparsertest.c 
b/tests/glslparsertest/glslparsertest.c
index ff4c4b9..b45f1ed 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -51,13 +51,13 @@ get_shader_compile_status(GLuint shader)
 {
        GLint status;
 
-#if defined USE_OPENGL
+#if defined PIGLIT_USE_OPENGL
        if (gl_version_times_10 >= 20) {
                glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
        } else {
                glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, 
&status);
        }
-#elif defined USE_OPENGL_ES2
+#elif defined PIGLIT_USE_OPENGL_ES2
        glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
 #else
 #      error
@@ -71,13 +71,13 @@ get_shader_info_log_length(GLuint shader)
 {
        GLsizei length;
 
-#if defined USE_OPENGL
+#if defined PIGLIT_USE_OPENGL
        if (gl_version_times_10 >= 20) {
                glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
        } else {
                glGetObjectParameterivARB(shader, 
GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
        }
-#elif defined USE_OPENGL_ES2
+#elif defined PIGLIT_USE_OPENGL_ES2
        glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
 #else
 #      error
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index 874991b..0eac8ce 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -4,18 +4,18 @@ include_directories(
        ${OPENGL_INCLUDE_PATH}
 )
 
-if(BUILD_GLX_TESTS)
+if(PIGLIT_BUILD_GLX_TESTS)
     link_libraries (
         piglitglxutil
     )
-endif(BUILD_GLX_TESTS)
+endif(PIGLIT_BUILD_GLX_TESTS)
 
 link_libraries (
        ${OPENGL_gl_LIBRARY}
        ${OPENGL_glu_LIBRARY}
 )
 
-IF(BUILD_GLX_TESTS)
+IF(PIGLIT_BUILD_GLX_TESTS)
        include_directories(
                ${GLPROTO_INCLUDE_DIRS}
        )
@@ -66,6 +66,6 @@ IF(BUILD_GLX_TESTS)
 
        piglit_add_executable (glx-copy-sub-buffer glx-copy-sub-buffer.c)
        piglit_add_executable (glx-query-drawable glx-query-drawable.c)
-ENDIF(BUILD_GLX_TESTS)
+ENDIF(PIGLIT_BUILD_GLX_TESTS)
 
 # vim: ft=cmake:
diff --git a/tests/spec/glx_arb_create_context/CMakeLists.gl.txt 
b/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
index 2f27d57..b57e948 100644
--- a/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
+++ b/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
@@ -4,18 +4,18 @@ include_directories(
        ${OPENGL_INCLUDE_PATH}
 )
 
-if(BUILD_GLX_TESTS)
+if(PIGLIT_BUILD_GLX_TESTS)
     link_libraries (
         piglitglxutil
     )
-endif(BUILD_GLX_TESTS)
+endif(PIGLIT_BUILD_GLX_TESTS)
 
 link_libraries (
        ${OPENGL_gl_LIBRARY}
        ${OPENGL_glu_LIBRARY}
 )
 
-IF(BUILD_GLX_TESTS)
+IF(PIGLIT_BUILD_GLX_TESTS)
        include_directories(
                ${GLPROTO_INCLUDE_DIRS}
        )
@@ -40,6 +40,6 @@ IF(BUILD_GLX_TESTS)
        piglit_add_executable (glx-create-context-valid-attribute-empty 
valid-attribute-empty.c common.c)
        piglit_add_executable (glx-create-context-valid-attribute-null 
valid-attribute-null.c common.c)
        piglit_add_executable (glx-create-context-valid-flag-forward-compatible 
valid-flag-forward-compatible.c common.c)
-ENDIF(BUILD_GLX_TESTS)
+ENDIF(PIGLIT_BUILD_GLX_TESTS)
 
 # vim: ft=cmake:
diff --git a/tests/spec/glx_ext_import_context/CMakeLists.gl.txt 
b/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
index 1eaa2ea..af93a16 100644
--- a/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
+++ b/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
@@ -4,18 +4,18 @@ include_directories(
        ${OPENGL_INCLUDE_PATH}
 )
 
-if(BUILD_GLX_TESTS)
+if(PIGLIT_BUILD_GLX_TESTS)
     link_libraries (
         piglitglxutil
     )
-endif(BUILD_GLX_TESTS)
+endif(PIGLIT_BUILD_GLX_TESTS)
 
 link_libraries (
        ${OPENGL_gl_LIBRARY}
        ${OPENGL_glu_LIBRARY}
 )
 
-IF(BUILD_GLX_TESTS)
+IF(PIGLIT_BUILD_GLX_TESTS)
        include_directories(
                ${GLPROTO_INCLUDE_DIRS}
        )
@@ -31,6 +31,6 @@ IF(BUILD_GLX_TESTS)
        piglit_add_executable (glx-make-current-multi-process 
make-current-multi-process.c common.c)
        piglit_add_executable (glx-make-current-single-process 
make-current-single-process.c common.c)
        piglit_add_executable (glx-query-context-info-ext query-context-info.c 
common.c)
-ENDIF(BUILD_GLX_TESTS)
+ENDIF(PIGLIT_BUILD_GLX_TESTS)
 
 # vim: ft=cmake:
diff --git 
a/tests/spec/oes_compressed_paletted_texture/oes_compressed_paletted_texture-api.c
 
b/tests/spec/oes_compressed_paletted_texture/oes_compressed_paletted_texture-api.c
index 39a734d..5c61e44 100644
--- 
a/tests/spec/oes_compressed_paletted_texture/oes_compressed_paletted_texture-api.c
+++ 
b/tests/spec/oes_compressed_paletted_texture/oes_compressed_paletted_texture-api.c
@@ -94,7 +94,7 @@ piglit_init(int argc, char **argv)
                glTexImage2D(GL_TEXTURE_2D, 0, t[i].internal_format,
                             16, 16, 0,
                             t[i].internal_format, t[i].type, buffer);
-#if defined(USE_OPENGL_ES1) || defined(USE_OPENGL_ES2)
+#if defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
                if (!piglit_check_gl_error(GL_INVALID_VALUE))
                        piglit_report_result(PIGLIT_FAIL);
 #else
@@ -170,7 +170,7 @@ piglit_init(int argc, char **argv)
                glCompressedTexImage2D(GL_TEXTURE_2D, 0, t[i].internal_format,
                                       16, 16, 1,
                                       size + t[i].palette_size, buffer);
-#if defined(USE_OPENGL_ES1) || defined(USE_OPENGL_ES2)
+#if defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
                if (!piglit_check_gl_error(GL_INVALID_VALUE))
                        piglit_report_result(PIGLIT_FAIL);
 #else
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index 2cd4ecd..a4e7dc6 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -18,14 +18,14 @@ link_libraries(
        ${UTIL_GL_LIBS}
        )
 
-IF(BUILD_GLX_TESTS)
+IF(PIGLIT_BUILD_GLX_TESTS)
        # XXX: This is currently duplicated wherever tests
        # include "piglit-glx-util.h". Is it possible to refactor it?
        include_directories(
                ${GLPROTO_INCLUDE_DIRS}
        )
 
-       add_definitions ( -DUSE_GLX )
+       add_definitions ( -DPIGLIT_USE_GLX )
        piglit_add_library (piglitglxutil
                    piglit-shader.c
                    piglit-shader-gl.c
@@ -44,7 +44,7 @@ IF(BUILD_GLX_TESTS)
                ${UTIL_GL_SOURCES}
                piglit-glx-util.c
        )
-ENDIF(BUILD_GLX_TESTS)
+ENDIF(PIGLIT_BUILD_GLX_TESTS)
 
 piglit_add_library (piglitutil_${piglit_target_api}
        ${UTIL_GL_SOURCES}
diff --git a/tests/util/piglit-framework-fbo.c 
b/tests/util/piglit-framework-fbo.c
index 1164f80..713a319 100644
--- a/tests/util/piglit-framework-fbo.c
+++ b/tests/util/piglit-framework-fbo.c
@@ -21,17 +21,17 @@
  * IN THE SOFTWARE.
  */
 
-#if defined(USE_OPENGL_ES1)
+#if defined(PIGLIT_USE_OPENGL_ES1)
 #      define PIGLIT_FRAMEWORK_FBO_DISABLED
-#elif defined(USE_WAFFLE)
+#elif defined(PIGLIT_USE_WAFFLE)
 #      define PIGLIT_FRAMEWORK_FBO_USE_WAFFLE
-#elif defined(USE_GLX)
+#elif defined(PIGLIT_USE_GLX)
 #      define PIGLIT_FRAMEWORK_FBO_USE_GLX
 #else
 #      define PIGLIT_FRAMEWORK_FBO_DISABLED
 #endif
 
-#ifdef USE_OPENGL_ES2
+#ifdef PIGLIT_USE_OPENGL_ES2
 #      define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
 #      define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
 #endif
@@ -147,11 +147,11 @@ piglit_framework_fbo_waffle_init(void)
                        "value \"%s\"", env_platform);
        }
 
-#if defined(USE_OPENGL)
+#if defined(PIGLIT_USE_OPENGL)
        waffle_context_api = WAFFLE_CONTEXT_OPENGL;
-#elif defined(USE_OPENGL_ES1)
+#elif defined(PIGLIT_USE_OPENGL_ES1)
        waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES1;
-#elif defined(USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES2)
        waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES2;
 #else
 #      error
@@ -240,7 +240,7 @@ piglit_framework_fbo_gl_init(const struct 
piglit_gl_test_info *info)
        GLuint tex, depth = 0;
        GLenum status;
 
-#ifdef USE_OPENGL
+#ifdef PIGLIT_USE_OPENGL
        glewInit();
 
        if (piglit_get_gl_version() < 20)
@@ -317,7 +317,7 @@ piglit_framework_fbo_init(const struct piglit_gl_test_info 
*info)
 static void
 piglit_framework_fbo_destroy(void)
 {
-#ifdef USE_OPENGL
+#ifdef PIGLIT_USE_OPENGL
        glDeleteFramebuffers(1, &piglit_winsys_fbo);
 #endif
 
diff --git a/tests/util/piglit-framework-glut.c 
b/tests/util/piglit-framework-glut.c
index d61eed6..6510df6 100644
--- a/tests/util/piglit-framework-glut.c
+++ b/tests/util/piglit-framework-glut.c
@@ -31,7 +31,7 @@
 #include "piglit-framework-gl.h"
 #include "piglit-framework-glut.h"
 
-#ifdef USE_GLX
+#ifdef PIGLIT_USE_GLX
 #include "piglit-glx-util.h"
 #endif
 
@@ -103,12 +103,12 @@ piglit_framework_glut_init(int argc, char *argv[],
        test_info = info;
        glutInit(&argc, argv);
 
-#      if defined(USE_WAFFLE)
-#              if defined(USE_OPENGL)
+#      if defined(PIGLIT_USE_WAFFLE)
+#              if defined(PIGLIT_USE_OPENGL)
                        glutInitAPIMask(GLUT_OPENGL_BIT);
-#              elif defined(USE_OPENGL_ES1)
+#              elif defined(PIGLIT_USE_OPENGL_ES1)
                        glutInitAPIMask(GLUT_OPENGL_ES1_BIT);
-#              elif defined(USE_OPENGL_ES2)
+#              elif defined(PIGLIT_USE_OPENGL_ES2)
                        glutInitAPIMask(GLUT_OPENGL_ES2_BIT);
 #              else
 #                      error
@@ -121,7 +121,7 @@ piglit_framework_glut_init(int argc, char *argv[],
        glutInitDisplayMode(info->window_visual);
        piglit_window = glutCreateWindow(argv[0]);
 
-#if defined(USE_GLX) && !defined(USE_WAFFLE)
+#if defined(PIGLIT_USE_GLX) && !defined(PIGLIT_USE_WAFFLE)
        /* If using waffle, then the current platform might not be GLX.
         * So we can't call any GLX functions.
         *
@@ -136,7 +136,7 @@ piglit_framework_glut_init(int argc, char *argv[],
        glutReshapeFunc(reshape);
        glutKeyboardFunc(piglit_escape_exit_key);
 
-#ifdef USE_OPENGL
+#ifdef PIGLIT_USE_OPENGL
        glewInit();
 #endif
 }
diff --git a/tests/util/piglit-shader-gl.c b/tests/util/piglit-shader-gl.c
index d3eee67..1ca443e 100644
--- a/tests/util/piglit-shader-gl.c
+++ b/tests/util/piglit-shader-gl.c
@@ -21,8 +21,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef USE_OPENGL
-#      error USE_OPENGL is undefined
+#ifndef PIGLIT_USE_OPENGL
+#      error PIGLIT_USE_OPENGL is undefined
 #endif
 
 #if defined(_MSC_VER)
diff --git a/tests/util/piglit-shader-gles1.c b/tests/util/piglit-shader-gles1.c
index 6fd7d10..88606ca 100644
--- a/tests/util/piglit-shader-gles1.c
+++ b/tests/util/piglit-shader-gles1.c
@@ -21,8 +21,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef USE_OPENGL_ES1
-#      error USE_OPENGL_ES1 is undefined
+#ifndef PIGLIT_USE_OPENGL_ES1
+#      error PIGLIT_USE_OPENGL_ES1 is undefined
 #endif
 
 #include "piglit-util-gl-common.h"
diff --git a/tests/util/piglit-shader-gles2.c b/tests/util/piglit-shader-gles2.c
index 8e85bbd..c6e6dfb 100644
--- a/tests/util/piglit-shader-gles2.c
+++ b/tests/util/piglit-shader-gles2.c
@@ -21,8 +21,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef USE_OPENGL_ES2
-#      error USE_OPENGL_ES2 is undefined
+#ifndef PIGLIT_USE_OPENGL_ES2
+#      error PIGLIT_USE_OPENGL_ES2 is undefined
 #endif
 
 #include "piglit-util-gl-common.h"
diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
index f097512..32e8e15 100644
--- a/tests/util/piglit-shader.c
+++ b/tests/util/piglit-shader.c
@@ -118,7 +118,7 @@ shader_name(GLenum target)
    switch (target) {
    case GL_VERTEX_SHADER:
       return "vertex";
-#if defined USE_OPENGL
+#if defined PIGLIT_USE_OPENGL
    case GL_GEOMETRY_SHADER:
       return "geometry";
 #endif
diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h
index 64e6623..f2dacc3 100644
--- a/tests/util/piglit-shader.h
+++ b/tests/util/piglit-shader.h
@@ -45,7 +45,7 @@ GLint piglit_link_simple_program(GLint vs, GLint fs);
  * wrappers.
  */
 /*@{*/
-#if defined(USE_OPENGL_ES1)
+#if defined(PIGLIT_USE_OPENGL_ES1)
 #define piglit_AttachShader assert(!"glAttachShader does not exist in ES1")
 #define piglit_BindAttribLocation assert(!"glBindAttribLocation does not exist 
in ES1")
 #define piglit_CompileShader assert(!"glCompileShader does not exist in ES1")
@@ -88,7 +88,7 @@ GLint piglit_link_simple_program(GLint vs, GLint fs);
 #define piglit_UniformMatrix3x4fv assert(!"glUniformMatrix3x4fv does not exist 
in ES1")
 #define piglit_UniformMatrix4x2fv assert(!"glUniformMatrix4x2fv does not exist 
in ES1")
 #define piglit_UniformMatrix4x3fv assert(!"glUniformMatrix4x3fv does not exist 
in ES1")
-#elif defined(USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES2)
 #define piglit_AttachShader glAttachShader
 #define piglit_BindAttribLocation glBindAttribLocation
 #define piglit_CompileShader glCompileShader
diff --git a/tests/util/piglit-util-gl-enum.c b/tests/util/piglit-util-gl-enum.c
index 225b008..bde15ea 100644
--- a/tests/util/piglit-util-gl-enum.c
+++ b/tests/util/piglit-util-gl-enum.c
@@ -30,10 +30,10 @@
 #endif
 
 /* Force GL defines */
-#ifndef USE_OPENGL
-#  define USE_OPENGL
-#  undef USE_OPENGL_ES1
-#  undef USE_OPENGL_ES2
+#ifndef PIGLIT_USE_OPENGL
+#  define PIGLIT_USE_OPENGL
+#  undef PIGLIT_USE_OPENGL_ES1
+#  undef PIGLIT_USE_OPENGL_ES2
 #endif
 
 #include "piglit-util-gl-common.h"
diff --git a/tests/util/piglit-util-gles.c b/tests/util/piglit-util-gles.c
index 12ae847..f83d373 100644
--- a/tests/util/piglit-util-gles.c
+++ b/tests/util/piglit-util-gles.c
@@ -188,7 +188,7 @@ piglit_escape_exit_key(unsigned char key, int x, int y)
 static void
 draw_arrays(const GLvoid *verts, const GLvoid *tex)
 {
-#if defined(USE_OPENGL_ES1)
+#if defined(PIGLIT_USE_OPENGL_ES1)
        if (verts) {
                glVertexPointer(4, GL_FLOAT, 0, verts);
                glEnableClientState(GL_VERTEX_ARRAY);
@@ -205,7 +205,7 @@ draw_arrays(const GLvoid *verts, const GLvoid *tex)
                glDisableClientState(GL_VERTEX_ARRAY);
        if (tex)
                glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-#elif defined(USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES2)
        if (verts) {
                glVertexAttribPointer(PIGLIT_ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, 
0, verts);
                glEnableVertexAttribArray(PIGLIT_ATTRIB_POS);
@@ -521,7 +521,7 @@ piglit_checkerboard_texture(GLuint tex, unsigned level,
        return tex;
 }
 
-#if defined(USE_OPENGL_ES1)
+#if defined(PIGLIT_USE_OPENGL_ES1)
 
 /**
  * Convenience function to configure an abitrary orthogonal projection matrix
@@ -556,4 +556,4 @@ piglit_ortho_projection(int w, int h, GLboolean push)
        piglit_gen_ortho_projection(0, w, 0, h, -1, 1, push);
 }
 
-#endif /* USE_OPENGL_ES1 */
+#endif /* PIGLIT_USE_OPENGL_ES1 */
diff --git a/tests/util/piglit_ktx.c b/tests/util/piglit_ktx.c
index 4c67489..7febc8f 100644
--- a/tests/util/piglit_ktx.c
+++ b/tests/util/piglit_ktx.c
@@ -631,7 +631,7 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
 
        switch (info->target) {
        case GL_TEXTURE_1D:
-#ifdef USE_OPENGL
+#ifdef PIGLIT_USE_OPENGL
                if (info->gl_type == 0)
                        glCompressedTexImage1D(info->target,
                                               level,
@@ -679,7 +679,7 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
        case GL_TEXTURE_2D_ARRAY:
        case GL_TEXTURE_3D:
        case GL_TEXTURE_CUBE_MAP_ARRAY:
-#ifdef USE_OPENGL
+#ifdef PIGLIT_USE_OPENGL
                if (info->gl_type == 0)
                        glCompressedTexImage3D(info->target,
                                               level,
@@ -715,7 +715,7 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
        *gl_error = glGetError();
        return *gl_error == 0;
 
-#ifndef USE_OPENGL
+#ifndef PIGLIT_USE_OPENGL
 unsupported_on_gles:
        *gl_error = 0;
        piglit_ktx_error("%s", "GLES supports only GL_TEXTURE_2D and "
-- 
1.7.12.1

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to