1
# Copyright (c) 2008 BBN Technologies Corp. All rights reserved.
3
# Redistribution and use in source and binary forms, with or without
4
# modification, are permitted provided that the following conditions
6
# 1. Redistributions of source code must retain the above copyright
7
# notice, this list of conditions and the following disclaimer.
8
# 2. Redistributions in binary form must reproduce the above copyright
9
# notice, this list of conditions and the following disclaimer in the
10
# documentation and/or other materials provided with the distribution.
11
# 3. Neither the name of BBN Technologies nor the names of its contributors
12
# may be used to endorse or promote products derived from this software
13
# without specific prior written permission.
15
# THIS SOFTWARE IS PROVIDED BY BBN TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
16
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
# ARE DISCLAIMED. IN NO EVENT SHALL BBN TECHNOLOGIES OR CONTRIBUTORS BE
19
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
# POSSIBILITY OF SUCH DAMAGE.
27
AC_INIT([svnstsw], [1.4])
29
AC_CONFIG_SRCDIR([src/main.c])
30
AC_CONFIG_AUX_DIR([conf])
31
AC_CONFIG_MACRO_DIR([conf])
38
doc/man/svnstsw_exec_svnserve.3
39
doc/man/svnstsw_get_tunnel_user_name.3
40
doc/man/svnstsw_fso_is_changeable.3
44
AC_CONFIG_HEADERS([src/config.h])
45
AH_BOTTOM([#include <svnstsw_compat.h>])
47
AM_INIT_AUTOMAKE([foreign 1.10])
50
# Test for a C99 compiler. Features in use:
52
# * declare variables after start
53
# * variable-length arrays
54
# * C++-style comments
57
STSW_FUNC_SNPRINTF_BROKEN
58
if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$snprintf_broken" = "xyes" ; then
59
AC_MSG_ERROR([Your C compiler does not support some of the required C99 features.])
65
# Test for the reentrant POSIX functions we use
66
AC_CHECK_FUNCS([getpwuid_r getpwnam_r], [],
67
[AC_MSG_ERROR([A required function was not found on your system.])])
68
AC_CHECK_FUNCS([getlogin_r], [], [AC_MSG_WARN([
70
If multiple users share the same user ID on this system, svnserve
71
may use the wrong username as the argument to svnserve's
72
'--tunnel-user' parameter. This is because the POSIX function
73
getlogin_r() was not found on your system. The function
74
getpwuid_r() will be used instead, which means that another
75
username corresponding to the shared UID may be returned by
76
svnstsw_get_tunnel_user_name().
79
# Have autoconf tests modify the following variables rather than
80
# CPPFLAGS, CFLAGS, etc. This allows automake .am files to override
81
# these flags (by appending to them) without overriding user-specified
83
AC_SUBST([CONFIGURECPPFLAGS])
84
AC_SUBST([CONFIGURECFLAGS])
85
AC_SUBST([CONFIGURECXXFLAGS])
86
AC_SUBST([CONFIGURELDFLAGS])
87
AC_SUBST([CONFIGURELIBTOOLFLAGS])
89
# increase compiler strictness
90
if test "x$GCC" = "xyes" ; then
91
CONFIGURECFLAGS="-Wall -Werror $CONFIGURECFLAGS"
93
if test "x$GXX" = "xyes" ; then
94
CONFIGURECXXFLAGS="-Wall -Werror $CONFIGURECXXFLAGS"
97
# The following makes sure that the include subdirectory is included,
98
# even in VPATH builds. Unfortunately, autoconf doesn't define a
99
# shell variable containing the absolute path to the top source
100
# directory (at least it's not documented), so we can't use that here.
101
# However, it does have a preset *ouput* variable. The following
102
# causes a literal '-I${top_srcdir}/include' to appear in the
103
# definition of the CONFIGURECPPFLAGS variable. The '${top_srcdir}'
104
# is then substituted by make. Unfortunately, this is somewhat
105
# broken: If we want to do further autoconf tests using this include,
106
# the '${top_srcdir}' either won't be substituted or it will be
107
# substituted with an empty string since there is no 'top_srcdir'
108
# shell variable defined by autoconf. TODO: figure out a way around
111
CONFIGURECPPFLAGS="-I\${top_srcdir}/include $CONFIGURECPPFLAGS"
114
STSW_LIB_APR([0\.9\.@<:@7-9@:>@ 0\.9\.1@<:@0-9@:>@ 1\.])
115
CONFIGURECPPFLAGS="$STSW_APR_CPPFLAGS $STSW_APR_INCLUDES $CONFIGURECPPFLAGS"
116
CONFIGURECFLAGS="$STSW_APR_CFLAGS $CONFIGURECFLAGS"
117
CONFIGURELDFLAGS="$STSW_APR_LDFLAGS $STSW_APR_LIBS $CONFIGURELDFLAGS"
119
# find doxygen for generating the source code documentation
121
DOXYFILE_PREDEFINED="$DOXYFILE_PREDEFINED HAVE_CONFIG_H=1"
123
# Test for the location of svnserve
127
[--with-svnserve=/path/to/svnserve],
129
[Full path to the svnserve executable. This string will be
130
used literally to start svnserve; e.g.,
131
execl("/given/path/to/svnserve", ...). For security reasons,
132
this can not be a relative path -- it must start with "/".
133
Note that this path can point to any executable that accepts
134
svnserve's arguments, such as another svnserve wrapper. Do
135
not provide a path to a script unless you are fully aware of
136
the security problems that arise when a script is run as a
137
different user. If left unspecified, configure will search
138
the PATH for svnserve.])],
141
if test "x$withval" = "xyes" ; then
142
AC_PATH_PROG([SVNSERVE], [svnserve])
144
AC_MSG_CHECKING([for svnserve])
146
AC_MSG_RESULT([$SVNSERVE])
150
AC_PATH_PROG([SVNSERVE], [svnserve])
158
AC_MSG_ERROR([You must specify a full path to the svnserve executable using "--with-svnserve=/path/to/svnserve"])
161
AC_DEFINE_UNQUOTED([SVNSERVE], ["$SVNSERVE"], [Define to the desired svnserve binary to run.])
163
# Ask user if root override is acceptable
164
stsw_root_override=yes
166
[svnserve-root-override],
168
[--disable-svnserve-root-override],
170
[Tell svnstsw to ignore the -r and --root command-line
171
options. This prevents a user from specifying a virtual root
172
path, ensuring that the default path (given by
173
--with-svnserve-root-default) is always passed to the
174
svnserve executable (given by --with-svnserve) using
175
svnserve's --root command-line option. Allowing a user to
176
specify a different virtual root could be a security concern
177
if there is a repository that is accessible to the svnstsw
178
wrapper and that repository uses a username namespace that is
179
different from the system username namespace.])],
182
if test "x$enableval" != "xyes" ; then
183
stsw_root_override=no
186
AC_MSG_CHECKING([if users should be allowed to override the default repository virtual root])
187
stsw_root_override_bool=1
188
if test "x$stsw_root_override" = "xno" ; then
189
stsw_root_override_bool=0
191
AC_DEFINE_UNQUOTED([ALLOW_SVNSERVE_ROOT_OVERRIDE], [$stsw_root_override_bool], [Define to 1 if svnstsw should honor the -r and --root command-line arguments, 0 otherwise.])
192
AC_MSG_RESULT([$stsw_root_override])
194
# Ask the user for the default svn repository root
197
[svnserve-root-default],
199
[--with-svnserve-root-default=/path/to/svn/virtual/root],
201
[Specify the default path to pass as the argument to
202
svnserve's --root command-line option. The given path will
203
be passed to svnserve if the user of svnstsw does not pass -r
204
or --root to svnstsw or if svnstsw is configured to prevent
205
users from specifying a virtual root path (via
206
--disable-svnserve-root-override). If unspecified, "/" is
210
if test "x$withval" != "xyes" && test "x$withval" != "xno" ; then
211
stsw_root_default=$withval
214
AC_MSG_CHECKING([for the default repository virtual root path])
215
AC_DEFINE_UNQUOTED([SVNSERVE_DEFAULT_ROOT], ["$stsw_root_default"], [Define to the desired default repository virtual root path.])
216
AC_MSG_RESULT([$stsw_root_default])
218
# Ask the user for the file mode creation mask
223
[--with-umask=<mode_t expression>],
225
[Specify the file mode creation mask to use when the program
226
is run. This must be a C constant expression with a type
227
that is compatible with mode_t (see the umask(3) man page and
228
<sys/stat.h>). If unspecified, "S_IRWXO" is used (which
229
disables read, write, and execute for others/world and allows
230
read, write, and execute for the user and group).])],
233
if test "x$withval" != "xyes" && test "x$withval" != "xno" ; then
237
AC_MSG_CHECKING([for the file mode creation mask])
238
AC_DEFINE_UNQUOTED([SVNSTSW_UMASK()], [($stsw_umask)], [Define to the desired file mode creation mask.])
239
AC_MSG_RESULT([$stsw_umask])