From: Alexandre Julliard <julliard@winehq.org> --- configure | 287 +++++++++++++++++++++++++-------------------------- configure.ac | 28 ++--- 2 files changed, 158 insertions(+), 157 deletions(-) diff --git a/configure b/configure index 82ba3070e35..69ef15d96f3 100755 --- a/configure +++ b/configure @@ -681,7 +681,10 @@ DBUS_CFLAGS INOTIFY_LIBS INOTIFY_CFLAGS PCSCLITE_LIBS +PCSCLITE_CFLAGS PCAP_LIBS +PCAP_CFLAGS +OPENCL_CFLAGS WAYLAND_EGL_LIBS WAYLAND_EGL_CFLAGS XKBCOMMON_LIBS @@ -1908,6 +1911,12 @@ XKBCOMMON_CFLAGS XKBCOMMON_LIBS WAYLAND_EGL_CFLAGS WAYLAND_EGL_LIBS +OPENCL_CFLAGS +OPENCL_LIBS +PCAP_CFLAGS +PCAP_LIBS +PCSCLITE_CFLAGS +PCSCLITE_LIBS INOTIFY_CFLAGS INOTIFY_LIBS DBUS_CFLAGS @@ -2786,6 +2795,15 @@ Some influential environment variables: C compiler flags for wayland-egl, overriding pkg-config WAYLAND_EGL_LIBS Linker flags for wayland-egl, overriding pkg-config + OPENCL_CFLAGS + C compiler flags for OpenCL, overriding pkg-config + OPENCL_LIBS Linker flags for OpenCL, overriding pkg-config + PCAP_CFLAGS C compiler flags for libpcap, overriding pkg-config + PCAP_LIBS Linker flags for libpcap, overriding pkg-config + PCSCLITE_CFLAGS + C compiler flags for libpcsclite, overriding pkg-config + PCSCLITE_LIBS + Linker flags for libpcsclite, overriding pkg-config INOTIFY_CFLAGS C compiler flags for libinotify, overriding pkg-config INOTIFY_LIBS @@ -4433,7 +4451,7 @@ fi # Check whether --with-opencl was given. if test ${with_opencl+y} then : - withval=$with_opencl; if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi + withval=$with_opencl; if test "x$withval" = "xno"; then ac_cv_header_OpenCL_opencl_h=no; fi fi @@ -4454,7 +4472,7 @@ fi # Check whether --with-pcap was given. if test ${with_pcap+y} then : - withval=$with_pcap; if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi + withval=$with_pcap; fi @@ -10750,12 +10768,6 @@ then : printf '%s\n' "#define STDC_HEADERS 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "CL/cl.h" "ac_cv_header_CL_cl_h" "$ac_includes_default" -if test "x$ac_cv_header_CL_cl_h" = xyes -then : - printf '%s\n' "#define HAVE_CL_CL_H 1" >>confdefs.h - fi ac_fn_c_check_header_compile "$LINENO" "OpenCL/opencl.h" "ac_cv_header_OpenCL_opencl_h" "$ac_includes_default" if test "x$ac_cv_header_OpenCL_opencl_h" = xyes @@ -10984,12 +10996,6 @@ if test "x$ac_cv_header_netinet_tcp_fsm_h" = xyes then : printf '%s\n' "#define HAVE_NETINET_TCP_FSM_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "pcap/pcap.h" "ac_cv_header_pcap_pcap_h" "$ac_includes_default" -if test "x$ac_cv_header_pcap_pcap_h" = xyes -then : - printf '%s\n' "#define HAVE_PCAP_PCAP_H 1" >>confdefs.h - fi ac_fn_c_check_header_compile "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default" if test "x$ac_cv_header_port_h" = xyes @@ -12448,7 +12454,7 @@ fi then OPENCL_LIBS="-framework OpenCL" - ac_cv_lib_OpenCL_clGetPlatformInfo=yes + ac_cv_func_clGetPlatformInfo=yes fi ac_ext=m @@ -17084,59 +17090,58 @@ enable_winex11_drv=${enable_winex11_drv:-no} fi fi -if test "$ac_cv_header_CL_cl_h" = "yes" +if test "x$with_opencl" != "xno" then - { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for clGetPlatformInfo in -lOpenCL" >&5 -printf %s "checking for clGetPlatformInfo in -lOpenCL... " >&6; } -if test ${ac_cv_lib_OpenCL_clGetPlatformInfo+y} + rm -f conftest.err +if ${OPENCL_CFLAGS:+false} : then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lOpenCL $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test ${PKG_CONFIG+y} +then : + OPENCL_CFLAGS=`$PKG_CONFIG --cflags OpenCL 2>conftest.err` +fi +fi -/* 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char clGetPlatformInfo (void); -int -main (void) -{ -return clGetPlatformInfo (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" +if ${OPENCL_LIBS:+false} : then : - ac_cv_lib_OpenCL_clGetPlatformInfo=yes -else case e in #( - e) ac_cv_lib_OpenCL_clGetPlatformInfo=no ;; -esac + if test ${PKG_CONFIG+y} +then : + OPENCL_LIBS=`$PKG_CONFIG --libs OpenCL 2>/dev/null` fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac fi -{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenCL_clGetPlatformInfo" >&5 -printf '%s\n' "$ac_cv_lib_OpenCL_clGetPlatformInfo" >&6; } -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" = xyes + +OPENCL_LIBS=${OPENCL_LIBS:-"-lOpenCL"} +printf '%s\n' "$as_me:${as_lineno-$LINENO}: OpenCL cflags: $OPENCL_CFLAGS" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: OpenCL libs: $OPENCL_LIBS" >&5 +if test -s conftest.err; then + printf %s "$as_me:${as_lineno-$LINENO}: OpenCL errors: " >&5 + cat conftest.err >&5 +fi +rm -f conftest.err +if test -n "$OPENCL_CFLAGS$OPENCL_LIBS" +then : + ac_save_pkg_CPPFLAGS=$CPPFLAGS +ac_save_pkg_LIBS=$LIBS +CPPFLAGS="$CPPFLAGS $OPENCL_CFLAGS" +LIBS="$OPENCL_LIBS $LIBS" +ac_fn_c_check_header_compile "$LINENO" "CL/cl.h" "ac_cv_header_CL_cl_h" "$ac_includes_default" +if test "x$ac_cv_header_CL_cl_h" = xyes +then : + printf '%s\n' "#define HAVE_CL_CL_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "clGetPlatformInfo" "ac_cv_func_clGetPlatformInfo" +if test "x$ac_cv_func_clGetPlatformInfo" = xyes then : - OPENCL_LIBS="-lOpenCL" + : +fi +CPPFLAGS=$ac_save_pkg_CPPFLAGS +LIBS=$ac_save_pkg_LIBS fi fi -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes +if test "x$ac_cv_func_clGetPlatformInfo" != xyes then : case "x$with_opencl" in x) as_fn_append wine_notices "|OpenCL ${notice_platform}development files not found, OpenCL won't be supported." ;; @@ -17147,59 +17152,61 @@ esac enable_opencl=${enable_opencl:-no} fi -if test "$ac_cv_header_pcap_pcap_h" = "yes" +if test "x$with_pcap" != "xno" then - { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for pcap_init in -lpcap" >&5 -printf %s "checking for pcap_init in -lpcap... " >&6; } -if test ${ac_cv_lib_pcap_pcap_init+y} + rm -f conftest.err +if ${PCAP_CFLAGS:+false} : then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test ${PKG_CONFIG+y} +then : + PCAP_CFLAGS=`$PKG_CONFIG --cflags libpcap 2>conftest.err` +fi +fi -/* 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char pcap_init (void); -int -main (void) -{ -return pcap_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" +if ${PCAP_LIBS:+false} : then : - ac_cv_lib_pcap_pcap_init=yes -else case e in #( - e) ac_cv_lib_pcap_pcap_init=no ;; -esac + if test ${PKG_CONFIG+y} +then : + PCAP_LIBS=`$PKG_CONFIG --libs libpcap 2>/dev/null` fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac fi -{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_init" >&5 -printf '%s\n' "$ac_cv_lib_pcap_pcap_init" >&6; } -if test "x$ac_cv_lib_pcap_pcap_init" = xyes + +PCAP_LIBS=${PCAP_LIBS:-"-lpcap"} +printf '%s\n' "$as_me:${as_lineno-$LINENO}: libpcap cflags: $PCAP_CFLAGS" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: libpcap libs: $PCAP_LIBS" >&5 +if test -s conftest.err; then + printf %s "$as_me:${as_lineno-$LINENO}: libpcap errors: " >&5 + cat conftest.err >&5 +fi +rm -f conftest.err +if test -n "$PCAP_CFLAGS$PCAP_LIBS" +then : + ac_save_pkg_CPPFLAGS=$CPPFLAGS +ac_save_pkg_LIBS=$LIBS +CPPFLAGS="$CPPFLAGS $PCAP_CFLAGS" +LIBS="$PCAP_LIBS $LIBS" +ac_fn_c_check_header_compile "$LINENO" "pcap/pcap.h" "ac_cv_header_pcap_pcap_h" "$ac_includes_default" +if test "x$ac_cv_header_pcap_pcap_h" = xyes +then : + printf '%s\n' "#define HAVE_PCAP_PCAP_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "pcap_init" "ac_cv_func_pcap_init" +if test "x$ac_cv_func_pcap_init" = xyes then : - PCAP_LIBS="-lpcap" + : +else case e in #( + e) PCAP_LIBS="" ;; +esac +fi +CPPFLAGS=$ac_save_pkg_CPPFLAGS +LIBS=$ac_save_pkg_LIBS fi fi -if test "x$ac_cv_lib_pcap_pcap_init" != xyes +if test "x$ac_cv_func_pcap_init" != xyes then : case "x$with_pcap" in x) as_fn_append wine_notices "|pcap ${notice_platform}development files not found, wpcap won't be supported." ;; @@ -17212,61 +17219,50 @@ fi if test "x$with_pcsclite" != "xno" then - { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for SCardEstablishContext in -lpcsclite" >&5 -printf %s "checking for SCardEstablishContext in -lpcsclite... " >&6; } -if test ${ac_cv_lib_pcsclite_SCardEstablishContext+y} + rm -f conftest.err +if ${PCSCLITE_CFLAGS:+false} : then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcsclite $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char SCardEstablishContext (void); -int -main (void) -{ -return SCardEstablishContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" + if test ${PKG_CONFIG+y} then : - ac_cv_lib_pcsclite_SCardEstablishContext=yes -else case e in #( - e) ac_cv_lib_pcsclite_SCardEstablishContext=no ;; -esac + PCSCLITE_CFLAGS=`$PKG_CONFIG --cflags libpcsclite 2>conftest.err` fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac fi -{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcsclite_SCardEstablishContext" >&5 -printf '%s\n' "$ac_cv_lib_pcsclite_SCardEstablishContext" >&6; } -if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = xyes + +if ${PCSCLITE_LIBS:+false} : then : - PCSCLITE_LIBS="-lpcsclite" + if test ${PKG_CONFIG+y} +then : + PCSCLITE_LIBS=`$PKG_CONFIG --libs libpcsclite 2>/dev/null` +fi +fi +PCSCLITE_LIBS=${PCSCLITE_LIBS:-"-lpcsclite"} +printf '%s\n' "$as_me:${as_lineno-$LINENO}: libpcsclite cflags: $PCSCLITE_CFLAGS" >&5 +printf '%s\n' "$as_me:${as_lineno-$LINENO}: libpcsclite libs: $PCSCLITE_LIBS" >&5 +if test -s conftest.err; then + printf %s "$as_me:${as_lineno-$LINENO}: libpcsclite errors: " >&5 + cat conftest.err >&5 +fi +rm -f conftest.err +if test -n "$PCSCLITE_CFLAGS$PCSCLITE_LIBS" +then : + ac_save_pkg_CPPFLAGS=$CPPFLAGS +ac_save_pkg_LIBS=$LIBS +CPPFLAGS="$CPPFLAGS $PCSCLITE_CFLAGS" +LIBS="$PCSCLITE_LIBS $LIBS" +ac_fn_c_check_func "$LINENO" "SCardEstablishContext" "ac_cv_func_SCardEstablishContext" +if test "x$ac_cv_func_SCardEstablishContext" = xyes +then : + : else case e in #( - e) case $host_os in - darwin*) PCSCLITE_LIBS="-framework PCSC" - ;; - esac ;; + e) PCSCLITE_LIBS="" ;; esac fi +CPPFLAGS=$ac_save_pkg_CPPFLAGS +LIBS=$ac_save_pkg_LIBS +fi + fi if test "x$PCSCLITE_LIBS" = x then : @@ -24379,7 +24375,10 @@ XKBCOMMON_CFLAGS = $XKBCOMMON_CFLAGS XKBCOMMON_LIBS = $XKBCOMMON_LIBS WAYLAND_EGL_CFLAGS = $WAYLAND_EGL_CFLAGS WAYLAND_EGL_LIBS = $WAYLAND_EGL_LIBS +OPENCL_CFLAGS = $OPENCL_CFLAGS +PCAP_CFLAGS = $PCAP_CFLAGS PCAP_LIBS = $PCAP_LIBS +PCSCLITE_CFLAGS = $PCSCLITE_CFLAGS PCSCLITE_LIBS = $PCSCLITE_LIBS INOTIFY_CFLAGS = $INOTIFY_CFLAGS INOTIFY_LIBS = $INOTIFY_LIBS diff --git a/configure.ac b/configure.ac index d2e2a133c1a..8c53d1807b6 100644 --- a/configure.ac +++ b/configure.ac @@ -47,11 +47,10 @@ AC_ARG_WITH(krb5, AS_HELP_STRING([--without-krb5],[do not use krb5 (Kerbero AC_ARG_WITH(mingw, AS_HELP_STRING([--without-mingw],[do not use the MinGW cross-compiler])) AC_ARG_WITH(netapi, AS_HELP_STRING([--without-netapi],[do not use the Samba NetAPI library])) AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]), - [if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi]) + [if test "x$withval" = "xno"; then ac_cv_header_OpenCL_opencl_h=no; fi]) AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support])) -AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), - [if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi]) +AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library])) AC_ARG_WITH(pcsclite, AS_HELP_STRING([--without-pcsclite],[do not use PCSC lite])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library])) AC_ARG_WITH(pulse, AS_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) @@ -724,7 +723,6 @@ m4_ifdef([AC_SYS_YEAR2038], [test "$ac_cv_sys_file_offset_bits" = 64 && AC_DEFINE(_TIME_BITS,64,[Define to 64 to enable 64-bit time_t])]) AC_CHECK_HEADERS(\ - CL/cl.h \ OpenCL/opencl.h \ arpa/inet.h \ arpa/nameser.h \ @@ -763,7 +761,6 @@ AC_CHECK_HEADERS(\ netinet/in_systm.h \ netinet/tcp.h \ netinet/tcp_fsm.h \ - pcap/pcap.h \ port.h \ pwd.h \ sched.h \ @@ -1031,7 +1028,7 @@ case $host_os in if test "$ac_cv_header_OpenCL_opencl_h" = "yes" then AC_SUBST(OPENCL_LIBS,"-framework OpenCL") - ac_cv_lib_OpenCL_clGetPlatformInfo=yes + ac_cv_func_clGetPlatformInfo=yes fi dnl Check for MTLDevice registryID property @@ -1489,27 +1486,32 @@ else fi dnl **** Check for OpenCL **** -if test "$ac_cv_header_CL_cl_h" = "yes" +if test "x$with_opencl" != "xno" then - AC_CHECK_LIB(OpenCL,clGetPlatformInfo,[AC_SUBST(OPENCL_LIBS,["-lOpenCL"])]) + WINE_PACKAGE_FLAGS(OPENCL,[OpenCL],[-lOpenCL],,, + [AC_CHECK_HEADERS([CL/cl.h]) + AC_CHECK_FUNC(clGetPlatformInfo,[:])]) fi -WINE_NOTICE_WITH(opencl,[test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes], +WINE_NOTICE_WITH(opencl,[test "x$ac_cv_func_clGetPlatformInfo" != xyes], [OpenCL ${notice_platform}development files not found, OpenCL won't be supported.], [enable_opencl]) dnl **** Check for libpcap **** -if test "$ac_cv_header_pcap_pcap_h" = "yes" +if test "x$with_pcap" != "xno" then - AC_CHECK_LIB(pcap,pcap_init,[AC_SUBST(PCAP_LIBS,["-lpcap"])]) + WINE_PACKAGE_FLAGS(PCAP,[libpcap],[-lpcap],,, + [AC_CHECK_HEADERS([pcap/pcap.h]) + AC_CHECK_FUNC(pcap_init,[:],[PCAP_LIBS=""])]) fi -WINE_NOTICE_WITH(pcap,[test "x$ac_cv_lib_pcap_pcap_init" != xyes], +WINE_NOTICE_WITH(pcap,[test "x$ac_cv_func_pcap_init" != xyes], [pcap ${notice_platform}development files not found, wpcap won't be supported.], [enable_wpcap]) dnl **** Check for libpcsclite **** if test "x$with_pcsclite" != "xno" then - AC_CHECK_LIB(pcsclite,SCardEstablishContext,[AC_SUBST(PCSCLITE_LIBS,["-lpcsclite"])], + WINE_PACKAGE_FLAGS(PCSCLITE,[libpcsclite],[-lpcsclite],,, + [AC_CHECK_FUNC(SCardEstablishContext,[:],[PCSCLITE_LIBS=""])], [case $host_os in darwin*) AC_SUBST(PCSCLITE_LIBS,"-framework PCSC") ;; esac]) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11201