libtool doesn't handle frameworks as dependencies, and only support them
as linker argument (ie. -Wl,-framework arguments). Remove them from the
link to prevent the linkage failure. This also means that they must be
provided manually in the makefile afterwards...
Make the script work like Makefile.am files, by allowing to specify
where libtool is meant to be found. Using the same libtool as autoconf
will ensure we use the correct wrapper or alternative implementation as
specified by autoconf.
Avoid using array syntax from bash and use a case; esac to filter the
arguments given to the libtool_cargo wrapper. This allows to extract
some arguments, such as --cfg here.
The autotools suite (automake, libtool, ...) does not support Rust
neither Cargo (Rust package manager and build system) so we need to have
a custom system for using them. We do this by having "hacky" script that
does the build with cargo and output an .a archive in the .libs
directory. And with this and another cargo command we create the .la
with the right information so that the build system can continue as
usual.