Now mingw-w64 C++ compiler defines __USE_MINGW_ANSI_STDIO to 1, we
have to follow it as well. We hope that mingw version of stdio
function behaves like Linux ones. We have not tested them thoroughly
yet. pthread for windows defines its own HAVE_STRUCT_TIMESPEC macro.
To avoid warning, we rename our version of it as
HAVE_A2_STRUCT_TIMESPEC.
Since we use libtool, -static-libgcc and -static-libstdc++ are
stripped by libtool and not used. We just use -all-static libtool flag
for this purpose.
To create windows dll, it turns out that we need -no-undefined flag.
Now you can build bittorrent support without without external
libraries, meaning you can skip libnettle, libgmp, libgcrypt, GnuTLS and
OpenSSL on OSX (for now).
Reusing a bignum (well, unsigned very-long) implementation I had lying
around for years and just cleaned up a bit and brought to C++11 land.
It might not be the most performant implementation, but it shoud be fast
enough for our purposes and will go a long way of removing gcrypt,
nettle, gmp, openssl dependencies when using AppleTLS and WinTLS
(upcoming).
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.
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)
Android NDK R8e does not provide ftruncate64, but bionic has the
assembler code to access kernel function. We borrowed those
ftruncate64.S files from android source code repository. It turns out
that x86 asm.h in NDK R8e is also broken, so latest asm.h was also
borrowed.
By default, libaria2 feature is disabled. Use --enable-libaria2
to enable it. libaria2 static build is also disabled by default.
Use --enable-static to enable it.
Both tcmalloc_minimal and jemalloc outperform the native malloc
implemention on Windows (MSVCRT) in terms of committed memory
consumption (~-30%) and performance (e.g. far less page faults, ~-60%),
depending, of course, on the actual workload.
The longer the download queue, the bigger the impact ;)
On *nix the picture is a little different... tcmalloc usually still
outperforms the native malloc implementation, but not that significantly
than on Windows. jemalloc however is only marginally better than recent
native Linux implementations, while it is already used by some BSD as the
native allocator.
tcmalloc is part of gperftools and very mature and tested by now. It
doesn't work on OSX in the default configuration, however.
http://code.google.com/p/gperftools/
jemalloc is the default allocator at least on FreeBSD and NetBSD and
used in Firefox.
http://www.canonware.com/jemalloc/index.html