ssl: Don't let cmd_fd activity break timeouts

If we receive a "status" command like OC_CMD_STATS on cmd_fd (as opposed
to a "control" command line OC_CMD_CANCEL), we don't want it to speed up
timeouts for (re)connections.  Instead, we want to make the requested
callback and then go back to waiting.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
library: Update changelog and bump minor version

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
main: Add openconnect_vpninfo_free() on a couple of exit paths

This makes it easier to check for library memory leaks.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
buildsys: Allow overriding -W flags

For any given source file, automake will apply either
"$(AM_CFLAGS) $(CFLAGS)" or "$(objname_CFLAGS) $(CFLAGS)" [1].  Move the
warning flags into the former item so that they can be disabled on a per-
object basis.

[1] http://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-Ordering

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
acinclude: Add AX_JNI_INCLUDE_DIR macro

AX_JNI_INCLUDE_DIR is used to locate jni.h for building the Java Native
Interface to libopenconnect.  Original source:

http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html

This commit also includes two pending enhancements:

http://savannah.gnu.org/patch/?8154
http://savannah.gnu.org/patch/?8155

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
JNI: Initial commit of C wrapper functions

If the user runs "configure --with-java", a separate library is built
with Java native interface stubs and it can be loaded with:

    System.loadLibrary("openconnect-wrapper");

On a native build, it should autodetect the jni.h location by looking at
JAVA_HOME or the path to javac.  On a cross build,
--with-java=/java_home/include must be explicitly specified.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
JNI: Initial commit of Java library + example program

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
android: Enable JNI in build

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
android: Add libstoken to build

This was tested with NDK release r8e on ARM (on a real device) and
x86 (compile only).

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
android: Add liboath to build

Compile-tested with NDK r9:

    make NDK=/opt/android-ndk-r9 GCCVER=4.8

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
android: Add "sources" target

Provide an easy way to download and extract the source tarballs in
anticipation of a multiplatform build.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
android: Detect /dev/tun shutdown

For reasons that are not yet clear, the OS can tear down /dev/tun on its
own and cause writes to return EBADF.  If this happens, the best we can
do is exit the mainloop and let the app try to recover.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
main: Add --timestamp option

This is useful for debugging connection timeouts and DPD/Keepalive
problems.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>