0e3136
diff --git a/Makefile.in b/Makefile.in
0e3136
index 0b088ac..9eeb5c7 100644
0e3136
--- a/Makefile.in
0e3136
+++ b/Makefile.in
0e3136
@@ -4,7 +4,7 @@ CLEAN_SUBDIRS = test
0e3136
 
0e3136
 PROGRAM_NAME         = $(progname)
0e3136
 PROGRAM_SOURCES      = modules.c
0e3136
-PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
0e3136
+PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
0e3136
 PROGRAM_PRELINK      = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
0e3136
 PROGRAM_DEPENDENCIES = \
0e3136
   server/libmain.la \
0e3136
diff --git a/acinclude.m4 b/acinclude.m4
0e3136
index 2a7e5d1..eb28321 100644
0e3136
--- a/acinclude.m4
0e3136
+++ b/acinclude.m4
0e3136
@@ -624,6 +624,7 @@ case $host in
0e3136
       if test "${ac_cv_header_systemd_sd_daemon_h}" = "no" || test -z "${SYSTEMD_LIBS}"; then
0e3136
         AC_MSG_WARN([Your system does not support systemd.])
0e3136
       else
0e3136
+        APR_ADDTO(HTTPD_LIBS, [$SYSTEMD_LIBS])
0e3136
         AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported])
0e3136
       fi
0e3136
    fi
0e3136
diff --git a/configure.in b/configure.in
0e3136
index 3618a5a..74a782b 100644
0e3136
--- a/configure.in
0e3136
+++ b/configure.in
0e3136
@@ -234,6 +234,7 @@ if test "$PCRE_CONFIG" != "false"; then
0e3136
   AC_MSG_NOTICE([Using external PCRE library from $PCRE_CONFIG])
0e3136
   APR_ADDTO(PCRE_INCLUDES, [`$PCRE_CONFIG --cflags`])
0e3136
   APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs`])
0e3136
+  APR_ADDTO(HTTPD_LIBS, [\$(PCRE_LIBS)])
0e3136
 else
0e3136
   AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/])
0e3136
 fi
0e3136
@@ -710,6 +711,7 @@ APACHE_SUBST(OS_DIR)
0e3136
 APACHE_SUBST(BUILTIN_LIBS)
0e3136
 APACHE_SUBST(SHLIBPATH_VAR)
0e3136
 APACHE_SUBST(OS_SPECIFIC_VARS)
0e3136
+APACHE_SUBST(HTTPD_LIBS)
0e3136
 
0e3136
 PRE_SHARED_CMDS='echo ""'
0e3136
 POST_SHARED_CMDS='echo ""'