summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/configure.in
blob: 2a6a39088a4870c14eabec3859f7e45909e8ee30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
dnl configure.in for cvs
AC_INIT(src/cvs.h)
AM_INIT_AUTOMAKE(cvs, 1.11.1p1)
AC_PREREQ(2.13)
AC_PREFIX_PROGRAM(cvs)
AM_CONFIG_HEADER(config.h src/options.h)

AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Automake's more advanced version of AC_PROG_RANLIB
AC_PROG_RANLIB
AC_PROG_YACC
AC_PROG_LN_S

AC_PATH_PROG(PERL, perl, no)
AC_PATH_PROG(CSH, csh, no)
AC_PATH_PROG(PR, pr, no)
# For diff/util.c
if test x"$PR" != xno; then
	AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR"], [Path to the pr utility])
fi

dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
dnl FIXME I pulled this default list from sanity.sh.  Perhaps these lists
dnl can be stored in one location?
glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
AC_PATH_PROGS(ROFF, groff roff, $missing_dir/missing roff, $glocs)
AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)

AC_SYS_INTERPRETER
if test X"$ac_cv_sys_interpreter" != X"yes" ; then
  # silly trick to avoid problems in AC macros...
  ac_msg='perl scripts using #! may not be invoked properly'
  AC_MSG_WARN($ac_msg)
fi

# BSD's logo is a devil for a reason, hey?
AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
[if test ! -d ac_test_dir ; then
	AC_TRY_COMMAND([mkdir ac_test_dir])
fi
cat >conftestmake <<EOF
VPATH = ac_test_dir
ac_test_target: ac_test_dep
	echo BSD VPATH bug present >&2
ac_test_dep: ac_test_dep_dep
EOF
touch ac_test_dir/ac_test_dep_dep
touch ac_test_dir/ac_test_dep
touch ac_test_target
# Don't know why, but the following test doesn't work under FreeBSD 4.2
# without this sleep command
sleep 1
if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
	ccvs_cv_bsd_make_vpath_bug=yes
else
	ccvs_cv_bsd_make_vpath_bug=no
fi
AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
# We also don't need to worry about the bug when $srcdir = $builddir
AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
		test $ccvs_cv_bsd_make_vpath_bug = no \
		|| test $srcdir = .)

AC_AIX
AC_MINIX
AC_ISC_POSIX
if test "$ISC" = yes; then
CFLAGS="$CFLAGS -D_SYSV3"
LIBS="-lcrypt $LIBS"
fi

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
		 limits.h sys/file.h \
                 sys/param.h sys/select.h sys/time.h sys/timeb.h \
                 io.h direct.h sys/bsdtypes.h sys/resource.h syslog.h)
AC_HEADER_STAT
AC_HEADER_TIME

AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL

AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_RDEV
AC_REPLACE_FUNCS(mkdir rename strstr dup2 strerror valloc waitpid memmove strtoul)
AC_CHECK_FUNCS(\
	fchdir \
	fchmod \
	fsync \
	ftime \
	ftruncate \
	getgroups \
	getpagesize \
	getpassphrase \
	gettimeofday \
	initgroups \
	mknod \
	mkstemp \
	mktemp \
	putenv \
	readlink \
	sigaction \
	sigblock \
	sigprocmask \
	sigsetmask \
	sigvec \
	tempnam \
	timezone \
	tzset \
	vprintf \
	wait3 \
)
# we only need one of the following
AC_CHECK_FUNCS([\
	nanosleep \
	usleep \
	select \
], [break])

dnl
dnl The CVS coding standard (as specified in HACKING) is that if it exists
dnl in SunOS4 and ANSI, we use it.  CVS itself, of course, therefore doesn't
dnl need HAVE_* defines for such functions, but diff wants them.
dnl
AC_DEFINE(HAVE_STRCHR)
AC_DEFINE(HAVE_MEMCHR)

