From: Bernhard Kölbl besentv@gmail.com
--- configure | 83 +++++++++++++++++++++++++++++++++++++++++++++ include/config.h.in | 6 ++++ 2 files changed, 89 insertions(+)
diff --git a/configure b/configure index 5164b21486f..0636631705e 100755 --- a/configure +++ b/configure @@ -936,6 +936,7 @@ with_udev with_unwind with_usb with_v4l2 +with_vosk with_vulkan with_xcomposite with_xcursor @@ -2454,6 +2455,7 @@ Optional Packages: handling) --without-usb do not use the libusb library --without-v4l2 do not use v4l2 (video capture) + --without-vosk do not use Vosk --without-vulkan do not use Vulkan --without-xcomposite do not use the Xcomposite extension --without-xcursor do not use the Xcursor extension @@ -4364,6 +4366,13 @@ then : fi
+# Check whether --with-vosk was given. +if test ${with_vosk+y} +then : + withval=$with_vosk; +fi + + # Check whether --with-vulkan was given. if test ${with_vulkan+y} then : @@ -8286,6 +8295,12 @@ if test "x$ac_cv_header_valgrind_valgrind_h" = xyes then : printf "%s\n" "#define HAVE_VALGRIND_VALGRIND_H 1" >>confdefs.h
+fi +ac_fn_c_check_header_compile "$LINENO" "vosk_api.h" "ac_cv_header_vosk_api_h" "$ac_includes_default" +if test "x$ac_cv_header_vosk_api_h" = xyes +then : + printf "%s\n" "#define HAVE_VOSK_API_H 1" >>confdefs.h + fi
ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" @@ -18256,6 +18271,74 @@ then as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." fi
+if test x$with_vosk != xno +then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lvosk" >&5 +printf %s "checking for -lvosk... " >&6; } +if test ${ac_cv_lib_soname_vosk+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_soname_save_LIBS=$LIBS +LIBS="-lvosk $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char vosk_recognizer_new (); +int +main (void) +{ +return vosk_recognizer_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + case "$LIBEXT" in + dll) ac_cv_lib_soname_vosk=`$ac_cv_path_LDD conftest.exe | grep "vosk" | sed -e "s/dll.*/dll/"';2,$d'` ;; + dylib) ac_cv_lib_soname_vosk=`$OTOOL -L conftest$ac_exeext | grep "libvosk\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*/(libvosk.[0-9A-Za-z.]*dylib).*$/\1/"';2,$d'` ;; + *) ac_cv_lib_soname_vosk=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libvosk\.$LIBEXT" | sed -e "s/^.*\[\(libvosk\.$LIBEXT[^ ]*\)\].*$/\1/"';2,$d'` + if ${ac_cv_lib_soname_vosk:+false} : +then : + ac_cv_lib_soname_vosk=`$LDD conftest$ac_exeext | grep "libvosk\.$LIBEXT" | sed -e "s/^.*(libvosk.$LIBEXT[^ ]*).*$/\1/"';2,$d'` +fi ;; + esac +else $as_nop + ac_cv_lib_soname_vosk= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_soname_save_LIBS +fi +if ${ac_cv_lib_soname_vosk:+false} : +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +printf "%s\n" "not found" >&6; } + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_vosk" >&5 +printf "%s\n" "$ac_cv_lib_soname_vosk" >&6; } + +printf "%s\n" "#define SONAME_LIBVOSK "$ac_cv_lib_soname_vosk"" >>confdefs.h + + +fi +fi +if test x$ac_cv_lib_soname_vosk = x +then : + case "x$with_vosk" in + x) as_fn_append wine_notices "|libvosk ${notice_platform}development files not found, speech recognition won't be supported." ;; + xno) ;; + *) as_fn_error $? "libvosk ${notice_platform}development files not found, speech recognition won't be supported. +This is an error since --with-vosk was requested." "$LINENO" 5 ;; +esac + +fi + if test "x$with_vulkan" != "xno" then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lvulkan" >&5 diff --git a/include/config.h.in b/include/config.h.in index fe2fc36a914..25b09de07ff 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -645,6 +645,9 @@ /* Define to 1 if you have the <valgrind/valgrind.h> header file. */ #undef HAVE_VALGRIND_VALGRIND_H
+/* Define to 1 if you have the <vosk_api.h> header file. */ +#undef HAVE_VOSK_API_H + /* Define to 1 if you have the <X11/extensions/shape.h> header file. */ #undef HAVE_X11_EXTENSIONS_SHAPE_H
@@ -789,6 +792,9 @@ /* Define to the soname of the libv4l2 library. */ #undef SONAME_LIBV4L2
+/* Define to the soname of the libvosk library. */ +#undef SONAME_LIBVOSK + /* Define to the soname of the libvulkan library. */ #undef SONAME_LIBVULKAN