r300g: do not abort if a constant buffer is too large
[mesa.git] / configure.ac
index ef8a7eef82bc699c44e395489f6897226c75e8ac..7f6f8db2463ce72b4c856d10af6b4927e04d9abe 100644 (file)
@@ -4,7 +4,7 @@ AC_PREREQ([2.59])
 
 dnl Versioning - scrape the version from configs/default
 m4_define([mesa_version],
-    [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
+    [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr -d '\r'])])
 m4_ifval(mesa_version,,
     [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
 
@@ -281,6 +281,7 @@ OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
 EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
 GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
 GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
+VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
 
 GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
 GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
@@ -290,6 +291,7 @@ OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
 EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
 GLESv1_CM_LIB_GLOB='lib$(GLESv1_CM_LIB).*'${LIB_EXTENSION}'*'
 GLESv2_LIB_GLOB='lib$(GLESv2_LIB).*'${LIB_EXTENSION}'*'
+VG_LIB_GLOB='lib$(VG_LIB).*'${LIB_EXTENSION}'*'
 
 AC_SUBST([GL_LIB_NAME])
 AC_SUBST([GLU_LIB_NAME])
@@ -299,6 +301,7 @@ AC_SUBST([OSMESA_LIB_NAME])
 AC_SUBST([EGL_LIB_NAME])
 AC_SUBST([GLESv1_CM_LIB_NAME])
 AC_SUBST([GLESv2_LIB_NAME])
+AC_SUBST([VG_LIB_NAME])
 
 AC_SUBST([GL_LIB_GLOB])
 AC_SUBST([GLU_LIB_GLOB])
@@ -308,6 +311,7 @@ AC_SUBST([OSMESA_LIB_GLOB])
 AC_SUBST([EGL_LIB_GLOB])
 AC_SUBST([GLESv1_CM_LIB_GLOB])
 AC_SUBST([GLESv2_LIB_GLOB])
+AC_SUBST([VG_LIB_GLOB])
 
 dnl
 dnl Arch/platform-specific settings
@@ -463,14 +467,14 @@ dnl Driver specific build directories
 dnl
 
 dnl this variable will be prepended to SRC_DIRS and is not exported
-CORE_DIRS="glsl mesa"
+CORE_DIRS="mapi/glapi glsl mesa"
 
 SRC_DIRS="glew"
 GLU_DIRS="sgi"
 GALLIUM_DIRS="auxiliary drivers state_trackers"
 GALLIUM_TARGET_DIRS=""
 GALLIUM_WINSYS_DIRS="sw"
-GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
+GALLIUM_DRIVERS_DIRS="softpipe failover trace rbug identity"
 GALLIUM_STATE_TRACKERS_DIRS=""
 
 case "$mesa_driver" in
@@ -678,7 +682,10 @@ AC_SUBST([GL_PC_LIB_PRIV])
 AC_SUBST([GL_PC_CFLAGS])
 AC_SUBST([DRI_PC_REQ_PRIV])
 AC_SUBST([GLESv1_LIB_DEPS])
+AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
 AC_SUBST([GLESv2_LIB_DEPS])
+AC_SUBST([GLESv2_PC_LIB_PRIV])
+
 
 dnl
 dnl More X11 setup
@@ -742,11 +749,15 @@ AC_ARG_ENABLE([gles2],
         [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
     [enable_gles2="$enableval"],
     [enable_gles2=no])
+AC_ARG_ENABLE([gles-overlay],
+    [AS_HELP_STRING([--enable-gles-overlay],
+        [build separate OpenGL ES only libraries @<:@default=no@:>@])],
+    [enable_gles_overlay="$enableval"],
+    [enable_gles_overlay=no])
 
 API_DEFINES=""
 APIS=""
-ES1_SOURCES=""
-ES2_SOURCES=""
+GLES_OVERLAY=0
 if test "x$enable_opengl" = xno; then
     API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
 else
@@ -756,20 +767,21 @@ fi
 if test "x$enable_gles1" = xyes; then
     API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
     APIS="$APIS es1"
-    ES1_SOURCES='$(ES1_SOURCES)'
 fi
 if test "x$enable_gles2" = xyes; then
     API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
     APIS="$APIS es2"
-    ES2_SOURCES='$(ES2_SOURCES)'
 fi
-if test "x$enable_gles1" = xyes -o "x$enable_gles2"; then
-    SRC_DIRS="$SRC_DIRS gles"
+if test "x$enable_gles_overlay" = xyes -o \
+    "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
+    CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
+    if test "x$enable_gles_overlay" = xyes; then
+        GLES_OVERLAY=1
+    fi
 fi
 AC_SUBST([API_DEFINES])
 AC_SUBST([APIS])
-AC_SUBST([ES1_SOURCES])
-AC_SUBST([ES2_SOURCES])
+AC_SUBST([GLES_OVERLAY])
 
 dnl If $with_dri_drivers is yes, directories will be added through
 dnl platform checks
@@ -1251,6 +1263,12 @@ AC_SUBST([LLVM_LIBS])
 AC_SUBST([LLVM_LDFLAGS])
 AC_SUBST([LLVM_VERSION])
 
+VG_LIB_DEPS=""
+EGL_CLIENT_APIS='$(GL_LIB)'
+if test "x$enable_gles_overlay" = xyes; then
+    EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
+fi
+
 dnl
 dnl Gallium state trackers configuration
 dnl
@@ -1287,11 +1305,9 @@ yes)
     ;;
 *)
     # verify the requested state tracker exist
-    state_trackers=`IFS=', '; echo $with_state_trackers`
-    for tracker in $state_trackers; do
-        test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
-            AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
-
+    state_trackers=""
+    _state_trackers=`IFS=', '; echo $with_state_trackers`
+    for tracker in $_state_trackers; do
         case "$tracker" in
         dri)
             if test "x$mesa_driver" != xdri; then
