The libtool.m4 file defining the LT_INIT macro is located in the share
directory of the built libtool prefix. This file can be present on the
host system but when it isn't, the bootstrap can fail during bootstrap
with the following error:
autoreconf: running: automake --add-missing --copy --force-missing
bin/Makefile.am:41: error: Libtool library used but 'LIBTOOL' is undefined
bin/Makefile.am:41: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
bin/Makefile.am:41: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
bin/Makefile.am:41: If 'LT_INIT' is in 'configure.ac', make sure
bin/Makefile.am:41: its definition is in aclocal's search path.
Indeed, when libtool.m4 is not installed with the same prefix as
autoconf/autom4te, and specificallly the share/ folder is not shared,
then autom4te will fail to detect LT_INIT, leading autoreconf to
disable the libtool support and discard the call to libtoolize.
Then, automake cannot find the aclocal m4 file since libtoolize didn't
install it, and the previous error is displayed before bootstrap exits.
This behaviour can be checked by uninstalling every libtool and trying
to run the following commands:
# Works
autom4te --verbose --language=Autoconf --output=- --trace=LT_INIT extras/tools/build/share/aclocal/libtool.m4 configure.ac
# Fails to find LT_INIT
autom4te --verbose --language=Autoconf --output=- --trace=LT_INIT configure.ac extras/tools/build/share/aclocal/libtool.m4
# Fails to find LT_INIT
autom4te --verbose --language=Autoconf --output=- --trace=LT_INIT configure.ac
This commit ensures that the libtool.m4 will be found at the aclocal
setup, to allow libtoolize to copy the libtool.m4 as aclocal.m4 for
automake.
On Windows it's possible to build VLC in either msys2 or WSL. But the tools are
shared and incompatible. Only one at a time is currently possible. This will
allow switching back and forth without rebuilding tools all the time
(especially since they are detected as built).
And make sure we really use the host to check what contrib to use in the configure.
You don't have to re-run bootstrap from contrib after make from contrib when building for x86_64-darwin.