1 dnl configure.in for cvs
3 AM_INIT_AUTOMAKE(cvs, 1.11.1p1)
6 AM_CONFIG_HEADER(config.h src/options.h)
12 # Automake's more advanced version of AC_PROG_RANLIB
17 AC_PATH_PROG(PERL, perl, no)
18 AC_PATH_PROG(CSH, csh, no)
19 AC_PATH_PROG(PR, pr, no)
21 if test x"$PR" != xno; then
22 AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR"], [Path to the pr utility])
25 dnl FIXME This is truly gross.
26 missing_dir=`cd $ac_aux_dir && pwd`
27 dnl FIXME I pulled this default list from sanity.sh. Perhaps these lists
28 dnl can be stored in one location?
29 glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
30 AC_PATH_PROGS(ROFF, groff roff, $missing_dir/missing roff, $glocs)
31 AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
32 AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)
35 if test X"$ac_cv_sys_interpreter" != X"yes" ; then
36 # silly trick to avoid problems in AC macros...
37 ac_msg='perl scripts using #! may not be invoked properly'
41 # BSD's logo is a devil for a reason, hey?
42 AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
43 [if test ! -d ac_test_dir ; then
44 AC_TRY_COMMAND([mkdir ac_test_dir])
46 cat >conftestmake <<EOF
48 ac_test_target: ac_test_dep
49 echo BSD VPATH bug present >&2
50 ac_test_dep: ac_test_dep_dep
52 touch ac_test_dir/ac_test_dep_dep
53 touch ac_test_dir/ac_test_dep
55 # Don't know why, but the following test doesn't work under FreeBSD 4.2
56 # without this sleep command
58 if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
59 ccvs_cv_bsd_make_vpath_bug=yes
61 ccvs_cv_bsd_make_vpath_bug=no
63 AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
64 # We also don't need to worry about the bug when $srcdir = $builddir
65 AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
66 test $ccvs_cv_bsd_make_vpath_bug = no \
72 if test "$ISC" = yes; then
73 CFLAGS="$CFLAGS -D_SYSV3"
80 AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
82 sys/param.h sys/select.h sys/time.h sys/timeb.h \
83 io.h direct.h sys/bsdtypes.h sys/resource.h syslog.h)
96 AC_REPLACE_FUNCS(mkdir rename strstr dup2 strerror valloc waitpid memmove strtoul)
124 # we only need one of the following
132 dnl The CVS coding standard (as specified in HACKING) is that if it exists
133 dnl in SunOS4 and ANSI, we use it. CVS itself, of course, therefore doesn't
134 dnl need HAVE_* defines for such functions, but diff wants them.
136 AC_DEFINE(HAVE_STRCHR)
137 AC_DEFINE(HAVE_MEMCHR)
140 dnl Force lib/regex.c to use malloc instead of messing around with alloca
141 dnl and define the old re_comp routines that we use.
143 AC_DEFINE(REGEX_MALLOC)
144 AC_DEFINE(_REGEX_RE_COMP)
146 dnl AC_FUNC_VFORK is rather baroque. It seems to be rather more picky
147 dnl than, say, the Single Unix Specification (version 2), which simplifies
148 dnl a lot of cases by saying that the child process can't set any variables
149 dnl (thus avoiding problems with register allocation) or call any functions
150 dnl (thus avoiding problems with whether file descriptors are shared).
151 dnl It would be nice if we could just write to the Single Unix Specification.
152 dnl I think the only way to do redirection this way is by doing it in the
153 dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
154 dnl That would appear to have a race condition if the user hits ^C (or
155 dnl some other signal) at the wrong time, as main_cleanup will try to use
156 dnl stdout/stderr. So maybe we are stuck with AC_FUNC_VFORK.
159 AC_FUNC_CLOSEDIR_VOID
162 dnl Check for shadow password support.
164 dnl We used to try to determine whether shadow passwords were actually in
165 dnl use or not, but the code has been changed to work right reguardless,
166 dnl so we can go back to a simple check.
167 AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM))
170 AC_SYS_LONG_FILE_NAMES
173 if test "$ac_cv_func_fnmatch_works" = no; then
174 LIBOBJS="$LIBOBJS fnmatch.o"
177 # Try to find connect and gethostbyname.
178 AC_CHECK_LIB(nsl, main,
179 AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT),, -lnsl),
180 AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT)))
181 AC_SEARCH_LIBS(gethostbyname, netinet nsl)
184 dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
186 dnl If you change this, keep in mind that some systems have a bogus
187 dnl libkrb in the system libraries, so --with-krb4=value needs to
188 dnl override the system -lkrb.
193 [ --with-krb4=value set default \$(KRB4) from value],
196 echo "default place for krb4 is $KRB4"
201 AC_MSG_CHECKING([for krb.h])
202 if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
204 CFLAGS="$CFLAGS -I$KRB4/include"
205 AC_TRY_LINK([#include <krb.h>],[int i;],
206 [krb_h=yes krb_incdir=$KRB4/include],
208 AC_TRY_LINK([#include <krb.h>],[int i;],
209 [krb_h=yes krb_incdir=])])
212 AC_TRY_LINK([#include <krb.h>],[int i;],
213 [krb_h=yes krb_incdir=])
215 if test -z "$krb_h"; then
216 AC_TRY_LINK([#include <krb.h>],[int i;],
217 [krb_h=yes krb_incdir=],
218 [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
220 CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
221 AC_TRY_LINK([#include <krb.h>],[int i;],
222 [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
226 AC_MSG_RESULT($krb_h)
230 if test -n "$krb_h"; then
232 if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
233 hold_ldflags=$LDFLAGS
234 LDFLAGS="-L${KRB4}/lib $LDFLAGS"
235 AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib],
236 [LDFLAGS=$hold_ldflags
237 # Using open here instead of printf so we don't
238 # get confused by the cached value for printf from above.
239 AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])])
240 LDFLAGS=$hold_ldflags
242 AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=])
244 if test -n "$krb_lib"; then
245 AC_DEFINE(HAVE_KERBEROS)
246 test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
248 # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
249 # -ldes in the command line. Don't do it permanently so that we honor
250 # the user's setting for LDFLAGS
251 hold_ldflags=$LDFLAGS
252 test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
253 AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
254 LDFLAGS=$hold_ldflags
255 if test -n "$krb_incdir"; then
256 includeopt="${includeopt} -I$krb_incdir"
260 AC_CHECK_FUNCS(krb_get_err_text)
265 dnl Use --with-encryption to turn on encryption support
267 AC_ARG_ENABLE(encryption,
268 [ --enable-encryption enable encryption support],
269 [case "${enableval}" in
270 yes) encryption=true ;;
271 no) encryption=false ;;
272 *) AC_MSG_ERROR(bad value ${enableval} for encryption option) ;;
275 if test "$encryption" = "true"; then
276 AC_DEFINE(ENCRYPTION)
279 AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
281 # Check for options requesting client and server feature. If none are
282 # given and we have connect(), we want the full client & server arrangement.
283 AC_ARG_ENABLE(client,
284 [ --enable-client include code for running as a remote client (default)
285 --disable-client don't include remote client code],
286 [if test "$enable_client" = yes; then
287 AC_DEFINE(CLIENT_SUPPORT)
289 [if test "$ac_cv_search_connect" != no; then
290 AC_DEFINE(CLIENT_SUPPORT)
292 AC_ARG_ENABLE(server,
293 [ --enable-server include code for running as a server (default)
294 --disable-server don't include server code],
295 [if test "$enable_server" = yes; then
296 AC_DEFINE(SERVER_SUPPORT)
298 [if test "$ac_cv_search_connect" != no; then
299 AC_DEFINE(SERVER_SUPPORT)
303 dnl The auth server needs to be able to check passwords against passwd
304 dnl file entries, so we only #define AUTH_SERVER_SUPPORT if we can
305 dnl find the crypt function.
307 if test "$enable_server" = yes; then
308 AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT) AC_DEFINE(AUTH_SERVER_SUPPORT))
311 dnl For the moment we will assume that all systems which have
312 dnl the unixyness to run configure are unixy enough to do the
313 dnl PreservePermissions stuff. I have this sinking feeling that
314 dnl things won't be that simple, before long.
315 dnl AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT)
317 dnl On cygwin32, we configure like a Unix system, but we use the
318 dnl Windows support code in lib/fncase.c to handle the case
319 dnl insensitive file system. We also need some support libraries. We
320 dnl do this at the end so that the new libraries are added at the end
322 AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
323 [AC_TRY_COMPILE([], [return __CYGWIN32__;],
324 ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
325 if test $ccvs_cv_sys_cygwin32 = yes; then
326 LIBOBJS="$LIBOBJS fncase.o"
327 LIBS="$LIBS -ladvapi32"
329 dnl On Windows you can only change file times if you can write to
330 dnl the file. cygwin32 should really handle this for us, but as of
331 dnl January 1998 it doesn't.
332 AC_DEFINE(UTIME_EXPECTS_WRITABLE)
334 dnl On Windows we must use setmode to change between binary and text
336 AC_DEFINE(USE_SETMODE_STDOUT)
337 AC_DEFINE(HAVE_SETMODE)
340 test -f src/options.h && (
341 AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
342 AC_MSG_WARN(You may wish to check that local options have not been lost.)
343 AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
344 cp ./src/options.h ./src/options.h-SAVED
347 AC_OUTPUT([Makefile \
351 contrib/commit_prep \
368 windows-NT/Makefile \
369 windows-NT/SCC/Makefile \
374 contrib/commit_prep \