1 dnl configure.in for cvs
4 AC_PREREQ(2.4)dnl Required Autoconf version.
5 dnl Do not use autoconf 2.12; it produces a configure script which produces
6 dnl a "internal 2K buffer" error on HPUX when run with /bin/sh.
7 dnl autoconf 2.10 seems like a good choice.
9 dnl It is possible that we should just change the above required version
10 dnl to 2.10; it seems like everyone is using 2.10 anyway, and there is
11 dnl at least some sentiment that we should be using a version which has
12 dnl --bindir (and correspondingly, using @bindir@ and friends in our
13 dnl Makefile.in files. I'm not sure exactly what version of autoconf
14 dnl introduced --bindir but I know 2.10 has it.
15 AC_CONFIG_HEADER(config.h src/options.h)
22 if test "$ISC" = yes; then
23 CFLAGS="$CFLAGS -D_SYSV3"
27 AC_PREFIX_PROGRAM(cvs)
29 dnl FIXME: AC_C_CROSS is considered obsolete by autoconf 2.12, and is
30 dnl pretty ugly to start with. But it isn't obvious to me how we should
31 dnl be handling the uses of cross_compiling below.
41 AC_PATH_PROG(perl_path, perl, no)
42 AC_PATH_PROG(csh_path, csh, no)
45 if test X"$ac_cv_sys_interpreter" != X"yes" ; then
46 # silly trick to avoid problems in AC macros...
47 ac_msg='perl scripts using #! may not be invoked properly'
52 AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
53 sys/param.h sys/select.h sys/time.h sys/timeb.h \
54 io.h direct.h sys/bsdtypes.h sys/resource.h)
64 AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid vasprintf strtoul)
65 AC_CHECK_FUNCS(fchmod fsync ftime mktemp putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3)
68 dnl Look for shadow password files before we go ahead and set getspnam.
69 dnl On some systems (Linux), the C library has getspnam but shadow
70 dnl passwords might not be in use.
72 dnl We used to check for the existence of the /etc/security directory
73 dnl here, but that's incorrect, since it's possible to have PAM installed
74 dnl without using shadow passwords.
76 AC_MSG_CHECKING([for evidence of shadow passwords])
77 if test -f /etc/shadow \
78 || test -f /etc/security/passwd.adjunct ; then
80 AC_CHECK_LIB(sec, getspnam)
81 AC_CHECK_FUNCS(getspnam)
85 AC_MSG_RESULT([$found])
87 AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o")
89 AC_SYS_LONG_FILE_NAMES
91 AC_MSG_CHECKING([for working fnmatch function])
92 AC_CACHE_VAL(ccvs_cv_sys_working_fnmatch,
98 exit ((fnmatch ("a", "a", FNM_PATHNAME) == 0
99 && fnmatch ("a", "b", FNM_PATHNAME) == FNM_NOMATCH)
102 ccvs_cv_sys_working_fnmatch=yes,
103 ccvs_cv_sys_working_fnmatch=no,
104 ccvs_cv_sys_working_fnmatch=no)])
105 if test $ccvs_cv_sys_working_fnmatch = no; then
106 LIBOBJS="$LIBOBJS fnmatch.o"
108 AC_MSG_RESULT($ccvs_cv_sys_working_fnmatch)
110 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
111 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
112 # libsocket.so which has a bad implementation of gethostbyname (it
113 # only looks in /etc/hosts), so we only look for -lsocket if we need
115 AC_CHECK_FUNC(connect, :,
118 *) AC_CHECK_LIB(nsl_s, printf) ;;
122 *) AC_CHECK_LIB(nsl, printf) ;;
126 *) AC_CHECK_LIB(socket, connect) ;;
130 *) AC_CHECK_LIB(inet, connect) ;;
132 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
134 if test "$ac_cv_lib_socket_connect" = "yes" || test "$ac_cv_lib_inet_connect" = "yes"; then
135 ac_cv_func_connect=yes
136 AC_DEFINE(HAVE_CONNECT)
140 dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
145 [ --with-krb4=value set default \$(KRB4) from value],
148 echo "default place for krb4 is $KRB4"
153 AC_MSG_CHECKING([for krb.h])
154 AC_TRY_LINK([#include <krb.h>],[int i;],
155 [krb_h=yes krb_incdir=],
156 [if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
158 CFLAGS="$CFLAGS -I$KRB4/include"
159 AC_TRY_LINK([#include <krb.h>],[int i;],
160 [krb_h=yes krb_incdir=$KRB4/include])
163 if test -z "$krb_h"; then
164 AC_TRY_LINK([#include <krb.h>],[int i;],
165 [krb_h=yes krb_incdir=],
166 [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
168 CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
169 AC_TRY_LINK([#include <krb.h>],[int i;],
170 [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
174 AC_MSG_RESULT($krb_h)
176 if test -n "$krb_h"; then
178 AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=],
179 [if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
180 krb_lib=yes krb_libdir=$KRB4/lib
182 if test -n "$krb_lib"; then
183 AC_DEFINE(HAVE_KERBEROS)
184 test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
186 # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
187 # -ldes in the command line. Don't do it permanently so that we honor
188 # the user's setting for LDFLAGS
189 hold_ldflags=$LDFLAGS
190 test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
191 AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
192 LDFLAGS=$hold_ldflags
193 if test -n "$krb_incdir"; then
194 includeopt="${includeopt} -I$krb_incdir"
199 AC_CHECK_FUNCS(krb_get_err_text)
202 dnl Use --with-encryption to turn on encryption support
204 AC_ARG_ENABLE(encryption,
205 [ --enable-encryption enable encryption support],
206 [case "${enableval}" in
207 yes) encryption=true ;;
208 no) encryption=false ;;
209 *) AC_MSG_ERROR(bad value ${enableval} for encryption option) ;;
212 if test "$encryption" = "true"; then
213 AC_DEFINE(ENCRYPTION)
216 AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
218 # Check for options requesting client and server feature. If none are
219 # given and we have connect(), we want the full client & server arrangement.
220 AC_ARG_ENABLE(client,
221 [ --enable-client include code for running as a remote client (default)
222 --disable-client don't include remote client code],
223 [if test "$enable_client" = yes; then
224 AC_DEFINE(CLIENT_SUPPORT)
226 [if test "$ac_cv_func_connect" = yes; then
227 AC_DEFINE(CLIENT_SUPPORT)
229 AC_ARG_ENABLE(server,
230 [ --enable-server include code for running as a server (default)
231 --disable-server don't include server code],
232 [if test "$enable_server" = yes; then
233 AC_DEFINE(SERVER_SUPPORT)
235 [if test "$ac_cv_func_connect" = yes; then
236 AC_DEFINE(SERVER_SUPPORT)
240 ### The auth server needs to be able to check passwords against passwd
241 ### file entries, so we only #define AUTH_SERVER_SUPPORT if we can
242 ### find the crypt function.
244 ### We used to test for crypt in libc first, and only add -lcrypt if
245 ### we couldn't find it, but that interacts badly with the cache
246 ### variables, the 'unset' command isn't portable, and I'm not sure
247 ### there's any harm in just testing for -lcrypt first.
249 if test "$enable_server" = yes; then
250 AC_CHECK_LIB(crypt, crypt)
251 AC_CHECK_FUNCS(crypt)
253 if test "$ac_cv_func_crypt" = yes; then
254 AC_DEFINE(AUTH_SERVER_SUPPORT)
258 test -f src/options.h && (
259 AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
260 AC_MSG_WARN(You may wish to check that local options have not been lost.)
261 AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
262 cp ./src/options.h ./src/options.h-SAVED
265 AC_OUTPUT(Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefile \
266 man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
267 contrib/Makefile contrib/elib/Makefile \
268 windows-NT/Makefile windows-NT/SCC/Makefile \
269 os2/Makefile emx/Makefile macintosh/Makefile vms/Makefile \