2002-04-04 09:47:41 +04:00
dnl -*- mode: m4-mode -*-
1998-07-29 07:08:05 +04:00
dnl Process this file with autoconf to produce a configure script.
1998-08-09 15:14:23 +04:00
AC_INIT(include/includes.h)
AC_CONFIG_HEADER(include/config.h)
2002-07-15 14:35:28 +04:00
#################################################
# Directory handling stuff to support both the
# legacy SAMBA directories and FHS compliant
# ones...
1998-11-19 07:15:23 +03:00
AC_PREFIX_DEFAULT(/usr/local/samba)
1998-07-29 07:08:05 +04:00
2002-07-15 14:35:28 +04:00
AC_ARG_WITH(fhs,
[ --with-fhs Use FHS-compliant paths (default=no)],
configdir="${sysconfdir}/samba"
lockdir="\${VARDIR}/cache/samba"
piddir="\$(VARDIR)/run/samba"
logfilebase="\${VARDIR}/log/samba"
privatedir="\${CONFIGDIR}/private"
swatdir="\${DATADIR}/samba/swat",
configdir="\$(LIBDIR)"
logfilebase="\$(VARDIR)"
lockdir="\${VARDIR}/locks"
piddir="\$(VARDIR)/locks"
privatedir="\${prefix}/private"
swatdir="\${prefix}/swat")
#################################################
# 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="$withval"
;;
esac])
#################################################
# 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="$withval"
;;
esac])
#################################################
# set pid directory location
AC_ARG_WITH(piddir,
[ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)],
[ case "$withval" in
yes|no)
#
# Just in case anybody calls it without argument
#
AC_MSG_WARN([--with-piddir called without argument - will use default])
;;
* )
piddir="$withval"
;;
esac])
#################################################
# set SWAT directory location
AC_ARG_WITH(swatdir,
[ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
[ case "$withval" in
yes|no)
#
# Just in case anybody does it
#
AC_MSG_WARN([--with-swatdir called without argument - will use default])
;;
* )
swatdir="$withval"
;;
esac])
#################################################
# set configuration directory location
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 log directory location
AC_ARG_WITH(logfilebase,
[ --with-logfilebase=DIR Where to put log files (\$(VARDIR))],
[ case "$withval" in
yes|no)
#
# Just in case anybody does it
#
AC_MSG_WARN([--with-logfilebase called without argument - will use default])
;;
* )
logfilebase="$withval"
;;
esac])
AC_SUBST(configdir)
AC_SUBST(lockdir)
AC_SUBST(piddir)
AC_SUBST(logfilebase)
AC_SUBST(privatedir)
AC_SUBST(swatdir)
AC_SUBST(bindir)
AC_SUBST(sbindir)
1998-11-14 00:41:01 +03:00
dnl Unique-to-Samba variables we'll be playing with.
1998-07-29 07:08:05 +04:00
AC_SUBST(SHELL)
1999-12-13 16:27:58 +03:00
AC_SUBST(RUNPROG)
1998-09-28 23:18:21 +04:00
AC_SUBST(MPROGS)
1998-10-04 18:56:19 +04:00
AC_SUBST(LDSHFLAGS)
2002-07-15 14:35:28 +04:00
AC_SUBST(SONAMEFLAG)
2001-07-14 06:52:41 +04:00
AC_SUBST(SHLD)
1998-10-05 16:17:01 +04:00
AC_SUBST(HOST_OS)
2001-04-25 01:13:48 +04:00
AC_SUBST(PAM_MOD)
1998-10-23 05:51:31 +04:00
AC_SUBST(WRAP)
1998-10-05 16:17:01 +04:00
AC_SUBST(WRAP32)
2002-07-15 14:35:28 +04:00
AC_SUBST(WRAPPROG)
1998-10-05 16:17:01 +04:00
AC_SUBST(PICFLAG)
2001-07-23 15:22:29 +04:00
AC_SUBST(PICSUFFIX)
AC_SUBST(POBAD_CC)
1999-12-13 16:27:58 +03:00
AC_SUBST(SHLIBEXT)
2001-09-22 11:50:08 +04:00
AC_SUBST(LIBSMBCLIENT_SHARED)
2002-07-15 14:35:28 +04:00
AC_SUBST(LIBSMBCLIENT)
2002-09-25 19:19:00 +04:00
AC_SUBST(PRINTLIBS)
2002-10-28 22:28:32 +03:00
AC_SUBST(AUTHLIBS)
1998-11-15 02:52:49 +03:00
2002-07-15 14:35:28 +04:00
# compile with optimization and without debugging by default
2001-04-06 22:37:55 +04:00
CFLAGS="-O ${CFLAGS}"
2002-07-15 14:35:28 +04:00
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on compiler debugging information (default=no)],
2001-04-06 22:37:55 +04:00
[if eval "test x$enable_debug = xyes"; then
CFLAGS="${CFLAGS} -g"
fi])
2002-07-15 14:35:28 +04:00
AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
2001-09-25 09:08:05 +04:00
[if eval "test x$enable_developer = xyes"; then
CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
fi])
1998-11-15 02:52:49 +03:00
2002-07-15 14:35:28 +04:00
AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
2002-01-15 01:11:01 +03:00
[if eval "test x$enable_krb5developer = xyes"; then
CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
fi])
2002-07-15 14:35:28 +04:00
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable heap debugging [default=no]])
2001-12-20 07:01:44 +03:00
if test "x$enable_dmalloc" = xyes
then
AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
2002-01-09 09:38:22 +03:00
AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
[Define to check invariants around some common functions])
2001-12-20 07:01:44 +03:00
LIBS="$LIBS -ldmalloc"
fi
1998-11-14 00:41:01 +03:00
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
1998-07-29 07:08:05 +04:00
AC_PROG_AWK
2002-07-15 14:35:28 +04:00
dnl Check if we use GNU ld
LD=ld
AC_PROG_LD_GNU
2001-10-11 11:42:52 +04:00
dnl needed before AC_TRY_COMPILE
AC_ISC_POSIX
1999-12-13 16:27:58 +03:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
1999-12-13 16:27:58 +03:00
fi
1998-10-06 03:44:13 +04:00
AC_CANONICAL_SYSTEM
2000-04-01 02:30:13 +04:00
dnl Add #include for broken IRIX header files
case "$host_os" in
2001-03-27 05:41:50 +04:00
*irix6*) AC_ADD_INCLUDE(<standards.h>)
2000-04-01 02:30:13 +04:00
;;
esac
1998-10-07 08:24:04 +04:00
AC_VALIDATE_CACHE_SYSTEM_TYPE
2002-02-22 05:47:53 +03:00
DYNEXP=
1998-11-20 02:42:57 +03:00
#
# Config CPPFLAG settings for strange OS's that must be set
# before other tests.
#
1998-11-20 01:37:33 +03:00
case "$host_os" in
1998-11-20 02:42:57 +03:00
# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
*hpux*)
2002-02-22 05:47:53 +03:00
1998-11-20 02:42:57 +03:00
AC_PROG_CC_FLAG(Ae)
2001-08-03 00:52:57 +04:00
# mmap on HPUX is completely broken...
2002-10-28 22:28:32 +03:00
AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
1998-11-20 02:42:57 +03:00
if test $ac_cv_prog_cc_Ae = yes; then
CPPFLAGS="$CPPFLAGS -Ae"
fi
1999-12-13 16:27:58 +03:00
#
# Defines needed for HPUX support.
# HPUX has bigcrypt but (sometimes?) doesn't use it for
# password hashing - hence the USE_BOTH_CRYPT_CALLS define.
#
case `uname -r` in
*9*|*10*)
2002-04-11 04:37:31 +04:00
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4"
2002-10-28 22:28:32 +03:00
AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
AC_DEFINE(_ALIGNMENT_REQUIRED,1,[Required alignment])
AC_DEFINE(_MAX_ALIGNMENT,4,[Maximum alignment])
1999-12-13 16:27:58 +03:00
;;
*11*)
2002-04-11 04:37:31 +04:00
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4"
2002-10-28 22:28:32 +03:00
AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to use large file support])
AC_DEFINE(_ALIGNMENT_REQUIRED, 1, [Required alignment])
AC_DEFINE(_MAX_ALIGNMENT, 4, [Maximum alignment])
1999-12-13 16:27:58 +03:00
;;
esac
2002-02-22 05:47:53 +03:00
DYNEXP="-Wl,-E"
1998-11-20 02:42:57 +03:00
;;
2002-01-01 09:55:33 +03:00
#
# CRAY Unicos has broken const handling
*unicos*)
AC_MSG_RESULT([disabling const])
CPPFLAGS="$CPPFLAGS -Dconst="
;;
1998-11-20 02:42:57 +03:00
#
1999-12-13 16:27:58 +03:00
# AIX4.x doesn't even admit to having large
1998-11-20 02:42:57 +03:00
# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
#
*aix4*)
1999-12-13 16:27:58 +03:00
AC_MSG_RESULT([enabling large file support])
1998-11-20 02:42:57 +03:00
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support])
1998-11-20 02:42:57 +03:00
;;
1999-12-13 16:27:58 +03:00
#
# Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
# to the existance of large files..
# Note that -D_LARGEFILE64_SOURCE is different from the Sun
# recommendations on large file support, however it makes the
# compile work using gcc 2.7 and 2.8, whereas using the Sun
# recommendation makes the compile fail on gcc2.7. JRA.
#
*solaris*)
case `uname -r` in
2001-09-15 04:29:54 +04:00
5.0*|5.1*|5.2*|5.3*|5.5*)
AC_MSG_RESULT([no large file support])
;;
5.*)
1999-12-13 16:27:58 +03:00
AC_MSG_RESULT([enabling large file support])
if test "$ac_cv_prog_gcc" = yes; then
${CC-cc} -v >conftest.c 2>&1
ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
rm -fr conftest.c
case "$ac_cv_gcc_compiler_version_number" in
*"gcc version 2.6"*|*"gcc version 2.7"*)
CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
1999-12-13 16:27:58 +03:00
;;
*)
CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
1999-12-13 16:27:58 +03:00
;;
esac
else
CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
1999-12-13 16:27:58 +03:00
fi
;;
esac
;;
#
# Tests needed for SINIX large file support.
#
*sysv4*)
if test $host = mips-sni-sysv4 ; then
AC_MSG_CHECKING([for LFS support])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
AC_TRY_RUN([
#include <unistd.h>
main () {
#if _LFS64_LARGEFILE == 1
exit(0);
#else
exit(1);
#endif
}], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
CPPFLAGS="$old_CPPFLAGS"
if test x$SINIX_LFS_SUPPORT = xyes ; then
CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
1999-12-13 16:27:58 +03:00
CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
LIBS="`getconf LFS64_LIBS` $LIBS"
fi
AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
fi
;;
2001-02-27 06:37:29 +03:00
# Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
1999-12-13 16:27:58 +03:00
#
2001-02-27 06:37:29 +03:00
*linux*)
AC_MSG_CHECKING([for LFS support])
old_CPPFLAGS="$CPPFLAGS"
2001-06-07 03:07:10 +04:00
CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
2001-02-27 06:37:29 +03:00
AC_TRY_RUN([
#include <unistd.h>
#include <sys/utsname.h>
main() {
#if _LFS64_LARGEFILE == 1
struct utsname uts;
char *release;
int major, minor;
/* Ensure this is glibc 2.2 or higher */
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
int libc_major = __GLIBC__;
int libc_minor = __GLIBC_MINOR__;
if (libc_major < 2)
exit(1);
if (libc_minor < 2)
exit(1);
#endif
/* Ensure this is kernel 2.4 or higher */
uname(&uts);
release = uts.release;
major = atoi(strsep(&release, "."));
minor = atoi(strsep(&release, "."));
if (major > 2 || (major == 2 && minor > 3))
exit(0);
exit(1);
#else
exit(1);
#endif
}
], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
CPPFLAGS="$old_CPPFLAGS"
if test x$LINUX_LFS_SUPPORT = xyes ; then
2001-06-07 03:07:10 +04:00
CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
2001-02-27 06:37:29 +03:00
fi
AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
1999-12-13 16:27:58 +03:00
;;
2001-02-27 06:37:29 +03:00
1999-12-13 16:27:58 +03:00
*hurd*)
AC_MSG_CHECKING([for LFS support])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
AC_TRY_RUN([
#include <unistd.h>
main () {
#if _LFS64_LARGEFILE == 1
exit(0);
#else
exit(1);
#endif
}], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
CPPFLAGS="$old_CPPFLAGS"
if test x$GLIBC_LFS_SUPPORT = xyes ; then
CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
2002-10-28 22:28:32 +03:00
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
1999-12-13 16:27:58 +03:00
fi
AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
;;
1998-11-20 01:37:33 +03:00
esac
1998-07-29 07:08:05 +04:00
AC_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
1999-12-13 16:27:58 +03:00
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)
2001-07-25 07:28:45 +04:00
AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
2001-05-03 23:47:30 +04:00
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
1999-12-13 16:27:58 +03:00
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)
2002-07-15 14:35:28 +04:00
AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h lber.h dlfcn.h)
2002-09-25 19:19:00 +04:00
AC_CHECK_HEADERS(sys/syslog.h syslog.h)
2001-05-23 01:47:11 +04:00
1999-12-13 16:27:58 +03:00
#
# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
# This causes configure to fail to detect it. Check for shadow separately on HPUX.
#
case "$host_os" in
*hpux*)
AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
if test x"$ac_cv_header_shadow_h" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h])
1999-12-13 16:27:58 +03:00
fi
;;
esac
AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
2001-12-12 19:08:32 +03:00
AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
2001-04-13 23:12:06 +04:00
AC_CHECK_HEADERS(stropts.h poll.h)
AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
2001-06-19 00:27:35 +04:00
AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
1998-07-29 07:08:05 +04:00
2000-10-21 05:47:25 +04:00
# For experimental utmp support (lastlog on some BSD-like systems)
AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
# For quotas on Veritas VxFS filesystems
AC_CHECK_HEADERS(sys/fs/vx_quota.h)
2000-01-12 06:09:17 +03:00
2001-12-01 00:50:02 +03:00
# For quotas on Linux XFS filesystems
AC_CHECK_HEADERS(linux/xqm.h)
1998-09-21 13:07:08 +04:00
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
AC_CHECK_SIZEOF(short,cross)
1998-07-29 07:08:05 +04:00
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
1998-10-07 11:55:14 +04:00
AC_DIRENT_D_OFF
1998-07-29 07:08:05 +04:00
AC_CHECK_TYPE(ino_t,unsigned)
1998-10-05 07:52:57 +04:00
AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,loff_t)
1998-09-11 05:24:30 +04:00
AC_CHECK_TYPE(ssize_t, int)
1999-12-29 05:00:38 +03:00
AC_CHECK_TYPE(wchar_t, unsigned short)
1998-07-29 07:08:05 +04:00
2001-08-23 23:06:20 +04:00
############################################
# for cups support we need libcups, and a handful of header files
2002-07-15 14:35:28 +04:00
AC_ARG_ENABLE(cups,
[ --enable-cups Turn on CUPS support (default=auto)])
1999-12-13 16:27:58 +03:00
2002-07-15 14:35:28 +04:00
if test x$enable_cups != xno; then
AC_PATH_PROG(CUPS_CONFIG, cups-config)
2001-08-23 23:06:20 +04:00
2002-07-15 14:35:28 +04:00
if test "x$CUPS_CONFIG" != x; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
2002-07-15 14:35:28 +04:00
CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
2002-09-25 19:19:00 +04:00
PRINTLIBS="$PRINTLIBS `$CUPS_CONFIG --libs`"
2001-08-23 23:06:20 +04:00
fi
fi
############################################
2002-10-28 22:28:32 +03:00
# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
2002-07-15 14:35:28 +04:00
AC_CHECK_FUNCS(dlopen)
if test x"$ac_cv_func_dlopen" = x"no"; then
AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_DLOPEN,1,[Whether we have dlopen()])])
2002-07-15 14:35:28 +04:00
fi
# dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
1999-12-13 16:27:58 +03:00
2001-09-03 12:50:59 +04:00
############################################
# check if the compiler can do immediate structures
AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
AC_TRY_COMPILE([
#include <stdio.h>],
[
typedef struct {unsigned x;} FOOBAR;
2002-02-22 04:54:17 +03:00
#define X_FOOBAR(x) ((FOOBAR) { x })
#define FOO_ONE X_FOOBAR(1)
FOOBAR f = FOO_ONE;
static struct {
FOOBAR y;
} f2[] = {
{FOO_ONE}
};
2001-09-03 12:50:59 +04:00
],
samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
if test x"$samba_cv_immediate_structures" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
2001-09-03 12:50:59 +04:00
fi
2001-07-25 07:28:45 +04:00
############################################
# check for unix domain sockets
AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>],
[
struct sockaddr_un sunaddr;
sunaddr.sun_family = AF_UNIX;
],
samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
if test x"$samba_cv_unixsocket" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
2001-07-25 07:28:45 +04:00
fi
2001-06-25 06:53:13 +04:00
AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
AC_TRY_COMPILE([
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#include <sys/socket.h>],[socklen_t i = 0],
samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
if test x"$samba_cv_socklen_t" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t])
2001-06-25 06:53:13 +04:00
fi
1999-12-13 16:27:58 +03:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
1999-12-13 16:27:58 +03:00
fi
2001-05-30 16:28:13 +04:00
# stupid headers have the functions but no declaration. grrrr.
AC_HAVE_DECL(errno, [#include <errno.h>])
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
AC_HAVE_DECL(setresgid, [#include <unistd.h>])
AC_HAVE_DECL(asprintf, [#include <stdio.h>])
AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
AC_HAVE_DECL(snprintf, [#include <stdio.h>])
1998-10-15 04:55:17 +04:00
1998-08-19 19:01:03 +04:00
# and glibc has setresuid under linux but the function does
# nothing until kernel 2.1.44! very dumb.
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
AC_TRY_RUN([#include <errno.h>
1998-08-19 19:01:03 +04:00
main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
1998-09-21 13:07:08 +04:00
samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
if test x"$samba_cv_have_setresuid" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid])
1998-09-21 13:07:08 +04:00
fi
1998-08-19 19:01:03 +04:00
1999-12-13 16:27:58 +03:00
# Do the same check for setresguid...
#
AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
AC_TRY_RUN([#include <unistd.h>
#include <errno.h>
main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
if test x"$samba_cv_have_setresgid" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid])
1999-12-13 16:27:58 +03:00
fi
1998-07-29 07:08:05 +04:00
AC_FUNC_MEMCMP
###############################################
# test for where we get crypt() from
1998-09-21 13:07:08 +04:00
AC_CHECK_FUNCS(crypt)
if test x"$ac_cv_func_crypt" = x"no"; then
2002-10-28 22:28:32 +03:00
AC_CHECK_LIB(crypt, crypt, [AUTHLIBS="$AUTHLIBS -lcrypt";
AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
1998-07-29 07:08:05 +04:00
fi
###############################################
2001-04-13 23:12:06 +04:00
# Readline included by default unless explicitly asked not to
test "${with_readline+set}" != "set" && with_readline=yes
1999-12-13 16:27:58 +03:00
# test for where we get readline() from
2001-04-13 23:12:06 +04:00
AC_MSG_CHECKING(whether to use readline)
AC_ARG_WITH(readline,
2001-08-24 23:58:28 +04:00
[ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto) ],
2001-04-13 23:12:06 +04:00
[ case "$with_readline" in
yes)
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)
AC_CHECK_HEADERS(readline.h readline/readline.h,[
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
done
AC_CHECK_LIB(readline, rl_callback_handler_install,
[TERMLIBS="-lreadline $TERMLIBS"
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
2001-04-13 23:12:06 +04:00
break], [TERMLIBS=], $TERMLIBS)])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
1998-09-18 21:50:18 +04:00
2001-04-13 23:12:06 +04:00
# Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
# alternate readline path
_ldflags=${LDFLAGS}
_cppflags=${CPPFLAGS}
# Add additional search path
LDFLAGS="-L$with_readline/lib $LDFLAGS"
CPPFLAGS="-I$with_readline/include $CPPFLAGS"
AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)
AC_CHECK_HEADERS(readline.h readline/readline.h,[
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
done
AC_CHECK_LIB(readline, rl_callback_handler_install,
[TERMLDFLAGS="-L$with_readline/lib"
TERMCPPFLAGS="-I$with_readline/include"
CPPFLAGS="-I$with_readline/include $CPPFLAGS"
TERMLIBS="-lreadline $TERMLIBS"
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
2001-04-13 23:12:06 +04:00
break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
LDFLAGS=$_ldflags
;;
esac],
AC_MSG_RESULT(no)
)
AC_SUBST(TERMLIBS)
AC_SUBST(TERMLDFLAGS)
1999-12-13 16:27:58 +03:00
2001-11-19 07:18:45 +03:00
# The readline API changed slightly from readline3 to readline4, so
# code will generate warnings on one of them unless we have a few
# special cases.
AC_CHECK_LIB(readline, rl_completion_matches,
[AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
[Do we have rl_completion_matches?])],
[],
[$TERMLIBS])
1998-08-08 09:25:04 +04:00
# 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.
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
1998-09-21 13:07:08 +04:00
fi
fi
1998-08-08 09:25:04 +04:00
2000-10-07 04:26:04 +04:00
###############################################
# test for where we get get_yp_default_domain() from
AC_CHECK_FUNCS(yp_get_default_domain)
if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN,1,[Whether the system has yp_get_default_domain()])])
2000-10-07 04:26:04 +04:00
fi
1999-12-13 16:27:58 +03:00
# Check if we have execl, if not we need to compile smbrun.
AC_CHECK_FUNCS(execl)
if test x"$ac_cv_func_execl" = x"no"; then
RUNPROG="bin/smbrun"
else
RUNPROG=""
fi
1998-07-29 07:08:05 +04:00
2002-07-15 14:35:28 +04:00
AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
2001-12-30 04:46:38 +03:00
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
2001-04-28 17:49:34 +04:00
AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
2001-09-28 22:07:11 +04:00
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
2002-03-19 05:32:39 +03:00
AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath)
2000-02-15 22:36:47 +03:00
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
1999-12-13 16:27:58 +03:00
AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
2001-03-31 23:06:45 +04:00
AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
2001-06-30 02:32:24 +04:00
AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
2002-08-17 21:00:51 +04:00
AC_CHECK_FUNCS(syslog vsyslog getgrouplist)
2001-07-02 08:47:55 +04:00
# setbuffer is needed for smbtorture
AC_CHECK_FUNCS(setbuffer)
1999-12-13 16:27:58 +03:00
1998-11-14 00:41:01 +03:00
# syscall() is needed for smbwrapper.
AC_CHECK_FUNCS(syscall)
1998-07-29 07:08:05 +04:00
1998-10-04 18:02:50 +04:00
AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
AC_CHECK_FUNCS(__getcwd _getcwd)
AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
1998-10-04 19:54:04 +04:00
AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
1998-10-07 09:58:09 +04:00
AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
1998-10-06 16:23:37 +04:00
AC_CHECK_FUNCS(_write __write _fork __fork)
1998-10-05 04:48:59 +04:00
AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
1998-10-07 12:12:04 +04:00
AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
1998-10-05 06:14:19 +04:00
AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
1998-10-05 13:01:49 +04:00
AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
1998-10-04 18:02:50 +04:00
1999-12-13 16:27:58 +03:00
#
# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
#
if test x$ac_cv_func_stat64 = xno ; then
AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
AC_TRY_LINK([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/stat.h>
], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
AC_MSG_RESULT([$ac_cv_func_stat64])
if test x$ac_cv_func_stat64 = xyes ; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available])
1999-12-13 16:27:58 +03:00
fi
fi
if test x$ac_cv_func_lstat64 = xno ; then
AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
AC_TRY_LINK([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/stat.h>
], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
AC_MSG_RESULT([$ac_cv_func_lstat64])
if test x$ac_cv_func_lstat64 = xyes ; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available])
1999-12-13 16:27:58 +03:00
fi
fi
if test x$ac_cv_func_fstat64 = xno ; then
AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
AC_TRY_LINK([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/stat.h>
], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
AC_MSG_RESULT([$ac_cv_func_fstat64])
if test x$ac_cv_func_fstat64 = xyes ; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available])
1999-12-13 16:27:58 +03:00
fi
fi
2001-10-16 05:05:49 +04:00
#####################################
# we might need the resolv library on some systems
AC_CHECK_LIB(resolv, dn_expand)
1999-12-13 16:27:58 +03:00
1998-11-19 07:15:23 +03:00
#
1998-11-20 23:44:21 +03:00
# Check for the functions putprpwnam, set_auth_parameters,
# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
# Needed for OSF1 and HPUX.
1998-11-19 07:15:23 +03:00
#
1998-11-20 23:44:21 +03:00
1998-11-26 00:17:20 +03:00
AC_LIBTESTFUNC(security, putprpwnam)
AC_LIBTESTFUNC(sec, putprpwnam)
1998-11-19 01:04:24 +03:00
1998-11-26 00:17:20 +03:00
AC_LIBTESTFUNC(security, set_auth_parameters)
AC_LIBTESTFUNC(sec, set_auth_parameters)
1998-11-19 07:15:23 +03:00
1999-12-13 16:27:58 +03:00
# UnixWare 7.x has its getspnam in -lgen
AC_LIBTESTFUNC(gen, getspnam)
1998-11-26 00:17:20 +03:00
AC_LIBTESTFUNC(security, getspnam)
AC_LIBTESTFUNC(sec, getspnam)
1998-11-20 23:44:21 +03:00
1998-11-26 00:17:20 +03:00
AC_LIBTESTFUNC(security, bigcrypt)
AC_LIBTESTFUNC(sec, bigcrypt)
1998-11-20 23:44:21 +03:00
1998-11-26 00:17:20 +03:00
AC_LIBTESTFUNC(security, getprpwnam)
AC_LIBTESTFUNC(sec, getprpwnam)
1998-11-20 01:37:33 +03:00
1998-11-14 00:41:01 +03:00
# 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"
2002-07-15 14:35:28 +04:00
SONAMEFLAG="#"
2001-07-14 06:52:41 +04:00
SHLD="\${CC}"
1999-12-13 16:27:58 +03:00
PICFLAG=""
2001-07-23 15:22:29 +04:00
PICSUFFIX="po"
POBAD_CC="#"
1999-12-13 16:27:58 +03:00
SHLIBEXT="so"
2001-12-10 07:29:14 +03:00
# Assume non-shared by default and override below
2001-06-30 03:30:01 +04:00
BLDSHARED="false"
2001-12-10 07:29:14 +03:00
AC_MSG_CHECKING([ability to build shared libraries])
1998-11-14 00:41:01 +03:00
# and these are for particular systems
case "$host_os" in
2002-10-28 22:28:32 +03:00
*linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux])
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
LDSHFLAGS="-shared"
2002-02-22 06:29:13 +03:00
DYNEXP="-Wl,--export-dynamic"
2001-07-11 05:58:37 +04:00
PICFLAG="-fPIC"
2002-07-15 14:35:28 +04:00
SONAMEFLAG="-Wl,-soname="
2002-01-10 00:30:37 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,512)
2001-06-30 03:30:01 +04:00
;;
2002-10-28 22:28:32 +03:00
*solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
2002-07-15 14:35:28 +04:00
LDSHFLAGS="-G"
SONAMEFLAG="-h "
if test "${GCC}" = "yes"; then
2001-07-23 15:22:29 +04:00
PICFLAG="-fPIC"
2002-07-15 14:35:28 +04:00
if test "${ac_cv_prog_gnu_ld}" = "yes"; then
DYNEXP="-Wl,-E"
fi
2001-07-23 15:22:29 +04:00
else
2001-09-11 07:10:29 +04:00
PICFLAG="-KPIC"
2002-07-15 14:35:28 +04:00
## ${CFLAGS} added for building 64-bit shared
## libs using Sun's Compiler
LDSHFLAGS="-G \${CFLAGS}"
2001-07-23 15:22:29 +04:00
POBAD_CC=""
2001-09-11 08:29:25 +04:00
PICSUFFIX="po.o"
2001-07-23 15:22:29 +04:00
fi
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
1998-11-14 00:41:01 +03:00
;;
2002-10-28 22:28:32 +03:00
*sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
2002-07-15 14:35:28 +04:00
LDSHFLAGS="-G"
SONAMEFLAG="-Wl,-h,"
2001-09-11 07:10:29 +04:00
PICFLAG="-KPIC" # Is this correct for SunOS
1998-11-14 00:41:01 +03:00
;;
2002-09-25 19:19:00 +04:00
*freebsd*) BLDSHARED="true"
LDSHFLAGS="-shared"
DYNEXP="-Wl,--export-dynamic"
SONAMEFLAG="-Wl,-soname,"
PICFLAG="-fPIC -DPIC"
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
2002-09-25 19:19:00 +04:00
;;
*openbsd*) BLDSHARED="true"
2002-07-15 14:35:28 +04:00
LDSHFLAGS="-shared"
DYNEXP="-Wl,-Bdynamic"
SONAMEFLAG="-Wl,-soname,"
2001-09-11 07:10:29 +04:00
PICFLAG="-fPIC"
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
1998-11-14 00:41:01 +03:00
;;
2002-10-28 22:28:32 +03:00
*irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
1999-12-13 16:27:58 +03:00
case "$host_os" in
2002-10-28 22:28:32 +03:00
*irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
1999-12-13 16:27:58 +03:00
;;
esac
1998-11-14 04:04:13 +03:00
ATTEMPT_WRAP32_BUILD=yes
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
2002-07-15 14:35:28 +04:00
LDSHFLAGS="-set_version sgi1.0 -shared"
SONAMEFLAG="-soname "
2002-02-06 03:53:00 +03:00
SHLD="\${LD}"
2002-07-15 14:35:28 +04:00
if test "${GCC}" = "yes"; then
2001-07-23 11:18:03 +04:00
PICFLAG="-fPIC"
else
PICFLAG="-KPIC"
fi
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
2001-07-11 05:58:37 +04:00
;;
2002-10-28 22:28:32 +03:00
*aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
2002-07-15 14:35:28 +04:00
DYNEXP="-Wl,-brtl,-bexpall"
2002-09-25 19:19:00 +04:00
PICFLAG="-O2"
if test "${GCC}" != "yes"; then
2002-07-15 14:35:28 +04:00
## for funky AIX compiler using strncpy()
2002-09-25 19:19:00 +04:00
CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
2002-07-15 14:35:28 +04:00
fi
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block])
1998-11-14 00:41:01 +03:00
;;
2002-10-28 22:28:32 +03:00
*hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
1999-12-13 16:27:58 +03:00
SHLIBEXT="sl"
# Use special PIC flags for the native HP-UX compiler.
if test $ac_cv_prog_cc_Ae = yes; then
2002-03-23 11:28:19 +03:00
BLDSHARED="true"
2002-07-15 14:35:28 +04:00
SHLD="/usr/bin/ld"
LDSHFLAGS="-B symbolic -b -z"
SONAMEFLAG="+h "
1999-12-13 16:27:58 +03:00
PICFLAG="+z"
fi
2002-02-22 06:29:13 +03:00
DYNEXP="-Wl,-E"
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
1999-12-13 16:27:58 +03:00
;;
2002-10-28 22:28:32 +03:00
*qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx]);;
*osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
2002-07-15 14:35:28 +04:00
LDSHFLAGS="-shared"
SONAMEFLAG="-Wl,-soname,"
2001-07-11 05:58:37 +04:00
PICFLAG="-fPIC"
;;
2002-10-28 22:28:32 +03:00
*sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix]);;
*unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
2001-07-11 05:58:37 +04:00
BLDSHARED="true"
2002-07-15 14:35:28 +04:00
LDSHFLAGS="-shared"
SONAMEFLAG="-Wl,-soname,"
2001-07-23 11:22:11 +04:00
PICFLAG="-KPIC"
2001-07-11 05:58:37 +04:00
;;
2002-10-28 22:28:32 +03:00
*next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2]);;
1998-11-14 00:41:01 +03:00
*dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
2002-10-28 22:28:32 +03:00
*sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
1999-12-13 16:27:58 +03:00
case "$host" in
2002-07-15 14:35:28 +04:00
*-univel-*) if [ test "$GCC" != yes ]; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
2002-02-22 06:29:13 +03:00
fi
LDSHFLAGS="-G"
DYNEXP="-Bexport"
1999-12-13 16:27:58 +03:00
;;
2002-10-28 22:28:32 +03:00
*mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
1999-12-13 16:27:58 +03:00
esac
2002-02-22 06:29:13 +03:00
;;
2002-02-22 05:47:53 +03:00
2002-10-28 22:28:32 +03:00
*sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
1999-12-13 16:27:58 +03:00
if [ test "$GCC" != yes ]; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
1999-12-13 16:27:58 +03:00
fi
LDSHFLAGS="-G"
2002-02-22 06:29:13 +03:00
;;
1998-11-14 00:41:01 +03:00
esac
2002-02-22 05:47:53 +03:00
AC_SUBST(DYNEXP)
2001-12-10 07:29:14 +03:00
AC_MSG_RESULT($BLDSHARED)
AC_MSG_CHECKING([linker flags for shared libraries])
AC_MSG_RESULT([$LDSHFLAGS])
AC_MSG_CHECKING([compiler flags for position-independent code])
AC_MSG_RESULT([$PICFLAGS])
1998-11-14 00:41:01 +03:00
2002-01-01 01:10:24 +03:00
#######################################################
# test whether building a shared library actually works
if test $BLDSHARED = true; then
AC_CACHE_CHECK([whether building shared libraries actually works],
[ac_cv_shlib_works],[
ac_cv_shlib_works=no
# try building a trivial shared library
$CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
2002-04-04 09:47:41 +04:00
$CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
2002-01-01 01:10:24 +03:00
ac_cv_shlib_works=yes
rm -f shlib.so shlib.po
])
if test $ac_cv_shlib_works = no; then
BLDSHARED=false
fi
fi
2001-09-22 11:50:08 +04:00
# this updates our target list if we can build shared libs
if test $BLDSHARED = true; then
LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
else
LIBSMBCLIENT_SHARED=
fi
1998-11-14 00:41:01 +03:00
################
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([#include <stdio.h>
main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
2000-03-30 03:03:48 +04:00
#
# Check if the compiler supports the LL prefix on long long integers.
# AIX needs this.
AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers])
2000-03-30 03:03:48 +04:00
fi
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
1998-09-03 22:40:31 +04:00
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>
main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type])
1998-09-21 13:07:08 +04:00
fi
1998-09-03 22:40:31 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
1999-12-13 16:27:58 +03:00
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
1998-07-29 07:08:05 +04:00
#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); }],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
1998-09-05 00:53:58 +04:00
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>
main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type])
1998-09-21 13:07:08 +04:00
fi
1998-09-05 00:53:58 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
1999-12-13 16:27:58 +03:00
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
1998-09-05 00:53:58 +04:00
#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); }],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available])
1998-09-21 13:07:08 +04:00
fi
1998-09-05 00:53:58 +04:00
2002-01-10 03:28:09 +03:00
AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
#include <sys/stat.h>
main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available])
2002-01-10 03:28:09 +03:00
fi
1999-12-13 16:27:58 +03:00
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)])
2002-07-15 14:35:28 +04:00
if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available])
1999-12-13 16:27:58 +03:00
fi
2002-01-10 04:49:09 +03:00
AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/types.h>
main() { dev_t dev; int i = major(dev); return 0; }],
samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available])
2002-01-10 04:49:09 +03:00
fi
AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/types.h>
main() { dev_t dev; int i = minor(dev); return 0; }],
samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available])
2002-01-10 04:49:09 +03:00
fi
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([#include <stdio.h>
main() { char c; c=250; exit((c > 0)?0:1); }],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
1998-07-29 07:08:05 +04:00
AC_TRY_COMPILE([#include <sys/types.h>
1998-07-30 08:54:14 +04:00
#include <sys/socket.h>
#include <netinet/in.h>],
1998-07-29 07:08:05 +04:00
[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-10-07 10:15:08 +04:00
AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
AC_TRY_COMPILE([#include <sys/types.h>
1998-10-07 12:39:37 +04:00
#include <dirent.h>
void seekdir(DIR *d, long loc) { return; }],[return 0;],
1998-10-07 10:15:08 +04:00
samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void])
1998-10-07 10:15:08 +04:00
fi
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
1998-07-31 00:39:30 +04:00
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
1998-09-21 13:07:08 +04:00
samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_FILE_MACRO,1,[Whether there is a __FILE__ macro])
1998-09-21 13:07:08 +04:00
fi
1998-07-31 00:39:30 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
1998-07-30 11:05:15 +04:00
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
1998-09-21 13:07:08 +04:00
samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
1998-09-21 13:07:08 +04:00
fi
1998-07-30 11:05:15 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([
#include <sys/time.h>
#include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
2002-07-15 14:35:28 +04:00
AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[
AC_TRY_LINK([#include <stdarg.h>
va_list ap1,ap2;], [__va_copy(ap1,ap2);],
samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)])
if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available])
2002-07-15 14:35:28 +04:00
fi
2001-04-27 06:35:42 +04:00
AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
AC_TRY_RUN([
#include <sys/types.h>
#include <stdarg.h>
void foo(const char *format, ...) {
va_list ap;
int len;
2001-05-01 08:16:28 +04:00
char buf[5];
2002-02-22 04:54:17 +03:00
va_start(ap, format);
len = vsnprintf(buf, 0, format, ap);
va_end(ap);
if (len != 5) exit(1);
2001-04-27 06:35:42 +04:00
va_start(ap, format);
len = vsnprintf(0, 0, format, ap);
va_end(ap);
2001-05-01 08:16:28 +04:00
if (len != 5) exit(1);
if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
exit(0);
2001-04-27 06:35:42 +04:00
}
main() { foo("hello"); }
],
samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
2001-04-27 06:35:42 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1998-07-29 07:08:05 +04:00
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);} ],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1998-07-29 07:08:05 +04:00
AC_TRY_COMPILE([#include <sys/types.h>
#include <utime.h>],
[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
2000-10-21 05:47:25 +04:00
dnl utmp and utmpx come in many flavours
dnl We need to check for many of them
dnl But we don't need to do each and every one, because our code uses
dnl mostly just the utmp (not utmpx) fields.
AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_name[0] = 'a';],
samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_NAME,1,[Whether the utmp struct has a property ut_name])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_user[0] = 'a';],
samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_USER,1,[Whether the utmp struct has a property ut_user])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_id[0] = 'a';],
samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_ID,1,[Whether the utmp struct has a property ut_id])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_host[0] = 'a';],
samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_HOST,1,[Whether the utmp struct has a property ut_host])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; time_t t; ut.ut_time = t;],
samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_TIME,1,[Whether the utmp struct has a property ut_time])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_TV,1,[Whether the utmp struct has a property ut_tv])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_type = 0;],
samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_TYPE,1,[Whether the utmp struct has a property ut_type])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_pid = 0;],
samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_PID,1,[Whether the utmp struct has a property ut_pid])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_exit.e_exit = 0;],
samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit])
2000-10-21 05:47:25 +04:00
fi
AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp ut; ut.ut_addr = 0;],
samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr])
2000-10-21 05:47:25 +04:00
fi
if test x$ac_cv_func_pututline = xyes ; then
AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmp.h>],
[struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(PUTUTLINE_RETURNS_UTMP,1,[Whether pututline returns pointer])
2000-10-21 05:47:25 +04:00
fi
fi
2000-03-22 22:03:12 +03:00
AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
2000-10-21 05:47:25 +04:00
AC_TRY_COMPILE([#include <sys/types.h>
#include <utmpx.h>],
2000-03-22 22:03:12 +03:00
[struct utmpx ux; ux.ut_syslen = 0;],
samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen])
2000-03-22 22:03:12 +03:00
fi
2001-07-25 07:05:00 +04:00
#################################################
# check for libiconv support
AC_MSG_CHECKING(whether to use libiconv)
AC_ARG_WITH(libiconv,
2001-08-24 23:58:28 +04:00
[ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
2001-07-25 07:05:00 +04:00
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
AC_CHECK_LIB(iconv, iconv_open)
2002-10-28 22:28:32 +03:00
AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}",[Path to iconv])
2001-07-25 07:05:00 +04:00
;;
esac ],
AC_MSG_RESULT(no)
)
2001-07-04 11:15:53 +04:00
############
2001-07-25 07:05:00 +04:00
# check for iconv in libc
2001-07-04 11:15:53 +04:00
AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
AC_TRY_RUN([
#include <iconv.h>
main() {
2001-07-25 07:05:00 +04:00
iconv_t cd = iconv_open("ASCII", "UCS-2LE");
2001-07-04 11:15:53 +04:00
if (cd == 0 || cd == (iconv_t)-1) return -1;
return 0;
}
],
samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)])
if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
2001-07-04 11:15:53 +04:00
fi
2000-06-08 11:40:55 +04:00
AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
AC_TRY_RUN([
#include <sys/types.h>
#include <fcntl.h>
#ifndef F_GETLEASE
2000-06-09 10:55:25 +04:00
#define F_GETLEASE 1025
2000-06-08 11:40:55 +04:00
#endif
main() {
int fd = open("/dev/null", O_RDONLY);
return fcntl(fd, F_GETLEASE, 0) == -1;
}
],
samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks])
2000-06-08 11:40:55 +04:00
fi
2000-06-14 11:10:15 +04:00
AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
AC_TRY_RUN([
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h>
#ifndef F_NOTIFY
#define F_NOTIFY 1026
#endif
main() {
2000-06-29 12:23:56 +04:00
exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
2000-06-14 11:10:15 +04:00
}
],
samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes])
2000-06-14 11:10:15 +04:00
fi
2000-06-15 13:35:37 +04:00
AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
AC_TRY_RUN([
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/file.h>
#ifndef LOCK_MAND
#define LOCK_MAND 32
#define LOCK_READ 64
#endif
main() {
exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
}
],
samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes])
2000-06-15 13:35:37 +04:00
fi
2000-06-14 11:10:15 +04:00
2000-06-08 11:40:55 +04:00
AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1998-09-23 05:48:45 +04:00
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;],
2000-06-08 11:40:55 +04:00
samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
1998-09-23 05:48:45 +04:00
fi
1998-09-26 03:40:49 +04:00
AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1998-09-29 01:43:48 +04:00
AC_TRY_RUN([#include <sys/types.h>
#include <sys/capability.h>
main() {
cap_t cap;
1998-09-26 03:40:49 +04:00
if ((cap = cap_get_proc()) == NULL)
exit(1);
cap->cap_effective |= CAP_NETWORK_MGT;
cap->cap_inheritable |= CAP_NETWORK_MGT;
1998-09-29 01:43:48 +04:00
cap_set_proc(cap);
exit(0);
}
1998-09-26 03:40:49 +04:00
],
1998-09-29 01:43:48 +04:00
samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1998-09-26 03:40:49 +04:00
if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
1998-09-26 03:40:49 +04:00
fi
1998-09-05 17:21:57 +04:00
1998-11-19 07:15:23 +03:00
#
# 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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H,1,[Whether int16 typedef is included by rpc/rpc.h])
1998-11-19 07:15:23 +03:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H,1,[Whether uint16 typedef is included by rpc/rpc.h])
1998-11-19 07:15:23 +03:00
fi
AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1998-11-19 01:04:24 +03:00
AC_TRY_COMPILE([#include <sys/types.h>
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
1998-11-19 07:15:23 +03:00
[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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H,1,[Whether int32 typedef is included by rpc/rpc.h])
1998-11-19 01:04:24 +03:00
fi
1998-11-19 07:15:23 +03:00
AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1998-11-19 01:04:24 +03:00
AC_TRY_COMPILE([#include <sys/types.h>
#if defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#endif],
1998-11-19 07:15:23 +03:00
[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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H,1,[Whether uint32 typedef is included by rpc/rpc.h])
1998-11-19 01:04:24 +03:00
fi
1999-12-13 16:27:58 +03:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT,1,[Whether there is a conflicting AUTH_ERROR define in rpc/rpc.h])
1999-12-13 16:27:58 +03:00
fi
1998-09-21 13:07:08 +04:00
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]))
1998-09-05 17:21:57 +04:00
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
2001-06-26 11:44:02 +04:00
AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
samba_cv_HAVE_WORKING_AF_LOCAL=yes,
samba_cv_HAVE_WORKING_AF_LOCAL=no,
samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
then
AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
fi
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 09:05:36 +04:00
1998-09-21 15:34:44 +04:00
AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
SAVE_CPPFLAGS="$CPPFLAGS"
2002-07-15 14:35:28 +04:00
CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/smbwrapper"
1998-09-21 15:34:44 +04:00
AC_TRY_COMPILE([
#define REPLACE_GETPASS 1
#define NO_CONFIG_H 1
#define main dont_declare_main
#include "${srcdir-.}/lib/getsmbpass.c"
#undef main
],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
CPPFLAGS="$SAVE_CPPFLAGS"
])
if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
1998-09-21 15:34:44 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1998-07-29 11:02:06 +04:00
AC_TRY_RUN([
#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
1999-12-13 16:27:58 +03:00
#ifdef HAVE_ARPA_INET_H
1998-07-29 11:02:06 +04:00
#include <arpa/inet.h>
1999-12-13 16:27:58 +03:00
#endif
1998-07-29 11:02:06 +04:00
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);}],
1998-09-21 13:07:08 +04:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 11:02:06 +04:00
2001-04-12 03:19:08 +04:00
AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
AC_TRY_RUN([#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
main() {
struct stat st;
char tpl[20]="/tmp/test.XXXXXX";
int fd = mkstemp(tpl);
if (fd == -1) exit(1);
unlink(tpl);
if (fstat(fd, &st) != 0) exit(1);
if ((st.st_mode & 0777) != 0600) exit(1);
exit(0);
}],
samba_cv_HAVE_SECURE_MKSTEMP=yes,
samba_cv_HAVE_SECURE_MKSTEMP=no,
samba_cv_HAVE_SECURE_MKSTEMP=cross)])
if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
2001-04-12 03:19:08 +04:00
fi
2000-02-15 22:36:47 +03:00
AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
AC_TRY_RUN([#include <unistd.h>
main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available])
2000-02-15 22:36:47 +03:00
fi
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([main() { exit(getuid() != 0); }],
1998-09-21 13:07:08 +04:00
samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_ROOT,1,[Whether current user is root])
1998-09-21 13:07:08 +04:00
else
AC_MSG_WARN(running as non-root will disable some tests)
fi
1998-07-29 07:08:05 +04:00
1999-12-13 16:27:58 +03:00
##################
# look for a method of finding the list of network interfaces
iface=no;
AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([
1999-12-13 16:27:58 +03:00
#define HAVE_IFACE_AIX 1
#define AUTOCONF_TEST 1
#include "confdefs.h"
#include "${srcdir-.}/lib/interfaces.c"],
samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
2002-10-28 22:28:32 +03:00
iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1999-12-13 16:27:58 +03:00
if test $iface = no; then
AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([
1999-12-13 16:27:58 +03:00
#define HAVE_IFACE_IFCONF 1
#define AUTOCONF_TEST 1
#include "confdefs.h"
#include "${srcdir-.}/lib/interfaces.c"],
samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
2002-10-28 22:28:32 +03:00
iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
fi
1999-12-13 16:27:58 +03:00
if test $iface = no; then
AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1998-07-29 07:08:05 +04:00
AC_TRY_RUN([
1999-12-13 16:27:58 +03:00
#define HAVE_IFACE_IFREQ 1
#define AUTOCONF_TEST 1
#include "confdefs.h"
#include "${srcdir-.}/lib/interfaces.c"],
samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
2002-10-28 22:28:32 +03:00
iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
fi
1999-12-13 16:27:58 +03:00
################################################
# look for a method of setting the effective uid
seteuid=no;
if test $seteuid = no; then
AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
AC_TRY_RUN([
#define AUTOCONF_TEST 1
#define USE_SETRESUID 1
#include "confdefs.h"
#include "${srcdir-.}/lib/util_sec.c"],
samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
2002-10-28 22:28:32 +03:00
seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
1999-12-13 16:27:58 +03:00
fi
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1999-12-13 16:27:58 +03:00
if test $seteuid = no; then
AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
AC_TRY_RUN([
#define AUTOCONF_TEST 1
#define USE_SETREUID 1
#include "confdefs.h"
#include "${srcdir-.}/lib/util_sec.c"],
samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
if test x"$samba_cv_USE_SETREUID" = x"yes"; then
2002-10-28 22:28:32 +03:00
seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
1999-12-13 16:27:58 +03:00
fi
fi
if test $seteuid = no; then
AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
AC_TRY_RUN([
#define AUTOCONF_TEST 1
#define USE_SETEUID 1
#include "confdefs.h"
#include "${srcdir-.}/lib/util_sec.c"],
samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
if test x"$samba_cv_USE_SETEUID" = x"yes"; then
2002-10-28 22:28:32 +03:00
seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available])
1999-12-13 16:27:58 +03:00
fi
fi
if test $seteuid = no; then
AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
AC_TRY_RUN([
#define AUTOCONF_TEST 1
#define USE_SETUIDX 1
#include "confdefs.h"
#include "${srcdir-.}/lib/util_sec.c"],
samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
2002-10-28 22:28:32 +03:00
seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available])
1999-12-13 16:27:58 +03:00
fi
fi
2000-04-17 10:11:08 +04:00
AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1998-09-21 13:07:08 +04:00
AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
2000-04-17 10:11:08 +04:00
samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
1999-12-13 16:27:58 +03:00
fi
AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(FTRUNCATE_NEEDS_ROOT,1,[Whether ftruncate() needs root])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1998-09-21 13:07:08 +04:00
AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available])
1998-09-21 13:07:08 +04:00
fi
1998-07-29 07:08:05 +04:00
1999-12-13 16:27:58 +03:00
AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken])
1999-12-13 16:27:58 +03:00
else
dnl
dnl Don't check for 64 bit fcntl locking if we know that the
dnl glibc2.1 broken check has succeeded.
dnl
AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
1998-09-04 04:23:28 +04:00
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
main() { struct flock64 fl64;
#if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
exit(0);
#else
exit(1);
#endif
}],
1998-09-21 13:07:08 +04:00
samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1999-12-13 16:27:58 +03:00
if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available])
1999-12-13 16:27:58 +03:00
fi
1998-09-21 13:07:08 +04:00
fi
1998-09-04 04:23:28 +04:00
2002-01-10 00:30:37 +03:00
AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>],
[struct stat st; st.st_blocks = 0;],
samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property])
2002-01-10 00:30:37 +03:00
fi
2001-11-15 02:00:37 +03:00
2002-09-25 19:19:00 +04:00
AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>],
[struct stat st; st.st_blksize = 0;],
samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)])
if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property])
2002-09-25 19:19:00 +04:00
fi
2001-11-15 02:00:37 +03:00
case "$host_os" in
*linux*)
AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
AC_TRY_COMPILE([
2001-11-15 04:18:10 +03:00
#ifdef HAVE_SYS_VFS_H
2001-11-15 02:00:37 +03:00
#include <sys/vfs.h>
2001-11-15 04:18:10 +03:00
#endif
2001-11-17 02:22:49 +03:00
#ifdef HAVE_SYS_CAPABILITY_H
2001-11-15 02:00:37 +03:00
#include <sys/capability.h>
2001-11-15 04:18:10 +03:00
#endif
2001-11-15 02:00:37 +03:00
],[int i;],
samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
2001-11-15 02:00:37 +03:00
fi
;;
esac
1999-12-13 16:27:58 +03:00
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],
2001-11-15 04:18:10 +03:00
[int i;],
1999-12-13 16:27:58 +03:00
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
2002-10-28 22:28:32 +03:00
AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES,1,[Whether the nisplus include files are broken])
1999-12-13 16:27:58 +03:00
fi
1998-11-14 04:04:13 +03:00
#################################################
# check for smbwrapper support
AC_MSG_CHECKING(whether to use smbwrapper)
AC_ARG_WITH(smbwrapper,
2001-08-24 23:58:28 +04:00
[ --with-smbwrapper Include SMB wrapper support (default=no) ],
1998-11-14 04:04:13 +03:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_SMBWRAPPER,1,[Whether to include smbwrapper support])
2002-07-15 14:35:28 +04:00
WRAPPROG="bin/smbsh"
WRAP="bin/smbwrapper.$SHLIBEXT"
1998-11-14 04:04:13 +03:00
if test x$ATTEMPT_WRAP32_BUILD = x; then
WRAP32=""
else
1999-12-13 16:27:58 +03:00
WRAP32=bin/smbwrapper.32.$SHLIBEXT
1998-11-14 04:04:13 +03:00
fi
# Conditions under which smbwrapper should not be built.
if test x$PICFLAG = x; then
echo No support for PIC code - disabling smbwrapper and smbsh
2002-07-15 14:35:28 +04:00
WRAPPROG=""
1998-11-14 04:04:13 +03:00
WRAP=""
WRAP32=""
elif test x$ac_cv_func_syscall = xno; then
AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
2002-07-15 14:35:28 +04:00
WRAPPROG=""
1998-11-14 04:04:13 +03:00
WRAP=""
WRAP32=""
fi
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
1998-07-29 07:08:05 +04:00
#################################################
2001-11-11 13:42:07 +03:00
# check for AFS clear-text auth support
AC_MSG_CHECKING(whether to use AFS clear-text auth)
1998-07-29 07:08:05 +04:00
AC_ARG_WITH(afs,
2001-11-11 13:42:07 +03:00
[ --with-afs Include AFS clear-text auth support (default=no) ],
1998-07-29 07:08:05 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_AFS,1,[Whether to include AFS clear-text auth support])
1998-07-29 07:08:05 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
#################################################
2001-11-11 13:42:07 +03:00
# check for the DFS clear-text auth system
AC_MSG_CHECKING(whether to use DFS clear-text auth)
1998-07-29 07:08:05 +04:00
AC_ARG_WITH(dfs,
2001-11-11 13:42:07 +03:00
[ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)],
1998-07-29 07:08:05 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_DFS,1,[Whether to include DFS support])
1998-07-29 07:08:05 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2002-09-25 19:19:00 +04:00
#################################################
# active directory support
with_ads_support=yes
AC_MSG_CHECKING([whether to use Active Directory])
2001-10-16 05:05:49 +04:00
2002-09-25 19:19:00 +04:00
AC_ARG_WITH(ads,
[ --with-ads Active Directory support (default yes)],
[ case "$withval" in
no)
with_ads_support=no
;;
esac ])
if test x"$with_ads_support" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
2002-09-25 19:19:00 +04:00
fi
AC_MSG_RESULT($with_ads_support)
FOUND_KRB5=no
if test x"$with_ads_support" = x"yes"; then
#################################################
# check for location of Kerberos 5 install
AC_MSG_CHECKING(for kerberos 5 install path)
AC_ARG_WITH(krb5,
[ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
LIBS="$LIBS -lkrb5"
CFLAGS="$CFLAGS -I$withval/include"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
FOUND_KRB5=yes
;;
esac ],
AC_MSG_RESULT(no)
)
if test x$FOUND_KRB5 = x"no"; then
2001-11-27 04:45:08 +03:00
#################################################
# see if this box has the RedHat location for kerberos
AC_MSG_CHECKING(for /usr/kerberos)
if test -d /usr/kerberos; then
LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
CFLAGS="$CFLAGS -I/usr/kerberos/include"
2001-11-28 09:52:33 +03:00
CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
2001-11-27 04:45:08 +03:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
2002-09-25 19:19:00 +04:00
fi
2001-11-27 04:45:08 +03:00
1999-12-13 16:27:58 +03:00
2002-09-25 19:19:00 +04:00
# now check for krb5.h. Some systems have the libraries without the headers!
# note that this check is done here to allow for different kerberos
# include paths
AC_CHECK_HEADERS(krb5.h)
2001-11-28 01:37:25 +03:00
2002-09-25 19:19:00 +04:00
# now check for gssapi headers. This is also done here to allow for
# different kerberos include paths
AC_CHECK_HEADERS(gssapi/gssapi_generic.h gssapi/gssapi.h)
2001-12-10 21:07:17 +03:00
2002-09-25 19:19:00 +04:00
##################################################################
# we might need the k5crypto and com_err libraries on some systems
AC_CHECK_LIB(com_err, _et_list, [LIBS="$LIBS -lcom_err"])
AC_CHECK_LIB(k5crypto, krb5_encrypt_data, [LIBS="$LIBS -lk5crypto"])
2001-10-15 05:54:39 +04:00
2002-09-25 19:19:00 +04:00
########################################################
# now see if we can find the krb5 libs in standard paths
# or as specified above
AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_KRB5,1,[Whether KRB5 is available])])
2001-10-15 05:54:39 +04:00
2002-09-25 19:19:00 +04:00
########################################################
# now see if we can find the gssapi libs in standard paths
AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5";
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
2002-09-25 19:19:00 +04:00
fi
2001-12-01 01:45:52 +03:00
2001-11-20 11:54:15 +03:00
########################################################
2002-09-25 19:19:00 +04:00
# Compile with LDAP support?
with_ldap_support=yes
AC_MSG_CHECKING([whether to use LDAP])
AC_ARG_WITH(ldap,
[ --with-ldap LDAP support (default yes)],
[ case "$withval" in
no)
with_ldap_support=no
;;
esac ])
AC_MSG_RESULT($with_ldap_support)
if test x"$with_ldap_support" = x"yes"; then
##################################################################
# we might need the lber lib on some systems. To avoid link errors
# this test must be before the libldap test
AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
########################################################
# now see if we can find the ldap libs in standard paths
if test x$have_ldap != xyes; then
AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])])
2002-07-15 14:35:28 +04:00
########################################################
# If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
# Check found in pam_ldap 145.
AC_CHECK_FUNCS(ldap_set_rebind_proc)
AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, pam_ldap_cv_ldap_set_rebind_proc, [
AC_TRY_COMPILE([
#include <lber.h>
#include <ldap.h>], [ldap_set_rebind_proc(0, 0, 0);], [pam_ldap_cv_ldap_set_rebind_proc=3], [pam_ldap_cv_ldap_set_rebind_proc=2]) ])
2002-10-28 22:28:32 +03:00
AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
2002-09-25 19:19:00 +04:00
fi
2001-11-20 11:54:15 +03:00
fi
1998-07-29 07:08:05 +04:00
#################################################
# check for automount support
AC_MSG_CHECKING(whether to use AUTOMOUNT)
AC_ARG_WITH(automount,
2001-08-24 23:58:28 +04:00
[ --with-automount Include AUTOMOUNT support (default=no)],
1998-07-29 07:08:05 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_AUTOMOUNT,1,[Whether to include automount support])
1998-07-29 07:08:05 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
1998-09-28 23:18:21 +04:00
#################################################
# check for smbmount support
AC_MSG_CHECKING(whether to use SMBMOUNT)
AC_ARG_WITH(smbmount,
2001-08-24 23:58:28 +04:00
[ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1998-09-28 23:18:21 +04:00
[ case "$withval" in
yes)
2001-09-21 01:06:02 +04:00
case "$host_os" in
*linux*)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_SMBMOUNT,1,[Whether to build smbmount])
2001-09-21 01:06:02 +04:00
MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
;;
*)
AC_MSG_ERROR(not on a linux system!)
;;
esac
1998-09-28 23:18:21 +04:00
;;
*)
AC_MSG_RESULT(no)
MPROGS=
;;
esac ],
AC_MSG_RESULT(no)
MPROGS=
)
1999-12-13 16:27:58 +03:00
#################################################
2001-11-11 13:42:07 +03:00
# check for a PAM clear-text auth, accounts, password and session support
2001-08-07 23:34:38 +04:00
with_pam_for_crypt=no
2001-11-11 13:42:07 +03:00
AC_MSG_CHECKING(whether to use PAM)
1999-12-13 16:27:58 +03:00
AC_ARG_WITH(pam,
2001-11-11 13:42:07 +03:00
[ --with-pam Include PAM support (default=no)],
1999-12-13 16:27:58 +03:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_PAM,1,[Whether to include PAM support])
AUTHLIBS="$AUTHLIBS -lpam"
2001-08-07 23:34:38 +04:00
with_pam_for_crypt=yes
1999-12-13 16:27:58 +03:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2001-04-25 01:13:48 +04:00
# we can't build a pam module if we don't have pam.
2002-10-28 22:28:32 +03:00
AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM,1,[Whether libpam is available])])
2001-04-25 01:13:48 +04:00
#################################################
# check for pam_smbpass support
AC_MSG_CHECKING(whether to use pam_smbpass)
AC_ARG_WITH(pam_smbpass,
2001-09-08 03:56:54 +04:00
[ --with-pam_smbpass Build a PAM module to allow other applications to use our smbpasswd file (default=no)],
2001-04-25 01:13:48 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
# Conditions under which pam_smbpass should not be built.
if test x$PICFLAG = x; then
AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
PAM_MOD=""
elif test x$ac_cv_lib_pam_pam_get_data = xno; then
AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
PAM_MOD=""
else
PAM_MOD="bin/pam_smbpass.so"
fi
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2001-04-19 17:47:12 +04:00
###############################################
# test for where we get crypt() from, but only
# if not using PAM
2002-09-25 19:19:00 +04:00
if test x"$with_pam_for_crypt" = x"no"; then
2001-04-19 17:47:12 +04:00
AC_CHECK_FUNCS(crypt)
if test x"$ac_cv_func_crypt" = x"no"; then
2002-10-28 22:28:32 +03:00
AC_CHECK_LIB(crypt, crypt, [AUTHLIBS="$AUTHLIBS -lcrypt";
AC_DEFINE(HAVE_CRYPT,1,[Whether crypt() is available])])
2001-04-19 17:47:12 +04:00
fi
fi
2001-08-07 23:34:38 +04:00
##
## moved after the check for -lcrypt in order to
## ensure that the necessary libraries are included
## check checking for truncated salt. Wrapped by the
## $with_pam_for_crypt variable as above --jerry
##
if test $with_pam_for_crypt = no; then
AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
2002-10-28 22:28:32 +03:00
crypt_LIBS="$LIBS"
LIBS="$AUTHLIBS $LIBS"
2001-08-07 23:34:38 +04:00
AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
2002-10-28 22:28:32 +03:00
samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)
LIBS="$crypt_LIBS"])
2001-08-07 23:34:38 +04:00
if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt])
2001-08-07 23:34:38 +04:00
fi
fi
2001-09-26 04:22:54 +04:00
########################################################################################
##
## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
##
########################################################################################
2002-10-01 17:10:57 +04:00
#################################################
# check for a LDAP password database configuration backwards compatibility
AC_MSG_CHECKING(whether to use LDAP SAM 2.2 compatible configuration)
AC_ARG_WITH(ldapsam,
[ --with-ldapsam Include LDAP SAM 2.2 compatible configuration (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_LDAP_SAMCONFIG,1,[Whether to include 2.2 compatibel LDAP SAM configuration])
2002-10-01 17:10:57 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2000-10-26 07:31:41 +04:00
#################################################
# check for a TDB password database
2001-09-26 04:22:54 +04:00
AC_MSG_CHECKING(whether to use TDB SAM database)
2000-11-21 08:55:16 +03:00
AC_ARG_WITH(tdbsam,
2001-09-26 04:22:54 +04:00
[ --with-tdbsam Include experimental TDB SAM support (default=no)],
2000-10-26 07:31:41 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_TDB_SAM,1,[Whether to include experimental TDB SAM support])
2000-10-26 07:31:41 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
1999-12-13 16:27:58 +03:00
1998-07-29 07:08:05 +04:00
#################################################
# check for a NISPLUS password database
2001-09-26 00:21:21 +04:00
AC_MSG_CHECKING(whether to use NISPLUS SAM database)
AC_ARG_WITH(nisplussam,
[ --with-nisplussam Include NISPLUS SAM support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_NISPLUS_SAM,1,[Whether to include nisplus SAM support])
2001-09-26 00:21:21 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2001-09-26 04:22:54 +04:00
########################################################################################
##
## END OF TESTS FOR SAM BACKENDS.
##
########################################################################################
1998-08-08 05:15:14 +04:00
#################################################
# check for a NISPLUS_HOME support
AC_MSG_CHECKING(whether to use NISPLUS_HOME)
AC_ARG_WITH(nisplus-home,
2001-08-24 23:58:28 +04:00
[ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
1998-08-08 05:15:14 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_NISPLUS_HOME,1,[Whether to include nisplus_home support])
1998-08-08 05:15:14 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
1998-07-29 07:08:05 +04:00
#################################################
# check for syslog logging
AC_MSG_CHECKING(whether to use syslog logging)
AC_ARG_WITH(syslog,
2001-08-24 23:58:28 +04:00
[ --with-syslog Include experimental SYSLOG support (default=no)],
1998-07-29 07:08:05 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_SYSLOG,1,[Whether to include experimental syslog support])
1998-07-29 07:08:05 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
1999-04-01 09:22:58 +04:00
#################################################
# check for a shared memory profiling support
AC_MSG_CHECKING(whether to use profiling)
2001-09-05 21:39:51 +04:00
AC_ARG_WITH(profiling-data,
2001-08-24 23:58:28 +04:00
[ --with-profiling-data Include gathering source code profile information (default=no)],
1999-04-01 09:22:58 +04:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling])
1999-04-01 09:22:58 +04:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
1998-11-03 05:25:28 +03:00
#################################################
# check for experimental disk-quotas support
2000-04-16 10:17:59 +04:00
QUOTAOBJS=smbd/noquotas.o
1998-11-03 05:25:28 +03:00
AC_MSG_CHECKING(whether to support disk-quotas)
AC_ARG_WITH(quotas,
2001-08-24 23:58:28 +04:00
[ --with-quotas Include experimental disk-quota support (default=no)],
1998-11-03 05:25:28 +03:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2001-09-22 02:06:03 +04:00
case "$host_os" in
*linux*)
# Check for kernel 2.4.x quota braindamage...
AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
AC_TRY_COMPILE([#include <stdio.h>
#include <sys/types.h>
#include <asm/types.h>
#include <linux/quota.h>
#include <mntent.h>
#include <linux/unistd.h>],[struct mem_dqblk D;],
samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(LINUX_QUOTAS_2,1,[linux 2.4.x quota braindamage])
2001-09-22 02:06:03 +04:00
else
2002-10-28 22:28:32 +03:00
AC_DEFINE(LINUX_QUOTAS_1,1,[linux quotas])
2001-09-22 02:06:03 +04:00
fi
;;
*)
;;
esac
2000-04-16 10:17:59 +04:00
QUOTAOBJS=smbd/quotas.o
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_QUOTAS,1,[Whether to include experimental quota support])
1998-11-03 05:25:28 +03:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
AC_SUBST(QUOTAOBJS)
1998-07-29 07:08:05 +04:00
2000-01-12 06:09:17 +03:00
#################################################
# check for experimental utmp accounting
AC_MSG_CHECKING(whether to support utmp accounting)
AC_ARG_WITH(utmp,
2001-08-24 23:58:28 +04:00
[ --with-utmp Include experimental utmp accounting (default=no)],
2000-01-12 06:09:17 +03:00
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_UTMP,1,[Whether to include experimental utmp accounting])
2000-01-12 06:09:17 +03:00
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2001-09-24 19:55:09 +04:00
#################################################
# choose native language(s) of man pages
AC_MSG_CHECKING(chosen man pages' language(s))
AC_ARG_WITH(manpages-langs,
[ --with-manpages-langs={en,ja,pl} Choose man pages' language(s). (en)],
[ case "$withval" in
yes|no)
AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
manlangs="en"
;;
*)
manlangs="$withval"
;;
esac
AC_MSG_RESULT($manlangs)
2001-09-25 18:11:28 +04:00
manlangs=`echo $manlangs | sed "s/,/ /"` # replacing commas with spaces to produce a list
2001-09-24 19:55:09 +04:00
AC_SUBST(manlangs)],
[manlangs="en"
AC_MSG_RESULT($manlangs)
AC_SUBST(manlangs)]
)
2002-07-15 14:35:28 +04:00
#################################################
# should we build libsmbclient?
LIBSMBCLIENT_SHARED=
LIBSMBCLIENT=
AC_MSG_CHECKING(whether to build the libsmbclient shared library)
AC_ARG_WITH(libsmbclient,
[ --with-libsmbclient Build the libsmbclient shared library (default=yes)],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
if test $BLDSHARED = true; then
LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
LIBSMBCLIENT=libsmbclient
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no shared library support)
fi
;;
esac ],
AC_MSG_RESULT(yes)
)
1998-07-29 07:08:05 +04:00
#################################################
# these tests are taken from the GNU fileutils package
AC_CHECKING(how to get filesystem space usage)
space=no
1998-09-18 03:06:57 +04:00
# Test for statvfs64.
if test $space = no; then
# SVR4
AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
[AC_TRY_RUN([
1999-12-13 16:27:58 +03:00
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
1998-09-18 03:06:57 +04:00
#include <sys/types.h>
#include <sys/statvfs.h>
main ()
{
struct statvfs64 fsd;
1999-12-13 16:27:58 +03:00
exit (statvfs64 (".", &fsd));
1998-09-18 03:06:57 +04:00
}],
fu_cv_sys_stat_statvfs64=yes,
1998-09-21 13:07:08 +04:00
fu_cv_sys_stat_statvfs64=no,
fu_cv_sys_stat_statvfs64=cross)])
1998-09-18 03:06:57 +04:00
if test $fu_cv_sys_stat_statvfs64 = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
1998-09-18 03:06:57 +04:00
fi
fi
1998-07-29 07:08:05 +04:00
# Perform only the link test since it seems there are no variants of the
# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
# because that got a false positive on SCO OSR5. Adding the declaration
# of a `struct statvfs' causes this test to fail (as it should) on such
# systems. That system is reported to work fine with STAT_STATFS4 which
# is what it gets when this test fails.
if test $space = no; then
# SVR4
AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
[AC_TRY_LINK([#include <sys/types.h>
#include <sys/statvfs.h>],
[struct statvfs fsd; statvfs (0, &fsd);],
fu_cv_sys_stat_statvfs=yes,
fu_cv_sys_stat_statvfs=no)])
if test $fu_cv_sys_stat_statvfs = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
1998-07-29 07:08:05 +04:00
fi
fi
if test $space = no; then
# DEC Alpha running OSF/1
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
[AC_TRY_RUN([
#include <sys/param.h>
#include <sys/types.h>
#include <sys/mount.h>
main ()
{
struct statfs fsd;
fsd.f_fsize = 0;
exit (statfs (".", &fsd, sizeof (struct statfs)));
}],
fu_cv_sys_stat_statfs3_osf1=yes,
fu_cv_sys_stat_statfs3_osf1=no,
fu_cv_sys_stat_statfs3_osf1=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
1998-07-29 07:08:05 +04:00
fi
fi
if test $space = no; then
# AIX
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
member (AIX, 4.3BSD)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
[AC_TRY_RUN([
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
main ()
{
struct statfs fsd;
fsd.f_bsize = 0;
exit (statfs (".", &fsd));
}],
fu_cv_sys_stat_statfs2_bsize=yes,
fu_cv_sys_stat_statfs2_bsize=no,
fu_cv_sys_stat_statfs2_bsize=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
if test $fu_cv_sys_stat_statfs2_bsize = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
1998-07-29 07:08:05 +04:00
fi
fi
if test $space = no; then
# SVR3
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
[AC_TRY_RUN([#include <sys/types.h>
#include <sys/statfs.h>
main ()
{
struct statfs fsd;
exit (statfs (".", &fsd, sizeof fsd, 0));
}],
fu_cv_sys_stat_statfs4=yes,
fu_cv_sys_stat_statfs4=no,
fu_cv_sys_stat_statfs4=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
if test $fu_cv_sys_stat_statfs4 = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
1998-07-29 07:08:05 +04:00
fi
fi
if test $space = no; then
# 4.4BSD and NetBSD
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
member (4.4BSD and NetBSD)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
[AC_TRY_RUN([#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
main ()
{
struct statfs fsd;
fsd.f_fsize = 0;
exit (statfs (".", &fsd));
}],
fu_cv_sys_stat_statfs2_fsize=yes,
fu_cv_sys_stat_statfs2_fsize=no,
fu_cv_sys_stat_statfs2_fsize=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
if test $fu_cv_sys_stat_statfs2_fsize = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
1998-07-29 07:08:05 +04:00
fi
fi
if test $space = no; then
# Ultrix
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
[AC_TRY_RUN([#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_FS_TYPES_H
#include <sys/fs_types.h>
#endif
main ()
{
struct fs_data fsd;
/* Ultrix's statfs returns 1 for success,
0 for not mounted, -1 for failure. */
exit (statfs (".", &fsd) != 1);
}],
fu_cv_sys_stat_fs_data=yes,
fu_cv_sys_stat_fs_data=no,
fu_cv_sys_stat_fs_data=no)])
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
if test $fu_cv_sys_stat_fs_data = yes; then
space=yes
2002-10-28 22:28:32 +03:00
AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
1998-07-29 07:08:05 +04:00
fi
fi
1999-12-13 16:27:58 +03:00
#
# As a gating factor for large file support, in order to
# use <4GB files we must have the following minimal support
# available.
# long long, and a 64 bit off_t or off64_t.
# If we don't have all of these then disable large
# file support.
#
2000-12-08 06:44:52 +03:00
AC_MSG_CHECKING([if large file support can be enabled])
1999-12-13 16:27:58 +03:00
AC_TRY_COMPILE([
#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
#include <sys/types.h>
#else
__COMPILE_ERROR_
#endif
],
[int i],
samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled])
1999-12-13 16:27:58 +03:00
fi
2000-12-08 06:44:52 +03:00
AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
1999-12-13 16:27:58 +03:00
2001-08-24 23:58:28 +04:00
AC_ARG_WITH(spinlocks,
[ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ])
2000-12-06 03:05:15 +03:00
if test "x$with_spinlocks" = "xyes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(USE_SPINLOCKS,1,[Whether to use spin locks instead of fcntl locks])
2000-12-06 03:05:15 +03:00
case "$host_cpu" in
sparc)
2002-10-28 22:28:32 +03:00
AC_DEFINE(SPARC_SPINLOCKS,1,[Whether to use sparc spinlocks])
2000-12-06 03:05:15 +03:00
;;
i386|i486|i586|i686)
2002-10-28 22:28:32 +03:00
AC_DEFINE(INTEL_SPINLOCKS,1,[Whether to use intel spinlocks])
2000-12-06 03:05:15 +03:00
;;
mips)
2002-10-28 22:28:32 +03:00
AC_DEFINE(MIPS_SPINLOCKS,1,[Whether to use mips spinlocks])
2000-12-06 03:05:15 +03:00
;;
powerpc)
2002-10-28 22:28:32 +03:00
AC_DEFINE(POWERPC_SPINLOCKS,1,[Whether to use powerpc spinlocks])
2000-12-06 03:05:15 +03:00
;;
esac
fi
2000-12-07 08:38:01 +03:00
#################################################
2001-02-25 03:24:54 +03:00
# check for ACL support
2000-12-07 08:38:01 +03:00
2001-02-25 03:24:54 +03:00
AC_MSG_CHECKING(whether to support ACLs)
AC_ARG_WITH(acl-support,
2001-08-24 23:58:28 +04:00
[ --with-acl-support Include ACL support (default=no)],
2000-12-07 08:38:01 +03:00
[ case "$withval" in
yes)
2000-12-07 09:23:01 +03:00
2001-12-15 05:40:16 +03:00
case "$host_os" in
*sysv5*)
AC_MSG_RESULT(Using UnixWare ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
2001-12-15 05:40:16 +03:00
;;
*solaris*)
AC_MSG_RESULT(Using solaris ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
2001-12-15 05:40:16 +03:00
;;
*hpux*)
AC_MSG_RESULT(Using HPUX ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
2001-12-15 05:40:16 +03:00
;;
*irix*)
AC_MSG_RESULT(Using IRIX ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
2001-12-15 05:40:16 +03:00
;;
*aix*)
AC_MSG_RESULT(Using AIX ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
2001-12-15 05:40:16 +03:00
;;
*osf*)
AC_MSG_RESULT(Using Tru64 ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
2001-12-15 05:40:16 +03:00
LIBS="$LIBS -lpacl"
;;
2001-02-25 03:24:54 +03:00
*)
2001-12-15 05:40:16 +03:00
AC_CHECK_LIB(acl,acl_get_file)
AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
AC_TRY_LINK([#include <sys/types.h>
2000-12-07 09:23:01 +03:00
#include <sys/acl.h>],
[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2001-04-14 23:46:28 +04:00
if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
AC_MSG_RESULT(Using posix ACLs)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
2001-04-14 23:46:28 +04:00
AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
AC_TRY_LINK([#include <sys/types.h>
#include <sys/acl.h>],
[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
2001-04-14 23:46:28 +04:00
fi
fi
2001-02-25 03:24:54 +03:00
;;
esac
;;
2000-12-07 08:38:01 +03:00
*)
AC_MSG_RESULT(no)
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
2000-12-07 08:38:01 +03:00
;;
esac ],
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
2001-02-25 03:24:54 +03:00
AC_MSG_RESULT(no)
2000-12-07 08:38:01 +03:00
)
2001-05-16 06:32:34 +04:00
2002-09-25 19:19:00 +04:00
#################################################
# check for sendfile support
2002-10-05 04:40:49 +04:00
with_sendfile_support=yes
AC_MSG_CHECKING(whether to check to support sendfile)
2002-09-25 19:19:00 +04:00
AC_ARG_WITH(sendfile-support,
2002-10-05 04:40:49 +04:00
[ --with-sendfile-support Check for sendfile support (default=yes)],
2002-09-25 19:19:00 +04:00
[ case "$withval" in
yes)
2002-10-01 09:54:40 +04:00
AC_MSG_RESULT(yes);
2002-09-25 19:19:00 +04:00
case "$host_os" in
*linux*)
AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
AC_TRY_LINK([#include <sys/sendfile.h>],
[\
int tofd, fromfd;
off64_t offset;
size_t total;
ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total);
],
samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[
AC_TRY_LINK([#include <sys/sendfile.h>],
[\
int tofd, fromfd;
off_t offset;
size_t total;
ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
],
samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
# Try and cope with broken Linux sendfile....
AC_CACHE_CHECK([for broken linux sendfile support],samba_cv_HAVE_BROKEN_LINUX_SENDFILE,[
AC_TRY_LINK([\
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
#undef _FILE_OFFSET_BITS
#endif
#include <sys/sendfile.h>],
[\
int tofd, fromfd;
off_t offset;
size_t total;
ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
],
samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)])
if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILE64,1,[Whether 64-bit sendfile() is available])
AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
2002-09-25 19:19:00 +04:00
elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
2002-09-25 19:19:00 +04:00
elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
2002-09-25 19:19:00 +04:00
else
AC_MSG_RESULT(no);
fi
;;
*freebsd*)
AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[
AC_TRY_LINK([\
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>],
[\
int fromfd, tofd;
off_t offset, nwritten;
struct sf_hdtr hdr;
struct iovec hdtrl;
hdr->headers = &hdtrl;
hdr->hdr_cnt = 1;
hdr->trailers = NULL;
hdr->trl_cnt = 0;
hdtrl.iov_base = NULL;
hdtrl.iov_len = 0;
int ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0);
],
samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available])
AC_DEFINE(FREEBSD_SENDFILE_API,1,[Whether the FreeBSD sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
2002-09-25 19:19:00 +04:00
else
AC_MSG_RESULT(no);
fi
;;
*hpux*)
AC_CACHE_CHECK([for hpux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
AC_TRY_LINK([\
#include <sys/socket.h>
#include <sys/uio.h>],
[\
int fromfd, tofd;
size_t total=0;
struct iovec hdtrl[2];
ssize_t nwritten;
off64_t offset;
hdtrl[0].iov_base = 0;
hdtrl[0].iov_len = 0;
nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0);
],
samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILE64,1,[Whether sendfile64() is available])
AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
2002-09-25 19:19:00 +04:00
else
AC_MSG_RESULT(no);
fi
AC_CACHE_CHECK([for hpux sendfile support],samba_cv_HAVE_SENDFILE,[
AC_TRY_LINK([\
#include <sys/socket.h>
#include <sys/uio.h>],
[\
int fromfd, tofd;
size_t total=0;
struct iovec hdtrl[2];
ssize_t nwritten;
off_t offset;
hdtrl[0].iov_base = 0;
hdtrl[0].iov_len = 0;
nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0);
],
samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
2002-09-25 19:19:00 +04:00
else
AC_MSG_RESULT(no);
fi
2002-10-01 01:17:18 +04:00
;;
*solaris*)
LIBS="$LIBS -lsendfile"
AC_CACHE_CHECK([for solaris sendfilev64 support],samba_cv_HAVE_SENDFILEV64,[
AC_TRY_LINK([\
#include <sys/sendfile.h>],
[\
int sfvcnt;
size_t xferred;
struct sendfilevec vec[2];
ssize_t nwritten;
2002-10-01 09:54:40 +04:00
int tofd;
2002-10-01 01:17:18 +04:00
sfvcnt = 2;
2002-09-25 19:19:00 +04:00
2002-10-01 01:17:18 +04:00
vec[0].sfv_fd = SFV_FD_SELF;
vec[0].sfv_flag = 0;
vec[0].sfv_off = 0;
vec[0].sfv_len = 0;
vec[1].sfv_fd = 0;
vec[1].sfv_flag = 0;
vec[1].sfv_off = 0;
vec[1].sfv_len = 0;
nwritten = sendfilev64(tofd, vec, sfvcnt, &xferred);
],
samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)])
if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILEV64,1,[Whether sendfilev64() is available])
AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the soloris sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
2002-10-01 01:17:18 +04:00
else
AC_MSG_RESULT(no);
fi
AC_CACHE_CHECK([for solaris sendfilev support],samba_cv_HAVE_SENDFILEV,[
AC_TRY_LINK([\
#include <sys/sendfile.h>],
[\
int sfvcnt;
size_t xferred;
struct sendfilevec vec[2];
ssize_t nwritten;
2002-10-01 09:54:40 +04:00
int tofd;
2002-10-01 01:17:18 +04:00
sfvcnt = 2;
vec[0].sfv_fd = SFV_FD_SELF;
vec[0].sfv_flag = 0;
vec[0].sfv_off = 0;
vec[0].sfv_len = 0;
vec[1].sfv_fd = 0;
vec[1].sfv_flag = 0;
vec[1].sfv_off = 0;
vec[1].sfv_len = 0;
nwritten = sendfilev(tofd, vec, sfvcnt, &xferred);
],
samba_cv_HAVE_SENDFILEV=yes,samba_cv_HAVE_SENDFILEV=no)])
if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_SENDFILEV,1,[Whether sendfilev() is available])
AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the solaris sendfile() API is available])
AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support])
2002-10-01 01:17:18 +04:00
else
AC_MSG_RESULT(no);
fi
2002-09-25 19:19:00 +04:00
;;
*)
;;
esac
;;
*)
AC_MSG_RESULT(no)
;;
esac ],
2002-10-05 04:40:49 +04:00
AC_MSG_RESULT(yes)
2002-09-25 19:19:00 +04:00
)
2001-05-16 06:32:34 +04:00
#################################################
2001-08-01 06:30:33 +04:00
# Check whether winbind is supported on this platform. If so we need to
# build and install client programs (WINBIND_TARGETS), sbin programs
# (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2001-05-16 06:32:34 +04:00
2001-08-01 06:30:33 +04:00
AC_MSG_CHECKING(whether to build winbind)
# Initially, the value of $host_os decides whether winbind is supported
2001-06-01 15:53:48 +04:00
2002-03-01 04:03:06 +03:00
case "$host_os" in
*linux*|*irix*)
2001-08-01 06:30:33 +04:00
HAVE_WINBIND=yes
2002-03-01 04:03:06 +03:00
;;
*solaris*)
HAVE_WINBIND=yes
2002-03-04 01:49:08 +03:00
WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
2002-03-01 22:30:34 +03:00
WINBIND_NSS_EXTRA_LIBS="-lsocket"
2002-03-01 04:03:06 +03:00
;;
*hpux11*)
HAVE_WINBIND=yes
2002-03-04 01:49:08 +03:00
WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
2002-03-01 04:03:06 +03:00
;;
*)
2001-08-01 06:30:33 +04:00
HAVE_WINBIND=no
2002-03-01 04:03:06 +03:00
winbind_no_reason=", unsupported on $host_os"
;;
2001-05-16 06:32:34 +04:00
esac
2001-08-01 06:30:33 +04:00
# Check the setting of --with-winbindd
2001-06-01 15:53:48 +04:00
AC_ARG_WITH(winbind,
2001-08-24 23:58:28 +04:00
[ --with-winbind Build winbind (default, if supported by OS)],
2001-06-01 15:53:48 +04:00
[
case "$withval" in
2001-08-01 06:30:33 +04:00
yes)
HAVE_WINBIND=yes
;;
2001-06-01 15:53:48 +04:00
no)
2001-08-01 06:30:33 +04:00
HAVE_WINBIND=no
2001-06-01 15:53:48 +04:00
winbind_reason=""
;;
esac ],
)
2001-08-01 06:30:33 +04:00
# We need unix domain sockets for winbind
if test x"$HAVE_WINBIND" = x"yes"; then
if test x"$samba_cv_unixsocket" = x"no"; then
winbind_no_reason=", no unix domain socket support on $host_os"
HAVE_WINBIND=no
fi
fi
# Display test results
2002-01-08 07:44:15 +03:00
WINBIND_TARGETS=""
WINBIND_STARGETS=""
WINBIND_LTARGETS=""
WINBIND_PAM_PROGS=""
if test x"$HAVE_WINBIND" = x"yes"; then
2001-06-01 15:53:48 +04:00
AC_MSG_RESULT(yes)
2002-10-28 22:28:32 +03:00
AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind])
2001-08-01 06:30:33 +04:00
2001-12-06 00:08:17 +03:00
WINBIND_TARGETS="bin/wbinfo"
WINBIND_STARGETS="bin/winbindd"
2002-01-08 07:44:15 +03:00
if test x"$BLDSHARED" = x"true"; then
WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
if test x"$with_pam" = x"yes"; then
2001-12-06 00:08:17 +03:00
WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2002-01-08 07:44:15 +03:00
fi
fi
2001-08-01 06:30:33 +04:00
else
AC_MSG_RESULT(no$winbind_no_reason)
2001-06-01 15:53:48 +04:00
fi
2002-07-15 14:35:28 +04:00
2001-08-01 06:30:33 +04:00
# Substitution time!
2001-05-16 06:32:34 +04:00
AC_SUBST(WINBIND_TARGETS)
2001-07-25 03:30:13 +04:00
AC_SUBST(WINBIND_STARGETS)
2001-08-01 06:30:33 +04:00
AC_SUBST(WINBIND_LTARGETS)
2001-12-06 00:08:17 +03:00
AC_SUBST(WINBIND_PAM_TARGETS)
2002-03-01 04:03:06 +03:00
AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
2001-05-16 06:32:34 +04:00
2002-05-13 04:06:35 +04:00
# Solaris has some extra fields in struct passwd that need to be
# initialised otherwise nscd crashes. Unfortunately autoconf < 2.50
# doesn't have the AC_CHECK_MEMBER macro which would be handy for checking
# this.
#AC_CHECK_MEMBER(struct passwd.pw_comment,
# AC_DEFINE(HAVE_PASSWD_PW_COMMENT, 1, [Defined if struct passwd has pw_comment field]),
# [#include <pwd.h>])
AC_CACHE_CHECK([whether struct passwd has pw_comment],samba_cv_passwd_pw_comment, [
AC_TRY_COMPILE([#include <pwd.h>],[struct passwd p; p.pw_comment;],
samba_cv_passwd_pw_comment=yes,samba_cv_passwd_pw_comment=no)])
if test x"$samba_cv_passwd_pw_comment" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_PASSWD_PW_COMMENT,1,[Whether struct passwd has pw_comment])
2002-05-13 04:06:35 +04:00
fi
#AC_CHECK_MEMBER(struct passwd.pw_age,
# AC_DEFINE(HAVE_PASSWD_PW_AGE, 1, [Defined if struct passwd has pw_age field]),
# [#include <pwd.h>])
AC_CACHE_CHECK([whether struct passwd has pw_age],samba_cv_passwd_pw_age, [
AC_TRY_COMPILE([#include <pwd.h>],[struct passwd p; p.pw_age;],
samba_cv_passwd_pw_age=yes,samba_cv_passwd_pw_age=no)])
if test x"$samba_cv_passwd_pw_age" = x"yes"; then
2002-10-28 22:28:32 +03:00
AC_DEFINE(HAVE_PASSWD_PW_AGE,1,[Whether struct passwd has pw_age])
2002-05-13 04:06:35 +04:00
fi
2001-10-23 18:16:22 +04:00
#################################################
# Check to see if we should use the included popt
AC_ARG_WITH(included-popt,
[ --with-included-popt use bundled popt library, not from system],
[
case "$withval" in
yes)
INCLUDED_POPT=yes
;;
no)
INCLUDED_POPT=no
;;
esac ],
)
2001-10-23 21:12:30 +04:00
if test x"$INCLUDED_POPT" != x"yes"; then
AC_CHECK_LIB(popt, poptGetContext,
INCLUDED_POPT=no, INCLUDED_POPT=yes)
2001-10-23 18:16:22 +04:00
fi
2001-11-14 04:18:41 +03:00
AC_MSG_CHECKING(whether to use included popt)
2001-10-23 18:16:22 +04:00
if test x"$INCLUDED_POPT" = x"yes"; then
2002-08-17 21:00:51 +04:00
AC_MSG_RESULT(yes)
2001-10-23 18:16:22 +04:00
BUILD_POPT='$(POPT_OBJS)'
2001-12-05 22:45:30 +03:00
FLAGS1="-I$srcdir/popt"
2001-10-23 18:16:22 +04:00
else
AC_MSG_RESULT(no)
LIBS="$LIBS -lpopt"
fi
AC_SUBST(BUILD_POPT)
2001-12-05 22:45:30 +03:00
AC_SUBST(FLAGS1)
2001-10-23 18:16:22 +04:00
2002-09-25 19:19:00 +04:00
#################################################
# Check if the user wants Python
# At the moment, you can use this to set which Python binary to link
# against. (Libraries built for Python2.2 can't be used by 2.1,
# though they can coexist in different directories.) In the future
# this might make the Python stuff be built by default.
AC_ARG_WITH(python,
[ --with-python=PYTHONNAME build Python libraries],
[ case "${withval-python}" in
yes)
PYTHON=python
;;
*)
PYTHON=${withval-python}
;;
esac ])
AC_SUBST(PYTHON)
2002-04-04 06:30:54 +04:00
#################################################
# do extra things if we are running insure
if test "${ac_cv_prog_CC}" = "insure"; then
CPPFLAGS="$CPPFLAGS -D__INSURE__"
fi
2001-05-16 06:32:34 +04:00
#################################################
# final configure stuff
2002-04-01 11:29:43 +04:00
AC_MSG_CHECKING([configure summary])
1998-09-21 13:07:08 +04:00
AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2002-04-01 11:29:43 +04:00
AC_MSG_RESULT(yes),
AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
AC_MSG_WARN([cannot run when cross-compiling]))
1998-09-05 17:53:13 +04:00
1998-10-05 02:42:05 +04:00
builddir=`pwd`
AC_SUBST(builddir)
2002-09-25 19:19:00 +04:00
# I added make files that are outside /source directory.
# I know this is not a good solution, will work out a better
# solution soon. --simo
2002-10-30 09:46:23 +03:00
AC_OUTPUT(include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile)
2002-01-03 06:04:35 +03:00
#################################################
# Print very concise instructions on building/use
if test "x$enable_dmalloc" = xyes
then
2002-01-09 10:52:51 +03:00
AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])
2002-01-10 00:30:37 +03:00
fi