dnl
dnl Force lib/regex.c to use malloc instead of messing around with alloca
dnl and define the old re_comp routines that we use.
dnl
AC_DEFINE(REGEX_MALLOC)
AC_DEFINE(_REGEX_RE_COMP)
dnl
dnl AC_FUNC_VFORK is rather baroque.  It seems to be rather more picky
dnl than, say, the Single Unix Specification (version 2), which simplifies
dnl a lot of cases by saying that the child process can't set any variables
dnl (thus avoiding problems with register allocation) or call any functions
dnl (thus avoiding problems with whether file descriptors are shared).
dnl It would be nice if we could just write to the Single Unix Specification.
dnl I think the only way to do redirection this way is by doing it in the
dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
dnl That would appear to have a race condition if the user hits ^C (or
dnl some other signal) at the wrong time, as main_cleanup will try to use
dnl stdout/stderr.  So maybe we are stuck with AC_FUNC_VFORK.
dnl
AC_FUNC_VFORK
AC_FUNC_CLOSEDIR_VOID

dnl
dnl Check for shadow password support.
dnl
dnl We used to try to determine whether shadow passwords were actually in
dnl use or not, but the code has been changed to work right reguardless,
dnl so we can go back to a simple check.
AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM))

AC_FUNC_UTIME_NULL
AC_SYS_LONG_FILE_NAMES

AC_FUNC_FNMATCH
if test "$ac_cv_func_fnmatch_works" = no; then
  LIBOBJS="$LIBOBJS fnmatch.o"
fi

# Try to find connect and gethostbyname.
AC_CHECK_LIB(nsl, main,
  AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT),, -lnsl),
  AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT)))
AC_SEARCH_LIBS(gethostbyname, netinet nsl)

dnl
dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
dnl
dnl If you change this, keep in mind that some systems have a bogus
dnl libkrb in the system libraries, so --with-krb4=value needs to
dnl override the system -lkrb.
dnl
KRB4=/usr/kerberos
define(WITH_KRB4,[
AC_ARG_WITH([krb4],
  [  --with-krb4=value       set default \$(KRB4) from value],
  [KRB4=$withval],
)dnl
echo "default place for krb4 is $KRB4"
AC_SUBST(KRB4)])dnl
WITH_KRB4

krb_h=
AC_MSG_CHECKING([for krb.h])
if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
   hold_cflags=$CFLAGS
   CFLAGS="$CFLAGS -I$KRB4/include"
   AC_TRY_LINK([#include <krb.h>],[int i;],
          [krb_h=yes krb_incdir=$KRB4/include],
          [CFLAGS=$hold_cflags
           AC_TRY_LINK([#include <krb.h>],[int i;],
             [krb_h=yes krb_incdir=])])
   CFLAGS=$hold_cflags
else
   AC_TRY_LINK([#include <krb.h>],[int i;],
             [krb_h=yes krb_incdir=])
fi
if test -z "$krb_h"; then
  AC_TRY_LINK([#include <krb.h>],[int i;],
    [krb_h=yes krb_incdir=],
    [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
       hold_cflags=$CFLAGS
       CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
       AC_TRY_LINK([#include <krb.h>],[int i;],
	 [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
       CFLAGS=$hold_cflags
     fi])
fi
AC_MSG_RESULT($krb_h)

includeopt=
AC_SUBST(includeopt)
if test -n "$krb_h"; then
  krb_lib=
  if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
       hold_ldflags=$LDFLAGS
       LDFLAGS="-L${KRB4}/lib $LDFLAGS"
       AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib],
           [LDFLAGS=$hold_ldflags
            # Using open here instead of printf so we don't
            # get confused by the cached value for printf from above.
            AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])])
       LDFLAGS=$hold_ldflags
  else
       AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=])
  fi
  if test -n "$krb_lib"; then
    AC_DEFINE(HAVE_KERBEROS)
    test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
    LIBS="${LIBS} -lkrb"
    # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
    # -ldes in the command line.  Don't do it permanently so that we honor
    # the user's setting for LDFLAGS
    hold_ldflags=$LDFLAGS
    test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
    AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
    LDFLAGS=$hold_ldflags
    if test -n "$krb_incdir"; then
      includeopt="${includeopt} -I$krb_incdir"
    fi
  fi
fi
AC_CHECK_FUNCS(krb_get_err_text)

ACX_WITH_GSSAPI

dnl
dnl Use --with-encryption to turn on encryption support
dnl
AC_ARG_ENABLE(encryption,
  [  --enable-encryption     enable encryption support],
  [case "${enableval}" in
    yes) encryption=true ;;
    no) encryption=false ;;
    *) AC_MSG_ERROR(bad value ${enableval} for encryption option) ;;
   esac],
  [encryption=false])
