-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.in
219 lines (147 loc) · 4.1 KB
/
configure.in
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
dnl Process this file with autoconf to produce a configure script.
AC_INIT(wwwoffle,2.9)
dnl Specify the autoconf file.
AC_CONFIG_HEADER(src/autoconfig.h)
m4_include(m4/etr_socket_nsl.m4)
m4_include(m4/gnutls.m4)
m4_include(m4/gcrypt.m4)
m4_include(m4/zlib.m4)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LEX
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_MAKE_SET
AC_CHECK_PROGS(TAR,gnutar gtar tar,tar)
AC_CHECK_PROG(PERL,perl,perl)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h sys/param.h sys/statvfs.h sys/vfs.h)
AC_CHECK_HEADERS(sys/mount.h,,,
[
#if SYS_PARAM_H
#include <sys/param.h>
#endif
])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TIMEZONE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_BLKSIZE
dnl Checks for libraries.
ETR_SOCKET_NSL
LIBS="$LIBS $ETR_SOCKET_LIBS"
dnl Checks for library functions.
AC_CHECK_FUNCS(getaddrinfo getnameinfo)
AC_CHECK_FUNCS(statfs statvfs)
if test "$ac_cv_func_statfs" = "no"; then
if test "$ac_cv_func_statvfs" = "no"; then
AC_MSG_ERROR([Neither of the two functions statfs or statvfs are available])
fi
fi
AC_CHECK_FUNCS(setresuid setresgid getresuid getresgid setreuid setregid setgroups)
PKG_CHECK_ZLIB
PKG_CHECK_GNUTLS
PKG_CHECK_GCRYPT
dnl Checks for using IPv6.
AC_ARG_WITH(ipv6,
[ --with-ipv6 Enable the use of IPv6 sockets],
WITH_IPV6=$withval,WITH_IPV6=yes)
if test "$WITH_IPV6" = "no"; then
USE_IPV6=0
else
USE_IPV6=1
AC_MSG_CHECKING(for IPv6 support)
if test "$ac_cv_func_getnameinfo" = "no"; then
AC_MSG_RESULT([no, cannot find getnameinfo() function])
USE_IPV6=0
elif test "$ac_cv_func_getaddrinfo" = "no"; then
AC_MSG_RESULT([no, cannot find getaddrinfo() function])
USE_IPV6=0
else
AC_MSG_RESULT(yes)
fi
fi
AC_DEFINE_UNQUOTED(USE_IPV6,$USE_IPV6,[enable ipv6])
dnl Check for Cygwin.
AC_CYGWIN
if test "$CYGWIN" = "yes"; then
install_win32=install-win32
else
install_win32=
fi
AC_SUBST(install_win32)
dnl The WWWOFFLE specific settings that we need.
AC_ARG_WITH(spooldir,
[ --with-spooldir=directory Set the default spool directory],
SPOOLDIR=$withval,)
if test "x$SPOOLDIR" = "x"; then
SPOOLDIR=/var/cache/wwwoffle
fi
AC_DEFINE_UNQUOTED(DEF_SPOOLDIR,"$SPOOLDIR",[default spool directory])
AC_SUBST(SPOOLDIR)
AC_ARG_WITH(confdir,
[ --with-confdir=directory Set the default config file directory],
CONFDIR=$withval,)
if test "x$CONFDIR" = "x"; then
CONFDIR=/etc/wwwoffle
fi
AC_DEFINE_UNQUOTED(DEF_CONFDIR,"$CONFDIR", [default config directory])
AC_SUBST(CONFDIR)
AC_ARG_WITH(server,
[ --with-server=host:port:port:port Set the default host, HTTP port, WWWOFFLE port and HTTPS port],
SERVER=$withval,)
if test "x$SERVER" = "x"; then
SERVER=localhost:8080:8081:8443
fi
LOCALHOST=`echo $SERVER | awk -F: '{print $1}'`
if test "x$LOCALHOST" = "x"; then
LOCALHOST=localhost
fi
HTTP_PORT=`echo $SERVER | awk -F: '{print $2}'`
if test "x$HTTP_PORT" = "x"; then
HTTP_PORT=8080
fi
WWWOFFLE_PORT=`echo $SERVER | awk -F: '{print $3}'`
if test "x$WWWOFFLE_PORT" = "x"; then
WWWOFFLE_PORT=8081
fi
HTTPS_PORT=`echo $SERVER | awk -F: '{print $4}'`
if test "x$HTTPS_PORT" = "x"; then
HTTPS_PORT=8443
fi
AC_SUBST(LOCALHOST)
AC_SUBST(HTTP_PORT)
AC_SUBST(HTTPS_PORT)
AC_SUBST(WWWOFFLE_PORT)
dnl Language settings.
AC_MSG_CHECKING(the default language)
LANGUAGES="de en es fr it nl pl ru"
AC_SUBST(LANGUAGES)
AC_ARG_WITH(default-language,
[ --with-default-language=lang Set the default language to install],
WITH_LANG=$withval,WITH_LANG=en)
DEFLANG=
for lang in $LANGUAGES; do
if test "$WITH_LANG" = $lang; then
DEFLANG=$lang
fi
done
if test "x$DEFLANG" = "x"; then
AC_MSG_ERROR([Invalid value $WITH_LANG for default language, choose from: $LANGUAGES.])
else
AC_MSG_RESULT($DEFLANG)
fi
AC_SUBST(DEFLANG)
dnl Checks for installation location.
dnl Create the output files.
AC_OUTPUT(
Makefile
cache/Makefile
conf/Makefile
doc/Makefile
src/Makefile
src/testprogs/Makefile
src/autoconfig.h.in
)