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(krb5developer, [ --enable-krb5developer turn on developer warnings and debugging, except -Wstrict-prototypes [default=no]],
37 [if eval "test x$enable_krb5developer = xyes"; then
38 CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
41 AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable heap debugging [default=no]])
43 if test "x$enable_dmalloc" = xyes
45 AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
46 AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
47 [Define to check invariants around some common functions])
48 LIBS="$LIBS -ldmalloc"
51 dnl Checks for programs.
56 dnl needed before AC_TRY_COMPILE
59 dnl Check if C compiler understands -c and -o at the same time
61 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
68 dnl Check if the C compiler understands volatile (it should, being ANSI).
69 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
70 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
71 samba_cv_volatile=yes,samba_cv_volatile=no)])
72 if test x"$samba_cv_volatile" = x"yes"; then
73 AC_DEFINE(HAVE_VOLATILE)
79 dnl Add #include for broken IRIX header files
81 *irix6*) AC_ADD_INCLUDE(<standards.h>)
85 AC_VALIDATE_CACHE_SYSTEM_TYPE
88 # Config CPPFLAG settings for strange OS's that must be set
92 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
95 # mmap on HPUX is completely broken...
96 AC_DEFINE(MMAP_BLACKLIST)
97 if test $ac_cv_prog_cc_Ae = yes; then
98 CPPFLAGS="$CPPFLAGS -Ae"
101 # Defines needed for HPUX support.
102 # HPUX has bigcrypt but (sometimes?) doesn't use it for
103 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
107 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
108 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
111 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
112 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
118 # CRAY Unicos has broken const handling
120 AC_MSG_RESULT([disabling const])
121 CPPFLAGS="$CPPFLAGS -Dconst="
125 # AIX4.x doesn't even admit to having large
126 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
129 AC_MSG_RESULT([enabling large file support])
130 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
133 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
134 # to the existance of large files..
135 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
136 # recommendations on large file support, however it makes the
137 # compile work using gcc 2.7 and 2.8, whereas using the Sun
138 # recommendation makes the compile fail on gcc2.7. JRA.
142 5.0*|5.1*|5.2*|5.3*|5.5*)
143 AC_MSG_RESULT([no large file support])
146 AC_MSG_RESULT([enabling large file support])
147 if test "$ac_cv_prog_gcc" = yes; then
148 ${CC-cc} -v >conftest.c 2>&1
149 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
151 case "$ac_cv_gcc_compiler_version_number" in
152 *"gcc version 2.6"*|*"gcc version 2.7"*)
153 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
156 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
160 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
166 # Tests needed for SINIX large file support.
169 if test $host = mips-sni-sysv4 ; then
170 AC_MSG_CHECKING([for LFS support])
171 old_CPPFLAGS="$CPPFLAGS"
172 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
176 #if _LFS64_LARGEFILE == 1
181 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
182 CPPFLAGS="$old_CPPFLAGS"
183 if test x$SINIX_LFS_SUPPORT = xyes ; then
184 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
185 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
186 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
187 LIBS="`getconf LFS64_LIBS` $LIBS"
189 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
193 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
196 AC_MSG_CHECKING([for LFS support])
197 old_CPPFLAGS="$CPPFLAGS"
198 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
201 #include <sys/utsname.h>
203 #if _LFS64_LARGEFILE == 1
208 /* Ensure this is glibc 2.2 or higher */
209 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
210 int libc_major = __GLIBC__;
211 int libc_minor = __GLIBC_MINOR__;
219 /* Ensure this is kernel 2.4 or higher */
222 release = uts.release;
223 major = atoi(strsep(&release, "."));
224 minor = atoi(strsep(&release, "."));
226 if (major > 2 || (major == 2 && minor > 3))
233 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
234 CPPFLAGS="$old_CPPFLAGS"
235 if test x$LINUX_LFS_SUPPORT = xyes ; then
236 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
238 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
242 AC_MSG_CHECKING([for LFS support])
243 old_CPPFLAGS="$CPPFLAGS"
244 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
248 #if _LFS64_LARGEFILE == 1
253 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
254 CPPFLAGS="$old_CPPFLAGS"
255 if test x$GLIBC_LFS_SUPPORT = xyes ; then
256 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
258 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
268 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
269 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
270 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
271 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
272 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
273 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
274 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
275 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h lber.h)
278 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
279 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
283 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
284 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
285 if test x"$ac_cv_header_shadow_h" = x"yes"; then
286 AC_DEFINE(HAVE_SHADOW_H)
290 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
291 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
292 AC_CHECK_HEADERS(stropts.h poll.h)
293 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
294 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
296 # For experimental utmp support (lastlog on some BSD-like systems)
297 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
299 # For quotas on Veritas VxFS filesystems
300 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
302 # For quotas on Linux XFS filesystems
303 AC_CHECK_HEADERS(linux/xqm.h)
305 AC_CHECK_SIZEOF(int,cross)
306 AC_CHECK_SIZEOF(long,cross)
307 AC_CHECK_SIZEOF(short,cross)
322 AC_CHECK_TYPE(ino_t,unsigned)
323 AC_CHECK_TYPE(loff_t,off_t)
324 AC_CHECK_TYPE(offset_t,loff_t)
325 AC_CHECK_TYPE(ssize_t, int)
326 AC_CHECK_TYPE(wchar_t, unsigned short)
328 ############################################
329 # for cups support we need libcups, and a handful of header files
331 AC_CHECK_LIB(cups,httpConnect)
333 # I wonder if there is a nicer way of doing this?
335 if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
336 AC_CHECK_HEADERS(cups/cups.h cups/language.h)
337 if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
338 if test x"$ac_cv_header_cups_language_h" = x"yes"; then
344 ############################################
345 # we need libdl for PAM and the new VFS code
346 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
347 AC_DEFINE(HAVE_LIBDL)])
349 ############################################
350 # check if the compiler can do immediate structures
351 AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
355 #define X_FOOBAR(x) ((FOOBAR) { x })
356 typedef struct {unsigned x;} FOOBAR;
357 FOOBAR f = X_FOOBAR(1);
359 samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
360 if test x"$samba_cv_immediate_structures" = x"yes"; then
361 AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES)
364 ############################################
365 # check for unix domain sockets
366 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
368 #include <sys/types.h>
371 #include <sys/socket.h>
372 #include <sys/un.h>],
374 struct sockaddr_un sunaddr;
375 sunaddr.sun_family = AF_UNIX;
377 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
378 if test x"$samba_cv_unixsocket" = x"yes"; then
379 AC_DEFINE(HAVE_UNIXSOCKET)
383 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
385 #include <sys/types.h>
390 #include <sys/socket.h>],[socklen_t i = 0],
391 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
392 if test x"$samba_cv_socklen_t" = x"yes"; then
393 AC_DEFINE(HAVE_SOCKLEN_T_TYPE)
396 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
398 #include <sys/types.h>
403 #include <signal.h>],[sig_atomic_t i = 0],
404 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
405 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
406 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
409 # stupid headers have the functions but no declaration. grrrr.
410 AC_HAVE_DECL(errno, [#include <errno.h>])
411 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
412 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
413 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
414 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
415 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
416 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
418 # and glibc has setresuid under linux but the function does
419 # nothing until kernel 2.1.44! very dumb.
420 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
421 AC_TRY_RUN([#include <errno.h>
422 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
423 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
424 if test x"$samba_cv_have_setresuid" = x"yes"; then
425 AC_DEFINE(HAVE_SETRESUID)
428 # Do the same check for setresguid...
430 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
431 AC_TRY_RUN([#include <unistd.h>
433 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
434 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
435 if test x"$samba_cv_have_setresgid" = x"yes"; then
436 AC_DEFINE(HAVE_SETRESGID)
441 ###############################################
442 # test for where we get crypt() from
443 AC_CHECK_FUNCS(crypt)
444 if test x"$ac_cv_func_crypt" = x"no"; then
445 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
446 AC_DEFINE(HAVE_CRYPT)])
450 ###############################################
451 # Readline included by default unless explicitly asked not to
452 test "${with_readline+set}" != "set" && with_readline=yes
454 # test for where we get readline() from
455 AC_MSG_CHECKING(whether to use readline)
456 AC_ARG_WITH(readline,
457 [ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto) ],
458 [ case "$with_readline" in
462 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
463 AC_CHECK_HEADERS(readline/history.h)
465 AC_CHECK_HEADERS(readline.h readline/readline.h,[
466 for termlib in ncurses curses termcap terminfo termlib; do
467 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
469 AC_CHECK_LIB(readline, rl_callback_handler_install,
470 [TERMLIBS="-lreadline $TERMLIBS"
471 AC_DEFINE(HAVE_LIBREADLINE)
472 break], [TERMLIBS=], $TERMLIBS)])
480 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
481 # alternate readline path
483 _cppflags=${CPPFLAGS}
485 # Add additional search path
486 LDFLAGS="-L$with_readline/lib $LDFLAGS"
487 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
489 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
490 AC_CHECK_HEADERS(readline/history.h)
492 AC_CHECK_HEADERS(readline.h readline/readline.h,[
493 for termlib in ncurses curses termcap terminfo termlib; do
494 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
496 AC_CHECK_LIB(readline, rl_callback_handler_install,
497 [TERMLDFLAGS="-L$with_readline/lib"
498 TERMCPPFLAGS="-I$with_readline/include"
499 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
500 TERMLIBS="-lreadline $TERMLIBS"
501 AC_DEFINE(HAVE_LIBREADLINE)
502 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
510 AC_SUBST(TERMLDFLAGS)
512 # The readline API changed slightly from readline3 to readline4, so
513 # code will generate warnings on one of them unless we have a few
515 AC_CHECK_LIB(readline, rl_completion_matches,
516 [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
517 [Do we have rl_completion_matches?])],
521 # The following test taken from the cvs sources
522 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
523 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
524 # libsocket.so which has a bad implementation of gethostbyname (it
525 # only looks in /etc/hosts), so we only look for -lsocket if we need
527 AC_CHECK_FUNCS(connect)
528 if test x"$ac_cv_func_connect" = x"no"; then
531 *) AC_CHECK_LIB(nsl_s, printf) ;;
535 *) AC_CHECK_LIB(nsl, printf) ;;
539 *) AC_CHECK_LIB(socket, connect) ;;
543 *) AC_CHECK_LIB(inet, connect) ;;
545 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
547 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
548 test x"$ac_cv_lib_inet_connect" = x"yes"; then
549 # ac_cv_func_connect=yes
550 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
551 AC_DEFINE(HAVE_CONNECT)
555 ###############################################
556 # test for where we get get_yp_default_domain() from
557 AC_CHECK_FUNCS(yp_get_default_domain)
558 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
559 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
560 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
563 # Check if we have execl, if not we need to compile smbrun.
564 AC_CHECK_FUNCS(execl)
565 if test x"$ac_cv_func_execl" = x"no"; then
571 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
572 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
573 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
574 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
575 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
576 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
577 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
578 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
579 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
580 AC_CHECK_FUNCS(syslog vsyslog)
581 # setbuffer is needed for smbtorture
582 AC_CHECK_FUNCS(setbuffer)
584 # syscall() is needed for smbwrapper.
585 AC_CHECK_FUNCS(syscall)
587 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
588 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
589 AC_CHECK_FUNCS(__getcwd _getcwd)
590 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
591 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
592 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
593 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
594 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
595 AC_CHECK_FUNCS(_write __write _fork __fork)
596 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
597 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
598 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
599 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
600 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
603 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
606 if test x$ac_cv_func_stat64 = xno ; then
607 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
609 #if defined(HAVE_UNISTD_H)
612 #include <sys/stat.h>
613 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
614 AC_MSG_RESULT([$ac_cv_func_stat64])
615 if test x$ac_cv_func_stat64 = xyes ; then
616 AC_DEFINE(HAVE_STAT64)
620 if test x$ac_cv_func_lstat64 = xno ; then
621 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
623 #if defined(HAVE_UNISTD_H)
626 #include <sys/stat.h>
627 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
628 AC_MSG_RESULT([$ac_cv_func_lstat64])
629 if test x$ac_cv_func_lstat64 = xyes ; then
630 AC_DEFINE(HAVE_LSTAT64)
634 if test x$ac_cv_func_fstat64 = xno ; then
635 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
637 #if defined(HAVE_UNISTD_H)
640 #include <sys/stat.h>
641 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
642 AC_MSG_RESULT([$ac_cv_func_fstat64])
643 if test x$ac_cv_func_fstat64 = xyes ; then
644 AC_DEFINE(HAVE_FSTAT64)
648 #####################################
649 # we might need the resolv library on some systems
650 AC_CHECK_LIB(resolv, dn_expand)
653 # Check for the functions putprpwnam, set_auth_parameters,
654 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
655 # Needed for OSF1 and HPUX.
658 AC_LIBTESTFUNC(security, putprpwnam)
659 AC_LIBTESTFUNC(sec, putprpwnam)
661 AC_LIBTESTFUNC(security, set_auth_parameters)
662 AC_LIBTESTFUNC(sec, set_auth_parameters)
664 # UnixWare 7.x has its getspnam in -lgen
665 AC_LIBTESTFUNC(gen, getspnam)
667 AC_LIBTESTFUNC(security, getspnam)
668 AC_LIBTESTFUNC(sec, getspnam)
670 AC_LIBTESTFUNC(security, bigcrypt)
671 AC_LIBTESTFUNC(sec, bigcrypt)
673 AC_LIBTESTFUNC(security, getprpwnam)
674 AC_LIBTESTFUNC(sec, getprpwnam)
676 # this bit needs to be modified for each OS that is suported by
677 # smbwrapper. You need to specify how to created a shared library and
678 # how to compile C code to produce PIC object files
680 # these are the defaults, good for lots of systems
688 # Assume non-shared by default and override below
690 AC_MSG_CHECKING([ability to build shared libraries])
692 # and these are for particular systems
694 *linux*) AC_DEFINE(LINUX)
698 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
700 *solaris*) AC_DEFINE(SUNOS5)
702 LDSHFLAGS="-h \$@ -G"
703 if test "${ac_cv_prog_CC}" = "gcc"; then
710 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
712 *sunos*) AC_DEFINE(SUNOS4)
714 LDSHFLAGS="-Wl,-h,\$@ -G"
715 PICFLAG="-KPIC" # Is this correct for SunOS
717 *bsd*) BLDSHARED="true"
718 LDSHFLAGS="-Wl,-soname,\$@ -shared"
720 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
722 *irix*) AC_DEFINE(IRIX)
724 *irix6*) AC_DEFINE(IRIX6)
727 ATTEMPT_WRAP32_BUILD=yes
729 LDSHFLAGS="-soname \$@ -shared"
731 if test "${ac_cv_prog_CC}" = "gcc"; then
736 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
738 *aix*) AC_DEFINE(AIX)
740 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
741 PICFLAG="-O2 -qmaxmem=6000"
742 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
744 *hpux*) AC_DEFINE(HPUX)
746 # Use special PIC flags for the native HP-UX compiler.
747 if test $ac_cv_prog_cc_Ae = yes; then
749 LDSHFLAGS="-b -z +h \$@"
752 AC_DEFINE(STAT_ST_BLOCKSIZE,8192)
754 *qnx*) AC_DEFINE(QNX);;
755 *osf*) AC_DEFINE(OSF1)
757 LDSHFLAGS="-Wl,-soname,\$@ -shared"
760 *sco*) AC_DEFINE(SCO);;
761 *unixware*) AC_DEFINE(UNIXWARE)
763 LDSHFLAGS="-Wl,-soname,\$@ -shared"
766 *next2*) AC_DEFINE(NEXT2);;
767 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
770 *-univel-*) if [ test "$GCC" != yes ]; then
771 AC_DEFINE(HAVE_MEMSET)
775 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
779 if [ test "$GCC" != yes ]; then
780 AC_DEFINE(HAVE_MEMSET)
785 AC_MSG_RESULT($BLDSHARED)
786 AC_MSG_CHECKING([linker flags for shared libraries])
787 AC_MSG_RESULT([$LDSHFLAGS])
788 AC_MSG_CHECKING([compiler flags for position-independent code])
789 AC_MSG_RESULT([$PICFLAGS])
791 #######################################################
792 # test whether building a shared library actually works
793 if test $BLDSHARED = true; then
794 AC_CACHE_CHECK([whether building shared libraries actually works],
795 [ac_cv_shlib_works],[
797 # try building a trivial shared library
798 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
799 $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
800 ac_cv_shlib_works=yes
801 rm -f shlib.so shlib.po
803 if test $ac_cv_shlib_works = no; then
809 # this updates our target list if we can build shared libs
810 if test $BLDSHARED = true; then
811 LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
818 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
819 AC_TRY_RUN([#include <stdio.h>
820 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
821 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
822 if test x"$samba_cv_have_longlong" = x"yes"; then
823 AC_DEFINE(HAVE_LONGLONG)
827 # Check if the compiler supports the LL prefix on long long integers.
830 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
831 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
832 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
833 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
834 AC_DEFINE(COMPILER_SUPPORTS_LL)
838 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
839 AC_TRY_RUN([#include <stdio.h>
840 #include <sys/stat.h>
841 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
842 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
843 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
844 AC_DEFINE(SIZEOF_OFF_T,8)
847 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
849 #if defined(HAVE_UNISTD_H)
853 #include <sys/stat.h>
854 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
855 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
856 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
857 AC_DEFINE(HAVE_OFF64_T)
860 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
861 AC_TRY_RUN([#include <stdio.h>
862 #include <sys/stat.h>
863 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
864 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
865 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
866 AC_DEFINE(SIZEOF_INO_T,8)
869 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
871 #if defined(HAVE_UNISTD_H)
875 #include <sys/stat.h>
876 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
877 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
878 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
879 AC_DEFINE(HAVE_INO64_T)
882 AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
884 #if defined(HAVE_UNISTD_H)
888 #include <sys/stat.h>
889 main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
890 samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
891 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
892 AC_DEFINE(HAVE_DEV64_T)
895 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
897 #if defined(HAVE_UNISTD_H)
900 #include <sys/types.h>
901 #include <dirent.h>],
902 [struct dirent64 de;],
903 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
904 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
905 AC_DEFINE(HAVE_STRUCT_DIRENT64)
908 AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
910 #if defined(HAVE_UNISTD_H)
913 #include <sys/types.h>
914 main() { dev_t dev; int i = major(dev); return 0; }],
915 samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
916 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
917 AC_DEFINE(HAVE_DEVICE_MAJOR_FN)
920 AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
922 #if defined(HAVE_UNISTD_H)
925 #include <sys/types.h>
926 main() { dev_t dev; int i = minor(dev); return 0; }],
927 samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
928 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
929 AC_DEFINE(HAVE_DEVICE_MINOR_FN)
932 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
933 AC_TRY_RUN([#include <stdio.h>
934 main() { char c; c=250; exit((c > 0)?0:1); }],
935 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
936 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
937 AC_DEFINE(HAVE_UNSIGNED_CHAR)
940 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
941 AC_TRY_COMPILE([#include <sys/types.h>
942 #include <sys/socket.h>
943 #include <netinet/in.h>],
944 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
945 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
946 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
947 AC_DEFINE(HAVE_SOCK_SIN_LEN)
950 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
951 AC_TRY_COMPILE([#include <sys/types.h>
953 void seekdir(DIR *d, long loc) { return; }],[return 0;],
954 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
955 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
956 AC_DEFINE(SEEKDIR_RETURNS_VOID)
959 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
960 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
961 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
962 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
963 AC_DEFINE(HAVE_FILE_MACRO)
966 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
967 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
968 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
969 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
970 AC_DEFINE(HAVE_FUNCTION_MACRO)
973 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
975 #include <sys/time.h>
977 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
978 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
979 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
980 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
983 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
985 #include <sys/types.h>
987 void foo(const char *format, ...) {
992 va_start(ap, format);
993 len = vsnprintf(0, 0, format, ap);
995 if (len != 5) exit(1);
997 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1001 main() { foo("hello"); }
1003 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
1004 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1005 AC_DEFINE(HAVE_C99_VSNPRINTF)
1008 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1009 AC_TRY_RUN([#include <sys/types.h>
1011 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1012 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1013 di->d_name[0] == 0) exit(0); exit(1);} ],
1014 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
1015 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1016 AC_DEFINE(HAVE_BROKEN_READDIR)
1019 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1020 AC_TRY_COMPILE([#include <sys/types.h>
1021 #include <utime.h>],
1022 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1023 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
1024 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
1025 AC_DEFINE(HAVE_UTIMBUF)
1028 dnl utmp and utmpx come in many flavours
1029 dnl We need to check for many of them
1030 dnl But we don't need to do each and every one, because our code uses
1031 dnl mostly just the utmp (not utmpx) fields.
1033 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
1035 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
1036 AC_TRY_COMPILE([#include <sys/types.h>
1038 [struct utmp ut; ut.ut_name[0] = 'a';],
1039 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
1040 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
1041 AC_DEFINE(HAVE_UT_UT_NAME)
1044 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
1045 AC_TRY_COMPILE([#include <sys/types.h>
1047 [struct utmp ut; ut.ut_user[0] = 'a';],
1048 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
1049 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
1050 AC_DEFINE(HAVE_UT_UT_USER)
1053 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
1054 AC_TRY_COMPILE([#include <sys/types.h>
1056 [struct utmp ut; ut.ut_id[0] = 'a';],
1057 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
1058 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
1059 AC_DEFINE(HAVE_UT_UT_ID)
1062 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
1063 AC_TRY_COMPILE([#include <sys/types.h>
1065 [struct utmp ut; ut.ut_host[0] = 'a';],
1066 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
1067 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
1068 AC_DEFINE(HAVE_UT_UT_HOST)
1071 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
1072 AC_TRY_COMPILE([#include <sys/types.h>
1074 [struct utmp ut; time_t t; ut.ut_time = t;],
1075 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
1076 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
1077 AC_DEFINE(HAVE_UT_UT_TIME)
1080 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
1081 AC_TRY_COMPILE([#include <sys/types.h>
1083 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
1084 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
1085 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
1086 AC_DEFINE(HAVE_UT_UT_TV)
1089 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
1090 AC_TRY_COMPILE([#include <sys/types.h>
1092 [struct utmp ut; ut.ut_type = 0;],
1093 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
1094 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
1095 AC_DEFINE(HAVE_UT_UT_TYPE)
1098 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
1099 AC_TRY_COMPILE([#include <sys/types.h>
1101 [struct utmp ut; ut.ut_pid = 0;],
1102 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
1103 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
1104 AC_DEFINE(HAVE_UT_UT_PID)
1107 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1108 AC_TRY_COMPILE([#include <sys/types.h>
1110 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1111 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1112 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1113 AC_DEFINE(HAVE_UT_UT_EXIT)
1116 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1117 AC_TRY_COMPILE([#include <sys/types.h>
1119 [struct utmp ut; ut.ut_addr = 0;],
1120 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1121 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1122 AC_DEFINE(HAVE_UT_UT_ADDR)
1125 if test x$ac_cv_func_pututline = xyes ; then
1126 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1127 AC_TRY_COMPILE([#include <sys/types.h>
1129 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1130 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1131 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1132 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1136 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1137 AC_TRY_COMPILE([#include <sys/types.h>
1138 #include <utmpx.h>],
1139 [struct utmpx ux; ux.ut_syslen = 0;],
1140 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1141 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1142 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1146 #################################################
1147 # check for libiconv support
1148 AC_MSG_CHECKING(whether to use libiconv)
1149 AC_ARG_WITH(libiconv,
1150 [ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
1151 [ case "$withval" in
1157 CFLAGS="$CFLAGS -I$withval/include"
1158 LDFLAGS="$LDFLAGS -L$withval/lib"
1159 AC_CHECK_LIB(iconv, iconv_open)
1160 AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}")
1168 # check for iconv in libc
1169 AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
1173 iconv_t cd = iconv_open("ASCII", "UCS-2LE");
1174 if (cd == 0 || cd == (iconv_t)-1) return -1;
1178 samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)])
1179 if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
1180 AC_DEFINE(HAVE_NATIVE_ICONV)
1184 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1186 #include <sys/types.h>
1189 #define F_GETLEASE 1025
1192 int fd = open("/dev/null", O_RDONLY);
1193 return fcntl(fd, F_GETLEASE, 0) == -1;
1196 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1197 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1198 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1201 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1203 #include <sys/types.h>
1207 #define F_NOTIFY 1026
1210 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1213 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1214 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1215 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1218 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1220 #include <sys/types.h>
1223 #include <sys/file.h>
1225 #define LOCK_MAND 32
1226 #define LOCK_READ 64
1229 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1232 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1233 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1234 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1240 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1241 AC_TRY_COMPILE([#include <sys/types.h>
1242 #include <fcntl.h>],
1243 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1244 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1245 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1246 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1249 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1250 AC_TRY_RUN([#include <sys/types.h>
1251 #include <sys/capability.h>
1254 if ((cap = cap_get_proc()) == NULL)
1256 cap->cap_effective |= CAP_NETWORK_MGT;
1257 cap->cap_inheritable |= CAP_NETWORK_MGT;
1262 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1263 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1264 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1268 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1269 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1272 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1273 AC_TRY_COMPILE([#include <sys/types.h>
1274 #if defined(HAVE_RPC_RPC_H)
1275 #include <rpc/rpc.h>
1278 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1279 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1280 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1283 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1284 AC_TRY_COMPILE([#include <sys/types.h>
1285 #if defined(HAVE_RPC_RPC_H)
1286 #include <rpc/rpc.h>
1289 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1290 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1291 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1294 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1295 AC_TRY_COMPILE([#include <sys/types.h>
1296 #if defined(HAVE_RPC_RPC_H)
1297 #include <rpc/rpc.h>
1300 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1301 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1302 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1305 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1306 AC_TRY_COMPILE([#include <sys/types.h>
1307 #if defined(HAVE_RPC_RPC_H)
1308 #include <rpc/rpc.h>
1311 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1312 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1313 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1317 dnl Some systems (SCO) have a problem including
1318 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1319 dnl as a #define in <prot.h> and as part of an enum
1323 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1324 AC_TRY_COMPILE([#include <sys/types.h>
1325 #ifdef HAVE_SYS_SECURITY_H
1326 #include <sys/security.h>
1328 #endif /* HAVE_SYS_SECURITY_H */
1329 #if defined(HAVE_RPC_RPC_H)
1330 #include <rpc/rpc.h>
1333 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1334 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1335 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1338 AC_MSG_CHECKING([for test routines])
1339 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1341 AC_MSG_ERROR([cant find test code. Aborting config]),
1342 AC_MSG_WARN([cannot run when cross-compiling]))
1344 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1345 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1346 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1347 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1348 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1351 AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
1352 AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
1353 samba_cv_HAVE_WORKING_AF_LOCAL=yes,
1354 samba_cv_HAVE_WORKING_AF_LOCAL=no,
1355 samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
1356 if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
1358 AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
1361 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1362 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1363 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1364 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1365 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1368 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1369 SAVE_CPPFLAGS="$CPPFLAGS"
1370 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1372 #define REPLACE_GETPASS 1
1373 #define NO_CONFIG_H 1
1374 #define main dont_declare_main
1375 #include "${srcdir-.}/lib/getsmbpass.c"
1377 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1378 CPPFLAGS="$SAVE_CPPFLAGS"
1380 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1381 AC_DEFINE(REPLACE_GETPASS)
1384 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1387 #include <sys/types.h>
1388 #include <netinet/in.h>
1389 #ifdef HAVE_ARPA_INET_H
1390 #include <arpa/inet.h>
1392 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1393 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1394 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1396 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1397 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1398 AC_DEFINE(REPLACE_INET_NTOA)
1401 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1402 AC_TRY_RUN([#include <stdlib.h>
1403 #include <sys/types.h>
1404 #include <sys/stat.h>
1408 char tpl[20]="/tmp/test.XXXXXX";
1409 int fd = mkstemp(tpl);
1410 if (fd == -1) exit(1);
1412 if (fstat(fd, &st) != 0) exit(1);
1413 if ((st.st_mode & 0777) != 0600) exit(1);
1416 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1417 samba_cv_HAVE_SECURE_MKSTEMP=no,
1418 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1419 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1420 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1423 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1424 AC_TRY_RUN([#include <unistd.h>
1425 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1426 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1427 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1428 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1431 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1432 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1433 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1434 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1435 AC_DEFINE(HAVE_ROOT)
1437 AC_MSG_WARN(running as non-root will disable some tests)
1441 # look for a method of finding the list of network interfaces
1443 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1445 #define HAVE_IFACE_AIX 1
1446 #define AUTOCONF_TEST 1
1447 #include "confdefs.h"
1448 #include "${srcdir-.}/lib/interfaces.c"],
1449 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1450 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1451 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1454 if test $iface = no; then
1455 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1457 #define HAVE_IFACE_IFCONF 1
1458 #define AUTOCONF_TEST 1
1459 #include "confdefs.h"
1460 #include "${srcdir-.}/lib/interfaces.c"],
1461 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1462 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1463 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1467 if test $iface = no; then
1468 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1470 #define HAVE_IFACE_IFREQ 1
1471 #define AUTOCONF_TEST 1
1472 #include "confdefs.h"
1473 #include "${srcdir-.}/lib/interfaces.c"],
1474 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1475 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1476 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1481 ################################################
1482 # look for a method of setting the effective uid
1484 if test $seteuid = no; then
1485 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1487 #define AUTOCONF_TEST 1
1488 #define USE_SETRESUID 1
1489 #include "confdefs.h"
1490 #include "${srcdir-.}/lib/util_sec.c"],
1491 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1492 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1493 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1498 if test $seteuid = no; then
1499 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1501 #define AUTOCONF_TEST 1
1502 #define USE_SETREUID 1
1503 #include "confdefs.h"
1504 #include "${srcdir-.}/lib/util_sec.c"],
1505 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1506 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1507 seteuid=yes;AC_DEFINE(USE_SETREUID)
1511 if test $seteuid = no; then
1512 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1514 #define AUTOCONF_TEST 1
1515 #define USE_SETEUID 1
1516 #include "confdefs.h"
1517 #include "${srcdir-.}/lib/util_sec.c"],
1518 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1519 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1520 seteuid=yes;AC_DEFINE(USE_SETEUID)
1524 if test $seteuid = no; then
1525 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1527 #define AUTOCONF_TEST 1
1528 #define USE_SETUIDX 1
1529 #include "confdefs.h"
1530 #include "${srcdir-.}/lib/util_sec.c"],
1531 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1532 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1533 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1538 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1539 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1540 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1541 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1542 AC_DEFINE(HAVE_MMAP)
1545 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1546 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1547 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1548 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1549 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1552 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1553 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1554 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1555 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1556 AC_DEFINE(HAVE_FCNTL_LOCK)
1559 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1560 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1561 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1562 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1563 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1568 dnl Don't check for 64 bit fcntl locking if we know that the
1569 dnl glibc2.1 broken check has succeeded.
1572 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1574 #if defined(HAVE_UNISTD_H)
1584 #ifdef HAVE_SYS_FCNTL_H
1585 #include <sys/fcntl.h>
1587 main() { struct flock64 fl64;
1588 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1594 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1596 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1597 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1601 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1602 AC_TRY_COMPILE([#include <sys/types.h>
1603 #include <sys/stat.h>
1604 #include <unistd.h>],
1605 [struct stat st; st.st_blocks = 0;],
1606 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1607 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1608 AC_DEFINE(HAVE_STAT_ST_BLOCKS)
1613 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1615 #ifdef HAVE_SYS_VFS_H
1616 #include <sys/vfs.h>
1618 #ifdef HAVE_SYS_CAPABILITY_H
1619 #include <sys/capability.h>
1622 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1623 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1624 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS)
1629 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1630 AC_TRY_COMPILE([#include <sys/acl.h>
1631 #if defined(HAVE_RPCSVC_NIS_H)
1632 #include <rpcsvc/nis.h>
1635 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1636 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1637 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1641 #################################################
1642 # check for smbwrapper support
1643 AC_MSG_CHECKING(whether to use smbwrapper)
1644 AC_ARG_WITH(smbwrapper,
1645 [ --with-smbwrapper Include SMB wrapper support (default=no) ],
1646 [ case "$withval" in
1649 AC_DEFINE(WITH_SMBWRAPPER)
1650 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1652 if test x$ATTEMPT_WRAP32_BUILD = x; then
1655 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1658 # Conditions under which smbwrapper should not be built.
1660 if test x$PICFLAG = x; then
1661 echo No support for PIC code - disabling smbwrapper and smbsh
1664 elif test x$ac_cv_func_syscall = xno; then
1665 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1677 #################################################
1678 # check for AFS clear-text auth support
1679 AC_MSG_CHECKING(whether to use AFS clear-text auth)
1681 [ --with-afs Include AFS clear-text auth support (default=no) ],
1682 [ case "$withval" in
1695 #################################################
1696 # check for the DFS clear-text auth system
1697 AC_MSG_CHECKING(whether to use DFS clear-text auth)
1699 [ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)],
1700 [ case "$withval" in
1713 #################################################
1714 # see if this box has the RedHat location for kerberos
1715 AC_MSG_CHECKING(for /usr/kerberos)
1716 if test -d /usr/kerberos; then
1717 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
1718 CFLAGS="$CFLAGS -I/usr/kerberos/include"
1719 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1725 #################################################
1726 # check for location of Kerberos 5 install
1727 AC_MSG_CHECKING(for kerberos 5 install path)
1729 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
1730 [ case "$withval" in
1737 CFLAGS="$CFLAGS -I$withval/include"
1738 CPPFLAGS="$CPPFLAGS -I$withval/include"
1739 LDFLAGS="$LDFLAGS -L$withval/lib"
1745 # now check for krb5.h. Some systems have the libraries without the headers!
1746 # note that this check is done here to allow for different kerberos
1748 AC_CHECK_HEADERS(krb5.h)
1750 # now check for gssapi headers. This is also done here to allow for
1751 # different kerberos include paths
1752 AC_CHECK_HEADERS(gssapi/gssapi_generic.h gssapi/gssapi.h)
1754 ##################################################################
1755 # we might need the k5crypto and com_err libraries on some systems
1756 AC_CHECK_LIB(com_err, _et_list, [LIBS="$LIBS -lcom_err"])
1757 AC_CHECK_LIB(k5crypto, krb5_encrypt_data, [LIBS="$LIBS -lk5crypto"])
1758 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5"])
1761 ########################################################
1762 # now see if we can find the krb5 libs in standard paths
1763 # or as specified above
1764 AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
1765 AC_DEFINE(HAVE_KRB5)])
1767 ########################################################
1768 # now see if we can find the gssapi libs in standard paths
1769 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [AC_DEFINE(HAVE_GSSAPI)])
1772 ##################################################################
1773 # we might need the lber lib on some systems. To avoid link errors
1774 # this test must be before the libldap test
1775 AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
1777 ########################################################
1778 # now see if we can find the ldap libs in standard paths
1779 if test x$have_ldap != xyes; then
1780 AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
1781 AC_DEFINE(HAVE_LDAP)])
1784 #################################################
1785 # check for automount support
1786 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1787 AC_ARG_WITH(automount,
1788 [ --with-automount Include AUTOMOUNT support (default=no)],
1789 [ case "$withval" in
1792 AC_DEFINE(WITH_AUTOMOUNT)
1801 #################################################
1802 # check for smbmount support
1803 AC_MSG_CHECKING(whether to use SMBMOUNT)
1804 AC_ARG_WITH(smbmount,
1805 [ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1806 [ case "$withval" in
1811 AC_DEFINE(WITH_SMBMOUNT)
1812 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1815 AC_MSG_ERROR(not on a linux system!)
1829 #################################################
1830 # check for a PAM clear-text auth, accounts, password and session support
1831 with_pam_for_crypt=no
1832 AC_MSG_CHECKING(whether to use PAM)
1834 [ --with-pam Include PAM support (default=no)],
1835 [ case "$withval" in
1840 with_pam_for_crypt=yes
1849 # we can't build a pam module if we don't have pam.
1850 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1852 #################################################
1853 # check for pam_smbpass support
1854 AC_MSG_CHECKING(whether to use pam_smbpass)
1855 AC_ARG_WITH(pam_smbpass,
1856 [ --with-pam_smbpass Build a PAM module to allow other applications to use our smbpasswd file (default=no)],
1857 [ case "$withval" in
1861 # Conditions under which pam_smbpass should not be built.
1863 if test x$PICFLAG = x; then
1864 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1866 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1867 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1870 PAM_MOD="bin/pam_smbpass.so"
1881 ###############################################
1882 # test for where we get crypt() from, but only
1884 if test $with_pam_for_crypt = no; then
1885 AC_CHECK_FUNCS(crypt)
1886 if test x"$ac_cv_func_crypt" = x"no"; then
1887 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1888 AC_DEFINE(HAVE_CRYPT)])
1893 ## moved after the check for -lcrypt in order to
1894 ## ensure that the necessary libraries are included
1895 ## check checking for truncated salt. Wrapped by the
1896 ## $with_pam_for_crypt variable as above --jerry
1898 if test $with_pam_for_crypt = no; then
1899 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1900 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1901 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1902 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1903 AC_DEFINE(HAVE_TRUNCATED_SALT)
1909 ########################################################################################
1911 ## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
1913 ########################################################################################
1915 #################################################
1916 # check for a TDB password database
1917 AC_MSG_CHECKING(whether to use TDB SAM database)
1919 [ --with-tdbsam Include experimental TDB SAM support (default=no)],
1920 [ case "$withval" in
1923 AC_DEFINE(WITH_TDB_SAM)
1932 #################################################
1933 # check for a LDAP password database
1934 AC_MSG_CHECKING(whether to use LDAP SAM database)
1935 AC_ARG_WITH(ldapsam,
1936 [ --with-ldapsam Include experimental LDAP SAM support (default=no)],
1937 [ case "$withval" in
1940 AC_DEFINE(WITH_LDAP_SAM)
1941 LIBS="-lldap -llber $LIBS"
1950 #################################################
1951 # check for a NISPLUS password database
1952 AC_MSG_CHECKING(whether to use NISPLUS SAM database)
1953 AC_ARG_WITH(nisplussam,
1954 [ --with-nisplussam Include NISPLUS SAM support (default=no)],
1955 [ case "$withval" in
1958 AC_DEFINE(WITH_NISPLUS_SAM)
1967 ########################################################################################
1969 ## END OF TESTS FOR SAM BACKENDS.
1971 ########################################################################################
1973 #################################################
1974 # check for a NISPLUS_HOME support
1975 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1976 AC_ARG_WITH(nisplus-home,
1977 [ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
1978 [ case "$withval" in
1981 AC_DEFINE(WITH_NISPLUS_HOME)
1990 #################################################
1991 # check for the secure socket layer
1992 AC_MSG_CHECKING(whether to use SSL)
1994 [ --with-ssl Include SSL support (default=no)
1995 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
1996 --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
1997 [ case "$withval" in
2001 withval="/usr/local/ssl" # default
2003 if test "${with_sslinc+set}" = set; then
2005 withval="$with_sslinc"
2008 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
2009 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2012 CFLAGS="-I${withval} $CFLAGS"
2018 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2022 if test "${with_ssllib+set}" = set; then
2024 withval="$with_ssllib"
2027 echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
2028 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2031 LDFLAGS="-L${withval}/lib $LDFLAGS"
2037 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2041 LIBS="-lssl -lcrypto $LIBS"
2043 # if test ! -d ${withval}; then
2044 # echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
2048 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
2058 #################################################
2059 # check for syslog logging
2060 AC_MSG_CHECKING(whether to use syslog logging)
2062 [ --with-syslog Include experimental SYSLOG support (default=no)],
2063 [ case "$withval" in
2066 AC_DEFINE(WITH_SYSLOG)
2075 #################################################
2076 # check for a shared memory profiling support
2077 AC_MSG_CHECKING(whether to use profiling)
2078 AC_ARG_WITH(profiling-data,
2079 [ --with-profiling-data Include gathering source code profile information (default=no)],
2080 [ case "$withval" in
2083 AC_DEFINE(WITH_PROFILE)
2093 #################################################
2094 # check for experimental disk-quotas support
2095 QUOTAOBJS=smbd/noquotas.o
2097 AC_MSG_CHECKING(whether to support disk-quotas)
2099 [ --with-quotas Include experimental disk-quota support (default=no)],
2100 [ case "$withval" in
2105 # Check for kernel 2.4.x quota braindamage...
2106 AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
2107 AC_TRY_COMPILE([#include <stdio.h>
2108 #include <sys/types.h>
2109 #include <asm/types.h>
2110 #include <linux/quota.h>
2112 #include <linux/unistd.h>],[struct mem_dqblk D;],
2113 samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
2114 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
2115 AC_DEFINE(LINUX_QUOTAS_2)
2117 AC_DEFINE(LINUX_QUOTAS_1)
2123 QUOTAOBJS=smbd/quotas.o
2124 AC_DEFINE(WITH_QUOTAS)
2134 #################################################
2135 # check for experimental utmp accounting
2137 AC_MSG_CHECKING(whether to support utmp accounting)
2139 [ --with-utmp Include experimental utmp accounting (default=no)],
2140 [ case "$withval" in
2143 AC_DEFINE(WITH_UTMP)
2152 #################################################
2153 # set private directory location
2154 AC_ARG_WITH(privatedir,
2155 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
2156 [ case "$withval" in
2159 # Just in case anybody calls it without argument
2161 AC_MSG_WARN([--with-privatedir called without argument - will use default])
2162 privatedir='${prefix}/private'
2165 privatedir="$withval"
2168 AC_SUBST(privatedir)],
2169 [privatedir='${prefix}/private'
2170 AC_SUBST(privatedir)]
2173 #################################################
2174 # set lock directory location
2175 AC_ARG_WITH(lockdir,
2176 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
2177 [ case "$withval" in
2180 # Just in case anybody calls it without argument
2182 AC_MSG_WARN([--with-lockdir called without argument - will use default])
2183 lockdir='$(VARDIR)/locks'
2190 [lockdir='$(VARDIR)/locks'
2194 #################################################
2195 # set SWAT directory location
2196 AC_ARG_WITH(swatdir,
2197 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
2198 [ case "$withval" in
2201 # Just in case anybody does it
2203 AC_MSG_WARN([--with-swatdir called without argument - will use default])
2204 swatdir='${prefix}/swat'
2211 [swatdir='${prefix}/swat'
2215 #################################################
2216 # choose native language(s) of man pages
2217 AC_MSG_CHECKING(chosen man pages' language(s))
2218 AC_ARG_WITH(manpages-langs,
2219 [ --with-manpages-langs={en,ja,pl} Choose man pages' language(s). (en)],
2220 [ case "$withval" in
2222 AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
2230 AC_MSG_RESULT($manlangs)
2231 manlangs=`echo $manlangs | sed "s/,/ /"` # replacing commas with spaces to produce a list
2232 AC_SUBST(manlangs)],
2235 AC_MSG_RESULT($manlangs)
2239 #################################################
2240 # these tests are taken from the GNU fileutils package
2241 AC_CHECKING(how to get filesystem space usage)
2244 # Test for statvfs64.
2245 if test $space = no; then
2247 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
2249 #if defined(HAVE_UNISTD_H)
2252 #include <sys/types.h>
2253 #include <sys/statvfs.h>
2256 struct statvfs64 fsd;
2257 exit (statvfs64 (".", &fsd));
2259 fu_cv_sys_stat_statvfs64=yes,
2260 fu_cv_sys_stat_statvfs64=no,
2261 fu_cv_sys_stat_statvfs64=cross)])
2262 if test $fu_cv_sys_stat_statvfs64 = yes; then
2264 AC_DEFINE(STAT_STATVFS64)
2268 # Perform only the link test since it seems there are no variants of the
2269 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2270 # because that got a false positive on SCO OSR5. Adding the declaration
2271 # of a `struct statvfs' causes this test to fail (as it should) on such
2272 # systems. That system is reported to work fine with STAT_STATFS4 which
2273 # is what it gets when this test fails.
2274 if test $space = no; then
2276 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2277 [AC_TRY_LINK([#include <sys/types.h>
2278 #include <sys/statvfs.h>],
2279 [struct statvfs fsd; statvfs (0, &fsd);],
2280 fu_cv_sys_stat_statvfs=yes,
2281 fu_cv_sys_stat_statvfs=no)])
2282 if test $fu_cv_sys_stat_statvfs = yes; then
2284 AC_DEFINE(STAT_STATVFS)
2288 if test $space = no; then
2289 # DEC Alpha running OSF/1
2290 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2291 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2293 #include <sys/param.h>
2294 #include <sys/types.h>
2295 #include <sys/mount.h>
2300 exit (statfs (".", &fsd, sizeof (struct statfs)));
2302 fu_cv_sys_stat_statfs3_osf1=yes,
2303 fu_cv_sys_stat_statfs3_osf1=no,
2304 fu_cv_sys_stat_statfs3_osf1=no)])
2305 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2306 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2308 AC_DEFINE(STAT_STATFS3_OSF1)
2312 if test $space = no; then
2314 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2315 member (AIX, 4.3BSD)])
2316 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2318 #ifdef HAVE_SYS_PARAM_H
2319 #include <sys/param.h>
2321 #ifdef HAVE_SYS_MOUNT_H
2322 #include <sys/mount.h>
2324 #ifdef HAVE_SYS_VFS_H
2325 #include <sys/vfs.h>
2331 exit (statfs (".", &fsd));
2333 fu_cv_sys_stat_statfs2_bsize=yes,
2334 fu_cv_sys_stat_statfs2_bsize=no,
2335 fu_cv_sys_stat_statfs2_bsize=no)])
2336 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2337 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2339 AC_DEFINE(STAT_STATFS2_BSIZE)
2343 if test $space = no; then
2345 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2346 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2347 [AC_TRY_RUN([#include <sys/types.h>
2348 #include <sys/statfs.h>
2352 exit (statfs (".", &fsd, sizeof fsd, 0));
2354 fu_cv_sys_stat_statfs4=yes,
2355 fu_cv_sys_stat_statfs4=no,
2356 fu_cv_sys_stat_statfs4=no)])
2357 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2358 if test $fu_cv_sys_stat_statfs4 = yes; then
2360 AC_DEFINE(STAT_STATFS4)
2364 if test $space = no; then
2366 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2367 member (4.4BSD and NetBSD)])
2368 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2369 [AC_TRY_RUN([#include <sys/types.h>
2370 #ifdef HAVE_SYS_PARAM_H
2371 #include <sys/param.h>
2373 #ifdef HAVE_SYS_MOUNT_H
2374 #include <sys/mount.h>
2380 exit (statfs (".", &fsd));
2382 fu_cv_sys_stat_statfs2_fsize=yes,
2383 fu_cv_sys_stat_statfs2_fsize=no,
2384 fu_cv_sys_stat_statfs2_fsize=no)])
2385 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2386 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2388 AC_DEFINE(STAT_STATFS2_FSIZE)
2392 if test $space = no; then
2394 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2395 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2396 [AC_TRY_RUN([#include <sys/types.h>
2397 #ifdef HAVE_SYS_PARAM_H
2398 #include <sys/param.h>
2400 #ifdef HAVE_SYS_MOUNT_H
2401 #include <sys/mount.h>
2403 #ifdef HAVE_SYS_FS_TYPES_H
2404 #include <sys/fs_types.h>
2409 /* Ultrix's statfs returns 1 for success,
2410 0 for not mounted, -1 for failure. */
2411 exit (statfs (".", &fsd) != 1);
2413 fu_cv_sys_stat_fs_data=yes,
2414 fu_cv_sys_stat_fs_data=no,
2415 fu_cv_sys_stat_fs_data=no)])
2416 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2417 if test $fu_cv_sys_stat_fs_data = yes; then
2419 AC_DEFINE(STAT_STATFS2_FS_DATA)
2424 # As a gating factor for large file support, in order to
2425 # use <4GB files we must have the following minimal support
2427 # long long, and a 64 bit off_t or off64_t.
2428 # If we don't have all of these then disable large
2431 AC_MSG_CHECKING([if large file support can be enabled])
2433 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2434 #include <sys/types.h>
2440 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2441 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2442 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2444 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
2446 AC_ARG_WITH(spinlocks,
2447 [ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ])
2448 if test "x$with_spinlocks" = "xyes"; then
2449 AC_DEFINE(USE_SPINLOCKS)
2453 AC_DEFINE(SPARC_SPINLOCKS)
2456 i386|i486|i586|i686)
2457 AC_DEFINE(INTEL_SPINLOCKS)
2461 AC_DEFINE(MIPS_SPINLOCKS)
2465 AC_DEFINE(POWERPC_SPINLOCKS)
2470 #################################################
2471 # check for ACL support
2473 AC_MSG_CHECKING(whether to support ACLs)
2474 AC_ARG_WITH(acl-support,
2475 [ --with-acl-support Include ACL support (default=no)],
2476 [ case "$withval" in
2481 AC_MSG_RESULT(Using UnixWare ACLs)
2482 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2485 AC_MSG_RESULT(Using solaris ACLs)
2486 AC_DEFINE(HAVE_SOLARIS_ACLS)
2489 AC_MSG_RESULT(Using HPUX ACLs)
2490 AC_DEFINE(HAVE_HPUX_ACLS)
2493 AC_MSG_RESULT(Using IRIX ACLs)
2494 AC_DEFINE(HAVE_IRIX_ACLS)
2497 AC_MSG_RESULT(Using AIX ACLs)
2498 AC_DEFINE(HAVE_AIX_ACLS)
2501 AC_MSG_RESULT(Using Tru64 ACLs)
2502 AC_DEFINE(HAVE_TRU64_ACLS)
2506 AC_CHECK_LIB(acl,acl_get_file)
2507 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2508 AC_TRY_LINK([#include <sys/types.h>
2509 #include <sys/acl.h>],
2510 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2511 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2512 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2513 AC_MSG_RESULT(Using posix ACLs)
2514 AC_DEFINE(HAVE_POSIX_ACLS)
2515 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2516 AC_TRY_LINK([#include <sys/types.h>
2517 #include <sys/acl.h>],
2518 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2519 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2520 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2521 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2529 AC_DEFINE(HAVE_NO_ACLS)
2532 AC_DEFINE(HAVE_NO_ACLS)
2536 #################################################
2537 # Check whether winbind is supported on this platform. If so we need to
2538 # build and install client programs (WINBIND_TARGETS), sbin programs
2539 # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2541 AC_MSG_CHECKING(whether to build winbind)
2543 # Initially, the value of $host_os decides whether winbind is supported
2546 *linux*|*solaris*|*irix*)
2551 winbind_no_reason=", unsupported on $host_os"
2555 # Check the setting of --with-winbindd
2557 AC_ARG_WITH(winbind,
2558 [ --with-winbind Build winbind (default, if supported by OS)],
2571 # We need unix domain sockets for winbind
2573 if test x"$HAVE_WINBIND" = x"yes"; then
2574 if test x"$samba_cv_unixsocket" = x"no"; then
2575 winbind_no_reason=", no unix domain socket support on $host_os"
2580 # Display test results
2585 WINBIND_PAM_PROGS=""
2587 if test x"$HAVE_WINBIND" = x"yes"; then
2590 WINBIND_TARGETS="bin/wbinfo"
2591 WINBIND_STARGETS="bin/winbindd"
2592 if test x"$BLDSHARED" = x"true"; then
2593 WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
2594 if test x"$with_pam" = x"yes"; then
2595 WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2599 AC_MSG_RESULT(no$winbind_no_reason)
2602 # Substitution time!
2604 AC_SUBST(WINBIND_TARGETS)
2605 AC_SUBST(WINBIND_STARGETS)
2606 AC_SUBST(WINBIND_LTARGETS)
2607 AC_SUBST(WINBIND_PAM_TARGETS)
2609 #################################################
2610 # Check to see if we should use the included popt
2612 AC_ARG_WITH(included-popt,
2613 [ --with-included-popt use bundled popt library, not from system],
2624 if test x"$INCLUDED_POPT" != x"yes"; then
2625 AC_CHECK_LIB(popt, poptGetContext,
2626 INCLUDED_POPT=no, INCLUDED_POPT=yes)
2629 AC_MSG_CHECKING(whether to use included popt)
2630 if test x"$INCLUDED_POPT" = x"yes"; then
2631 AC_MSG_RESULT($srcdir/popt)
2632 BUILD_POPT='$(POPT_OBJS)'
2633 FLAGS1="-I$srcdir/popt"
2638 AC_SUBST(BUILD_POPT)
2641 #################################################
2642 # final configure stuff
2644 echo "checking configure summary"
2645 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2646 echo "configure OK";,
2647 AC_MSG_ERROR([summary failure. Aborting config]),:)
2652 AC_OUTPUT(include/stamp-h Makefile)
2654 #################################################
2655 # Print very concise instructions on building/use
2656 if test "x$enable_dmalloc" = xyes
2658 AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
2659 AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])