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="-Wl,-soname,\$@ -shared"
730 if test "${ac_cv_prog_CC}" = "gcc"; then
735 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
737 *aix*) AC_DEFINE(AIX)
739 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
740 PICFLAG="-O2 -qmaxmem=6000"
741 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
743 *hpux*) AC_DEFINE(HPUX)
745 # Use special PIC flags for the native HP-UX compiler.
746 if test $ac_cv_prog_cc_Ae = yes; then
748 LDSHFLAGS="-b -z +h \$@"
751 AC_DEFINE(STAT_ST_BLOCKSIZE,8192)
753 *qnx*) AC_DEFINE(QNX);;
754 *osf*) AC_DEFINE(OSF1)
756 LDSHFLAGS="-Wl,-soname,\$@ -shared"
759 *sco*) AC_DEFINE(SCO);;
760 *unixware*) AC_DEFINE(UNIXWARE)
762 LDSHFLAGS="-Wl,-soname,\$@ -shared"
765 *next2*) AC_DEFINE(NEXT2);;
766 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
769 *-univel-*) if [ test "$GCC" != yes ]; then
770 AC_DEFINE(HAVE_MEMSET)
774 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
778 if [ test "$GCC" != yes ]; then
779 AC_DEFINE(HAVE_MEMSET)
784 AC_MSG_RESULT($BLDSHARED)
785 AC_MSG_CHECKING([linker flags for shared libraries])
786 AC_MSG_RESULT([$LDSHFLAGS])
787 AC_MSG_CHECKING([compiler flags for position-independent code])
788 AC_MSG_RESULT([$PICFLAGS])
790 #######################################################
791 # test whether building a shared library actually works
792 if test $BLDSHARED = true; then
793 AC_CACHE_CHECK([whether building shared libraries actually works],
794 [ac_cv_shlib_works],[
796 # try building a trivial shared library
797 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
798 $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
799 ac_cv_shlib_works=yes
800 rm -f shlib.so shlib.po
802 if test $ac_cv_shlib_works = no; then
808 # this updates our target list if we can build shared libs
809 if test $BLDSHARED = true; then
810 LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
817 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
818 AC_TRY_RUN([#include <stdio.h>
819 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
820 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
821 if test x"$samba_cv_have_longlong" = x"yes"; then
822 AC_DEFINE(HAVE_LONGLONG)
826 # Check if the compiler supports the LL prefix on long long integers.
829 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
830 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
831 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
832 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
833 AC_DEFINE(COMPILER_SUPPORTS_LL)
837 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
838 AC_TRY_RUN([#include <stdio.h>
839 #include <sys/stat.h>
840 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
841 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
842 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
843 AC_DEFINE(SIZEOF_OFF_T,8)
846 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
848 #if defined(HAVE_UNISTD_H)
852 #include <sys/stat.h>
853 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
854 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
855 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
856 AC_DEFINE(HAVE_OFF64_T)
859 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
860 AC_TRY_RUN([#include <stdio.h>
861 #include <sys/stat.h>
862 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
863 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
864 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
865 AC_DEFINE(SIZEOF_INO_T,8)
868 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
870 #if defined(HAVE_UNISTD_H)
874 #include <sys/stat.h>
875 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
876 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
877 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
878 AC_DEFINE(HAVE_INO64_T)
881 AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
883 #if defined(HAVE_UNISTD_H)
887 #include <sys/stat.h>
888 main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
889 samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
890 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
891 AC_DEFINE(HAVE_DEV64_T)
894 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
896 #if defined(HAVE_UNISTD_H)
899 #include <sys/types.h>
900 #include <dirent.h>],
901 [struct dirent64 de;],
902 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
903 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
904 AC_DEFINE(HAVE_STRUCT_DIRENT64)
907 AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
909 #if defined(HAVE_UNISTD_H)
912 #include <sys/types.h>
913 main() { dev_t dev; int i = major(dev); return 0; }],
914 samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
915 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
916 AC_DEFINE(HAVE_DEVICE_MAJOR_FN)
919 AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
921 #if defined(HAVE_UNISTD_H)
924 #include <sys/types.h>
925 main() { dev_t dev; int i = minor(dev); return 0; }],
926 samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
927 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
928 AC_DEFINE(HAVE_DEVICE_MINOR_FN)
931 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
932 AC_TRY_RUN([#include <stdio.h>
933 main() { char c; c=250; exit((c > 0)?0:1); }],
934 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
935 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
936 AC_DEFINE(HAVE_UNSIGNED_CHAR)
939 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
940 AC_TRY_COMPILE([#include <sys/types.h>
941 #include <sys/socket.h>
942 #include <netinet/in.h>],
943 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
944 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
945 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
946 AC_DEFINE(HAVE_SOCK_SIN_LEN)
949 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
950 AC_TRY_COMPILE([#include <sys/types.h>
952 void seekdir(DIR *d, long loc) { return; }],[return 0;],
953 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
954 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
955 AC_DEFINE(SEEKDIR_RETURNS_VOID)
958 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
959 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
960 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
961 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
962 AC_DEFINE(HAVE_FILE_MACRO)
965 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
966 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
967 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
968 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
969 AC_DEFINE(HAVE_FUNCTION_MACRO)
972 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
974 #include <sys/time.h>
976 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
977 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
978 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
979 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
982 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
984 #include <sys/types.h>
986 void foo(const char *format, ...) {
991 va_start(ap, format);
992 len = vsnprintf(0, 0, format, ap);
994 if (len != 5) exit(1);
996 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1000 main() { foo("hello"); }
1002 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
1003 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1004 AC_DEFINE(HAVE_C99_VSNPRINTF)
1007 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1008 AC_TRY_RUN([#include <sys/types.h>
1010 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1011 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1012 di->d_name[0] == 0) exit(0); exit(1);} ],
1013 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
1014 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1015 AC_DEFINE(HAVE_BROKEN_READDIR)
1018 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1019 AC_TRY_COMPILE([#include <sys/types.h>
1020 #include <utime.h>],
1021 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1022 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
1023 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
1024 AC_DEFINE(HAVE_UTIMBUF)
1027 dnl utmp and utmpx come in many flavours
1028 dnl We need to check for many of them
1029 dnl But we don't need to do each and every one, because our code uses
1030 dnl mostly just the utmp (not utmpx) fields.
1032 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
1034 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
1035 AC_TRY_COMPILE([#include <sys/types.h>
1037 [struct utmp ut; ut.ut_name[0] = 'a';],
1038 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
1039 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
1040 AC_DEFINE(HAVE_UT_UT_NAME)
1043 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
1044 AC_TRY_COMPILE([#include <sys/types.h>
1046 [struct utmp ut; ut.ut_user[0] = 'a';],
1047 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
1048 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
1049 AC_DEFINE(HAVE_UT_UT_USER)
1052 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
1053 AC_TRY_COMPILE([#include <sys/types.h>
1055 [struct utmp ut; ut.ut_id[0] = 'a';],
1056 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
1057 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
1058 AC_DEFINE(HAVE_UT_UT_ID)
1061 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
1062 AC_TRY_COMPILE([#include <sys/types.h>
1064 [struct utmp ut; ut.ut_host[0] = 'a';],
1065 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
1066 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
1067 AC_DEFINE(HAVE_UT_UT_HOST)
1070 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
1071 AC_TRY_COMPILE([#include <sys/types.h>
1073 [struct utmp ut; time_t t; ut.ut_time = t;],
1074 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
1075 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
1076 AC_DEFINE(HAVE_UT_UT_TIME)
1079 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
1080 AC_TRY_COMPILE([#include <sys/types.h>
1082 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
1083 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
1084 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
1085 AC_DEFINE(HAVE_UT_UT_TV)
1088 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
1089 AC_TRY_COMPILE([#include <sys/types.h>
1091 [struct utmp ut; ut.ut_type = 0;],
1092 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
1093 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
1094 AC_DEFINE(HAVE_UT_UT_TYPE)
1097 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
1098 AC_TRY_COMPILE([#include <sys/types.h>
1100 [struct utmp ut; ut.ut_pid = 0;],
1101 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
1102 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
1103 AC_DEFINE(HAVE_UT_UT_PID)
1106 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1107 AC_TRY_COMPILE([#include <sys/types.h>
1109 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1110 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1111 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1112 AC_DEFINE(HAVE_UT_UT_EXIT)
1115 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1116 AC_TRY_COMPILE([#include <sys/types.h>
1118 [struct utmp ut; ut.ut_addr = 0;],
1119 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1120 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1121 AC_DEFINE(HAVE_UT_UT_ADDR)
1124 if test x$ac_cv_func_pututline = xyes ; then
1125 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1126 AC_TRY_COMPILE([#include <sys/types.h>
1128 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1129 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1130 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1131 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1135 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1136 AC_TRY_COMPILE([#include <sys/types.h>
1137 #include <utmpx.h>],
1138 [struct utmpx ux; ux.ut_syslen = 0;],
1139 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1140 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1141 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1145 #################################################
1146 # check for libiconv support
1147 AC_MSG_CHECKING(whether to use libiconv)
1148 AC_ARG_WITH(libiconv,
1149 [ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
1150 [ case "$withval" in
1156 CFLAGS="$CFLAGS -I$withval/include"
1157 LDFLAGS="$LDFLAGS -L$withval/lib"
1158 AC_CHECK_LIB(iconv, iconv_open)
1159 AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}")
1167 # check for iconv in libc
1168 AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
1172 iconv_t cd = iconv_open("ASCII", "UCS-2LE");
1173 if (cd == 0 || cd == (iconv_t)-1) return -1;
1177 samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)])
1178 if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
1179 AC_DEFINE(HAVE_NATIVE_ICONV)
1183 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1185 #include <sys/types.h>
1188 #define F_GETLEASE 1025
1191 int fd = open("/dev/null", O_RDONLY);
1192 return fcntl(fd, F_GETLEASE, 0) == -1;
1195 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1196 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1197 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1200 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1202 #include <sys/types.h>
1206 #define F_NOTIFY 1026
1209 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1212 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1213 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1214 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1217 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1219 #include <sys/types.h>
1222 #include <sys/file.h>
1224 #define LOCK_MAND 32
1225 #define LOCK_READ 64
1228 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1231 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1232 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1233 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1239 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1240 AC_TRY_COMPILE([#include <sys/types.h>
1241 #include <fcntl.h>],
1242 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1243 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1244 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1245 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1248 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1249 AC_TRY_RUN([#include <sys/types.h>
1250 #include <sys/capability.h>
1253 if ((cap = cap_get_proc()) == NULL)
1255 cap->cap_effective |= CAP_NETWORK_MGT;
1256 cap->cap_inheritable |= CAP_NETWORK_MGT;
1261 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1262 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1263 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1267 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1268 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1271 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1272 AC_TRY_COMPILE([#include <sys/types.h>
1273 #if defined(HAVE_RPC_RPC_H)
1274 #include <rpc/rpc.h>
1277 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1278 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1279 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1282 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1283 AC_TRY_COMPILE([#include <sys/types.h>
1284 #if defined(HAVE_RPC_RPC_H)
1285 #include <rpc/rpc.h>
1288 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1289 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1290 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1293 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1294 AC_TRY_COMPILE([#include <sys/types.h>
1295 #if defined(HAVE_RPC_RPC_H)
1296 #include <rpc/rpc.h>
1299 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1300 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1301 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1304 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1305 AC_TRY_COMPILE([#include <sys/types.h>
1306 #if defined(HAVE_RPC_RPC_H)
1307 #include <rpc/rpc.h>
1310 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1311 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1312 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1316 dnl Some systems (SCO) have a problem including
1317 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1318 dnl as a #define in <prot.h> and as part of an enum
1322 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1323 AC_TRY_COMPILE([#include <sys/types.h>
1324 #ifdef HAVE_SYS_SECURITY_H
1325 #include <sys/security.h>
1327 #endif /* HAVE_SYS_SECURITY_H */
1328 #if defined(HAVE_RPC_RPC_H)
1329 #include <rpc/rpc.h>
1332 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1333 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1334 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1337 AC_MSG_CHECKING([for test routines])
1338 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1340 AC_MSG_ERROR([cant find test code. Aborting config]),
1341 AC_MSG_WARN([cannot run when cross-compiling]))
1343 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1344 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1345 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1346 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1347 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1350 AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
1351 AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
1352 samba_cv_HAVE_WORKING_AF_LOCAL=yes,
1353 samba_cv_HAVE_WORKING_AF_LOCAL=no,
1354 samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
1355 if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
1357 AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
1360 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1361 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1362 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1363 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1364 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1367 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1368 SAVE_CPPFLAGS="$CPPFLAGS"
1369 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1371 #define REPLACE_GETPASS 1
1372 #define NO_CONFIG_H 1
1373 #define main dont_declare_main
1374 #include "${srcdir-.}/lib/getsmbpass.c"
1376 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1377 CPPFLAGS="$SAVE_CPPFLAGS"
1379 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1380 AC_DEFINE(REPLACE_GETPASS)
1383 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1386 #include <sys/types.h>
1387 #include <netinet/in.h>
1388 #ifdef HAVE_ARPA_INET_H
1389 #include <arpa/inet.h>
1391 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1392 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1393 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1395 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1396 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1397 AC_DEFINE(REPLACE_INET_NTOA)
1400 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1401 AC_TRY_RUN([#include <stdlib.h>
1402 #include <sys/types.h>
1403 #include <sys/stat.h>
1407 char tpl[20]="/tmp/test.XXXXXX";
1408 int fd = mkstemp(tpl);
1409 if (fd == -1) exit(1);
1411 if (fstat(fd, &st) != 0) exit(1);
1412 if ((st.st_mode & 0777) != 0600) exit(1);
1415 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1416 samba_cv_HAVE_SECURE_MKSTEMP=no,
1417 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1418 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1419 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1422 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1423 AC_TRY_RUN([#include <unistd.h>
1424 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1425 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1426 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1427 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1430 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1431 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1432 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1433 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1434 AC_DEFINE(HAVE_ROOT)
1436 AC_MSG_WARN(running as non-root will disable some tests)
1440 # look for a method of finding the list of network interfaces
1442 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1444 #define HAVE_IFACE_AIX 1
1445 #define AUTOCONF_TEST 1
1446 #include "confdefs.h"
1447 #include "${srcdir-.}/lib/interfaces.c"],
1448 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1449 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1450 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1453 if test $iface = no; then
1454 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1456 #define HAVE_IFACE_IFCONF 1
1457 #define AUTOCONF_TEST 1
1458 #include "confdefs.h"
1459 #include "${srcdir-.}/lib/interfaces.c"],
1460 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1461 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1462 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1466 if test $iface = no; then
1467 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1469 #define HAVE_IFACE_IFREQ 1
1470 #define AUTOCONF_TEST 1
1471 #include "confdefs.h"
1472 #include "${srcdir-.}/lib/interfaces.c"],
1473 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1474 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1475 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1480 ################################################
1481 # look for a method of setting the effective uid
1483 if test $seteuid = no; then
1484 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1486 #define AUTOCONF_TEST 1
1487 #define USE_SETRESUID 1
1488 #include "confdefs.h"
1489 #include "${srcdir-.}/lib/util_sec.c"],
1490 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1491 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1492 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1497 if test $seteuid = no; then
1498 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1500 #define AUTOCONF_TEST 1
1501 #define USE_SETREUID 1
1502 #include "confdefs.h"
1503 #include "${srcdir-.}/lib/util_sec.c"],
1504 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1505 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1506 seteuid=yes;AC_DEFINE(USE_SETREUID)
1510 if test $seteuid = no; then
1511 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1513 #define AUTOCONF_TEST 1
1514 #define USE_SETEUID 1
1515 #include "confdefs.h"
1516 #include "${srcdir-.}/lib/util_sec.c"],
1517 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1518 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1519 seteuid=yes;AC_DEFINE(USE_SETEUID)
1523 if test $seteuid = no; then
1524 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1526 #define AUTOCONF_TEST 1
1527 #define USE_SETUIDX 1
1528 #include "confdefs.h"
1529 #include "${srcdir-.}/lib/util_sec.c"],
1530 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1531 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1532 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1537 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1538 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1539 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1540 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1541 AC_DEFINE(HAVE_MMAP)
1544 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1545 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1546 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1547 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1548 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1551 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1552 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1553 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1554 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1555 AC_DEFINE(HAVE_FCNTL_LOCK)
1558 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1559 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1560 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1561 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1562 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1567 dnl Don't check for 64 bit fcntl locking if we know that the
1568 dnl glibc2.1 broken check has succeeded.
1571 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1573 #if defined(HAVE_UNISTD_H)
1583 #ifdef HAVE_SYS_FCNTL_H
1584 #include <sys/fcntl.h>
1586 main() { struct flock64 fl64;
1587 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1593 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1595 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1596 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1600 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1601 AC_TRY_COMPILE([#include <sys/types.h>
1602 #include <sys/stat.h>
1603 #include <unistd.h>],
1604 [struct stat st; st.st_blocks = 0;],
1605 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1606 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1607 AC_DEFINE(HAVE_STAT_ST_BLOCKS)
1612 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1614 #ifdef HAVE_SYS_VFS_H
1615 #include <sys/vfs.h>
1617 #ifdef HAVE_SYS_CAPABILITY_H
1618 #include <sys/capability.h>
1621 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1622 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1623 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS)
1628 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1629 AC_TRY_COMPILE([#include <sys/acl.h>
1630 #if defined(HAVE_RPCSVC_NIS_H)
1631 #include <rpcsvc/nis.h>
1634 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1635 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1636 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1640 #################################################
1641 # check for smbwrapper support
1642 AC_MSG_CHECKING(whether to use smbwrapper)
1643 AC_ARG_WITH(smbwrapper,
1644 [ --with-smbwrapper Include SMB wrapper support (default=no) ],
1645 [ case "$withval" in
1648 AC_DEFINE(WITH_SMBWRAPPER)
1649 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1651 if test x$ATTEMPT_WRAP32_BUILD = x; then
1654 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1657 # Conditions under which smbwrapper should not be built.
1659 if test x$PICFLAG = x; then
1660 echo No support for PIC code - disabling smbwrapper and smbsh
1663 elif test x$ac_cv_func_syscall = xno; then
1664 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1676 #################################################
1677 # check for AFS clear-text auth support
1678 AC_MSG_CHECKING(whether to use AFS clear-text auth)
1680 [ --with-afs Include AFS clear-text auth support (default=no) ],
1681 [ case "$withval" in
1694 #################################################
1695 # check for the DFS clear-text auth system
1696 AC_MSG_CHECKING(whether to use DFS clear-text auth)
1698 [ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)],
1699 [ case "$withval" in
1712 #################################################
1713 # see if this box has the RedHat location for kerberos
1714 AC_MSG_CHECKING(for /usr/kerberos)
1715 if test -d /usr/kerberos; then
1716 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
1717 CFLAGS="$CFLAGS -I/usr/kerberos/include"
1718 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1724 #################################################
1725 # check for location of Kerberos 5 install
1726 AC_MSG_CHECKING(for kerberos 5 install path)
1728 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
1729 [ case "$withval" in
1736 CFLAGS="$CFLAGS -I$withval/include"
1737 CPPFLAGS="$CPPFLAGS -I$withval/include"
1738 LDFLAGS="$LDFLAGS -L$withval/lib"
1744 # now check for krb5.h. Some systems have the libraries without the headers!
1745 # note that this check is done here to allow for different kerberos
1747 AC_CHECK_HEADERS(krb5.h)
1749 # now check for gssapi headers. This is also done here to allow for
1750 # different kerberos include paths
1751 AC_CHECK_HEADERS(gssapi/gssapi_generic.h gssapi/gssapi.h)
1753 ##################################################################
1754 # we might need the k5crypto and com_err libraries on some systems
1755 AC_CHECK_LIB(com_err, _et_list, [LIBS="$LIBS -lcom_err"])
1756 AC_CHECK_LIB(k5crypto, krb5_encrypt_data, [LIBS="$LIBS -lk5crypto"])
1757 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5"])
1760 ########################################################
1761 # now see if we can find the krb5 libs in standard paths
1762 # or as specified above
1763 AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
1764 AC_DEFINE(HAVE_KRB5)])
1766 ########################################################
1767 # now see if we can find the gssapi libs in standard paths
1768 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [AC_DEFINE(HAVE_GSSAPI)])
1771 ##################################################################
1772 # we might need the lber lib on some systems. To avoid link errors
1773 # this test must be before the libldap test
1774 AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
1776 ########################################################
1777 # now see if we can find the ldap libs in standard paths
1778 if test x$have_ldap != xyes; then
1779 AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
1780 AC_DEFINE(HAVE_LDAP)])
1783 #################################################
1784 # check for automount support
1785 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1786 AC_ARG_WITH(automount,
1787 [ --with-automount Include AUTOMOUNT support (default=no)],
1788 [ case "$withval" in
1791 AC_DEFINE(WITH_AUTOMOUNT)
1800 #################################################
1801 # check for smbmount support
1802 AC_MSG_CHECKING(whether to use SMBMOUNT)
1803 AC_ARG_WITH(smbmount,
1804 [ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1805 [ case "$withval" in
1810 AC_DEFINE(WITH_SMBMOUNT)
1811 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1814 AC_MSG_ERROR(not on a linux system!)
1828 #################################################
1829 # check for a PAM clear-text auth, accounts, password and session support
1830 with_pam_for_crypt=no
1831 AC_MSG_CHECKING(whether to use PAM)
1833 [ --with-pam Include PAM support (default=no)],
1834 [ case "$withval" in
1839 with_pam_for_crypt=yes
1848 # we can't build a pam module if we don't have pam.
1849 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1851 #################################################
1852 # check for pam_smbpass support
1853 AC_MSG_CHECKING(whether to use pam_smbpass)
1854 AC_ARG_WITH(pam_smbpass,
1855 [ --with-pam_smbpass Build a PAM module to allow other applications to use our smbpasswd file (default=no)],
1856 [ case "$withval" in
1860 # Conditions under which pam_smbpass should not be built.
1862 if test x$PICFLAG = x; then
1863 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1865 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1866 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1869 PAM_MOD="bin/pam_smbpass.so"
1880 ###############################################
1881 # test for where we get crypt() from, but only
1883 if test $with_pam_for_crypt = no; then
1884 AC_CHECK_FUNCS(crypt)
1885 if test x"$ac_cv_func_crypt" = x"no"; then
1886 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1887 AC_DEFINE(HAVE_CRYPT)])
1892 ## moved after the check for -lcrypt in order to
1893 ## ensure that the necessary libraries are included
1894 ## check checking for truncated salt. Wrapped by the
1895 ## $with_pam_for_crypt variable as above --jerry
1897 if test $with_pam_for_crypt = no; then
1898 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1899 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1900 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1901 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1902 AC_DEFINE(HAVE_TRUNCATED_SALT)
1908 ########################################################################################
1910 ## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
1912 ########################################################################################
1914 ## set the with_smbpasswd_sam as the default
1915 with_smbpasswd_sam=yes
1918 #################################################
1919 # check for a TDB password database
1920 AC_MSG_CHECKING(whether to use TDB SAM database)
1922 [ --with-tdbsam Include experimental TDB SAM support (default=no)],
1923 [ case "$withval" in
1926 AC_DEFINE(WITH_TDB_SAM)
1927 with_smbpasswd_sam=no
1936 #################################################
1937 # check for a LDAP password database
1938 AC_MSG_CHECKING(whether to use LDAP SAM database)
1939 AC_ARG_WITH(ldapsam,
1940 [ --with-ldapsam Include experimental LDAP SAM support (default=no)],
1941 [ case "$withval" in
1944 AC_DEFINE(WITH_LDAP_SAM)
1945 LIBS="-lldap -llber $LIBS"
1946 with_smbpasswd_sam=no
1955 #################################################
1956 # check for a NISPLUS password database
1957 AC_MSG_CHECKING(whether to use NISPLUS SAM database)
1958 AC_ARG_WITH(nisplussam,
1959 [ --with-nisplussam Include NISPLUS SAM support (default=no)],
1960 [ case "$withval" in
1963 AC_DEFINE(WITH_NISPLUS_SAM)
1964 with_smbpasswd_sam=no
1973 ################################################
1974 # This test should come last because the
1975 # smbpasswd SAM is only used if another format
1976 # has not been defined
1977 AC_MSG_CHECKING(whether to use traditional smbpasswd file)
1978 if test $with_smbpasswd_sam = yes; then
1980 AC_DEFINE(WITH_SMBPASSWD_SAM)
1985 ########################################################################################
1987 ## END OF TESTS FOR SAM BACKENDS.
1989 ########################################################################################
1991 #################################################
1992 # check for a NISPLUS_HOME support
1993 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1994 AC_ARG_WITH(nisplus-home,
1995 [ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
1996 [ case "$withval" in
1999 AC_DEFINE(WITH_NISPLUS_HOME)
2008 #################################################
2009 # check for the secure socket layer
2010 AC_MSG_CHECKING(whether to use SSL)
2012 [ --with-ssl Include SSL support (default=no)
2013 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
2014 --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
2015 [ case "$withval" in
2019 withval="/usr/local/ssl" # default
2021 if test "${with_sslinc+set}" = set; then
2023 withval="$with_sslinc"
2026 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
2027 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2030 CFLAGS="-I${withval} $CFLAGS"
2036 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2040 if test "${with_ssllib+set}" = set; then
2042 withval="$with_ssllib"
2045 echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
2046 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2049 LDFLAGS="-L${withval}/lib $LDFLAGS"
2055 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2059 LIBS="-lssl -lcrypto $LIBS"
2061 # if test ! -d ${withval}; then
2062 # echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
2066 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
2076 #################################################
2077 # check for syslog logging
2078 AC_MSG_CHECKING(whether to use syslog logging)
2080 [ --with-syslog Include experimental SYSLOG support (default=no)],
2081 [ case "$withval" in
2084 AC_DEFINE(WITH_SYSLOG)
2093 #################################################
2094 # check for a shared memory profiling support
2095 AC_MSG_CHECKING(whether to use profiling)
2096 AC_ARG_WITH(profiling-data,
2097 [ --with-profiling-data Include gathering source code profile information (default=no)],
2098 [ case "$withval" in
2101 AC_DEFINE(WITH_PROFILE)
2111 #################################################
2112 # check for experimental disk-quotas support
2113 QUOTAOBJS=smbd/noquotas.o
2115 AC_MSG_CHECKING(whether to support disk-quotas)
2117 [ --with-quotas Include experimental disk-quota support (default=no)],
2118 [ case "$withval" in
2123 # Check for kernel 2.4.x quota braindamage...
2124 AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
2125 AC_TRY_COMPILE([#include <stdio.h>
2126 #include <sys/types.h>
2127 #include <asm/types.h>
2128 #include <linux/quota.h>
2130 #include <linux/unistd.h>],[struct mem_dqblk D;],
2131 samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
2132 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
2133 AC_DEFINE(LINUX_QUOTAS_2)
2135 AC_DEFINE(LINUX_QUOTAS_1)
2141 QUOTAOBJS=smbd/quotas.o
2142 AC_DEFINE(WITH_QUOTAS)
2152 #################################################
2153 # check for experimental utmp accounting
2155 AC_MSG_CHECKING(whether to support utmp accounting)
2157 [ --with-utmp Include experimental utmp accounting (default=no)],
2158 [ case "$withval" in
2161 AC_DEFINE(WITH_UTMP)
2170 #################################################
2171 # set private directory location
2172 AC_ARG_WITH(privatedir,
2173 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
2174 [ case "$withval" in
2177 # Just in case anybody calls it without argument
2179 AC_MSG_WARN([--with-privatedir called without argument - will use default])
2180 privatedir='${prefix}/private'
2183 privatedir="$withval"
2186 AC_SUBST(privatedir)],
2187 [privatedir='${prefix}/private'
2188 AC_SUBST(privatedir)]
2191 #################################################
2192 # set lock directory location
2193 AC_ARG_WITH(lockdir,
2194 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
2195 [ case "$withval" in
2198 # Just in case anybody calls it without argument
2200 AC_MSG_WARN([--with-lockdir called without argument - will use default])
2201 lockdir='$(VARDIR)/locks'
2208 [lockdir='$(VARDIR)/locks'
2212 #################################################
2213 # set SWAT directory location
2214 AC_ARG_WITH(swatdir,
2215 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
2216 [ case "$withval" in
2219 # Just in case anybody does it
2221 AC_MSG_WARN([--with-swatdir called without argument - will use default])
2222 swatdir='${prefix}/swat'
2229 [swatdir='${prefix}/swat'
2233 #################################################
2234 # choose native language(s) of man pages
2235 AC_MSG_CHECKING(chosen man pages' language(s))
2236 AC_ARG_WITH(manpages-langs,
2237 [ --with-manpages-langs={en,ja,pl} Choose man pages' language(s). (en)],
2238 [ case "$withval" in
2240 AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
2248 AC_MSG_RESULT($manlangs)
2249 manlangs=`echo $manlangs | sed "s/,/ /"` # replacing commas with spaces to produce a list
2250 AC_SUBST(manlangs)],
2253 AC_MSG_RESULT($manlangs)
2257 #################################################
2258 # these tests are taken from the GNU fileutils package
2259 AC_CHECKING(how to get filesystem space usage)
2262 # Test for statvfs64.
2263 if test $space = no; then
2265 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
2267 #if defined(HAVE_UNISTD_H)
2270 #include <sys/types.h>
2271 #include <sys/statvfs.h>
2274 struct statvfs64 fsd;
2275 exit (statvfs64 (".", &fsd));
2277 fu_cv_sys_stat_statvfs64=yes,
2278 fu_cv_sys_stat_statvfs64=no,
2279 fu_cv_sys_stat_statvfs64=cross)])
2280 if test $fu_cv_sys_stat_statvfs64 = yes; then
2282 AC_DEFINE(STAT_STATVFS64)
2286 # Perform only the link test since it seems there are no variants of the
2287 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2288 # because that got a false positive on SCO OSR5. Adding the declaration
2289 # of a `struct statvfs' causes this test to fail (as it should) on such
2290 # systems. That system is reported to work fine with STAT_STATFS4 which
2291 # is what it gets when this test fails.
2292 if test $space = no; then
2294 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2295 [AC_TRY_LINK([#include <sys/types.h>
2296 #include <sys/statvfs.h>],
2297 [struct statvfs fsd; statvfs (0, &fsd);],
2298 fu_cv_sys_stat_statvfs=yes,
2299 fu_cv_sys_stat_statvfs=no)])
2300 if test $fu_cv_sys_stat_statvfs = yes; then
2302 AC_DEFINE(STAT_STATVFS)
2306 if test $space = no; then
2307 # DEC Alpha running OSF/1
2308 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2309 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2311 #include <sys/param.h>
2312 #include <sys/types.h>
2313 #include <sys/mount.h>
2318 exit (statfs (".", &fsd, sizeof (struct statfs)));
2320 fu_cv_sys_stat_statfs3_osf1=yes,
2321 fu_cv_sys_stat_statfs3_osf1=no,
2322 fu_cv_sys_stat_statfs3_osf1=no)])
2323 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2324 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2326 AC_DEFINE(STAT_STATFS3_OSF1)
2330 if test $space = no; then
2332 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2333 member (AIX, 4.3BSD)])
2334 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2336 #ifdef HAVE_SYS_PARAM_H
2337 #include <sys/param.h>
2339 #ifdef HAVE_SYS_MOUNT_H
2340 #include <sys/mount.h>
2342 #ifdef HAVE_SYS_VFS_H
2343 #include <sys/vfs.h>
2349 exit (statfs (".", &fsd));
2351 fu_cv_sys_stat_statfs2_bsize=yes,
2352 fu_cv_sys_stat_statfs2_bsize=no,
2353 fu_cv_sys_stat_statfs2_bsize=no)])
2354 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2355 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2357 AC_DEFINE(STAT_STATFS2_BSIZE)
2361 if test $space = no; then
2363 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2364 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2365 [AC_TRY_RUN([#include <sys/types.h>
2366 #include <sys/statfs.h>
2370 exit (statfs (".", &fsd, sizeof fsd, 0));
2372 fu_cv_sys_stat_statfs4=yes,
2373 fu_cv_sys_stat_statfs4=no,
2374 fu_cv_sys_stat_statfs4=no)])
2375 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2376 if test $fu_cv_sys_stat_statfs4 = yes; then
2378 AC_DEFINE(STAT_STATFS4)
2382 if test $space = no; then
2384 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2385 member (4.4BSD and NetBSD)])
2386 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2387 [AC_TRY_RUN([#include <sys/types.h>
2388 #ifdef HAVE_SYS_PARAM_H
2389 #include <sys/param.h>
2391 #ifdef HAVE_SYS_MOUNT_H
2392 #include <sys/mount.h>
2398 exit (statfs (".", &fsd));
2400 fu_cv_sys_stat_statfs2_fsize=yes,
2401 fu_cv_sys_stat_statfs2_fsize=no,
2402 fu_cv_sys_stat_statfs2_fsize=no)])
2403 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2404 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2406 AC_DEFINE(STAT_STATFS2_FSIZE)
2410 if test $space = no; then
2412 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2413 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2414 [AC_TRY_RUN([#include <sys/types.h>
2415 #ifdef HAVE_SYS_PARAM_H
2416 #include <sys/param.h>
2418 #ifdef HAVE_SYS_MOUNT_H
2419 #include <sys/mount.h>
2421 #ifdef HAVE_SYS_FS_TYPES_H
2422 #include <sys/fs_types.h>
2427 /* Ultrix's statfs returns 1 for success,
2428 0 for not mounted, -1 for failure. */
2429 exit (statfs (".", &fsd) != 1);
2431 fu_cv_sys_stat_fs_data=yes,
2432 fu_cv_sys_stat_fs_data=no,
2433 fu_cv_sys_stat_fs_data=no)])
2434 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2435 if test $fu_cv_sys_stat_fs_data = yes; then
2437 AC_DEFINE(STAT_STATFS2_FS_DATA)
2442 # As a gating factor for large file support, in order to
2443 # use <4GB files we must have the following minimal support
2445 # long long, and a 64 bit off_t or off64_t.
2446 # If we don't have all of these then disable large
2449 AC_MSG_CHECKING([if large file support can be enabled])
2451 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2452 #include <sys/types.h>
2458 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2459 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2460 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2462 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
2464 AC_ARG_WITH(spinlocks,
2465 [ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ])
2466 if test "x$with_spinlocks" = "xyes"; then
2467 AC_DEFINE(USE_SPINLOCKS)
2471 AC_DEFINE(SPARC_SPINLOCKS)
2474 i386|i486|i586|i686)
2475 AC_DEFINE(INTEL_SPINLOCKS)
2479 AC_DEFINE(MIPS_SPINLOCKS)
2483 AC_DEFINE(POWERPC_SPINLOCKS)
2488 #################################################
2489 # check for ACL support
2491 AC_MSG_CHECKING(whether to support ACLs)
2492 AC_ARG_WITH(acl-support,
2493 [ --with-acl-support Include ACL support (default=no)],
2494 [ case "$withval" in
2499 AC_MSG_RESULT(Using UnixWare ACLs)
2500 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2503 AC_MSG_RESULT(Using solaris ACLs)
2504 AC_DEFINE(HAVE_SOLARIS_ACLS)
2507 AC_MSG_RESULT(Using HPUX ACLs)
2508 AC_DEFINE(HAVE_HPUX_ACLS)
2511 AC_MSG_RESULT(Using IRIX ACLs)
2512 AC_DEFINE(HAVE_IRIX_ACLS)
2515 AC_MSG_RESULT(Using AIX ACLs)
2516 AC_DEFINE(HAVE_AIX_ACLS)
2519 AC_MSG_RESULT(Using Tru64 ACLs)
2520 AC_DEFINE(HAVE_TRU64_ACLS)
2524 AC_CHECK_LIB(acl,acl_get_file)
2525 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2526 AC_TRY_LINK([#include <sys/types.h>
2527 #include <sys/acl.h>],
2528 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2529 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2530 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2531 AC_MSG_RESULT(Using posix ACLs)
2532 AC_DEFINE(HAVE_POSIX_ACLS)
2533 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2534 AC_TRY_LINK([#include <sys/types.h>
2535 #include <sys/acl.h>],
2536 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2537 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2538 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2539 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2547 AC_DEFINE(HAVE_NO_ACLS)
2550 AC_DEFINE(HAVE_NO_ACLS)
2554 #################################################
2555 # Check whether winbind is supported on this platform. If so we need to
2556 # build and install client programs (WINBIND_TARGETS), sbin programs
2557 # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2559 AC_MSG_CHECKING(whether to build winbind)
2561 # Initially, the value of $host_os decides whether winbind is supported
2564 *linux*|*solaris*|*irix*)
2569 winbind_no_reason=", unsupported on $host_os"
2573 # Check the setting of --with-winbindd
2575 AC_ARG_WITH(winbind,
2576 [ --with-winbind Build winbind (default, if supported by OS)],
2589 # We need unix domain sockets for winbind
2591 if test x"$HAVE_WINBIND" = x"yes"; then
2592 if test x"$samba_cv_unixsocket" = x"no"; then
2593 winbind_no_reason=", no unix domain socket support on $host_os"
2598 # Display test results
2603 WINBIND_PAM_PROGS=""
2605 if test x"$HAVE_WINBIND" = x"yes"; then
2608 WINBIND_TARGETS="bin/wbinfo"
2609 WINBIND_STARGETS="bin/winbindd"
2610 if test x"$BLDSHARED" = x"true"; then
2611 WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
2612 if test x"$with_pam" = x"yes"; then
2613 WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2617 AC_MSG_RESULT(no$winbind_no_reason)
2620 # Substitution time!
2622 AC_SUBST(WINBIND_TARGETS)
2623 AC_SUBST(WINBIND_STARGETS)
2624 AC_SUBST(WINBIND_LTARGETS)
2625 AC_SUBST(WINBIND_PAM_TARGETS)
2627 #################################################
2628 # Check to see if we should use the included popt
2630 AC_ARG_WITH(included-popt,
2631 [ --with-included-popt use bundled popt library, not from system],
2642 if test x"$INCLUDED_POPT" != x"yes"; then
2643 AC_CHECK_LIB(popt, poptGetContext,
2644 INCLUDED_POPT=no, INCLUDED_POPT=yes)
2647 AC_MSG_CHECKING(whether to use included popt)
2648 if test x"$INCLUDED_POPT" = x"yes"; then
2649 AC_MSG_RESULT($srcdir/popt)
2650 BUILD_POPT='$(POPT_OBJS)'
2651 FLAGS1="-I$srcdir/popt"
2656 AC_SUBST(BUILD_POPT)
2659 #################################################
2660 # final configure stuff
2662 echo "checking configure summary"
2663 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2664 echo "configure OK";,
2665 AC_MSG_ERROR([summary failure. Aborting config]),:)
2670 AC_OUTPUT(include/stamp-h Makefile)
2672 #################################################
2673 # Print very concise instructions on building/use
2674 if test "x$enable_dmalloc" = xyes
2676 AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
2677 AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])