android: ac/debug: move sid_tables.h generation and IB decode to amd/common
[mesa.git] / configure.ac
index 56e91f00784c20e7f74db985eb607b477dc41674..33f1c42c8bed48c7d86672fd87b9e1c037b9968b 100644 (file)
@@ -76,6 +76,7 @@ LIBDRM_NVVIEUX_REQUIRED=2.4.66
 LIBDRM_NOUVEAU_REQUIRED=2.4.66
 LIBDRM_FREEDRENO_REQUIRED=2.4.74
 LIBDRM_VC4_REQUIRED=2.4.69
+LIBDRM_ETNAVIV_REQUIRED=2.4.74
 DRI2PROTO_REQUIRED=2.6
 DRI3PROTO_REQUIRED=1.0
 PRESENTPROTO_REQUIRED=1.0
@@ -83,7 +84,7 @@ GLPROTO_REQUIRED=1.4.14
 LIBOMXIL_BELLAGIO_REQUIRED=0.0
 LIBVA_REQUIRED=0.38.0
 VDPAU_REQUIRED=1.1
-WAYLAND_REQUIRED=1.2.0
+WAYLAND_REQUIRED=1.11
 XCB_REQUIRED=1.9.3
 XCBDRI2_REQUIRED=1.8
 XCBGLX_REQUIRED=1.8.1
@@ -238,6 +239,7 @@ AX_GCC_FUNC_ATTRIBUTE([unused])
 AX_GCC_FUNC_ATTRIBUTE([visibility])
 AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
 AX_GCC_FUNC_ATTRIBUTE([weak])
+AX_GCC_FUNC_ATTRIBUTE([alias])
 
 AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
 
@@ -466,12 +468,10 @@ dnl explicitly requested. If both disabled, set to static since shared
 dnl was explicitly requested.
 case "x$enable_static$enable_shared" in
 xyesyes)
-    AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
-    enable_shared=no
+    AC_MSG_ERROR([Cannot enable both static and shared. Building using --enable-shared is strongly recommended])
     ;;
 xnono)
-    AC_MSG_WARN([Cannot disable both static and shared libraries, enabling shared])
-    enable_shared=yes
+    AC_MSG_ERROR([Cannot disable both static and shared. Building using --enable-shared is strongly recommended])
     ;;
 esac
 
@@ -978,6 +978,10 @@ llvm_set_environment_variables() {
         LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
         LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
 
+        # We need to respect LLVM_CFLAGS when compiling LLVM headers.
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $LLVM_CFLAGS"
+
         AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
         AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
@@ -985,6 +989,8 @@ llvm_set_environment_variables() {
         AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
 
+        CFLAGS="$save_CFLAGS"
+
         # Only needed for LLVM < 3.6.0
         if test -z "$LLVM_VERSION_PATCH"; then
             LLVM_VERSION_PATCH=0
@@ -1119,11 +1125,11 @@ AC_ARG_ENABLE([lmsensors],
 AM_CONDITIONAL(HAVE_LIBSENSORS, test "x$enable_lmsensors" = xyes)
 if test "x$enable_lmsensors" = xyes ; then
     DEFINES="${DEFINES} -DHAVE_LIBSENSORS=1"
-    LIBSENSORS_LDFLAGS="-lsensors"
+    LIBSENSORS_LIBS="-lsensors"
 else
-    LIBSENSORS_LDFLAGS=""
+    LIBSENSORS_LIBS=""
 fi
-AC_SUBST(LIBSENSORS_LDFLAGS)
+AC_SUBST(LIBSENSORS_LIBS)
 
 case "$host_os" in
 linux*)
@@ -1233,7 +1239,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
 AC_ARG_WITH([gallium-drivers],
     [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
         [comma delimited Gallium drivers list, e.g.
-        "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl"
+        "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl,etnaviv,imx"
         @<:@default=r300,r600,svga,swrast@:>@])],
     [with_gallium_drivers="$withval"],
     [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
@@ -1577,9 +1583,7 @@ if test "x$enable_shader_cache" = "xyes"; then
 fi
 
 if test "x$enable_dri" = xyes; then
-    if test "$enable_static" = yes; then
-        AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
-    fi
+    require_dri_shared_libs_and_glapi "DRI"
 
     # not a hard requirement as swrast does not depend on it
     if test "x$have_libdrm" = xyes; then
@@ -1597,6 +1601,9 @@ AC_ARG_ENABLE([driglx-direct],
 dnl
 dnl libGL configuration per driver
 dnl
+if test "x$enable_glx" != xno; then
+    PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
+fi
 case "x$enable_glx" in
 xxlib | xgallium-xlib)
     # Xlib-based GLX
@@ -1610,7 +1617,6 @@ xxlib | xgallium-xlib)
     ;;
 xdri)
     # DRI-based GLX
-    PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
 
     # find the DRI deps for libGL
     dri_modules="x11 xext xdamage xfixes x11-xcb xcb xcb-glx >= $XCBGLX_REQUIRED"
@@ -1710,8 +1716,9 @@ AC_ARG_ENABLE([glx-tls],
     [GLX_USE_TLS=yes])
 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
 
-AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
-      [DEFINES="${DEFINES} -DGLX_USE_TLS"])
+if test "x$GLX_USE_TLS" = xyes; then
+    DEFINES="$DEFINES -DGLX_USE_TLS"
+fi
 
 dnl Read-only text section on x86 hardened platforms
 AC_ARG_ENABLE([glx-read-only-text],
@@ -1765,7 +1772,6 @@ if test "x$enable_dri" = xyes; then
     # Platform specific settings and drivers to build
     case "$host_os" in
     linux*)
