You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2013/10/01 12:15:13 UTC
svn commit: r1528032 - in /httpd/httpd/trunk: configure.in
modules/arch/unix/config5.m4 server/listen.c
Author: jorton
Date: Tue Oct 1 10:15:12 2013
New Revision: 1528032
URL: http://svn.apache.org/r1528032
Log:
* configure.in: Simplify/fix systemd detection: move later to fix
autoconf warnings; define HAVE_SYSTEMD rather than using CPPFLAGS.
* server/listen.c: Use HAVE_SYSTEMD for systemd #define.
* modules/arch/unix/config5.m4: Update systemd headers check.
Modified:
httpd/httpd/trunk/configure.in
httpd/httpd/trunk/modules/arch/unix/config5.m4
httpd/httpd/trunk/server/listen.c
Modified: httpd/httpd/trunk/configure.in
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/configure.in?rev=1528032&r1=1528031&r2=1528032&view=diff
==============================================================================
--- httpd/httpd/trunk/configure.in (original)
+++ httpd/httpd/trunk/configure.in Tue Oct 1 10:15:12 2013
@@ -322,15 +322,6 @@ case $host in
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
;;
*-linux-*)
- AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
- AC_CHECK_HEADERS(systemd/sd-daemon.h, [ap_HAVE_SD_DAEMON_H="yes"], [ap_HAVE_SD_DAEMON_H="no"])
- if test $ap_HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then
- AC_MSG_WARN([Your system does not support systemd.])
- else
- APR_ADDTO(LIBS, $SYSTEMD_LIBS)
- APR_ADDTO(INTERNAL_CPPFLAGS, [-DAP_SYSTEMD_SUPPORT])
- fi
-
case `uname -r` in
# Unserialized accept() was not recommended until Linux 2.2.
[[01]].* | 2.[[01]]* )
@@ -522,6 +513,19 @@ if test "$ac_cv_struct_tm_gmtoff" = "yes
AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field])
fi
+dnl Check for systemd support for listen.c's socket activation.
+case $host in
+*-linux-*)
+ AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
+ AC_CHECK_HEADERS(systemd/sd-daemon.h)
+ if test "${ac_cv_header_systemd_sd_daemon_h}" = "no" || test -z "${SYSTEMD_LIBS}"; then
+ AC_MSG_WARN([Your system does not support systemd.])
+ else
+ APR_ADDTO(LIBS, $SYSTEMD_LIBS)
+ AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported])
+ fi
+esac
+
dnl ## Set up any appropriate OS-specific environment variables for apachectl
case $host in
Modified: httpd/httpd/trunk/modules/arch/unix/config5.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/unix/config5.m4?rev=1528032&r1=1528031&r2=1528032&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/unix/config5.m4 (original)
+++ httpd/httpd/trunk/modules/arch/unix/config5.m4 Tue Oct 1 10:15:12 2013
@@ -21,7 +21,7 @@ APACHE_MODULE(privileges, Per-virtualhos
])
APACHE_MODULE(systemd, Systemd support, , , all, [
- if test $ap_HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then
+ if test "${ac_cv_header_systemd_sd_daemon_h}" = "no" || test -z "${SYSTEMD_LIBS}"; then
AC_MSG_WARN([Your system does not support systemd.])
enable_systemd="no"
else
Modified: httpd/httpd/trunk/server/listen.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/listen.c?rev=1528032&r1=1528031&r2=1528032&view=diff
==============================================================================
--- httpd/httpd/trunk/server/listen.c (original)
+++ httpd/httpd/trunk/server/listen.c Tue Oct 1 10:15:12 2013
@@ -28,7 +28,7 @@
#include "http_log.h"
#include "mpm_common.h"
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
@@ -42,7 +42,7 @@ static ap_listen_rec *old_listeners;
static int ap_listenbacklog;
static int send_buffer_size;
static int receive_buffer_size;
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
static int use_systemd;
#endif
@@ -249,7 +249,7 @@ static apr_status_t close_listeners_on_e
}
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
static apr_status_t alloc_systemd_listener(process_rec * process,
int fd,
@@ -371,7 +371,7 @@ static int open_systemd_listeners(proces
return 0;
}
-#endif /* AP_SYSTEMD_SUPPORT */
+#endif /* HAVE_SYSTEMD */
static const char *alloc_listener(process_rec *process, char *addr,
apr_port_t port, const char* proto,
@@ -692,7 +692,7 @@ AP_DECLARE(int) ap_setup_listeners(serve
}
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
if (use_systemd) {
if (open_systemd_listeners(s->process) != 0) {
return 0;
@@ -778,7 +778,7 @@ AP_DECLARE_NONSTD(const char *) ap_set_l
}
if (strcmp("systemd", argv[0]) == 0) {
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
use_systemd = 1;
if (ap_listeners != NULL) {
return "systemd socket activation support must be used exclusive of normal listeners.";
@@ -789,7 +789,7 @@ AP_DECLARE_NONSTD(const char *) ap_set_l
#endif
}
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
if (use_systemd) {
return "systemd socket activation support must be used exclusive of normal listeners.";
}