util/sha1: rework _mesa_sha1_{init,final}
[mesa.git] / configure.ac
index bc85d3ca6af049ad1bb2329900c718de261ffa36..1d81fcceaeed3847354fe6958d3dc3511c140b54 100644 (file)
@@ -126,7 +126,6 @@ LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
 AC_CHECK_PROG(RM, rm, [rm -f])
-AC_CHECK_PROG(XXD, xxd, [xxd])
 
 AX_PROG_BISON([],
               AS_IF([test ! -f "$srcdir/src/compiler/glsl/glcpp/glcpp-parse.c"],
@@ -801,9 +800,10 @@ if test "x$android" = xno; then
     test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
 fi
 
-dnl pthread-stubs is mandatory on targets where it exists
+dnl pthread-stubs is mandatory on BSD platforms, due to the nature of the
+dnl project. Even then there's a notable issue as described in the project README
 case "$host_os" in
-cygwin* )
+linux* | cygwin* | darwin* | solaris* | gnu*)
     pthread_stubs_possible="no"
     ;;
 * )
@@ -908,18 +908,18 @@ llvm_add_target() {
 # $1 is the llvm-config command with arguments.
 strip_unwanted_llvm_flags() {
     # Use \> (marks the end of the word)
-    echo " `$1`" | sed \
-        -e 's/\s\+-m\S*//g' \
-        -e 's/\s\+-DNDEBUG\>//g' \
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
-        -e 's/\s\+-pedantic\>//g' \
-        -e 's/\s\+-W\S*//g' \
-        -e 's/\s\+-O\S*//g' \
-        -e 's/\s\+-g\S*//g' \
+    echo " `$1`" | sed -E \
+        -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
+        -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
+        -e 's/[[[:space:]]]+-D_GNU_SOURCE\>//g' \
+        -e 's/[[[:space:]]]+-pedantic\>//g' \
+        -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
+        -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
+        -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
         -e 's/-fno-rtti\>/-Fno-rtti/g' \
-        -e 's/\s\+-f\S*//g' \
+        -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
         -e 's/-Fno-rtti\>/-fno-rtti/g' \
-        -e 's/^ //'
+        -e 's/^[[[:space:]]]//'
 }
 
 llvm_set_environment_variables() {
@@ -1786,9 +1786,8 @@ if test -n "$with_vulkan_drivers"; then
     for driver in $VULKAN_DRIVERS; do
         case "x$driver" in
         xintel)
-            if test "x$HAVE_I965_DRI" != xyes; then
-                AC_MSG_ERROR([Intel Vulkan driver requires the i965 dri driver])
-            fi
+            require_libdrm "i965"
+            PKG_CHECK_MODULES([INTEL], [libdrm >= $LIBDRM_INTEL_REQUIRED libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
             HAVE_INTEL_VULKAN=yes
 
             ;;
@@ -2018,8 +2017,10 @@ if test "x$enable_opencl" = xyes; then
                     PKG_CONFIG_PATH environment variable.
                     By default libclc.pc is installed to /usr/local/share/pkgconfig/])
     else
-        PKG_CHECK_VAR([LIBCLC_INCLUDEDIR], [libclc], [includedir])
-        PKG_CHECK_VAR([LIBCLC_LIBEXECDIR], [libclc], [libexecdir])
+        LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
+        LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
+        AC_SUBST([LIBCLC_INCLUDEDIR])
+        AC_SUBST([LIBCLC_LIBEXECDIR])
     fi
 
     gallium_st="$gallium_st clover"
@@ -2100,7 +2101,12 @@ if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
     AC_MSG_ERROR([cannot build egl state tracker without EGL library])
 fi
 
-PKG_CHECK_VAR([WAYLAND_SCANNER], [wayland-scanner], [wayland_scanner])
+PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
+        WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
+        WAYLAND_SCANNER='')
+if test "x$WAYLAND_SCANNER" = x; then
+    AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
+fi
 
 # Do per-EGL platform setups and checks
 egl_platforms=`IFS=', '; echo $with_egl_platforms`
@@ -2110,7 +2116,7 @@ for plat in $egl_platforms; do
 
                PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED])
 
-               if test "x$WAYLAND_SCANNER" = x; then
+               if test "x$WAYLAND_SCANNER" = "x:"; then
                        AC_MSG_ERROR([wayland-scanner is needed to compile the wayland egl platform])
                fi
                ;;
@@ -2195,7 +2201,8 @@ AC_ARG_WITH([omx-libdir],
     [AS_HELP_STRING([--with-omx-libdir=DIR],
         [directory for the OMX libraries])],
     [OMX_LIB_INSTALL_DIR="$withval"],
-    [OMX_LIB_INSTALL_DIR=`$PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
+    [OMX_LIB_INSTALL_DIR=`$PKG_CONFIG --exists libomxil-bellagio && \
+                          $PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
 AC_SUBST([OMX_LIB_INSTALL_DIR])
 
 dnl Directory for VA libs
@@ -2679,8 +2686,6 @@ AC_CONFIG_FILES([Makefile
                src/glx/windows/windowsdriproto.pc
                src/gtest/Makefile
                src/intel/Makefile
-               src/intel/tools/Makefile
-               src/intel/vulkan/Makefile
                src/loader/Makefile
                src/mapi/Makefile
                src/mapi/es1api/glesv1_cm.pc