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