diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2022-05-20 23:01:41 +0300 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2022-05-20 23:39:56 +0300 |
commit | d18c579c017a31cd1e4a601660e04da78f207a5e (patch) | |
tree | f7af279e21889ecf9388f13d7134d9bc1478a44e | |
parent | ed3af74ffd91d827bcd824a6d6706c29358336c4 (diff) | |
download | mpv-build-d18c579c017a31cd1e4a601660e04da78f207a5e.tar.bz2 mpv-build-d18c579c017a31cd1e4a601660e04da78f207a5e.tar.xz |
ffmpeg-config: ssl/tls detection: simplify (no-op)
- Implement our own echo function. echo is non standard and its
behavior varies, where on some systems it can be affected by -n
or -e etc. Our implementation is unaffected by any switch/options.
- Invoke grep only once, and check one of the three strings at once
as an ERE (-E).
- Add a user-message when skipping auto-detection
-rwxr-xr-x | scripts/ffmpeg-config | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/ffmpeg-config b/scripts/ffmpeg-config index 4fd3a5b..c36a424 100755 --- a/scripts/ffmpeg-config +++ b/scripts/ffmpeg-config @@ -1,6 +1,8 @@ #!/bin/sh set -e +echo() { printf %s\\n "$*"; } # depends on standard IFS (which we have) + BUILD="$(pwd)" newline=" " @@ -17,10 +19,11 @@ if "$BUILD"/scripts/test-libmpv ; then fi # Do FFmpeg's job. -if ! ( echo "$OPTIONS" "$@" | grep -q -e --enable-openssl ) && - ! ( echo "$OPTIONS" "$@" | grep -q -e --enable-gnutls ) && - ! ( echo "$OPTIONS" "$@" | grep -q -e --enable-mbedtls ) ; +if ( echo "$OPTIONS" "$@" | \ + grep -q -E -e "--enable-openssl|--enable-gnutls|--enable-mbedtls" ) then + echo TLS/SSL user option specified, skipping autodetection +else if pkg-config gnutls ; then OPTIONS="$OPTIONS --enable-gnutls" echo "Auto-enabling GnuTLS." |