-        DEFINES="$DEFINES -DHAVE_ALIAS"
         if test "x$enable_dri3" = xyes; then
             DEFINES="$DEFINES -DHAVE_DRI3"
         fi
@@ -1779,19 +1785,13 @@ if test "x$enable_dri" = xyes; then
             ;;
         esac
         ;;
-    *freebsd* | dragonfly* | *netbsd* | openbsd*)
-        DEFINES="$DEFINES -DHAVE_ALIAS"
-        ;;
-    gnu*)
-        DEFINES="$DEFINES -DHAVE_ALIAS"
-        ;;
     cygwin*)
         if test "x$with_dri_drivers" = "xyes"; then
             with_dri_drivers="swrast"
         fi
         ;;
     darwin*)
-        DEFINES="$DEFINES -DGLX_ALIAS_UNSUPPORTED -DBUILDING_MESA"
+        DEFINES="$DEFINES -DBUILDING_MESA"
         if test "x$with_dri_drivers" = "xyes"; then
             with_dri_drivers="swrast"
         fi
@@ -1966,22 +1966,27 @@ AC_SUBST([OSMESA_LIB_DEPS])
 AC_SUBST([OSMESA_PC_REQ])
 AC_SUBST([OSMESA_PC_LIB_PRIV])
 
+require_dri_shared_libs_and_glapi() {
+    if test "x$enable_static" = xyes; then
+        AC_MSG_ERROR([$1 cannot be build as static library])
+    fi
+
+    if test "x$enable_dri" != xyes; then
+        # There is only a single backend which won't be build/used otherwise.
+        # XXX: Revisit this as the egl/haiku is a thing.
+        AC_MSG_ERROR([$1 requires --enable-dri])
+    fi
+
+    if test "x$enable_shared_glapi" != xyes; then
+        AC_MSG_ERROR([$1 requires --enable-shared-glapi])
+    fi
+}
+
 dnl
 dnl gbm configuration
 dnl
 if test "x$enable_gbm" = xyes; then
-    if test "x$enable_dri" = xyes; then
-        if test "x$enable_shared_glapi" = xno; then
-            AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
-        fi
-    else
-        # Strictly speaking libgbm does not require --enable-dri, although
-        # both of its backends do. Thus one can build libgbm without any
-        # backends if --disable-dri is set.
-        # To avoid unnecessary complexity of checking if at least one backend
-        # is available when building, just mandate --enable-dri.
-        AC_MSG_ERROR([gbm requires --enable-dri])
-    fi
+    require_dri_shared_libs_and_glapi "gbm"
 fi
 AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
 # FINISHME: GBM has a number of dependencies which we should add below
@@ -1993,32 +1998,13 @@ AC_SUBST([GBM_PC_LIB_PRIV])
 dnl
 dnl EGL configuration
 dnl
-EGL_CLIENT_APIS=""
 
 if test "x$enable_egl" = xyes; then
     EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
 
     AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
 
-    if test "$enable_static" != yes; then
-        if test "x$enable_dri" = xyes; then
-            HAVE_EGL_DRIVER_DRI2=1
-            if test "x$enable_shared_glapi" = xno; then
-                AC_MSG_ERROR([egl_dri2 requires --enable-shared-glapi])
-            fi
-            if test "x$enable_dri3" = xyes; then
-                HAVE_EGL_DRIVER_DRI3=1
-                if test "x$enable_shared_glapi" = xno; then
-                    AC_MSG_ERROR([egl_dri3 requires --enable-shared-glapi])
-                fi
-            fi
-        else
-            # Avoid building an "empty" libEGL. Drop/update this
-            # when other backends (haiku?) come along.
-            AC_MSG_ERROR([egl requires --enable-dri])
-        fi
-
-    fi
+    require_dri_shared_libs_and_glapi "egl"
 fi
 AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
 AC_SUBST([EGL_LIB_DEPS])
