Use pkg-config where available or detect the library using AC_LIB_HAVE_LINKFLAGS.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
print usage when cannot open config file

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Separated daemonize from dropping permissions.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
If system provides a daemon(0,0) use it.

That makes sniproxy follow system conventions (e.g., in linux
daemon() does not need to fork twice, something that systemd
relies on).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
remove any old pidfile

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>