From 17f43903b6438db8590ebb59d7e9086e473237cd Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 4 Nov 2019 05:59:54 +0100 Subject: [PATCH] Document how to use -lsyslog Signed-off-by: Joachim Nilsson --- README.md | 36 ++++++++++++++++++++++++++++++++++++ TODO.org | 5 +++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d38dfad..e503f2c 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Table of Contents ----------------- * [Introduction](#introduction) +* [Using -lsyslog](#using--lsyslog) * [Build & Install](#build--install) * [Building from GIT](#building-from-git) * [Origin & References](#origin--references) @@ -67,6 +68,41 @@ Main differences from the original sysklogd package are: - Support for configuring remote syslog timeout +Using -lsyslog +-------------- + +libsyslog is by default installed as a library with a header file: + +```C +#include +``` + +The output from the `pkg-config` tool holds no surprises: + +```sh +$ pkg-config --libs --static --cflags libsyslog +-I/usr/local/include -L/usr/local/lib -lsyslog +``` + +The prefix path `/usr/local/` shown here is only the default. Use the +`configure` script to select a different prefix when installing libsyslog. + +For GNU autotools based projects, use the following in `configure.ac`: + +```sh +# Check for required libraries +PKG_CHECK_MODULES([syslog], [libsyslog >= 2.0]) +``` + +and in your `Makefile.am`: + +```sh +proggy_CFLAGS = $(syslog_CFLAGS) +proggy_LDADD = $(syslog_LIBS) +``` + + + Build & Install --------------- diff --git a/TODO.org b/TODO.org index 85b0071..dd3c0a8 100644 --- a/TODO.org +++ b/TODO.org @@ -1,8 +1,9 @@ #+STARTUP: showall * sysklogd v2.0 -** TODO Document, and add examle of, how to use libsyslog -** TODO Check for memory/descriptor leaks, valgrind +** TODO Check for memory/descriptor leaks, valgrind/Coverity +** TODO Drop strlcpy() from libsyslog, make built-in? +** DONE Document, and add examle of, how to use libsyslog ** DONE Separate libsylog.{a,so} and syslog/syslog.h with NetBSD API ** DONE Add syslogp() and vsyslogp() to libsyslog ** DONE Add support for =/etc/syslog.d/*.conf= to syslogd