Build libsyslog.la and install it with syslog.h and libsyslog.pc

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-10-31 08:39:09 +01:00
parent 358cbae1dc
commit af97a5bb0a
5 changed files with 35 additions and 3 deletions

4
.gitignore vendored
View File

@ -10,12 +10,16 @@ aclocal.m4
autom4te.cache autom4te.cache
compile compile
config.h* config.h*
config.guess
config.log config.log
config.status config.status
config.sub
configure configure
depcomp depcomp
install-sh install-sh
klogd.service klogd.service
libtool
ltmain.sh
missing missing
stamp-h1 stamp-h1
syslogd.service syslogd.service

View File

@ -19,6 +19,7 @@
AC_INIT([sysklogd], [2.0-beta1], [https://github.com/troglobit/sysklogd/issues],, AC_INIT([sysklogd], [2.0-beta1], [https://github.com/troglobit/sysklogd/issues],,
[https://github.com/troglobit/sysklogd]) [https://github.com/troglobit/sysklogd])
AM_INIT_AUTOMAKE([1.11 foreign]) AM_INIT_AUTOMAKE([1.11 foreign])
LT_INIT
AM_SILENT_RULES([yes]) AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([src/syslogd.c]) AC_CONFIG_SRCDIR([src/syslogd.c])
@ -26,6 +27,7 @@ AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
man/Makefile man/Makefile
src/Makefile src/Makefile
src/libsyslog.pc
test/Makefile test/Makefile
klogd.service klogd.service
syslogd.service]) syslogd.service])

4
src/.gitignore vendored
View File

@ -1,6 +1,10 @@
*.o *.o
*.lo
.libs/*
klogd klogd
logger logger
syslogd syslogd
syslog_tst syslog_tst
tsyslogd tsyslogd
libsyslog.la
libsyslog.pc

View File

@ -19,21 +19,31 @@ AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = logger bin_PROGRAMS = logger
sbin_PROGRAMS = syslogd klogd sbin_PROGRAMS = syslogd klogd
lib_LTLIBRARIES = libsyslog.la
AM_CFLAGS = -W -Wall -Wextra AM_CFLAGS = -W -Wall -Wextra
AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter
AM_CFLAGS += -fno-strict-aliasing -fno-strength-reduce AM_CFLAGS += -fno-strict-aliasing -fno-strength-reduce
syslogd_SOURCES = syslogd.c pidfile.c pidfile.h syslogd_SOURCES = syslogd.c syslog.h pidfile.c pidfile.h
syslogd_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE syslogd_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE
syslogd_LDADD = $(LIBS) $(LIBOBJS) syslogd_LDADD = $(LIBS) $(LIBOBJS)
klogd_SOURCES = klogd.c klogd.h syslog.c pidfile.c pidfile.h \ klogd_SOURCES = klogd.c klogd.h syslog.h pidfile.c pidfile.h \
ksym.c ksyms.h ksym_mod.c module.h ksym.c ksyms.h ksym_mod.c module.h
klogd_CPPFLAGS = -DALLOW_KERNEL_LOGGING -D_BSD_SOURCE -D_DEFAULT_SOURCE klogd_CPPFLAGS = -DALLOW_KERNEL_LOGGING -D_BSD_SOURCE -D_DEFAULT_SOURCE
klogd_LDADD = $(LIBS) $(LIBOBJS) klogd_LDADD = $(LIBS) $(LIBOBJS)
klogd_LDADD += libsyslog.la
logger_SOURCES = logger.c syslog.c logger_SOURCES = logger.c syslog.h
logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE
logger_LDADD = $(LIBS) $(LIBOBJS) logger_LDADD = $(LIBS) $(LIBOBJS)
logger_LDADD += libsyslog.la
pkgconfigdir = $(libdir)/pkgconfig
pkgincludedir = $(includedir)/syslog
pkgconfig_DATA = libsyslog.pc
pkginclude_HEADERS = syslog.h
libsyslog_la_SOURCES = syslog.c syslog.h
libsyslog_la_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE
libsyslog_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0

12
src/libsyslog.pc.in Normal file
View File

@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: @PACKAGE@
Description: RFC5424 compliant syslogp() API and syslog() replacement from sysklogd
Version: @VERSION@
Requires:
Libs: -L${libdir} -lsyslog
Cflags: -I${includedir}