@@ -2077,7 +2063,7 @@ if test "x$enable_xvmc" = xyes -o \
         "x$enable_va" = xyes; then
     if test x"$enable_dri3" = xyes; then
         PKG_CHECK_MODULES([VL], [xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED
-                                 x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
+                                 xcb-xfixes x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
     else
         PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
     fi
@@ -2207,15 +2193,6 @@ dnl Gallium configuration
 dnl
 AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
 
-case "x$enable_opengl$enable_gles1$enable_gles2" in
-x*yes*)
-    EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
-    ;;
-esac
-
-AC_SUBST([VG_LIB_DEPS])
-AC_SUBST([EGL_CLIENT_APIS])
-
 dnl
 dnl EGL Platforms configuration
 dnl
@@ -2301,8 +2278,6 @@ AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
 AM_CONDITIONAL(HAVE_EGL_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless')
 AM_CONDITIONAL(HAVE_EGL_PLATFORM_ANDROID, echo "$egl_platforms" | grep -q 'android')
 
-AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
-
 AC_SUBST([EGL_NATIVE_PLATFORM])
 AC_SUBST([EGL_CFLAGS])
 
@@ -2381,7 +2356,7 @@ dnl
 dnl Gallium helper functions
 dnl
 gallium_require_llvm() {
-    if test "x$enable_gallium_llvm" == "xyes"; then
+    if test "x$enable_gallium_llvm" = "xyes"; then
         llvm_check_version_for $LLVM_REQUIRED_GALLIUM "gallium"
     else
         AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
@@ -2505,6 +2480,14 @@ if test -n "$with_gallium_drivers"; then
             PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
             require_libdrm "freedreno"
             ;;
+        xetnaviv)
+            HAVE_GALLIUM_ETNAVIV=yes
+            PKG_CHECK_MODULES([ETNAVIV], [libdrm_etnaviv >= $LIBDRM_ETNAVIV_REQUIRED])
+            require_libdrm "etnaviv"
+            ;;
+       ximx)
+            HAVE_GALLIUM_IMX=yes
+            ;;
         xswrast)
             HAVE_GALLIUM_SOFTPIPE=yes
             if test "x$MESA_LLVM" = x1 && test "x$enable_gallium_llvm" == "xyes";  then
@@ -2559,6 +2542,12 @@ if test "x$enable_gallium_llvm" == "xyes"; then
     llvm_add_default_components "gallium"
 fi
 
+dnl We need to validate some needed dependencies for renderonly drivers.
+
+if test "x$HAVE_GALLIUM_ETNAVIV" != xyes -a "x$HAVE_GALLIUM_IMX" == xyes  ; then
+    AC_ERROR([Building with imx requires etnaviv])
+fi
+
 dnl Set LLVM_LIBS - This is done after the driver configuration so
 dnl that drivers can add additional components to LLVM_COMPONENTS.
 dnl Previously, gallium drivers were updating LLVM_LIBS directly
@@ -2623,6 +2612,8 @@ AM_CONDITIONAL(HAVE_GALLIUM_RADEON_COMMON, test "x$HAVE_GALLIUM_R600" = xyes -o
                                                 "x$HAVE_GALLIUM_RADEONSI" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_ETNAVIV, test "x$HAVE_GALLIUM_ETNAVIV" = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_IMX, test "x$HAVE_GALLIUM_IMX" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_SWR, test "x$HAVE_GALLIUM_SWR" = xyes)
@@ -2776,6 +2767,8 @@ AC_CONFIG_FILES([Makefile
                src/gallium/drivers/svga/Makefile
                src/gallium/drivers/swr/Makefile
                src/gallium/drivers/trace/Makefile
+               src/gallium/drivers/etnaviv/Makefile
+               src/gallium/drivers/imx/Makefile
                src/gallium/drivers/vc4/Makefile
                src/gallium/drivers/virgl/Makefile
                src/gallium/state_trackers/clover/Makefile
@@ -2805,6 +2798,8 @@ AC_CONFIG_FILES([Makefile
                src/gallium/targets/xvmc/Makefile
                src/gallium/tests/trivial/Makefile
                src/gallium/tests/unit/Makefile
+               src/gallium/winsys/etnaviv/drm/Makefile
+               src/gallium/winsys/imx/drm/Makefile
                src/gallium/winsys/freedreno/drm/Makefile
                src/gallium/winsys/i915/drm/Makefile
                src/gallium/winsys/intel/drm/Makefile
@@ -2923,10 +2918,10 @@ if test "$enable_egl" = yes; then
     echo "        EGL platforms:   $egl_platforms"
 
     egl_drivers=""
-    if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
+    if test "x$enable_dri" != "xno"; then
         egl_drivers="$egl_drivers builtin:egl_dri2"
     fi
-    if test "x$HAVE_EGL_DRIVER_DRI3" != "x"; then
+    if test "x$enable_dri3" != "xno"; then
         egl_drivers="$egl_drivers builtin:egl_dri3"
     fi