diff --git a/Makefile.am b/Makefile.am index 846738b..b7cafda 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,7 +51,3 @@ release: distcheck # Workaround for systemd unit file duing distcheck DISTCHECK_CONFIGURE_FLAGS = --with-systemd=$$dc_install_base/$(systemd) - -# Disable parallel build in top Makefile, we might otherwise get a very -# bizarre build problem with strlcpy.o in libcompat and for syslogd. -.NOTPARALLEL: diff --git a/lib/pidfile.c b/lib/pidfile.c index 81f2315..8b5f517 100644 --- a/lib/pidfile.c +++ b/lib/pidfile.c @@ -31,6 +31,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include +#ifndef HAVE_PIDFILE + #define _GNU_SOURCE /* Needed with GLIBC to get asprintf() */ #include /* utimensat() */ #include /* utimensat() on *BSD */ @@ -54,7 +57,7 @@ const char *__pidfile_path = RUNSTATEDIR; const char *__pidfile_name = NULL; int -pidfile(const char *basename) +__pidfile(const char *basename) { int save_errno; int atexit_already; @@ -136,3 +139,6 @@ pidfile_cleanup(void) pidfile_path = NULL; } } + +weak_alias(__pidfile, pidfile); +#endif /* HAVE_PIDFILE */ diff --git a/lib/utimensat.c b/lib/utimensat.c index edf7e10..b68ce0e 100644 --- a/lib/utimensat.c +++ b/lib/utimensat.c @@ -15,7 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "config.h" +#include +#ifndef HAVE_UTIMENSAT #include #ifdef HAVE_FCNTL_H @@ -23,7 +24,8 @@ #endif #include /* lutimes(), utimes(), utimensat() */ -int utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int flags) +int +__utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int flags) { int ret = -1; struct timeval tv[2]; @@ -45,3 +47,7 @@ int utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int return ret; } + +weak_alias(__utimensat, utimensat); + +#endif /* HAVE_UTIMENSAT */ diff --git a/src/Makefile.am b/src/Makefile.am index 57fe786..207a137 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,6 @@ bin_PROGRAMS = sbin_PROGRAMS = syslogd lib_LTLIBRARIES = libsyslog.la -noinst_LTLIBRARIES = libcompat.la if ENABLE_LOGGER bin_PROGRAMS += logger @@ -48,10 +47,6 @@ logger_CPPFLAGS = $(AM_CPPFLAGS) -D_XOPEN_SOURCE=600 logger_LDADD = $(LIBS) $(LIBOBJS) logger_LDADD += libsyslog.la -# Convenience library for libsyslog instead of linking with $(LTLIBOBJS), -# which would pull in pidfile() and other (strong) symbols as well. -libcompat_la_SOURCES = ../lib/strlcpy.c ../lib/strlcat.c - pkgconfigdir = $(libdir)/pkgconfig pkgincludedir = $(includedir)/syslog pkgconfig_DATA = libsyslog.pc @@ -59,4 +54,4 @@ pkginclude_HEADERS = syslog.h libsyslog_la_SOURCES = syslog.c syslog.h compat.h libsyslog_la_CPPFLAGS = $(AM_CPPFLAGS) -D_XOPEN_SOURCE=600 libsyslog_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 -libsyslog_la_LIBADD = libcompat.la +libsyslog_la_LIBADD = $(LTLIBOJBS)