1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(include/includes.h)
3 AC_CONFIG_HEADER(include/config.h)
5 #################################################
6 # Directory handling stuff to support both the
7 # legacy SAMBA directories and FHS compliant
9 AC_PREFIX_DEFAULT(/usr/local/samba)
12 [ --with-fhs Use FHS-compliant paths (default=no)],
13 codepagedir="\$(DATADIR)/samba/codepages"
14 configdir="${sysconfdir}/samba"
15 lockdir="\${VARDIR}/cache/samba"
16 logfilebase="\${VARDIR}/log/samba"
17 privatedir="\${CONFIGDIR}/private"
18 swatdir="\${DATADIR}/samba/swat",
19 codepagedir="\$(LIBDIR)/codepages"
20 configdir="\$(LIBDIR)"
21 lockdir="\$(VARDIR)/locks"
22 logfilebase="\$(VARDIR)"
23 privatedir="\${prefix}/private"
24 swatdir="\${prefix}/swat")
26 #################################################
27 # set private directory location
28 AC_ARG_WITH(privatedir,
29 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
33 # Just in case anybody calls it without argument
35 AC_MSG_WARN([--with-privatedir called without argument - will use default])
42 #################################################
43 # set lock directory location
45 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
49 # Just in case anybody calls it without argument
51 AC_MSG_WARN([--with-lockdir called without argument - will use default])
58 #################################################
59 # set SWAT directory location
61 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
65 # Just in case anybody does it
67 AC_MSG_WARN([--with-swatdir called without argument - will use default])
74 #################################################
75 # set configuration directory location
76 AC_ARG_WITH(configdir,
77 [ --with-configdir=DIR Where to put configuration files (\$libdir)],
81 # Just in case anybody does it
83 AC_MSG_WARN([--with-configdir called without argument - will use default])
90 #################################################
91 # set codepage directory location
92 AC_ARG_WITH(codepagedir,
93 [ --with-codepagedir=DIR Where to put codepage files (\$libdir/codepages)],
97 # Just in case anybody does it
99 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
102 codepagedir="$withval"
106 #################################################
107 # set log directory location
108 AC_ARG_WITH(logfilebase,
109 [ --with-logfilebase=DIR Where to put log files (\$(VARDIR))],
113 # Just in case anybody does it
115 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
118 logfilebase="$withval"
122 AC_SUBST(codepagedir)
125 AC_SUBST(logfilebase)
131 dnl Unique-to-Samba variables we'll be playing with.
147 AC_SUBST(LIBSMBCLIENT_SHARED)
148 AC_SUBST(LIBSMBCLIENT)
150 # compile with optimization and without debugging by default
151 CFLAGS="-O ${CFLAGS}"
154 [ --enable-debug Turn on compiler debugging information (default=no)],
155 [if eval "test x$enable_debug = xyes"; then
156 CFLAGS="${CFLAGS} -g"
161 dnl Checks for programs.
166 dnl Check if C compiler understands -c and -o at the same time
168 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
175 dnl Check if the C compiler understands volatile (it should, being ANSI).
176 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
177 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
178 samba_cv_volatile=yes,samba_cv_volatile=no)])
179 if test x"$samba_cv_volatile" = x"yes"; then
180 AC_DEFINE(HAVE_VOLATILE)
187 dnl Add #include for broken IRIX header files
189 *irix6*) AC_ADD_INCLUDE(<standards.h>)
193 AC_VALIDATE_CACHE_SYSTEM_TYPE
196 # Config CPPFLAG settings for strange OS's that must be set
197 # before other tests.
200 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
203 # mmap on HPUX is completely broken...
204 AC_DEFINE(MMAP_BLACKLIST)
205 if test $ac_cv_prog_cc_Ae = yes; then
206 CPPFLAGS="$CPPFLAGS -Ae"
209 # Defines needed for HPUX support.
210 # HPUX has bigcrypt but (sometimes?) doesn't use it for
211 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
215 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4"
216 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
219 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4"
220 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
227 # CRAY Unicos has broken const handling
229 AC_MSG_RESULT([disabling const])
230 CPPFLAGS="$CPPFLAGS -Dconst="
234 # AIX4.x doesn't even admit to having large
235 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
238 AC_MSG_RESULT([enabling large file support])
239 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
242 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
243 # to the existance of large files..
244 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
245 # recommendations on large file support, however it makes the
246 # compile work using gcc 2.7 and 2.8, whereas using the Sun
247 # recommendation makes the compile fail on gcc2.7. JRA.
251 5.0*|5.1*|5.2*|5.3*|5.5*)
252 AC_MSG_RESULT([no large file support])
255 AC_MSG_RESULT([enabling large file support])
256 if test "$ac_cv_prog_gcc" = yes; then
257 ${CC-cc} -v >conftest.c 2>&1
258 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
260 case "$ac_cv_gcc_compiler_version_number" in
261 *"gcc version 2.6"*|*"gcc version 2.7"*)
262 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
265 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
269 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
275 # Tests needed for SINIX large file support.
278 if test $host = mips-sni-sysv4 ; then
279 AC_MSG_CHECKING([for LFS support])
280 old_CPPFLAGS="$CPPFLAGS"
281 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
285 #if _LFS64_LARGEFILE == 1
290 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
291 CPPFLAGS="$old_CPPFLAGS"
292 if test x$SINIX_LFS_SUPPORT = xyes ; then
293 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
294 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
295 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
296 LIBS="`getconf LFS64_LIBS` $LIBS"
298 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
302 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
305 AC_MSG_CHECKING([for LFS support])
306 old_CPPFLAGS="$CPPFLAGS"
307 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
310 #include <sys/utsname.h>
312 #if _LFS64_LARGEFILE == 1
317 /* Ensure this is glibc 2.2 or higher */
318 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
319 int libc_major = __GLIBC__;
320 int libc_minor = __GLIBC_MINOR__;
328 /* Ensure this is kernel 2.4 or higher */
331 release = uts.release;
332 major = atoi(strsep(&release, "."));
333 minor = atoi(strsep(&release, "."));
335 if (major > 2 || (major == 2 && minor > 3))
342 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
343 CPPFLAGS="$old_CPPFLAGS"
344 if test x$LINUX_LFS_SUPPORT = xyes ; then
345 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
347 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
351 AC_MSG_CHECKING([for LFS support])
352 old_CPPFLAGS="$CPPFLAGS"
353 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
357 #if _LFS64_LARGEFILE == 1
362 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
363 CPPFLAGS="$old_CPPFLAGS"
364 if test x$GLIBC_LFS_SUPPORT = xyes ; then
365 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
367 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
377 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
378 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
379 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
380 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
381 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
382 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
383 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
384 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h synch.h pthread.h nsswitch.h)
387 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
388 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
392 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
393 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
394 if test x"$ac_cv_header_shadow_h" = x"yes"; then
395 AC_DEFINE(HAVE_SHADOW_H)
399 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
400 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
401 AC_CHECK_HEADERS(stropts.h poll.h)
402 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
403 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
405 # For experimental utmp support (lastlog on some BSD-like systems)
406 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
408 # For quotas on Veritas VxFS filesystems
409 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
411 # For quotas on Linux XFS filesystems
412 AC_CHECK_HEADERS(linux/xqm.h)
414 AC_CHECK_SIZEOF(int,cross)
415 AC_CHECK_SIZEOF(long,cross)
416 AC_CHECK_SIZEOF(short,cross)
431 AC_CHECK_TYPE(ino_t,unsigned)
432 AC_CHECK_TYPE(loff_t,off_t)
433 AC_CHECK_TYPE(offset_t,loff_t)
434 AC_CHECK_TYPE(ssize_t, int)
435 AC_CHECK_TYPE(wchar_t, unsigned short)
437 ############################################
438 # for cups support we need libcups, and a handful of header files
440 AC_CHECK_LIB(cups,httpConnect)
442 # I wonder if there is a nicer way of doing this?
444 if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
445 AC_CHECK_HEADERS(cups/cups.h cups/language.h)
446 if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
447 if test x"$ac_cv_header_cups_language_h" = x"yes"; then
453 ############################################
454 # we need libdl for PAM and the new VFS code
455 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
456 AC_DEFINE(HAVE_LIBDL)])
458 ############################################
459 # check if the compiler can do immediate structures
460 AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
464 #define X_FOOBAR(x) ((FOOBAR) { x })
465 typedef struct {unsigned x;} FOOBAR;
466 FOOBAR f = X_FOOBAR(1);
468 samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
469 if test x"$samba_cv_immediate_structures" = x"yes"; then
470 AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES)
473 ############################################
474 # check for unix domain sockets
475 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
477 #include <sys/types.h>
480 #include <sys/socket.h>
481 #include <sys/un.h>],
483 struct sockaddr_un sunaddr;
484 sunaddr.sun_family = AF_UNIX;
486 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
487 if test x"$samba_cv_unixsocket" = x"yes"; then
488 AC_DEFINE(HAVE_UNIXSOCKET)
491 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
493 #include <sys/types.h>
498 #include <sys/socket.h>],[socklen_t i = 0],
499 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
500 if test x"$samba_cv_socklen_t" = x"yes"; then
501 AC_DEFINE(HAVE_SOCKLEN_T_TYPE)
504 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
506 #include <sys/types.h>
511 #include <signal.h>],[sig_atomic_t i = 0],
512 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
513 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
514 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
517 # stupid headers have the functions but no declaration. grrrr.
518 AC_HAVE_DECL(errno, [#include <errno.h>])
519 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
520 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
521 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
522 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
523 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
524 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
526 # and glibc has setresuid under linux but the function does
527 # nothing until kernel 2.1.44! very dumb.
528 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
529 AC_TRY_RUN([#include <errno.h>
530 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
531 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
532 if test x"$samba_cv_have_setresuid" = x"yes"; then
533 AC_DEFINE(HAVE_SETRESUID)
536 # Do the same check for setresguid...
538 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
539 AC_TRY_RUN([#include <unistd.h>
541 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
542 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
543 if test x"$samba_cv_have_setresgid" = x"yes"; then
544 AC_DEFINE(HAVE_SETRESGID)
549 ###############################################
550 # Readline included by default unless explicitly asked not to
551 test "${with_readline+set}" != "set" && with_readline=yes
553 # test for where we get readline() from
554 AC_MSG_CHECKING(whether to use readline)
555 AC_ARG_WITH(readline,
556 [ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto)],
557 [ case "$with_readline" in
561 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
562 AC_CHECK_HEADERS(readline/history.h)
564 AC_CHECK_HEADERS(readline.h readline/readline.h,[
565 for termlib in ncurses curses termcap terminfo termlib; do
566 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
568 AC_CHECK_LIB(readline, rl_callback_handler_install,
569 [TERMLIBS="-lreadline $TERMLIBS"
570 AC_DEFINE(HAVE_LIBREADLINE)
571 break], [TERMLIBS=], $TERMLIBS)])
579 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
580 # alternate readline path
582 _cppflags=${CPPFLAGS}
584 # Add additional search path
585 LDFLAGS="-L$with_readline/lib $LDFLAGS"
586 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
588 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
589 AC_CHECK_HEADERS(readline/history.h)
591 AC_CHECK_HEADERS(readline.h readline/readline.h,[
592 for termlib in ncurses curses termcap terminfo termlib; do
593 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
595 AC_CHECK_LIB(readline, rl_callback_handler_install,
596 [TERMLDFLAGS="-L$with_readline/lib"
597 TERMCPPFLAGS="-I$with_readline/include"
598 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
599 TERMLIBS="-lreadline $TERMLIBS"
600 AC_DEFINE(HAVE_LIBREADLINE)
601 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
609 AC_SUBST(TERMLDFLAGS)
611 # The following test taken from the cvs sources
612 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
613 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
614 # libsocket.so which has a bad implementation of gethostbyname (it
615 # only looks in /etc/hosts), so we only look for -lsocket if we need
617 AC_CHECK_FUNCS(connect)
618 if test x"$ac_cv_func_connect" = x"no"; then
621 *) AC_CHECK_LIB(nsl_s, printf) ;;
625 *) AC_CHECK_LIB(nsl, printf) ;;
629 *) AC_CHECK_LIB(socket, connect) ;;
633 *) AC_CHECK_LIB(inet, connect) ;;
635 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
637 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
638 test x"$ac_cv_lib_inet_connect" = x"yes"; then
639 # ac_cv_func_connect=yes
640 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
641 AC_DEFINE(HAVE_CONNECT)
645 ###############################################
646 # test for where we get get_yp_default_domain() from
647 AC_CHECK_FUNCS(yp_get_default_domain)
648 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
649 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
650 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
653 # Check if we have execl, if not we need to compile smbrun.
654 AC_CHECK_FUNCS(execl)
655 if test x"$ac_cv_func_execl" = x"no"; then
661 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot link)
662 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset setpgid mknod mknod64)
663 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
664 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
665 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath)
666 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
667 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
668 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
669 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
670 AC_CHECK_FUNCS(syslog vsyslog)
672 # syscall() is needed for smbwrapper.
673 AC_CHECK_FUNCS(syscall)
675 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
676 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
677 AC_CHECK_FUNCS(__getcwd _getcwd)
678 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
679 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
680 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
681 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
682 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
683 AC_CHECK_FUNCS(_write __write _fork __fork)
684 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
685 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
686 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
687 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
688 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
691 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
694 if test x$ac_cv_func_stat64 = xno ; then
695 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
697 #if defined(HAVE_UNISTD_H)
700 #include <sys/stat.h>
701 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
702 AC_MSG_RESULT([$ac_cv_func_stat64])
703 if test x$ac_cv_func_stat64 = xyes ; then
704 AC_DEFINE(HAVE_STAT64)
708 if test x$ac_cv_func_lstat64 = xno ; then
709 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
711 #if defined(HAVE_UNISTD_H)
714 #include <sys/stat.h>
715 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
716 AC_MSG_RESULT([$ac_cv_func_lstat64])
717 if test x$ac_cv_func_lstat64 = xyes ; then
718 AC_DEFINE(HAVE_LSTAT64)
722 if test x$ac_cv_func_fstat64 = xno ; then
723 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
725 #if defined(HAVE_UNISTD_H)
728 #include <sys/stat.h>
729 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
730 AC_MSG_RESULT([$ac_cv_func_fstat64])
731 if test x$ac_cv_func_fstat64 = xyes ; then
732 AC_DEFINE(HAVE_FSTAT64)
737 # If no strcasecmp, check for it in some known places
738 # It is in -lresolv on ReliantUNIX and UnixWare
739 # -lresolve *must* follow -lnsl for name resolution to work properly
742 if test x$ac_cv_func_strcasecmp = xno ; then
743 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
744 AC_DEFINE(HAVE_STRCASECMP))
748 # Check for the functions putprpwnam, set_auth_parameters,
749 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
750 # Needed for OSF1 and HPUX.
753 AC_LIBTESTFUNC(security, putprpwnam)
754 AC_LIBTESTFUNC(sec, putprpwnam)
756 AC_LIBTESTFUNC(security, set_auth_parameters)
757 AC_LIBTESTFUNC(sec, set_auth_parameters)
759 # UnixWare 7.x has its getspnam in -lgen
760 AC_LIBTESTFUNC(gen, getspnam)
762 AC_LIBTESTFUNC(security, getspnam)
763 AC_LIBTESTFUNC(sec, getspnam)
765 AC_LIBTESTFUNC(security, bigcrypt)
766 AC_LIBTESTFUNC(sec, bigcrypt)
768 AC_LIBTESTFUNC(security, getprpwnam)
769 AC_LIBTESTFUNC(sec, getprpwnam)
771 # this bit needs to be modified for each OS that is suported by
772 # smbwrapper. You need to specify how to created a shared library and
773 # how to compile C code to produce PIC object files
775 # these are the defaults, good for lots of systems
783 # Assume non-shared by default and override below
785 AC_MSG_CHECKING([ability to build shared libraries])
787 # and these are for particular systems
789 *linux*) AC_DEFINE(LINUX)
793 SONAMEFLAG="-Wl,-soname="
794 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
796 *solaris*) AC_DEFINE(SUNOS5)
798 LDSHFLAGS="-h \$@ -G"
799 if test "${ac_cv_prog_CC}" = "gcc"; then
806 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
808 *sunos*) AC_DEFINE(SUNOS4)
810 LDSHFLAGS="-Wl,-h,\$@ -G"
811 PICFLAG="-KPIC" # Is this correct for SunOS
813 *bsd*) BLDSHARED="true"
814 LDSHFLAGS="-Wl,-soname,\$@ -shared"
816 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
818 *irix*) AC_DEFINE(IRIX)
820 *irix6*) AC_DEFINE(IRIX6)
823 ATTEMPT_WRAP32_BUILD=yes
825 LDSHFLAGS="-soname \$@ -shared"
827 if test "${ac_cv_prog_CC}" = "gcc"; then
832 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
834 *aix*) AC_DEFINE(AIX)
836 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
837 PICFLAG="-O2 -qmaxmem=6000"
838 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
840 *hpux*) AC_DEFINE(HPUX)
842 # Use special PIC flags for the native HP-UX compiler.
843 if test $ac_cv_prog_cc_Ae = yes; then
846 LDSHFLAGS="-B symbolic -b -z +h \$@"
849 AC_DEFINE(STAT_ST_BLOCKSIZE,8192)
851 *qnx*) AC_DEFINE(QNX);;
852 *osf*) AC_DEFINE(OSF1)
854 LDSHFLAGS="-Wl,-soname,\$@ -shared"
857 *sco*) AC_DEFINE(SCO);;
858 *unixware*) AC_DEFINE(UNIXWARE)
860 LDSHFLAGS="-Wl,-soname,\$@ -shared"
863 *next2*) AC_DEFINE(NEXT2);;
864 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
867 *-univel-*) if [ test "$GCC" != yes ]; then
868 AC_DEFINE(HAVE_MEMSET)
872 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
876 if [ test "$GCC" != yes ]; then
877 AC_DEFINE(HAVE_MEMSET)
882 AC_MSG_RESULT($BLDSHARED)
883 AC_MSG_CHECKING([linker flags for shared libraries])
884 AC_MSG_RESULT([$LDSHFLAGS])
885 AC_MSG_CHECKING([compiler flags for position-independent code])
886 AC_MSG_RESULT([$PICFLAGS])
888 # try to work out how to produce pic code with this compiler
889 AC_PROG_CC_FLAG(fpic)
890 if test $ac_cv_prog_cc_fpic = yes; then
893 if test x$PICFLAG = x; then
894 AC_PROG_CC_FLAG(KPIC)
895 if test $ac_cv_prog_cc_KPIC = yes; then
899 if test x$PICFLAG = x; then
900 AC_PROG_CC_FLAG(Kpic)
901 if test $ac_cv_prog_cc_Kpic = yes; then
908 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
909 AC_TRY_RUN([#include <stdio.h>
910 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
911 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
912 if test x"$samba_cv_have_longlong" = x"yes"; then
913 AC_DEFINE(HAVE_LONGLONG)
917 # Check if the compiler supports the LL prefix on long long integers.
920 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
921 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
922 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
923 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
924 AC_DEFINE(COMPILER_SUPPORTS_LL)
928 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
929 AC_TRY_RUN([#include <stdio.h>
930 #include <sys/stat.h>
931 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
932 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
933 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
934 AC_DEFINE(SIZEOF_OFF_T,8)
937 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
939 #if defined(HAVE_UNISTD_H)
943 #include <sys/stat.h>
944 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
945 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
946 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
947 AC_DEFINE(HAVE_OFF64_T)
950 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
951 AC_TRY_RUN([#include <stdio.h>
952 #include <sys/stat.h>
953 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
954 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
955 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
956 AC_DEFINE(SIZEOF_INO_T,8)
959 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
961 #if defined(HAVE_UNISTD_H)
965 #include <sys/stat.h>
966 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
967 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
968 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
969 AC_DEFINE(HAVE_INO64_T)
972 AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
974 #if defined(HAVE_UNISTD_H)
978 #include <sys/stat.h>
979 main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
980 samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
981 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
982 AC_DEFINE(HAVE_DEV64_T)
985 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
987 #if defined(HAVE_UNISTD_H)
990 #include <sys/types.h>
991 #include <dirent.h>],
992 [struct dirent64 de;],
993 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
994 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
995 AC_DEFINE(HAVE_STRUCT_DIRENT64)
998 AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
1000 #if defined(HAVE_UNISTD_H)
1003 #include <sys/types.h>
1004 main() { dev_t dev; int i = major(dev); return 0; }],
1005 samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
1006 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
1007 AC_DEFINE(HAVE_DEVICE_MAJOR_FN)
1010 AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
1012 #if defined(HAVE_UNISTD_H)
1015 #include <sys/types.h>
1016 main() { dev_t dev; int i = minor(dev); return 0; }],
1017 samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
1018 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
1019 AC_DEFINE(HAVE_DEVICE_MINOR_FN)
1022 AC_CACHE_CHECK([for makedev macro],samba_cv_HAVE_MAKEDEV_FN,[
1024 #if defined(HAVE_UNISTD_H)
1027 #include <sys/types.h>
1028 main() { dev_t dev = makedev(1,2); return 0; }],
1029 samba_cv_HAVE_MAKEDEV_FN=yes,samba_cv_HAVE_MAKEDEV_FN=no,samba_cv_HAVE_MAKEDEV_FN=cross)])
1030 if test x"$samba_cv_HAVE_MAKEDEV_FN" = x"yes"; then
1031 AC_DEFINE(MAKEDEV_FN)
1034 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
1035 AC_TRY_RUN([#include <stdio.h>
1036 main() { char c; c=250; exit((c > 0)?0:1); }],
1037 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
1038 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
1039 AC_DEFINE(HAVE_UNSIGNED_CHAR)
1042 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
1043 AC_TRY_COMPILE([#include <sys/types.h>
1044 #include <sys/socket.h>
1045 #include <netinet/in.h>],
1046 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
1047 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
1048 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
1049 AC_DEFINE(HAVE_SOCK_SIN_LEN)
1052 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
1053 AC_TRY_COMPILE([#include <sys/types.h>
1055 void seekdir(DIR *d, long loc) { return; }],[return 0;],
1056 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
1057 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
1058 AC_DEFINE(SEEKDIR_RETURNS_VOID)
1061 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
1062 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
1063 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
1064 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
1065 AC_DEFINE(HAVE_FILE_MACRO)
1068 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
1069 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
1070 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
1071 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
1072 AC_DEFINE(HAVE_FUNCTION_MACRO)
1075 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
1077 #include <sys/time.h>
1079 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
1080 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
1081 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
1082 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
1085 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
1087 #include <sys/types.h>
1089 void foo(const char *format, ...) {
1094 va_start(ap, format);
1095 len = vsnprintf(0, 0, format, ap);
1097 if (len != 5) exit(1);
1099 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1103 main() { foo("hello"); }
1105 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
1106 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1107 AC_DEFINE(HAVE_C99_VSNPRINTF)
1110 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1111 AC_TRY_RUN([#include <sys/types.h>
1113 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1114 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1115 di->d_name[0] == 0) exit(0); exit(1);} ],
1116 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
1117 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1118 AC_DEFINE(HAVE_BROKEN_READDIR)
1121 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1122 AC_TRY_COMPILE([#include <sys/types.h>
1123 #include <utime.h>],
1124 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1125 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
1126 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
1127 AC_DEFINE(HAVE_UTIMBUF)
1130 dnl utmp and utmpx come in many flavours
1131 dnl We need to check for many of them
1132 dnl But we don't need to do each and every one, because our code uses
1133 dnl mostly just the utmp (not utmpx) fields.
1135 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
1137 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
1138 AC_TRY_COMPILE([#include <sys/types.h>
1140 [struct utmp ut; ut.ut_name[0] = 'a';],
1141 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
1142 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
1143 AC_DEFINE(HAVE_UT_UT_NAME)
1146 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
1147 AC_TRY_COMPILE([#include <sys/types.h>
1149 [struct utmp ut; ut.ut_user[0] = 'a';],
1150 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
1151 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
1152 AC_DEFINE(HAVE_UT_UT_USER)
1155 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
1156 AC_TRY_COMPILE([#include <sys/types.h>
1158 [struct utmp ut; ut.ut_id[0] = 'a';],
1159 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
1160 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
1161 AC_DEFINE(HAVE_UT_UT_ID)
1164 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
1165 AC_TRY_COMPILE([#include <sys/types.h>
1167 [struct utmp ut; ut.ut_host[0] = 'a';],
1168 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
1169 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
1170 AC_DEFINE(HAVE_UT_UT_HOST)
1173 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
1174 AC_TRY_COMPILE([#include <sys/types.h>
1176 [struct utmp ut; time_t t; ut.ut_time = t;],
1177 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
1178 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
1179 AC_DEFINE(HAVE_UT_UT_TIME)
1182 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
1183 AC_TRY_COMPILE([#include <sys/types.h>
1185 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
1186 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
1187 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
1188 AC_DEFINE(HAVE_UT_UT_TV)
1191 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
1192 AC_TRY_COMPILE([#include <sys/types.h>
1194 [struct utmp ut; ut.ut_type = 0;],
1195 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
1196 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
1197 AC_DEFINE(HAVE_UT_UT_TYPE)
1200 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
1201 AC_TRY_COMPILE([#include <sys/types.h>
1203 [struct utmp ut; ut.ut_pid = 0;],
1204 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
1205 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
1206 AC_DEFINE(HAVE_UT_UT_PID)
1209 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1210 AC_TRY_COMPILE([#include <sys/types.h>
1212 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1213 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1214 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1215 AC_DEFINE(HAVE_UT_UT_EXIT)
1218 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1219 AC_TRY_COMPILE([#include <sys/types.h>
1221 [struct utmp ut; ut.ut_addr = 0;],
1222 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1223 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1224 AC_DEFINE(HAVE_UT_UT_ADDR)
1227 if test x$ac_cv_func_pututline = xyes ; then
1228 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1229 AC_TRY_COMPILE([#include <sys/types.h>
1231 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1232 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1233 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1234 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1238 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1239 AC_TRY_COMPILE([#include <sys/types.h>
1240 #include <utmpx.h>],
1241 [struct utmpx ux; ux.ut_syslen = 0;],
1242 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1243 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1244 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1247 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1249 #include <sys/types.h>
1252 #define F_GETLEASE 1025
1255 int fd = open("/dev/null", O_RDONLY);
1256 return fcntl(fd, F_GETLEASE, 0) == -1;
1259 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1260 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1261 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1264 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1266 #include <sys/types.h>
1270 #define F_NOTIFY 1026
1273 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1276 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1277 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1278 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1281 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1283 #include <sys/types.h>
1286 #include <sys/file.h>
1288 #define LOCK_MAND 32
1289 #define LOCK_READ 64
1292 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1295 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1296 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1297 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1303 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1304 AC_TRY_COMPILE([#include <sys/types.h>
1305 #include <fcntl.h>],
1306 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1307 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1308 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1309 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1312 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1313 AC_TRY_RUN([#include <sys/types.h>
1314 #include <sys/capability.h>
1317 if ((cap = cap_get_proc()) == NULL)
1319 cap->cap_effective |= CAP_NETWORK_MGT;
1320 cap->cap_inheritable |= CAP_NETWORK_MGT;
1325 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1326 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1327 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1331 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1332 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1335 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1336 AC_TRY_COMPILE([#include <sys/types.h>
1337 #if defined(HAVE_RPC_RPC_H)
1338 #include <rpc/rpc.h>
1341 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1342 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1343 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1346 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1347 AC_TRY_COMPILE([#include <sys/types.h>
1348 #if defined(HAVE_RPC_RPC_H)
1349 #include <rpc/rpc.h>
1352 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1353 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1354 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1357 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1358 AC_TRY_COMPILE([#include <sys/types.h>
1359 #if defined(HAVE_RPC_RPC_H)
1360 #include <rpc/rpc.h>
1363 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1364 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1365 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1368 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1369 AC_TRY_COMPILE([#include <sys/types.h>
1370 #if defined(HAVE_RPC_RPC_H)
1371 #include <rpc/rpc.h>
1374 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1375 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1376 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1380 dnl Some systems (SCO) have a problem including
1381 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1382 dnl as a #define in <prot.h> and as part of an enum
1386 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1387 AC_TRY_COMPILE([#include <sys/types.h>
1388 #ifdef HAVE_SYS_SECURITY_H
1389 #include <sys/security.h>
1391 #endif /* HAVE_SYS_SECURITY_H */
1392 #if defined(HAVE_RPC_RPC_H)
1393 #include <rpc/rpc.h>
1396 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1397 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1398 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1401 AC_MSG_CHECKING([for test routines])
1402 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1404 AC_MSG_ERROR([cant find test code. Aborting config]),
1405 AC_MSG_WARN([cannot run when cross-compiling]))
1407 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1408 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1409 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1410 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1411 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1414 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1415 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1416 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1417 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1418 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1421 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1422 SAVE_CPPFLAGS="$CPPFLAGS"
1423 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1425 #define REPLACE_GETPASS 1
1426 #define NO_CONFIG_H 1
1427 #define main dont_declare_main
1428 #include "${srcdir-.}/lib/getsmbpass.c"
1430 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1431 CPPFLAGS="$SAVE_CPPFLAGS"
1433 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1434 AC_DEFINE(REPLACE_GETPASS)
1437 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1440 #include <sys/types.h>
1441 #include <netinet/in.h>
1442 #ifdef HAVE_ARPA_INET_H
1443 #include <arpa/inet.h>
1445 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1446 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1447 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1449 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1450 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1451 AC_DEFINE(REPLACE_INET_NTOA)
1454 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1455 AC_TRY_RUN([#include <stdlib.h>
1456 #include <sys/types.h>
1457 #include <sys/stat.h>
1461 char tpl[20]="/tmp/test.XXXXXX";
1462 int fd = mkstemp(tpl);
1463 if (fd == -1) exit(1);
1465 if (fstat(fd, &st) != 0) exit(1);
1466 if ((st.st_mode & 0777) != 0600) exit(1);
1469 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1470 samba_cv_HAVE_SECURE_MKSTEMP=no,
1471 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1472 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1473 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1476 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1477 AC_TRY_RUN([#include <unistd.h>
1478 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1479 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1480 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1481 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1484 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1485 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1486 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1487 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1488 AC_DEFINE(HAVE_ROOT)
1490 AC_MSG_WARN(running as non-root will disable some tests)
1494 # look for a method of finding the list of network interfaces
1496 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1498 #define HAVE_IFACE_AIX 1
1499 #define AUTOCONF_TEST 1
1500 #include "confdefs.h"
1501 #include "${srcdir-.}/lib/interfaces.c"],
1502 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1503 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1504 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1507 if test $iface = no; then
1508 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1510 #define HAVE_IFACE_IFCONF 1
1511 #define AUTOCONF_TEST 1
1512 #include "confdefs.h"
1513 #include "${srcdir-.}/lib/interfaces.c"],
1514 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1515 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1516 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1520 if test $iface = no; then
1521 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1523 #define HAVE_IFACE_IFREQ 1
1524 #define AUTOCONF_TEST 1
1525 #include "confdefs.h"
1526 #include "${srcdir-.}/lib/interfaces.c"],
1527 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1528 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1529 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1534 ################################################
1535 # look for a method of setting the effective uid
1537 if test $seteuid = no; then
1538 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1540 #define AUTOCONF_TEST 1
1541 #define USE_SETRESUID 1
1542 #include "confdefs.h"
1543 #include "${srcdir-.}/lib/util_sec.c"],
1544 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1545 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1546 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1551 if test $seteuid = no; then
1552 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1554 #define AUTOCONF_TEST 1
1555 #define USE_SETREUID 1
1556 #include "confdefs.h"
1557 #include "${srcdir-.}/lib/util_sec.c"],
1558 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1559 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1560 seteuid=yes;AC_DEFINE(USE_SETREUID)
1564 if test $seteuid = no; then
1565 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1567 #define AUTOCONF_TEST 1
1568 #define USE_SETEUID 1
1569 #include "confdefs.h"
1570 #include "${srcdir-.}/lib/util_sec.c"],
1571 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1572 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1573 seteuid=yes;AC_DEFINE(USE_SETEUID)
1577 if test $seteuid = no; then
1578 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1580 #define AUTOCONF_TEST 1
1581 #define USE_SETUIDX 1
1582 #include "confdefs.h"
1583 #include "${srcdir-.}/lib/util_sec.c"],
1584 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1585 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1586 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1591 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1592 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1593 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1594 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1595 AC_DEFINE(HAVE_MMAP)
1598 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1599 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1600 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1601 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1602 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1605 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1606 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1607 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1608 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1609 AC_DEFINE(HAVE_FCNTL_LOCK)
1612 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1613 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1614 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1615 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1616 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1621 dnl Don't check for 64 bit fcntl locking if we know that the
1622 dnl glibc2.1 broken check has succeeded.
1625 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1627 #if defined(HAVE_UNISTD_H)
1637 #ifdef HAVE_SYS_FCNTL_H
1638 #include <sys/fcntl.h>
1640 main() { struct flock64 fl64;
1641 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1647 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1649 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1650 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1654 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1655 AC_TRY_COMPILE([#include <sys/types.h>
1656 #include <sys/stat.h>
1657 #include <unistd.h>],
1658 [struct stat st; st.st_blocks = 0;],
1659 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1660 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1661 AC_DEFINE(HAVE_STAT_ST_BLOCKS)
1666 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1668 #ifdef HAVE_SYS_VFS_H
1669 #include <sys/vfs.h>
1671 #ifdef HAVE_SYS_CAPABILITY_H
1672 #include <sys/capability.h>
1675 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1676 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1677 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS)
1682 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1683 AC_TRY_COMPILE([#include <sys/acl.h>
1684 #if defined(HAVE_RPCSVC_NIS_H)
1685 #include <rpcsvc/nis.h>
1688 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1689 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1690 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1694 #################################################
1695 # check for smbwrapper support
1696 AC_MSG_CHECKING(whether to use smbwrapper)
1697 AC_ARG_WITH(smbwrapper,
1698 [ --with-smbwrapper Include SMB wrapper support (default=no)],
1699 [ case "$withval" in
1702 AC_DEFINE(WITH_SMBWRAPPER)
1703 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1705 if test x$ATTEMPT_WRAP32_BUILD = x; then
1708 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1711 # Conditions under which smbwrapper should not be built.
1713 if test x$PICFLAG = x; then
1714 echo No support for PIC code - disabling smbwrapper and smbsh
1717 elif test x$ac_cv_func_syscall = xno; then
1718 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1730 #################################################
1731 # check for the AFS filesystem
1732 AC_MSG_CHECKING(whether to use AFS)
1734 [ --with-afs Include AFS support (default=no)],
1735 [ case "$withval" in
1748 #################################################
1749 # check for the DFS auth system
1750 AC_MSG_CHECKING(whether to use DCE/DFS auth)
1752 [ --with-dce-dfs Include DCE/DFS support (default=no)],
1753 [ case "$withval" in
1765 #################################################
1766 # check for Kerberos IV auth system
1767 AC_MSG_CHECKING(whether to use Kerberos IV)
1769 [ --with-krb4=base-dir Include Kerberos IV support (default=no)],
1770 [ case "$withval" in
1773 AC_DEFINE(KRB4_AUTH)
1774 AC_CHECK_LIB(resolv, dn_expand)
1775 LIBS="$LIBS -lkrb -ldes"
1776 CFLAGS="$CFLAGS -I$withval/include"
1777 LDFLAGS="$LDFLAGS -L$withval/lib"
1786 #################################################
1787 # check for Kerberos 5 auth system
1788 AC_MSG_CHECKING(whether to use Kerberos 5)
1790 [ --with-krb5=base-dir Include Kerberos 5 support (default=no)],
1791 [ case "$withval" in
1794 AC_DEFINE(KRB5_AUTH)
1795 LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
1796 CFLAGS="$CFLAGS -I$withval/include"
1797 LDFLAGS="$LDFLAGS -L$withval/lib"
1806 #################################################
1807 # check for automount support
1808 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1809 AC_ARG_WITH(automount,
1810 [ --with-automount Include AUTOMOUNT support (default=no)],
1811 [ case "$withval" in
1814 AC_DEFINE(WITH_AUTOMOUNT)
1823 #################################################
1824 # check for smbmount support
1825 AC_MSG_CHECKING(whether to use SMBMOUNT)
1826 AC_ARG_WITH(smbmount,
1827 [ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1828 [ case "$withval" in
1833 AC_DEFINE(WITH_SMBMOUNT)
1834 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1837 AC_MSG_ERROR(not on a linux system!)
1851 #################################################
1852 # check for a PAM password database
1853 with_pam_for_crypt=no
1854 AC_MSG_CHECKING(whether to use PAM password database)
1856 [ --with-pam Include PAM password database support (default=no)],
1857 [ case "$withval" in
1862 with_pam_for_crypt=yes
1871 # we can't build a pam module if we don't have pam.
1872 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1874 #################################################
1875 # check for pam_smbpass support
1876 AC_MSG_CHECKING(whether to use pam_smbpass)
1877 AC_ARG_WITH(pam_smbpass,
1878 [ --with-pam_smbpass Include the smbpass PAM module (default=no)],
1879 [ case "$withval" in
1883 # Conditions under which pam_smbpass should not be built.
1885 if test x$PICFLAG = x; then
1886 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1888 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1889 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1892 AC_DEFINE(WITH_PAM_SMBPASS)
1893 PAM_MOD="bin/pam_smbpass.so"
1904 ###############################################
1905 # test for where we get crypt() from, but only
1907 if test $with_pam_for_crypt = no; then
1908 AC_CHECK_FUNCS(crypt)
1909 if test x"$ac_cv_func_crypt" = x"no"; then
1910 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1911 AC_DEFINE(HAVE_CRYPT)])
1916 ## moved after the check for -lcrypt in order to
1917 ## ensure that the necessary libraries are included
1918 ## check checking for truncated salt. Wrapped by the
1919 ## $with_pam_for_crypt variable as above --jerry
1921 if test $with_pam_for_crypt = no; then
1922 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1923 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1924 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1925 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1926 AC_DEFINE(HAVE_TRUNCATED_SALT)
1931 ########################################################################################
1933 ## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
1935 ########################################################################################
1937 ## set the with_smbpasswd_sam as the default
1938 with_smbpasswd_sam=yes
1942 #################################################
1943 # check for a TDB password database
1944 AC_MSG_CHECKING(whether to use TDB SAM database)
1946 [ --with-tdbsam Include experimental TDB SAM support (default=no)],
1947 [ case "$withval" in
1950 AC_DEFINE(WITH_TDB_SAM)
1951 with_smbpasswd_sam=no
1960 #################################################
1961 # check for a LDAP password database
1962 AC_MSG_CHECKING(whether to use LDAP SAM database)
1963 AC_ARG_WITH(ldapsam,
1964 [ --with-ldapsam Include experimental LDAP SAM support (default=no)],
1965 [ case "$withval" in
1968 AC_DEFINE(WITH_LDAP_SAM)
1969 LIBS="-lldap -llber -lresolv $LIBS"
1970 with_smbpasswd_sam=no
1979 #################################################
1980 # check for a NISPLUS password database
1981 AC_MSG_CHECKING(whether to use NISPLUS SAM database)
1982 AC_ARG_WITH(nisplussam,
1983 [ --with-nisplussam Include NISPLUS SAM support (default=no)],
1984 [ case "$withval" in
1987 AC_DEFINE(WITH_NISPLUS_SAM)
1988 with_smbpasswd_sam=no
1997 ################################################
1998 # This test should come last because the
1999 # smbpasswd SAM is only used if another format
2000 # has not been defined
2001 AC_MSG_CHECKING(whether to use traditional smbpasswd file)
2002 if test $with_smbpasswd_sam = yes; then
2004 AC_DEFINE(WITH_SMBPASSWD_SAM)
2011 ########################################################################################
2013 ## END OF TESTS FOR SAM BACKENDS.
2015 ########################################################################################
2017 #################################################
2018 # check for a NISPLUS_HOME support
2019 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
2020 AC_ARG_WITH(nisplus-home,
2021 [ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
2022 [ case "$withval" in
2025 AC_DEFINE(WITH_NISPLUS_HOME)
2034 #################################################
2035 # check for the secure socket layer
2036 AC_MSG_CHECKING(whether to use SSL)
2038 [ --with-ssl Include SSL support (default=no)
2039 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
2040 --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
2041 [ case "$withval" in
2045 withval="/usr/local/ssl" # default
2047 if test "${with_sslinc+set}" = set; then
2049 withval="$with_sslinc"
2052 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
2053 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2056 CFLAGS="-I${withval} $CFLAGS"
2062 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2066 if test "${with_ssllib+set}" = set; then
2068 withval="$with_ssllib"
2071 echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
2072 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2075 LDFLAGS="-L${withval}/lib $LDFLAGS"
2081 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2085 LIBS="-lssl -lcrypto $LIBS"
2087 # if test ! -d ${withval}; then
2088 # echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
2092 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
2102 #################################################
2103 # check for syslog logging
2104 AC_MSG_CHECKING(whether to use syslog logging)
2106 [ --with-syslog Include experimental SYSLOG support (default=no)],
2107 [ case "$withval" in
2110 AC_DEFINE(WITH_SYSLOG)
2119 #################################################
2120 # check for a shared memory profiling support
2121 AC_MSG_CHECKING(whether to use profiling)
2122 AC_ARG_WITH(profiling-data,
2123 [ --with-profiling-data Include gathering source code profile information (default=no)],
2124 [ case "$withval" in
2127 AC_DEFINE(WITH_PROFILE)
2137 #################################################
2138 # check for experimental disk-quotas support
2139 QUOTAOBJS=smbd/noquotas.o
2141 AC_MSG_CHECKING(whether to support disk-quotas)
2143 [ --with-quotas Include experimental disk-quota support (default=no)],
2144 [ case "$withval" in
2147 QUOTAOBJS=smbd/quotas.o
2150 # Check for kernel 2.4.x quota braindamage...
2151 AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
2152 AC_TRY_COMPILE([#include <stdio.h>
2153 #include <sys/types.h>
2154 #include <asm/types.h>
2155 #include <linux/quota.h>
2157 #include <linux/unistd.h>],[struct mem_dqblk D;],
2158 samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
2159 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
2160 AC_DEFINE(LINUX_QUOTAS_2)
2162 AC_DEFINE(LINUX_QUOTAS_1)
2177 #################################################
2178 # check for experimental utmp accounting
2180 AC_MSG_CHECKING(whether to support utmp accounting)
2182 [ --with-utmp Include experimental utmp accounting (default=no)],
2183 [ case "$withval" in
2186 AC_DEFINE(WITH_UTMP)
2195 #################################################
2196 # check for MS Dfs support
2198 AC_MSG_CHECKING(whether to support Microsoft Dfs)
2200 [ --with-msdfs Include MS Dfs support (default=no)],
2201 [ case "$withval" in
2204 AC_DEFINE(WITH_MSDFS)
2213 #################################################
2214 # check for Samba VFS support
2216 AC_MSG_CHECKING(whether to support the experimental Samba vfs)
2218 [ --with-vfs Include Samba vfs support (default=no)],
2219 [ case "$withval" in
2232 #################################################
2233 # should we build libsmbclient?
2235 LIBSMBCLIENT_SHARED=
2237 AC_MSG_CHECKING(whether to build the libsmbclient shared library)
2238 AC_ARG_WITH(libsmbclient,
2239 [ --with-libsmbclient Build the libsmbclient shared library (default=no)],
2240 [ case "$withval" in
2242 if test $BLDSHARED = true; then
2243 LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
2244 LIBSMBCLIENT=libsmbclient
2247 AC_MSG_RESULT(no shared library support)
2257 #################################################
2258 # these tests are taken from the GNU fileutils package
2259 AC_CHECKING(how to get filesystem space usage)
2262 # Test for statvfs64.
2263 if test $space = no; then
2265 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
2267 #if defined(HAVE_UNISTD_H)
2270 #include <sys/types.h>
2271 #include <sys/statvfs.h>
2274 struct statvfs64 fsd;
2275 exit (statvfs64 (".", &fsd));
2277 fu_cv_sys_stat_statvfs64=yes,
2278 fu_cv_sys_stat_statvfs64=no,
2279 fu_cv_sys_stat_statvfs64=cross)])
2280 if test $fu_cv_sys_stat_statvfs64 = yes; then
2282 AC_DEFINE(STAT_STATVFS64)
2286 # Perform only the link test since it seems there are no variants of the
2287 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2288 # because that got a false positive on SCO OSR5. Adding the declaration
2289 # of a `struct statvfs' causes this test to fail (as it should) on such
2290 # systems. That system is reported to work fine with STAT_STATFS4 which
2291 # is what it gets when this test fails.
2292 if test $space = no; then
2294 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2295 [AC_TRY_LINK([#include <sys/types.h>
2296 #include <sys/statvfs.h>],
2297 [struct statvfs fsd; statvfs (0, &fsd);],
2298 fu_cv_sys_stat_statvfs=yes,
2299 fu_cv_sys_stat_statvfs=no)])
2300 if test $fu_cv_sys_stat_statvfs = yes; then
2302 AC_DEFINE(STAT_STATVFS)
2306 if test $space = no; then
2307 # DEC Alpha running OSF/1
2308 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2309 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2311 #include <sys/param.h>
2312 #include <sys/types.h>
2313 #include <sys/mount.h>
2318 exit (statfs (".", &fsd, sizeof (struct statfs)));
2320 fu_cv_sys_stat_statfs3_osf1=yes,
2321 fu_cv_sys_stat_statfs3_osf1=no,
2322 fu_cv_sys_stat_statfs3_osf1=no)])
2323 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2324 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2326 AC_DEFINE(STAT_STATFS3_OSF1)
2330 if test $space = no; then
2332 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2333 member (AIX, 4.3BSD)])
2334 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2336 #ifdef HAVE_SYS_PARAM_H
2337 #include <sys/param.h>
2339 #ifdef HAVE_SYS_MOUNT_H
2340 #include <sys/mount.h>
2342 #ifdef HAVE_SYS_VFS_H
2343 #include <sys/vfs.h>
2349 exit (statfs (".", &fsd));
2351 fu_cv_sys_stat_statfs2_bsize=yes,
2352 fu_cv_sys_stat_statfs2_bsize=no,
2353 fu_cv_sys_stat_statfs2_bsize=no)])
2354 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2355 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2357 AC_DEFINE(STAT_STATFS2_BSIZE)
2361 if test $space = no; then
2363 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2364 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2365 [AC_TRY_RUN([#include <sys/types.h>
2366 #include <sys/statfs.h>
2370 exit (statfs (".", &fsd, sizeof fsd, 0));
2372 fu_cv_sys_stat_statfs4=yes,
2373 fu_cv_sys_stat_statfs4=no,
2374 fu_cv_sys_stat_statfs4=no)])
2375 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2376 if test $fu_cv_sys_stat_statfs4 = yes; then
2378 AC_DEFINE(STAT_STATFS4)
2382 if test $space = no; then
2384 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2385 member (4.4BSD and NetBSD)])
2386 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2387 [AC_TRY_RUN([#include <sys/types.h>
2388 #ifdef HAVE_SYS_PARAM_H
2389 #include <sys/param.h>
2391 #ifdef HAVE_SYS_MOUNT_H
2392 #include <sys/mount.h>
2398 exit (statfs (".", &fsd));
2400 fu_cv_sys_stat_statfs2_fsize=yes,
2401 fu_cv_sys_stat_statfs2_fsize=no,
2402 fu_cv_sys_stat_statfs2_fsize=no)])
2403 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2404 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2406 AC_DEFINE(STAT_STATFS2_FSIZE)
2410 if test $space = no; then
2412 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2413 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2414 [AC_TRY_RUN([#include <sys/types.h>
2415 #ifdef HAVE_SYS_PARAM_H
2416 #include <sys/param.h>
2418 #ifdef HAVE_SYS_MOUNT_H
2419 #include <sys/mount.h>
2421 #ifdef HAVE_SYS_FS_TYPES_H
2422 #include <sys/fs_types.h>
2427 /* Ultrix's statfs returns 1 for success,
2428 0 for not mounted, -1 for failure. */
2429 exit (statfs (".", &fsd) != 1);
2431 fu_cv_sys_stat_fs_data=yes,
2432 fu_cv_sys_stat_fs_data=no,
2433 fu_cv_sys_stat_fs_data=no)])
2434 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2435 if test $fu_cv_sys_stat_fs_data = yes; then
2437 AC_DEFINE(STAT_STATFS2_FS_DATA)
2442 # As a gating factor for large file support, in order to
2443 # use <4GB files we must have the following minimal support
2445 # long long, and a 64 bit off_t or off64_t.
2446 # If we don't have all of these then disable large
2449 AC_MSG_CHECKING(if large file support can be enabled)
2451 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2452 #include <sys/types.h>
2458 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2459 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2461 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2466 AC_ARG_WITH(spinlocks,
2467 [ --with-spinlocks Use spin locks instead of fcntl locks (default=no)])
2468 if test "x$with_spinlocks" = "xyes"; then
2469 AC_DEFINE(USE_SPINLOCKS)
2473 AC_DEFINE(SPARC_SPINLOCKS)
2476 i386|i486|i586|i686)
2477 AC_DEFINE(INTEL_SPINLOCKS)
2481 AC_DEFINE(MIPS_SPINLOCKS)
2485 AC_DEFINE(POWERPC_SPINLOCKS)
2490 #################################################
2491 # check for ACL support
2493 AC_MSG_CHECKING(whether to support ACLs)
2494 AC_ARG_WITH(acl-support,
2495 [ --with-acl-support Include ACL support (default=no)],
2496 [ case "$withval" in
2501 AC_MSG_RESULT(Using UnixWare ACLs)
2502 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2505 AC_MSG_RESULT(Using solaris ACLs)
2506 AC_DEFINE(HAVE_SOLARIS_ACLS)
2509 AC_MSG_RESULT(Using HPUX ACLs)
2510 AC_DEFINE(HAVE_HPUX_ACLS)
2513 AC_MSG_RESULT(Using IRIX ACLs)
2514 AC_DEFINE(HAVE_IRIX_ACLS)
2517 AC_MSG_RESULT(Using AIX ACLs)
2518 AC_DEFINE(HAVE_AIX_ACLS)
2521 AC_MSG_RESULT(Using Tru64 ACLs)
2522 AC_DEFINE(HAVE_TRU64_ACLS)
2526 AC_CHECK_LIB(acl,acl_get_file)
2527 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2528 AC_TRY_LINK([#include <sys/types.h>
2529 #include <sys/acl.h>],
2530 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2531 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2532 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2533 AC_MSG_RESULT(Using posix ACLs)
2534 AC_DEFINE(HAVE_POSIX_ACLS)
2535 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2536 AC_TRY_LINK([#include <sys/types.h>
2537 #include <sys/acl.h>],
2538 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2539 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2540 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2541 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2549 AC_DEFINE(HAVE_NO_ACLS)
2552 AC_DEFINE(HAVE_NO_ACLS)
2556 #################################################
2557 # check for the historical SAMBA installation
2559 if test "x$prefix" = xNONE -a "$sbindir" = "\${exec_prefix}/sbin"; then
2560 # Put all binaries under the /usr/local/samba/bin directory.
2564 #################################################
2565 # Check whether winbind is supported on this platform. If so we need to
2566 # build and install client programs (WINBIND_TARGETS), sbin programs
2567 # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2569 AC_MSG_CHECKING(whether to build winbind)
2571 # Initially, the value of $host_os decides whether winbind is supported
2574 *linux*|*solaris*|*irix*|*hpux11*)
2579 winbind_no_reason=", unsupported on $host_os"
2583 # Check the setting of --with-winbindd
2585 AC_ARG_WITH(winbind,
2586 [ --with-winbind Build winbind (default, if supported by OS)],
2599 # We need unix domain sockets for winbind
2601 if test x"$HAVE_WINBIND" = x"yes"; then
2602 if test x"$samba_cv_unixsocket" = x"no"; then
2603 winbind_no_reason=", no unix domain socket support on $host_os"
2608 # Display test results
2610 if test x"$HAVE_WINBIND" = x"yes"; then
2614 WINBIND_TARGETS="bin/wbinfo"
2615 WINBIND_STARGETS="bin/winbindd"
2616 WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
2620 WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2624 AC_MSG_RESULT(no$winbind_no_reason)
2629 WINBIND_PAM_TARGETS=""
2632 # Substitution time!
2634 AC_SUBST(WINBIND_TARGETS)
2635 AC_SUBST(WINBIND_STARGETS)
2636 AC_SUBST(WINBIND_LTARGETS)
2637 AC_SUBST(WINBIND_PAM_TARGETS)
2639 #################################################
2640 # final configure stuff
2641 echo "checking configure summary"
2642 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2643 echo "configure OK";,
2644 AC_MSG_ERROR([summary failure. Aborting config]),:)
2649 AC_OUTPUT(include/stamp-h Makefile)