1dnl $MirOS: src/gnu/usr.bin/cvs/configure.in,v 1.18 2013/07/18 20:08:26 tg Exp $
2dnl
3dnl configure.in for cvs
4
5AC_COPYRIGHT(
6[Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
7              1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8              Free Software Foundation, Inc.
9
10This program is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2, or (at your option)
13any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18GNU General Public License for more details.])
19
20AC_INIT([Concurrent Versions System (CVS)],[1.12.13-MirOS-0AB3.1],
21	[miros-discuss@mirbsd.org],[cvs])
22AC_CONFIG_SRCDIR(src/cvs.h)
23AM_INIT_AUTOMAKE([gnu 1.9.2 dist-bzip2 no-define])
24AC_PREREQ(2.59)
25
26AC_PREFIX_PROGRAM(cvs)
27AM_CONFIG_HEADER(config.h)
28AM_MAINTAINER_MODE
29
30dnl This needs to be called to enable certain system extensions before calling
31dnl a C compiler.
32gl_EARLY
33
34AC_PROG_CC
35
36AC_PROG_RANLIB
37AC_PROG_LN_S
38AC_SYS_LARGEFILE
39AC_EXEEXT
40
41AC_PATH_PROG(PERL, perl, no)
42AC_PATH_PROG(CSH, csh, no)
43# for contrib/rcs2log.sh & src/cvsbug.in.
44AC_PATH_PROG(MKTEMP, mktemp, mktemp)
45if test x"$MKTEMP" = xmktemp; then
46	MKTEMP_SH_FUNCTION=$srcdir/mktemp.sh
47else
48	MKTEMP_SH_FUNCTION=/dev/null
49fi
50AC_SUBST_FILE(MKTEMP_SH_FUNCTION)
51# for src/cvsbug.in
52AC_PATH_PROG(SENDMAIL, sendmail, no, [$PATH:/usr/sbin:/usr/lib])
53# For diff/util.c
54AC_PATH_PROG(PR, pr, no)
55if test x"$PR" != xno; then
56	AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR"], [Path to the pr utility])
57fi
58
59dnl FIXME This is truly gross.
60missing_dir=`cd $ac_aux_dir && pwd`
61dnl FIXME I pulled this default list from sanity.sh.  Perhaps these lists
62dnl can be stored in one location?
63dnl
64dnl Yeah, put the value in a variable add it to the substitution list
65dnl then have configure create sanity.sh from sanity.sh.in...
66glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
67AC_PATH_PROGS(ROFF, nroff gnroff groff roff, $missing_dir/missing roff, $glocs)
68AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
69AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)
70
71AC_SYS_INTERPRETER
72if test X"$ac_cv_sys_interpreter" != X"yes" ; then
73  # silly trick to avoid problems in AC macros...
74  ac_msg='perl scripts using #! may not be invoked properly'
75  AC_MSG_WARN($ac_msg)
76fi
77
78# BSD's logo is a devil for a reason, hey?
79AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
80[if test ! -d ac_test_dir ; then
81	AC_TRY_COMMAND([mkdir ac_test_dir])
82fi
83cat >conftestmake <<EOF
84VPATH = ac_test_dir
85ac_test_target: ac_test_dep
86	echo BSD VPATH bug present >&2
87ac_test_dep: ac_test_dep_dep
88EOF
89touch ac_test_dir/ac_test_dep_dep
90touch ac_test_dir/ac_test_dep
91touch ac_test_target
92# Don't know why, but the following test doesn't work under FreeBSD 4.2
93# without this sleep command
94sleep 1
95if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
96	ccvs_cv_bsd_make_vpath_bug=yes
97else
98	ccvs_cv_bsd_make_vpath_bug=no
99fi
100AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
101# We also don't need to worry about the bug when $srcdir = $builddir
102AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
103		test $ccvs_cv_bsd_make_vpath_bug = no \
104		|| test $srcdir = .)
105
106AC_HEADER_DIRENT
107AC_HEADER_STDC
108AC_HEADER_SYS_WAIT
109AC_CHECK_HEADERS(\
110	direct.h \
111	fcntl.h \
112	getopt.h \
113	inttypes.h \
114	io.h \
115	memory.h \
116	ndbm.h \
117	stdint.h \
118	syslog.h \
119	sys/bsdtypes.h \
120	sys/file.h \
121	sys/inttypes.h \
122	sys/param.h \
123	sys/resource.h \
124	sys/select.h \
125	unistd.h \
126	utime.h \
127	wctype.h \
128	zlib.h \
129)
130gl_AC_HEADER_STDINT_H
131AC_HEADER_STAT
132AC_HEADER_STDBOOL
133
134AC_C_CONST
135AC_TYPE_UID_T
136AC_TYPE_MODE_T
137AC_TYPE_PID_T
138AC_TYPE_SIGNAL
139
140AC_CHECK_MEMBERS([struct stat.st_blksize])
141AC_CHECK_MEMBERS([struct stat.st_rdev])
142
143AC_FUNC_FSEEKO
144AC_FUNC_ALLOCA
145AC_CHECK_FUNCS([fseeko])
146if test $ac_cv_func_fseeko = no; then
147    AC_LIBOBJ(fseeko)
148    AC_LIBOBJ(ftello)
149fi
150
151# Replace functions with versions in lib/ when they can't be found.
152AC_REPLACE_FUNCS(\
153	waitpid \
154)
155
156#
157# Special hack for a SunOS 5.7 (aka Solaris 7) select() problem.
158#
159ccvs_FUNC_SELECT
160
161#
162# Begin GNULIB stuff.
163#
164
165# Look for functions from GNULIB and replace with versions in lib/ when
166# necessary.
167dnl This calls most of the GNULIB macros we need via the
168dnl autogenerated m4/gnulib.m4.
169gl_INIT
170# The error module still poses merge problems.
171AC_FUNC_STRERROR_R
172dnl The following macros can be called by other GNULIB macros but are also
173dnl used by the UNIQUE_*_TYPE stuff below.  I don't want to rely on the GNULIB
174dnl macros which call these to continue to do so, so use AC_REQUIRE, which can
175dnl only be called from within another macro, to only call them only once.
176AC_DEFUN([CCVS_CALL_GNULIB_MACROS_ONCE],
177[AC_REQUIRE([gt_TYPE_LONGDOUBLE])
178AC_REQUIRE([gt_TYPE_WCHAR_T])
179AC_REQUIRE([gt_TYPE_WINT_T])
180AC_REQUIRE([gl_AC_TYPE_INTMAX_T])
181AC_REQUIRE([gl_FUNC_MMAP_ANON])
182AC_REQUIRE([gl_AC_TYPE_LONG_LONG])])
183CCVS_CALL_GNULIB_MACROS_ONCE()
184
185#
186# End GNULIB stuff.
187#
188
189
190
191# Check for function existance.
192AC_CHECK_FUNCS(\
193	alloca \
194	btowc \
195	fchdir \
196	fchmod \
197	fsync \
198	ftime \
199	geteuid \
200	getgroups \
201	getopt_long_only \
202	getpagesize \
203	getpass \
204	gettimeofday \
205	initgroups \
206	login \
207	logout \
208	mbsrtowcs \
209	mknod \
210	regcomp \
211	regerror \
212	regexec \
213	regfree \
214	sigaction \
215	sigblock \
216	sigprocmask \
217	sigsetmask \
218	sigvec \
219	timezone \
220	tzset \
221	vprintf \
222	wait3 \
223	wmemchr \
224	wmemcpy \
225	wmempcpy \
226)
227HAVE_PUTENV=$ac_cv_func_putenv
228AC_SUBST(HAVE_PUTENV)
229AC_C_BIGENDIAN
230
231dnl
232dnl Find the sizes of various types and set a variable for some if they
233dnl are "unique", meaning it does not share a size with a lower precedence
234dnl type.
235dnl
236dnl also, I snagged this cross_compiling line from openldap's autoconf,
237dnl because I can't figure out how to stop autoconf from giving cross compiler
238dnl related warnings each time the AC_CHECK_SIZEOF function is run
239dnl
240if test $cross_compiling = yes ; then
241	AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
242else
243	AC_CHECK_SIZEOF(char)
244	AC_CACHE_CHECK(for uniquely sized char,
245		ccvs_cv_unique_int_type_char,
246		[if set |grep ^ccvs_cv_unique_int_type_ \
247			|grep "($ac_cv_sizeof_char)" >/dev/null ; then
248			ccvs_cv_unique_int_type_char=no
249		else
250			ccvs_cv_unique_int_type_char=yes\($ac_cv_sizeof_char\)
251		fi])
252	if test $ccvs_cv_unique_int_type_char != no ; then
253		AC_DEFINE( UNIQUE_INT_TYPE_CHAR, 1,
254                           [Define if char is the first integer type
255		            detected with its size.])
256	fi
257	AC_CHECK_SIZEOF(short)
258	AC_CACHE_CHECK(for uniquely sized short,
259		ccvs_cv_unique_int_type_short,
260		[if set |grep ^ccvs_cv_unique_int_type_ \
261			|grep "($ac_cv_sizeof_short)" >/dev/null ; then
262			ccvs_cv_unique_int_type_short=no
263		else
264			ccvs_cv_unique_int_type_short=yes\($ac_cv_sizeof_short\)
265		fi])
266	if test $ccvs_cv_unique_int_type_short != no ; then
267		AC_DEFINE( UNIQUE_INT_TYPE_SHORT, 1,
268                           [Define if short is the first integer type
269		            detected with its size.])
270	fi
271	AC_CHECK_SIZEOF(int)
272	AC_CACHE_CHECK(for uniquely sized int,
273		ccvs_cv_unique_int_type_int,
274		[if set |grep ^ccvs_cv_unique_int_type_ \
275			|grep "($ac_cv_sizeof_int)" >/dev/null ; then
276			ccvs_cv_unique_int_type_int=no
277		else
278			ccvs_cv_unique_int_type_int=yes\($ac_cv_sizeof_int\)
279		fi])
280	if test $ccvs_cv_unique_int_type_int != no ; then
281		AC_DEFINE( UNIQUE_INT_TYPE_INT, 1,
282                           [Define if int is the first integer type
283		            detected with its size.])
284	fi
285	AC_CHECK_SIZEOF(long)
286	AC_CACHE_CHECK(for uniquely sized long,
287		ccvs_cv_unique_int_type_long,
288		[if set |grep ^ccvs_cv_unique_int_type_ \
289			|grep "($ac_cv_sizeof_long)" >/dev/null ; then
290			ccvs_cv_unique_int_type_long=no
291		else
292			ccvs_cv_unique_int_type_long=yes\($ac_cv_sizeof_long\)
293		fi])
294	if test $ccvs_cv_unique_int_type_long != no ; then
295		AC_DEFINE(UNIQUE_INT_TYPE_LONG, 1,
296                          [Define if long int is the first integer type
297		           detected with its size.])
298	fi
299	if test $ac_cv_type_long_long != no; then
300		AC_CHECK_SIZEOF(long long)
301		AC_CACHE_CHECK(for uniquely sized long long,
302			ccvs_cv_unique_int_type_long_long,
303			[if set |grep ^ccvs_cv_unique_int_type_ \
304				|grep "($ac_cv_sizeof_long_long)" >/dev/null ; then
305				ccvs_cv_unique_int_type_long_long=no
306			else
307				ccvs_cv_unique_int_type_long_long=yes\($ac_cv_sizeof_long_long\)
308			fi])
309		if test $ccvs_cv_unique_int_type_long_long != no ; then
310			AC_DEFINE(UNIQUE_INT_TYPE_LONG_LONG, 1,
311				  [Define if long long is the first integer type
312				   detected with its size.])
313		fi
314	fi
315	AC_CHECK_SIZEOF(size_t)
316	AC_CACHE_CHECK(for uniquely sized size_t,
317		ccvs_cv_unique_int_type_size_t,
318		[if set |grep ^ccvs_cv_unique_int_type_ \
319			|grep "($ac_cv_sizeof_size_t)" >/dev/null ; then
320			ccvs_cv_unique_int_type_size_t=no
321		else
322			ccvs_cv_unique_int_type_size_t=yes\($ac_cv_sizeof_size_t\)
323		fi])
324	if test $ccvs_cv_unique_int_type_size_t != no ; then
325		AC_DEFINE(UNIQUE_INT_TYPE_SIZE_T, 1,
326                          [Define if size_t is the first integer type
327		           detected with its size.])
328	fi
329	AC_CHECK_SIZEOF(ptrdiff_t)
330	AC_CACHE_CHECK(for uniquely sized ptrdiff_t,
331		ccvs_cv_unique_int_type_ptrdiff_t,
332		[if set |grep ^ccvs_cv_unique_int_type_ \
333			|grep "($ac_cv_sizeof_ptrdiff_t)" >/dev/null ; then
334			ccvs_cv_unique_int_type_ptrdiff_t=no
335		else
336			ccvs_cv_unique_int_type_ptrdiff_t=yes\($ac_cv_sizeof_ptrdiff_t\)
337		fi])
338	if test $ccvs_cv_unique_int_type_ptrdiff_t != no ; then
339		AC_DEFINE(UNIQUE_INT_TYPE_PTRDIFF_T, 1,
340                          [Define if ptrdiff_t is the first integer type
341		           detected with its size.])
342	fi
343	if test $gt_cv_c_wint_t != no; then
344		AC_CHECK_SIZEOF(wint_t, [], [[#include <stdio.h>
345#include <wchar.h>
346]])
347		AC_CACHE_CHECK(for uniquely sized wint_t,
348			ccvs_cv_unique_int_type_wint_t,
349			[if set |grep ^ccvs_cv_unique_int_type_ \
350				|grep "($ac_cv_sizeof_wint_t)" >/dev/null ; then
351				ccvs_cv_unique_int_type_wint_t=no
352			else
353				ccvs_cv_unique_int_type_wint_t=yes\($ac_cv_sizeof_wint_t\)
354			fi])
355		if test $ccvs_cv_unique_int_type_wint_t != no ; then
356			AC_DEFINE( UNIQUE_INT_TYPE_WINT_T, 1,
357				   [Define if wint_t is the first integer type
358				    detected with its size.])
359		fi
360	fi
361	if test $gt_cv_c_intmax_t != no; then
362		AC_CHECK_SIZEOF(intmax_t, [], [[#include <stdio.h>
363#ifdef HAVE_INTTYPES_H
364#include <inttypes.h>
365#else
366#ifdef HAVE_STDINT_H
367#include <stdint.h>
368#endif
369#endif
370]])
371		AC_CACHE_CHECK(for uniquely sized intmax_t,
372			ccvs_cv_unique_int_type_intmax_t,
373			[if set |grep ^ccvs_cv_unique_int_type_ \
374				|grep "($ac_cv_sizeof_intmax_t)" >/dev/null ; then
375				ccvs_cv_unique_int_type_intmax_t=no
376			else
377				ccvs_cv_unique_int_type_intmax_t=yes\($ac_cv_sizeof_intmax_t\)
378			fi])
379		if test $ccvs_cv_unique_int_type_intmax_t != no ; then
380			AC_DEFINE( UNIQUE_INT_TYPE_INTMAX_T, 1,
381                        	   [Define if intmax_t is the first integer type
382			            detected with its size.])
383		fi
384	fi
385
386	dnl
387	dnl and the same for floats...
388	dnl
389	AC_CHECK_SIZEOF(float)
390	AC_CACHE_CHECK(for uniquely sized float,
391		ccvs_cv_unique_float_type_float,
392		[if set |grep ^ccvs_cv_unique_float_type_ \
393			|grep "($ac_cv_sizeof_float)" >/dev/null ; then
394			ccvs_cv_unique_float_type_float=no
395		else
396			ccvs_cv_unique_float_type_float=yes\($ac_cv_sizeof_float\)
397		fi])
398	if test $ccvs_cv_unique_float_type_float != no ; then
399		AC_DEFINE( UNIQUE_FLOAT_TYPE_FLOAT, 1,
400                           [Define if float is the first floating point type
401		            detected with its size.])
402	fi
403	AC_CHECK_SIZEOF(double)
404	AC_CACHE_CHECK(for uniquely sized double,
405		ccvs_cv_unique_float_type_double,
406		[if set |grep ^ccvs_cv_unique_float_type_ \
407			|grep "($ac_cv_sizeof_double)" >/dev/null ; then
408			ccvs_cv_unique_float_type_double=no
409		else
410			ccvs_cv_unique_float_type_double=yes\($ac_cv_sizeof_double\)
411		fi])
412	if test $ccvs_cv_unique_float_type_double != no ; then
413		AC_DEFINE( UNIQUE_FLOAT_TYPE_DOUBLE, 1,
414                           [Define if double is the first floating point type
415		            detected with its size.])
416	fi
417	if test $gt_cv_c_long_double != no; then
418		AC_CHECK_SIZEOF(long double)
419		AC_CACHE_CHECK(for uniquely sized long double,
420			ccvs_cv_unique_float_type_long_double,
421			[if set |grep ^ccvs_cv_unique_float_type_ \
422				|grep "($ac_cv_sizeof_long_double)" >/dev/null ; then
423				ccvs_cv_unique_float_type_long_double=no
424			else
425				ccvs_cv_unique_float_type_long_double=yes\($ac_cv_sizeof_long_double\)
426			fi])
427		if test $ccvs_cv_unique_float_type_long_double != no ; then
428			AC_DEFINE(UNIQUE_FLOAT_TYPE_LONG_DOUBLE, 1,
429				  [Define if long double is the first floating point
430				   type detected with its size.])
431		fi
432	fi
433fi
434
435dnl
436dnl The CVS coding standard (as specified in HACKING) is that if it exists
437dnl in SunOS4 and ANSI, we use it.  CVS itself, of course, therefore doesn't
438dnl need HAVE_* defines for such functions, but diff wants them.
439dnl
440AC_DEFINE(HAVE_STRCHR, 1,
441[Define if you have strchr (always for CVS).])
442AC_DEFINE(HAVE_MEMCHR, 1,
443[Define if you have memchr (always for CVS).])
444
445dnl
446dnl Force lib/regex.c to use malloc instead of messing around with alloca
447dnl and define the old re_comp routines that we use.
448dnl
449AC_DEFINE(REGEX_MALLOC, 1,
450[Define to force lib/regex.c to use malloc instead of alloca.])
451AC_DEFINE(_REGEX_RE_COMP, 1,
452[Define to force lib/regex.c to define re_comp et al.])
453dnl
454dnl AC_FUNC_FORK([]) is rather baroque.  It seems to be rather more picky
455dnl than, say, the Single Unix Specification (version 2), which simplifies
456dnl a lot of cases by saying that the child process can't set any variables
457dnl (thus avoiding problems with register allocation) or call any functions
458dnl (thus avoiding problems with whether file descriptors are shared).
459dnl It would be nice if we could just write to the Single Unix Specification.
460dnl I think the only way to do redirection this way is by doing it in the
461dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
462dnl That would appear to have a race condition if the user hits ^C (or
463dnl some other signal) at the wrong time, as main_cleanup will try to use
464dnl stdout/stderr.  So maybe we are stuck with AC_FUNC_FORK([]).
465dnl
466AC_FUNC_FORK([])
467AC_FUNC_CLOSEDIR_VOID
468
469dnl
470dnl Check for shadow password support.
471dnl
472dnl We used to try to determine whether shadow passwords were actually in
473dnl use or not, but the code has been changed to work right reguardless,
474dnl so we can go back to a simple check.
475AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM, 1,
476[Define if you have the getspnam function.]))
477
478AC_FUNC_UTIME_NULL
479AC_SYS_LONG_FILE_NAMES
480
481dnl for debugging code
482CVS_FUNC_PRINTF_PTR
483
484# Try to find connect and gethostbyname.
485AC_CHECK_LIB(nsl, main)
486AC_SEARCH_LIBS(connect, xnet socket inet,
487  AC_DEFINE(HAVE_CONNECT, 1,
488[Define if you have the connect function.]))
489dnl no need to search nsl for gethostbyname here since we should have
490dnl just added libnsl above if we found it.
491AC_SEARCH_LIBS(gethostbyname, netinet)
492
493AC_SUBST(cvs_client_objects)
494
495
496dnl
497dnl begin --with-*
498dnl
499
500dnl
501dnl begin --with-rsh
502dnl
503dnl Many sites no longer desire the use of "rsh" as the default
504dnl remote shell program. They typically favor "ssh" as the default
505
506# What remote shell transport should our client cvs default to using?
507AC_ARG_WITH(
508  [rsh],
509  AC_HELP_STRING(
510    [--with-rsh],
511    [The default remote shell CVS will use for :ext: transport
512     (default ssh)]), ,
513  [with_rsh="ssh rsh"])
514
515if test no = "$with_rsh"; then
516  AC_MSG_WARN([Failed to find usable remote shell. Using 'rsh'.])
517  with_rsh=rsh
518elif test yes = "$with_rsh"; then
519  # Make --with-rsh mean the same thing as --with-rsh=rsh
520  with_rsh=rsh
521fi
522
523if echo $with_rsh |grep ^/ >/dev/null; then
524  # If $with_rsh is an absolute path, issue a warning if the executable
525  # doesn't exist or isn't usable, but then trust the user and use it
526  # regardless
527  with_default_rsh=$with_rsh
528  AC_MSG_CHECKING([for a remote shell])
529  if ! test -f $with_rsh \
530      || ! test -x $with_rsh; then
531    # warn the user that they may encounter problems
532    AC_MSG_WARN([$with_rsh is not a path to an executable file])
533  fi
534else
535  # Search for a remote shell
536  AC_CHECK_PROGS([with_default_rsh], [$with_rsh], "rsh")
537fi
538
539AC_DEFINE_UNQUOTED(
540  [RSH_DFLT], ["$with_default_rsh"],
541  [The default remote shell to use, if one does not specify the
542   CVS_RSH environment variable.])
543RSH_DFLT=$with_default_rsh
544AC_SUBST(RSH_DFLT)
545dnl done with finding a default CVS_RSH value
546dnl
547dnl end --with-rsh
548dnl
549
550dnl
551dnl begin --with-editor
552dnl
553dnl Set the default editor to use for log messages
554dnl
555
556AC_ARG_VAR(
557  [EDITOR],
558  [The text editor CVS will use by default for log messages.])
559
560# Let the confiscator request a specific editor
561AC_ARG_WITH(
562  [editor],
563  AC_HELP_STRING(
564    [--with-editor],
565    [The default text editor CVS should use for log messages
566     (default autoselects)]), ,
567  [with_editor=yes])
568
569# If --with-editor was supplied with an argument, let it override $EDITOR from
570# the user's environment.  We need to unset EDITOR here because AC_CHECK_PROGS
571# will let the value of EDITOR ride when it is set rather than searching.  We
572# ignore the --without-editor case since it will be caught below.
573if test -n "$EDITOR" && test yes != $with_editor; then
574  AS_UNSET([EDITOR])
575fi
576
577# Set the default when --with-editor wasn't supplied or when it was supplied
578# without an argument.
579if test yes = $with_editor; then
580  with_editor="vim vi emacs nano pico edit"
581fi
582
583if echo $with_editor |grep ^/ >/dev/null; then
584  # If $with_editor is an absolute path, issue a warning if the executable
585  # doesn't exist or isn't usable, but then trust the user and use it
586  # regardless
587  EDITOR=$with_editor
588  AC_MSG_CHECKING([for an editor])
589  AC_MSG_RESULT([$EDITOR])
590  if ! test -f $with_editor \
591      || ! test -x $with_editor; then
592    # warn the user that they may encounter problems
593    AC_MSG_WARN([\`$with_editor' is not a path to an executable file])
594  fi
595elif test no != "${with_editor}"; then
596  # Search for an editor
597  AC_CHECK_PROGS([EDITOR], [$with_editor], [no])
598    if test no = "${EDITOR}"; then
599      AC_MSG_ERROR([
600    Failed to find a text file editor.  CVS cannot be compiled
601    without a default log message editor.  Searched for
602    \`$with_editor'.  Try \`configure --with-editor'.])
603    fi
604else
605  AC_MSG_ERROR([
606    CVS cannot be compiled without a default log message editor.
607    Try \`configure --with-editor'.])
608fi
609
610dnl FIXME - Using --without-editor will probably break a compile at
611dnl the moment, but maybe it is reasonable for someone to want to
612dnl compile a CVS executable that refuses to run if no $EDITOR,
613dnl $CVS_EDITOR, or -e option is specified?  Making a preliminary
614dnl design decision in this direction, subject to discussion.
615dnl
616dnl Still don't know if the above would be useful, but we shouldn't
617dnl be able to get here any longer without $EDITOR defined due to the
618dnl error checking above.
619AC_DEFINE_UNQUOTED(
620  [EDITOR_DFLT], ["$EDITOR"],
621  [The default editor to use, if one does not specify the "-e" option
622   to cvs, or does not have an EDITOR environment variable.  If this
623   is not set to an absolute path to an executable, use the shell to
624   find where the editor actually is.  This allows sites with
625   /usr/bin/vi or /usr/ucb/vi to work equally well (assuming that their
626   PATH is reasonable).])
627
628dnl
629dnl done finding an editor
630dnl
631dnl end --with-editor
632dnl
633
634
635
636dnl
637dnl --with-hardcoded-pam-service-name
638dnl
639AC_ARG_WITH(
640  [hardcoded-pam-service-name],
641  AC_HELP_STRING(
642    [--with-hardcoded-pam-service-name],
643    [Use this to hard code a service name for PAM CVS authentication.  The
644     special name, `program_name', will cause CVS to use whatever name it
645     was invoked as as the service name.  (defaults to `cvs')]),,
646    [with_hardcoded_pam_service_name=cvs])
647
648if test "x$with_hardcoded_pam_service_name" = xno ||
649   test "x$with_hardcoded_pam_service_name" = xprogram_name; then
650  AC_DEFINE([PAM_SERVICE_NAME], [program_name],
651    [Define to set a service name for PAM.  This must be defined.  Define to
652     `program_name', without the quotes, to use whatever name CVS was invoked
653      as.  Otherwise, define to a double-quoted literal string, such as
654      `"cvs"'.])
655else
656  if test x"$with_hardcoded_pam_service_name" = xyes; then
657    with_hardcoded_pam_service_name=cvs
658  fi
659  AC_DEFINE_UNQUOTED([PAM_SERVICE_NAME], ["$with_hardcoded_pam_service_name"])
660fi
661
662
663
664dnl
665dnl Find a temporary directory
666dnl
667AC_ARG_WITH(
668  [tmpdir],
669  AC_HELP_STRING(
670    [--with-tmpdir],
671    [The temporary directory CVS should use as a default
672     (default autoselects)]))
673
674AC_MSG_CHECKING([for temporary directory])
675if test -z "$with_tmpdir" || test yes = "$with_tmpdir"; then
676  for with_tmpdir in /tmp /var/tmp no; do
677    if test -d "$with_tmpdir" && test -x "$with_tmpdir" \
678        && test -w "$with_tmpdir" && test -r "$with_tmpdir"; then
679      break
680    fi
681  done
682  if test no = "$with_tmpdir"; then
683    AC_MSG_WARN([Failed to find usable temporary directory.  Using '/tmp'.])
684    with_tmpdir=/tmp
685  fi
686  AC_MSG_RESULT([$with_tmpdir])
687elif ! echo "$with_tmpdir" |grep '^[[\\/]]'; then
688  AC_MSG_RESULT([$with_tmpdir])
689  AC_MSG_ERROR([--with-tmpdir requires an absolute path.])
690elif ! test -d "$with_tmpdir" || ! test -x "$with_tmpdir" \
691        || ! test -w "$with_tmpdir" || ! test -r "$with_tmpdir"; then
692  AC_MSG_RESULT([$with_tmpdir])
693  AC_MSG_WARN(
694    [User supplied temporary directory ('$with_tmpdir') does not
695     exist or lacks sufficient permissions for read/write.])
696fi
697
698AC_DEFINE_UNQUOTED(
699  [TMPDIR_DFLT], ["$with_tmpdir"],
700  [Directory used for storing temporary files, if not overridden by
701   environment variables or the -T global option.  There should be little
702   need to change this (-T is a better mechanism if you need to use a
703   different directory for temporary files).])
704
705dnl
706dnl done finding tmpdir
707dnl
708
709
710dnl
711dnl Get default umask
712dnl
713
714AC_ARG_WITH(
715  [umask],
716  AC_HELP_STRING(
717    [--with-umask],
718    [Set the umask CVS will use by default in the repository (default 002)]))
719
720if test -z "$with_umask" || test yes = "$with_umask"; then
721  with_umask=002
722elif test no = "$with_umask"; then
723  with_umask=000
724fi
725
726AC_DEFINE_UNQUOTED(
727  [UMASK_DFLT], [$with_umask],
728  [The default umask to use when creating or otherwise setting file or
729   directory permissions in the repository.  Must be a value in the
730   range of 0 through 0777.  For example, a value of 002 allows group
731   rwx access and world rx access; a value of 007 allows group rwx
732   access but no world access.  This value is overridden by the value
733   of the CVSUMASK environment variable, which is interpreted as an
734   octal number.])
735
736dnl
737dnl Done setting default umask
738dnl
739
740dnl
741dnl Set CVS Administrator Group
742dnl
743AC_ARG_WITH(
744  [cvs-admin-group],
745  AC_HELP_STRING(
746    [--with-cvs-admin-group=GROUP],
747    [The CVS admin command is restricted to the members of this group.
748     If this group does not exist, all users are allowed to run CVS admin.
749     To disable the CVS admin command for all users, create an empty group
750     by specifying the --with-cvs-admin-group= option.  To disable access
751     control for CVS admin, run configure with the --without-cvs-admin-group
752     option. (default 'cvsadmin')]), ,
753  [with_cvs_admin_group=cvsadmin])
754
755if test yes = "$with_cvs_admin_group"; then
756  with_cvs_admin_group=cvsadmin
757fi
758if test no != "$with_cvs_admin_group"; then
759  dnl FIXME We should warn if the group doesn't exist
760  AC_DEFINE_UNQUOTED(
761    [CVS_ADMIN_GROUP], ["$with_cvs_admin_group"],
762    [The CVS admin command is restricted to the members of the group
763     CVS_ADMIN_GROUP.  If this group does not exist, all users are
764     allowed to run CVS admin.  To disable the CVS admin command for
765     all users, create an empty CVS_ADMIN_GROUP by running configure
766     with the --with-cvs-admin-group= option.  To disable access control
767     for CVS admin, run configure with the --without-cvs-admin-group
768     option in order to comment out the define below.])
769fi
770
771dnl
772dnl Done setting CVS Administrator Group
773dnl
774
775dnl
776dnl Set the NDBM library to use.
777dnl
778dnl XXX - FIXME - FIXME - FIXME - XXX
779dnl
780dnl This is very bad.  It should really autodetect an appropriate NDBM library
781dnl and, if it doesn't find one, decide to use MY_NDBM.  I'm am defining
782dnl this here since this is no worse than it worked when it was in options.h
783dnl and I am cleaning out options.h so that the Windows version of CVS will
784dnl compile properly for the next release.
785dnl
786dnl That's why this option is in the --with-* section rather than the
787dnl --enable-* section.
788dnl
789dnl XXX - FIXME - FIXME - FIXME - XXX
790dnl
791AC_ARG_ENABLE(
792  [cvs-ndbm],
793  AC_HELP_STRING(
794    [--enable-cvs-ndbm],
795    [Use the NDBM library distributed with CVS rather than attempting to use
796     a system NDBM library.  Disabling this may not work.  (default)]), ,
797  [enable_cvs_ndbm=yes])
798if test no != "$enable_cvs_ndbm"; then
799  AC_DEFINE(
800    [MY_NDBM], [1],
801    [By default, CVS stores its modules and other such items in flat
802     text files (MY_NDBM enables this).  Turning off MY_NDBM causes CVS
803     to look for a system-supplied ndbm database library and use it
804     instead.  That may speed things up, but the default setting
805     generally works fine too.])
806fi
807
808dnl
809dnl Done selecting NDBM library.
810dnl
811
812
813
814dnl
815dnl end --with-*
816dnl
817
818
819dnl
820dnl begin --enables
821dnl
822
823
824dnl
825dnl begin --enable-client
826dnl
827
828# Check for options requesting client and server feature. If none are
829# given and we have connect(), we want the full client & server arrangement.
830AC_ARG_ENABLE(
831  [client],
832  AC_HELP_STRING(
833    [--enable-client],
834    [Include code for running as a remote client (default)]), ,
835  [enable_client=$ac_cv_search_connect])
836if test no != "$enable_client"; then
837  AC_DEFINE(
838    [CLIENT_SUPPORT], [1],
839    [Define if you want CVS to be able to be a remote repository client.])
840fi
841
842dnl
843dnl end --enable-client
844dnl
845
846
847dnl
848dnl begin --enable-password-authenticated-client
849dnl
850AC_ARG_ENABLE(
851  [password-authenticated-client],
852  AC_HELP_STRING(
853    [--enable-password-authenticated-client],
854    [Enable pserver as a remote access method in the CVS client
855     (default)]), ,
856  [enable_password_authenticated_client=$enable_client])
857
858if test xno != "x$enable_password_authenticated_client"; then
859  if test xno != "x$enable_client"; then
860    AC_DEFINE(
861      [AUTH_CLIENT_SUPPORT], [1],
862      [Enable AUTH_CLIENT_SUPPORT to enable pserver as a remote access
863       method in the CVS client (default)])
864  else
865    AC_MSG_WARN(
866      [--enable-password-authenticated-client is meaningless with
867       the CVS client disabled (--disable-client)])
868  fi
869fi
870
871dnl
872dnl begin --enable-password-authenticated-client
873dnl
874
875
876dnl
877dnl begin --enable-server
878dnl
879
880dnl
881dnl Give the confiscator control over whether the server code is compiled
882dnl
883AC_ARG_ENABLE(
884  [server],
885  AC_HELP_STRING(
886    [--enable-server],
887    [Include code for running as a server (default)]), ,
888  [enable_server=$ac_cv_search_connect])
889
890if test no != "$enable_server"; then
891  AC_DEFINE(
892    [SERVER_SUPPORT], [1],
893    [Define if you want CVS to be able to serve repositories to remote
894     clients.])
895
896  dnl
897  dnl The auth server needs to be able to check passwords against passwd
898  dnl file entries, so we only #define AUTH_SERVER_SUPPORT if we can
899  dnl find the crypt function.
900  dnl
901  AC_SEARCH_LIBS(
902    [crypt], [crypt],
903    [AC_DEFINE(
904       [HAVE_CRYPT], [1],
905       [Define if you have the crypt function.])
906     AC_DEFINE(
907       [AUTH_SERVER_SUPPORT], [1],
908       [Define if you want to use the password authenticated server.])dnl
909  ])dnl AC_SEARCH_LIBS
910
911  dnl
912  dnl Allow the configurer to enable server flowcontrol.  Read the help
913  dnl strings below for a full explanation.
914  dnl
915  AC_ARG_ENABLE(
916    [server-flow-control],
917    AC_HELP_STRING(
918      [--enable-server-flow-control],
919      [If you are working with a large remote repository and a 'cvs
920       checkout' is swamping your network and memory, define these to
921       enable flow control.  You may optionally pass a low water mark
922       in bytes and a high water mark in bytes, separated by commas.
923       (default is enabled 1M,2M)]),
924    [if test yes = $enable_server_flow_control; then
925       enable_server_flow_control=1M,2M
926     fi],
927    [enable_server_flow_control=1M,2M])
928  if test no != $enable_server_flow_control; then
929    ccvs_lwm=`expr "$enable_server_flow_control" : '\(.*\),'`
930    ccvs_hwm=`expr "$enable_server_flow_control" : '.*,\(.*\)'`
931    ccvs_lwm_E=`expr "$ccvs_lwm" : '[[0-9]][[0-9]]*\(.*\)'`
932    ccvs_lwm=`expr "$ccvs_lwm" : '\([[0-9]][[0-9]]*\)'`
933    test "" != "$ccvs_lwm" || ccvs_lwm_E="?"
934    case $ccvs_lwm_E in
935        G) ccvs_lwm="$ccvs_lwm * 1024 * 1024 * 1024";;
936        M) ccvs_lwm="$ccvs_lwm * 1024 * 1024";;
937        k) ccvs_lwm="$ccvs_lwm * 1024";;
938        b | '') ;;
939        *) AC_MSG_ERROR([Can't parse argument to --enable-server-flow-control
940                        ('$enable_server_flow_control') as <lwm>,<hwm>])
941      esac
942    ccvs_hwm_E=`expr "$ccvs_hwm" : '[[0-9]][[0-9]]*\(.*\)'`
943    ccvs_hwm=`expr "$ccvs_hwm" : '\([[0-9]][[0-9]]*\).*'`
944    test "" != "$ccvs_hwm" || ccvs_hwm_E="?"
945    case $ccvs_hwm_E in
946        G) ccvs_hwm="$ccvs_hwm * 1024 * 1024 * 1024";;
947        M) ccvs_hwm="$ccvs_hwm * 1024 * 1024";;
948        k) ccvs_hwm="$ccvs_hwm * 1024";;
949        b | '') ccvs_hwm="$ccvs_hwm";;
950        *) AC_MSG_ERROR([Can't parse argument to --enable-server-flow-control
951                        ('$enable_server_flow_control') as <lwm>,<hwm>])
952      esac
953
954    AC_DEFINE(
955      [SERVER_FLOWCONTROL], [1],
956      [If you are working with a large remote repository and a 'cvs
957       checkout' is swamping your network and memory, define these to
958       enable flow control.  You will end up with even less probability of
959       a consistent checkout (see Concurrency in cvs.texinfo), but CVS
960       doesn't try to guarantee that anyway.  The master server process
961       will monitor how far it is getting behind, if it reaches the high
962       water mark, it will signal the child process to stop generating
963       data when convenient (ie: no locks are held, currently at the
964       beginning of a new directory).  Once the buffer has drained
965       sufficiently to reach the low water mark, it will be signalled to
966       start again.])
967    AC_DEFINE_UNQUOTED(
968      [SERVER_LO_WATER], [($ccvs_lwm)],
969      [The low water mark in bytes for server flow control.  Required if
970       SERVER_FLOWCONTROL is defined, and useless otherwise.])
971    AC_DEFINE_UNQUOTED(
972      [SERVER_HI_WATER], [($ccvs_hwm)],
973      [The high water mark in bytes for server flow control.  Required if
974       SERVER_FLOWCONTROL is defined, and useless otherwise.])
975  fi # enable_server_flow_control
976fi # enable_server
977
978dnl
979dnl end --enable-server
980dnl
981
982
983dnl
984dnl begin --enable-proxy
985dnl
986
987dnl
988dnl Give the confiscator control over whether the proxy server code is compiled
989dnl
990AC_ARG_ENABLE(
991  [proxy],
992  AC_HELP_STRING(
993    [--enable-proxy],
994    [Include code for running as a transparent proxy server.  Disabling this
995     may produce a slight performance gain on some systems, at the expense of
996     write proxy support. (default)]), ,
997  [if test xno != "x$enable_client" && test xno != "x$enable_server"; then
998     enable_proxy=yes
999   else
1000     enable_proxy=no
1001   fi])
1002
1003if test no != "$enable_proxy"; then
1004  if test xno = "x$enable_client" || test xno = "x$enable_server"; then
1005    AC_MSG_WARN(
1006      [--enable-proxy is meaningless when either the CVS client or the
1007       CVS server is disabled (--disable-client and --disable-server).])
1008  else
1009    AC_DEFINE(
1010      [PROXY_SUPPORT], [1],
1011      [Define if you want CVS to be able to serve as a transparent proxy for
1012       write operations.  Disabling this may produce a slight performance gain
1013       on some systems, at the expense of write proxy support.])
1014  fi
1015fi
1016dnl
1017dnl end --enable-proxy
1018dnl
1019
1020
1021dnl
1022dnl begin --enable-pam
1023dnl
1024
1025dnl
1026dnl Check if PAM authentication is enabled
1027dnl
1028AC_ARG_ENABLE(
1029  [pam],
1030  AC_HELP_STRING(
1031    [--enable-pam],
1032    [Use to enable system authentication with PAM instead of using the
1033    simple getpwnam interface.  This allows authentication (in theory)
1034    with any PAM module, e.g. on systems with shadow passwords or via LDAP]), ,
1035  [enable_pam=no]
1036  )
1037
1038if test yes = $enable_pam; then
1039  ac_pam_header_available=
1040
1041  AC_CHECK_HEADER([security/pam_appl.h], [
1042    AC_DEFINE([HAVE_SECURITY_PAM_APPL_H], 1, [Define to 1 if security/pam_appl.h is available])
1043    ac_pam_header_available=1])
1044
1045  if test -z "$ac_pam_header_available"; then
1046  AC_CHECK_HEADER([pam/pam_appl.h], [
1047    AC_DEFINE([HAVE_PAM_PAM_APPL_H], 1, [Define to 1 if pam/pam_appl.h is available])
1048    ac_pam_header_available=1])
1049  fi
1050
1051  if test -z "$ac_pam_header_available"; then
1052    AC_MSG_ERROR([Could not find PAM headers])
1053  else
1054    AC_DEFINE(HAVE_PAM, 1,
1055    [Define to enable system authentication with PAM instead of using the
1056    simple getpwnam interface.  This allows authentication (in theory)
1057    with any PAM module, e.g. on systems with shadow passwords or via LDAP])
1058    AC_CHECK_LIB(pam, pam_start, [LIBS="${LIBS} -lpam"],
1059      AC_MSG_ERROR([Could not find PAM libraries but the headers exist.
1060      Give the --disable-pam option to compile without PAM support (or fix
1061      your broken configuration)])
1062    )
1063  fi
1064fi
1065
1066dnl
1067dnl end --enable-pam
1068dnl
1069
1070
1071dnl
1072dnl begin --enable-case-sensitivity
1073dnl
1074
1075AC_ARG_ENABLE(
1076  [case-sensitivity],
1077  AC_HELP_STRING(
1078    [--enable-case-sensitivity],
1079    [Force CVS to expect a case sensitive file system.  Enabling this on a case
1080     insensitive system should have little effect on the server or client
1081     operation, though client users may ocassionally be suprised that the CVS
1082     server appears to be case sensitive.  Disabling this for a case sensitive
1083     server disables server support for case insensitive clients, which can
1084     confuse all users of case insensitive clients contacting the server.
1085     Disabling this for a case sensitive client will cause the client to ask
1086     servers to behave case insensitively, which could cause confusion for
1087     users, but also probably no real harm.  (default autoselects based on the
1088     case sensitivity of the file system containing the current working
1089     directory)]),
1090    [case "$enable_case_sensitivity" in
1091       yes | no | auto) ;;
1092       *)
1093          AC_MSG_ERROR([Unrecognized argument to --enable-case-sensitivity: \`$enable_case_sensitivity'.  Acceptable values are \`yes', \`no', and \`auto'.])
1094          ;;
1095     esac],
1096  [enable_case_sensitivity=auto])
1097
1098acx_forced=' (forced)'
1099AC_MSG_CHECKING([for a case sensitive file system])
1100if test $enable_case_sensitivity = auto; then
1101  dnl
1102  dnl Check for a case insensitive filesystem, like Mac OS X and Windows have.
1103  dnl
1104  AC_CACHE_VAL([acx_cv_case_sensitive],
1105  [ rm -f ac_TEST_filenames_CASE_sensitive
1106    echo foo >ac_test_filenames_case_sensitive
1107    if test -f ac_TEST_filenames_CASE_sensitive; then
1108      acx_cv_case_sensitive=no
1109    else
1110      acx_cv_case_sensitive=yes
1111    fi
1112    rm ac_test_filenames_case_sensitive
1113  ])
1114  enable_case_sensitivity=$acx_cv_case_sensitive
1115  acx_forced=
1116fi
1117AC_MSG_RESULT([$enable_case_sensitivity$acx_forced])
1118if test $enable_case_sensitivity = no; then
1119  AC_DEFINE([FILENAMES_CASE_INSENSITIVE], [1],
1120            [Define if this executable will be running on case insensitive
1121             file systems.  In the client case, this means that it will request
1122             that the server pretend to be case insensitive if it isn't
1123             already.])
1124  dnl Compile fncase.c (containing fncase() & fncmp()) to handle file name
1125  dnl comparisons on case insensitive filesystems.
1126  AC_LIBOBJ(fncase)
1127fi
1128
1129dnl
1130dnl end --enable-case-sensitivity
1131dnl
1132
1133
1134dnl
1135dnl begin --enable-encryption
1136dnl
1137
1138dnl
1139dnl Use --enable-encryption to turn on encryption support, but ignore this
1140dnl option unless either client or server is enabled.
1141dnl
1142AC_ARG_ENABLE(
1143  [encryption],
1144  AC_HELP_STRING(
1145    [--enable-encryption],
1146    [Enable encryption support (disabled by default)]), ,
1147  [enable_encryption=no])
1148if test "x$enable_encryption" = xyes; then
1149  if test xno = "x$with_client" && test xno = "x$with_server"; then
1150    AC_MSG_WARN(
1151      [--enable-encryption is meaningless when neither the CVS client
1152       nor the CVS server is enabled (--disable-client and --disable-server).])
1153  else
1154    AC_DEFINE(
1155      [ENCRYPTION], [1],
1156      [Define to enable encryption support.])
1157  fi
1158fi
1159
1160dnl
1161dnl end --enable-encryption
1162dnl
1163
1164
1165dnl
1166dnl begin --enable-force-editor
1167dnl
1168
1169AC_ARG_ENABLE(
1170  [force-editor],
1171  AC_HELP_STRING(
1172    [--enable-force-editor],
1173    [When committing or importing files, you must enter a log message.
1174     Normally, you can do this either via the -m flag on the command
1175     line, the -F flag on the command line, or an editor will be started
1176     for you.  If you like to use logging templates (the rcsinfo file
1177     within the $CVSROOT/CVSROOT directory), you might want to force
1178     people to use the editor even if they specify a message with -m or
1179     -F.  --enable-force-editor will cause the -m or -F message to be
1180     appended to the temp file when the editor is started. (disabled
1181     by default)]), ,
1182  [enable_force_editor=no])
1183
1184if test yes = "$enable_force_editor"; then
1185  AC_DEFINE(
1186    [FORCE_USE_EDITOR], [1],
1187    [When committing or importing files, you must enter a log message.
1188    Normally, you can do this either via the -m flag on the command
1189    line, the -F flag on the command line, or an editor will be started
1190    for you.  If you like to use logging templates (the rcsinfo file
1191    within the $CVSROOT/CVSROOT directory), you might want to force
1192    people to use the editor even if they specify a message with -m or
1193    -F.  Enabling FORCE_USE_EDITOR will cause the -m or -F message to be
1194    appended to the temp file when the editor is started.])
1195fi
1196
1197dnl
1198dnl end --enable-force-editor
1199dnl
1200
1201
1202dnl
1203dnl begin --enable-lock-compatibility
1204dnl
1205
1206# Check for options requesting client and server feature. If none are
1207# given and we have connect(), we want the full client & server arrangement.
1208AC_ARG_ENABLE(
1209  [lock-compatibility],
1210  AC_HELP_STRING(
1211    [--enable-lock-compatibility],
1212    [Include locking code which prevents versions of CVS earlier than 1.12.4
1213     directly accessing the same repositiory as this executable from ignoring
1214     this executable's promotable read locks.  If only CVS versions 1.12.4 and
1215     later will be accessing your repository directly (as a server or locally),
1216     you can safely disable this option in return for fewer disk accesses and a
1217     small speed increase.  Disabling this option when versions of CVS earlier
1218     than 1,12,4 _will_ be accessing your repository, however, is *VERY* *VERY*
1219     *VERY* dangerous and could result in data loss.  (enabled by default)]),,
1220  [enable_lock_compatibility=yes])
1221
1222if test x$enable_lock_compatibility = xyes; then
1223  AC_DEFINE([LOCK_COMPATIBILITY], [1],
1224    [Define to include locking code which prevents versions of CVS earlier than
1225     1.12.4 directly accessing the same repositiory as this executable from
1226     ignoring this executable's promotable read locks.  If only CVS versions
1227     1.12.4 and later will be accessing your repository directly (as a server
1228     or locally), you can safely disable this option in return for fewer disk
1229     accesses and a small speed increase.  Disabling this option when versions
1230     of CVS earlier than 1,12,4 _will_ be accessing your repository, however,
1231     is *VERY* *VERY* *VERY* dangerous and could result in data loss.
1232
1233     As such, by default, CVS is compiled with this code enabled.  If you are
1234     sure you would like this code disabled, you can disable it by passing the
1235     "--disable-lock-compatibility" option to configure or by commenting out
1236     the lines below.])
1237fi
1238
1239dnl
1240dnl end --enable-lock-compatibility
1241dnl
1242
1243
1244dnl
1245dnl begin --enable-rootcommit
1246dnl
1247
1248dnl
1249dnl I don't like this here, but I don't really like options.h, either.
1250dnl Besides, this is causing some problems currently when compiling under
1251dnl Windows and moving it here should avoid the issue (the wrong options.h
1252dnl is being used).
1253dnl
1254dnl I don't like making this a runtime option either.  I think I just don't
1255dnl like making it easy to get to, but putting it here goes along with the
1256dnl Autoconf ideal.
1257dnl
1258AC_ARG_ENABLE(
1259  [rootcommit],
1260  AC_HELP_STRING(
1261    [--enable-rootcommit],
1262    [Allow the root user to commit files (disabled by default)]), ,
1263  [enable_rootcommit=no])
1264if test "$enable_rootcommit" = no; then
1265  AC_DEFINE(
1266    [CVS_BADROOT], [1],
1267    [When committing a permanent change, CVS and RCS make a log entry of
1268     who committed the change.  If you are committing the change logged
1269     in as "root" (not under "su" or other root-priv giving program),
1270     CVS/RCS cannot determine who is actually making the change.
1271
1272     As such, by default, CVS prohibits changes committed by users
1273     logged in as "root".  You can disable checking by passing the
1274     "--enable-rootcommit" option to configure or by commenting out the
1275     lines below.])
1276fi
1277
1278dnl
1279dnl end --enable-rootcommit
1280dnl
1281
1282dnl
1283dnl begin --enable-old-info-support
1284dnl
1285AC_ARG_ENABLE(
1286  [old-info-support],
1287  AC_HELP_STRING(
1288    [--enable-old-info-format-support],
1289    [Enable support for the pre 1.12.1 *info scripting hook format strings.
1290     Disable this option for a smaller executable once your scripting
1291     hooks have been updated to use the new *info format strings (default).]), ,
1292  [enable_old_info_format_support=yes])
1293if test "$enable_old_info_format_support" = yes; then
1294  AC_DEFINE(
1295    [SUPPORT_OLD_INFO_FMT_STRINGS], [1],
1296    [Enable support for the pre 1.12.1 *info scripting hook format strings.
1297     Disable this option for a smaller executable once your scripting
1298     hooks have been updated to use the new *info format strings by passing
1299     "--disable-old-info-format-support" option to configure or by commenting
1300     out the line below.])
1301fi
1302
1303dnl
1304dnl end --enable-old-info-support
1305dnl
1306
1307
1308dnl
1309dnl begin --enable-config-override
1310dnl
1311
1312AC_ARG_ENABLE(
1313  [config-override],
1314  AC_HELP_STRING(
1315    [--enable-config-override],
1316    [Set to a comma-separated list of paths to directories (designated by
1317     trailing `/') and files, specifies the path prefixes (for directories) and
1318     paths to files the CVS server commands will allow configuration to be read
1319     from.  Specify `--enable-config-override=no' to disable config file
1320     overrides completely and `--enable-config-override=/' or simply
1321     `--enable-config-override' to allow all paths.  (Defaults to
1322     `SYSCONFDIR/cvs.conf,SYSCONFDIR/cvs/')]),,
1323  [# $sysconfdir may still contain variable references.  By default, this will
1324   # be to $prefix, and $prefix won't be set to its default value until later.
1325   # Compromise without setting $prefix for the rest of the file.
1326   cvs_save_prefix=$prefix
1327   if test "X$prefix" = XNONE; then
1328     prefix=$ac_prefix_default
1329   fi
1330   eval enable_config_override=`echo $sysconfdir/cvs.conf,$sysconfdir/cvs/`
1331   prefix=$cvs_save_prefix])
1332
1333if test x"$enable_config_override" = xyes; then
1334  enable_config_override=/
1335fi
1336
1337if test x"$enable_config_override" = xno; then :; else
1338  save_IFS=$IFS
1339  IFS=,
1340  arrayinit=""
1341  for path in $enable_config_override; do
1342    IFS=$save_IFS
1343    case "$path" in
1344      [[\\/$]]* | ?:[[\\/]]* )
1345	arrayinit="$arrayinit\"$path\", "
1346	;;
1347      *)  AC_MSG_ERROR(
1348          [expected comma separated list of absolute directory
1349           names for --enable-config-override, or \`no', not:
1350           \`$enable_config_override'
1351           (\`$path' invalid.)]);;
1352    esac
1353  done
1354  arrayinit="${arrayinit}NULL"
1355
1356  AC_DEFINE_UNQUOTED(ALLOW_CONFIG_OVERRIDE, [$arrayinit],
1357    [Define this to a NULL terminated list of allowed path prefixes (for
1358     directories) and paths to files the CVS server will allow configuration to
1359     be read from when specified from the command line.])
1360fi
1361
1362dnl
1363dnl end --enable-config-override
1364dnl
1365
1366
1367
1368dnl
1369dnl end --enables
1370dnl
1371
1372
1373
1374dnl For the moment we will assume that all systems which have
1375dnl the unixyness to run configure are unixy enough to do the
1376dnl PreservePermissions stuff.  I have this sinking feeling that
1377dnl things won't be that simple, before long.
1378dnl AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT, 1,
1379dnl [Define if this system supports chown(), link(), and friends.])
1380
1381dnl On cygwin32, we configure like a Unix system, but we need some support
1382dnl libraries.  We do this at the end so that the new libraries are added at
1383dnl the end of LIBS.
1384dnl
1385dnl FIXME: We should be trying to meet the autoconf ideal of checking for
1386dnl the properties of the system rather than the name of the os here.  In other
1387dnl words, we should check the case sensitivty of the system and then for
1388dnl the support functions we are using and which library we find them in.
1389AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
1390[AC_TRY_COMPILE([], [return __CYGWIN32__;],
1391ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
1392if test $ccvs_cv_sys_cygwin32 = yes; then
1393  LIBS="$LIBS -ladvapi32"
1394
1395  dnl On Windows you can only change file times if you can write to
1396  dnl the file.  cygwin32 should really handle this for us, but as of
1397  dnl January 1998 it doesn't.
1398  AC_DEFINE(UTIME_EXPECTS_WRITABLE, 1,
1399[Define if utime requires write access to the file (true on Windows,
1400but not Unix).])
1401
1402  dnl On Windows we must use setmode to change between binary and text
1403  dnl mode.  This probably doesn't really require two macro definitions
1404  AC_DEFINE(USE_SETMODE_STDOUT, 1,
1405[Define if setmode is required when writing binary data to stdout.])
1406  AC_DEFINE(HAVE_SETMODE, 1,
1407[Define if the diff library should use setmode for binary files.])
1408fi
1409
1410dnl associate the setting of the execute bit with the individual scripts
1411AC_CONFIG_FILES(contrib/validate_repo, [chmod +x contrib/validate_repo])
1412AC_CONFIG_FILES(contrib/clmerge, [chmod +x contrib/clmerge])
1413AC_CONFIG_FILES(contrib/cln_hist, [chmod +x contrib/cln_hist])
1414dnl AC_CONFIG_FILES(contrib/commit_prep, [chmod +x contrib/commit_prep])
1415dnl AC_CONFIG_FILES(contrib/cvs_acls, [chmod +x contrib/cvs_acls])
1416dnl AC_CONFIG_FILES(contrib/log, [chmod +x contrib/log])
1417dnl AC_CONFIG_FILES(contrib/log_accum, [chmod +x contrib/log_accum])
1418dnl AC_CONFIG_FILES(contrib/mfpipe, [chmod +x contrib/mfpipe])
1419AC_CONFIG_FILES(contrib/pvcs2rcs, [chmod +x contrib/pvcs2rcs])
1420AC_CONFIG_FILES(contrib/rcs2log:contrib/rcs2log.sh, [chmod +x contrib/rcs2log])
1421dnl AC_CONFIG_FILES(contrib/rcslock, [chmod +x contrib/rcslock])
1422AC_CONFIG_FILES(contrib/sccs2rcs, [chmod +x contrib/sccs2rcs])
1423AC_CONFIG_FILES(doc/mkman:doc/mkman.pl, [chmod +x doc/mkman])
1424
1425dnl the bulk files
1426AC_CONFIG_FILES([Makefile \
1427	  contrib/Makefile \
1428	  diff/Makefile \
1429	  doc/Makefile \
1430	  lib/Makefile \
1431	  man/Makefile \
1432	  src/Makefile])
1433
1434dnl and we're done
1435AC_OUTPUT
1436
1437
1438
1439# Report the state of this version of CVS if this is from dev.
1440m4_bmatch(m4_defn([AC_PACKAGE_VERSION]),  [[0-9]*\.[0-9]*\.[0-9]*\.[0-9]],
1441[    cat <<EOF
1442
1443You are about to use an unreleased version of CVS.  Be sure to
1444read the relevant mailing lists, most importantly <info-cvs@nongnu.org>.
1445
1446Below you will find information on the status of this version of CVS.
1447
1448
1449EOF
1450    sed -n '/^\* Status/,$p' $srcdir/BUGS
1451])
1452