mingw64下为ffmpeg编译gnutls小结

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zymill/article/details/81711446

软件包官方地址:https://gnutls.org/

笔者采用版本为 gnutls-3.5.19,编译过程中遇到的2个问题

1)合理使用自带openssl / libunistring / libtasn1库函数,减少对外部第三方库的依赖,选项参数(红色标注)如下

--enable-local-libopts --enable-openssl-compatibility --with-nettle-mini --with-included-unistring --with-included-libtasn1 --enable-silent-rules --without-p11-kit --without-tpm --without-p11-kit --without-tpm --without-idn --without-libidn2 --disable-tools --disable-gtk-doc --disable-gcc-warnings --disable-non-suiteb-curves --disable-full-test-suite --disable-tests --disable-doc --disable-manpages --disable-gtk-doc-html --with-libiconv-prefix=$(OPENSDK_PATH) --with-libz-prefix=$(OPENSDK_PATH)

2)gnutls.pc执行遇到的问题

诚如下面report bug所描述,但是在本机上执行的结果 gnutls.pc -lcrypt32并没有真正生效,文件中出现了重复一个-lws2_32。为了先保证编译通过,仍然可以按照下述方法做兼容。真正解决问题,还需gnutls本身。

I'm cross-compiling FFmpeg with GnuTLS (on Windows using Cygwin, MinGW and GCC) for TLS 1.2 support.
Without intervention FFmpeg's configure would always fail:
...

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: GnuTLS
Description: Transport Security Layer implementation for the GNU system
URL: http://www.gnutls.org/
Version: @VERSION@
Libs: -L${libdir} -lgnutls
Libs.private: @LIBINTL@ @LIBSOCKET@ @LIBNSL@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBIDN2_LIBS@ -lcrypt32
@GNUTLS_REQUIRES_PRIVATE@
Cflags: -I${includedir}

or configure FFmpeg with --extra-libs=-lcrypt32 to correct this.

In 'lib/Makefile.am' I did notice:

if WINDOWS
thirdparty_libadd += -lcrypt32
endif

and in 'lib/.libs/libgnutls.lai' I did notice:

# Libraries that this one depends upon.
dependency_libs=' -lws2_32 -L/cygdrive/m/[...]/i686-w64-mingw32/lib -lhogweed -lnettle /cygdrive/m/[...]/i686-w64-mingw32/lib/libgmp.la -lcrypt32'

but as FFmpeg only checks the pkg-config file, I believe 'gnutls.pc.in' is this case is in need of an update.
 

猜你喜欢

转载自blog.csdn.net/zymill/article/details/81711446