rdp / ffmpeg-windows-build-helpers

Helper script for cross compiling some media tools for windows, like customizable ffmpeg.exe (with or without non-free components, etc), and some other bonuses like mplayer, mp4box, mxf, etc.
GNU General Public License v3.0
1.08k stars 412 forks source link

fix: configure not detecting build machine on aarch64 #698

Closed insomnimus closed 1 year ago

insomnimus commented 1 year ago

This commit adds a --build for calls to configure in generic_configure, using the value obtained from gcc -dumpmachine.

On x86_64, all the configure scripts are able to detect the build machine correctly; in Arm aarch64, bs2b fails with the following message:

unzipping libbs2b-3.1.0.tar.gz ...
configuring libbs2b-3.1.0 (/parent/ffmpeg/rdp/sandbox/win64/libbs2b-3.1.0) as $ PKG_CONFIG_PATH=/parent/ffmpeg/rdp/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/lib/pkgconfig PATH=/parent/ffmpeg/rdp/sandbox/cross_compilers/mingw-w64-x86_64/bin:$PATH ./configure --host=x86_64-w64-mingw32 --prefix=/parent/ffmpeg/rdp/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static 
all touch files already_configured* touchname= already_configured_00c87be795485e939d1d23c84d477351-
config options --host=x86_64-w64-mingw32 --prefix=/parent/ffmpeg/rdp/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static ./configure
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
# [...]
checking dependency style of x86_64-w64-mingw32-gcc... gcc3
checking build system type... build-aux/config.guess: unable to guess system type

This script, last modified 2009-06-03, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (build-aux/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2009-06-03

uname -m = aarch64
uname -r = 6.2.10-1-aarch64-ARCH
uname -s = Linux
uname -v = #1 SMP PREEMPT_DYNAMIC Fri Apr  7 10:32:52 MDT 2023

/usr/bin/uname -p = aarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = aarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = aarch64
UNAME_RELEASE = 6.2.10-1-aarch64-ARCH
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP PREEMPT_DYNAMIC Fri Apr  7 10:32:52 MDT 2023
configure: error: cannot guess build type; you must specify one
failed configure libbs2b-3.1.0

Adding the --build flag fixes this.

This commit also runs the zeranoe mingw build script with CFLAGS=-O2 CXXFLAGS=-O2 which seems to cut the overall compilation time.