~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/server-side/svnstsw/configure.ac

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 2008 BBN Technologies Corp.  All rights reserved.
2
 
#
3
 
# Redistribution and use in source and binary forms, with or without
4
 
# modification, are permitted provided that the following conditions
5
 
# are met:
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.
14
 
#
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.
26
 
 
27
 
AC_INIT([svnstsw], [1.4])
28
 
AC_PREREQ([2.61])
29
 
AC_CONFIG_SRCDIR([src/main.c])
30
 
AC_CONFIG_AUX_DIR([conf])
31
 
AC_CONFIG_MACRO_DIR([conf])
32
 
AC_CONFIG_FILES([
33
 
    Makefile
34
 
    doc/Doxyfile-html
35
 
    doc/Makefile
36
 
    doc/man/libsvnstsw.3
37
 
    doc/man/svnstsw.8
38
 
    doc/man/svnstsw_exec_svnserve.3
39
 
    doc/man/svnstsw_get_tunnel_user_name.3
40
 
    doc/man/svnstsw_fso_is_changeable.3
41
 
    include/Makefile
42
 
    src/Makefile
43
 
  ])
44
 
AC_CONFIG_HEADERS([src/config.h])
45
 
AH_BOTTOM([#include <svnstsw_compat.h>])
46
 
 
47
 
AM_INIT_AUTOMAKE([foreign 1.10])
48
 
AM_MAINTAINER_MODE
49
 
 
50
 
# Test for a C99 compiler.  Features in use:
51
 
#   * _Bool
52
 
#   * declare variables after start
53
 
#   * variable-length arrays
54
 
#   * C++-style comments
55
 
AC_PROG_CC_C99
56
 
#   * snprintf
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.])
60
 
fi
61
 
 
62
 
AC_PROG_LIBTOOL
63
 
AC_PROG_INSTALL
64
 
 
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([
69
 
 
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().
77
 
])])
78
 
 
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
82
 
# flags.
83
 
AC_SUBST([CONFIGURECPPFLAGS])
84
 
AC_SUBST([CONFIGURECFLAGS])
85
 
AC_SUBST([CONFIGURECXXFLAGS])
86
 
AC_SUBST([CONFIGURELDFLAGS])
87
 
AC_SUBST([CONFIGURELIBTOOLFLAGS])
88
 
 
89
 
# increase compiler strictness
90
 
if test "x$GCC" = "xyes" ; then
91
 
    CONFIGURECFLAGS="-Wall -Werror $CONFIGURECFLAGS"
92
 
fi
93
 
if test "x$GXX" = "xyes" ; then
94
 
    CONFIGURECXXFLAGS="-Wall -Werror $CONFIGURECXXFLAGS"
95
 
fi
96
 
 
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
109
 
# this.
110
 
#
111
 
CONFIGURECPPFLAGS="-I\${top_srcdir}/include $CONFIGURECPPFLAGS"
112
 
 
113
 
# find libapr
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"
118
 
 
119
 
# find doxygen for generating the source code documentation
120
 
STSW_PROG_DOXYGEN
121
 
DOXYFILE_PREDEFINED="$DOXYFILE_PREDEFINED HAVE_CONFIG_H=1"
122
 
 
123
 
# Test for the location of svnserve
124
 
AC_ARG_WITH(
125
 
    [svnserve],
126
 
    [AS_HELP_STRING(
127
 
        [--with-svnserve=/path/to/svnserve],
128
 
 
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.])],
139
 
 
140
 
    [
141
 
        if test "x$withval" = "xyes" ; then
142
 
            AC_PATH_PROG([SVNSERVE], [svnserve])
143
 
        else
144
 
            AC_MSG_CHECKING([for svnserve])
145
 
            SVNSERVE=$withval
146
 
            AC_MSG_RESULT([$SVNSERVE])
147
 
        fi
148
 
    ],
149
 
    [
150
 
        AC_PATH_PROG([SVNSERVE], [svnserve])
151
 
    ])
152
 
case "$SVNSERVE" in
153
 
    /*)
154
 
        # absolute path
155
 
        ;;
156
 
    *)
157
 
        # relative path
158
 
        AC_MSG_ERROR([You must specify a full path to the svnserve executable using "--with-svnserve=/path/to/svnserve"])
159
 
        ;;
160
 
esac
161
 
AC_DEFINE_UNQUOTED([SVNSERVE], ["$SVNSERVE"], [Define to the desired svnserve binary to run.])
162
 
 
163
 
# Ask user if root override is acceptable
164
 
stsw_root_override=yes
165
 
AC_ARG_ENABLE(
166
 
    [svnserve-root-override],
167
 
    [AS_HELP_STRING(
168
 
        [--disable-svnserve-root-override],
169
 
 
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.])],
180
 
 
181
 
    [
182
 
        if test "x$enableval" != "xyes" ; then
183
 
            stsw_root_override=no
184
 
        fi
185
 
    ])
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
190
 
fi
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])
193
 
 
194
 
# Ask the user for the default svn repository root
195
 
stsw_root_default=/
196
 
AC_ARG_WITH(
197
 
    [svnserve-root-default],
198
 
    [AS_HELP_STRING(
199
 
        [--with-svnserve-root-default=/path/to/svn/virtual/root],
200
 
 
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
207
 
         used.])],
208
 
 
209
 
    [
210
 
        if test "x$withval" != "xyes" && test "x$withval" != "xno" ; then
211
 
            stsw_root_default=$withval
212
 
        fi
213
 
    ])
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])
217
 
 
218
 
# Ask the user for the file mode creation mask
219
 
stsw_umask="S_IRWXO"
220
 
AC_ARG_WITH(
221
 
    [umask],
222
 
    [AS_HELP_STRING(
223
 
        [--with-umask=<mode_t expression>],
224
 
 
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).])],
231
 
 
232
 
    [
233
 
        if test "x$withval" != "xyes" && test "x$withval" != "xno" ; then
234
 
            stsw_umask=$withval
235
 
        fi
236
 
    ])
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])
240
 
 
241
 
AC_OUTPUT