-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
66 lines (55 loc) · 1.89 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([calf], [2.1], [[email protected]])
AM_INIT_AUTOMAKE([foreign no-exeext])
AC_CONFIG_SRCDIR([src/calf.c])
AC_CONFIG_HEADERS([config.h])
AC_ARG_ENABLE([timers],
AS_HELP_STRING([--enable-timers], [measure performance]),
[AC_DEFINE([USE_TIMERS], [1], [Display timings.])])
AC_ARG_WITH([fcgi],
AS_HELP_STRING([--with-fcgi], [support for FastCGI]),
[], [with_fcgi=check])
AC_ARG_WITH([systemd],
AS_HELP_STRING([--with-systemd], [support for systemd's socket activation]),
[], [with_systemd=check])
AC_PROG_CC_C99
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_HEADERS(
[unistd.h obstack.h],
[], [AC_MSG_ERROR([critical header missing])]
)
PKG_CHECK_MODULES([URIPARSER], [liburiparser])
have_fcgi=no
AS_IF([test "x$with_fcgi" != xno], [
have_fcgi=yes
AC_CHECK_LIB([fcgi], [FCGI_Accept], [], [have_fcgi=no])
AC_CHECK_HEADERS([fcgi_stdio.h], [], [have_fcgi=no])
])
AS_IF([test "x$with_fcgi" = xyes -a "x$have_fcgi" = xno], [
AC_MSG_ERROR([cannot find libfcgi])
])
AM_CONDITIONAL(FASTCGI, [test "x$have_fcgi" = xyes])
have_systemd=no
AS_IF([test "x$have_fcgi" = xno -a "x$with_systemd" = xyes], [
AC_MSG_ERROR([cannot enable socket activation without FastCGI support (please use --with-fcgi)])
])
AS_IF([test "x$have_fcgi" = xyes -a "x$with_systemd" != xno], [
PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
[have_systemd=yes
AC_DEFINE([HAVE_SYSTEMD], [1], [Support for systemd's socket activation.])],
[])
])
AS_IF([test "x$with_systemd" = xyes -a "x$have_systemd" = xno], [
AC_MSG_ERROR([cannot find libsystemd])
])
AM_CONDITIONAL([SYSTEMD], [test "x$have_systemd" = xyes])
AC_CONFIG_FILES([Makefile src/Makefile share/Makefile systemd/Makefile])
AC_OUTPUT
echo
echo '--- Summary ---'
echo "FastCGI support: $have_fcgi"
echo "systemd support: $have_systemd"
echo