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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1528032 13f79535-47bb-0310-9956-
ffa450edef68
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]]* )
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
])
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
#include "http_log.h"
#include "mpm_common.h"
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
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
}
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
static apr_status_t alloc_systemd_listener(process_rec * process,
int fd,
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,
}
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
if (use_systemd) {
if (open_systemd_listeners(s->process) != 0) {
return 0;
}
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.";
#endif
}
-#ifdef AP_SYSTEMD_SUPPORT
+#ifdef HAVE_SYSTEMD
if (use_systemd) {
return "systemd socket activation support must be used exclusive of normal listeners.";
}