configure.ac: Do not strip away space after regex word match.
[mesa.git] / configure.ac
index 87cfbaf457ef6ee71dea3e6685d89833ff5fdf71..ab9a91ed17bff352c71e039337ee07115ef2c2d7 100644 (file)
@@ -72,7 +72,7 @@ AC_SUBST([OPENCL_VERSION])
 # codifies which drivers need which version of libdrm. Any libdrm
 # version dependencies in non-driver-specific code should be reflected
 # in the first entry.
-LIBDRM_REQUIRED=2.4.66
+LIBDRM_REQUIRED=2.4.75
 LIBDRM_RADEON_REQUIRED=2.4.71
 LIBDRM_AMDGPU_REQUIRED=2.4.63
 LIBDRM_INTEL_REQUIRED=2.4.75
@@ -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"
     ;;
 * )
@@ -812,7 +812,7 @@ cygwin* )
 esac
 
 if test "x$pthread_stubs_possible" = xyes; then
-    PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
+    PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs >= 0.4)
     AC_SUBST(PTHREADSTUBS_CFLAGS)
     AC_SUBST(PTHREADSTUBS_LIBS)
 fi
@@ -907,19 +907,19 @@ llvm_add_target() {
 # Call this inside ` ` to get the return value.
 # $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' \
-        -e 's/-fno-rtti\>/-Fno-rtti/g' \
-        -e 's/\s\+-f\S*//g' \
-        -e 's/-Fno-rtti\>/-fno-rtti/g' \
-        -e 's///'
+    echo " `$1` " | sed -E \
+        -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
+        -e 's/[[[:space:]]]+-DNDEBUG[[[:space:]]]/ /g' \
+        -e 's/[[[:space:]]]+-D_GNU_SOURCE[[[:space:]]]/ /g' \
+        -e 's/[[[:space:]]]+-pedantic[[[:space:]]]/ /g' \
+        -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
+        -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
+        -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
+        -e 's/-fno-rtti[[[:space:]]]/-Fno-rtti /g' \
+        -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
+        -e 's/-Fno-rtti[[[:space:]]]/-fno-rtti /g' \
+        -e 's/^[[[:space:]]]//' \
+        -e 's/[[[:space:]]]$//'
 }
 
 llvm_set_environment_variables() {
@@ -1786,13 +1786,12 @@ 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 "ANV"
+            PKG_CHECK_MODULES([INTEL], [libdrm >= $LIBDRM_INTEL_REQUIRED libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
             HAVE_INTEL_VULKAN=yes
-
             ;;
         xradeon)
+            require_libdrm "radv"
             PKG_CHECK_MODULES([AMDGPU], [libdrm >= $LIBDRM_AMDGPU_REQUIRED libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
             radeon_llvm_check $LLVM_REQUIRED_RADV "radv"
             HAVE_RADEON_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
                ;;
@@ -2680,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