59afc15
diff -uap httpd-2.4.25/acinclude.m4.detectsystemd httpd-2.4.25/acinclude.m4
59afc15
diff -uap httpd-2.4.25/acinclude.m4.detectsystemd httpd-2.4.25/acinclude.m4
59afc15
diff -uap httpd-2.4.25/acinclude.m4.detectsystemd httpd-2.4.25/acinclude.m4
59afc15
--- httpd-2.4.25/acinclude.m4.detectsystemd
59afc15
+++ httpd-2.4.25/acinclude.m4
59afc15
@@ -604,6 +604,30 @@
94399e0
   fi
94399e0
 ])
94399e0
 
94399e0
+AC_DEFUN(APACHE_CHECK_SYSTEMD, [                                                                        
94399e0
+dnl Check for systemd support for listen.c's socket activation.
94399e0
+case $host in
94399e0
+*-linux-*)
94399e0
+   if test -n "$PKGCONFIG" && $PKGCONFIG --exists libsystemd; then
94399e0
+      SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd`
94399e0
+   elif test -n "$PKGCONFIG" && $PKGCONFIG --exists libsystemd-daemon; then
94399e0
+      SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd-daemon`
94399e0
+   else
94399e0
+      AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
94399e0
+   fi
94399e0
+   if test -n "$SYSTEMD_LIBS"; then
94399e0
+      AC_CHECK_HEADERS(systemd/sd-daemon.h)
94399e0
+      if test "${ac_cv_header_systemd_sd_daemon_h}" = "no" || test -z "${SYSTEMD_LIBS}"; then
94399e0
+        AC_MSG_WARN([Your system does not support systemd.])
94399e0
+      else
59afc15
+        APR_ADDTO(HTTPD_LIBS, [$SYSTEMD_LIBS])
94399e0
+        AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported])
94399e0
+      fi
94399e0
+   fi
94399e0
+   ;;
94399e0
+esac
94399e0
+])
94399e0
+
94399e0
 dnl
94399e0
 dnl APACHE_EXPORT_ARGUMENTS
94399e0
 dnl Export (via APACHE_SUBST) the various path-related variables that
59afc15
diff -uap httpd-2.4.25/configure.in.detectsystemd httpd-2.4.25/configure.in
59afc15
--- httpd-2.4.25/configure.in.detectsystemd
59afc15
+++ httpd-2.4.25/configure.in
59afc15
@@ -234,6 +234,7 @@
59afc15
   AC_MSG_NOTICE([Using external PCRE library from $PCRE_CONFIG])
59afc15
   APR_ADDTO(PCRE_INCLUDES, [`$PCRE_CONFIG --cflags`])
59afc15
   APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs`])
59afc15
+  APR_ADDTO(HTTPD_LIBS, [\$(PCRE_LIBS)])
59afc15
 else
59afc15
   AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/])
59afc15
 fi
59afc15
@@ -504,6 +510,8 @@
94399e0
     AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field])
94399e0
 fi
94399e0
 
94399e0
+APACHE_CHECK_SYSTEMD
94399e0
+
94399e0
 dnl ## Set up any appropriate OS-specific environment variables for apachectl
94399e0
 
94399e0
 case $host in
59afc15
@@ -668,6 +676,7 @@
59afc15
 APACHE_SUBST(BUILTIN_LIBS)
59afc15
 APACHE_SUBST(SHLIBPATH_VAR)
59afc15
 APACHE_SUBST(OS_SPECIFIC_VARS)
59afc15
+APACHE_SUBST(HTTPD_LIBS)
59afc15
 
59afc15
 PRE_SHARED_CMDS='echo ""'
59afc15
 POST_SHARED_CMDS='echo ""'
59afc15
--- httpd-2.4.25/Makefile.in.detectsystemd
59afc15
+++ httpd-2.4.25/Makefile.in
59afc15
@@ -4,7 +4,7 @@
59afc15
 
59afc15
 PROGRAM_NAME         = $(progname)
59afc15
 PROGRAM_SOURCES      = modules.c
59afc15
-PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
59afc15
+PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
59afc15
 PROGRAM_PRELINK      = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
59afc15
 PROGRAM_DEPENDENCIES = \
59afc15
   server/libmain.la \