]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/cvs/configure.in
This commit was generated by cvs2svn to compensate for changes in r92386,
[FreeBSD/FreeBSD.git] / contrib / cvs / configure.in
1 dnl configure.in for cvs
2 AC_INIT(src/cvs.h)
3 AM_INIT_AUTOMAKE(cvs, 1.11.1p1)
4 AC_PREREQ(2.13)
5 AC_PREFIX_PROGRAM(cvs)
6 AM_CONFIG_HEADER(config.h src/options.h)
7
8 AC_PROG_AWK
9 AC_PROG_CC
10 AC_PROG_INSTALL
11 AC_PROG_MAKE_SET
12 # Automake's more advanced version of AC_PROG_RANLIB
13 AC_PROG_RANLIB
14 AC_PROG_YACC
15 AC_PROG_LN_S
16
17 AC_PATH_PROG(PERL, perl, no)
18 AC_PATH_PROG(CSH, csh, no)
19 AC_PATH_PROG(PR, pr, no)
20 # For diff/util.c
21 if test x"$PR" != xno; then
22         AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR"], [Path to the pr utility])
23 fi
24
25 dnl FIXME This is truly gross.
26 missing_dir=`cd $ac_aux_dir && pwd`
27 dnl FIXME I pulled this default list from sanity.sh.  Perhaps these lists
28 dnl can be stored in one location?
29 glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
30 AC_PATH_PROGS(ROFF, groff roff, $missing_dir/missing roff, $glocs)
31 AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
32 AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)
33
34 AC_SYS_INTERPRETER
35 if test X"$ac_cv_sys_interpreter" != X"yes" ; then
36   # silly trick to avoid problems in AC macros...
37   ac_msg='perl scripts using #! may not be invoked properly'
38   AC_MSG_WARN($ac_msg)
39 fi
40
41 # BSD's logo is a devil for a reason, hey?
42 AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
43 [if test ! -d ac_test_dir ; then
44         AC_TRY_COMMAND([mkdir ac_test_dir])
45 fi
46 cat >conftestmake <<EOF
47 VPATH = ac_test_dir
48 ac_test_target: ac_test_dep
49         echo BSD VPATH bug present >&2
50 ac_test_dep: ac_test_dep_dep
51 EOF
52 touch ac_test_dir/ac_test_dep_dep
53 touch ac_test_dir/ac_test_dep
54 touch ac_test_target
55 # Don't know why, but the following test doesn't work under FreeBSD 4.2
56 # without this sleep command
57 sleep 1
58 if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
59         ccvs_cv_bsd_make_vpath_bug=yes
60 else
61         ccvs_cv_bsd_make_vpath_bug=no
62 fi
63 AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
64 # We also don't need to worry about the bug when $srcdir = $builddir
65 AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
66                 test $ccvs_cv_bsd_make_vpath_bug = no \
67                 || test $srcdir = .)
68
69 AC_AIX
70 AC_MINIX
71 AC_ISC_POSIX
72 if test "$ISC" = yes; then
73 CFLAGS="$CFLAGS -D_SYSV3"
74 LIBS="-lcrypt $LIBS"
75 fi
76
77 AC_HEADER_DIRENT
78 AC_HEADER_STDC
79 AC_HEADER_SYS_WAIT
80 AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
81                  limits.h sys/file.h \
82                  sys/param.h sys/select.h sys/time.h sys/timeb.h \
83                  io.h direct.h sys/bsdtypes.h sys/resource.h syslog.h)
84 AC_HEADER_STAT
85 AC_HEADER_TIME
86
87 AC_C_CONST
88 AC_TYPE_UID_T
89 AC_TYPE_MODE_T
90 AC_TYPE_PID_T
91 AC_TYPE_SIZE_T
92 AC_TYPE_SIGNAL
93
94 AC_STRUCT_ST_BLKSIZE
95 AC_STRUCT_ST_RDEV
96 AC_REPLACE_FUNCS(mkdir rename strstr dup2 strerror valloc waitpid memmove strtoul)
97 AC_CHECK_FUNCS(\
98         fchdir \
99         fchmod \
100         fsync \
101         ftime \
102         ftruncate \
103         getgroups \
104         getpagesize \
105         getpassphrase \
106         gettimeofday \
107         initgroups \
108         mknod \
109         mkstemp \
110         mktemp \
111         putenv \
112         readlink \
113         sigaction \
114         sigblock \
115         sigprocmask \
116         sigsetmask \
117         sigvec \
118         tempnam \
119         timezone \
120         tzset \
121         vprintf \
122         wait3 \
123 )
124 # we only need one of the following
125 AC_CHECK_FUNCS([\
126         nanosleep \
127         usleep \
128         select \
129 ], [break])
130
131 dnl
132 dnl The CVS coding standard (as specified in HACKING) is that if it exists
133 dnl in SunOS4 and ANSI, we use it.  CVS itself, of course, therefore doesn't
134 dnl need HAVE_* defines for such functions, but diff wants them.
135 dnl
136 AC_DEFINE(HAVE_STRCHR)
137 AC_DEFINE(HAVE_MEMCHR)
138
139 dnl
140 dnl Force lib/regex.c to use malloc instead of messing around with alloca
141 dnl and define the old re_comp routines that we use.
142 dnl
143 AC_DEFINE(REGEX_MALLOC)
144 AC_DEFINE(_REGEX_RE_COMP)
145 dnl
146 dnl AC_FUNC_VFORK is rather baroque.  It seems to be rather more picky
147 dnl than, say, the Single Unix Specification (version 2), which simplifies
148 dnl a lot of cases by saying that the child process can't set any variables
149 dnl (thus avoiding problems with register allocation) or call any functions
150 dnl (thus avoiding problems with whether file descriptors are shared).
151 dnl It would be nice if we could just write to the Single Unix Specification.
152 dnl I think the only way to do redirection this way is by doing it in the
153 dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
154 dnl That would appear to have a race condition if the user hits ^C (or
155 dnl some other signal) at the wrong time, as main_cleanup will try to use
156 dnl stdout/stderr.  So maybe we are stuck with AC_FUNC_VFORK.
157 dnl
158 AC_FUNC_VFORK
159 AC_FUNC_CLOSEDIR_VOID
160
161 dnl
162 dnl Check for shadow password support.
163 dnl
164 dnl We used to try to determine whether shadow passwords were actually in
165 dnl use or not, but the code has been changed to work right reguardless,
166 dnl so we can go back to a simple check.
167 AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM))
168
169 AC_FUNC_UTIME_NULL
170 AC_SYS_LONG_FILE_NAMES
171
172 AC_FUNC_FNMATCH
173 if test "$ac_cv_func_fnmatch_works" = no; then
174   LIBOBJS="$LIBOBJS fnmatch.o"
175 fi
176
177 # Try to find connect and gethostbyname.
178 AC_CHECK_LIB(nsl, main,
179   AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT),, -lnsl),
180   AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT)))
181 AC_SEARCH_LIBS(gethostbyname, netinet nsl)
182
183 dnl
184 dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
185 dnl
186 dnl If you change this, keep in mind that some systems have a bogus
187 dnl libkrb in the system libraries, so --with-krb4=value needs to
188 dnl override the system -lkrb.
189 dnl
190 KRB4=/usr/kerberos
191 define(WITH_KRB4,[
192 AC_ARG_WITH([krb4],
193   [  --with-krb4=value       set default \$(KRB4) from value],
194   [KRB4=$withval],
195 )dnl
196 echo "default place for krb4 is $KRB4"
197 AC_SUBST(KRB4)])dnl
198 WITH_KRB4
199
200 krb_h=
201 AC_MSG_CHECKING([for krb.h])
202 if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
203    hold_cflags=$CFLAGS
204    CFLAGS="$CFLAGS -I$KRB4/include"
205    AC_TRY_LINK([#include <krb.h>],[int i;],
206           [krb_h=yes krb_incdir=$KRB4/include],
207           [CFLAGS=$hold_cflags
208            AC_TRY_LINK([#include <krb.h>],[int i;],
209              [krb_h=yes krb_incdir=])])
210    CFLAGS=$hold_cflags
211 else
212    AC_TRY_LINK([#include <krb.h>],[int i;],
213              [krb_h=yes krb_incdir=])
214 fi
215 if test -z "$krb_h"; then
216   AC_TRY_LINK([#include <krb.h>],[int i;],
217     [krb_h=yes krb_incdir=],
218     [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
219        hold_cflags=$CFLAGS
220        CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
221        AC_TRY_LINK([#include <krb.h>],[int i;],
222          [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
223        CFLAGS=$hold_cflags
224      fi])
225 fi
226 AC_MSG_RESULT($krb_h)
227
228 includeopt=
229 AC_SUBST(includeopt)
230 if test -n "$krb_h"; then
231   krb_lib=
232   if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
233        hold_ldflags=$LDFLAGS
234        LDFLAGS="-L${KRB4}/lib $LDFLAGS"
235        AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib],
236            [LDFLAGS=$hold_ldflags
237             # Using open here instead of printf so we don't
238             # get confused by the cached value for printf from above.
239             AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])])
240        LDFLAGS=$hold_ldflags
241   else
242        AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=])
243   fi
244   if test -n "$krb_lib"; then
245     AC_DEFINE(HAVE_KERBEROS)
246     test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
247     LIBS="${LIBS} -lkrb"
248     # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
249     # -ldes in the command line.  Don't do it permanently so that we honor
250     # the user's setting for LDFLAGS
251     hold_ldflags=$LDFLAGS
252     test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
253     AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
254     LDFLAGS=$hold_ldflags
255     if test -n "$krb_incdir"; then
256       includeopt="${includeopt} -I$krb_incdir"
257     fi
258   fi
259 fi
260 AC_CHECK_FUNCS(krb_get_err_text)
261
262 ACX_WITH_GSSAPI
263
264 dnl
265 dnl Use --with-encryption to turn on encryption support
266 dnl
267 AC_ARG_ENABLE(encryption,
268   [  --enable-encryption     enable encryption support],
269   [case "${enableval}" in
270     yes) encryption=true ;;
271     no) encryption=false ;;
272     *) AC_MSG_ERROR(bad value ${enableval} for encryption option) ;;
273    esac],
274   [encryption=false])
275 if test "$encryption" = "true"; then
276   AC_DEFINE(ENCRYPTION)
277 fi
278
279 AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
280
281 # Check for options requesting client and server feature. If none are
282 # given and we have connect(), we want the full client & server arrangement.
283 AC_ARG_ENABLE(client,
284 [  --enable-client         include code for running as a remote client (default)
285   --disable-client        don't include remote client code],
286 [if test "$enable_client" = yes; then
287   AC_DEFINE(CLIENT_SUPPORT)
288 fi],
289 [if test "$ac_cv_search_connect" != no; then
290   AC_DEFINE(CLIENT_SUPPORT)
291 fi])
292 AC_ARG_ENABLE(server,
293 [  --enable-server         include code for running as a server (default)
294   --disable-server        don't include server code],
295 [if test "$enable_server" = yes; then
296   AC_DEFINE(SERVER_SUPPORT)
297 fi],
298 [if test "$ac_cv_search_connect" != no; then
299   AC_DEFINE(SERVER_SUPPORT)
300   enable_server=yes
301 fi])
302
303 dnl The auth server needs to be able to check passwords against passwd
304 dnl file entries, so we only #define AUTH_SERVER_SUPPORT if we can
305 dnl find the crypt function. 
306
307 if test "$enable_server" = yes; then
308 AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT) AC_DEFINE(AUTH_SERVER_SUPPORT))
309 fi # enable_server
310
311 dnl For the moment we will assume that all systems which have
312 dnl the unixyness to run configure are unixy enough to do the
313 dnl PreservePermissions stuff.  I have this sinking feeling that
314 dnl things won't be that simple, before long.
315 dnl AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT)
316
317 dnl On cygwin32, we configure like a Unix system, but we use the
318 dnl Windows support code in lib/fncase.c to handle the case
319 dnl insensitive file system.  We also need some support libraries.  We
320 dnl do this at the end so that the new libraries are added at the end
321 dnl of LIBS.
322 AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
323 [AC_TRY_COMPILE([], [return __CYGWIN32__;],
324 ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
325 if test $ccvs_cv_sys_cygwin32 = yes; then
326   LIBOBJS="$LIBOBJS fncase.o"
327   LIBS="$LIBS -ladvapi32"
328
329   dnl On Windows you can only change file times if you can write to
330   dnl the file.  cygwin32 should really handle this for us, but as of
331   dnl January 1998 it doesn't.
332   AC_DEFINE(UTIME_EXPECTS_WRITABLE)
333
334   dnl On Windows we must use setmode to change between binary and text
335   dnl mode.
336   AC_DEFINE(USE_SETMODE_STDOUT)
337   AC_DEFINE(HAVE_SETMODE)
338 fi
339
340 test -f src/options.h && (
341   AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
342   AC_MSG_WARN(You may wish to check that local options have not been lost.)
343   AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
344   cp ./src/options.h ./src/options.h-SAVED
345 )
346
347 AC_OUTPUT([Makefile \
348           contrib/Makefile \
349           contrib/clmerge \
350           contrib/cln_hist \
351           contrib/commit_prep \
352           contrib/cvs_acls \
353           contrib/log \
354           contrib/log_accum \
355           contrib/mfpipe \
356           contrib/rcslock \
357           contrib/sccs2rcs \
358           diff/Makefile \
359           doc/Makefile \
360           emx/Makefile \
361           lib/Makefile \
362           man/Makefile \
363           os2/Makefile \
364           src/Makefile \
365           src/cvsbug \
366           tools/Makefile \
367           vms/Makefile \
368           windows-NT/Makefile \
369           windows-NT/SCC/Makefile \
370           zlib/Makefile],
371           [chmod -f +x \
372           contrib/clmerge \
373           contrib/cln_hist \
374           contrib/commit_prep \
375           contrib/cvs_acls \
376           contrib/log \
377           contrib/log_accum \
378           contrib/mfpipe \
379           contrib/rcslock \
380           contrib/sccs2rcs \
381           src/cvsbug])