Blame SOURCES/httpd-2.4.35-detect-systemd.patch

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