Since Android ndk r9, __set_errno is deprecated. It is now defined as
inline function in errno.h. The syscall assembly calls __set_errno,
but since libc.so does not export it, the link fails. To workaround
this, replace all occurrences of __set_errno with a2_set_errno and
define it as normal C function.
Also it's not just the `html` target that needs libaria2api generated.
The fix is mighty ackward, as it is not really out-of-tree: libaria2api
still will be but into the srcdir. I settled for this because trying to
do a real include from the build dir is really a mess, either requireing
heavy pre-processing or a custom sphinx Include directive :p
The cause of slowness of the first implementation is the memory
allocation overhead and appending character by character. In this
implementation, the output buffer is reserved the same size of input.
This is reasonable because most likely no replacement happens in
practice. And the unmodified region is copied using iterator range to
speed up a bit.
Supported since automake-1.11. There is no point in having the very
verbose compile stuff running about, which cannot even silenced properly
with `make -s` by default. Otherwise, `make V=1` or
`--disable-silent-rules` are your friends
AC_USE_SYSTEM_EXTENSIONS will cause AC_PROG_CC, which is overridden by
automake-1.14, which will then init (part) of automake, in particular
am_aux_dir expansion, which in turn relies on ac_aux-dir, which is not
initialized at this point, and thus: certain doom (or fun, depending on
your POV and mood :p)
Hence call AC_USE_SYSTEM_EXTENSIONS only after AM_INIT_AUTOMAKE. This,
of course, caused a lot of related macro shuffling.
Tested against automake-1.10 (OSX Lion/XCode version) and automake-1.14
(homebrew version)
The clang shipped with OSX XCode and clangs not build enabling libcpp,
will default to the libstdc++ headers and lib installed on the system.
In the OSX case, that libstdc++ is the one bundles with gcc-4.2, which
is far too old to provide all required C++11 types, such as
std::shared_ptr.
Hence, the C++11 check should try to compile a program with a C++11 type
and try -stdlib=libc++ if the default lib fails to compile said program.
Because mingw cross compiler g++-4.6.3 does not support
std::unordered_map::emplace and std::deque::emplace, traditional
insert member function is used instead.