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