1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(include/includes.h)
3 AC_CONFIG_HEADER(include/config.h)
5 #################################################
6 # Directory handling stuff to support both the
7 # legacy SAMBA directories and FHS compliant
9 AC_PREFIX_DEFAULT(/usr/local/samba)
11 AC_ARG_WITH(fhs, [ --with-fhs use FHS-compliant paths [default=no]],
12 codepagedir="\$(DATADIR)/samba/codepages"
13 configdir="${sysconfdir}/samba"
14 lockdir="\${VARDIR}/lock/samba"
15 logfilebase="\${VARDIR}/log/samba"
16 privatedir="\${CONFIGDIR}/private"
17 swatdir="\${DATADIR}/samba/swat",
18 codepagedir="\$(LIBDIR)/codepages"
19 configdir="\$(LIBDIR)"
20 lockdir="\$(VARDIR)/locks"
21 logfilebase="\$(VARDIR)"
22 privatedir="\${prefix}/private"
23 swatdir="\${prefix}/swat")
25 #################################################
26 # set private directory location
27 AC_ARG_WITH(privatedir,
28 [ --with-privatedir=DIR Where to put smbpasswd ($privatedir)],
32 # Just in case anybody calls it without argument
34 AC_MSG_WARN([--with-privatedir called without argument - will use default])
41 #################################################
42 # set lock directory location
44 [ --with-lockdir=DIR Where to put lock files ($lockdir)],
48 # Just in case anybody calls it without argument
50 AC_MSG_WARN([--with-lockdir called without argument - will use default])
57 #################################################
58 # set SWAT directory location
60 [ --with-swatdir=DIR Where to put SWAT files ($swatdir)],
64 # Just in case anybody does it
66 AC_MSG_WARN([--with-swatdir called without argument - will use default])
73 #################################################
74 # set configuration directory location
75 AC_ARG_WITH(configdir,
76 [ --with-configdir=DIR Where to put configuration files ($configdir)],
80 # Just in case anybody does it
82 AC_MSG_WARN([--with-configdir called without argument - will use default])
89 #################################################
90 # set codepage directory location
91 AC_ARG_WITH(codepagedir,
92 [ --with-codepagedir=DIR Where to put codepage files ($codepagedir)],
96 # Just in case anybody does it
98 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
101 codepagedir="$withval"
106 AC_SUBST(codepagedir)
109 AC_SUBST(logfilebase)
115 dnl Unique-to-Samba variables we'll be playing with.
126 # compile with optimization and without debugging by default
127 CFLAGS="-O ${CFLAGS}"
129 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
130 [if eval "test x$enable_debug = xyes"; then
131 CFLAGS="${CFLAGS} -g"
136 dnl Checks for programs.
141 AC_SUBST(LIBTOOL_DEPS)
143 dnl Check if C compiler understands -c and -o at the same time
145 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
152 dnl Check if the C compiler understands volatile (it should, being ANSI).
153 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
154 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
155 samba_cv_volatile=yes,samba_cv_volatile=no)])
156 if test x"$samba_cv_volatile" = x"yes"; then
157 AC_DEFINE(HAVE_VOLATILE)
164 dnl Add #include for broken IRIX header files
166 *irix6*) AC_ADD_INCLUDE(<standards.h>)
170 AC_VALIDATE_CACHE_SYSTEM_TYPE
173 # Config CPPFLAG settings for strange OS's that must be set
174 # before other tests.
177 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
180 if test $ac_cv_prog_cc_Ae = yes; then
181 CPPFLAGS="$CPPFLAGS -Ae"
184 # Defines needed for HPUX support.
185 # HPUX has bigcrypt but (sometimes?) doesn't use it for
186 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
190 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
191 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
194 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
195 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
200 # AIX4.x doesn't even admit to having large
201 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
204 AC_MSG_RESULT([enabling large file support])
205 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
208 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
209 # to the existance of large files..
210 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
211 # recommendations on large file support, however it makes the
212 # compile work using gcc 2.7 and 2.8, whereas using the Sun
213 # recommendation makes the compile fail on gcc2.7. JRA.
218 AC_MSG_RESULT([enabling large file support])
219 if test "$ac_cv_prog_gcc" = yes; then
220 ${CC-cc} -v >conftest.c 2>&1
221 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
223 case "$ac_cv_gcc_compiler_version_number" in
224 *"gcc version 2.6"*|*"gcc version 2.7"*)
225 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
228 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
232 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
238 # Tests needed for SINIX large file support.
241 if test $host = mips-sni-sysv4 ; then
242 AC_MSG_CHECKING([for LFS support])
243 old_CPPFLAGS="$CPPFLAGS"
244 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
248 #if _LFS64_LARGEFILE == 1
253 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
254 CPPFLAGS="$old_CPPFLAGS"
255 if test x$SINIX_LFS_SUPPORT = xyes ; then
256 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
257 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
258 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
259 LIBS="`getconf LFS64_LIBS` $LIBS"
261 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
265 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
268 AC_MSG_CHECKING([for LFS support])
269 old_CPPFLAGS="$CPPFLAGS"
270 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
273 #include <sys/utsname.h>
275 #if _LFS64_LARGEFILE == 1
280 /* Ensure this is glibc 2.2 or higher */
281 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
282 int libc_major = __GLIBC__;
283 int libc_minor = __GLIBC_MINOR__;
291 /* Ensure this is kernel 2.4 or higher */
294 release = uts.release;
295 major = atoi(strsep(&release, "."));
296 minor = atoi(strsep(&release, "."));
298 if (major > 2 || (major == 2 && minor > 3))
305 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
306 CPPFLAGS="$old_CPPFLAGS"
307 if test x$LINUX_LFS_SUPPORT = xyes ; then
308 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
310 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
314 AC_MSG_CHECKING([for LFS support])
315 old_CPPFLAGS="$CPPFLAGS"
316 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
320 #if _LFS64_LARGEFILE == 1
325 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
326 CPPFLAGS="$old_CPPFLAGS"
327 if test x$GLIBC_LFS_SUPPORT = xyes ; then
328 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
330 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
340 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
341 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
342 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
343 AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
344 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
345 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
346 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
348 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
349 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
353 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
354 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
355 if test x"$ac_cv_header_shadow_h" = x"yes"; then
356 AC_DEFINE(HAVE_SHADOW_H)
360 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
361 AC_CHECK_HEADERS(nss.h sys/security.h security/pam_appl.h)
362 AC_CHECK_HEADERS(stropts.h poll.h)
363 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
364 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h acl/acl.h)
366 # For experimental utmp support (lastlog on some BSD-like systems)
367 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
369 # For quotas on Veritas VxFS filesystems
370 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
372 AC_CHECK_SIZEOF(int,cross)
373 AC_CHECK_SIZEOF(long,cross)
374 AC_CHECK_SIZEOF(short,cross)
389 AC_CHECK_TYPE(ino_t,unsigned)
390 AC_CHECK_TYPE(loff_t,off_t)
391 AC_CHECK_TYPE(offset_t,loff_t)
392 AC_CHECK_TYPE(ssize_t, int)
393 AC_CHECK_TYPE(wchar_t, unsigned short)
395 # we need libcups for CUPS support...
396 AC_CHECK_LIB(cups,httpConnect)
398 # we need libdl for PAM and the new VFS code
399 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
400 AC_DEFINE(HAVE_LIBDL)])
402 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
404 #include <sys/types.h>
409 #include <signal.h>],[sig_atomic_t i = 0],
410 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
411 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
412 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
415 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
416 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
417 samba_cv_errno=yes,samba_cv_have_errno=no)])
418 if test x"$samba_cv_errno" = x"yes"; then
419 AC_DEFINE(HAVE_ERRNO_DECL)
422 # stupid glibc has the functions but no declaration. grrrr.
423 AC_CACHE_CHECK([for setresuid declaration],samba_cv_have_setresuid_decl,[
424 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresuid],
425 samba_cv_have_setresuid_decl=yes,samba_cv_have_setresuid_decl=no)])
426 if test x"$samba_cv_have_setresuid_decl" = x"yes"; then
427 AC_DEFINE(HAVE_SETRESUID_DECL)
430 # stupid glibc has the functions but no declaration. grrrr.
431 AC_CACHE_CHECK([for setresgid declaration],samba_cv_have_setresgid_decl,[
432 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresgid],
433 samba_cv_have_setresgid_decl=yes,samba_cv_have_setresgid_decl=no)])
434 if test x"$samba_cv_have_setresgid_decl" = x"yes"; then
435 AC_DEFINE(HAVE_SETRESGID_DECL)
438 # and glibc has setresuid under linux but the function does
439 # nothing until kernel 2.1.44! very dumb.
440 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
441 AC_TRY_RUN([#include <errno.h>
442 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
443 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
444 if test x"$samba_cv_have_setresuid" = x"yes"; then
445 AC_DEFINE(HAVE_SETRESUID)
448 # Do the same check for setresguid...
450 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
451 AC_TRY_RUN([#include <unistd.h>
453 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
454 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
455 if test x"$samba_cv_have_setresgid" = x"yes"; then
456 AC_DEFINE(HAVE_SETRESGID)
461 ###############################################
462 # test for where we get crypt() from
463 AC_CHECK_FUNCS(crypt)
464 if test x"$ac_cv_func_crypt" = x"no"; then
465 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
466 AC_DEFINE(HAVE_CRYPT)])
469 ###############################################
470 # Readline included by default unless explicitly asked not to
471 test "${with_readline+set}" != "set" && with_readline=yes
473 # test for where we get readline() from
474 AC_MSG_CHECKING(whether to use readline)
475 AC_ARG_WITH(readline,
476 [ --with-readline[=DIR] Look for readline include/libs in DIR
477 --without-readline Don't include readline support],
478 [ case "$with_readline" in
482 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
483 AC_CHECK_HEADERS(readline/history.h)
485 AC_CHECK_HEADERS(readline.h readline/readline.h,[
486 for termlib in ncurses curses termcap terminfo termlib; do
487 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
489 AC_CHECK_LIB(readline, rl_callback_handler_install,
490 [TERMLIBS="-lreadline $TERMLIBS"
491 AC_DEFINE(HAVE_LIBREADLINE)
492 break], [TERMLIBS=], $TERMLIBS)])
500 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
501 # alternate readline path
503 _cppflags=${CPPFLAGS}
505 # Add additional search path
506 LDFLAGS="-L$with_readline/lib $LDFLAGS"
507 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
509 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
510 AC_CHECK_HEADERS(readline/history.h)
512 AC_CHECK_HEADERS(readline.h readline/readline.h,[
513 for termlib in ncurses curses termcap terminfo termlib; do
514 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
516 AC_CHECK_LIB(readline, rl_callback_handler_install,
517 [TERMLDFLAGS="-L$with_readline/lib"
518 TERMCPPFLAGS="-I$with_readline/include"
519 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
520 TERMLIBS="-lreadline $TERMLIBS"
521 AC_DEFINE(HAVE_LIBREADLINE)
522 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
530 AC_SUBST(TERMLDFLAGS)
532 # The following test taken from the cvs sources
533 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
534 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
535 # libsocket.so which has a bad implementation of gethostbyname (it
536 # only looks in /etc/hosts), so we only look for -lsocket if we need
538 AC_CHECK_FUNCS(connect)
539 if test x"$ac_cv_func_connect" = x"no"; then
542 *) AC_CHECK_LIB(nsl_s, printf) ;;
546 *) AC_CHECK_LIB(nsl, printf) ;;
550 *) AC_CHECK_LIB(socket, connect) ;;
554 *) AC_CHECK_LIB(inet, connect) ;;
556 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
558 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
559 test x"$ac_cv_lib_inet_connect" = x"yes"; then
560 # ac_cv_func_connect=yes
561 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
562 AC_DEFINE(HAVE_CONNECT)
566 ###############################################
567 # test for where we get get_yp_default_domain() from
568 AC_CHECK_FUNCS(yp_get_default_domain)
569 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
570 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
571 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
574 # Check if we have execl, if not we need to compile smbrun.
575 AC_CHECK_FUNCS(execl)
576 if test x"$ac_cv_func_execl" = x"no"; then
582 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot)
583 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
584 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
585 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
586 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
587 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
588 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
589 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
590 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl)
592 # syscall() is needed for smbwrapper.
593 AC_CHECK_FUNCS(syscall)
595 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
596 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
597 AC_CHECK_FUNCS(__getcwd _getcwd)
598 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
599 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
600 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
601 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
602 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
603 AC_CHECK_FUNCS(_write __write _fork __fork)
604 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
605 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
606 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
607 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
608 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
611 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
614 if test x$ac_cv_func_stat64 = xno ; then
615 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
617 #if defined(HAVE_UNISTD_H)
620 #include <sys/stat.h>
621 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
622 AC_MSG_RESULT([$ac_cv_func_stat64])
623 if test x$ac_cv_func_stat64 = xyes ; then
624 AC_DEFINE(HAVE_STAT64)
628 if test x$ac_cv_func_lstat64 = xno ; then
629 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
631 #if defined(HAVE_UNISTD_H)
634 #include <sys/stat.h>
635 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
636 AC_MSG_RESULT([$ac_cv_func_lstat64])
637 if test x$ac_cv_func_lstat64 = xyes ; then
638 AC_DEFINE(HAVE_LSTAT64)
642 if test x$ac_cv_func_fstat64 = xno ; then
643 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
645 #if defined(HAVE_UNISTD_H)
648 #include <sys/stat.h>
649 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
650 AC_MSG_RESULT([$ac_cv_func_fstat64])
651 if test x$ac_cv_func_fstat64 = xyes ; then
652 AC_DEFINE(HAVE_FSTAT64)
657 # If no strcasecmp, check for it in some known places
658 # It is in -lresolv on ReliantUNIX and UnixWare
659 # -lresolve *must* follow -lnsl for name resolution to work properly
662 if test x$ac_cv_func_strcasecmp = xno ; then
663 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
664 AC_DEFINE(HAVE_STRCASECMP))
668 # Check for the functions putprpwnam, set_auth_parameters,
669 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
670 # Needed for OSF1 and HPUX.
673 AC_LIBTESTFUNC(security, putprpwnam)
674 AC_LIBTESTFUNC(sec, putprpwnam)
676 AC_LIBTESTFUNC(security, set_auth_parameters)
677 AC_LIBTESTFUNC(sec, set_auth_parameters)
679 # UnixWare 7.x has its getspnam in -lgen
680 AC_LIBTESTFUNC(gen, getspnam)
682 AC_LIBTESTFUNC(security, getspnam)
683 AC_LIBTESTFUNC(sec, getspnam)
685 AC_LIBTESTFUNC(security, bigcrypt)
686 AC_LIBTESTFUNC(sec, bigcrypt)
688 AC_LIBTESTFUNC(security, getprpwnam)
689 AC_LIBTESTFUNC(sec, getprpwnam)
691 # this bit needs to be modified for each OS that is suported by
692 # smbwrapper. You need to specify how to created a shared library and
693 # how to compile C code to produce PIC object files
695 # these are the defaults, good for lots of systems
701 # and these are for particular systems
703 *linux*) AC_DEFINE(LINUX);;
704 *solaris*) AC_DEFINE(SUNOS5)
707 *sunos*) AC_DEFINE(SUNOS4)
710 *bsd*) LDSHFLAGS="-shared -Bshareable"
712 *irix*) AC_DEFINE(IRIX)
714 *irix6*) AC_DEFINE(IRIX6)
717 ATTEMPT_WRAP32_BUILD=yes
719 *aix*) AC_DEFINE(AIX);;
720 *hpux*) AC_DEFINE(HPUX)
722 # Use special PIC flags for the native HP-UX compiler.
723 if test $ac_cv_prog_cc_Ae = yes; then
728 *qnx*) AC_DEFINE(QNX);;
729 *osf*) AC_DEFINE(OSF1);;
730 *sco*) AC_DEFINE(SCO);;
731 *next2*) AC_DEFINE(NEXT2);;
732 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
735 *-univel-*) if [ test "$GCC" != yes ]; then
736 AC_DEFINE(HAVE_MEMSET)
740 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
744 if [ test "$GCC" != yes ]; then
745 AC_DEFINE(HAVE_MEMSET)
751 # try to work out how to produce pic code with this compiler
752 AC_PROG_CC_FLAG(fpic)
753 if test $ac_cv_prog_cc_fpic = yes; then
756 if test x$PICFLAG = x; then
757 AC_PROG_CC_FLAG(KPIC)
758 if test $ac_cv_prog_cc_KPIC = yes; then
762 if test x$PICFLAG = x; then
763 AC_PROG_CC_FLAG(Kpic)
764 if test $ac_cv_prog_cc_Kpic = yes; then
771 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
772 AC_TRY_RUN([#include <stdio.h>
773 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
774 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
775 if test x"$samba_cv_have_longlong" = x"yes"; then
776 AC_DEFINE(HAVE_LONGLONG)
780 # Check if the compiler supports the LL prefix on long long integers.
783 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
784 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
785 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
786 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
787 AC_DEFINE(COMPILER_SUPPORTS_LL)
791 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
792 AC_TRY_RUN([#include <stdio.h>
793 #include <sys/stat.h>
794 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
795 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
796 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
797 AC_DEFINE(SIZEOF_OFF_T,8)
800 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
802 #if defined(HAVE_UNISTD_H)
806 #include <sys/stat.h>
807 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
808 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
809 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
810 AC_DEFINE(HAVE_OFF64_T)
813 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
814 AC_TRY_RUN([#include <stdio.h>
815 #include <sys/stat.h>
816 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
817 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
818 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
819 AC_DEFINE(SIZEOF_INO_T,8)
822 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
824 #if defined(HAVE_UNISTD_H)
828 #include <sys/stat.h>
829 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
830 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
831 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
832 AC_DEFINE(HAVE_INO64_T)
835 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
837 #if defined(HAVE_UNISTD_H)
840 #include <sys/types.h>
841 #include <dirent.h>],
842 [struct dirent64 de;],
843 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
844 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
845 AC_DEFINE(HAVE_STRUCT_DIRENT64)
848 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
849 AC_TRY_RUN([#include <stdio.h>
850 main() { char c; c=250; exit((c > 0)?0:1); }],
851 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
852 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
853 AC_DEFINE(HAVE_UNSIGNED_CHAR)
856 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
857 AC_TRY_COMPILE([#include <sys/types.h>
858 #include <sys/socket.h>
859 #include <netinet/in.h>],
860 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
861 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
862 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
863 AC_DEFINE(HAVE_SOCK_SIN_LEN)
866 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
867 AC_TRY_COMPILE([#include <sys/types.h>
869 void seekdir(DIR *d, long loc) { return; }],[return 0;],
870 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
871 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
872 AC_DEFINE(SEEKDIR_RETURNS_VOID)
875 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
876 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
877 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
878 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
879 AC_DEFINE(HAVE_FILE_MACRO)
882 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
883 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
884 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
885 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
886 AC_DEFINE(HAVE_FUNCTION_MACRO)
889 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
891 #include <sys/time.h>
893 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
894 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
895 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
896 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
900 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
901 AC_TRY_RUN([#include <sys/types.h>
903 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
904 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
905 di->d_name[0] == 0) exit(0); exit(1);} ],
906 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
907 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
908 AC_DEFINE(HAVE_BROKEN_READDIR)
911 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
912 AC_TRY_COMPILE([#include <sys/types.h>
914 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
915 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
916 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
917 AC_DEFINE(HAVE_UTIMBUF)
920 dnl utmp and utmpx come in many flavours
921 dnl We need to check for many of them
922 dnl But we don't need to do each and every one, because our code uses
923 dnl mostly just the utmp (not utmpx) fields.
925 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
927 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
928 AC_TRY_COMPILE([#include <sys/types.h>
930 [struct utmp ut; ut.ut_name[0] = 'a';],
931 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
932 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
933 AC_DEFINE(HAVE_UT_UT_NAME)
936 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
937 AC_TRY_COMPILE([#include <sys/types.h>
939 [struct utmp ut; ut.ut_user[0] = 'a';],
940 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
941 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
942 AC_DEFINE(HAVE_UT_UT_USER)
945 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
946 AC_TRY_COMPILE([#include <sys/types.h>
948 [struct utmp ut; ut.ut_id[0] = 'a';],
949 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
950 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
951 AC_DEFINE(HAVE_UT_UT_ID)
954 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
955 AC_TRY_COMPILE([#include <sys/types.h>
957 [struct utmp ut; ut.ut_host[0] = 'a';],
958 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
959 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
960 AC_DEFINE(HAVE_UT_UT_HOST)
963 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
964 AC_TRY_COMPILE([#include <sys/types.h>
966 [struct utmp ut; time_t t; ut.ut_time = t;],
967 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
968 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
969 AC_DEFINE(HAVE_UT_UT_TIME)
972 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
973 AC_TRY_COMPILE([#include <sys/types.h>
975 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
976 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
977 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
978 AC_DEFINE(HAVE_UT_UT_TV)
981 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
982 AC_TRY_COMPILE([#include <sys/types.h>
984 [struct utmp ut; ut.ut_type = 0;],
985 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
986 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
987 AC_DEFINE(HAVE_UT_UT_TYPE)
990 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
991 AC_TRY_COMPILE([#include <sys/types.h>
993 [struct utmp ut; ut.ut_pid = 0;],
994 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
995 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
996 AC_DEFINE(HAVE_UT_UT_PID)
999 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1000 AC_TRY_COMPILE([#include <sys/types.h>
1002 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1003 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1004 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1005 AC_DEFINE(HAVE_UT_UT_EXIT)
1008 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1009 AC_TRY_COMPILE([#include <sys/types.h>
1011 [struct utmp ut; ut.ut_addr = 0;],
1012 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1013 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1014 AC_DEFINE(HAVE_UT_UT_ADDR)
1017 if test x$ac_cv_func_pututline = xyes ; then
1018 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1019 AC_TRY_COMPILE([#include <sys/types.h>
1021 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1022 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1023 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1024 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1028 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1029 AC_TRY_COMPILE([#include <sys/types.h>
1030 #include <utmpx.h>],
1031 [struct utmpx ux; ux.ut_syslen = 0;],
1032 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1033 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1034 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1037 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1039 #include <sys/types.h>
1042 #define F_GETLEASE 1025
1045 int fd = open("/dev/null", O_RDONLY);
1046 return fcntl(fd, F_GETLEASE, 0) == -1;
1049 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1050 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1051 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1054 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1056 #include <sys/types.h>
1060 #define F_NOTIFY 1026
1063 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1066 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1067 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1068 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1071 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1073 #include <sys/types.h>
1076 #include <sys/file.h>
1078 #define LOCK_MAND 32
1079 #define LOCK_READ 64
1082 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1085 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1086 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1087 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1093 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1094 AC_TRY_COMPILE([#include <sys/types.h>
1095 #include <fcntl.h>],
1096 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1097 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1098 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1099 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1102 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1103 AC_TRY_RUN([#include <sys/types.h>
1104 #include <sys/capability.h>
1107 if ((cap = cap_get_proc()) == NULL)
1109 cap->cap_effective |= CAP_NETWORK_MGT;
1110 cap->cap_inheritable |= CAP_NETWORK_MGT;
1115 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1116 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1117 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1121 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1122 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1125 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1126 AC_TRY_COMPILE([#include <sys/types.h>
1127 #if defined(HAVE_RPC_RPC_H)
1128 #include <rpc/rpc.h>
1131 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1132 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1133 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1136 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1137 AC_TRY_COMPILE([#include <sys/types.h>
1138 #if defined(HAVE_RPC_RPC_H)
1139 #include <rpc/rpc.h>
1142 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1143 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1144 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1147 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1148 AC_TRY_COMPILE([#include <sys/types.h>
1149 #if defined(HAVE_RPC_RPC_H)
1150 #include <rpc/rpc.h>
1153 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1154 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1155 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1158 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1159 AC_TRY_COMPILE([#include <sys/types.h>
1160 #if defined(HAVE_RPC_RPC_H)
1161 #include <rpc/rpc.h>
1164 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1165 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1166 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1170 dnl Some systems (SCO) have a problem including
1171 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1172 dnl as a #define in <prot.h> and as part of an enum
1176 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1177 AC_TRY_COMPILE([#include <sys/types.h>
1178 #ifdef HAVE_SYS_SECURITY_H
1179 #include <sys/security.h>
1181 #endif /* HAVE_SYS_SECURITY_H */
1182 #if defined(HAVE_RPC_RPC_H)
1183 #include <rpc/rpc.h>
1186 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1187 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1188 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1191 AC_MSG_CHECKING([for test routines])
1192 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1194 AC_MSG_ERROR([cant find test code. Aborting config]),
1195 AC_MSG_WARN([cannot run when cross-compiling]))
1197 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1198 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1199 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1200 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1201 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1204 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1205 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1206 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1207 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1208 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1211 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1212 SAVE_CPPFLAGS="$CPPFLAGS"
1213 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1215 #define REPLACE_GETPASS 1
1216 #define NO_CONFIG_H 1
1217 #define main dont_declare_main
1218 #include "${srcdir-.}/lib/getsmbpass.c"
1220 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1221 CPPFLAGS="$SAVE_CPPFLAGS"
1223 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1224 AC_DEFINE(REPLACE_GETPASS)
1227 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1230 #include <sys/types.h>
1231 #include <netinet/in.h>
1232 #ifdef HAVE_ARPA_INET_H
1233 #include <arpa/inet.h>
1235 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1236 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1237 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1239 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1240 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1241 AC_DEFINE(REPLACE_INET_NTOA)
1244 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1245 AC_TRY_RUN([#include <stdlib.h>
1246 #include <sys/types.h>
1247 #include <sys/stat.h>
1251 char tpl[20]="/tmp/test.XXXXXX";
1252 int fd = mkstemp(tpl);
1253 if (fd == -1) exit(1);
1255 if (fstat(fd, &st) != 0) exit(1);
1256 if ((st.st_mode & 0777) != 0600) exit(1);
1259 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1260 samba_cv_HAVE_SECURE_MKSTEMP=no,
1261 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1262 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1263 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1266 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1267 AC_TRY_RUN([#include <unistd.h>
1268 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1269 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1270 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1271 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1274 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1275 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1276 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1277 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1278 AC_DEFINE(HAVE_ROOT)
1280 AC_MSG_WARN(running as non-root will disable some tests)
1284 # look for a method of finding the list of network interfaces
1286 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1288 #define HAVE_IFACE_AIX 1
1289 #define AUTOCONF_TEST 1
1290 #include "confdefs.h"
1291 #include "${srcdir-.}/lib/interfaces.c"],
1292 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1293 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1294 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1297 if test $iface = no; then
1298 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1300 #define HAVE_IFACE_IFCONF 1
1301 #define AUTOCONF_TEST 1
1302 #include "confdefs.h"
1303 #include "${srcdir-.}/lib/interfaces.c"],
1304 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1305 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1306 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1310 if test $iface = no; then
1311 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1313 #define HAVE_IFACE_IFREQ 1
1314 #define AUTOCONF_TEST 1
1315 #include "confdefs.h"
1316 #include "${srcdir-.}/lib/interfaces.c"],
1317 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1318 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1319 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1324 ################################################
1325 # look for a method of setting the effective uid
1327 if test $seteuid = no; then
1328 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1330 #define AUTOCONF_TEST 1
1331 #define USE_SETRESUID 1
1332 #include "confdefs.h"
1333 #include "${srcdir-.}/lib/util_sec.c"],
1334 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1335 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1336 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1341 if test $seteuid = no; then
1342 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1344 #define AUTOCONF_TEST 1
1345 #define USE_SETREUID 1
1346 #include "confdefs.h"
1347 #include "${srcdir-.}/lib/util_sec.c"],
1348 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1349 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1350 seteuid=yes;AC_DEFINE(USE_SETREUID)
1354 if test $seteuid = no; then
1355 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1357 #define AUTOCONF_TEST 1
1358 #define USE_SETEUID 1
1359 #include "confdefs.h"
1360 #include "${srcdir-.}/lib/util_sec.c"],
1361 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1362 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1363 seteuid=yes;AC_DEFINE(USE_SETEUID)
1367 if test $seteuid = no; then
1368 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1370 #define AUTOCONF_TEST 1
1371 #define USE_SETUIDX 1
1372 #include "confdefs.h"
1373 #include "${srcdir-.}/lib/util_sec.c"],
1374 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1375 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1376 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1381 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1382 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1383 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1384 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1385 AC_DEFINE(HAVE_MMAP)
1388 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1389 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1390 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1391 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1392 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1395 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1396 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1397 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1398 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1399 AC_DEFINE(HAVE_FCNTL_LOCK)
1402 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1403 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1404 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1405 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1406 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1411 dnl Don't check for 64 bit fcntl locking if we know that the
1412 dnl glibc2.1 broken check has succeeded.
1415 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1417 #if defined(HAVE_UNISTD_H)
1427 #ifdef HAVE_SYS_FCNTL_H
1428 #include <sys/fcntl.h>
1430 main() { struct flock64 fl64;
1431 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1437 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1439 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1440 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1444 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1445 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1446 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1447 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1448 AC_DEFINE(HAVE_TRUNCATED_SALT)
1451 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1452 AC_TRY_COMPILE([#include <sys/acl.h>
1453 #if defined(HAVE_RPCSVC_NIS_H)
1454 #include <rpcsvc/nis.h>
1457 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1458 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1459 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1463 #################################################
1464 # check for smbwrapper support
1465 AC_MSG_CHECKING(whether to use smbwrapper)
1466 AC_ARG_WITH(smbwrapper,
1467 [ --with-smbwrapper Include SMB wrapper support
1468 --without-smbwrapper Don't include SMB wrapper support (default)],
1469 [ case "$withval" in
1472 AC_DEFINE(WITH_SMBWRAPPER)
1473 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1475 if test x$ATTEMPT_WRAP32_BUILD = x; then
1478 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1481 # Conditions under which smbwrapper should not be built.
1483 if test x$PICFLAG = x; then
1484 echo No support for PIC code - disabling smbwrapper and smbsh
1487 elif test x$ac_cv_func_syscall = xno; then
1488 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1500 #################################################
1501 # check for the AFS filesystem
1502 AC_MSG_CHECKING(whether to use AFS)
1504 [ --with-afs Include AFS support
1505 --without-afs Don't include AFS support (default)],
1506 [ case "$withval" in
1519 #################################################
1520 # check for the DFS auth system
1521 AC_MSG_CHECKING(whether to use DFS auth)
1523 [ --with-dfs Include DFS support
1524 --without-dfs Don't include DFS support (default)],
1525 [ case "$withval" in
1537 #################################################
1538 # check for Kerberos IV auth system
1539 AC_MSG_CHECKING(whether to use Kerberos IV)
1541 [ --with-krb4=base-dir Include Kerberos IV support
1542 --without-krb4 Don't include Kerberos IV support (default)],
1543 [ AC_MSG_RESULT(yes)
1544 AC_DEFINE(KRB4_AUTH)
1545 AC_CHECK_LIB(resolv, dn_expand)
1546 LIBS="$LIBS -lkrb -ldes"
1547 CFLAGS="$CFLAGS -I$withval/include"
1548 LDFLAGS="$LDFLAGS -L$withval/lib"],
1552 #################################################
1553 # check for Kerberos 5 auth system
1554 AC_MSG_CHECKING(whether to use Kerberos 5)
1556 [ --with-krb5=base-dir Include Kerberos 5 support
1557 --without-krb5 Don't include Kerberos 5 support (default)],
1558 [ AC_MSG_RESULT(yes)
1559 AC_DEFINE(KRB5_AUTH)
1560 LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
1561 CFLAGS="$CFLAGS -I$withval/include"
1562 LDFLAGS="$LDFLAGS -L$withval/lib"],
1566 #################################################
1567 # check for automount support
1568 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1569 AC_ARG_WITH(automount,
1570 [ --with-automount Include AUTOMOUNT support
1571 --without-automount Don't include AUTOMOUNT support (default)],
1572 [ case "$withval" in
1575 AC_DEFINE(WITH_AUTOMOUNT)
1584 #################################################
1585 # check for smbmount support
1586 AC_MSG_CHECKING(whether to use SMBMOUNT)
1587 AC_ARG_WITH(smbmount,
1588 [ --with-smbmount Include SMBMOUNT (Linux only) support
1589 --without-smbmount Don't include SMBMOUNT support (default)],
1590 [ case "$withval" in
1593 AC_DEFINE(WITH_SMBMOUNT)
1594 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1606 #################################################
1607 # check for a PAM password database
1608 AC_MSG_CHECKING(whether to use PAM password database)
1610 [ --with-pam Include PAM password database support
1611 --without-pam Don't include PAM password database support (default)],
1612 [ case "$withval" in
1625 #################################################
1626 # removed until we get the code actually working
1628 # check for a TDB password database
1629 # AC_MSG_CHECKING(whether to use TDB password database)
1630 #AC_ARG_WITH(tdbpwd,
1631 #[ --with-tdbpwd Include TDB password database
1632 # --without-tdbpwd Don't include TDB password database (default)],
1633 #[ case "$withval" in
1635 # AC_MSG_RESULT(yes)
1636 # AC_DEFINE(WITH_TDBPWD)
1637 # AC_MSG_ERROR([TDB password database not supported in this version.])
1646 #################################################
1647 # removed until we get the code actually working
1650 # check for a LDAP password database
1651 #AC_MSG_CHECKING(whether to use LDAP password database)
1653 #[ --with-ldap Include LDAP support
1654 # --without-ldap Don't include LDAP support (default)],
1655 #[ case "$withval" in
1657 # AC_MSG_RESULT(yes)
1658 # AC_DEFINE(WITH_LDAP)
1659 # AC_MSG_ERROR([LDAP password database not supported in this version.])
1668 #################################################
1669 # check for a NISPLUS password database
1670 AC_MSG_CHECKING(whether to use NISPLUS password database)
1671 AC_ARG_WITH(nisplus,
1672 [ --with-nisplus Include NISPLUS password database support
1673 --without-nisplus Don't include NISPLUS password database support (default)],
1674 [ case "$withval" in
1677 AC_DEFINE(WITH_NISPLUS)
1686 #################################################
1687 # check for a NISPLUS_HOME support
1688 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1689 AC_ARG_WITH(nisplus-home,
1690 [ --with-nisplus-home Include NISPLUS_HOME support
1691 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
1692 [ case "$withval" in
1695 AC_DEFINE(WITH_NISPLUS_HOME)
1704 #################################################
1705 # check for the secure socket layer
1706 AC_MSG_CHECKING(whether to use SSL)
1708 [ --with-ssl Include SSL support
1709 --without-ssl Don't include SSL support (default)
1710 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
1711 [ case "$withval" in
1715 withval="/usr/local/ssl" # default
1717 if test "${with_sslinc+set}" = set; then
1719 withval="$with_sslinc"
1722 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
1723 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1724 LIBS="-lssl -lcrypto $LIBS"
1725 LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
1728 CFLAGS="-I${withval}/include $CFLAGS"
1729 LIBS="-lssl -lcrypto $LIBS"
1730 LDFLAGS="-L${withval}/lib $LDFLAGS"
1736 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1737 LIBS="-lssl -lcrypto $LIBS"
1738 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
1742 if test ! -d ${withval}; then
1743 echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
1747 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
1757 #################################################
1758 # check for syslog logging
1759 AC_MSG_CHECKING(whether to use syslog logging)
1761 [ --with-syslog Include experimental SYSLOG support
1762 --without-syslog Don't include SYSLOG support (default)],
1763 [ case "$withval" in
1766 AC_DEFINE(WITH_SYSLOG)
1775 #################################################
1776 # check for a shared memory profiling support
1777 AC_MSG_CHECKING(whether to use profiling)
1778 AC_ARG_WITH(profile,
1779 [ --with-profile Include profile support
1780 --without-profile Don't include profile support (default)],
1781 [ case "$withval" in
1784 AC_DEFINE(WITH_PROFILE)
1794 #################################################
1795 # check for experimental netatalk resource fork support
1796 AC_MSG_CHECKING(whether to support netatalk)
1797 AC_ARG_WITH(netatalk,
1798 [ --with-netatalk Include experimental Netatalk support
1799 --without-netatalk Don't include experimental Netatalk support (default)],
1800 [ case "$withval" in
1803 AC_DEFINE(WITH_NETATALK)
1812 #################################################
1813 # check for experimental disk-quotas support
1814 QUOTAOBJS=smbd/noquotas.o
1816 AC_MSG_CHECKING(whether to support disk-quotas)
1818 [ --with-quotas Include experimental disk-quota support
1819 --without-quotas Don't include experimental disk-quota support (default)],
1820 [ case "$withval" in
1823 QUOTAOBJS=smbd/quotas.o
1833 #################################################
1834 # check for experimental utmp accounting
1836 AC_MSG_CHECKING(whether to support utmp accounting)
1838 [ --with-utmp Include experimental utmp accounting
1839 --without-utmp Don't include experimental utmp accounting (default)],
1840 [ case "$withval" in
1843 AC_DEFINE(WITH_UTMP)
1852 #################################################
1853 # check for MS Dfs support
1855 AC_MSG_CHECKING(whether to support Microsoft Dfs)
1857 [ --with-msdfs Include MS Dfs support
1858 --without-msdfs Don't include MS Dfs support (default)],
1859 [ case "$withval" in
1862 AC_DEFINE(WITH_MSDFS)
1871 #################################################
1872 # check for Samba VFS support
1874 AC_MSG_CHECKING(whether to support the experimantal Samba vfs)
1876 [ --with-vfs Include Samba vfs support
1877 --without-vfs Don't include Samba vfs support (default)],
1878 [ case "$withval" in
1890 #################################################
1891 # these tests are taken from the GNU fileutils package
1892 AC_CHECKING(how to get filesystem space usage)
1895 # Test for statvfs64.
1896 if test $space = no; then
1898 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
1900 #if defined(HAVE_UNISTD_H)
1903 #include <sys/types.h>
1904 #include <sys/statvfs.h>
1907 struct statvfs64 fsd;
1908 exit (statvfs64 (".", &fsd));
1910 fu_cv_sys_stat_statvfs64=yes,
1911 fu_cv_sys_stat_statvfs64=no,
1912 fu_cv_sys_stat_statvfs64=cross)])
1913 if test $fu_cv_sys_stat_statvfs64 = yes; then
1915 AC_DEFINE(STAT_STATVFS64)
1919 # Perform only the link test since it seems there are no variants of the
1920 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
1921 # because that got a false positive on SCO OSR5. Adding the declaration
1922 # of a `struct statvfs' causes this test to fail (as it should) on such
1923 # systems. That system is reported to work fine with STAT_STATFS4 which
1924 # is what it gets when this test fails.
1925 if test $space = no; then
1927 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
1928 [AC_TRY_LINK([#include <sys/types.h>
1929 #include <sys/statvfs.h>],
1930 [struct statvfs fsd; statvfs (0, &fsd);],
1931 fu_cv_sys_stat_statvfs=yes,
1932 fu_cv_sys_stat_statvfs=no)])
1933 if test $fu_cv_sys_stat_statvfs = yes; then
1935 AC_DEFINE(STAT_STATVFS)
1939 if test $space = no; then
1940 # DEC Alpha running OSF/1
1941 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
1942 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
1944 #include <sys/param.h>
1945 #include <sys/types.h>
1946 #include <sys/mount.h>
1951 exit (statfs (".", &fsd, sizeof (struct statfs)));
1953 fu_cv_sys_stat_statfs3_osf1=yes,
1954 fu_cv_sys_stat_statfs3_osf1=no,
1955 fu_cv_sys_stat_statfs3_osf1=no)])
1956 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
1957 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
1959 AC_DEFINE(STAT_STATFS3_OSF1)
1963 if test $space = no; then
1965 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
1966 member (AIX, 4.3BSD)])
1967 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
1969 #ifdef HAVE_SYS_PARAM_H
1970 #include <sys/param.h>
1972 #ifdef HAVE_SYS_MOUNT_H
1973 #include <sys/mount.h>
1975 #ifdef HAVE_SYS_VFS_H
1976 #include <sys/vfs.h>
1982 exit (statfs (".", &fsd));
1984 fu_cv_sys_stat_statfs2_bsize=yes,
1985 fu_cv_sys_stat_statfs2_bsize=no,
1986 fu_cv_sys_stat_statfs2_bsize=no)])
1987 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
1988 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
1990 AC_DEFINE(STAT_STATFS2_BSIZE)
1994 if test $space = no; then
1996 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
1997 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
1998 [AC_TRY_RUN([#include <sys/types.h>
1999 #include <sys/statfs.h>
2003 exit (statfs (".", &fsd, sizeof fsd, 0));
2005 fu_cv_sys_stat_statfs4=yes,
2006 fu_cv_sys_stat_statfs4=no,
2007 fu_cv_sys_stat_statfs4=no)])
2008 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2009 if test $fu_cv_sys_stat_statfs4 = yes; then
2011 AC_DEFINE(STAT_STATFS4)
2015 if test $space = no; then
2017 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2018 member (4.4BSD and NetBSD)])
2019 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2020 [AC_TRY_RUN([#include <sys/types.h>
2021 #ifdef HAVE_SYS_PARAM_H
2022 #include <sys/param.h>
2024 #ifdef HAVE_SYS_MOUNT_H
2025 #include <sys/mount.h>
2031 exit (statfs (".", &fsd));
2033 fu_cv_sys_stat_statfs2_fsize=yes,
2034 fu_cv_sys_stat_statfs2_fsize=no,
2035 fu_cv_sys_stat_statfs2_fsize=no)])
2036 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2037 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2039 AC_DEFINE(STAT_STATFS2_FSIZE)
2043 if test $space = no; then
2045 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2046 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2047 [AC_TRY_RUN([#include <sys/types.h>
2048 #ifdef HAVE_SYS_PARAM_H
2049 #include <sys/param.h>
2051 #ifdef HAVE_SYS_MOUNT_H
2052 #include <sys/mount.h>
2054 #ifdef HAVE_SYS_FS_TYPES_H
2055 #include <sys/fs_types.h>
2060 /* Ultrix's statfs returns 1 for success,
2061 0 for not mounted, -1 for failure. */
2062 exit (statfs (".", &fsd) != 1);
2064 fu_cv_sys_stat_fs_data=yes,
2065 fu_cv_sys_stat_fs_data=no,
2066 fu_cv_sys_stat_fs_data=no)])
2067 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2068 if test $fu_cv_sys_stat_fs_data = yes; then
2070 AC_DEFINE(STAT_STATFS2_FS_DATA)
2075 # As a gating factor for large file support, in order to
2076 # use <4GB files we must have the following minimal support
2078 # long long, and a 64 bit off_t or off64_t.
2079 # If we don't have all of these then disable large
2082 AC_MSG_CHECKING(checking if large file support can be enabled)
2084 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2085 #include <sys/types.h>
2091 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2092 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2094 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2099 AC_ARG_WITH(spinlocks, [ --with-spinlocks use spin locks instead of fcntl locks ])
2100 if test "x$with_spinlocks" = "xyes"; then
2101 AC_DEFINE(USE_SPINLOCKS)
2105 AC_DEFINE(SPARC_SPINLOCKS)
2108 i386|i486|i586|i686)
2109 AC_DEFINE(INTEL_SPINLOCKS)
2113 AC_DEFINE(MIPS_SPINLOCKS)
2117 AC_DEFINE(POWERPC_SPINLOCKS)
2122 #################################################
2123 # check for ACL support
2125 AC_MSG_CHECKING(whether to support ACLs)
2126 AC_ARG_WITH(acl-support,
2127 [ --with-acl-support Include ACL support
2128 --without-acl-support Don't include ACL support (default)],
2129 [ case "$withval" in
2134 AC_MSG_RESULT(Using UnixWare ACLs)
2135 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2138 AC_MSG_RESULT(Using solaris ACLs)
2139 AC_DEFINE(HAVE_SOLARIS_ACLS)
2142 AC_MSG_RESULT(Using IRIX ACLs)
2143 AC_DEFINE(HAVE_IRIX_ACLS)
2146 AC_MSG_RESULT(Using AIX ACLs)
2147 AC_DEFINE(HAVE_AIX_ACLS)
2150 AC_CHECK_LIB(acl,acl_get_file)
2151 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2152 AC_TRY_LINK([#include <sys/types.h>
2153 #include <sys/acl.h>],
2154 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2155 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2156 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2157 AC_MSG_RESULT(Using posix ACLs)
2158 AC_DEFINE(HAVE_POSIX_ACLS)
2159 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2160 AC_TRY_LINK([#include <sys/types.h>
2161 #include <sys/acl.h>],
2162 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2163 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2164 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2165 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2168 AC_CACHE_CHECK([for XFS ACL support],samba_cv_HAVE_XFS_ACLS,[
2169 AC_TRY_COMPILE([#include <sys/types.h>
2170 #include <acl/acl.h>],
2171 [ char test_str[13] = SGI_ACL_FILE; ],
2172 samba_cv_HAVE_XFS_ACLS=yes,samba_cv_XFS_POSIX_ACLS=no)])
2173 if test x"$samba_cv_HAVE_XFS_ACLS" = x"yes"; then
2174 AC_MSG_RESULT(Using XFS ACLs)
2175 AC_DEFINE(HAVE_XFS_ACLS)
2182 AC_DEFINE(HAVE_NO_ACLS)
2185 AC_DEFINE(HAVE_NO_ACLS)
2189 #################################################
2190 # check for the historical SAMBA installation
2192 if test "x$prefix" = xNONE -a "$sbindir" = "\${exec_prefix}/sbin"; then
2193 # Put all binaries under the /usr/local/samba/bin directory.
2197 echo "checking configure summary"
2198 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2199 echo "configure OK";,
2200 AC_MSG_ERROR([summary failure. Aborting config]),:)
2205 AC_OUTPUT(include/stamp-h Makefile)