From: Bernhard Kölbl besentv@gmail.com
--- configure | 90 +++++++++++++++++++++++++++++++++++++++++++++ include/config.h.in | 9 +++++ 2 files changed, 99 insertions(+)
diff --git a/configure b/configure index c1c6c4cf93b..28de5ae1851 100755 --- a/configure +++ b/configure @@ -656,6 +656,7 @@ RT_LIBS WINELOADER_PROGRAMS DELAYLOADFLAG MSVCRTFLAGS +VOSK_LIBS NETAPI_LIBS NETAPI_CFLAGS PROCSTAT_LIBS @@ -936,6 +937,7 @@ with_udev with_unwind with_usb with_v4l2 +with_vosk with_vulkan with_xcomposite with_xcursor @@ -2450,6 +2452,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 @@ -4360,6 +4363,13 @@ then : fi
+# Check whether --with-vosk was given. +if test ${with_vosk+y} +then : + withval=$with_vosk; if test "x$withval" = "xno"; then ac_cv_header_vosk_api_h=no; fi +fi + + # Check whether --with-vulkan was given. if test ${with_vulkan+y} then : @@ -8282,6 +8292,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" @@ -18252,6 +18268,79 @@ then as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." fi
+if test "$ac_cv_header_vosk_api_h" = "yes" +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 + + VOSK_LIBS="-lvosk" + + ac_cv_lib_vosk=yes + +printf "%s\n" "#define HAVE_VOSK 1" >>confdefs.h + +fi +fi +if test "x$ac_cv_lib_vosk" != xyes +then : + case "x$with_vosk" in + x) as_fn_append wine_notices "|libvosk ${notice_platform}development files not found (or too old), Vosk aka speech recognition won't be supported." ;; + xno) ;; + *) as_fn_error $? "libvosk ${notice_platform}development files not found (or too old), Vosk aka speech recognition won't be supported. +This is an error since --with-vosk was requested." "$LINENO" 5 ;; +esac +enable_vosk=${enable_vosk:-no} +fi + if test "x$with_vulkan" != "xno" then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lvulkan" >&5 @@ -23121,6 +23210,7 @@ GSSAPI_LIBS = $GSSAPI_LIBS PROCSTAT_LIBS = $PROCSTAT_LIBS NETAPI_CFLAGS = $NETAPI_CFLAGS NETAPI_LIBS = $NETAPI_LIBS +VOSK_LIBS = $VOSK_LIBS MSVCRTFLAGS = $MSVCRTFLAGS DELAYLOADFLAG = $DELAYLOADFLAG WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS diff --git a/include/config.h.in b/include/config.h.in index fe2fc36a914..2858797aa59 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -645,6 +645,12 @@ /* Define to 1 if you have the <valgrind/valgrind.h> header file. */ #undef HAVE_VALGRIND_VALGRIND_H
+/* Define to 1 if Vosk is available */ +#undef HAVE_VOSK + +/* 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 +795,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