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
89 # I'm sure gcc supports -rdynamic
90 if test "$ac_cv_prog_gcc" = yes; then
95 # Config CPPFLAG settings for strange OS's that must be set
99 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
103 # mmap on HPUX is completely broken...
104 AC_DEFINE(MMAP_BLACKLIST)
105 if test $ac_cv_prog_cc_Ae = yes; then
106 CPPFLAGS="$CPPFLAGS -Ae"
109 # Defines needed for HPUX support.
110 # HPUX has bigcrypt but (sometimes?) doesn't use it for
111 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
115 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
116 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
119 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
120 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
127 # CRAY Unicos has broken const handling
129 AC_MSG_RESULT([disabling const])
130 CPPFLAGS="$CPPFLAGS -Dconst="
134 # AIX4.x doesn't even admit to having large
135 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
138 AC_MSG_RESULT([enabling large file support])
139 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
142 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
143 # to the existance of large files..
144 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
145 # recommendations on large file support, however it makes the
146 # compile work using gcc 2.7 and 2.8, whereas using the Sun
147 # recommendation makes the compile fail on gcc2.7. JRA.
151 5.0*|5.1*|5.2*|5.3*|5.5*)
152 AC_MSG_RESULT([no large file support])
155 AC_MSG_RESULT([enabling large file support])
156 if test "$ac_cv_prog_gcc" = yes; then
157 ${CC-cc} -v >conftest.c 2>&1
158 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
160 case "$ac_cv_gcc_compiler_version_number" in
161 *"gcc version 2.6"*|*"gcc version 2.7"*)
162 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
165 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
170 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
176 # Tests needed for SINIX large file support.
179 if test $host = mips-sni-sysv4 ; then
180 AC_MSG_CHECKING([for LFS support])
181 old_CPPFLAGS="$CPPFLAGS"
182 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
186 #if _LFS64_LARGEFILE == 1
191 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
192 CPPFLAGS="$old_CPPFLAGS"
193 if test x$SINIX_LFS_SUPPORT = xyes ; then
194 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
195 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
196 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
197 LIBS="`getconf LFS64_LIBS` $LIBS"
199 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
203 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
206 AC_MSG_CHECKING([for LFS support])
207 old_CPPFLAGS="$CPPFLAGS"
208 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
211 #include <sys/utsname.h>
213 #if _LFS64_LARGEFILE == 1
218 /* Ensure this is glibc 2.2 or higher */
219 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
220 int libc_major = __GLIBC__;
221 int libc_minor = __GLIBC_MINOR__;
229 /* Ensure this is kernel 2.4 or higher */
232 release = uts.release;
233 major = atoi(strsep(&release, "."));
234 minor = atoi(strsep(&release, "."));
236 if (major > 2 || (major == 2 && minor > 3))
243 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
244 CPPFLAGS="$old_CPPFLAGS"
245 if test x$LINUX_LFS_SUPPORT = xyes ; then
246 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
248 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
252 AC_MSG_CHECKING([for LFS support])
253 old_CPPFLAGS="$CPPFLAGS"
254 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
258 #if _LFS64_LARGEFILE == 1
263 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
264 CPPFLAGS="$old_CPPFLAGS"
265 if test x$GLIBC_LFS_SUPPORT = xyes ; then
266 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
268 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
278 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
279 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
280 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
281 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
282 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
283 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
284 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
285 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h lber.h)
288 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
289 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
293 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
294 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
295 if test x"$ac_cv_header_shadow_h" = x"yes"; then
296 AC_DEFINE(HAVE_SHADOW_H)
300 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
301 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
302 AC_CHECK_HEADERS(stropts.h poll.h)
303 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
304 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
306 # For experimental utmp support (lastlog on some BSD-like systems)
307 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
309 # For quotas on Veritas VxFS filesystems
310 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
312 # For quotas on Linux XFS filesystems
313 AC_CHECK_HEADERS(linux/xqm.h)
315 AC_CHECK_SIZEOF(int,cross)
316 AC_CHECK_SIZEOF(long,cross)
317 AC_CHECK_SIZEOF(short,cross)
332 AC_CHECK_TYPE(ino_t,unsigned)
333 AC_CHECK_TYPE(loff_t,off_t)
334 AC_CHECK_TYPE(offset_t,loff_t)
335 AC_CHECK_TYPE(ssize_t, int)
336 AC_CHECK_TYPE(wchar_t, unsigned short)
338 ############################################
339 # for cups support we need libcups, and a handful of header files
341 AC_CHECK_LIB(cups,httpConnect)
343 # I wonder if there is a nicer way of doing this?
345 if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
346 AC_CHECK_HEADERS(cups/cups.h cups/language.h)
347 if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
348 if test x"$ac_cv_header_cups_language_h" = x"yes"; then
354 ############################################
355 # we need libdl for PAM, the password database plugins and the new VFS code
356 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
357 AC_DEFINE(HAVE_LIBDL)])
359 ############################################
360 # check if the compiler can do immediate structures
361 AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
365 typedef struct {unsigned x;} FOOBAR;
366 #define X_FOOBAR(x) ((FOOBAR) { x })
367 #define FOO_ONE X_FOOBAR(1)
375 samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
376 if test x"$samba_cv_immediate_structures" = x"yes"; then
377 AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES)
380 ############################################
381 # check for unix domain sockets
382 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
384 #include <sys/types.h>
387 #include <sys/socket.h>
388 #include <sys/un.h>],
390 struct sockaddr_un sunaddr;
391 sunaddr.sun_family = AF_UNIX;
393 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
394 if test x"$samba_cv_unixsocket" = x"yes"; then
395 AC_DEFINE(HAVE_UNIXSOCKET)
399 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
401 #include <sys/types.h>
406 #include <sys/socket.h>],[socklen_t i = 0],
407 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
408 if test x"$samba_cv_socklen_t" = x"yes"; then
409 AC_DEFINE(HAVE_SOCKLEN_T_TYPE)
412 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
414 #include <sys/types.h>
419 #include <signal.h>],[sig_atomic_t i = 0],
420 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
421 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
422 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
425 # stupid headers have the functions but no declaration. grrrr.
426 AC_HAVE_DECL(errno, [#include <errno.h>])
427 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
428 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
429 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
430 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
431 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
432 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
434 # and glibc has setresuid under linux but the function does
435 # nothing until kernel 2.1.44! very dumb.
436 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
437 AC_TRY_RUN([#include <errno.h>
438 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
439 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
440 if test x"$samba_cv_have_setresuid" = x"yes"; then
441 AC_DEFINE(HAVE_SETRESUID)
444 # Do the same check for setresguid...
446 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
447 AC_TRY_RUN([#include <unistd.h>
449 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
450 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
451 if test x"$samba_cv_have_setresgid" = x"yes"; then
452 AC_DEFINE(HAVE_SETRESGID)
457 ###############################################
458 # test for where we get crypt() from
459 AC_CHECK_FUNCS(crypt)
460 if test x"$ac_cv_func_crypt" = x"no"; then
461 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
462 AC_DEFINE(HAVE_CRYPT)])
466 ###############################################
467 # Readline included by default unless explicitly asked not to
468 test "${with_readline+set}" != "set" && with_readline=yes
470 # test for where we get readline() from
471 AC_MSG_CHECKING(whether to use readline)
472 AC_ARG_WITH(readline,
473 [ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto) ],
474 [ case "$with_readline" in
478 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
479 AC_CHECK_HEADERS(readline/history.h)
481 AC_CHECK_HEADERS(readline.h readline/readline.h,[
482 for termlib in ncurses curses termcap terminfo termlib; do
483 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
485 AC_CHECK_LIB(readline, rl_callback_handler_install,
486 [TERMLIBS="-lreadline $TERMLIBS"
487 AC_DEFINE(HAVE_LIBREADLINE)
488 break], [TERMLIBS=], $TERMLIBS)])
496 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
497 # alternate readline path
499 _cppflags=${CPPFLAGS}
501 # Add additional search path
502 LDFLAGS="-L$with_readline/lib $LDFLAGS"
503 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
505 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
506 AC_CHECK_HEADERS(readline/history.h)
508 AC_CHECK_HEADERS(readline.h readline/readline.h,[
509 for termlib in ncurses curses termcap terminfo termlib; do
510 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
512 AC_CHECK_LIB(readline, rl_callback_handler_install,
513 [TERMLDFLAGS="-L$with_readline/lib"
514 TERMCPPFLAGS="-I$with_readline/include"
515 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
516 TERMLIBS="-lreadline $TERMLIBS"
517 AC_DEFINE(HAVE_LIBREADLINE)
518 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
526 AC_SUBST(TERMLDFLAGS)
528 # The readline API changed slightly from readline3 to readline4, so
529 # code will generate warnings on one of them unless we have a few
531 AC_CHECK_LIB(readline, rl_completion_matches,
532 [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
533 [Do we have rl_completion_matches?])],
537 # The following test taken from the cvs sources
538 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
539 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
540 # libsocket.so which has a bad implementation of gethostbyname (it
541 # only looks in /etc/hosts), so we only look for -lsocket if we need
543 AC_CHECK_FUNCS(connect)
544 if test x"$ac_cv_func_connect" = x"no"; then
547 *) AC_CHECK_LIB(nsl_s, printf) ;;
551 *) AC_CHECK_LIB(nsl, printf) ;;
555 *) AC_CHECK_LIB(socket, connect) ;;
559 *) AC_CHECK_LIB(inet, connect) ;;
561 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
563 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
564 test x"$ac_cv_lib_inet_connect" = x"yes"; then
565 # ac_cv_func_connect=yes
566 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
567 AC_DEFINE(HAVE_CONNECT)
571 ###############################################
572 # test for where we get get_yp_default_domain() from
573 AC_CHECK_FUNCS(yp_get_default_domain)
574 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
575 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
576 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
579 # Check if we have execl, if not we need to compile smbrun.
580 AC_CHECK_FUNCS(execl)
581 if test x"$ac_cv_func_execl" = x"no"; then
587 AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
588 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
589 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
590 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
591 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath)
592 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
593 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
594 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
595 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
596 AC_CHECK_FUNCS(syslog vsyslog)
597 # setbuffer is needed for smbtorture
598 AC_CHECK_FUNCS(setbuffer)
600 # syscall() is needed for smbwrapper.
601 AC_CHECK_FUNCS(syscall)
603 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
604 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
605 AC_CHECK_FUNCS(__getcwd _getcwd)
606 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
607 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
608 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
609 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
610 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
611 AC_CHECK_FUNCS(_write __write _fork __fork)
612 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
613 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
614 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
615 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
616 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
619 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
622 if test x$ac_cv_func_stat64 = xno ; then
623 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
625 #if defined(HAVE_UNISTD_H)
628 #include <sys/stat.h>
629 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
630 AC_MSG_RESULT([$ac_cv_func_stat64])
631 if test x$ac_cv_func_stat64 = xyes ; then
632 AC_DEFINE(HAVE_STAT64)
636 if test x$ac_cv_func_lstat64 = xno ; then
637 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
639 #if defined(HAVE_UNISTD_H)
642 #include <sys/stat.h>
643 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
644 AC_MSG_RESULT([$ac_cv_func_lstat64])
645 if test x$ac_cv_func_lstat64 = xyes ; then
646 AC_DEFINE(HAVE_LSTAT64)
650 if test x$ac_cv_func_fstat64 = xno ; then
651 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
653 #if defined(HAVE_UNISTD_H)
656 #include <sys/stat.h>
657 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
658 AC_MSG_RESULT([$ac_cv_func_fstat64])
659 if test x$ac_cv_func_fstat64 = xyes ; then
660 AC_DEFINE(HAVE_FSTAT64)
664 #####################################
665 # we might need the resolv library on some systems
666 AC_CHECK_LIB(resolv, dn_expand)
669 # Check for the functions putprpwnam, set_auth_parameters,
670 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
671 # Needed for OSF1 and HPUX.
674 AC_LIBTESTFUNC(security, putprpwnam)
675 AC_LIBTESTFUNC(sec, putprpwnam)
677 AC_LIBTESTFUNC(security, set_auth_parameters)
678 AC_LIBTESTFUNC(sec, set_auth_parameters)
680 # UnixWare 7.x has its getspnam in -lgen
681 AC_LIBTESTFUNC(gen, getspnam)
683 AC_LIBTESTFUNC(security, getspnam)
684 AC_LIBTESTFUNC(sec, getspnam)
686 AC_LIBTESTFUNC(security, bigcrypt)
687 AC_LIBTESTFUNC(sec, bigcrypt)
689 AC_LIBTESTFUNC(security, getprpwnam)
690 AC_LIBTESTFUNC(sec, getprpwnam)
692 # this bit needs to be modified for each OS that is suported by
693 # smbwrapper. You need to specify how to created a shared library and
694 # how to compile C code to produce PIC object files
696 # these are the defaults, good for lots of systems
704 # Assume non-shared by default and override below
706 AC_MSG_CHECKING([ability to build shared libraries])
708 # and these are for particular systems
710 *linux*) AC_DEFINE(LINUX)
713 DYNEXP="-Wl,--export-dynamic"
715 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
720 LDSHFLAGS="-h \$@ -G"
721 if test "${ac_cv_prog_CC}" = "gcc"; then
728 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
730 *sunos*) AC_DEFINE(SUNOS4)
732 LDSHFLAGS="-Wl,-h,\$@ -G"
733 PICFLAG="-KPIC" # Is this correct for SunOS
735 *bsd*) BLDSHARED="true"
736 LDSHFLAGS="-Wl,-soname,\$@ -shared"
738 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
740 *irix*) AC_DEFINE(IRIX)
742 *irix6*) AC_DEFINE(IRIX6)
745 ATTEMPT_WRAP32_BUILD=yes
747 LDSHFLAGS="-soname \$@ -shared"
749 if test "${ac_cv_prog_CC}" = "gcc"; then
754 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
756 *aix*) AC_DEFINE(AIX)
758 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
759 PICFLAG="-O2 -qmaxmem=6000"
760 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
762 *hpux*) AC_DEFINE(HPUX)
764 # Use special PIC flags for the native HP-UX compiler.
765 if test $ac_cv_prog_cc_Ae = yes; then
768 LDSHFLAGS="-B symbolic -b -z +h \$@"
772 AC_DEFINE(STAT_ST_BLOCKSIZE,8192)
774 *qnx*) AC_DEFINE(QNX);;
775 *osf*) AC_DEFINE(OSF1)
777 LDSHFLAGS="-Wl,-soname,\$@ -shared"
783 *unixware*) AC_DEFINE(UNIXWARE)
785 LDSHFLAGS="-Wl,-soname,\$@ -shared"
788 *next2*) AC_DEFINE(NEXT2);;
789 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
793 if [ test "$GCC" != yes ]; then
794 AC_DEFINE(HAVE_MEMSET)
800 AC_DEFINE(RELIANTUNIX)
806 if [ test "$GCC" != yes ]; then
807 AC_DEFINE(HAVE_MEMSET)
813 AC_MSG_RESULT($BLDSHARED)
814 AC_MSG_CHECKING([linker flags for shared libraries])
815 AC_MSG_RESULT([$LDSHFLAGS])
816 AC_MSG_CHECKING([compiler flags for position-independent code])
817 AC_MSG_RESULT([$PICFLAGS])
819 #######################################################
820 # test whether building a shared library actually works
821 if test $BLDSHARED = true; then
822 AC_CACHE_CHECK([whether building shared libraries actually works],
823 [ac_cv_shlib_works],[
825 # try building a trivial shared library
826 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
827 $SHLD $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
828 ac_cv_shlib_works=yes
829 rm -f shlib.so shlib.po
831 if test $ac_cv_shlib_works = no; then
837 # this updates our target list if we can build shared libs
838 if test $BLDSHARED = true; then
839 LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
846 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
847 AC_TRY_RUN([#include <stdio.h>
848 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
849 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
850 if test x"$samba_cv_have_longlong" = x"yes"; then
851 AC_DEFINE(HAVE_LONGLONG)
855 # Check if the compiler supports the LL prefix on long long integers.
858 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
859 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
860 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
861 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
862 AC_DEFINE(COMPILER_SUPPORTS_LL)
866 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
867 AC_TRY_RUN([#include <stdio.h>
868 #include <sys/stat.h>
869 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
870 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
871 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
872 AC_DEFINE(SIZEOF_OFF_T,8)
875 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
877 #if defined(HAVE_UNISTD_H)
881 #include <sys/stat.h>
882 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
883 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
884 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
885 AC_DEFINE(HAVE_OFF64_T)
888 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
889 AC_TRY_RUN([#include <stdio.h>
890 #include <sys/stat.h>
891 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
892 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
893 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
894 AC_DEFINE(SIZEOF_INO_T,8)
897 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
899 #if defined(HAVE_UNISTD_H)
903 #include <sys/stat.h>
904 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
905 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
906 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
907 AC_DEFINE(HAVE_INO64_T)
910 AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
912 #if defined(HAVE_UNISTD_H)
916 #include <sys/stat.h>
917 main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
918 samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
919 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
920 AC_DEFINE(HAVE_DEV64_T)
923 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
925 #if defined(HAVE_UNISTD_H)
928 #include <sys/types.h>
929 #include <dirent.h>],
930 [struct dirent64 de;],
931 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
932 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
933 AC_DEFINE(HAVE_STRUCT_DIRENT64)
936 AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
938 #if defined(HAVE_UNISTD_H)
941 #include <sys/types.h>
942 main() { dev_t dev; int i = major(dev); return 0; }],
943 samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
944 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
945 AC_DEFINE(HAVE_DEVICE_MAJOR_FN)
948 AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
950 #if defined(HAVE_UNISTD_H)
953 #include <sys/types.h>
954 main() { dev_t dev; int i = minor(dev); return 0; }],
955 samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
956 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
957 AC_DEFINE(HAVE_DEVICE_MINOR_FN)
960 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
961 AC_TRY_RUN([#include <stdio.h>
962 main() { char c; c=250; exit((c > 0)?0:1); }],
963 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
964 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
965 AC_DEFINE(HAVE_UNSIGNED_CHAR)
968 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
969 AC_TRY_COMPILE([#include <sys/types.h>
970 #include <sys/socket.h>
971 #include <netinet/in.h>],
972 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
973 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
974 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
975 AC_DEFINE(HAVE_SOCK_SIN_LEN)
978 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
979 AC_TRY_COMPILE([#include <sys/types.h>
981 void seekdir(DIR *d, long loc) { return; }],[return 0;],
982 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
983 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
984 AC_DEFINE(SEEKDIR_RETURNS_VOID)
987 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
988 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
989 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
990 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
991 AC_DEFINE(HAVE_FILE_MACRO)
994 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
995 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
996 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
997 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
998 AC_DEFINE(HAVE_FUNCTION_MACRO)
1001 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
1003 #include <sys/time.h>
1005 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
1006 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
1007 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
1008 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
1011 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
1013 #include <sys/types.h>
1015 void foo(const char *format, ...) {
1020 va_start(ap, format);
1021 len = vsnprintf(buf, 0, format, ap);
1023 if (len != 5) exit(1);
1025 va_start(ap, format);
1026 len = vsnprintf(0, 0, format, ap);
1028 if (len != 5) exit(1);
1030 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1034 main() { foo("hello"); }
1036 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
1037 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1038 AC_DEFINE(HAVE_C99_VSNPRINTF)
1041 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1042 AC_TRY_RUN([#include <sys/types.h>
1044 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1045 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1046 di->d_name[0] == 0) exit(0); exit(1);} ],
1047 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
1048 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1049 AC_DEFINE(HAVE_BROKEN_READDIR)
1052 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1053 AC_TRY_COMPILE([#include <sys/types.h>
1054 #include <utime.h>],
1055 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1056 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
1057 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
1058 AC_DEFINE(HAVE_UTIMBUF)
1061 dnl utmp and utmpx come in many flavours
1062 dnl We need to check for many of them
1063 dnl But we don't need to do each and every one, because our code uses
1064 dnl mostly just the utmp (not utmpx) fields.
1066 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
1068 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
1069 AC_TRY_COMPILE([#include <sys/types.h>
1071 [struct utmp ut; ut.ut_name[0] = 'a';],
1072 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
1073 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
1074 AC_DEFINE(HAVE_UT_UT_NAME)
1077 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
1078 AC_TRY_COMPILE([#include <sys/types.h>
1080 [struct utmp ut; ut.ut_user[0] = 'a';],
1081 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
1082 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
1083 AC_DEFINE(HAVE_UT_UT_USER)
1086 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
1087 AC_TRY_COMPILE([#include <sys/types.h>
1089 [struct utmp ut; ut.ut_id[0] = 'a';],
1090 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
1091 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
1092 AC_DEFINE(HAVE_UT_UT_ID)
1095 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
1096 AC_TRY_COMPILE([#include <sys/types.h>
1098 [struct utmp ut; ut.ut_host[0] = 'a';],
1099 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
1100 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
1101 AC_DEFINE(HAVE_UT_UT_HOST)
1104 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
1105 AC_TRY_COMPILE([#include <sys/types.h>
1107 [struct utmp ut; time_t t; ut.ut_time = t;],
1108 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
1109 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
1110 AC_DEFINE(HAVE_UT_UT_TIME)
1113 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
1114 AC_TRY_COMPILE([#include <sys/types.h>
1116 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
1117 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
1118 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
1119 AC_DEFINE(HAVE_UT_UT_TV)
1122 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
1123 AC_TRY_COMPILE([#include <sys/types.h>
1125 [struct utmp ut; ut.ut_type = 0;],
1126 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
1127 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
1128 AC_DEFINE(HAVE_UT_UT_TYPE)
1131 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
1132 AC_TRY_COMPILE([#include <sys/types.h>
1134 [struct utmp ut; ut.ut_pid = 0;],
1135 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
1136 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
1137 AC_DEFINE(HAVE_UT_UT_PID)
1140 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1141 AC_TRY_COMPILE([#include <sys/types.h>
1143 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1144 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1145 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1146 AC_DEFINE(HAVE_UT_UT_EXIT)
1149 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1150 AC_TRY_COMPILE([#include <sys/types.h>
1152 [struct utmp ut; ut.ut_addr = 0;],
1153 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1154 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1155 AC_DEFINE(HAVE_UT_UT_ADDR)
1158 if test x$ac_cv_func_pututline = xyes ; then
1159 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1160 AC_TRY_COMPILE([#include <sys/types.h>
1162 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1163 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1164 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1165 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1169 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1170 AC_TRY_COMPILE([#include <sys/types.h>
1171 #include <utmpx.h>],
1172 [struct utmpx ux; ux.ut_syslen = 0;],
1173 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1174 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1175 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1179 #################################################
1180 # check for libiconv support
1181 AC_MSG_CHECKING(whether to use libiconv)
1182 AC_ARG_WITH(libiconv,
1183 [ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
1184 [ case "$withval" in
1190 CFLAGS="$CFLAGS -I$withval/include"
1191 LDFLAGS="$LDFLAGS -L$withval/lib"
1192 AC_CHECK_LIB(iconv, iconv_open)
1193 AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}")
1201 # check for iconv in libc
1202 AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
1206 iconv_t cd = iconv_open("ASCII", "UCS-2LE");
1207 if (cd == 0 || cd == (iconv_t)-1) return -1;
1211 samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)])
1212 if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
1213 AC_DEFINE(HAVE_NATIVE_ICONV)
1217 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1219 #include <sys/types.h>
1222 #define F_GETLEASE 1025
1225 int fd = open("/dev/null", O_RDONLY);
1226 return fcntl(fd, F_GETLEASE, 0) == -1;
1229 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1230 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1231 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1234 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1236 #include <sys/types.h>
1240 #define F_NOTIFY 1026
1243 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1246 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1247 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1248 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1251 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1253 #include <sys/types.h>
1256 #include <sys/file.h>
1258 #define LOCK_MAND 32
1259 #define LOCK_READ 64
1262 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1265 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1266 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1267 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1273 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1274 AC_TRY_COMPILE([#include <sys/types.h>
1275 #include <fcntl.h>],
1276 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1277 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1278 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1279 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1282 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1283 AC_TRY_RUN([#include <sys/types.h>
1284 #include <sys/capability.h>
1287 if ((cap = cap_get_proc()) == NULL)
1289 cap->cap_effective |= CAP_NETWORK_MGT;
1290 cap->cap_inheritable |= CAP_NETWORK_MGT;
1295 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1296 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1297 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1301 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1302 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1305 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_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_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1312 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1313 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1316 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1317 AC_TRY_COMPILE([#include <sys/types.h>
1318 #if defined(HAVE_RPC_RPC_H)
1319 #include <rpc/rpc.h>
1322 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1323 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1324 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1327 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1328 AC_TRY_COMPILE([#include <sys/types.h>
1329 #if defined(HAVE_RPC_RPC_H)
1330 #include <rpc/rpc.h>
1333 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1334 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1335 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1338 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1339 AC_TRY_COMPILE([#include <sys/types.h>
1340 #if defined(HAVE_RPC_RPC_H)
1341 #include <rpc/rpc.h>
1344 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1345 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1346 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1350 dnl Some systems (SCO) have a problem including
1351 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1352 dnl as a #define in <prot.h> and as part of an enum
1356 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1357 AC_TRY_COMPILE([#include <sys/types.h>
1358 #ifdef HAVE_SYS_SECURITY_H
1359 #include <sys/security.h>
1361 #endif /* HAVE_SYS_SECURITY_H */
1362 #if defined(HAVE_RPC_RPC_H)
1363 #include <rpc/rpc.h>
1366 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1367 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1368 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1371 AC_MSG_CHECKING([for test routines])
1372 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1374 AC_MSG_ERROR([cant find test code. Aborting config]),
1375 AC_MSG_WARN([cannot run when cross-compiling]))
1377 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1378 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1379 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1380 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1381 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1384 AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
1385 AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
1386 samba_cv_HAVE_WORKING_AF_LOCAL=yes,
1387 samba_cv_HAVE_WORKING_AF_LOCAL=no,
1388 samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
1389 if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
1391 AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
1394 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1395 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1396 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1397 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1398 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1401 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1402 SAVE_CPPFLAGS="$CPPFLAGS"
1403 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1405 #define REPLACE_GETPASS 1
1406 #define NO_CONFIG_H 1
1407 #define main dont_declare_main
1408 #include "${srcdir-.}/lib/getsmbpass.c"
1410 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1411 CPPFLAGS="$SAVE_CPPFLAGS"
1413 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1414 AC_DEFINE(REPLACE_GETPASS)
1417 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1420 #include <sys/types.h>
1421 #include <netinet/in.h>
1422 #ifdef HAVE_ARPA_INET_H
1423 #include <arpa/inet.h>
1425 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1426 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1427 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1429 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1430 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1431 AC_DEFINE(REPLACE_INET_NTOA)
1434 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1435 AC_TRY_RUN([#include <stdlib.h>
1436 #include <sys/types.h>
1437 #include <sys/stat.h>
1441 char tpl[20]="/tmp/test.XXXXXX";
1442 int fd = mkstemp(tpl);
1443 if (fd == -1) exit(1);
1445 if (fstat(fd, &st) != 0) exit(1);
1446 if ((st.st_mode & 0777) != 0600) exit(1);
1449 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1450 samba_cv_HAVE_SECURE_MKSTEMP=no,
1451 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1452 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1453 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1456 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1457 AC_TRY_RUN([#include <unistd.h>
1458 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1459 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1460 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1461 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1464 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1465 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1466 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1467 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1468 AC_DEFINE(HAVE_ROOT)
1470 AC_MSG_WARN(running as non-root will disable some tests)
1474 # look for a method of finding the list of network interfaces
1476 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1478 #define HAVE_IFACE_AIX 1
1479 #define AUTOCONF_TEST 1
1480 #include "confdefs.h"
1481 #include "${srcdir-.}/lib/interfaces.c"],
1482 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1483 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1484 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1487 if test $iface = no; then
1488 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1490 #define HAVE_IFACE_IFCONF 1
1491 #define AUTOCONF_TEST 1
1492 #include "confdefs.h"
1493 #include "${srcdir-.}/lib/interfaces.c"],
1494 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1495 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1496 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1500 if test $iface = no; then
1501 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1503 #define HAVE_IFACE_IFREQ 1
1504 #define AUTOCONF_TEST 1
1505 #include "confdefs.h"
1506 #include "${srcdir-.}/lib/interfaces.c"],
1507 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1508 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1509 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1514 ################################################
1515 # look for a method of setting the effective uid
1517 if test $seteuid = no; then
1518 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1520 #define AUTOCONF_TEST 1
1521 #define USE_SETRESUID 1
1522 #include "confdefs.h"
1523 #include "${srcdir-.}/lib/util_sec.c"],
1524 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1525 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1526 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1531 if test $seteuid = no; then
1532 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1534 #define AUTOCONF_TEST 1
1535 #define USE_SETREUID 1
1536 #include "confdefs.h"
1537 #include "${srcdir-.}/lib/util_sec.c"],
1538 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1539 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1540 seteuid=yes;AC_DEFINE(USE_SETREUID)
1544 if test $seteuid = no; then
1545 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1547 #define AUTOCONF_TEST 1
1548 #define USE_SETEUID 1
1549 #include "confdefs.h"
1550 #include "${srcdir-.}/lib/util_sec.c"],
1551 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1552 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1553 seteuid=yes;AC_DEFINE(USE_SETEUID)
1557 if test $seteuid = no; then
1558 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1560 #define AUTOCONF_TEST 1
1561 #define USE_SETUIDX 1
1562 #include "confdefs.h"
1563 #include "${srcdir-.}/lib/util_sec.c"],
1564 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1565 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1566 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1571 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1572 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1573 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1574 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1575 AC_DEFINE(HAVE_MMAP)
1578 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1579 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1580 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1581 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1582 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1585 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1586 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1587 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1588 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1589 AC_DEFINE(HAVE_FCNTL_LOCK)
1592 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1593 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1594 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1595 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1596 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1601 dnl Don't check for 64 bit fcntl locking if we know that the
1602 dnl glibc2.1 broken check has succeeded.
1605 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1607 #if defined(HAVE_UNISTD_H)
1617 #ifdef HAVE_SYS_FCNTL_H
1618 #include <sys/fcntl.h>
1620 main() { struct flock64 fl64;
1621 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1627 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1629 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1630 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1634 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1635 AC_TRY_COMPILE([#include <sys/types.h>
1636 #include <sys/stat.h>
1637 #include <unistd.h>],
1638 [struct stat st; st.st_blocks = 0;],
1639 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1640 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1641 AC_DEFINE(HAVE_STAT_ST_BLOCKS)
1646 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1648 #ifdef HAVE_SYS_VFS_H
1649 #include <sys/vfs.h>
1651 #ifdef HAVE_SYS_CAPABILITY_H
1652 #include <sys/capability.h>
1655 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1656 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1657 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS)
1662 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1663 AC_TRY_COMPILE([#include <sys/acl.h>
1664 #if defined(HAVE_RPCSVC_NIS_H)
1665 #include <rpcsvc/nis.h>
1668 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1669 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1670 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1674 #################################################
1675 # check for smbwrapper support
1676 AC_MSG_CHECKING(whether to use smbwrapper)
1677 AC_ARG_WITH(smbwrapper,
1678 [ --with-smbwrapper Include SMB wrapper support (default=no) ],
1679 [ case "$withval" in
1682 AC_DEFINE(WITH_SMBWRAPPER)
1683 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1685 if test x$ATTEMPT_WRAP32_BUILD = x; then
1688 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1691 # Conditions under which smbwrapper should not be built.
1693 if test x$PICFLAG = x; then
1694 echo No support for PIC code - disabling smbwrapper and smbsh
1697 elif test x$ac_cv_func_syscall = xno; then
1698 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1710 #################################################
1711 # check for AFS clear-text auth support
1712 AC_MSG_CHECKING(whether to use AFS clear-text auth)
1714 [ --with-afs Include AFS clear-text auth support (default=no) ],
1715 [ case "$withval" in
1728 #################################################
1729 # check for the DFS clear-text auth system
1730 AC_MSG_CHECKING(whether to use DFS clear-text auth)
1732 [ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)],
1733 [ case "$withval" in
1746 #################################################
1747 # see if this box has the RedHat location for kerberos
1748 AC_MSG_CHECKING(for /usr/kerberos)
1749 if test -d /usr/kerberos; then
1750 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
1751 CFLAGS="$CFLAGS -I/usr/kerberos/include"
1752 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1758 #################################################
1759 # check for location of Kerberos 5 install
1760 AC_MSG_CHECKING(for kerberos 5 install path)
1762 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
1763 [ case "$withval" in
1770 CFLAGS="$CFLAGS -I$withval/include"
1771 CPPFLAGS="$CPPFLAGS -I$withval/include"
1772 LDFLAGS="$LDFLAGS -L$withval/lib"
1778 # now check for krb5.h. Some systems have the libraries without the headers!
1779 # note that this check is done here to allow for different kerberos
1781 AC_CHECK_HEADERS(krb5.h)
1783 # now check for gssapi headers. This is also done here to allow for
1784 # different kerberos include paths
1785 AC_CHECK_HEADERS(gssapi/gssapi_generic.h gssapi/gssapi.h)
1787 ##################################################################
1788 # we might need the k5crypto and com_err libraries on some systems
1789 AC_CHECK_LIB(com_err, _et_list, [LIBS="$LIBS -lcom_err"])
1790 AC_CHECK_LIB(k5crypto, krb5_encrypt_data, [LIBS="$LIBS -lk5crypto"])
1792 ########################################################
1793 # now see if we can find the krb5 libs in standard paths
1794 # or as specified above
1795 AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
1796 AC_DEFINE(HAVE_KRB5)])
1798 ########################################################
1799 # now see if we can find the gssapi libs in standard paths
1800 AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5";
1801 AC_DEFINE(HAVE_GSSAPI)])
1803 ##################################################################
1804 # we might need the lber lib on some systems. To avoid link errors
1805 # this test must be before the libldap test
1806 AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
1808 ########################################################
1809 # now see if we can find the ldap libs in standard paths
1810 if test x$have_ldap != xyes; then
1811 AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
1812 AC_DEFINE(HAVE_LDAP)])
1815 #################################################
1816 # check for automount support
1817 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1818 AC_ARG_WITH(automount,
1819 [ --with-automount Include AUTOMOUNT support (default=no)],
1820 [ case "$withval" in
1823 AC_DEFINE(WITH_AUTOMOUNT)
1832 #################################################
1833 # check for smbmount support
1834 AC_MSG_CHECKING(whether to use SMBMOUNT)
1835 AC_ARG_WITH(smbmount,
1836 [ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1837 [ case "$withval" in
1842 AC_DEFINE(WITH_SMBMOUNT)
1843 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1846 AC_MSG_ERROR(not on a linux system!)
1860 #################################################
1861 # check for a PAM clear-text auth, accounts, password and session support
1862 with_pam_for_crypt=no
1863 AC_MSG_CHECKING(whether to use PAM)
1865 [ --with-pam Include PAM support (default=no)],
1866 [ case "$withval" in
1871 with_pam_for_crypt=yes
1880 # we can't build a pam module if we don't have pam.
1881 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1883 #################################################
1884 # check for pam_smbpass support
1885 AC_MSG_CHECKING(whether to use pam_smbpass)
1886 AC_ARG_WITH(pam_smbpass,
1887 [ --with-pam_smbpass Build a PAM module to allow other applications to use our smbpasswd file (default=no)],
1888 [ case "$withval" in
1892 # Conditions under which pam_smbpass should not be built.
1894 if test x$PICFLAG = x; then
1895 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1897 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1898 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1901 PAM_MOD="bin/pam_smbpass.so"
1912 ###############################################
1913 # test for where we get crypt() from, but only
1915 if test $with_pam_for_crypt = no; then
1916 AC_CHECK_FUNCS(crypt)
1917 if test x"$ac_cv_func_crypt" = x"no"; then
1918 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1919 AC_DEFINE(HAVE_CRYPT)])
1924 ## moved after the check for -lcrypt in order to
1925 ## ensure that the necessary libraries are included
1926 ## check checking for truncated salt. Wrapped by the
1927 ## $with_pam_for_crypt variable as above --jerry
1929 if test $with_pam_for_crypt = no; then
1930 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1931 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1932 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1933 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1934 AC_DEFINE(HAVE_TRUNCATED_SALT)
1940 ########################################################################################
1942 ## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
1944 ########################################################################################
1946 #################################################
1947 # check for a TDB password database
1948 AC_MSG_CHECKING(whether to use TDB SAM database)
1950 [ --with-tdbsam Include experimental TDB SAM support (default=no)],
1951 [ case "$withval" in
1954 AC_DEFINE(WITH_TDB_SAM)
1963 #################################################
1964 # check for a LDAP password database
1965 AC_MSG_CHECKING(whether to use LDAP SAM database)
1966 AC_ARG_WITH(ldapsam,
1967 [ --with-ldapsam Include experimental LDAP SAM support (default=no)],
1968 [ case "$withval" in
1971 AC_DEFINE(WITH_LDAP_SAM)
1972 LIBS="-lldap -llber $LIBS"
1981 #################################################
1982 # check for a NISPLUS password database
1983 AC_MSG_CHECKING(whether to use NISPLUS SAM database)
1984 AC_ARG_WITH(nisplussam,
1985 [ --with-nisplussam Include NISPLUS SAM support (default=no)],
1986 [ case "$withval" in
1989 AC_DEFINE(WITH_NISPLUS_SAM)
1998 ########################################################################################
2000 ## END OF TESTS FOR SAM BACKENDS.
2002 ########################################################################################
2004 #################################################
2005 # check for a NISPLUS_HOME support
2006 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
2007 AC_ARG_WITH(nisplus-home,
2008 [ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
2009 [ case "$withval" in
2012 AC_DEFINE(WITH_NISPLUS_HOME)
2021 #################################################
2022 # check for the secure socket layer
2023 AC_MSG_CHECKING(whether to use SSL)
2025 [ --with-ssl Include SSL support (default=no)
2026 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
2027 --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
2028 [ case "$withval" in
2032 withval="/usr/local/ssl" # default
2034 if test "${with_sslinc+set}" = set; then
2036 withval="$with_sslinc"
2039 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
2040 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2043 CFLAGS="-I${withval} $CFLAGS"
2049 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
2053 if test "${with_ssllib+set}" = set; then
2055 withval="$with_ssllib"
2058 echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
2059 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2062 LDFLAGS="-L${withval}/lib $LDFLAGS"
2068 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
2072 LIBS="-lssl -lcrypto $LIBS"
2074 # if test ! -d ${withval}; then
2075 # echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
2079 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
2089 #################################################
2090 # check for syslog logging
2091 AC_MSG_CHECKING(whether to use syslog logging)
2093 [ --with-syslog Include experimental SYSLOG support (default=no)],
2094 [ case "$withval" in
2097 AC_DEFINE(WITH_SYSLOG)
2106 #################################################
2107 # check for a shared memory profiling support
2108 AC_MSG_CHECKING(whether to use profiling)
2109 AC_ARG_WITH(profiling-data,
2110 [ --with-profiling-data Include gathering source code profile information (default=no)],
2111 [ case "$withval" in
2114 AC_DEFINE(WITH_PROFILE)
2124 #################################################
2125 # check for experimental disk-quotas support
2126 QUOTAOBJS=smbd/noquotas.o
2128 AC_MSG_CHECKING(whether to support disk-quotas)
2130 [ --with-quotas Include experimental disk-quota support (default=no)],
2131 [ case "$withval" in
2136 # Check for kernel 2.4.x quota braindamage...
2137 AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
2138 AC_TRY_COMPILE([#include <stdio.h>
2139 #include <sys/types.h>
2140 #include <asm/types.h>
2141 #include <linux/quota.h>
2143 #include <linux/unistd.h>],[struct mem_dqblk D;],
2144 samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
2145 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
2146 AC_DEFINE(LINUX_QUOTAS_2)
2148 AC_DEFINE(LINUX_QUOTAS_1)
2154 QUOTAOBJS=smbd/quotas.o
2155 AC_DEFINE(WITH_QUOTAS)
2165 #################################################
2166 # check for experimental utmp accounting
2168 AC_MSG_CHECKING(whether to support utmp accounting)
2170 [ --with-utmp Include experimental utmp accounting (default=no)],
2171 [ case "$withval" in
2174 AC_DEFINE(WITH_UTMP)
2183 #################################################
2184 # set private directory location
2185 AC_ARG_WITH(privatedir,
2186 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
2187 [ case "$withval" in
2190 # Just in case anybody calls it without argument
2192 AC_MSG_WARN([--with-privatedir called without argument - will use default])
2193 privatedir='${prefix}/private'
2196 privatedir="$withval"
2199 AC_SUBST(privatedir)],
2200 [privatedir='${prefix}/private'
2201 AC_SUBST(privatedir)]
2204 #################################################
2205 # set lock directory location
2206 AC_ARG_WITH(lockdir,
2207 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
2208 [ case "$withval" in
2211 # Just in case anybody calls it without argument
2213 AC_MSG_WARN([--with-lockdir called without argument - will use default])
2214 lockdir='$(VARDIR)/locks'
2221 [lockdir='$(VARDIR)/locks'
2225 #################################################
2226 # set SWAT directory location
2227 AC_ARG_WITH(swatdir,
2228 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
2229 [ case "$withval" in
2232 # Just in case anybody does it
2234 AC_MSG_WARN([--with-swatdir called without argument - will use default])
2235 swatdir='${prefix}/swat'
2242 [swatdir='${prefix}/swat'
2246 #################################################
2247 # choose native language(s) of man pages
2248 AC_MSG_CHECKING(chosen man pages' language(s))
2249 AC_ARG_WITH(manpages-langs,
2250 [ --with-manpages-langs={en,ja,pl} Choose man pages' language(s). (en)],
2251 [ case "$withval" in
2253 AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
2261 AC_MSG_RESULT($manlangs)
2262 manlangs=`echo $manlangs | sed "s/,/ /"` # replacing commas with spaces to produce a list
2263 AC_SUBST(manlangs)],
2266 AC_MSG_RESULT($manlangs)
2270 #################################################
2271 # these tests are taken from the GNU fileutils package
2272 AC_CHECKING(how to get filesystem space usage)
2275 # Test for statvfs64.
2276 if test $space = no; then
2278 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
2280 #if defined(HAVE_UNISTD_H)
2283 #include <sys/types.h>
2284 #include <sys/statvfs.h>
2287 struct statvfs64 fsd;
2288 exit (statvfs64 (".", &fsd));
2290 fu_cv_sys_stat_statvfs64=yes,
2291 fu_cv_sys_stat_statvfs64=no,
2292 fu_cv_sys_stat_statvfs64=cross)])
2293 if test $fu_cv_sys_stat_statvfs64 = yes; then
2295 AC_DEFINE(STAT_STATVFS64)
2299 # Perform only the link test since it seems there are no variants of the
2300 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2301 # because that got a false positive on SCO OSR5. Adding the declaration
2302 # of a `struct statvfs' causes this test to fail (as it should) on such
2303 # systems. That system is reported to work fine with STAT_STATFS4 which
2304 # is what it gets when this test fails.
2305 if test $space = no; then
2307 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2308 [AC_TRY_LINK([#include <sys/types.h>
2309 #include <sys/statvfs.h>],
2310 [struct statvfs fsd; statvfs (0, &fsd);],
2311 fu_cv_sys_stat_statvfs=yes,
2312 fu_cv_sys_stat_statvfs=no)])
2313 if test $fu_cv_sys_stat_statvfs = yes; then
2315 AC_DEFINE(STAT_STATVFS)
2319 if test $space = no; then
2320 # DEC Alpha running OSF/1
2321 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2322 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2324 #include <sys/param.h>
2325 #include <sys/types.h>
2326 #include <sys/mount.h>
2331 exit (statfs (".", &fsd, sizeof (struct statfs)));
2333 fu_cv_sys_stat_statfs3_osf1=yes,
2334 fu_cv_sys_stat_statfs3_osf1=no,
2335 fu_cv_sys_stat_statfs3_osf1=no)])
2336 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2337 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2339 AC_DEFINE(STAT_STATFS3_OSF1)
2343 if test $space = no; then
2345 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2346 member (AIX, 4.3BSD)])
2347 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2349 #ifdef HAVE_SYS_PARAM_H
2350 #include <sys/param.h>
2352 #ifdef HAVE_SYS_MOUNT_H
2353 #include <sys/mount.h>
2355 #ifdef HAVE_SYS_VFS_H
2356 #include <sys/vfs.h>
2362 exit (statfs (".", &fsd));
2364 fu_cv_sys_stat_statfs2_bsize=yes,
2365 fu_cv_sys_stat_statfs2_bsize=no,
2366 fu_cv_sys_stat_statfs2_bsize=no)])
2367 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2368 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2370 AC_DEFINE(STAT_STATFS2_BSIZE)
2374 if test $space = no; then
2376 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2377 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2378 [AC_TRY_RUN([#include <sys/types.h>
2379 #include <sys/statfs.h>
2383 exit (statfs (".", &fsd, sizeof fsd, 0));
2385 fu_cv_sys_stat_statfs4=yes,
2386 fu_cv_sys_stat_statfs4=no,
2387 fu_cv_sys_stat_statfs4=no)])
2388 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2389 if test $fu_cv_sys_stat_statfs4 = yes; then
2391 AC_DEFINE(STAT_STATFS4)
2395 if test $space = no; then
2397 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2398 member (4.4BSD and NetBSD)])
2399 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2400 [AC_TRY_RUN([#include <sys/types.h>
2401 #ifdef HAVE_SYS_PARAM_H
2402 #include <sys/param.h>
2404 #ifdef HAVE_SYS_MOUNT_H
2405 #include <sys/mount.h>
2411 exit (statfs (".", &fsd));
2413 fu_cv_sys_stat_statfs2_fsize=yes,
2414 fu_cv_sys_stat_statfs2_fsize=no,
2415 fu_cv_sys_stat_statfs2_fsize=no)])
2416 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2417 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2419 AC_DEFINE(STAT_STATFS2_FSIZE)
2423 if test $space = no; then
2425 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2426 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2427 [AC_TRY_RUN([#include <sys/types.h>
2428 #ifdef HAVE_SYS_PARAM_H
2429 #include <sys/param.h>
2431 #ifdef HAVE_SYS_MOUNT_H
2432 #include <sys/mount.h>
2434 #ifdef HAVE_SYS_FS_TYPES_H
2435 #include <sys/fs_types.h>
2440 /* Ultrix's statfs returns 1 for success,
2441 0 for not mounted, -1 for failure. */
2442 exit (statfs (".", &fsd) != 1);
2444 fu_cv_sys_stat_fs_data=yes,
2445 fu_cv_sys_stat_fs_data=no,
2446 fu_cv_sys_stat_fs_data=no)])
2447 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2448 if test $fu_cv_sys_stat_fs_data = yes; then
2450 AC_DEFINE(STAT_STATFS2_FS_DATA)
2455 # As a gating factor for large file support, in order to
2456 # use <4GB files we must have the following minimal support
2458 # long long, and a 64 bit off_t or off64_t.
2459 # If we don't have all of these then disable large
2462 AC_MSG_CHECKING([if large file support can be enabled])
2464 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2465 #include <sys/types.h>
2471 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2472 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2473 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2475 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
2477 AC_ARG_WITH(spinlocks,
2478 [ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ])
2479 if test "x$with_spinlocks" = "xyes"; then
2480 AC_DEFINE(USE_SPINLOCKS)
2484 AC_DEFINE(SPARC_SPINLOCKS)
2487 i386|i486|i586|i686)
2488 AC_DEFINE(INTEL_SPINLOCKS)
2492 AC_DEFINE(MIPS_SPINLOCKS)
2496 AC_DEFINE(POWERPC_SPINLOCKS)
2501 #################################################
2502 # check for ACL support
2504 AC_MSG_CHECKING(whether to support ACLs)
2505 AC_ARG_WITH(acl-support,
2506 [ --with-acl-support Include ACL support (default=no)],
2507 [ case "$withval" in
2512 AC_MSG_RESULT(Using UnixWare ACLs)
2513 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2516 AC_MSG_RESULT(Using solaris ACLs)
2517 AC_DEFINE(HAVE_SOLARIS_ACLS)
2520 AC_MSG_RESULT(Using HPUX ACLs)
2521 AC_DEFINE(HAVE_HPUX_ACLS)
2524 AC_MSG_RESULT(Using IRIX ACLs)
2525 AC_DEFINE(HAVE_IRIX_ACLS)
2528 AC_MSG_RESULT(Using AIX ACLs)
2529 AC_DEFINE(HAVE_AIX_ACLS)
2532 AC_MSG_RESULT(Using Tru64 ACLs)
2533 AC_DEFINE(HAVE_TRU64_ACLS)
2537 AC_CHECK_LIB(acl,acl_get_file)
2538 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2539 AC_TRY_LINK([#include <sys/types.h>
2540 #include <sys/acl.h>],
2541 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2542 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2543 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2544 AC_MSG_RESULT(Using posix ACLs)
2545 AC_DEFINE(HAVE_POSIX_ACLS)
2546 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2547 AC_TRY_LINK([#include <sys/types.h>
2548 #include <sys/acl.h>],
2549 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2550 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2551 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2552 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2560 AC_DEFINE(HAVE_NO_ACLS)
2563 AC_DEFINE(HAVE_NO_ACLS)
2567 #################################################
2568 # Check whether winbind is supported on this platform. If so we need to
2569 # build and install client programs (WINBIND_TARGETS), sbin programs
2570 # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2572 AC_MSG_CHECKING(whether to build winbind)
2574 # Initially, the value of $host_os decides whether winbind is supported
2582 WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
2583 WINBIND_NSS_EXTRA_LIBS="-lsocket"
2587 WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
2591 winbind_no_reason=", unsupported on $host_os"
2595 # Check the setting of --with-winbindd
2597 AC_ARG_WITH(winbind,
2598 [ --with-winbind Build winbind (default, if supported by OS)],
2611 # We need unix domain sockets for winbind
2613 if test x"$HAVE_WINBIND" = x"yes"; then
2614 if test x"$samba_cv_unixsocket" = x"no"; then
2615 winbind_no_reason=", no unix domain socket support on $host_os"
2620 # Display test results
2625 WINBIND_PAM_PROGS=""
2627 if test x"$HAVE_WINBIND" = x"yes"; then
2630 WINBIND_TARGETS="bin/wbinfo"
2631 WINBIND_STARGETS="bin/winbindd"
2632 if test x"$BLDSHARED" = x"true"; then
2633 WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
2634 if test x"$with_pam" = x"yes"; then
2635 WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2639 AC_MSG_RESULT(no$winbind_no_reason)
2642 # Substitution time!
2644 AC_SUBST(WINBIND_TARGETS)
2645 AC_SUBST(WINBIND_STARGETS)
2646 AC_SUBST(WINBIND_LTARGETS)
2647 AC_SUBST(WINBIND_PAM_TARGETS)
2648 AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
2649 AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
2651 #################################################
2652 # Check to see if we should use the included popt
2654 AC_ARG_WITH(included-popt,
2655 [ --with-included-popt use bundled popt library, not from system],
2666 if test x"$INCLUDED_POPT" != x"yes"; then
2667 AC_CHECK_LIB(popt, poptGetContext,
2668 INCLUDED_POPT=no, INCLUDED_POPT=yes)
2671 AC_MSG_CHECKING(whether to use included popt)
2672 if test x"$INCLUDED_POPT" = x"yes"; then
2673 AC_MSG_RESULT($srcdir/popt)
2674 BUILD_POPT='$(POPT_OBJS)'
2675 FLAGS1="-I$srcdir/popt"
2680 AC_SUBST(BUILD_POPT)
2683 #################################################
2684 # final configure stuff
2686 echo "checking configure summary"
2687 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2688 echo "configure OK";,
2689 AC_MSG_ERROR([summary failure. Aborting config]),:)
2694 AC_OUTPUT(include/stamp-h Makefile)
2696 #################################################
2697 # Print very concise instructions on building/use
2698 if test "x$enable_dmalloc" = xyes
2700 AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
2701 AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])