Travis: Don't use mock tests

These builders are extremely slow. Also build without optimizations in
order to make life a bit easier for the builders.

Change-Id: I2374727e931ed6027b280ab8765c8a3d8fffe416
Reviewed-on: http://review.couchbase.org/43652
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Replace CMAKE_BINARY_DIR with PROJECT variants

This allows other (CMake) projects to include ourselves as a dependency within
CMake itself.

Change-Id: I6b37fed4050f4167455e016bed1f7fd9528bf2f3
Reviewed-on: http://review.couchbase.org/43630
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Remove some extra stuff from autotools' 'dist' target

Change-Id: I0a5c7f21cd795f01de9f85d13f442924f3ef5116
Reviewed-on: http://review.couchbase.org/43691
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Move all documentation to 'doc' directory

Remove clutter from top level directory

Change-Id: I458e424148762b0b8131743fce97f326fe6439fe
Reviewed-on: http://review.couchbase.org/43689
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Restore ABI compatibility for 'subclassing' I/O plugins

This necessarily introduces a set of hacks to deal with, but is
generally safe over the option of breaking some older builds.

Change-Id: I9bc00436470573d44287da6c74758798fa134bd8
Reviewed-on: http://review.couchbase.org/43628
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Move autotools related files to config subdirectory

Change-Id: Ia70a4ee754f03d871530b3fb86ce3ec5e1f4a7a8
Reviewed-on: http://review.couchbase.org/43692
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Move 'win32' files to contrib and packaging

This doesn't actually contain any "windows" code, and shouldn't be top
level anyway

Change-Id: I18843c1c67a91f1235b56bb1f100e3666bd1260a
Reviewed-on: http://review.couchbase.org/43693
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Merge (and update) AUTHORS into README

More decluttering of top level directory

Change-Id: I9befa8da58e7b8f924114fbd2b16696195ce6021
Reviewed-on: http://review.couchbase.org/43690
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Build IOCP as an OBJECT library

This lets us generate a static archive with mingw that can be linked
against properly

Change-Id: Ia7cc7c90a993a1682bb223aab2f7542d3c79c138
Reviewed-on: http://review.couchbase.org/43697
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Declare only a single 'BUILD' target for tests

This speeds things up dramatically, especially on Windows, because it
needs to scan the builds only once, rather than for each test binary.

The `alltests` target was added after the BUILD_TEST macro, and defines
which tests we should actually build.

Change-Id: Ibc03373475ed9e73c4df34f70212a65ea8660e1d
Reviewed-on: http://review.couchbase.org/43696
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add symlink cmake/configure => configure.pl

This will hopefully let users use "configure" as normal, while also
allowing for the coexistence of autotools' configure (if we decide to
package it).

Change-Id: Ib6a354a1f4eec8151fb2823d88c5a029cc6c7d8f
Reviewed-on: http://review.couchbase.org/43694
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Provide runtime version of wire_bsdio_impl2

This will allow adapters to take advantage of newer library versions

Change-Id: I7eb572c51ad99231b8ffa1d03dfee6e55ef9cfa9
Reviewed-on: http://review.couchbase.org/43701
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Remove AUTHORS file from packaging scripts

Change-Id: I12f30417fdf3f3b54cde1ff1f6daf1e6ef4ed303
Reviewed-on: http://review.couchbase.org/43703
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Minify autotools further

- Drop support for plugins (If they can build the plugins, they can
  probably build CMake)
- Drop support for Windows (CMake will always work here)

Change-Id: Ic4acfb6da7836b0726378cd1c2225aff2675f79c
Reviewed-on: http://review.couchbase.org/43700
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Consolidate deprecated API implementations into a single 'legacy.c' file

I've been getting questions from folks about various confusions with
these older files. This should help lay away some of the confusion :)

Change-Id: I75e36b5ce9ed18575eb49ef05c91bbf2f0e2c330
Reviewed-on: http://review.couchbase.org/43716
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Improve cbcrc/cbc-pillowfight manpages

This adds some more usage examples.

Change-Id: Ib4cc40bfdb9e693a00eb635e9de35d18d7479fe8
Reviewed-on: http://review.couchbase.org/43497
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Ensure that -fno-strict-aliasing is _appended_ after -O2

-O2 includes -fstrict-aliasing, so we need to ensure that these flags
are explicitly added after each invocation. Maybe we should just use
unions instead *sigh*.

Change-Id: I9321609a671339dfe13502fdd071ad1de823bf9f
Reviewed-on: http://review.couchbase.org/43720
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix several missing brackets and logic errors

This commit fixes several subtle issues in the library:

- IS_REFRESHING() (in confmon.c) should be defined with parens around
  the expression; since in the current implementation when used with
  !IS_REFRESHING (where the comparison is bitwise) the left operand gets
  evaluated first with the `!` operator and then the `&` operator

- Fixed several variable chcks in proper conditionals

- Fixed mismatched variable checks (when we should be checking another
  variable)

Change-Id: Ib7be07367162d46fb971e90a96eba7360f6e80b5
Reviewed-on: http://review.couchbase.org/43711
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Fix/test lcbio_MGR maxidle counters

This simplifies (and tests for) the logic of the manager's keeping track
of how many idle connections are allowed per socket. It also removes an
unnecessary variable which can be derived using other fielss.

Change-Id: I3f6ace4c581129de2a4b24562c203c6c37a36292
Reviewed-on: http://review.couchbase.org/43721
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Add README for source directory

Change-Id: I5283772822cc5d91e1a65a129410692025eb18f8
Reviewed-on: http://review.couchbase.org/43688
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>