configure.ac: Add options to enable GLES1/2 API support
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 27 Apr 2010 17:42:33 +0000 (13:42 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 28 Apr 2010 18:36:28 +0000 (14:36 -0400)
configs/autoconf.in
configure.ac
src/mesa/Makefile
src/mesa/drivers/dri/Makefile.template

index b6cc9b3..c89441b 100644 (file)
@@ -14,6 +14,7 @@ ARCH_FLAGS = @ARCH_FLAGS@
 ASM_FLAGS = @ASM_FLAGS@
 PIC_FLAGS = @PIC_FLAGS@
 DEFINES = @DEFINES@
+API_DEFINES = @API_DEFINES@
 CFLAGS = @CPPFLAGS@ @CFLAGS@ \
        $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
 CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
index 0e77707..abb6551 100644 (file)
@@ -711,6 +711,37 @@ if test "x$with_dri_drivers" = x; then
     with_dri_drivers=no
 fi
 
+dnl Determine which APIs to support
+AC_ARG_ENABLE([opengl],
+    [AS_HELP_STRING([--disable-opengl],
+        [disable support for standard OpenGL API @<:@default=no@:>@])],
+    [enable_opengl="$enableval"],
+    [enable_opengl=yes])
+AC_ARG_ENABLE([gles1],
+    [AS_HELP_STRING([--enable-gles1],
+        [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
+    [enable_gles1="$enableval"],
+    [enable_gles1=no])
+AC_ARG_ENABLE([gles2],
+    [AS_HELP_STRING([--enable-gles2],
+        [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
+    [enable_gles2="$enableval"],
+    [enable_gles2=no])
+
+API_DEFINES=""
+if test "x$enable_opengl" = xno; then
+    API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
+else
+    API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
+fi
+if test "x$enable_gles1" = xyes; then
+    API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
+fi
+if test "x$enable_gles2" = xyes; then
+    API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
+fi
+AC_SUBST([API_DEFINES])
+
 dnl If $with_dri_drivers is yes, directories will be added through
 dnl platform checks
 DRI_DIRS=""
index e404088..44e091f 100644 (file)
@@ -16,6 +16,7 @@ include sources.mak
 .S.o:
        $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
 
+CFLAGS += $(API_DEFINES)
 
 
 # Default: build dependencies, then asm_subdirs, GLSL built-in lib,
index 4cdd51e..4b9a0c1 100644 (file)
@@ -31,6 +31,7 @@ SHARED_INCLUDES = \
        -I$(TOP)/src/egl/drivers/dri \
        $(LIBDRM_CFLAGS)
 
+CFLAGS += $(API_DEFINES)
 
 ##### RULES #####