diff --git a/.gitignore b/.gitignore index 3618361..1b8fe98 100644 --- a/.gitignore +++ b/.gitignore @@ -10,12 +10,16 @@ aclocal.m4 autom4te.cache compile config.h* +config.guess config.log config.status +config.sub configure depcomp install-sh klogd.service +libtool +ltmain.sh missing stamp-h1 syslogd.service diff --git a/configure.ac b/configure.ac index 11b1c6f..32f2a53 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,7 @@ AC_INIT([sysklogd], [2.0-beta1], [https://github.com/troglobit/sysklogd/issues],, [https://github.com/troglobit/sysklogd]) AM_INIT_AUTOMAKE([1.11 foreign]) +LT_INIT AM_SILENT_RULES([yes]) AC_CONFIG_SRCDIR([src/syslogd.c]) @@ -26,6 +27,7 @@ AC_CONFIG_HEADER([config.h]) AC_CONFIG_FILES([Makefile man/Makefile src/Makefile + src/libsyslog.pc test/Makefile klogd.service syslogd.service]) diff --git a/src/.gitignore b/src/.gitignore index dd37664..9a0d0d8 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,6 +1,10 @@ *.o +*.lo +.libs/* klogd logger syslogd syslog_tst tsyslogd +libsyslog.la +libsyslog.pc diff --git a/src/Makefile.am b/src/Makefile.am index bbd9a0b..7a6213a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,21 +19,31 @@ AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = logger sbin_PROGRAMS = syslogd klogd +lib_LTLIBRARIES = libsyslog.la AM_CFLAGS = -W -Wall -Wextra AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter 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_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 klogd_CPPFLAGS = -DALLOW_KERNEL_LOGGING -D_BSD_SOURCE -D_DEFAULT_SOURCE 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_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 diff --git a/src/libsyslog.pc.in b/src/libsyslog.pc.in new file mode 100644 index 0000000..0c8c55a --- /dev/null +++ b/src/libsyslog.pc.in @@ -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} +