irungentoo/ProjectTox-Core — pull request #484 by jin-eld (2013-08-18 00:26:40+00:00)
Title: autotools build scripts - improved PR version 2

This the reworked version of my earlier autotools pull request. Just as the previous one it keeps the existing cmake build system intact and allows you to chose whatever build system you prefer.

It has also been tested on MinGW/Win32 and will compile just fine.

__Features:__

Tox is built as a library, both, shared and static variants are created, public headers are installed to `${prefix}/include/tox`, the library is called "libtoxcore".

`--with-dependency-search=DIR` will tell configure to look for various dependencies in DIR/include and DIR/lib

In addition you can also specify libsodium header and lib location with `--with-libsodium-headers` and `--with-libsodium-libs` if it is installed elsewhere.

A configuration file for pkg-config is automatically created by the configure script and is installed in the correct location when doing a `make install`

`make check` will run the unit tests

make dist` will generate a release tarball (version is specified in configure.ac)

toxic and nTox are installed to `${prefix}/bin`, files from the `testing` directory are compiled, but are not part of the install target (you can run them from the build directory).

`libconfig` is optional, if it is not found then the DHT bootstrap server daemon will not be built.

`check` library is optional, if it is not found then unit tests will not be built.

`ncurses` / `pdcurses` is optional, if it is not found then toxic and nTox will not be built.

Last but not least, to generate the `configure` script use `autoreconf -i`. This is only needed when you clone the repo from git, a tarball that was generated with `make dist` will already have everything generated.

__Notes:__

nTox on Win32 is broken and will not compile, I guess no one is maintaining it, so I had to disable it.

toxic on Win32 is broken and will not compile, currently it is already disabled in the cmake files in master. I did fix the compilation and I did enable it in the autotools build scripts, however it will not run but crash when executed. I did not look into it any further, at least it's not worse than it was before :P

I had to rename windows.h in toxic into toxic_windows.h to avoid a conflict on Win32 where winsock2.h also tries to include a windows.h file, for some reason it picked the header from toxic which lead to numerous errors.

I had to rename the `core` directory because of a known autotools limitation: the configure tests may produce core files which are then deleted by the configure script, if a directory with that name exists at top source level then there will be a lot of "could not remove core" messages when running configure.

I hope I can convince you to get this PR in, it does not enforce anything upon anyone, instead it allows every developer to use what he likes best, which imho is a good thing. I'm also willing to maintain the autotools build system and submit PRs on a regular basis, syncing with whatever changes are made in the core.