@@ -1311,15 +1327,45 @@ yes)
             HAVE_ST_XORG="yes"
             ;;
         es)
-            # mesa/es is required to build es state tracker
-            CORE_DIRS="$CORE_DIRS mesa/es"
+            AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
+
+            if test "x$enable_gles_overlay" != xyes; then
+                if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
+                    CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
+                fi
+                GLES_OVERLAY=1
+                EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
+            fi
+           tracker=""
+            ;;
+        vega)
+            CORE_DIRS="$CORE_DIRS mapi/vgapi"
+            VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
+            EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
             ;;
         esac
+
+       if test -n "$tracker"; then
+            test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
+                AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
+            if test -n "$state_trackers"; then
+                state_trackers="$state_trackers $tracker"
+            else
+                state_trackers="$tracker"
+            fi
+        fi
     done
     GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
     ;;
 esac
 
+AC_SUBST([VG_LIB_DEPS])
+AC_SUBST([EGL_CLIENT_APIS])
+
+if test "x$HAVE_ST_EGL" = xyes; then
+       GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-apis"
+fi
+
 if test "x$HAVE_ST_XORG" = xyes; then
     PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
         HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
@@ -1404,7 +1450,7 @@ if test "x$enable_gallium_llvm" = xyes; then
        fi
        LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
        GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
-       DEFINES="$DEFINES -DMESA_LLVM -D__STDC_CONSTANT_MACROS"
+       DEFINES="$DEFINES -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS"
        MESA_LLVM=1
     else
        MESA_LLVM=0
@@ -1575,6 +1621,9 @@ if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
     echo "        Winsys dirs:     $GALLIUM_WINSYS_DIRS"
     echo "        Driver dirs:     $GALLIUM_DRIVERS_DIRS"
     echo "        Trackers dirs:   $GALLIUM_STATE_TRACKERS_DIRS"
+    if test "x$HAVE_ST_EGL" = xyes; then
+        echo "        EGL client APIs: $EGL_CLIENT_APIS"
+    fi
 else
     echo "        Gallium:         no"
 fi
@@ -1585,6 +1634,7 @@ echo "        Shared libs:     $enable_shared"
 echo "        Static libs:     $enable_static"
 if test "$enable_egl" = yes; then
     echo "        EGL:             $EGL_DRIVERS_DIRS"
+    echo "        EGL displays:    $EGL_DISPLAYS"
 else
     echo "        EGL:             no"
 fi