Merge commit '1faffe7e8fab21186a233011bc8a62f47962e2cd'
authorClément Bœsch <u@pkh.me>
Wed, 26 Apr 2017 14:42:17 +0000 (16:42 +0200)
committerClément Bœsch <u@pkh.me>
Wed, 26 Apr 2017 14:42:17 +0000 (16:42 +0200)
* commit '1faffe7e8fab21186a233011bc8a62f47962e2cd':
  configure: Disentangle vfw32 and user32 lib handling

Merged-by: Clément Bœsch <u@pkh.me>
1  2 
configure

diff --cc configure
+++ b/configure
@@@ -3007,26 -2383,15 +3007,25 @@@ opengl_outdev_deps="opengl
  oss_indev_deps_any="soundcard_h sys_soundcard_h"
  oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  pulse_indev_deps="libpulse"
 +pulse_outdev_deps="libpulse"
 +qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
 +qtkit_indev_select="qtkit"
 +sdl2_outdev_deps="sdl2"
  sndio_indev_deps="sndio"
  sndio_outdev_deps="sndio"
 +v4l_indev_deps="linux_videodev_h"
  v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
 +v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
- vfwcap_indev_extralibs="-lavicap32"
  xcbgrab_indev_deps="libxcb"
 +xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
 +xv_outdev_extralibs="-lXv -lX11 -lXext"
  
  # protocols
 +async_protocol_deps="threads"
 +bluray_protocol_deps="libbluray"
  ffrtmpcrypt_protocol_deps="!librtmp_protocol"
 -ffrtmpcrypt_protocol_deps_any="gmp openssl"
 +ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
  ffrtmpcrypt_protocol_select="tcp_protocol"
  ffrtmphttp_protocol_deps="!librtmp_protocol"
  ffrtmphttp_protocol_select="http_protocol"
@@@ -3848,11 -3045,8 +3847,10 @@@ msvc_common_flags()
              -mthumb)              ;;
              -march=*)             ;;
              -lz)                  echo zlib.lib ;;
-             -lavicap32)           echo vfw32.lib user32.lib ;;
              -lx264)               echo libx264.lib ;;
 +            -lstdc++)             ;;
              -l*)                  echo ${flag#-l}.lib ;;
 +            -LARGEADDRESSAWARE)   echo $flag ;;
              -L*)                  echo -libpath:${flag#-L} ;;
              *)                    echo $flag ;;
          esac
@@@ -5907,68 -4701,34 +5905,69 @@@ enabled openssl           && { use_pkg_
                                 check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
                                 check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
                                 die "ERROR: openssl not found"; }
 -
 -enabled gnutls            && check_lib gmp.h mpz_export -lgmp && enable gmp
 -
 -if enabled nvenc; then
 -    check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."
 -    check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" ||
 -        die "ERROR: NVENC API version 5 or older is not supported"
 +enabled qtkit_indev      && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; }
 +
 +if enabled gcrypt; then
 +    GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
 +    if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
 +        gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
 +        gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
 +        check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
 +            die "ERROR: gcrypt not found"
 +        add_cflags $gcrypt_cflags && add_extralibs $gcrypt_extralibs
 +    else
 +        require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
 +    fi
  fi
  
 -if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
 -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
 -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
 -    enable sdl
 +disabled sdl && disable sdl2
 +if ! disabled sdl2; then
 +    SDL2_CONFIG="${cross_prefix}sdl2-config"
 +    if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
 +        check_func SDL_Init $sdl2_extralibs $sdl2_cflags && enable sdl2
 +    else
 +      if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
 +        sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
 +        sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
 +        check_func SDL_Init $sdl2_extralibs $sdl2_cflags && enable sdl2
 +      fi
 +    fi
 +    if test $target_os = "mingw32"; then
 +        sdl2_extralibs="$sdl2_extralibs -mconsole"
 +    fi
  fi
 +enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs $sdl2_extralibs
 +
 +disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
 +    check_lib "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
 +    enable securetransport; }
 +
 +disabled schannel || { check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
 +                       check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lsecur32; }
  
 -! disabled pod2man   && check_cmd pod2man --help     && enable pod2man   || disable pod2man
 -! disabled texi2html && check_cmd texi2html -version && enable texi2html || disable texi2html
 +makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 +enabled makeinfo \
 +    && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
 +    && enable makeinfo_html || disable makeinfo_html
 +disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
 +perl -v            > /dev/null 2>&1 && enable perl      || disable perl
 +pod2man --help     > /dev/null 2>&1 && enable pod2man   || disable pod2man
 +rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  
  check_header linux/fb.h
 +check_header linux/videodev.h
  check_header linux/videodev2.h
 -check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
 -
 -check_header AVFoundation/AVFoundation.h
 +check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  
  check_header sys/videoio.h
 +check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  
- check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
+ check_lib "windows.h winuser.h" GetShellWindow -luser32
+ check_lib "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  # w32api 3.12 had it defined wrong
  check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines