Document how to use -lsyslog

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-11-04 05:59:54 +01:00
parent 30d26f1d6d
commit 17f43903b6
2 changed files with 39 additions and 2 deletions

View File

@ -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 <syslog/syslog.h>
```
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
---------------

View File

@ -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