mc/vfs/samba/configure.in

793 lines
24 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_INIT(include/includes.h)
AC_PREREQ(2.52)
AC_CONFIG_HEADER(include/config.h)
AC_CONFIG_AUX_DIR(../../config)
# we want to be compatibe with older versions of Samba
AC_PREFIX_DEFAULT(/usr/local/samba)
dnl Unique-to-Samba variables we'll be playing with.
AC_SUBST(SHELL)
AC_SUBST(MPROGS)
AC_SUBST(LDSHFLAGS)
AC_SUBST(HOST_OS)
AC_SUBST(WRAP)
AC_SUBST(WRAP32)
# compile with optimisation and without debugging by default
CFLAGS=${CFLAGS-"-O"}
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_AWK
AC_CHECK_TOOL(AR, ar, ar)
dnl Check if C compiler understands -c and -o at the same time
AC_PROG_CC_C_O
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
BROKEN_CC=
else
BROKEN_CC=#
fi
AC_SUBST(BROKEN_CC)
dnl Check if the C compiler understands volatile (it should, being ANSI).
AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
samba_cv_volatile=yes,samba_cv_volatile=no)])
if test x"$samba_cv_volatile" = x"yes"; then
AC_DEFINE(HAVE_VOLATILE)
fi
AC_CANONICAL_HOST
AC_VALIDATE_CACHE_SYSTEM_TYPE
SAMBA_MAINTAINER_MODE
AC_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
AC_CHECK_HEADERS(netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
AC_CHECK_HEADERS(sys/security.h security/pam_appl.h)
AC_CHECK_HEADERS(stropts.h poll.h sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
AC_CHECK_SIZEOF(short,cross)
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_C_CHAR_UNSIGNED
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_ST_RDEV
AC_DIRENT_D_OFF
AC_CHECK_TYPE(ino_t,unsigned)
AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,off_t)
AC_CHECK_TYPE(ssize_t, int)
# we need libdl for PAM and the new VFS code
AC_CHECK_LIB(dl,main)
AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
AC_TRY_COMPILE([
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#include <signal.h>],[sig_atomic_t i = 0],
samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
if test x"$samba_cv_sig_atomic_t" = x"yes"; then
AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
fi
AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
samba_cv_errno=yes,samba_cv_have_errno=no)])
if test x"$samba_cv_errno" = x"yes"; then
AC_DEFINE(HAVE_ERRNO_DECL)
fi
# stupid glibc has the functions but no declaration. grrrr.
AC_CACHE_CHECK([for crypt declaration],samba_cv_have_crypt_decl,[
AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)crypt],
samba_cv_have_crypt_decl=yes,samba_cv_have_crypt_decl=no)])
if test x"$samba_cv_have_crypt_decl" = x"yes"; then
AC_DEFINE(HAVE_CRYPT_DECL)
fi
AC_FUNC_MEMCMP
###############################################
# test for where we get crypt() from
AC_CHECK_FUNCS(crypt)
if test x"$ac_cv_func_crypt" = x"no"; then
AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
AC_DEFINE(HAVE_CRYPT)])
fi
# The following test taken from the cvs sources
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
# libsocket.so which has a bad implementation of gethostbyname (it
# only looks in /etc/hosts), so we only look for -lsocket if we need
# it.
AC_CHECK_FUNCS(connect)
if test x"$ac_cv_func_connect" = x"no"; then
case "$LIBS" in
*-lnsl*) ;;
*) AC_CHECK_LIB(nsl_s, printf) ;;
esac
case "$LIBS" in
*-lnsl*) ;;
*) AC_CHECK_LIB(nsl, printf) ;;
esac
case "$LIBS" in
*-lsocket*) ;;
*) AC_CHECK_LIB(socket, connect) ;;
esac
case "$LIBS" in
*-linet*) ;;
*) AC_CHECK_LIB(inet, connect) ;;
esac
dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
dnl has been cached.
if test x"$ac_cv_lib_socket_connect" = x"yes" ||
test x"$ac_cv_lib_inet_connect" = x"yes"; then
# ac_cv_func_connect=yes
# don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
AC_DEFINE(HAVE_CONNECT)
fi
fi
AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod)
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf setreuid setregid seteuid setegid)
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate)
AC_CHECK_FUNCS(atexit grantpt dup2)
AC_CHECK_FUNCS(setluid yp_get_default_domain getpwanam)
AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp)
AC_CHECK_FUNCS(getdents)
AC_CHECK_FUNCS(llseek)
#
# If no strcasecmp, check for it in some known places
# It is in -lresolv on ReliantUNIX and UnixWare
# -lresolve *must* follow -lnsl for name resolution to work properly
#
if test x$ac_cv_func_strcasecmp = xno ; then
AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
AC_DEFINE(HAVE_STRCASECMP))
fi
#
# Check for the functions putprpwnam, set_auth_parameters,
# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
# Needed for OSF1 and HPUX.
#
AC_LIBTESTFUNC(security, putprpwnam)
AC_LIBTESTFUNC(sec, putprpwnam)
AC_LIBTESTFUNC(security, set_auth_parameters)
AC_LIBTESTFUNC(sec, set_auth_parameters)
AC_LIBTESTFUNC(security, getspnam)
AC_LIBTESTFUNC(sec, getspnam)
AC_LIBTESTFUNC(security, bigcrypt)
AC_LIBTESTFUNC(sec, bigcrypt)
AC_LIBTESTFUNC(security, getprpwnam)
AC_LIBTESTFUNC(sec, getprpwnam)
# this bit needs to be modified for each OS that is suported by
# smbwrapper. You need to specify how to created a shared library and
# how to compile C code to produce PIC object files
# these are the defaults, good for lots of systems
HOST_OS="$host_os"
LDSHFLAGS="-shared"
# and these are for particular systems
case "$host_os" in
*linux*) AC_DEFINE(LINUX);;
*solaris*) AC_DEFINE(SUNOS5)
LDSHFLAGS="-G"
;;
*sunos*) AC_DEFINE(SUNOS4)
LDSHFLAGS=""
;;
*bsd*) LDSHFLAGS="-shared -Bshareable"
;;
*irix*) AC_DEFINE(IRIX)
case "$host_os" in
*irix6*) AC_DEFINE(IRIX6)
;;
esac
ATTEMPT_WRAP32_BUILD=yes
;;
*aix*) AC_DEFINE(AIX);;
*hpux*) AC_DEFINE(HPUX);;
*qnx*) AC_DEFINE(QNX);;
*osf*) AC_DEFINE(OSF1);;
*sco*) AC_DEFINE(SCO);;
*next2*) AC_DEFINE(NEXT2);;
*dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
*sysv4*)
case "$host" in
*-univel-*) if [ test "$GCC" != yes ]; then
AC_DEFINE(HAVE_MEMSET)
fi
LDSHFLAGS="-G"
;;
*mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
esac
;;
*sysv5*)
if [ test "$GCC" != yes ]; then
AC_DEFINE(HAVE_MEMSET)
fi
LDSHFLAGS="-G"
;;
esac
################
AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
AC_TRY_RUN([#include <stdio.h>
main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
if test x"$samba_cv_have_longlong" = x"yes"; then
AC_DEFINE(HAVE_LONGLONG)
fi
AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>
main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
AC_DEFINE(SIZEOF_OFF_T,8)
fi
AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
#include <sys/stat.h>
main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
AC_DEFINE(HAVE_OFF64_T)
fi
AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>
main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
AC_DEFINE(SIZEOF_INO_T,8)
fi
AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
#include <sys/stat.h>
main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
AC_DEFINE(HAVE_INO64_T)
fi
AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
AC_TRY_COMPILE([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/types.h>
#include <dirent.h>],
[struct dirent64 de;],
samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
AC_DEFINE(HAVE_STRUCT_DIRENT64)
fi
AC_CACHE_CHECK([for union semun],samba_cv_HAVE_UNION_SEMUN,[
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
main() { union semun ss; exit(0); }],
samba_cv_HAVE_UNION_SEMUN=yes,samba_cv_HAVE_UNION_SEMUN=no,samba_cv_HAVE_UNION_SEMUN=cross)])
if test x"$samba_cv_HAVE_UNION_SEMUN" = x"yes"; then
AC_DEFINE(HAVE_UNION_SEMUN)
fi
AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
AC_TRY_RUN([#include <stdio.h>
main() { char c; c=250; exit((c > 0)?0:1); }],
samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
AC_DEFINE(HAVE_UNSIGNED_CHAR)
fi
AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
AC_DEFINE(HAVE_SOCK_SIN_LEN)
fi
AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <dirent.h>
void seekdir(DIR *d, long loc) { return; }],[return 0;],
samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
AC_DEFINE(SEEKDIR_RETURNS_VOID)
fi
AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
AC_DEFINE(HAVE_FILE_MACRO)
fi
AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
AC_DEFINE(HAVE_FUNCTION_MACRO)
fi
AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
AC_TRY_RUN([
#include <sys/time.h>
#include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
fi
AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
AC_TRY_RUN([#include <sys/types.h>
#include <dirent.h>
main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
di->d_name[0] == 0) exit(0); exit(1);} ],
samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
AC_DEFINE(HAVE_BROKEN_READDIR)
fi
AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utime.h>],
[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
AC_DEFINE(HAVE_UTIMBUF)
fi
AC_CACHE_CHECK([for kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <fcntl.h>],
[oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
samba_cv_HAVE_KERNEL_OPLOCKS=yes,samba_cv_HAVE_KERNEL_OPLOCKS=no)])
if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then
AC_DEFINE(HAVE_KERNEL_OPLOCKS)
fi
AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
AC_TRY_RUN([#include <sys/types.h>
#include <sys/capability.h>
main() {
cap_t cap;
if ((cap = cap_get_proc()) == NULL)
exit(1);
cap->cap_effective |= CAP_NETWORK_MGT;
cap->cap_inheritable |= CAP_NETWORK_MGT;
cap_set_proc(cap);
exit(0);
}
],
samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
fi
#
# Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
# This is *really* broken but some systems (DEC OSF1) do this.... JRA.
#
AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
AC_TRY_COMPILE([#include <sys/types.h>
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
[int16 testvar;],
samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
fi
AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
AC_TRY_COMPILE([#include <sys/types.h>
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
[uint16 testvar;],
samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
fi
AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
AC_TRY_COMPILE([#include <sys/types.h>
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
[int32 testvar;],
samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
fi
AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
AC_TRY_COMPILE([#include <sys/types.h>
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
[uint32 testvar;],
samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
fi
dnl
dnl Some systems (SCO) have a problem including
dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
dnl as a #define in <prot.h> and as part of an enum
dnl in <rpc/rpc.h>.
dnl
AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
AC_TRY_COMPILE([#include <sys/types.h>
#ifdef HAVE_SYS_SECURITY_H
#include <sys/security.h>
#include <prot.h>
#endif /* HAVE_SYS_SECURITY_H */
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
[int testvar;],
samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
fi
AC_MSG_CHECKING([for test routines])
AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
AC_MSG_RESULT(yes),
AC_MSG_ERROR([cant find test code. Aborting config]),
AC_MSG_WARN([cannot run when cross-compiling]))
AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
fi
AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
AC_DEFINE(HAVE_BROKEN_GETGROUPS)
fi
AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
AC_TRY_RUN([
#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
main() { struct in_addr ip; ip.s_addr = 0x12345678;
if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
exit(1);}],
samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
AC_DEFINE(REPLACE_INET_NTOA)
fi
netmask=no;
AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
AC_TRY_RUN([
#define HAVE_NETMASK_IFCONF 1
#define AUTOCONF 1
#include "confdefs.h"
#include "${srcdir-.}/lib/netmask.c"],
samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF)
fi
if test $netmask = no; then
AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
AC_TRY_RUN([
#define HAVE_NETMASK_IFREQ 1
#define AUTOCONF 1
#include "confdefs.h"
#include "${srcdir-.}/lib/netmask.c"],
samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ)
fi
fi
if test $netmask = no; then
AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
AC_TRY_RUN([
#define HAVE_NETMASK_AIX 1
#define AUTOCONF 1
#include "confdefs.h"
#include "${srcdir-.}/lib/netmask.c"],
samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX)
fi
fi
AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
AC_TRY_COMPILE([#include <sys/acl.h>
#if defined(HAVE_RPCSVC_NIS_H)
#include <rpcsvc/nis.h>
#endif],
[return 0;],
samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
fi
#################################################
# check for a LDAP password database
AC_MSG_CHECKING([whether to use LDAP password database])
AC_ARG_WITH(ldap,
[ --with-ldap Include LDAP support
--without-ldap Don't include LDAP support (default)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_LDAP)
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
#################################################
# check for a NISPLUS password database
AC_MSG_CHECKING([whether to use NISPLUS password database])
AC_ARG_WITH(nisplus,
[ --with-nisplus Include NISPLUS password database support
--without-nisplus Don't include NISPLUS password database support (default)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_NISPLUS)
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
#################################################
# check for a NISPLUS_HOME support
AC_MSG_CHECKING([whether to use NISPLUS_HOME])
AC_ARG_WITH(nisplus-home,
[ --with-nisplus-home Include NISPLUS_HOME support
--without-nisplus-home Don't include NISPLUS_HOME support (default)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_NISPLUS_HOME)
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
#################################################
# check for the secure socket layer
AC_MSG_CHECKING([whether to use SSL])
AC_ARG_WITH(ssl,
[ --with-ssl Include SSL support
--without-ssl Don't include SSL support (default)
--with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_SSL)
withval="/usr/local/ssl" # default
if test "${with_sslinc+set}" = set; then
withval="$with_sslinc"
case "$withval" in
yes|no)
AC_MSG_WARN([--with-sslinc called without argument - will use default])
CFLAGS="-I/usr/local/ssl/include $CFLAGS"
LIBS="-lssl -lcrypto $LIBS"
LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
;;
* )
CFLAGS="-I${withval}/include $CFLAGS"
LIBS="-lssl -l crypto $LIBS"
LDFLAGS="-L${withval}/lib $LDFLAGS"
;;
esac
else
CFLAGS="-I/usr/local/ssl/include $CFLAGS"
LIBS="-lssl -lcrypto $LIBS"
LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
fi
if test ! -d ${withval}; then
AC_MSG_ERROR([called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config])
fi
CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
#################################################
# set private directory location
AC_ARG_WITH(privatedir,
[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
[ case "$withval" in
yes|no)
#
# Just in case anybody calls it without argument
#
AC_MSG_WARN([--with-privatedir called without argument - will use default])
privatedir='${prefix}/private'
;;
* )
privatedir="$withval"
;;
esac
AC_SUBST(privatedir)],
[privatedir='${prefix}/private'
AC_SUBST(privatedir)]
)
#################################################
# set lock directory location
AC_ARG_WITH(lockdir,
[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
[ case "$withval" in
yes|no)
#
# Just in case anybody calls it without argument
#
AC_MSG_WARN([--with-lockdir called without argument - will use default])
lockdir='$(VARDIR)/locks'
;;
* )
lockdir="$withval"
;;
esac
AC_SUBST(lockdir)],
[lockdir='$(VARDIR)/locks'
AC_SUBST(lockdir)]
)
#################################################
# set configuration directory location
configdir="\$(LIBDIR)"
AC_ARG_WITH(configdir,
[ --with-configdir=DIR Where to put configuration files (\$libdir)],
[ case "$withval" in
yes|no)
#
# Just in case anybody does it
#
AC_MSG_WARN([--with-configdir called without argument - will use default])
;;
* )
configdir="$withval"
;;
esac]
)
#################################################
# set codepage directory location
codepagedir="\$(LIBDIR)/codepages"
AC_ARG_WITH(codepagedir,
[ --with-codepagedir=DIR Where to put codepage files (\$libdir/codepages)],
[ case "$withval" in
yes|no)
#
# Just in case anybody does it
#
AC_MSG_WARN([--with-codepagedir called without argument - will use default])
;;
* )
codepagedir="$withval"
;;
esac])
AC_MSG_CHECKING([configure summary])
AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
AC_MSG_RESULT(OK);,
AC_MSG_RESULT(failure)
AC_MSG_ERROR([Aborting config]),:)
builddir=`pwd`
AC_SUBST(builddir)
AC_SUBST(configdir)
AC_SUBST(codepagedir)
AC_OUTPUT([include/stamp-h Makefile])