Closed hydra3333 closed 1 year ago
This issue is fixed, looked at mabs which has a patch and a sed :) https://github.com/m-ab-s/media-autobuild_suite/blob/master/build/media-suite_compile.sh
However, it does not cross-compile to a .dll :(
If anyone has advice on that, it would be much appreciated
[21:02:22][INFO] Running './configure --host=x86_64-w64-mingw32 --prefix=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed --enable-static -disable-shared --with-zlib=/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/lib' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
Use --enable-shared instead of the bolded.
The sed modification has nothing to do with building FFMS2 as a dll, but for things trying to link to a static FFMS2 (like x264). AFAIK, nothing inside of FFMS2 relies on reading the .pc file for itself, so that's entirely for external use.
Although I'll note that if you're trying to build the AviSynth plugin, the autotools build system is not going to produce what you expect (even if you do specify --enable-avisynth to configure) when cross-compiling with MinGW-w64/GCC.
OK, Thanks. Vapoursynth only at this point.
Have got a bit further.
Built a shared ffmpeg with a few dependencies shared.
Updated json:
{
'repo_type' : 'git',
'url' : 'https://github.com/FFMS/ffms2',
'depth_git' : 0,
#'recursive_git' : True,
'rename_folder' : 'ffms2_dll',
'env_exports' : {
'CXXFLAGS' : ' -Wl,-Bsymbolic {original_stack_protector_trim} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ',
'CPPFLAGS' : ' -Wl,-Bsymbolic {original_stack_protector_trim} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ',
'CFLAGS' : ' -Wl,-Bsymbolic {original_stack_protector_trim} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ',
'LDFLAGS' : ' -fstack-protector -Wl,-Bsymbolic {original_stack_protector_trim} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ', # to mitigate lock per https://github.com/ffms/ffms2/issues/90
'PKG_CONFIG_PATH' : '{output_prefix}/ffms2_dll.installed/lib/pkgconfig',
'PKG_CONFIG_LIBDIR' : '{output_prefix}/ffms2_dll.installed/lib',
},
'patches' : [
( 'ffms2/0001-ffmsindex-fix-linking-issues.patch', '-Np1' ),# from MABS
],
'run_post_patch' : [
# diff for the patch
'diff -U 10 "Makefile.am.orig" "Makefile.am" && echo "NO difference" || echo "YES differences!"',
'diff -U 10 "configure.ac.orig" "configure.ac" && echo "NO difference" || echo "YES differences!"',
# diff for the sed
'cp -fv "ffms2.pc.in" "ffms2.pc.in.orig"',
#'sed -i "s/Libs.private.*/& -lstdc++/;s/Cflags.*/& -DFFMS_STATIC/" "ffms2.pc.in"',
'diff -U 10 "ffms2.pc.in.orig" "ffms2.pc.in" && echo "NO difference" || echo "YES differences!"',
#
'if [ -f "./configure" ] ; then rm -fv ./configure ; fi',
'if [ ! -d "src/config" ] ; then mkdir -p "src/config" ; fi',
'autoreconf -fiv',
'./configure --help=recursive',
],
#'configure_options': '--host={target_host} --prefix={output_prefix}/ffms2_dll.installed --enable-static -disable-shared --with-pic --with-zlib={target_prefix}/lib ', # --with-pic per https://github.com/ffms/ffms2/issues/90
'configure_options': '--host={target_host} --prefix={output_prefix}/ffms2_dll.installed --disable-static -enable-shared --with-pic --with-zlib={output_prefix}/ffms2_dll.installed/lib ', # --with-pic per https://github.com/ffms/ffms2/issues/90
'run_pre_patch' : [
'cp -fv "Makefile.am" "Makefile.am.orig"',
'cp -fv "configure.ac" "configure.ac.orig"',
],
'depends_on': [
'ffms2_libffmpeg', # has its own dependencies
],
'update_check' : { 'type' : 'git', },
'_info' : { 'version' : 'git master', 'fancy_name' : 'ffms2_dll' },
}
It eventually yields an error, which I'll look at in a day or three (life intervenes).
Something to do with posix threads by the looks (with which I am unfamiliar), so again any advice would be appreciated.
Once finally resolved (well, if) perhaps I'd better post the final successful steps so that some other novice could learn from them, since detailed cross-compilation steps with results are not available even after fairly extensive goggling.
[00:28:10][INFO] buildPackage: git reset --hard
[00:28:10][INFO] Running 'git reset --hard' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
HEAD is now at 1031029 Fix off by one error in previous commit
[00:28:10][INFO] buildPackage: git submodule foreach --recursive git reset --hard
[00:28:10][INFO] Running 'git submodule foreach --recursive git reset --hard' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
Entering 'test/googletest'
HEAD is now at f5260ae7 Merge c798e39a4f96f5a985126cc3fab4738b6412cfc1 into e93da23920e5b6887d6a6a291c3a59f83f5b579e
[00:28:10][INFO] buildPackage: git submodule update --init --recursive
[00:28:10][INFO] Running 'git submodule update --init --recursive' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[00:28:10][DEBUG] buildPackage: source_subfolder not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: debug_confighelp_and_exit not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: cflag_addition not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: custom_cflag not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: custom_ldflag not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: strip_cflags not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: custom_path not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: flipped_path not in pkg 'ffms2_dll'
[00:28:10][INFO] buildPackage: Environment variable 'CXXFLAGS' Set from ' -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 ' to ' -Wl,-Bsymbolic -fstack-protector-all -I/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -L/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib -L/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/lib -lssp -lpthread '
[00:28:10][INFO] buildPackage: Environment variable 'CPPFLAGS' Set from ' -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 ' to ' -Wl,-Bsymbolic -fstack-protector-all -I/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -L/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib -L/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/lib -lssp -lpthread '
[00:28:10][INFO] buildPackage: Environment variable 'CFLAGS' Set from ' -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 ' to ' -Wl,-Bsymbolic -fstack-protector-all -I/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -L/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib -L/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/lib -lssp -lpthread '
[00:28:10][INFO] buildPackage: Environment variable 'LDFLAGS' Set from ' -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 ' to ' -fstack-protector -Wl,-Bsymbolic -fstack-protector-all -I/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -L/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib -L/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/lib -lssp -lpthread '
[00:28:10][INFO] buildPackage: Environment variable 'PKG_CONFIG_PATH' Set from '/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/lib/pkgconfig' to '/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib/pkgconfig'
[00:28:10][INFO] buildPackage: Environment variable 'PKG_CONFIG_LIBDIR' Set from '' to '/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib'
[00:28:10][DEBUG] buildPackage: copy_over not in pkg 'ffms2_dll'
[00:28:10][DEBUG] buildPackage: run_justbefore_patch not in pkg 'ffms2_dll'
[00:28:10][INFO] applyPatch: Applying patch 'ffms2/0001-ffmsindex-fix-linking-issues.patch' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[00:28:10][INFO] applyPatch: Copying patch from '/home/u/Desktop/_working/patches/ffms2/0001-ffmsindex-fix-linking-issues.patch' to '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll/0001-ffmsindex-fix-linking-issues.patch'
[00:28:10][DEBUG] applyPatch: cp -f '/home/u/Desktop/_working/patches/ffms2/0001-ffmsindex-fix-linking-issues.patch' '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll/0001-ffmsindex-fix-linking-issues.patch' # copy file
[00:28:10][INFO] applyPatch: Patching source using: '0001-ffmsindex-fix-linking-issues.patch'
[00:28:10][DEBUG] applyPatch: patch -b -Np1 < '0001-ffmsindex-fix-linking-issues.patch'
[00:28:10][INFO] Running 'patch -b -Np1 < '0001-ffmsindex-fix-linking-issues.patch'' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
patching file Makefile.am
Hunk #1 succeeded at 56 (offset 7 lines).
patching file configure.ac
Hunk #1 succeeded at 150 (offset 10 lines).
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'diff -U 10 "Makefile.am.orig" "Makefile.am" && echo "NO difference" || echo "YES differences!"'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'diff -U 10 "Makefile.am.orig" "Makefile.am" && echo "NO difference" || echo "YES differences!"'
[00:28:10][DEBUG] diff -U 10 "Makefile.am.orig" "Makefile.am" && echo "NO difference" || echo "YES differences!"
[00:28:10][INFO] Running 'diff -U 10 "Makefile.am.orig" "Makefile.am" && echo "NO difference" || echo "YES differences!"' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
--- Makefile.am.orig 2023-03-09 00:28:10.136640508 +1030
+++ Makefile.am 2023-03-09 00:28:10.468660049 +1030
@@ -49,20 +49,21 @@
src/avisynth/avssources.cpp \
src/avisynth/avssources.h \
src/avisynth/avisynth.cpp
endif
include_HEADERS = $(top_srcdir)/include/ffms.h $(top_srcdir)/include/ffmscompat.h
bin_PROGRAMS = src/index/ffmsindex
src_index_ffmsindex_SOURCES = src/index/ffmsindex.cpp
src_index_ffmsindex_LDADD = src/core/libffms2.la
+src_index_ffmsindex_LDFLAGS = @src_index_ffmsindex_LDFLAGS@
.PHONY: test test-build test-clean test-sync test-run
clean-local: test-clean
SAMPLES_DIR = $(abs_top_builddir)/test/samples
SAMPLES_URL = https://storage.googleapis.com/ffms2tests
test: test-setup test-build test-run
test-setup:
YES differences!
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'diff -U 10 "configure.ac.orig" "configure.ac" && echo "NO difference" || echo "YES differences!"'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'diff -U 10 "configure.ac.orig" "configure.ac" && echo "NO difference" || echo "YES differences!"'
[00:28:10][DEBUG] diff -U 10 "configure.ac.orig" "configure.ac" && echo "NO difference" || echo "YES differences!"
[00:28:10][INFO] Running 'diff -U 10 "configure.ac.orig" "configure.ac" && echo "NO difference" || echo "YES differences!"' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
--- configure.ac.orig 2023-03-09 00:28:10.136640508 +1030
+++ configure.ac 2023-03-09 00:28:10.468660049 +1030
@@ -143,19 +143,20 @@
fi
AC_SUBST([src_core_libffms2_la_LDFLAGS])
CFLAGS="$_CFLAGS"
CPPFLAGS="$_CPPFLAGS"
LIBS="$_LIBS"
AC_MSG_RESULT($bsymbolic)
if echo "$host" | $GREP "mingw" >/dev/null 2>&1; then
LTUNDEF="-no-undefined"
+ src_index_ffmsindex_LDFLAGS="$src_index_ffmsindex_LDFLAGS -municode"
fi
AC_SUBST([LTUNDEF])
+AC_SUBST([src_index_ffmsindex_LDFLAGS])
AC_CONFIG_FILES([
Makefile
ffms2.pc
])
AC_OUTPUT
-
YES differences!
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'cp -fv "ffms2.pc.in" "ffms2.pc.in.orig"'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'cp -fv "ffms2.pc.in" "ffms2.pc.in.orig"'
[00:28:10][DEBUG] cp -fv "ffms2.pc.in" "ffms2.pc.in.orig"
[00:28:10][INFO] Running 'cp -fv "ffms2.pc.in" "ffms2.pc.in.orig"' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
'ffms2.pc.in' -> 'ffms2.pc.in.orig'
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'diff -U 10 "ffms2.pc.in.orig" "ffms2.pc.in" && echo "NO difference" || echo "YES differences!"'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'diff -U 10 "ffms2.pc.in.orig" "ffms2.pc.in" && echo "NO difference" || echo "YES differences!"'
[00:28:10][DEBUG] diff -U 10 "ffms2.pc.in.orig" "ffms2.pc.in" && echo "NO difference" || echo "YES differences!"
[00:28:10][INFO] Running 'diff -U 10 "ffms2.pc.in.orig" "ffms2.pc.in" && echo "NO difference" || echo "YES differences!"' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
NO difference
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'if [ -f "./configure" ] ; then rm -fv ./configure ; fi'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'if [ -f "./configure" ] ; then rm -fv ./configure ; fi'
[00:28:10][DEBUG] if [ -f "./configure" ] ; then rm -fv ./configure ; fi
[00:28:10][INFO] Running 'if [ -f "./configure" ] ; then rm -fv ./configure ; fi' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'if [ ! -d "src/config" ] ; then mkdir -p "src/config" ; fi'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'if [ ! -d "src/config" ] ; then mkdir -p "src/config" ; fi'
[00:28:10][DEBUG] if [ ! -d "src/config" ] ; then mkdir -p "src/config" ; fi
[00:28:10][INFO] Running 'if [ ! -d "src/config" ] ; then mkdir -p "src/config" ; fi' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[00:28:10][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): 'autoreconf -fiv'
[00:28:10][INFO] buildPackage: Running post-patch-command: 'autoreconf -fiv'
[00:28:10][DEBUG] autoreconf -fiv
[00:28:10][INFO] Running 'autoreconf -fiv' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
autoreconf: running: /usr/bin/autoconf --force
configure.ac:13: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:13: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
./lib/autoconf/general.m4:1534: AC_ARG_ENABLE is expanded from...
configure.ac:13: the top level
configure.ac:36: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:36: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
./lib/autoconf/general.m4:1534: AC_ARG_ENABLE is expanded from...
configure.ac:36: the top level
configure.ac:61: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:61: You should run autoupdate.
m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:61: the top level
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:47: installing './compile'
configure.ac:52: installing './config.guess'
configure.ac:52: installing './config.sub'
configure.ac:5: installing './install-sh'
configure.ac:5: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory '.'
[00:28:17][DEBUG] buildPackage: Running post-patch-command pre replaceVarCmdSubStrings (raw): './configure --help=recursive'
[00:28:17][INFO] buildPackage: Running post-patch-command: './configure --help=recursive'
[00:28:17][DEBUG] ./configure --help=recursive
[00:28:17][INFO] Running './configure --help=recursive' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
Configuration of ffms2 3.0.1:
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
--enable-maintainer-mode
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--enable-debug Enable debug build. [default=no]
--enable-avisynth Enable AviSynth+ plugin. [default=no]
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
speeds up one-time build
--enable-static[=PKGS] build static libraries [default=yes]
--enable-shared[=PKGS] build shared libraries [default=no]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
--with-aix-soname=aix|svr4|both
shared library versioning (aka "SONAME") variant to
provide on AIX, [default=aix].
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
--with-zlib=DIR specify zlib's root installation folder
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
LT_SYS_LIBRARY_PATH
User-defined run-time library search path.
CXXCPP C++ preprocessor
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
FFMPEG_CFLAGS
C compiler flags for FFMPEG, overriding pkg-config
FFMPEG_LIBS linker flags for FFMPEG, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
[00:28:17][DEBUG] buildPackage: regex_replace not in pkg 'ffms2_dll'
[00:28:17][DEBUG] buildPackage: run_post_regexreplace in pkg 'ffms2_dll' but is None - ignored
[00:28:17][DEBUG] buildPackage: build_system not in pkg 'ffms2_dll'
[00:28:17][DEBUG] buildPackage: conf_system not in pkg 'ffms2_dll'
[00:28:17][DEBUG] buildPackage: needs_configure not in pkg 'ffms2_dll'
[00:28:17][INFO] configureSource: Processing 'ffms2_dll'
[00:28:17][INFO][AUTOCONF] configureSource: Configuring 'ffms2_dll' with: '--host=x86_64-w64-mingw32 --prefix=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed --disable-static -enable-shared --with-pic --with-zlib=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib '
[00:28:17][INFO] configureSource: ./configure --host=x86_64-w64-mingw32 --prefix=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed --disable-static -enable-shared --with-pic --with-zlib=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib
[00:28:17][INFO] Running './configure --host=x86_64-w64-mingw32 --prefix=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed --disable-static -enable-shared --with-pic --with-zlib=/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/lib ' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... x86_64-w64-mingw32-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking if debug build is enabled... no
no
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to enable C11 features... none needed
checking whether x86_64-w64-mingw32-gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of x86_64-w64-mingw32-gcc... gcc3
checking for x86_64-w64-mingw32-g++... x86_64-w64-mingw32-g++
checking whether the compiler supports GNU C++... yes
checking whether x86_64-w64-mingw32-g++ accepts -g... yes
checking for x86_64-w64-mingw32-g++ option to enable C++11 features... none needed
checking dependency style of x86_64-w64-mingw32-g++... gcc3
checking whether ln -s works... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-w64-mingw32
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by x86_64-w64-mingw32-gcc... /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld
checking if the linker (/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-nm -B
checking the name lister (/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-w64-mingw32 format... func_convert_file_nix_to_w32
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld option to reload object files... -r
checking for x86_64-w64-mingw32-objdump... x86_64-w64-mingw32-objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for x86_64-w64-mingw32-dlltool... x86_64-w64-mingw32-dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for x86_64-w64-mingw32-ar... x86_64-w64-mingw32-ar
checking for archiver @FILE support... @
checking for x86_64-w64-mingw32-strip... (cached) x86_64-w64-mingw32-strip
checking for x86_64-w64-mingw32-ranlib... x86_64-w64-mingw32-ranlib
checking command to parse /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-nm -B output from x86_64-w64-mingw32-gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for x86_64-w64-mingw32-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if x86_64-w64-mingw32-gcc supports -fno-rtti -fno-exceptions... no
checking for x86_64-w64-mingw32-gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if x86_64-w64-mingw32-gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if x86_64-w64-mingw32-gcc static flag -static works... yes
checking if x86_64-w64-mingw32-gcc supports -c -o file.o... yes
checking if x86_64-w64-mingw32-gcc supports -c -o file.o... (cached) yes
checking whether the x86_64-w64-mingw32-gcc linker (/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... x86_64-w64-mingw32-g++ -E
checking for ld used by x86_64-w64-mingw32-g++... /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld
checking if the linker (/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld) is GNU ld... yes
checking whether the x86_64-w64-mingw32-g++ linker (/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld) supports shared libraries... yes
checking for x86_64-w64-mingw32-g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if x86_64-w64-mingw32-g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if x86_64-w64-mingw32-g++ static flag -static works... yes
checking if x86_64-w64-mingw32-g++ supports -c -o file.o... yes
checking if x86_64-w64-mingw32-g++ supports -c -o file.o... (cached) yes
checking whether the x86_64-w64-mingw32-g++ linker (/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking for zlib.h... yes
checking for inflateEnd in -lz... yes
checking for x86_64-w64-mingw32-pkg-config... no
checking for pkg-config... /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/bin/pkg-config
checking pkg-config is at least version 0.22... yes
checking for libavformat >= 53.20.0 libavcodec >= 53.24.0 libswscale >= 0.7.0 libavutil >= 51.21.0 libswresample >= 1.0.0... yes
checking whether FFmpeg works... yes
checking whether -Wl,-Bsymbolic is needed... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating ffms2.pc
config.status: creating src/config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[00:28:21][INFO] configureSource: make clean -j 6
[00:28:21][INFO] Running 'make clean -j 6' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
test -z "src/core/libffms2.la" || rm -f src/core/libffms2.la
rm -rf .libs _libs
rm -f *.o
rm -f src/index/ffmsindex.exe
rm -f *.lo
rm -rf src/avisynth/.libs src/avisynth/_libs
rm -f src/avisynth/*.o
rm -f src/index/ffmsindex
rm -rf src/core/.libs src/core/_libs
rm -f src/avisynth/*.lo
rm -f src/core/so_locations
rm -rf src/index/.libs src/index/_libs
rm -f src/core/*.o
make[1]: Entering directory '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll/test'
rm -f indexer hdr display_matrix gtest.a gtest_main.a *.o
rm -rf src/vapoursynth/.libs src/vapoursynth/_libs
rm -f src/core/*.lo
rm -rf .libs
make[1]: Leaving directory '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll/test'
rm -f src/index/*.o
rm -f src/vapoursynth/*.o
rm -f src/vapoursynth/*.lo
[00:28:21][DEBUG] buildPackage: needs_conf in pkg 'ffms2_dll' is TRUE but conf_system='autoconf' is NOT RECOGNISED - ignored
[00:28:21][DEBUG] buildPackage: make_subdir not in pkg 'ffms2_dll'
[00:28:21][DEBUG] buildPackage: needs_make not in pkg 'ffms2_dll'
[00:28:21][INFO] buildSource: Processing 'ffms2_dll'
[00:28:21][INFO] make clean -j 6
[00:28:21][INFO] Running 'make clean -j 6' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
test -z "src/core/libffms2.la" || rm -f src/core/libffms2.la
rm -rf .libs _libs
rm -f *.o
rm -f src/index/ffmsindex.exe
rm -f *.lo
rm -rf src/avisynth/.libs src/avisynth/_libs
make[1]: Entering directory '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll/test'
rm -f indexer hdr display_matrix gtest.a gtest_main.a *.o
rm -rf src/core/.libs src/core/_libs
rm -f src/index/ffmsindex
rm -f src/avisynth/*.o
rm -f src/core/so_locations
rm -rf .libs
make[1]: Leaving directory '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll/test'
rm -rf src/index/.libs src/index/_libs
rm -f src/avisynth/*.lo
rm -rf src/vapoursynth/.libs src/vapoursynth/_libs
rm -f src/core/*.o
rm -f src/core/*.lo
rm -f src/index/*.o
rm -f src/vapoursynth/*.o
rm -f src/vapoursynth/*.lo
[00:28:21][INFO][MAKE] buildSource: Building 'ffms2_dll' with build_options: '' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[00:28:21][INFO] buildSource: make -j 6
[00:28:21][INFO] Running 'make -j 6 ' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
CXX src/index/ffmsindex.o
CXX src/core/audiosource.lo
CXX src/core/ffms.lo
CXX src/core/filehandle.lo
CXX src/core/indexing.lo
CXX src/core/track.lo
CXX src/core/utils.lo
src/core/audiosource.cpp: In member function 'void FFMS_AudioSource::SetOutputFormat(const FFMS_ResampleOptions&)':
src/core/audiosource.cpp:217:128: warning: 'int av_get_channel_layout_nb_channels(uint64_t)' is deprecated [-Wdeprecated-declarations]
217 | BytesPerSample = av_get_bytes_per_sample(static_cast<AVSampleFormat>(opt.SampleFormat)) * av_get_channel_layout_nb_channels(opt.ChannelLayout);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavutil/opt.h:32,
from src/core/utils.h:28,
from src/core/audiosource.h:24,
from src/core/audiosource.cpp:21:
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavutil/channel_layout.h:474:5: note: declared here
474 | int av_get_channel_layout_nb_channels(uint64_t channel_layout);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/audiosource.cpp:233:30: warning: 'int av_opt_set_channel_layout(void*, const char*, int64_t, int)' is deprecated [-Wdeprecated-declarations]
233 | av_opt_set_channel_layout(newContext.get(), "out_channel_layout", opt.ChannelLayout, 0);
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavutil/opt.h:702:5: note: declared here
702 | int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, int search_flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
src/core/indexing.cpp: In member function 'void FFMS_Indexer::CheckAudioProperties(int, AVCodecContext*)':
src/core/indexing.cpp:347:32: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
347 | AP.Channels = Context->channels;
| ^~~~~~~~
In file included from src/core/utils.h:30,
from src/core/indexing.h:24,
from src/core/indexing.cpp:21:
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:347:32: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
347 | AP.Channels = Context->channels;
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:347:32: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
347 | AP.Channels = Context->channels;
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:350:41: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
350 | it->second.Channels != Context->channels) {
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:350:41: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
350 | it->second.Channels != Context->channels) {
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:350:41: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
350 | it->second.Channels != Context->channels) {
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:354:75: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
354 | << " Channels: " << it->second.Channels << " -> " << Context->channels << ";"
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:354:75: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
354 | << " Channels: " << it->second.Channels << " -> " << Context->channels << ";"
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/indexing.cpp:354:75: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
354 | << " Channels: " << it->second.Channels << " -> " << Context->channels << ";"
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
CXX src/core/videosource.lo
CXX src/core/videoutils.lo
CXX src/core/zipfile.lo
CXX src/vapoursynth/vapoursource.lo
CXX src/vapoursynth/vapoursynth.lo
src/core/utils.cpp: In function 'void FillAP(FFMS_AudioProperties&, AVCodecContext*, FFMS_Track&)':
src/core/utils.cpp:68:24: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
68 | AP.Channels = CTX->channels;
| ^~~~~~~~
In file included from src/core/utils.h:30,
from src/core/utils.cpp:25:
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/utils.cpp:68:24: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
68 | AP.Channels = CTX->channels;
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/utils.cpp:68:24: warning: 'AVCodecContext::channels' is deprecated [-Wdeprecated-declarations]
68 | AP.Channels = CTX->channels;
| ^~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1046:9: note: declared here
1046 | int channels;
| ^~~~~~~~
src/core/utils.cpp:69:29: warning: 'AVCodecContext::channel_layout' is deprecated [-Wdeprecated-declarations]
69 | AP.ChannelLayout = CTX->channel_layout;
| ^~~~~~~~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1104:14: note: declared here
1104 | uint64_t channel_layout;
| ^~~~~~~~~~~~~~
src/core/utils.cpp:69:29: warning: 'AVCodecContext::channel_layout' is deprecated [-Wdeprecated-declarations]
69 | AP.ChannelLayout = CTX->channel_layout;
| ^~~~~~~~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1104:14: note: declared here
1104 | uint64_t channel_layout;
| ^~~~~~~~~~~~~~
src/core/utils.cpp:69:29: warning: 'AVCodecContext::channel_layout' is deprecated [-Wdeprecated-declarations]
69 | AP.ChannelLayout = CTX->channel_layout;
| ^~~~~~~~~~~~~~
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1104:14: note: declared here
1104 | uint64_t channel_layout;
| ^~~~~~~~~~~~~~
src/core/utils.cpp:79:57: warning: 'int64_t av_get_default_channel_layout(int)' is deprecated [-Wdeprecated-declarations]
79 | AP.ChannelLayout = av_get_default_channel_layout(AP.Channels);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from src/core/utils.cpp:22:
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavutil/channel_layout.h:482:9: note: declared here
482 | int64_t av_get_default_channel_layout(int nb_channels);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CXXLD src/core/libffms2.la
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x78): undefined reference to `__imp_pthread_once'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0xdd): undefined reference to `__imp_pthread_mutex_init'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x134): undefined reference to `__imp_pthread_mutex_destroy'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x194): undefined reference to `__imp_pthread_mutex_lock'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x1f4): undefined reference to `__imp_pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make: *** [Makefile:657: src/core/libffms2.la] Error 1
[00:28:24][ERROR] Error [2] running process: 'make -j 6 ' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[00:28:24][ERROR] You can try deleting the product/dependency folder: '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll' and re-run the script
Ah. googled advice, which did not work for me :-
{
'repo_type' : 'git',
'url' : 'https://github.com/FFMS/ffms2',
'depth_git' : 0,
#'recursive_git' : True,
'rename_folder' : 'ffms2_dll',
'env_exports' : {
'CXXFLAGS' : ' -pthread -Wl,-Bsymbolic {original_stack_protector_trim} {original_fortify_source} {original_cflag} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ',
'CPPFLAGS' : ' -pthread -Wl,-Bsymbolic {original_stack_protector_trim} {original_fortify_source} {original_cflag} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ',
'CFLAGS' : ' -pthread -Wl,-Bsymbolic {original_stack_protector_trim} {original_fortify_source} {original_cflag} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ',
'LDFLAGS' : ' -pthread -fstack-protector -Wl,-Bsymbolic {original_stack_protector_trim} -I{output_prefix}/ffms2_dll.installed/include -I{target_prefix}/include -L{output_prefix}/ffms2_dll.installed/lib -L{target_prefix}/lib -lssp -lpthread ', # to mitigate lock per https://github.com/ffms/ffms2/issues/90
'PKG_CONFIG_PATH' : '{output_prefix}/ffms2_dll.installed/lib/pkgconfig',
'PKG_CONFIG_LIBDIR' : '{output_prefix}/ffms2_dll.installed/lib',
},
'patches' : [
( 'ffms2/0001-ffmsindex-fix-linking-issues.patch', '-Np1' ),# from MABS
],
'run_post_patch' : [
# diff for the patch
'diff -U 10 "Makefile.am.orig" "Makefile.am" && echo "NO difference" || echo "YES differences!"',
'diff -U 10 "configure.ac.orig" "configure.ac" && echo "NO difference" || echo "YES differences!"',
# diff for the sed
'cp -fv "ffms2.pc.in" "ffms2.pc.in.orig"',
#'sed -i "s/Libs.private.*/& -lstdc++/;s/Cflags.*/& -DFFMS_STATIC/" "ffms2.pc.in"',
'diff -U 10 "ffms2.pc.in.orig" "ffms2.pc.in" && echo "NO difference" || echo "YES differences!"',
#
'if [ -f "./configure" ] ; then rm -fv ./configure ; fi',
'if [ ! -d "src/config" ] ; then mkdir -p "src/config" ; fi',
'autoreconf -fiv',
'./configure --help=recursive',
],
#'configure_options': '--host={target_host} --prefix={output_prefix}/ffms2_dll.installed --enable-static -disable-shared --with-pic --with-zlib={target_prefix}/lib ', # --with-pic per https://github.com/ffms/ffms2/issues/90
'configure_options': '--host={target_host} --prefix={output_prefix}/ffms2_dll.installed --disable-static -enable-shared --with-pic --with-zlib={output_prefix}/ffms2_dll.installed/lib ', # --with-pic per https://github.com/ffms/ffms2/issues/90
'run_pre_patch' : [
'cp -fv "Makefile.am" "Makefile.am.orig"',
'cp -fv "configure.ac" "configure.ac.orig"',
],
'depends_on': [
'ffms2_libffmpeg', # has its own dependencies
],
'update_check' : { 'type' : 'git', },
'_info' : { 'version' : 'git master', 'fancy_name' : 'ffms2_dll' },
}
yielded
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavcodec/avcodec.h:1104:14: note: declared here
1104 | uint64_t channel_layout;
| ^~~~~~~~~~~~~~
src/core/utils.cpp:79:57: warning: 'int64_t av_get_default_channel_layout(int)' is deprecated [-Wdeprecated-declarations]
79 | AP.ChannelLayout = av_get_default_channel_layout(AP.Channels);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from src/core/utils.cpp:22:
/home/u/Desktop/_working/workdir/win64_output/ffms2_dll.installed/include/libavutil/channel_layout.h:482:9: note: declared here
482 | int64_t av_get_default_channel_layout(int nb_channels);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CXXLD src/core/libffms2.la
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x5f): undefined reference to `__imp_pthread_mutex_destroy'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x492): undefined reference to `__imp_pthread_once'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x4b4): undefined reference to `__imp_pthread_mutex_lock'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x4dc): undefined reference to `__imp_pthread_mutex_unlock'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x533): undefined reference to `__imp_pthread_mutex_lock'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text+0x55a): undefined reference to `__imp_pthread_mutex_unlock'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld: src/core/.libs/ffms.o:ffms.cpp:(.text.startup+0x21): undefined reference to `__imp_pthread_mutex_init'
collect2: error: ld returned 1 exit status
make: *** [Makefile:657: src/core/libffms2.la] Error 1
[17:47:22][ERROR] Error [2] running process: 'make -j 6 ' in '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll'
[17:47:22][ERROR] You can try deleting the product/dependency folder: '/home/u/Desktop/_working/workdir/x86_64_products/ffms2_dll' and re-run the script
Advice greatly appreciated.
Although I'll note that if you're trying to build the AviSynth plugin, the autotools build system is not going to produce what you expect (even if you do specify --enable-avisynth to configure) when cross-compiling with MinGW-w64/GCC.
Why is this? Is there any way to fix it?
Why is this? Is there any way to fix it?
MSVC and GCC use incompatible C++ ABIs. Any way to 'fix' it at a deep level would break compatibility with existing C++ plugins, requiring them all to be rebuilt or fixed against the newer version. The AviSynth core and the C++ plugin must be built with the same C++ ABI. So MSVC-built AviSynth+ (the standard, official builds) can only use C++ plugins built by MSVC or clang-cl (aka Clang in MSVC mode). Likewise, MinGW-w64/GCC-built AviSynth+ can only use C++ plugins built by GCC or Clang.
Or ignore the issue entirely and develop more plugins using the C interface, because the same C interface plugin .dll can be used by either MSVC-built or GCC-built AviSynth+ (and the C interface was intended for using GCC anyway). FFMS2 already has one; development moved to another repository many years ago (the changes there are almost entirely isolated to the C-plugin code, so it gets the same updates for the core, C++ plugin, and VapourSynth plugin when it syncs against upstream every so often). It doesn't use autotools, though; either a custom configure script/GNUmakefile (old), or meson (new).
But MSVC-built Vapoursynth can load GCC-built ffms2?
VapourSynth uses a C API, so yes. That has nothing to do with me saying that --enable-avisynth doesn't do what people think it does with MinGW-w64 cross-compiles.
VapourSynth uses a C API, so yes. That has nothing to do with me saying that --enable-avisynth doesn't do what people think it does with MinGW-w64 cross-compiles.
Sure, I wasn't making objection, just I don't have in-depth knowledge of them but I'm curious.
Hello, I hope to cross-compile ffms2 (mingw64 under ubunto for target Win11x64) linking with the latest ffmpeg however I am a tad stuck.
Having built successfully cross-compiled ffmpeg and some of its dependencies static, I hoped it would be a case of running the ffms2 configure/make process and it linking to the static libraries to create ffms2.dll (the ffmpeg build process is a script which auto-inserts -I -L etc to configures and variables like LDFLAGS etc)
However, the ffms2 build process yields a
undefined reference to
WinMain'` and I'm not sure what to do about it. (I'm a vanilla user, not a linix person nor a real programmer)Any advice on how to fix it would be greatly appreciated.
A snippet showing the error:
Full log below, showing the configure/make and log (process based on a successful ffmpeg static cross-compile):