]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/cvs/configure.in
Import cvs-1.11.15
[FreeBSD/FreeBSD.git] / contrib / cvs / configure.in
1 dnl configure.in for cvs
2 AC_INIT([Concurrent Versions System (CVS)],[1.11.15],[bug-cvs@gnu.org],[cvs])
3 AC_CONFIG_SRCDIR(src/cvs.h)
4 AM_INIT_AUTOMAKE([gnu 1.7.9 dist-bzip2 no-define])
5 AC_PREREQ(2.58)
6
7 AC_PREFIX_PROGRAM(cvs)
8 AM_CONFIG_HEADER(config.h)
9 AM_MAINTAINER_MODE
10
11 AC_PROG_CC
12 AM_PROG_CC_C_O
13
14 dnl FIXME the next three calls should be avoided according to autoconf
15 dnl philosophy.  for example, AC_CHECK_LIB should be used to look for crypt.
16 dnl
17 dnl These are here instead of later because they want to be called before
18 dnl anything that calls a C compiler.
19 AC_AIX
20 AC_MINIX
21
22 # Find the posix library needed on INTERACTIVE UNIX (ISC)
23 dnl
24 dnl From the Autoconf 2.53 manual (AC_ISC_POSIX):
25 dnl
26 dnl  For INTERACTIVE UNIX (ISC), add `-lcposix' to output variable
27 dnl  `LIBS' if necessary for POSIX facilities.  Call this after
28 dnl  `AC_PROG_CC' and before any other macros that use POSIX
29 dnl  interfaces.  INTERACTIVE UNIX is no longer sold, and Sun says that
30 dnl  they will drop support for it on 2006-07-23, so this macro is
31 dnl  becoming obsolescent.
32 dnl
33 AC_SEARCH_LIBS([strerror], [cposix])
34
35 dnl
36 dnl Autoconf stopped setting $ISC sometime before 2.53
37 dnl
38 dnl If this is still important, someone should come up with a generic test
39 dnl for whether _SYSV3 needs to be defined.  Removed code below:
40 dnl
41 dnl if test "$ISC" = yes; then
42 dnl CFLAGS="$CFLAGS -D_SYSV3"
43 dnl # And I don't like this...  In theory it should be found later if server is
44 dnl # enabled, but maybe something on INTERACTIVE UNIX (ISC) we didn't ask to
45 dnl # link with crypt tries?  Anyhow, the autoconf manual says we can delete
46 dnl # this ISC stuff on or after 2006-07-23 when Sun discontinues support and
47 dnl # ISC becomes obsolescent, but I suppose that is probably a matter of
48 dnl # opinion.
49 dnl #
50 dnl # N.B.  The reason for doing this is that some moron decided to put a stub
51 dnl # for crypt in libc that always returns NULL.  Without this here, the later
52 dnl # check will find the stub instead of the real thing, resulting in a server
53 dnl # that can't process crypted passwords correctly.
54 dnl
55 dnl # again, if we have to try and reenable this for ISC, someone should come
56 dnl # up with a generic test that figures out whether crypt is good or not -
57 dnl # Is it always returning NULL?
58 dnl LIBS="-lcrypt $LIBS"
59 dnl fi
60 dnl
61 dnl FIXME - This has been broken for at least a few months anyhow, so I'm
62 dnl removing the crypt lib define above, but the correct fix would be to
63 dnl provide a CRYPT_WORKS macro or the like that gets called sometime after
64 dnl the AC_SEARCH_LIBS call that normally finds crypt, and if crypt doesn't
65 dnl work, the macro should be retried with LIBS="-lcrypt $LIBS" forced.
66 dnl
67
68 AC_PROG_RANLIB
69 AC_PROG_YACC
70 AC_PROG_LN_S
71 AC_EXEEXT
72
73 AC_PATH_PROG(PERL, perl, no)
74 AC_PATH_PROG(CSH, csh, no)
75 # for contrib/rcs2log.sh & src/cvsbug.in.
76 AC_PATH_PROG(MKTEMP, mktemp, mktemp)
77 if test x"$MKTEMP" = xmktemp; then
78         MKTEMP_SH_FUNCTION=$srcdir/mktemp.sh
79 else
80         MKTEMP_SH_FUNCTION=/dev/null
81 fi
82 AC_SUBST_FILE(MKTEMP_SH_FUNCTION)
83 # for src/cvsbug.in
84 AC_PATH_PROG(SENDMAIL, sendmail, no, [$PATH:/usr/sbin:/usr/lib])
85 # For diff/util.c
86 AC_PATH_PROG(PR, pr, no)
87 if test x"$PR" != xno; then
88         AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR"], [Path to the pr utility])
89 fi
90
91 dnl FIXME This is truly gross.
92 missing_dir=`cd $ac_aux_dir && pwd`
93 dnl FIXME I pulled this default list from sanity.sh.  Perhaps these lists
94 dnl can be stored in one location?
95 dnl
96 dnl Yeah, put the value in a variable add it to the substitution list
97 dnl then have configure create sanity.sh from sanity.sh.in...
98 glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
99 AC_PATH_PROGS(ROFF, groff roff, $missing_dir/missing roff, $glocs)
100 AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
101 AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)
102
103 AC_SYS_INTERPRETER
104 if test X"$ac_cv_sys_interpreter" != X"yes" ; then
105   # silly trick to avoid problems in AC macros...
106   ac_msg='perl scripts using #! may not be invoked properly'
107   AC_MSG_WARN($ac_msg)
108 fi
109
110 # BSD's logo is a devil for a reason, hey?
111 AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
112 [if test ! -d ac_test_dir ; then
113         AC_TRY_COMMAND([mkdir ac_test_dir])
114 fi
115 cat >conftestmake <<EOF
116 VPATH = ac_test_dir
117 ac_test_target: ac_test_dep
118         echo BSD VPATH bug present >&2
119 ac_test_dep: ac_test_dep_dep
120 EOF
121 touch ac_test_dir/ac_test_dep_dep
122 touch ac_test_dir/ac_test_dep
123 touch ac_test_target
124 # Don't know why, but the following test doesn't work under FreeBSD 4.2
125 # without this sleep command
126 sleep 1
127 if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
128         ccvs_cv_bsd_make_vpath_bug=yes
129 else
130         ccvs_cv_bsd_make_vpath_bug=no
131 fi
132 AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
133 # We also don't need to worry about the bug when $srcdir = $builddir
134 AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
135                 test $ccvs_cv_bsd_make_vpath_bug = no \
136                 || test $srcdir = .)
137
138 AC_HEADER_DIRENT
139 AC_HEADER_STDC
140 AC_HEADER_SYS_WAIT
141 AC_CHECK_HEADERS(\
142         errno.h \
143         direct.h \
144         fcntl.h \
145         fnmatch.h \
146         io.h \
147         limits.h \
148         memory.h \
149         ndbm.h \
150         string.h \
151         syslog.h \
152         sys/bsdtypes.h \
153         sys/file.h \
154         sys/param.h \
155         sys/resource.h \
156         sys/select.h \
157         sys/time.h \
158         sys/timeb.h \
159         unistd.h \
160         utime.h\
161 )
162 AC_HEADER_STAT
163 AC_HEADER_TIME
164
165 AC_C_CONST
166 AC_TYPE_UID_T
167 AC_TYPE_MODE_T
168 AC_TYPE_PID_T
169 AC_TYPE_SIZE_T
170 AC_TYPE_SIGNAL
171
172 AC_CHECK_MEMBERS([struct stat.st_blksize])
173 AC_CHECK_MEMBERS([struct stat.st_rdev])
174
175 AC_REPLACE_FUNCS(\
176         dup2 \
177         ftruncate \
178         gethostname \
179         memmove \
180         mkdir \
181         rename \
182         strerror \
183         strstr \
184         strtoul\
185         valloc \
186         waitpid \
187 )
188
189
190
191 dnl
192 dnl Begin GNULIB stuff.
193 dnl
194
195 dnl We always want to use the GNULIB getpass, so define its name to something
196 dnl that won't conflict with system declarations.
197 AC_DEFINE([getpass], [cvs_getpass],
198   [We want to always use the GNULIB version of getpass which we have in lib,
199    so define getpass to something that won't conflict with any existing system
200    declarations.])
201
202 dnl
203 dnl End GNULIB stuff.
204 dnl
205
206
207
208 AC_CHECK_FUNCS(\
209         fchdir \
210         fchmod \
211         fsync \
212         ftime \
213         geteuid \
214         getgroups \
215         getopt \
216         getpagesize \
217         gettimeofday \
218         initgroups \
219         login \
220         logout \
221         mknod \
222         mkstemp \
223         mktemp \
224         putenv \
225         readlink \
226         regcomp \
227         regerror \
228         regexec \
229         regfree \
230         sigaction \
231         sigblock \
232         sigprocmask \
233         sigsetmask \
234         sigvec \
235         tempnam \
236         timezone \
237         tzset \
238         vprintf \
239         wait3 \
240 )
241 # we only need one of the following
242 AC_CHECK_FUNCS([\
243         nanosleep \
244         usleep \
245         select \
246 ], [break])
247
248 dnl
249 dnl The CVS coding standard (as specified in HACKING) is that if it exists
250 dnl in SunOS4 and ANSI, we use it.  CVS itself, of course, therefore doesn't
251 dnl need HAVE_* defines for such functions, but diff wants them.
252 dnl
253 AC_DEFINE(HAVE_STRCHR, 1,
254 [Define if you have strchr (always for CVS).])
255 AC_DEFINE(HAVE_MEMCHR, 1,
256 [Define if you have memchr (always for CVS).])
257
258 dnl
259 dnl Force lib/regex.c to use malloc instead of messing around with alloca
260 dnl and define the old re_comp routines that we use.
261 dnl
262 AC_DEFINE(REGEX_MALLOC, 1,
263 [Define to force lib/regex.c to use malloc instead of alloca.])
264 AC_DEFINE(_REGEX_RE_COMP, 1,
265 [Define to force lib/regex.c to define re_comp et al.])
266 dnl
267 dnl AC_FUNC_FORK([]) is rather baroque.  It seems to be rather more picky
268 dnl than, say, the Single Unix Specification (version 2), which simplifies
269 dnl a lot of cases by saying that the child process can't set any variables
270 dnl (thus avoiding problems with register allocation) or call any functions
271 dnl (thus avoiding problems with whether file descriptors are shared).
272 dnl It would be nice if we could just write to the Single Unix Specification.
273 dnl I think the only way to do redirection this way is by doing it in the
274 dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
275 dnl That would appear to have a race condition if the user hits ^C (or
276 dnl some other signal) at the wrong time, as main_cleanup will try to use
277 dnl stdout/stderr.  So maybe we are stuck with AC_FUNC_FORK([]).
278 dnl
279 AC_FUNC_FORK([])
280 AC_FUNC_CLOSEDIR_VOID
281
282 dnl
283 dnl Check for shadow password support.
284 dnl
285 dnl We used to try to determine whether shadow passwords were actually in
286 dnl use or not, but the code has been changed to work right reguardless,
287 dnl so we can go back to a simple check.
288 AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM, 1,
289 [Define if you have the getspnam function.]))
290
291 AC_FUNC_UTIME_NULL
292 AC_SYS_LONG_FILE_NAMES
293
294 AC_FUNC_FNMATCH
295 if test "$ac_cv_func_fnmatch_works" = no; then
296   AC_LIBOBJ(fnmatch)
297   AC_CONFIG_LINKS(lib/fnmatch.h:lib/fnmatch.h.in)
298   AC_LIBSOURCE(fnmatch.h.in)
299 fi
300
301 dnl for the buffer routine replacements
302 AC_FUNC_MMAP
303
304 # Try to find connect and gethostbyname.
305 AC_CHECK_LIB(nsl, main)
306 AC_SEARCH_LIBS(connect, xnet socket inet,
307   AC_DEFINE(HAVE_CONNECT, 1,
308 [Define if you have the connect function.]))
309 dnl no need to search nsl for gethostbyname here since we should have
310 dnl just added libnsl above if we found it.
311 AC_SEARCH_LIBS(gethostbyname, netinet)
312
313
314 dnl
315 dnl begin --with-*
316 dnl
317
318 dnl
319 dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
320 dnl
321 dnl If you change this, keep in mind that some systems have a bogus
322 dnl libkrb in the system libraries, so --with-krb4=value needs to
323 dnl override the system -lkrb.
324 dnl
325 KRB4=/usr/kerberos
326 define(WITH_KRB4,[
327 AC_ARG_WITH(
328   [krb4],
329   AC_HELP_STRING(
330     [--with-krb4],
331     [Kerberos 4 directory (default /usr/kerberos)]),
332   [KRB4=$with_krb4],
333 )dnl
334 AC_MSG_CHECKING([for KRB4 in $KRB4])
335 AC_MSG_RESULT([])
336 AC_SUBST(KRB4)])dnl
337 WITH_KRB4
338
339 krb_h=
340 AC_MSG_CHECKING([for krb.h])
341 if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
342    hold_cflags=$CFLAGS
343    CFLAGS="$CFLAGS -I$KRB4/include"
344    AC_TRY_LINK([#include <krb.h>],[int i;],
345           [krb_h=yes krb_incdir=$KRB4/include],
346           [CFLAGS=$hold_cflags
347            AC_TRY_LINK([#include <krb.h>],[int i;],
348              [krb_h=yes krb_incdir=])])
349    CFLAGS=$hold_cflags
350 else
351    AC_TRY_LINK([#include <krb.h>],[int i;],
352              [krb_h=yes krb_incdir=])
353 fi
354 if test -z "$krb_h"; then
355   AC_TRY_LINK([#include <krb.h>],[int i;],
356     [krb_h=yes krb_incdir=],
357     [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
358        hold_cflags=$CFLAGS
359        CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
360        AC_TRY_LINK([#include <krb.h>],[int i;],
361          [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
362        CFLAGS=$hold_cflags
363      fi])
364 fi
365 AC_MSG_RESULT($krb_h)
366
367 includeopt=
368 AC_SUBST(includeopt)
369 if test -n "$krb_h"; then
370   krb_lib=
371   if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
372        hold_ldflags=$LDFLAGS
373        LDFLAGS="-L${KRB4}/lib $LDFLAGS"
374        AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib],
375            [LDFLAGS=$hold_ldflags
376             # Using open here instead of printf so we don't
377             # get confused by the cached value for printf from above.
378             AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])])
379        LDFLAGS=$hold_ldflags
380   else
381        AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=])
382        AC_CHECK_FUNC(krb_recvauth,[krb_lib=yes krb_libdir=])
383   fi
384   if test -n "$krb_lib"; then
385     AC_DEFINE([HAVE_KERBEROS], 1,
386               [Define if you have MIT Kerberos version 4 available.])
387     test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
388     # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
389     # -ldes in the command line.  Don't do it permanently so that we honor
390     # the user's setting for LDFLAGS
391     hold_ldflags=$LDFLAGS
392     test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
393     AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
394     AC_CHECK_LIB(krb,krb_recvauth)
395     AC_CHECK_LIB(krb4,krb_recvauth)
396     LDFLAGS=$hold_ldflags
397     if test -n "$krb_incdir"; then
398       includeopt="${includeopt} -I$krb_incdir"
399     fi
400   fi
401 fi
402 AC_CHECK_FUNCS(krb_get_err_text)
403
404
405 dnl
406 dnl WITH_GSSAPI is external
407 dnl
408 dnl TODO - I tried to put these in alphabetical order, but ACX_WITH_GSSAPI
409 dnl fails unless called after the KRB4 stuff.  I don't know why.
410 dnl
411 ACX_WITH_GSSAPI
412
413
414 dnl
415 dnl begin --with-editor
416 dnl
417 dnl Set the default editor to use for log messages
418 dnl
419
420 AC_ARG_VAR(
421   [EDITOR],
422   [The text editor CVS will use by default for log messages.])
423
424 # Let the confiscator request a specific editor
425 AC_ARG_WITH(
426   [editor],
427   AC_HELP_STRING(
428     [--with-editor],
429     [The default text editor CVS should use for log messages
430      (default autoselects)]), ,
431   [with_editor=yes])
432
433 # If --with-editor was supplied with an argument, let it override $EDITOR from
434 # the user's environment.  We need to unset EDITOR here because AC_CHECK_PROGS
435 # will let the value of EDITOR ride when it is set rather than searching.  We
436 # ignore the --without-editor case since it will be caught below.
437 if test -n "$EDITOR" && test yes != $with_editor; then
438   AS_UNSET([EDITOR])
439 fi
440
441 # Set the default when --with-editor wasn't supplied or when it was supplied
442 # without an argument.
443 if test yes = $with_editor; then
444   with_editor="vim vi emacs nano pico edit"
445 fi
446
447 if echo $with_editor |grep ^/ >/dev/null; then
448   # If $with_editor is an absolute path, issue a warning if the executable
449   # doesn't exist or isn't usable, but then trust the user and use it
450   # regardless
451   EDITOR=$with_editor
452   AC_MSG_CHECKING([for an editor])
453   AC_MSG_RESULT([$EDITOR])
454   if ! test -f $with_editor \
455       || ! test -x $with_editor; then
456     # warn the user that they may encounter problems
457     AC_MSG_WARN([\`$with_editor' is not a path to an executable file])
458   fi
459 elif test no != "${with_editor}"; then
460   # Search for an editor
461   AC_CHECK_PROGS([EDITOR], [$with_editor], [no])
462     if test no = "${EDITOR}"; then
463       AC_MSG_ERROR([
464     Failed to find a text file editor.  CVS cannot be compiled
465     without a default log message editor.  Searched for
466     \`$with_editor'.  Try \`configure --with-editor'.])
467     fi
468 else
469   AC_MSG_ERROR([
470     CVS cannot be compiled without a default log message editor.
471     Try \`configure --with-editor'.])
472 fi
473
474 dnl FIXME - Using --without-editor will probably break a compile at
475 dnl the moment, but maybe it is reasonable for someone to want to
476 dnl compile a CVS executable that refuses to run if no $EDITOR,
477 dnl $CVS_EDITOR, or -e option is specified?  Making a preliminary
478 dnl design decision in this direction, subject to discussion.
479 dnl
480 dnl Still don't know if the above would be useful, but we shouldn't
481 dnl be able to get here any longer without $EDITOR defined due to the
482 dnl error checking above.
483 AC_DEFINE_UNQUOTED(
484   [EDITOR_DFLT], ["$EDITOR"],
485   [The default editor to use, if one does not specify the "-e" option
486    to cvs, or does not have an EDITOR environment variable.  If this
487    is not set to an absolute path to an executable, use the shell to
488    find where the editor actually is.  This allows sites with
489    /usr/bin/vi or /usr/ucb/vi to work equally well (assuming that their
490    PATH is reasonable).])
491
492 dnl
493 dnl done finding an editor
494 dnl
495 dnl end --with-editor
496 dnl
497
498
499 dnl
500 dnl Find a temporary directory
501 dnl
502 AC_ARG_WITH(
503   [tmpdir],
504   AC_HELP_STRING(
505     [--with-tmpdir],
506     [The temporary directory CVS should use as a default
507      (default autoselects)]))
508
509 AC_MSG_CHECKING([for temporary directory])
510 if test -z "$with_tmpdir" || test yes = "$with_tmpdir"; then
511   for with_tmpdir in /tmp /var/tmp no; do
512     if test -d "$with_tmpdir" && test -x "$with_tmpdir" \
513         && test -w "$with_tmpdir" && test -r "$with_tmpdir"; then
514       break
515     fi
516   done
517   if test no = "$with_tmpdir"; then
518     AC_MSG_WARN([Failed to find usable temporary directory.  Using '/tmp'.])
519     with_tmpdir=/tmp
520   fi
521   AC_MSG_RESULT([$with_tmpdir])
522 elif ! echo "$with_tmpdir" |grep '^[[\\/]]'; then
523   AC_MSG_RESULT([$with_tmpdir])
524   AC_MSG_ERROR([--with-tmpdir requires an absolute path.])
525 elif ! test -d "$with_tmpdir" || ! test -x "$with_tmpdir" \
526         || ! test -w "$with_tmpdir" || ! test -r "$with_tmpdir"; then
527   AC_MSG_RESULT([$with_tmpdir])
528   AC_MSG_WARN(
529     [User supplied temporary directory ('$with_tmpdir') does not
530      exist or lacks sufficient permissions for read/write.])
531 fi
532
533 AC_DEFINE_UNQUOTED(
534   [TMPDIR_DFLT], ["$with_tmpdir"],
535   [Directory used for storing temporary files, if not overridden by
536    environment variables or the -T global option.  There should be little
537    need to change this (-T is a better mechanism if you need to use a
538    different directory for temporary files).])
539
540 dnl
541 dnl done finding tmpdir
542 dnl
543
544
545 dnl
546 dnl Get default umask
547 dnl
548
549 AC_ARG_WITH(
550   [umask],
551   AC_HELP_STRING(
552     [--with-umask],
553     [Set the umask CVS will use by default in the repository (default 002)]))
554
555 if test -z "$with_umask" || test yes = "$with_umask"; then
556   with_umask=002
557 elif test no = "$with_umask"; then
558   with_umask=000
559 fi
560
561 AC_DEFINE_UNQUOTED(
562   [UMASK_DFLT], [$with_umask],
563   [The default umask to use when creating or otherwise setting file or
564    directory permissions in the repository.  Must be a value in the
565    range of 0 through 0777.  For example, a value of 002 allows group
566    rwx access and world rx access; a value of 007 allows group rwx
567    access but no world access.  This value is overridden by the value
568    of the CVSUMASK environment variable, which is interpreted as an
569    octal number.])
570
571 dnl
572 dnl Done setting default umask
573 dnl
574
575 dnl
576 dnl Set CVS Administrator Group
577 dnl
578 AC_ARG_WITH(
579   [cvs-admin-group],
580   AC_HELP_STRING(
581     [--with-cvs-admin-group=GROUP],
582     [The CVS admin command is restricted to the members of this group.
583      If this group does not exist, all users are allowed to run CVS admin.
584      To disable the CVS admin command for all users, create an empty group
585      by specifying the --with-cvs-admin-group= option.  To disable access
586      control for CVS admin, run configure with the --without-cvs-admin-group
587      option. (default 'cvsadmin')]), ,
588   [with_cvs_admin_group=cvsadmin])
589
590 if test yes = "$with_cvs_admin_group"; then
591   with_cvs_admin_group=cvsadmin
592 fi
593 if test no != "$with_cvs_admin_group"; then
594   dnl FIXME We should warn if the group doesn't exist
595   AC_DEFINE_UNQUOTED(
596     [CVS_ADMIN_GROUP], ["$with_cvs_admin_group"],
597     [The CVS admin command is restricted to the members of the group
598      CVS_ADMIN_GROUP.  If this group does not exist, all users are
599      allowed to run CVS admin.  To disable the CVS admin command for
600      all users, create an empty CVS_ADMIN_GROUP by running configure
601      with the --with-cvs-admin-group= option.  To disable access control
602      for CVS admin, run configure with the --without-cvs-admin-group
603      option in order to comment out the define below.])
604 fi
605
606 dnl
607 dnl Done setting CVS Administrator Group
608 dnl
609
610 dnl
611 dnl Set the NDBM library to use.
612 dnl
613 dnl XXX - FIXME - FIXME - FIXME - XXX
614 dnl
615 dnl This is very bad.  It should really autodetect an appropriate NDBM library
616 dnl and, if it doesn't find one, decide to use MY_NDBM.  I'm am defining
617 dnl this here since this is no worse than it worked when it was in options.h
618 dnl and I am cleaning out options.h so that the Windows version of CVS will
619 dnl compile properly for the next release.
620 dnl
621 dnl That's why this option is in the --with-* section rather than the
622 dnl --enable-* section.
623 dnl
624 dnl XXX - FIXME - FIXME - FIXME - XXX
625 dnl
626 AC_ARG_ENABLE(
627   [cvs-ndbm],
628   AC_HELP_STRING(
629     [--enable-cvs-ndbm],
630     [Use the NDBM library distributed with CVS rather than attempting to use
631      a system NDBM library.  Disabling this may not work.  (default)]), ,
632   [enable_cvs_ndbm=yes])
633 if test no != "$enable_cvs_ndbm"; then
634   AC_DEFINE(
635     [MY_NDBM], [1],
636     [By default, CVS stores its modules and other such items in flat
637      text files (MY_NDBM enables this).  Turning off MY_NDBM causes CVS
638      to look for a system-supplied ndbm database library and use it
639      instead.  That may speed things up, but the default setting
640      generally works fine too.])
641 fi
642
643 dnl
644 dnl Done selecting NDBM library.
645 dnl
646
647
648
649 dnl
650 dnl end --with-*
651 dnl
652
653
654 dnl
655 dnl begin --enables
656 dnl
657
658
659 # Check for options requesting client and server feature. If none are
660 # given and we have connect(), we want the full client & server arrangement.
661 AC_ARG_ENABLE(
662   [client],
663   AC_HELP_STRING(
664     [--enable-client],
665     [Include code for running as a remote client (default)]), ,
666   [if test "$ac_cv_search_connect" != no; then
667     enable_client=yes
668   fi])
669 if test no != "$enable_client"; then
670   AC_DEFINE(
671     [CLIENT_SUPPORT], [1],
672     [Define if you want CVS to be able to be a remote repository client.])
673 fi
674
675 AC_ARG_ENABLE(
676   [password-authenticated-client],
677   AC_HELP_STRING(
678     [--enable-password-authenticated-client],
679     [Enable pserver as a remote access method in the CVS client
680      (default)]))
681
682 if test no != "$enable_password_authenticated_client"; then
683   if test no != "$enable_client"; then
684     AC_DEFINE(
685       [AUTH_CLIENT_SUPPORT], [1],
686       [Enable AUTH_CLIENT_SUPPORT to enable pserver as a remote access
687        method in the CVS client (default)])
688   else
689     AC_MSG_WARN(
690       [--enable-password-authenticated-client is meaningless with
691        the CVS client disabled (--disable-client)])
692   fi
693 fi
694
695
696 dnl
697 dnl Give the confiscator control over whether the server code is compiled
698 dnl
699 AC_ARG_ENABLE(
700   [server],
701   AC_HELP_STRING(
702     [--enable-server],
703     [Include code for running as a server (default)]), ,
704   [if test "$ac_cv_search_connect" != no; then
705      enable_server=yes
706    fi])
707
708 if test no != "$enable_server"; then
709   AC_DEFINE(
710     [SERVER_SUPPORT], [1],
711     [Define if you want CVS to be able to serve repositories to remote
712      clients.])
713
714   dnl
715   dnl The auth server needs to be able to check passwords against passwd
716   dnl file entries, so we only #define AUTH_SERVER_SUPPORT if we can
717   dnl find the crypt function. 
718   dnl
719   AC_SEARCH_LIBS(
720     [crypt], [crypt],
721     [AC_DEFINE(
722        [HAVE_CRYPT], [1],
723        [Define if you have the crypt function.])
724      AC_DEFINE(
725        [AUTH_SERVER_SUPPORT], [1],
726        [Define if you want to use the password authenticated server.])dnl
727   ])dnl AC_SEARCH_LIBS
728
729   dnl
730   dnl Allow the configurer to enable server flowcontrol.  Read the help
731   dnl strings below for a full explanation.
732   dnl
733   AC_ARG_ENABLE(
734     [server-flow-control],
735     AC_HELP_STRING(
736       [--enable-server-flow-control],
737       [If you are working with a large remote repository and a 'cvs
738        checkout' is swamping your network and memory, define these to
739        enable flow control.  You may optionally pass a low water mark
740        in bytes and a high water mark in bytes, separated by commas.
741        (default is enabled 1M,2M)]),
742     [if test yes = $enable_server_flow_control; then
743        enable_server_flow_control=1M,2M
744      fi],
745     [enable_server_flow_control=1M,2M])
746   if test no != $enable_server_flow_control; then
747     ccvs_lwm=`expr "$enable_server_flow_control" : '\(.*\),'`
748     ccvs_hwm=`expr "$enable_server_flow_control" : '.*,\(.*\)'`
749     ccvs_lwm_E=`expr "$ccvs_lwm" : '[[0-9]][[0-9]]*\(.*\)'`
750     ccvs_lwm=`expr "$ccvs_lwm" : '\([[0-9]][[0-9]]*\)'`
751     test "" != "$ccvs_lwm" || ccvs_lwm_E="?"
752     case $ccvs_lwm_E in
753         G) ccvs_lwm="$ccvs_lwm * 1024 * 1024 * 1024";;
754         M) ccvs_lwm="$ccvs_lwm * 1024 * 1024";;
755         k) ccvs_lwm="$ccvs_lwm * 1024";;
756         b | '') ;;
757         *) AC_MSG_ERROR([Can't parse argument to --enable-server-flow-control
758                         ('$enable_server_flow_control') as <lwm>,<hwm>])
759       esac
760     ccvs_hwm_E=`expr "$ccvs_hwm" : '[[0-9]][[0-9]]*\(.*\)'`
761     ccvs_hwm=`expr "$ccvs_hwm" : '\([[0-9]][[0-9]]*\).*'`
762     test "" != "$ccvs_hwm" || ccvs_hwm_E="?"
763     case $ccvs_hwm_E in
764         G) ccvs_hwm="$ccvs_hwm * 1024 * 1024 * 1024";;
765         M) ccvs_hwm="$ccvs_hwm * 1024 * 1024";;
766         k) ccvs_hwm="$ccvs_hwm * 1024";;
767         b | '') ccvs_hwm="$ccvs_hwm";;
768         *) AC_MSG_ERROR([Can't parse argument to --enable-server-flow-control
769                         ('$enable_server_flow_control') as <lwm>,<hwm>])
770       esac
771
772     AC_DEFINE(
773       [SERVER_FLOWCONTROL], [1],
774       [If you are working with a large remote repository and a 'cvs
775        checkout' is swamping your network and memory, define these to
776        enable flow control.  You will end up with even less probability of
777        a consistent checkout (see Concurrency in cvs.texinfo), but CVS
778        doesn't try to guarantee that anyway.  The master server process
779        will monitor how far it is getting behind, if it reaches the high
780        water mark, it will signal the child process to stop generating
781        data when convenient (ie: no locks are held, currently at the
782        beginning of a new directory).  Once the buffer has drained
783        sufficiently to reach the low water mark, it will be signalled to
784        start again.])
785     AC_DEFINE_UNQUOTED(
786       [SERVER_LO_WATER], [($ccvs_lwm)],
787       [The low water mark in bytes for server flow control.  Required if
788        SERVER_FLOWCONTROL is defined, and useless otherwise.])
789     AC_DEFINE_UNQUOTED(
790       [SERVER_HI_WATER], [($ccvs_hwm)],
791       [The high water mark in bytes for server flow control.  Required if
792        SERVER_FLOWCONTROL is defined, and useless otherwise.])
793   fi # enable_server_flow_control
794 fi # enable_server
795
796
797 dnl
798 dnl begin --enable-case-sensitivity
799 dnl
800
801 AC_ARG_ENABLE(
802   [case-sensitivity],
803   AC_HELP_STRING(
804     [--enable-case-sensitivity],
805     [Force CVS to expect a case sensitive file system.  Enabling this on a case
806      insensitive system should have little effect on the server or client
807      operation, though client users may ocassionally be suprised that the CVS
808      server appears to be case sensitive.  Disabling this for a case sensitive
809      server disables server support for case insensitive clients, which can
810      confuse all users of case insensitive clients contacting the server.
811      Disabling this for a case sensitive client will cause the client to ask
812      servers to behave case insensitively, which could cause confusion for
813      users, but also probably no real harm.  (default autoselects based on the
814      case sensitivity of the file system containing the current working
815      directory)]),
816     [case "$enable_case_sensitivity" in
817        yes | no | auto) ;;
818        *)
819           AC_MSG_ERROR([Unrecognized argument to --enable-case-sensitivity: \`$enable_case_sensitivity'.  Acceptable values are \`yes', \`no', and \`auto'.])
820           ;;
821      esac],
822   [enable_case_sensitivity=auto])
823
824 acx_forced=' (forced)'
825 AC_MSG_CHECKING([for a case sensitive file system])
826 if test $enable_case_sensitivity = auto; then
827   dnl
828   dnl Check for a case insensitive filesystem, like Mac OS X and Windows have.
829   dnl
830   AC_CACHE_VAL([acx_cv_case_sensitive],
831   [ rm -f ac_TEST_filenames_CASE_sensitive
832     echo foo >ac_test_filenames_case_sensitive
833     if test -f ac_TEST_filenames_CASE_sensitive; then
834       acx_cv_case_sensitive=no
835     else
836       acx_cv_case_sensitive=yes
837     fi
838     rm ac_test_filenames_case_sensitive
839   ])
840   enable_case_sensitivity=$acx_cv_case_sensitive
841   acx_forced=
842 fi
843 AC_MSG_RESULT([$enable_case_sensitivity$acx_forced])
844 if test $enable_case_sensitivity = no; then
845   AC_DEFINE([FILENAMES_CASE_INSENSITIVE], [1],
846             [Define if this executable will be running on case insensitive
847              file systems.  In the client case, this means that it will request
848              that the server pretend to be case insensitive if it isn't
849              already.])
850   dnl Compile fncase.c (containing fncase() & fncmp()) to handle file name
851   dnl comparisons on case insensitive filesystems.
852   AC_LIBOBJ(fncase)
853 fi
854
855 dnl
856 dnl end --enable-case-sensitivity
857 dnl
858
859
860 dnl
861 dnl begin --enable-encryption
862 dnl
863
864 dnl
865 dnl Use --enable-encryption to turn on encryption support, but ignore this
866 dnl option unless either client or server is enabled.
867 dnl
868 AC_ARG_ENABLE(
869   [encryption],
870   AC_HELP_STRING(
871     [--enable-encryption],
872     [Enable encryption support (disabled by default)]), ,
873   [enable_encryption=no])
874 if test "$enable_encryption" = yes; then
875   if test no != "$with_client" || test no != "$with_server"; then
876     AC_DEFINE(
877       [ENCRYPTION], [1],
878       [Define to enable encryption support.])
879   else
880     AC_MSG_WARN(
881       [--enable-encryption is meaningless when neither the CVS client
882        nor the CVS server is enabled (--disable-client and --disable-server).])
883   fi
884 fi
885
886 dnl
887 dnl end --enable-encryption
888 dnl
889
890
891 dnl
892 dnl begin --enable-force-editor
893 dnl
894
895 AC_ARG_ENABLE(
896   [force-editor],
897   AC_HELP_STRING(
898     [--enable-force-editor],
899     [When committing or importing files, you must enter a log message.
900      Normally, you can do this either via the -m flag on the command
901      line, the -F flag on the command line, or an editor will be started
902      for you.  If you like to use logging templates (the rcsinfo file
903      within the $CVSROOT/CVSROOT directory), you might want to force
904      people to use the editor even if they specify a message with -m or
905      -F.  --enable-force-editor will cause the -m or -F message to be
906      appended to the temp file when the editor is started. (disabled
907      by default)]), ,
908   [enable_force_editor=no])
909
910 if test yes = "$enable_force_editor"; then
911   AC_DEFINE(
912     [FORCE_USE_EDITOR], [1],
913     [When committing or importing files, you must enter a log message.
914     Normally, you can do this either via the -m flag on the command
915     line, the -F flag on the command line, or an editor will be started
916     for you.  If you like to use logging templates (the rcsinfo file
917     within the $CVSROOT/CVSROOT directory), you might want to force
918     people to use the editor even if they specify a message with -m or
919     -F.  Enabling FORCE_USE_EDITOR will cause the -m or -F message to be
920     appended to the temp file when the editor is started.])
921 fi
922
923 dnl
924 dnl end --enable-force-editor
925 dnl
926
927
928 dnl
929 dnl begin --enable-rootcommit
930 dnl
931
932 dnl
933 dnl I don't like this here, but I don't really like options.h, either.
934 dnl Besides, this is causing some problems currently when compiling under
935 dnl Windows and moving it here should avoid the issue (the wrong options.h
936 dnl is being used).
937 dnl
938 dnl I don't like making this a runtime option either.  I think I just don't
939 dnl like making it easy to get to, but putting it here goes along with the
940 dnl Autoconf ideal.
941 dnl
942 AC_ARG_ENABLE(
943   [rootcommit],
944   AC_HELP_STRING(
945     [--enable-rootcommit],
946     [Allow the root user to commit files (disabled by default)]), ,
947   [enable_rootcommit=no])
948 if test "$enable_rootcommit" = no; then
949   AC_DEFINE(
950     [CVS_BADROOT], [1],
951     [When committing a permanent change, CVS and RCS make a log entry of
952      who committed the change.  If you are committing the change logged
953      in as "root" (not under "su" or other root-priv giving program),
954      CVS/RCS cannot determine who is actually making the change.
955
956      As such, by default, CVS prohibits changes committed by users
957      logged in as "root".  You can disable checking by passing the
958      "--enable-rootcommit" option to configure or by commenting out the
959      lines below.])
960 fi
961
962 dnl
963 dnl end --enable-rootcommit
964 dnl
965
966
967
968 dnl
969 dnl end --enable-*
970 dnl
971
972
973
974 dnl For the moment we will assume that all systems which have
975 dnl the unixyness to run configure are unixy enough to do the
976 dnl PreservePermissions stuff.  I have this sinking feeling that
977 dnl things won't be that simple, before long.
978 dnl AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT, 1,
979 dnl [Define if this system supports chown(), link(), and friends.])
980
981 dnl On cygwin32, we configure like a Unix system, but we need some support
982 dnl libraries.  We do this at the end so that the new libraries are added at
983 dnl the end of LIBS.
984 dnl
985 dnl FIXME: We should be trying to meet the autoconf ideal of checking for
986 dnl the properties of the system rather than the name of the os here.  In other
987 dnl words, we should check the case sensitivty of the system and then for
988 dnl the support functions we are using and which library we find them in.
989 AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
990 [AC_TRY_COMPILE([], [return __CYGWIN32__;],
991 ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
992 if test $ccvs_cv_sys_cygwin32 = yes; then
993   LIBS="$LIBS -ladvapi32"
994
995   dnl On Windows you can only change file times if you can write to
996   dnl the file.  cygwin32 should really handle this for us, but as of
997   dnl January 1998 it doesn't.
998   AC_DEFINE(UTIME_EXPECTS_WRITABLE, 1,
999 [Define if utime requires write access to the file (true on Windows,
1000 but not Unix).])
1001
1002   dnl On Windows we must use setmode to change between binary and text
1003   dnl mode.  This probably doesn't really require two macro definitions
1004   AC_DEFINE(USE_SETMODE_STDOUT, 1,
1005 [Define if setmode is required when writing binary data to stdout.])
1006   AC_DEFINE(HAVE_SETMODE, 1,
1007 [Define if the diff library should use setmode for binary files.])
1008 fi
1009
1010 dnl associate the setting of the execute bit with the individual scripts
1011 AC_CONFIG_FILES(contrib/check_cvs, [chmod +x contrib/check_cvs])
1012 AC_CONFIG_FILES(contrib/clmerge, [chmod +x contrib/clmerge])
1013 AC_CONFIG_FILES(contrib/cln_hist, [chmod +x contrib/cln_hist])
1014 AC_CONFIG_FILES(contrib/commit_prep, [chmod +x contrib/commit_prep])
1015 AC_CONFIG_FILES(contrib/cvs_acls, [chmod +x contrib/cvs_acls])
1016 AC_CONFIG_FILES(contrib/log, [chmod +x contrib/log])
1017 AC_CONFIG_FILES(contrib/log_accum, [chmod +x contrib/log_accum])
1018 AC_CONFIG_FILES(contrib/mfpipe, [chmod +x contrib/mfpipe])
1019 AC_CONFIG_FILES(contrib/pvcs2rcs, [chmod +x contrib/pvcs2rcs])
1020 AC_CONFIG_FILES(contrib/rcs2log:contrib/rcs2log.sh, [chmod +x contrib/rcs2log])
1021 AC_CONFIG_FILES(contrib/rcslock, [chmod +x contrib/rcslock])
1022 AC_CONFIG_FILES(contrib/sccs2rcs, [chmod +x contrib/sccs2rcs])
1023 AC_CONFIG_FILES(src/cvsbug, [chmod +x src/cvsbug])
1024
1025 dnl the bulk files
1026 AC_CONFIG_FILES([Makefile \
1027           contrib/Makefile \
1028           cvs.spec \
1029           diff/Makefile \
1030           doc/Makefile \
1031           emx/Makefile \
1032           lib/Makefile \
1033           man/Makefile \
1034           os2/Makefile \
1035           src/Makefile \
1036           tools/Makefile \
1037           vms/Makefile \
1038           windows-NT/Makefile \
1039           windows-NT/SCC/Makefile \
1040           zlib/Makefile])
1041
1042 dnl and we're done
1043 AC_OUTPUT
1044
1045
1046
1047 # Report the state of this version of CVS if this is from dev.
1048 m4_bmatch(m4_defn([AC_PACKAGE_VERSION]),  [[0-9]*\.[0-9]*\.[0-9]*\.[0-9]],
1049 [    cat <<EOF
1050
1051 You are about to use an unreleased version of CVS.  Be sure to
1052 read the relevant mailing lists, most importantly <info-cvs@gnu.org>.
1053
1054 Below you will find information on the status of this version of CVS.
1055
1056
1057 EOF
1058     sed -n '/^\* Status/,$p' $srcdir/BUGS
1059 ])