-
Notifications
You must be signed in to change notification settings - Fork 24
/
configure.ac
160 lines (135 loc) · 4.43 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([mod_auth_pubtkt],[0.14],[https://github.com/manuelkasper/mod_auth_pubtkt])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/ap_compat.h])
AC_CONFIG_HEADERS([src/config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
if test -z "${APXS}"; then
AC_PATH_PROGS(APXS, apxs2 apxs, no, [$PATH:/usr/sbin:/usr/local/apache2/bin])
fi
if test "$APXS" = no; then
AC_MSG_ERROR([apxs not found: install it or provide the path --with-apxs])
fi
AC_SUBST(APXS)
if test x$CRYPTO = x; then
AC_CHECK_LIB([crypto], [EVP_md5], [CRYPTO="crypto"])
fi
if test x$CRYPTO != x; then
AC_DEFINE(HAVE_LIBCRYPTO, 1,
[Define to 1 if you have the OpenSSL library (-lcrypto or -leay32).])
LIBCRYPTO="-l${CRYPTO}"
AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_create,
AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [],
[Define to 1 if you have the 'EVP_MD_CTX_create' function.])
AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [],
[Define to 1 if you have the 'EVP_MD_CTX_destroy' function.]))
AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_new,
AC_DEFINE([HAVE_EVP_MD_CTX_NEW], [],
[Define to 1 if you have the 'EVP_MD_CTX_new' function.])
AC_DEFINE([HAVE_EVP_MD_CTX_FREE], [],
[Define to 1 if you have the 'EVP_MD_CTX_free' function.]))
fi
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h limits.h netinet/in.h string.h httpd.h ap_release.h])
dnl Update CFLAGS to add httpd includes
AP_INCLUDES="-I`${APXS} -q INCLUDEDIR`"
CFLAGS="$CFLAGS $AP_INCLUDES"
dnl Check the signature of ap_unescape_url_keep2f()
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <httpd.h>
]], [[int (f) (char *url, int decode_slashes) = ap_unescape_url_keep2f;]])],[AC_DEFINE(APACHE_UNESCAPE_HAS_LONG_ARGS, 1,
Define to 1 if ap_unescape_url_keep2f() takes 2 arguments)],[])
AC_MSG_CHECKING([Apache version])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <ap_release.h>
]], [[
char *version = AP_SERVER_BASEREVISION;
]])],[
APACHE_VER=2.0
],[
APACHE_VER=1.3
])
if test "$APACHE_VER" = "1.3" ; then
APACHE_VER=1.3
else
AC_MSG_CHECKING([whether we are on Apache 2.2.x])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <ap_release.h>]], [[
int main ()
{
return (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 2) ? 0 : 1;
}
]])]
,[
AC_MSG_RESULT([yes])
APACHE_VER=2.2
],[
AC_MSG_RESULT([no])
]
)
AC_MSG_CHECKING([whether we are on Apache 2.4.x])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <ap_release.h>]], [[
int main ()
{
return (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4) ? 0 : 1;
}
]])]
,[
AC_MSG_RESULT([yes])
APACHE_VER=2.4
],[
AC_MSG_RESULT([no])
]
)
fi
if test ! "$APACHE_VER" = "1.3" -a ! "$APACHE_VER" = "retry" ; then
AC_MSG_RESULT(${APACHE_VER})
fi
if test "$APACHE_VER" = "1.3"; then
AC_DEFINE(APACHE13, [],
[Compiling for Apache 1.3])
fi
AC_DEFINE([APACHE2],[],[Compiling for Apache >= 2.0 ])
if test "$APACHE_VER" = "2.2" ; then
CFLAGS="${CFLAGS} -DAPACHE22"
AC_DEFINE(APACHE22, [],
[Compiling for Apache >= 2.2 ])
fi
if test "$APACHE_VER" = "2.4" ; then
CFLAGS="${CFLAGS} -DAPACHE24"
AC_DEFINE([APACHE24], [1],
[Compiling for Apache >= 2.4 ])
fi
AC_MSG_NOTICE([Got Apache version $APACHE_VER])
dnl End trying to figure out Apache version
dnl Very helpful. Nicked from:
dnl https://github.com/maxmind/mod_maxminddb/blob/master/configure.ac
AC_DEFUN([AX_CHECK_CFLAGS],
[
AC_MSG_CHECKING([whether compiler accepts "$1"])
cat > conftest.c << EOF
int main(){
return 0;
}
EOF
if $CC $CFLAGS -o conftest.o conftest.c [$1] > /dev/null 2>&1
then
AC_MSG_RESULT([yes])
CFLAGS="${CFLAGS} [$1]"
[$2]
else
AC_MSG_RESULT([no])
[$3]
fi
])dnl AX_CHECK_CFLAGS
AX_CHECK_CFLAGS([-std=c99 -fms-extensions])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_CHECK_FUNCS([strcasecmp strchr strstr])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT