[bp] CBD-774: Add support for automake 1.13

Change-Id: I881af884d4d2bd383a18f9c81099c2e5e7411c14
Original-Reviewed-on: http://review.couchbase.org/23969
Reviewed-on: http://review.couchbase.org/25180
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Revert "MB-7569 Ignore eacces errors on delete dir init"

This reverts commit dc873ddd49d011dd927a847212aa25c71f5ad69b.
Turns out to be a problem, found in MB-7772, and was not really
a solution for the problem, but more of a workaround to reduce
the frequency of the issue. CBD-790 is the ultimate solution.

Change-Id: I3c09b81850fe26b62c6f142022ff5c26dd87db42
Reviewed-on: http://review.couchbase.org/25173
Reviewed-by: Sriram Melkote <siri.couchbase@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
CBD-790 Build and run on Erlang OTP R16B

Upgraded mochiweb to version 2.4.2, so that it doesn't
require parametrized modules (removed from R16B) and
remove the unused etap_web and etap_request modules,
because they used parametrized modules.

This change still allows to build and run with Erlang
versions R14x and R15x.

Change-Id: Ib108468334b08aa0a29605d22c28a347fb5577d5
Reviewed-on: http://review.couchbase.org/25265
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Change dialyzer file path

So that it guarantees there's no dialyzer plt file versioning
issues when the same bot is used to run dialyzer for different
branches of couchdb.

Change-Id: I3e8ee4df225eefaae9077954e7718ab7e43d1a77
Reviewed-on: http://review.couchbase.org/25354
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7882 Simple btree optimizations

This change removes some inefficiencies in the btree module:

1) Building unnecessary tuples when the extract and assemble
   functions are the default ones (as is the case for views).
   For this case, just don't build any tuples nor do any
   assemble/extract function calls;

2) Traversing a list of KVs and applying the assemble function
   to build a new list - this is waste of time and cpu when
   the assemble function is the default one (as in the case for
   views);

3) Traversing the same list 2 times and reversing an accumulator
   when encoding a kp node. This can be done in a single pass
   with the list comprehension expression and avoiding the need
   to keep a list accumulator and reverse it at the end.

This was found it profiling data from fprof. Nearly no impact on
view updates (due to existing pipelining), however view compaction
had gains of about 6% regarding time. Very small impact as well
on query response time.

Change-Id: I0b9b8e013deede1bdba86f4f1ba2d4cc052bbbb4
Reviewed-on: http://review.couchbase.org/25353
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Log decoded KV list on reduce failure

So that we don't need to decode it when debugging failures.
This was not the case before support for termless format
storage was added.

Change-Id: I38019caf5235c234441c42ab2650540cf201deef
Reviewed-on: http://review.couchbase.org/25361
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7978 Fixes to view tree with multiple reducers

A view tree with multiple reducers where not all of them
are native (_count, _sum, _stats) or custom (JavaScript)
was not working anymore since the termless storage format,
and it became undetected for so long due to the fact that
old JavaScript testsuite (Futon) was removed (commit
304cbbd93400abfcb07ca70eecb4e1ccf3f3b485) and no equivalent
etap tests existed.

A view tree with multiple reducers only exists when 2 or
more views in the same design document have exactly the same
map function, on a byte by byte basis, and different reduce
functions (builtin or custom).

Change-Id: Id3218842da83e9e26339e6c59dd7c9b2e8d6a999
Reviewed-on: http://review.couchbase.org/25390
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Merge branch '2.0.2'

* 2.0.2:
  MB-7978 Fixes to view tree with multiple reducers
  Log decoded KV list on reduce failure
  MB-7882 Simple btree optimizations
  Change dialyzer file path
  CBD-790 Build and run on Erlang OTP R16B
  Revert "MB-7569 Ignore eacces errors on delete dir init"
  [bp] CBD-774: Add support for automake 1.13

Change-Id: I2b52af71a2fdf8f490cf80e91a3c69bd86ec5161