if test "$encryption" = "true"; then
  AC_DEFINE(ENCRYPTION)
fi

AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")

# Check for options requesting client and server feature. If none are
# given and we have connect(), we want the full client & server arrangement.
AC_ARG_ENABLE(client,
[  --enable-client         include code for running as a remote client (default)
  --disable-client        don't include remote client code],
[if test "$enable_client" = yes; then
  AC_DEFINE(CLIENT_SUPPORT)
fi],
[if test "$ac_cv_search_connect" != no; then
  AC_DEFINE(CLIENT_SUPPORT)
fi])
AC_ARG_ENABLE(server,
[  --enable-server         include code for running as a server (default)
  --disable-server        don't include server code],
[if test "$enable_server" = yes; then
  AC_DEFINE(SERVER_SUPPORT)
fi],
[if test "$ac_cv_search_connect" != no; then
  AC_DEFINE(SERVER_SUPPORT)
  enable_server=yes
fi])

dnl The auth server needs to be able to check passwords against passwd
dnl file entries, so we only #define AUTH_SERVER_SUPPORT if we can
dnl find the crypt function. 

if test "$enable_server" = yes; then
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT) AC_DEFINE(AUTH_SERVER_SUPPORT))
fi # enable_server

dnl For the moment we will assume that all systems which have
dnl the unixyness to run configure are unixy enough to do the
dnl PreservePermissions stuff.  I have this sinking feeling that
dnl things won't be that simple, before long.
dnl AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT)

dnl On cygwin32, we configure like a Unix system, but we use the
dnl Windows support code in lib/fncase.c to handle the case
dnl insensitive file system.  We also need some support libraries.  We
dnl do this at the end so that the new libraries are added at the end
dnl of LIBS.
AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
[AC_TRY_COMPILE([], [return __CYGWIN32__;],
ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
if test $ccvs_cv_sys_cygwin32 = yes; then
  LIBOBJS="$LIBOBJS fncase.o"
  LIBS="$LIBS -ladvapi32"

  dnl On Windows you can only change file times if you can write to
  dnl the file.  cygwin32 should really handle this for us, but as of
  dnl January 1998 it doesn't.
  AC_DEFINE(UTIME_EXPECTS_WRITABLE)

  dnl On Windows we must use setmode to change between binary and text
  dnl mode.
  AC_DEFINE(USE_SETMODE_STDOUT)
  AC_DEFINE(HAVE_SETMODE)
fi

test -f src/options.h && (
  AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
  AC_MSG_WARN(You may wish to check that local options have not been lost.)
  AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
  cp ./src/options.h ./src/options.h-SAVED
)

AC_OUTPUT([Makefile \
	  contrib/Makefile \
	  contrib/clmerge \
	  contrib/cln_hist \
	  contrib/commit_prep \
	  contrib/cvs_acls \
	  contrib/log \
	  contrib/log_accum \
	  contrib/mfpipe \
	  contrib/rcslock \
	  contrib/sccs2rcs \
	  diff/Makefile \
	  doc/Makefile \
	  emx/Makefile \
	  lib/Makefile \
	  man/Makefile \
	  os2/Makefile \
	  src/Makefile \
	  src/cvsbug \
	  tools/Makefile \
	  vms/Makefile \
	  windows-NT/Makefile \
	  windows-NT/SCC/Makefile \
	  zlib/Makefile],
	  [chmod -f +x \
	  contrib/clmerge \
	  contrib/cln_hist \
	  contrib/commit_prep \
	  contrib/cvs_acls \
	  contrib/log \
	  contrib/log_accum \
	  contrib/mfpipe \
	  contrib/rcslock \
	  contrib/sccs2rcs \
	  src/cvsbug])
OpenPOWER on IntegriCloud