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)
4 # we want to be compatible with older versions of Samba
5 AC_PREFIX_DEFAULT(/usr/local/samba)
7 dnl Unique-to-Samba variables we'll be playing with.
21 AC_SUBST(LIBSMBCLIENT_SHARED)
23 # compile with optimisation and without debugging by default
26 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
27 [if eval "test x$enable_debug = xyes"; then
31 AC_ARG_ENABLE(developer, [ --enable-developer turn on developer warnings and debugging [default=no]],
32 [if eval "test x$enable_developer = xyes"; then
33 CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
36 AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable heap debugging [default=no]])
38 if test "x$enable_dmalloc" = xyes
40 AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
41 AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
42 [Define to check invariants around some common functions])
43 LIBS="$LIBS -ldmalloc"
46 dnl Checks for programs.
51 dnl needed before AC_TRY_COMPILE
54 dnl Check if C compiler understands -c and -o at the same time
56 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
63 dnl Check if the C compiler understands volatile (it should, being ANSI).
64 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
65 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
66 samba_cv_volatile=yes,samba_cv_volatile=no)])
67 if test x"$samba_cv_volatile" = x"yes"; then
68 AC_DEFINE(HAVE_VOLATILE)
74 dnl Add #include for broken IRIX header files
76 *irix6*) AC_ADD_INCLUDE(<standards.h>)
80 AC_VALIDATE_CACHE_SYSTEM_TYPE
83 # Config CPPFLAG settings for strange OS's that must be set
87 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
90 # mmap on HPUX is completely broken...
91 AC_DEFINE(MMAP_BLACKLIST)
92 if test $ac_cv_prog_cc_Ae = yes; then
93 CPPFLAGS="$CPPFLAGS -Ae"
96 # Defines needed for HPUX support.
97 # HPUX has bigcrypt but (sometimes?) doesn't use it for
98 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
102 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
103 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
106 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
107 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
113 # CRAY Unicos has broken const handling
115 AC_MSG_RESULT([disabling const])
116 CPPFLAGS="$CPPFLAGS -Dconst="
120 # AIX4.x doesn't even admit to having large
121 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
124 AC_MSG_RESULT([enabling large file support])
125 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
128 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
129 # to the existance of large files..
130 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
131 # recommendations on large file support, however it makes the
132 # compile work using gcc 2.7 and 2.8, whereas using the Sun
133 # recommendation makes the compile fail on gcc2.7. JRA.
137 5.0*|5.1*|5.2*|5.3*|5.5*)
138 AC_MSG_RESULT([no large file support])
141 AC_MSG_RESULT([enabling large file support])
142 if test "$ac_cv_prog_gcc" = yes; then
143 ${CC-cc} -v >conftest.c 2>&1
144 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
146 case "$ac_cv_gcc_compiler_version_number" in
147 *"gcc version 2.6"*|*"gcc version 2.7"*)
148 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
151 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
155 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
161 # Tests needed for SINIX large file support.
164 if test $host = mips-sni-sysv4 ; then
165 AC_MSG_CHECKING([for LFS support])
166 old_CPPFLAGS="$CPPFLAGS"
167 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
171 #if _LFS64_LARGEFILE == 1
176 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
177 CPPFLAGS="$old_CPPFLAGS"
178 if test x$SINIX_LFS_SUPPORT = xyes ; then
179 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
180 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
181 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
182 LIBS="`getconf LFS64_LIBS` $LIBS"
184 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
188 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
191 AC_MSG_CHECKING([for LFS support])
192 old_CPPFLAGS="$CPPFLAGS"
193 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
196 #include <sys/utsname.h>
198 #if _LFS64_LARGEFILE == 1
203 /* Ensure this is glibc 2.2 or higher */
204 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
205 int libc_major = __GLIBC__;
206 int libc_minor = __GLIBC_MINOR__;
214 /* Ensure this is kernel 2.4 or higher */
217 release = uts.release;
218 major = atoi(strsep(&release, "."));
219 minor = atoi(strsep(&release, "."));
221 if (major > 2 || (major == 2 && minor > 3))
228 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
229 CPPFLAGS="$old_CPPFLAGS"
230 if test x$LINUX_LFS_SUPPORT = xyes ; then
231 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
233 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
237 AC_MSG_CHECKING([for LFS support])
238 old_CPPFLAGS="$CPPFLAGS"
239 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
243 #if _LFS64_LARGEFILE == 1
248 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
249 CPPFLAGS="$old_CPPFLAGS"
250 if test x$GLIBC_LFS_SUPPORT = xyes ; then
251 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
253 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
263 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
264 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
265 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
266 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
267 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
268 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
269 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
270 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h lber.h)
273 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
274 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
278 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
279 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
280 if test x"$ac_cv_header_shadow_h" = x"yes"; then
281 AC_DEFINE(HAVE_SHADOW_H)
285 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
286 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
287 AC_CHECK_HEADERS(stropts.h poll.h)
288 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
289 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
291 # For experimental utmp support (lastlog on some BSD-like systems)
292 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
294 # For quotas on Veritas VxFS filesystems
295 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
297 # For quotas on Linux XFS filesystems
298 AC_CHECK_HEADERS(linux/xqm.h)
300 AC_CHECK_SIZEOF(int,cross)
301 AC_CHECK_SIZEOF(long,cross)
302 AC_CHECK_SIZEOF(short,cross)
317 AC_CHECK_TYPE(ino_t,unsigned)
318 AC_CHECK_TYPE(loff_t,off_t)
319 AC_CHECK_TYPE(offset_t,loff_t)
320 AC_CHECK_TYPE(ssize_t, int)
321 AC_CHECK_TYPE(wchar_t, unsigned short)
323 ############################################
324 # for cups support we need libcups, and a handful of header files
326 AC_CHECK_LIB(cups,httpConnect)
328 # I wonder if there is a nicer way of doing this?
330 if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
331 AC_CHECK_HEADERS(cups/cups.h cups/language.h)
332 if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
333 if test x"$ac_cv_header_cups_language_h" = x"yes"; then
339 ############################################
340 # we need libdl for PAM and the new VFS code
341 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
342 AC_DEFINE(HAVE_LIBDL)])
344 ############################################
345 # check if the compiler can do immediate structures
346 AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
350 #define X_FOOBAR(x) ((FOOBAR) { x })
351 typedef struct {unsigned x;} FOOBAR;
352 FOOBAR f = X_FOOBAR(1);
354 samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
355 if test x"$samba_cv_immediate_structures" = x"yes"; then
356 AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES)
359 ############################################
360 # check for unix domain sockets
361 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
363 #include <sys/types.h>
366 #include <sys/socket.h>
367 #include <sys/un.h>],
369 struct sockaddr_un sunaddr;
370 sunaddr.sun_family = AF_UNIX;
372 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
373 if test x"$samba_cv_unixsocket" = x"yes"; then
374 AC_DEFINE(HAVE_UNIXSOCKET)
378 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
380 #include <sys/types.h>
385 #include <sys/socket.h>],[socklen_t i = 0],
386 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
387 if test x"$samba_cv_socklen_t" = x"yes"; then
388 AC_DEFINE(HAVE_SOCKLEN_T_TYPE)
391 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
393 #include <sys/types.h>
398 #include <signal.h>],[sig_atomic_t i = 0],
399 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
400 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
401 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
404 # stupid headers have the functions but no declaration. grrrr.
405 AC_HAVE_DECL(errno, [#include <errno.h>])
406 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
407 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
408 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
409 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
410 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
411 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
413 # and glibc has setresuid under linux but the function does
414 # nothing until kernel 2.1.44! very dumb.
415 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
416 AC_TRY_RUN([#include <errno.h>
417 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
418 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
419 if test x"$samba_cv_have_setresuid" = x"yes"; then
420 AC_DEFINE(HAVE_SETRESUID)
423 # Do the same check for setresguid...
425 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
426 AC_TRY_RUN([#include <unistd.h>
428 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
429 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
430 if test x"$samba_cv_have_setresgid" = x"yes"; then
431 AC_DEFINE(HAVE_SETRESGID)
436 ###############################################
437 # test for where we get crypt() from
438 AC_CHECK_FUNCS(crypt)
439 if test x"$ac_cv_func_crypt" = x"no"; then
440 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
441 AC_DEFINE(HAVE_CRYPT)])
445 ###############################################
446 # Readline included by default unless explicitly asked not to
447 test "${with_readline+set}" != "set" && with_readline=yes
449 # test for where we get readline() from
450 AC_MSG_CHECKING(whether to use readline)
451 AC_ARG_WITH(readline,
452 [ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto) ],
453 [ case "$with_readline" in
457 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
458 AC_CHECK_HEADERS(readline/history.h)
460 AC_CHECK_HEADERS(readline.h readline/readline.h,[
461 for termlib in ncurses curses termcap terminfo termlib; do
462 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
464 AC_CHECK_LIB(readline, rl_callback_handler_install,
465 [TERMLIBS="-lreadline $TERMLIBS"
466 AC_DEFINE(HAVE_LIBREADLINE)
467 break], [TERMLIBS=], $TERMLIBS)])
475 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
476 # alternate readline path
478 _cppflags=${CPPFLAGS}
480 # Add additional search path
481 LDFLAGS="-L$with_readline/lib $LDFLAGS"
482 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
484 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
485 AC_CHECK_HEADERS(readline/history.h)
487 AC_CHECK_HEADERS(readline.h readline/readline.h,[
488 for termlib in ncurses curses termcap terminfo termlib; do
489 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
491 AC_CHECK_LIB(readline, rl_callback_handler_install,
492 [TERMLDFLAGS="-L$with_readline/lib"
493 TERMCPPFLAGS="-I$with_readline/include"
494 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
495 TERMLIBS="-lreadline $TERMLIBS"
496 AC_DEFINE(HAVE_LIBREADLINE)
497 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
505 AC_SUBST(TERMLDFLAGS)
507 # The readline API changed slightly from readline3 to readline4, so
508 # code will generate warnings on one of them unless we have a few
510 AC_CHECK_LIB(readline, rl_completion_matches,
511 [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
512 [Do we have rl_completion_matches?])],
516 # The following test taken from the cvs sources
517 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
518 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
519 # libsocket.so which has a bad implementation of gethostbyname (it
520 # only looks in /etc/hosts), so we only look for -lsocket if we need
522 AC_CHECK_FUNCS(connect)
523 if test x"$ac_cv_func_connect" = x"no"; then
526 *) AC_CHECK_LIB(nsl_s, printf) ;;
530 *) AC_CHECK_LIB(nsl, printf) ;;
534 *) AC_CHECK_LIB(socket, connect) ;;
538 *) AC_CHECK_LIB(inet, connect) ;;
540 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
542 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
543 test x"$ac_cv_lib_inet_connect" = x"yes"; then
544 # ac_cv_func_connect=yes
545 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
546 AC_DEFINE(HAVE_CONNECT)
550 ###############################################
551 # test for where we get get_yp_default_domain() from
552 AC_CHECK_FUNCS(yp_get_default_domain)
553 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
554 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
555 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
558 # Check if we have execl, if not we need to compile smbrun.
559 AC_CHECK_FUNCS(execl)
560 if test x"$ac_cv_func_execl" = x"no"; then
566 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot)
567 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
568 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
569 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
570 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
571 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
572 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
573 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
574 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
575 AC_CHECK_FUNCS(syslog vsyslog)
576 # setbuffer is needed for smbtorture
577 AC_CHECK_FUNCS(setbuffer)
579 # syscall() is needed for smbwrapper.
580 AC_CHECK_FUNCS(syscall)
582 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
583 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
584 AC_CHECK_FUNCS(__getcwd _getcwd)
585 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
586 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
587 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
588 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
589 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
590 AC_CHECK_FUNCS(_write __write _fork __fork)
591 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
592 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
593 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
594 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
595 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
598 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
601 if test x$ac_cv_func_stat64 = xno ; then
602 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
604 #if defined(HAVE_UNISTD_H)
607 #include <sys/stat.h>
608 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
609 AC_MSG_RESULT([$ac_cv_func_stat64])
610 if test x$ac_cv_func_stat64 = xyes ; then
611 AC_DEFINE(HAVE_STAT64)
615 if test x$ac_cv_func_lstat64 = xno ; then
616 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
618 #if defined(HAVE_UNISTD_H)
621 #include <sys/stat.h>
622 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
623 AC_MSG_RESULT([$ac_cv_func_lstat64])
624 if test x$ac_cv_func_lstat64 = xyes ; then
625 AC_DEFINE(HAVE_LSTAT64)
629 if test x$ac_cv_func_fstat64 = xno ; then
630 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
632 #if defined(HAVE_UNISTD_H)
635 #include <sys/stat.h>
636 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
637 AC_MSG_RESULT([$ac_cv_func_fstat64])
638 if test x$ac_cv_func_fstat64 = xyes ; then
639 AC_DEFINE(HAVE_FSTAT64)
643 #####################################
644 # we might need the resolv library on some systems
645 AC_CHECK_LIB(resolv, dn_expand)
648 # Check for the functions putprpwnam, set_auth_parameters,
649 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
650 # Needed for OSF1 and HPUX.
653 AC_LIBTESTFUNC(security, putprpwnam)
654 AC_LIBTESTFUNC(sec, putprpwnam)
656 AC_LIBTESTFUNC(security, set_auth_parameters)
657 AC_LIBTESTFUNC(sec, set_auth_parameters)
659 # UnixWare 7.x has its getspnam in -lgen
660 AC_LIBTESTFUNC(gen, getspnam)
662 AC_LIBTESTFUNC(security, getspnam)
663 AC_LIBTESTFUNC(sec, getspnam)
665 AC_LIBTESTFUNC(security, bigcrypt)
666 AC_LIBTESTFUNC(sec, bigcrypt)
668 AC_LIBTESTFUNC(security, getprpwnam)
669 AC_LIBTESTFUNC(sec, getprpwnam)
671 # this bit needs to be modified for each OS that is suported by
672 # smbwrapper. You need to specify how to created a shared library and
673 # how to compile C code to produce PIC object files
675 # these are the defaults, good for lots of systems
683 # Assume non-shared by default and override below
685 AC_MSG_CHECKING([ability to build shared libraries])
687 # and these are for particular systems
689 *linux*) AC_DEFINE(LINUX)
693 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
695 *solaris*) AC_DEFINE(SUNOS5)
697 LDSHFLAGS="-h \$@ -G"
698 if test "${ac_cv_prog_CC}" = "gcc"; then
705 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
707 *sunos*) AC_DEFINE(SUNOS4)
709 LDSHFLAGS="-Wl,-h,\$@ -G"
710 PICFLAG="-KPIC" # Is this correct for SunOS
712 *bsd*) BLDSHARED="true"
713 LDSHFLAGS="-Wl,-soname,\$@ -shared"
715 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
717 *irix*) AC_DEFINE(IRIX)
719 *irix6*) AC_DEFINE(IRIX6)
722 ATTEMPT_WRAP32_BUILD=yes
724 LDSHFLAGS="-Wl,-soname,\$@ -shared"
725 if test "${ac_cv_prog_CC}" = "gcc"; then
730 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
732 *aix*) AC_DEFINE(AIX)
734 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
735 PICFLAG="-O2 -qmaxmem=6000"
736 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
738 *hpux*) AC_DEFINE(HPUX)
740 # Use special PIC flags for the native HP-UX compiler.
741 if test $ac_cv_prog_cc_Ae = yes; then
743 LDSHFLAGS="-b -z +h \$@"
746 AC_DEFINE(STAT_ST_BLOCKSIZE,8192)
748 *qnx*) AC_DEFINE(QNX);;
749 *osf*) AC_DEFINE(OSF1)
751 LDSHFLAGS="-Wl,-soname,\$@ -shared"
754 *sco*) AC_DEFINE(SCO);;
755 *unixware*) AC_DEFINE(UNIXWARE)
757 LDSHFLAGS="-Wl,-soname,\$@ -shared"
760 *next2*) AC_DEFINE(NEXT2);;
761 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
764 *-univel-*) if [ test "$GCC" != yes ]; then
765 AC_DEFINE(HAVE_MEMSET)
769 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
773 if [ test "$GCC" != yes ]; then
774 AC_DEFINE(HAVE_MEMSET)
779 AC_MSG_RESULT($BLDSHARED)
780 AC_MSG_CHECKING([linker flags for shared libraries])
781 AC_MSG_RESULT([$LDSHFLAGS])
782 AC_MSG_CHECKING([compiler flags for position-independent code])
783 AC_MSG_RESULT([$PICFLAGS])
785 #######################################################
786 # test whether building a shared library actually works
787 if test $BLDSHARED = true; then
788 AC_CACHE_CHECK([whether building shared libraries actually works],
789 [ac_cv_shlib_works],[
791 # try building a trivial shared library
792 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
793 $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
794 ac_cv_shlib_works=yes
795 rm -f shlib.so shlib.po
797 if test $ac_cv_shlib_works = no; then
803 # this updates our target list if we can build shared libs
804 if test $BLDSHARED = true; then
805 LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
812 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
813 AC_TRY_RUN([#include <stdio.h>
814 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
815 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
816 if test x"$samba_cv_have_longlong" = x"yes"; then
817 AC_DEFINE(HAVE_LONGLONG)
821 # Check if the compiler supports the LL prefix on long long integers.
824 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
825 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
826 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
827 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
828 AC_DEFINE(COMPILER_SUPPORTS_LL)
832 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
833 AC_TRY_RUN([#include <stdio.h>
834 #include <sys/stat.h>
835 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
836 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
837 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
838 AC_DEFINE(SIZEOF_OFF_T,8)
841 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
843 #if defined(HAVE_UNISTD_H)
847 #include <sys/stat.h>
848 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
849 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
850 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
851 AC_DEFINE(HAVE_OFF64_T)
854 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
855 AC_TRY_RUN([#include <stdio.h>
856 #include <sys/stat.h>
857 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
858 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
859 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
860 AC_DEFINE(SIZEOF_INO_T,8)
863 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
865 #if defined(HAVE_UNISTD_H)
869 #include <sys/stat.h>
870 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
871 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
872 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
873 AC_DEFINE(HAVE_INO64_T)
876 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
878 #if defined(HAVE_UNISTD_H)
881 #include <sys/types.h>
882 #include <dirent.h>],
883 [struct dirent64 de;],
884 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
885 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
886 AC_DEFINE(HAVE_STRUCT_DIRENT64)
889 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
890 AC_TRY_RUN([#include <stdio.h>
891 main() { char c; c=250; exit((c > 0)?0:1); }],
892 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
893 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
894 AC_DEFINE(HAVE_UNSIGNED_CHAR)
897 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
898 AC_TRY_COMPILE([#include <sys/types.h>
899 #include <sys/socket.h>
900 #include <netinet/in.h>],
901 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
902 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
903 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
904 AC_DEFINE(HAVE_SOCK_SIN_LEN)
907 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
908 AC_TRY_COMPILE([#include <sys/types.h>
910 void seekdir(DIR *d, long loc) { return; }],[return 0;],
911 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
912 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
913 AC_DEFINE(SEEKDIR_RETURNS_VOID)
916 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
917 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
918 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
919 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
920 AC_DEFINE(HAVE_FILE_MACRO)
923 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
924 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
925 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
926 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
927 AC_DEFINE(HAVE_FUNCTION_MACRO)
930 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
932 #include <sys/time.h>
934 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
935 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
936 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
937 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
940 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
942 #include <sys/types.h>
944 void foo(const char *format, ...) {
949 va_start(ap, format);
950 len = vsnprintf(0, 0, format, ap);
952 if (len != 5) exit(1);
954 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
958 main() { foo("hello"); }
960 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
961 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
962 AC_DEFINE(HAVE_C99_VSNPRINTF)
965 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
966 AC_TRY_RUN([#include <sys/types.h>
968 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
969 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
970 di->d_name[0] == 0) exit(0); exit(1);} ],
971 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
972 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
973 AC_DEFINE(HAVE_BROKEN_READDIR)
976 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
977 AC_TRY_COMPILE([#include <sys/types.h>
979 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
980 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
981 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
982 AC_DEFINE(HAVE_UTIMBUF)
985 dnl utmp and utmpx come in many flavours
986 dnl We need to check for many of them
987 dnl But we don't need to do each and every one, because our code uses
988 dnl mostly just the utmp (not utmpx) fields.
990 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
992 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
993 AC_TRY_COMPILE([#include <sys/types.h>
995 [struct utmp ut; ut.ut_name[0] = 'a';],
996 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
997 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
998 AC_DEFINE(HAVE_UT_UT_NAME)
1001 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
1002 AC_TRY_COMPILE([#include <sys/types.h>
1004 [struct utmp ut; ut.ut_user[0] = 'a';],
1005 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
1006 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
1007 AC_DEFINE(HAVE_UT_UT_USER)
1010 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
1011 AC_TRY_COMPILE([#include <sys/types.h>
1013 [struct utmp ut; ut.ut_id[0] = 'a';],
1014 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
1015 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
1016 AC_DEFINE(HAVE_UT_UT_ID)
1019 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
1020 AC_TRY_COMPILE([#include <sys/types.h>
1022 [struct utmp ut; ut.ut_host[0] = 'a';],
1023 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
1024 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
1025 AC_DEFINE(HAVE_UT_UT_HOST)
1028 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
1029 AC_TRY_COMPILE([#include <sys/types.h>
1031 [struct utmp ut; time_t t; ut.ut_time = t;],
1032 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
1033 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
1034 AC_DEFINE(HAVE_UT_UT_TIME)
1037 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
1038 AC_TRY_COMPILE([#include <sys/types.h>
1040 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
1041 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
1042 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
1043 AC_DEFINE(HAVE_UT_UT_TV)
1046 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
1047 AC_TRY_COMPILE([#include <sys/types.h>
1049 [struct utmp ut; ut.ut_type = 0;],
1050 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
1051 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
1052 AC_DEFINE(HAVE_UT_UT_TYPE)
1055 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
1056 AC_TRY_COMPILE([#include <sys/types.h>
1058 [struct utmp ut; ut.ut_pid = 0;],
1059 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
1060 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
1061 AC_DEFINE(HAVE_UT_UT_PID)
1064 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1065 AC_TRY_COMPILE([#include <sys/types.h>
1067 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1068 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1069 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1070 AC_DEFINE(HAVE_UT_UT_EXIT)
1073 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1074 AC_TRY_COMPILE([#include <sys/types.h>
1076 [struct utmp ut; ut.ut_addr = 0;],
1077 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1078 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1079 AC_DEFINE(HAVE_UT_UT_ADDR)
1082 if test x$ac_cv_func_pututline = xyes ; then
1083 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1084 AC_TRY_COMPILE([#include <sys/types.h>
1086 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1087 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1088 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1089 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1093 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1094 AC_TRY_COMPILE([#include <sys/types.h>
1095 #include <utmpx.h>],
1096 [struct utmpx ux; ux.ut_syslen = 0;],
1097 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1098 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1099 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1103 #################################################
1104 # check for libiconv support
1105 AC_MSG_CHECKING(whether to use libiconv)
1106 AC_ARG_WITH(libiconv,
1107 [ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
1108 [ case "$withval" in
1114 CFLAGS="$CFLAGS -I$withval/include"
1115 LDFLAGS="$LDFLAGS -L$withval/lib"
1116 AC_CHECK_LIB(iconv, iconv_open)
1117 AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}")
1125 # check for iconv in libc
1126 AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
1130 iconv_t cd = iconv_open("ASCII", "UCS-2LE");
1131 if (cd == 0 || cd == (iconv_t)-1) return -1;
1135 samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)])
1136 if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
1137 AC_DEFINE(HAVE_NATIVE_ICONV)
1141 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1143 #include <sys/types.h>
1146 #define F_GETLEASE 1025
1149 int fd = open("/dev/null", O_RDONLY);
1150 return fcntl(fd, F_GETLEASE, 0) == -1;
1153 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1154 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1155 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1158 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1160 #include <sys/types.h>
1164 #define F_NOTIFY 1026
1167 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1170 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1171 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1172 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1175 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1177 #include <sys/types.h>
1180 #include <sys/file.h>
1182 #define LOCK_MAND 32
1183 #define LOCK_READ 64
1186 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1189 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1190 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1191 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1197 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1198 AC_TRY_COMPILE([#include <sys/types.h>
1199 #include <fcntl.h>],
1200 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1201 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1202 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1203 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1206 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1207 AC_TRY_RUN([#include <sys/types.h>
1208 #include <sys/capability.h>
1211 if ((cap = cap_get_proc()) == NULL)
1213 cap->cap_effective |= CAP_NETWORK_MGT;
1214 cap->cap_inheritable |= CAP_NETWORK_MGT;
1219 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1220 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1221 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1225 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1226 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1229 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1230 AC_TRY_COMPILE([#include <sys/types.h>
1231 #if defined(HAVE_RPC_RPC_H)
1232 #include <rpc/rpc.h>
1235 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1236 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1237 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1240 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1241 AC_TRY_COMPILE([#include <sys/types.h>
1242 #if defined(HAVE_RPC_RPC_H)
1243 #include <rpc/rpc.h>
1246 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1247 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1248 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1251 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1252 AC_TRY_COMPILE([#include <sys/types.h>
1253 #if defined(HAVE_RPC_RPC_H)
1254 #include <rpc/rpc.h>
1257 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1258 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1259 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1262 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1263 AC_TRY_COMPILE([#include <sys/types.h>
1264 #if defined(HAVE_RPC_RPC_H)
1265 #include <rpc/rpc.h>
1268 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1269 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1270 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1274 dnl Some systems (SCO) have a problem including
1275 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1276 dnl as a #define in <prot.h> and as part of an enum
1280 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1281 AC_TRY_COMPILE([#include <sys/types.h>
1282 #ifdef HAVE_SYS_SECURITY_H
1283 #include <sys/security.h>
1285 #endif /* HAVE_SYS_SECURITY_H */
1286 #if defined(HAVE_RPC_RPC_H)
1287 #include <rpc/rpc.h>
1290 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1291 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1292 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1295 AC_MSG_CHECKING([for test routines])
1296 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1298 AC_MSG_ERROR([cant find test code. Aborting config]),
1299 AC_MSG_WARN([cannot run when cross-compiling]))
1301 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1302 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1303 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1304 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1305 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1308 AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
1309 AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
1310 samba_cv_HAVE_WORKING_AF_LOCAL=yes,
1311 samba_cv_HAVE_WORKING_AF_LOCAL=no,
1312 samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
1313 if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
1315 AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
1318 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1319 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1320 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1321 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1322 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1325 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1326 SAVE_CPPFLAGS="$CPPFLAGS"
1327 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1329 #define REPLACE_GETPASS 1
1330 #define NO_CONFIG_H 1
1331 #define main dont_declare_main
1332 #include "${srcdir-.}/lib/getsmbpass.c"
1334 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1335 CPPFLAGS="$SAVE_CPPFLAGS"
1337 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1338 AC_DEFINE(REPLACE_GETPASS)
1341 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1344 #include <sys/types.h>
1345 #include <netinet/in.h>
1346 #ifdef HAVE_ARPA_INET_H
1347 #include <arpa/inet.h>
1349 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1350 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1351 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1353 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1354 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1355 AC_DEFINE(REPLACE_INET_NTOA)
1358 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1359 AC_TRY_RUN([#include <stdlib.h>
1360 #include <sys/types.h>
1361 #include <sys/stat.h>
1365 char tpl[20]="/tmp/test.XXXXXX";
1366 int fd = mkstemp(tpl);
1367 if (fd == -1) exit(1);
1369 if (fstat(fd, &st) != 0) exit(1);
1370 if ((st.st_mode & 0777) != 0600) exit(1);
1373 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1374 samba_cv_HAVE_SECURE_MKSTEMP=no,
1375 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1376 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1377 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1380 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1381 AC_TRY_RUN([#include <unistd.h>
1382 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1383 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1384 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1385 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1388 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1389 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1390 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1391 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1392 AC_DEFINE(HAVE_ROOT)
1394 AC_MSG_WARN(running as non-root will disable some tests)
1398 # look for a method of finding the list of network interfaces
1400 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1402 #define HAVE_IFACE_AIX 1
1403 #define AUTOCONF_TEST 1
1404 #include "confdefs.h"
1405 #include "${srcdir-.}/lib/interfaces.c"],
1406 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1407 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1408 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1411 if test $iface = no; then
1412 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1414 #define HAVE_IFACE_IFCONF 1
1415 #define AUTOCONF_TEST 1
1416 #include "confdefs.h"
1417 #include "${srcdir-.}/lib/interfaces.c"],
1418 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1419 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1420 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1424 if test $iface = no; then
1425 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1427 #define HAVE_IFACE_IFREQ 1
1428 #define AUTOCONF_TEST 1
1429 #include "confdefs.h"
1430 #include "${srcdir-.}/lib/interfaces.c"],
1431 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1432 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1433 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1438 ################################################
1439 # look for a method of setting the effective uid
1441 if test $seteuid = no; then
1442 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1444 #define AUTOCONF_TEST 1
1445 #define USE_SETRESUID 1
1446 #include "confdefs.h"
1447 #include "${srcdir-.}/lib/util_sec.c"],
1448 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1449 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1450 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1455 if test $seteuid = no; then
1456 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1458 #define AUTOCONF_TEST 1
1459 #define USE_SETREUID 1
1460 #include "confdefs.h"
1461 #include "${srcdir-.}/lib/util_sec.c"],
1462 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1463 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1464 seteuid=yes;AC_DEFINE(USE_SETREUID)
1468 if test $seteuid = no; then
1469 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1471 #define AUTOCONF_TEST 1
1472 #define USE_SETEUID 1
1473 #include "confdefs.h"
1474 #include "${srcdir-.}/lib/util_sec.c"],
1475 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1476 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1477 seteuid=yes;AC_DEFINE(USE_SETEUID)
1481 if test $seteuid = no; then
1482 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1484 #define AUTOCONF_TEST 1
1485 #define USE_SETUIDX 1
1486 #include "confdefs.h"
1487 #include "${srcdir-.}/lib/util_sec.c"],
1488 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1489 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1490 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1495 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1496 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1497 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1498 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1499 AC_DEFINE(HAVE_MMAP)
1502 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1503 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1504 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1505 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1506 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1509 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1510 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1511 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1512 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1513 AC_DEFINE(HAVE_FCNTL_LOCK)
1516 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1517 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1518 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1519 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1520 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1525 dnl Don't check for 64 bit fcntl locking if we know that the
1526 dnl glibc2.1 broken check has succeeded.
1529 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1531 #if defined(HAVE_UNISTD_H)
1541 #ifdef HAVE_SYS_FCNTL_H
1542 #include <sys/fcntl.h>
1544 main() { struct flock64 fl64;
1545 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1551 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1553 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1554 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1558 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1559 AC_TRY_COMPILE([#include <sys/types.h>
1560 #include <sys/stat.h>
1561 #include <unistd.h>],
1562 [struct stat st; st.st_blocks = 0;],
1563 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1564 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1565 AC_DEFINE(HAVE_STAT_ST_BLOCKS)
1570 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1572 #ifdef HAVE_SYS_VFS_H
1573 #include <sys/vfs.h>
1575 #ifdef HAVE_SYS_CAPABILITY_H
1576 #include <sys/capability.h>
1579 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1580 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1581 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS)
1586 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1587 AC_TRY_COMPILE([#include <sys/acl.h>
1588 #if defined(HAVE_RPCSVC_NIS_H)
1589 #include <rpcsvc/nis.h>
1592 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1593 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1594 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1598 #################################################
1599 # check for smbwrapper support
1600 AC_MSG_CHECKING(whether to use smbwrapper)
1601 AC_ARG_WITH(smbwrapper,
1602 [ --with-smbwrapper Include SMB wrapper support (default=no) ],
1603 [ case "$withval" in
1606 AC_DEFINE(WITH_SMBWRAPPER)
1607 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1609 if test x$ATTEMPT_WRAP32_BUILD = x; then
1612 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1615 # Conditions under which smbwrapper should not be built.
1617 if test x$PICFLAG = x; then
1618 echo No support for PIC code - disabling smbwrapper and smbsh
1621 elif test x$ac_cv_func_syscall = xno; then
1622 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1634 #################################################
1635 # check for AFS clear-text auth support
1636 AC_MSG_CHECKING(whether to use AFS clear-text auth)
1638 [ --with-afs Include AFS clear-text auth support (default=no) ],
1639 [ case "$withval" in
1652 #################################################
1653 # check for the DFS clear-text auth system
1654 AC_MSG_CHECKING(whether to use DFS clear-text auth)
1656 [ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)],
1657 [ case "$withval" in
1670 #################################################
1671 # see if this box has the RedHat location for kerberos
1672 AC_MSG_CHECKING(for /usr/kerberos)
1673 if test -d /usr/kerberos; then
1674 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
1675 CFLAGS="$CFLAGS -I/usr/kerberos/include"
1676 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1682 #################################################
1683 # check for location of Kerberos 5 install
1684 AC_MSG_CHECKING(for kerberos 5 install path)
1686 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
1687 [ case "$withval" in
1694 CFLAGS="$CFLAGS -I$withval/include"
1695 CPPFLAGS="$CPPFLAGS -I$withval/include"
1696 LDFLAGS="$LDFLAGS -L$withval/lib"
1702 # now check for krb5.h. Some systems have the libraries without the headers!
1703 # note that this check is done here to allow for different kerberos
1705 AC_CHECK_HEADERS(krb5.h)
1707 # now check for gssapi headers. This is also done here to allow for
1708 # different kerberos include paths
1709 AC_CHECK_HEADERS(gssapi/gssapi_generic.h gssapi/gssapi.h)
1711 ##################################################################
1712 # we might need the k5crypto and com_err libraries on some systems
1713 AC_CHECK_LIB(com_err, _et_list, [LIBS="$LIBS -lcom_err"])
1714 AC_CHECK_LIB(k5crypto, krb5_encrypt_data, [LIBS="$LIBS -lk5crypto"])
1715 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5"])
1718 ########################################################
1719 # now see if we can find the krb5 libs in standard paths
1720 # or as specified above
1721 AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
1722 AC_DEFINE(HAVE_KRB5)])
1724 ########################################################
1725 # now see if we can find the gssapi libs in standard paths
1726 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [AC_DEFINE(HAVE_GSSAPI)])
1729 ##################################################################
1730 # we might need the lber lib on some systems. To avoid link errors
1731 # this test must be before the libldap test
1732 AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
1734 ########################################################
1735 # now see if we can find the ldap libs in standard paths
1736 if test x$have_ldap != xyes; then
1737 AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
1738 AC_DEFINE(HAVE_LDAP)])
1741 #################################################
1742 # check for automount support
1743 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1744 AC_ARG_WITH(automount,
1745 [ --with-automount Include AUTOMOUNT support (default=no)],
1746 [ case "$withval" in
1749 AC_DEFINE(WITH_AUTOMOUNT)
1758 #################################################
1759 # check for smbmount support
1760 AC_MSG_CHECKING(whether to use SMBMOUNT)
1761 AC_ARG_WITH(smbmount,
1762 [ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1763 [ case "$withval" in
1768 AC_DEFINE(WITH_SMBMOUNT)
1769 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1772 AC_MSG_ERROR(not on a linux system!)
1786 #################################################
1787 # check for a PAM clear-text auth, accounts, password and session support
1788 with_pam_for_crypt=no
1789 AC_MSG_CHECKING(whether to use PAM)
1791 [ --with-pam Include PAM support (default=no)],
1792 [ case "$withval" in
1797 with_pam_for_crypt=yes
1806 # we can't build a pam module if we don't have pam.
1807 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1809 #################################################
1810 # check for pam_smbpass support
1811 AC_MSG_CHECKING(whether to use pam_smbpass)
1812 AC_ARG_WITH(pam_smbpass,
1813 [ --with-pam_smbpass Build a PAM module to allow other applications to use our smbpasswd file (default=no)],
1814 [ case "$withval" in
1818 # Conditions under which pam_smbpass should not be built.
1820 if test x$PICFLAG = x; then
1821 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1823 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1824 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1827 PAM_MOD="bin/pam_smbpass.so"
1838 ###############################################
1839 # test for where we get crypt() from, but only
1841 if test $with_pam_for_crypt = no; then
1842 AC_CHECK_FUNCS(crypt)
1843 if test x"$ac_cv_func_crypt" = x"no"; then
1844 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1845 AC_DEFINE(HAVE_CRYPT)])
1850 ## moved after the check for -lcrypt in order to
1851 ## ensure that the necessary libraries are included
1852 ## check checking for truncated salt. Wrapped by the
1853 ## $with_pam_for_crypt variable as above --jerry
1855 if test $with_pam_for_crypt = no; then
1856 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1857 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1858 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1859 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1860 AC_DEFINE(HAVE_TRUNCATED_SALT)
1866 ########################################################################################
1868 ## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
1870 ########################################################################################
1872 ## set the with_smbpasswd_sam as the default
1873 with_smbpasswd_sam=yes
1876 #################################################
1877 # check for a TDB password database
1878 AC_MSG_CHECKING(whether to use TDB SAM database)
1880 [ --with-tdbsam Include experimental TDB SAM support (default=no)],
1881 [ case "$withval" in
1884 AC_DEFINE(WITH_TDB_SAM)
1885 with_smbpasswd_sam=no
1894 #################################################
1895 # check for a LDAP password database
1896 AC_MSG_CHECKING(whether to use LDAP SAM database)
1897 AC_ARG_WITH(ldapsam,
1898 [ --with-ldapsam Include experimental LDAP SAM support (default=no)],
1899 [ case "$withval" in
1902 AC_DEFINE(WITH_LDAP_SAM)
1903 LIBS="-lldap -llber $LIBS"
1904 with_smbpasswd_sam=no
1913 #################################################
1914 # check for a NISPLUS password database
1915 AC_MSG_CHECKING(whether to use NISPLUS SAM database)
1916 AC_ARG_WITH(nisplussam,
1917 [ --with-nisplussam Include NISPLUS SAM support (default=no)],
1918 [ case "$withval" in
1921 AC_DEFINE(WITH_NISPLUS_SAM)
1922 with_smbpasswd_sam=no
1931 ################################################
1932 # This test should come last because the
1933 # smbpasswd SAM is only used if another format
1934 # has not been defined
1935 AC_MSG_CHECKING(whether to use traditional smbpasswd file)
1936 if test $with_smbpasswd_sam = yes; then
1938 AC_DEFINE(WITH_SMBPASSWD_SAM)
1943 ########################################################################################
1945 ## END OF TESTS FOR SAM BACKENDS.
1947 ########################################################################################
1949 #################################################
1950 # check for a NISPLUS_HOME support
1951 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1952 AC_ARG_WITH(nisplus-home,
1953 [ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
1954 [ case "$withval" in
1957 AC_DEFINE(WITH_NISPLUS_HOME)
1966 #################################################
1967 # check for the secure socket layer
1968 AC_MSG_CHECKING(whether to use SSL)
1970 [ --with-ssl Include SSL support (default=no)
1971 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
1972 --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
1973 [ case "$withval" in
1977 withval="/usr/local/ssl" # default
1979 if test "${with_sslinc+set}" = set; then
1981 withval="$with_sslinc"
1984 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
1985 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1988 CFLAGS="-I${withval} $CFLAGS"
1994 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1998 if test "${with_ssllib+set}" = set; then
2000 withval="$with_ssllib"
2003 echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
2004 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2007 LDFLAGS="-L${withval}/lib $LDFLAGS"
2013 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2017 LIBS="-lssl -lcrypto $LIBS"
2019 # if test ! -d ${withval}; then
2020 # echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
2024 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
2034 #################################################
2035 # check for syslog logging
2036 AC_MSG_CHECKING(whether to use syslog logging)
2038 [ --with-syslog Include experimental SYSLOG support (default=no)],
2039 [ case "$withval" in
2042 AC_DEFINE(WITH_SYSLOG)
2051 #################################################
2052 # check for a shared memory profiling support
2053 AC_MSG_CHECKING(whether to use profiling)
2054 AC_ARG_WITH(profiling-data,
2055 [ --with-profiling-data Include gathering source code profile information (default=no)],
2056 [ case "$withval" in
2059 AC_DEFINE(WITH_PROFILE)
2069 #################################################
2070 # check for experimental disk-quotas support
2071 QUOTAOBJS=smbd/noquotas.o
2073 AC_MSG_CHECKING(whether to support disk-quotas)
2075 [ --with-quotas Include experimental disk-quota support (default=no)],
2076 [ case "$withval" in
2081 # Check for kernel 2.4.x quota braindamage...
2082 AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
2083 AC_TRY_COMPILE([#include <stdio.h>
2084 #include <sys/types.h>
2085 #include <asm/types.h>
2086 #include <linux/quota.h>
2088 #include <linux/unistd.h>],[struct mem_dqblk D;],
2089 samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
2090 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
2091 AC_DEFINE(LINUX_QUOTAS_2)
2093 AC_DEFINE(LINUX_QUOTAS_1)
2099 QUOTAOBJS=smbd/quotas.o
2100 AC_DEFINE(WITH_QUOTAS)
2110 #################################################
2111 # check for experimental utmp accounting
2113 AC_MSG_CHECKING(whether to support utmp accounting)
2115 [ --with-utmp Include experimental utmp accounting (default=no)],
2116 [ case "$withval" in
2119 AC_DEFINE(WITH_UTMP)
2128 #################################################
2129 # set private directory location
2130 AC_ARG_WITH(privatedir,
2131 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
2132 [ case "$withval" in
2135 # Just in case anybody calls it without argument
2137 AC_MSG_WARN([--with-privatedir called without argument - will use default])
2138 privatedir='${prefix}/private'
2141 privatedir="$withval"
2144 AC_SUBST(privatedir)],
2145 [privatedir='${prefix}/private'
2146 AC_SUBST(privatedir)]
2149 #################################################
2150 # set lock directory location
2151 AC_ARG_WITH(lockdir,
2152 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
2153 [ case "$withval" in
2156 # Just in case anybody calls it without argument
2158 AC_MSG_WARN([--with-lockdir called without argument - will use default])
2159 lockdir='$(VARDIR)/locks'
2166 [lockdir='$(VARDIR)/locks'
2170 #################################################
2171 # set SWAT directory location
2172 AC_ARG_WITH(swatdir,
2173 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
2174 [ case "$withval" in
2177 # Just in case anybody does it
2179 AC_MSG_WARN([--with-swatdir called without argument - will use default])
2180 swatdir='${prefix}/swat'
2187 [swatdir='${prefix}/swat'
2191 #################################################
2192 # choose native language(s) of man pages
2193 AC_MSG_CHECKING(chosen man pages' language(s))
2194 AC_ARG_WITH(manpages-langs,
2195 [ --with-manpages-langs={en,ja,pl} Choose man pages' language(s). (en)],
2196 [ case "$withval" in
2198 AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
2206 AC_MSG_RESULT($manlangs)
2207 manlangs=`echo $manlangs | sed "s/,/ /"` # replacing commas with spaces to produce a list
2208 AC_SUBST(manlangs)],
2211 AC_MSG_RESULT($manlangs)
2215 #################################################
2216 # these tests are taken from the GNU fileutils package
2217 AC_CHECKING(how to get filesystem space usage)
2220 # Test for statvfs64.
2221 if test $space = no; then
2223 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
2225 #if defined(HAVE_UNISTD_H)
2228 #include <sys/types.h>
2229 #include <sys/statvfs.h>
2232 struct statvfs64 fsd;
2233 exit (statvfs64 (".", &fsd));
2235 fu_cv_sys_stat_statvfs64=yes,
2236 fu_cv_sys_stat_statvfs64=no,
2237 fu_cv_sys_stat_statvfs64=cross)])
2238 if test $fu_cv_sys_stat_statvfs64 = yes; then
2240 AC_DEFINE(STAT_STATVFS64)
2244 # Perform only the link test since it seems there are no variants of the
2245 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2246 # because that got a false positive on SCO OSR5. Adding the declaration
2247 # of a `struct statvfs' causes this test to fail (as it should) on such
2248 # systems. That system is reported to work fine with STAT_STATFS4 which
2249 # is what it gets when this test fails.
2250 if test $space = no; then
2252 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2253 [AC_TRY_LINK([#include <sys/types.h>
2254 #include <sys/statvfs.h>],
2255 [struct statvfs fsd; statvfs (0, &fsd);],
2256 fu_cv_sys_stat_statvfs=yes,
2257 fu_cv_sys_stat_statvfs=no)])
2258 if test $fu_cv_sys_stat_statvfs = yes; then
2260 AC_DEFINE(STAT_STATVFS)
2264 if test $space = no; then
2265 # DEC Alpha running OSF/1
2266 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2267 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2269 #include <sys/param.h>
2270 #include <sys/types.h>
2271 #include <sys/mount.h>
2276 exit (statfs (".", &fsd, sizeof (struct statfs)));
2278 fu_cv_sys_stat_statfs3_osf1=yes,
2279 fu_cv_sys_stat_statfs3_osf1=no,
2280 fu_cv_sys_stat_statfs3_osf1=no)])
2281 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2282 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2284 AC_DEFINE(STAT_STATFS3_OSF1)
2288 if test $space = no; then
2290 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2291 member (AIX, 4.3BSD)])
2292 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2294 #ifdef HAVE_SYS_PARAM_H
2295 #include <sys/param.h>
2297 #ifdef HAVE_SYS_MOUNT_H
2298 #include <sys/mount.h>
2300 #ifdef HAVE_SYS_VFS_H
2301 #include <sys/vfs.h>
2307 exit (statfs (".", &fsd));
2309 fu_cv_sys_stat_statfs2_bsize=yes,
2310 fu_cv_sys_stat_statfs2_bsize=no,
2311 fu_cv_sys_stat_statfs2_bsize=no)])
2312 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2313 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2315 AC_DEFINE(STAT_STATFS2_BSIZE)
2319 if test $space = no; then
2321 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2322 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2323 [AC_TRY_RUN([#include <sys/types.h>
2324 #include <sys/statfs.h>
2328 exit (statfs (".", &fsd, sizeof fsd, 0));
2330 fu_cv_sys_stat_statfs4=yes,
2331 fu_cv_sys_stat_statfs4=no,
2332 fu_cv_sys_stat_statfs4=no)])
2333 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2334 if test $fu_cv_sys_stat_statfs4 = yes; then
2336 AC_DEFINE(STAT_STATFS4)
2340 if test $space = no; then
2342 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2343 member (4.4BSD and NetBSD)])
2344 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2345 [AC_TRY_RUN([#include <sys/types.h>
2346 #ifdef HAVE_SYS_PARAM_H
2347 #include <sys/param.h>
2349 #ifdef HAVE_SYS_MOUNT_H
2350 #include <sys/mount.h>
2356 exit (statfs (".", &fsd));
2358 fu_cv_sys_stat_statfs2_fsize=yes,
2359 fu_cv_sys_stat_statfs2_fsize=no,
2360 fu_cv_sys_stat_statfs2_fsize=no)])
2361 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2362 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2364 AC_DEFINE(STAT_STATFS2_FSIZE)
2368 if test $space = no; then
2370 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2371 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2372 [AC_TRY_RUN([#include <sys/types.h>
2373 #ifdef HAVE_SYS_PARAM_H
2374 #include <sys/param.h>
2376 #ifdef HAVE_SYS_MOUNT_H
2377 #include <sys/mount.h>
2379 #ifdef HAVE_SYS_FS_TYPES_H
2380 #include <sys/fs_types.h>
2385 /* Ultrix's statfs returns 1 for success,
2386 0 for not mounted, -1 for failure. */
2387 exit (statfs (".", &fsd) != 1);
2389 fu_cv_sys_stat_fs_data=yes,
2390 fu_cv_sys_stat_fs_data=no,
2391 fu_cv_sys_stat_fs_data=no)])
2392 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2393 if test $fu_cv_sys_stat_fs_data = yes; then
2395 AC_DEFINE(STAT_STATFS2_FS_DATA)
2400 # As a gating factor for large file support, in order to
2401 # use <4GB files we must have the following minimal support
2403 # long long, and a 64 bit off_t or off64_t.
2404 # If we don't have all of these then disable large
2407 AC_MSG_CHECKING([if large file support can be enabled])
2409 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2410 #include <sys/types.h>
2416 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2417 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2418 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2420 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
2422 AC_ARG_WITH(spinlocks,
2423 [ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ])
2424 if test "x$with_spinlocks" = "xyes"; then
2425 AC_DEFINE(USE_SPINLOCKS)
2429 AC_DEFINE(SPARC_SPINLOCKS)
2432 i386|i486|i586|i686)
2433 AC_DEFINE(INTEL_SPINLOCKS)
2437 AC_DEFINE(MIPS_SPINLOCKS)
2441 AC_DEFINE(POWERPC_SPINLOCKS)
2446 #################################################
2447 # check for ACL support
2449 AC_MSG_CHECKING(whether to support ACLs)
2450 AC_ARG_WITH(acl-support,
2451 [ --with-acl-support Include ACL support (default=no)],
2452 [ case "$withval" in
2457 AC_MSG_RESULT(Using UnixWare ACLs)
2458 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2461 AC_MSG_RESULT(Using solaris ACLs)
2462 AC_DEFINE(HAVE_SOLARIS_ACLS)
2465 AC_MSG_RESULT(Using HPUX ACLs)
2466 AC_DEFINE(HAVE_HPUX_ACLS)
2469 AC_MSG_RESULT(Using IRIX ACLs)
2470 AC_DEFINE(HAVE_IRIX_ACLS)
2473 AC_MSG_RESULT(Using AIX ACLs)
2474 AC_DEFINE(HAVE_AIX_ACLS)
2477 AC_MSG_RESULT(Using Tru64 ACLs)
2478 AC_DEFINE(HAVE_TRU64_ACLS)
2482 AC_CHECK_LIB(acl,acl_get_file)
2483 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2484 AC_TRY_LINK([#include <sys/types.h>
2485 #include <sys/acl.h>],
2486 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2487 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2488 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2489 AC_MSG_RESULT(Using posix ACLs)
2490 AC_DEFINE(HAVE_POSIX_ACLS)
2491 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2492 AC_TRY_LINK([#include <sys/types.h>
2493 #include <sys/acl.h>],
2494 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2495 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2496 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2497 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2505 AC_DEFINE(HAVE_NO_ACLS)
2508 AC_DEFINE(HAVE_NO_ACLS)
2512 #################################################
2513 # Check whether winbind is supported on this platform. If so we need to
2514 # build and install client programs (WINBIND_TARGETS), sbin programs
2515 # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2517 AC_MSG_CHECKING(whether to build winbind)
2519 # Initially, the value of $host_os decides whether winbind is supported
2522 *linux*|*solaris*|*irix*)
2527 winbind_no_reason=", unsupported on $host_os"
2531 # Check the setting of --with-winbindd
2533 AC_ARG_WITH(winbind,
2534 [ --with-winbind Build winbind (default, if supported by OS)],
2547 # We need unix domain sockets for winbind
2549 if test x"$HAVE_WINBIND" = x"yes"; then
2550 if test x"$samba_cv_unixsocket" = x"no"; then
2551 winbind_no_reason=", no unix domain socket support on $host_os"
2556 # Display test results
2562 WINBIND_PAM_PROGS=""
2564 if test x"$HAVE_WINBIND" = x"yes"; then
2567 WINBIND_TARGETS="bin/wbinfo"
2568 WINBIND_STARGETS="bin/winbindd"
2569 if test x"$BLDSHARED" = x"true"; then
2570 WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
2571 if test x"$with_pam" = x"yes"; then
2572 WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2576 AC_MSG_RESULT(no$winbind_no_reason)
2579 # Substitution time!
2581 AC_SUBST(WINBIND_TARGETS)
2582 AC_SUBST(WINBIND_STARGETS)
2583 AC_SUBST(WINBIND_LTARGETS)
2584 AC_SUBST(WINBIND_PAM_TARGETS)
2586 #################################################
2587 # Check to see if we should use the included popt
2589 AC_ARG_WITH(included-popt,
2590 [ --with-included-popt use bundled popt library, not from system],
2601 if test x"$INCLUDED_POPT" != x"yes"; then
2602 AC_CHECK_LIB(popt, poptGetContext,
2603 INCLUDED_POPT=no, INCLUDED_POPT=yes)
2606 AC_MSG_CHECKING(whether to use included popt)
2607 if test x"$INCLUDED_POPT" = x"yes"; then
2608 AC_MSG_RESULT($srcdir/popt)
2609 BUILD_POPT='$(POPT_OBJS)'
2610 FLAGS1="-I$srcdir/popt"
2615 AC_SUBST(BUILD_POPT)
2618 #################################################
2619 # final configure stuff
2621 echo "checking configure summary"
2622 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2623 echo "configure OK";,
2624 AC_MSG_ERROR([summary failure. Aborting config]),:)
2629 AC_OUTPUT(include/stamp-h Makefile)
2631 #################################################
2632 # Print very concise instructions on building/use
2633 if test "x$enable_dmalloc" = xyes
2635 AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
2636 AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])