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 compatibe with older versions of Samba
5 AC_PREFIX_DEFAULT(/usr/local/samba)
7 dnl Unique-to-Samba variables we'll be playing with.
19 # compile with optimisation and without debugging by default
22 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
23 [if eval "test x$enable_debug = xyes"; then
28 dnl Checks for programs.
33 AC_SUBST(LIBTOOL_DEPS)
35 dnl Check if C compiler understands -c and -o at the same time
37 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
44 dnl Check if the C compiler understands volatile (it should, being ANSI).
45 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
46 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
47 samba_cv_volatile=yes,samba_cv_volatile=no)])
48 if test x"$samba_cv_volatile" = x"yes"; then
49 AC_DEFINE(HAVE_VOLATILE)
53 #################################################
54 # set codepage directory location
55 AC_ARG_WITH(codepagedir,
56 [ --with-codepagedir=DIR Where to put codepage files (\$libdir/codepages)],
60 # Just in case anybody does it
62 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
65 codepagedir="$withval"
72 dnl Add #include for broken IRIX header files
74 *irix6*) AC_ADD_INCLUDE(<standards.h>)
78 AC_VALIDATE_CACHE_SYSTEM_TYPE
81 # Config CPPFLAG settings for strange OS's that must be set
85 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
88 if test $ac_cv_prog_cc_Ae = yes; then
89 CPPFLAGS="$CPPFLAGS -Ae"
92 # Defines needed for HPUX support.
93 # HPUX has bigcrypt but (sometimes?) doesn't use it for
94 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
98 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
99 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
102 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
103 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
108 # AIX4.x doesn't even admit to having large
109 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
112 AC_MSG_RESULT([enabling large file support])
113 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
116 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
117 # to the existance of large files..
118 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
119 # recommendations on large file support, however it makes the
120 # compile work using gcc 2.7 and 2.8, whereas using the Sun
121 # recommendation makes the compile fail on gcc2.7. JRA.
126 AC_MSG_RESULT([enabling large file support])
127 if test "$ac_cv_prog_gcc" = yes; then
128 ${CC-cc} -v >conftest.c 2>&1
129 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
131 case "$ac_cv_gcc_compiler_version_number" in
132 *"gcc version 2.6"*|*"gcc version 2.7"*)
133 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
136 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
140 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
146 # Tests needed for SINIX large file support.
149 if test $host = mips-sni-sysv4 ; then
150 AC_MSG_CHECKING([for LFS support])
151 old_CPPFLAGS="$CPPFLAGS"
152 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
156 #if _LFS64_LARGEFILE == 1
161 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
162 CPPFLAGS="$old_CPPFLAGS"
163 if test x$SINIX_LFS_SUPPORT = xyes ; then
164 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
165 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
166 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
167 LIBS="`getconf LFS64_LIBS` $LIBS"
169 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
173 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
176 AC_MSG_CHECKING([for LFS support])
177 old_CPPFLAGS="$CPPFLAGS"
178 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
181 #include <sys/utsname.h>
183 #if _LFS64_LARGEFILE == 1
188 /* Ensure this is glibc 2.2 or higher */
189 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
190 int libc_major = __GLIBC__;
191 int libc_minor = __GLIBC_MINOR__;
199 /* Ensure this is kernel 2.4 or higher */
202 release = uts.release;
203 major = atoi(strsep(&release, "."));
204 minor = atoi(strsep(&release, "."));
206 if (major > 2 || (major == 2 && minor > 3))
213 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
214 CPPFLAGS="$old_CPPFLAGS"
215 if test x$LINUX_LFS_SUPPORT = xyes ; then
216 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
218 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
222 AC_MSG_CHECKING([for LFS support])
223 old_CPPFLAGS="$CPPFLAGS"
224 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
228 #if _LFS64_LARGEFILE == 1
233 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
234 CPPFLAGS="$old_CPPFLAGS"
235 if test x$GLIBC_LFS_SUPPORT = xyes ; then
236 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
238 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
248 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
249 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
250 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
251 AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
252 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
253 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
254 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
255 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h)
258 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
259 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
263 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
264 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
265 if test x"$ac_cv_header_shadow_h" = x"yes"; then
266 AC_DEFINE(HAVE_SHADOW_H)
270 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
271 AC_CHECK_HEADERS(nss.h nss_common.h sys/security.h security/pam_appl.h security/pam_modules.h)
272 AC_CHECK_HEADERS(stropts.h poll.h)
273 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
274 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
276 # For experimental utmp support (lastlog on some BSD-like systems)
277 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
279 # For quotas on Veritas VxFS filesystems
280 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
282 AC_CHECK_SIZEOF(int,cross)
283 AC_CHECK_SIZEOF(long,cross)
284 AC_CHECK_SIZEOF(short,cross)
299 AC_CHECK_TYPE(ino_t,unsigned)
300 AC_CHECK_TYPE(loff_t,off_t)
301 AC_CHECK_TYPE(offset_t,loff_t)
302 AC_CHECK_TYPE(ssize_t, int)
303 AC_CHECK_TYPE(wchar_t, unsigned short)
305 # we need libcups for CUPS support...
306 AC_CHECK_LIB(cups,httpConnect)
308 # we need libdl for PAM and the new VFS code
309 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
310 AC_DEFINE(HAVE_LIBDL)])
312 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
314 #include <sys/types.h>
319 #include <signal.h>],[sig_atomic_t i = 0],
320 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
321 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
322 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
325 # stupid headers have the functions but no declaration. grrrr.
326 AC_HAVE_DECL(errno, [#include <errno.h>])
327 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
328 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
329 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
330 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
331 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
332 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
334 # and glibc has setresuid under linux but the function does
335 # nothing until kernel 2.1.44! very dumb.
336 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
337 AC_TRY_RUN([#include <errno.h>
338 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
339 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
340 if test x"$samba_cv_have_setresuid" = x"yes"; then
341 AC_DEFINE(HAVE_SETRESUID)
344 # Do the same check for setresguid...
346 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
347 AC_TRY_RUN([#include <unistd.h>
349 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
350 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
351 if test x"$samba_cv_have_setresgid" = x"yes"; then
352 AC_DEFINE(HAVE_SETRESGID)
357 ###############################################
358 # test for where we get crypt() from
359 AC_CHECK_FUNCS(crypt)
360 if test x"$ac_cv_func_crypt" = x"no"; then
361 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
362 AC_DEFINE(HAVE_CRYPT)])
366 ###############################################
367 # Readline included by default unless explicitly asked not to
368 test "${with_readline+set}" != "set" && with_readline=yes
370 # test for where we get readline() from
371 AC_MSG_CHECKING(whether to use readline)
372 AC_ARG_WITH(readline,
373 [ --with-readline[=DIR] Look for readline include/libs in DIR
374 --without-readline Don't include readline support],
375 [ case "$with_readline" in
379 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
380 AC_CHECK_HEADERS(readline/history.h)
382 AC_CHECK_HEADERS(readline.h readline/readline.h,[
383 for termlib in ncurses curses termcap terminfo termlib; do
384 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
386 AC_CHECK_LIB(readline, rl_callback_handler_install,
387 [TERMLIBS="-lreadline $TERMLIBS"
388 AC_DEFINE(HAVE_LIBREADLINE)
389 break], [TERMLIBS=], $TERMLIBS)])
397 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
398 # alternate readline path
400 _cppflags=${CPPFLAGS}
402 # Add additional search path
403 LDFLAGS="-L$with_readline/lib $LDFLAGS"
404 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
406 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
407 AC_CHECK_HEADERS(readline/history.h)
409 AC_CHECK_HEADERS(readline.h readline/readline.h,[
410 for termlib in ncurses curses termcap terminfo termlib; do
411 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
413 AC_CHECK_LIB(readline, rl_callback_handler_install,
414 [TERMLDFLAGS="-L$with_readline/lib"
415 TERMCPPFLAGS="-I$with_readline/include"
416 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
417 TERMLIBS="-lreadline $TERMLIBS"
418 AC_DEFINE(HAVE_LIBREADLINE)
419 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
427 AC_SUBST(TERMLDFLAGS)
429 # The following test taken from the cvs sources
430 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
431 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
432 # libsocket.so which has a bad implementation of gethostbyname (it
433 # only looks in /etc/hosts), so we only look for -lsocket if we need
435 AC_CHECK_FUNCS(connect)
436 if test x"$ac_cv_func_connect" = x"no"; then
439 *) AC_CHECK_LIB(nsl_s, printf) ;;
443 *) AC_CHECK_LIB(nsl, printf) ;;
447 *) AC_CHECK_LIB(socket, connect) ;;
451 *) AC_CHECK_LIB(inet, connect) ;;
453 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
455 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
456 test x"$ac_cv_lib_inet_connect" = x"yes"; then
457 # ac_cv_func_connect=yes
458 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
459 AC_DEFINE(HAVE_CONNECT)
463 ###############################################
464 # test for where we get get_yp_default_domain() from
465 AC_CHECK_FUNCS(yp_get_default_domain)
466 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
467 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
468 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
471 # Check if we have execl, if not we need to compile smbrun.
472 AC_CHECK_FUNCS(execl)
473 if test x"$ac_cv_func_execl" = x"no"; then
479 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot)
480 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
481 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
482 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
483 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
484 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
485 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
486 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
487 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl)
489 # syscall() is needed for smbwrapper.
490 AC_CHECK_FUNCS(syscall)
492 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
493 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
494 AC_CHECK_FUNCS(__getcwd _getcwd)
495 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
496 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
497 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
498 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
499 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
500 AC_CHECK_FUNCS(_write __write _fork __fork)
501 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
502 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
503 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
504 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
505 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
508 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
511 if test x$ac_cv_func_stat64 = xno ; then
512 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
514 #if defined(HAVE_UNISTD_H)
517 #include <sys/stat.h>
518 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
519 AC_MSG_RESULT([$ac_cv_func_stat64])
520 if test x$ac_cv_func_stat64 = xyes ; then
521 AC_DEFINE(HAVE_STAT64)
525 if test x$ac_cv_func_lstat64 = xno ; then
526 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
528 #if defined(HAVE_UNISTD_H)
531 #include <sys/stat.h>
532 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
533 AC_MSG_RESULT([$ac_cv_func_lstat64])
534 if test x$ac_cv_func_lstat64 = xyes ; then
535 AC_DEFINE(HAVE_LSTAT64)
539 if test x$ac_cv_func_fstat64 = xno ; then
540 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
542 #if defined(HAVE_UNISTD_H)
545 #include <sys/stat.h>
546 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
547 AC_MSG_RESULT([$ac_cv_func_fstat64])
548 if test x$ac_cv_func_fstat64 = xyes ; then
549 AC_DEFINE(HAVE_FSTAT64)
554 # If no strcasecmp, check for it in some known places
555 # It is in -lresolv on ReliantUNIX and UnixWare
556 # -lresolve *must* follow -lnsl for name resolution to work properly
559 if test x$ac_cv_func_strcasecmp = xno ; then
560 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
561 AC_DEFINE(HAVE_STRCASECMP))
565 # Check for the functions putprpwnam, set_auth_parameters,
566 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
567 # Needed for OSF1 and HPUX.
570 AC_LIBTESTFUNC(security, putprpwnam)
571 AC_LIBTESTFUNC(sec, putprpwnam)
573 AC_LIBTESTFUNC(security, set_auth_parameters)
574 AC_LIBTESTFUNC(sec, set_auth_parameters)
576 # UnixWare 7.x has its getspnam in -lgen
577 AC_LIBTESTFUNC(gen, getspnam)
579 AC_LIBTESTFUNC(security, getspnam)
580 AC_LIBTESTFUNC(sec, getspnam)
582 AC_LIBTESTFUNC(security, bigcrypt)
583 AC_LIBTESTFUNC(sec, bigcrypt)
585 AC_LIBTESTFUNC(security, getprpwnam)
586 AC_LIBTESTFUNC(sec, getprpwnam)
588 # this bit needs to be modified for each OS that is suported by
589 # smbwrapper. You need to specify how to created a shared library and
590 # how to compile C code to produce PIC object files
592 # these are the defaults, good for lots of systems
598 # and these are for particular systems
600 *linux*) AC_DEFINE(LINUX);;
601 *solaris*) AC_DEFINE(SUNOS5)
604 *sunos*) AC_DEFINE(SUNOS4)
607 *bsd*) LDSHFLAGS="-shared -Bshareable"
609 *irix*) AC_DEFINE(IRIX)
611 *irix6*) AC_DEFINE(IRIX6)
614 ATTEMPT_WRAP32_BUILD=yes
616 *aix*) AC_DEFINE(AIX);;
617 *hpux*) AC_DEFINE(HPUX)
619 # Use special PIC flags for the native HP-UX compiler.
620 if test $ac_cv_prog_cc_Ae = yes; then
625 *qnx*) AC_DEFINE(QNX);;
626 *osf*) AC_DEFINE(OSF1);;
627 *sco*) AC_DEFINE(SCO);;
628 *next2*) AC_DEFINE(NEXT2);;
629 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
632 *-univel-*) if [ test "$GCC" != yes ]; then
633 AC_DEFINE(HAVE_MEMSET)
637 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
641 if [ test "$GCC" != yes ]; then
642 AC_DEFINE(HAVE_MEMSET)
648 # try to work out how to produce PIC code with this compiler
649 AC_PROG_CC_FLAG(fPIC)
650 if test $ac_cv_prog_cc_fPIC = yes; then
653 if test x$PICFLAG = x; then
654 AC_PROG_CC_FLAG(KPIC)
655 if test $ac_cv_prog_cc_KPIC = yes; then
659 if test x$PICFLAG = x; then
660 AC_PROG_CC_FLAG(Kpic)
661 if test $ac_cv_prog_cc_Kpic = yes; then
668 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
669 AC_TRY_RUN([#include <stdio.h>
670 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
671 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
672 if test x"$samba_cv_have_longlong" = x"yes"; then
673 AC_DEFINE(HAVE_LONGLONG)
677 # Check if the compiler supports the LL prefix on long long integers.
680 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
681 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
682 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
683 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
684 AC_DEFINE(COMPILER_SUPPORTS_LL)
688 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
689 AC_TRY_RUN([#include <stdio.h>
690 #include <sys/stat.h>
691 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
692 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
693 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
694 AC_DEFINE(SIZEOF_OFF_T,8)
697 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
699 #if defined(HAVE_UNISTD_H)
703 #include <sys/stat.h>
704 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
705 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
706 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
707 AC_DEFINE(HAVE_OFF64_T)
710 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
711 AC_TRY_RUN([#include <stdio.h>
712 #include <sys/stat.h>
713 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
714 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
715 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
716 AC_DEFINE(SIZEOF_INO_T,8)
719 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
721 #if defined(HAVE_UNISTD_H)
725 #include <sys/stat.h>
726 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
727 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
728 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
729 AC_DEFINE(HAVE_INO64_T)
732 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
734 #if defined(HAVE_UNISTD_H)
737 #include <sys/types.h>
738 #include <dirent.h>],
739 [struct dirent64 de;],
740 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
741 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
742 AC_DEFINE(HAVE_STRUCT_DIRENT64)
745 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
746 AC_TRY_RUN([#include <stdio.h>
747 main() { char c; c=250; exit((c > 0)?0:1); }],
748 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
749 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
750 AC_DEFINE(HAVE_UNSIGNED_CHAR)
753 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
754 AC_TRY_COMPILE([#include <sys/types.h>
755 #include <sys/socket.h>
756 #include <netinet/in.h>],
757 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
758 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
759 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
760 AC_DEFINE(HAVE_SOCK_SIN_LEN)
763 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
764 AC_TRY_COMPILE([#include <sys/types.h>
766 void seekdir(DIR *d, long loc) { return; }],[return 0;],
767 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
768 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
769 AC_DEFINE(SEEKDIR_RETURNS_VOID)
772 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
773 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
774 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
775 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
776 AC_DEFINE(HAVE_FILE_MACRO)
779 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
780 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
781 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
782 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
783 AC_DEFINE(HAVE_FUNCTION_MACRO)
786 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
788 #include <sys/time.h>
790 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
791 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
792 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
793 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
796 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
798 #include <sys/types.h>
800 void foo(const char *format, ...) {
805 va_start(ap, format);
806 len = vsnprintf(0, 0, format, ap);
808 if (len != 5) exit(1);
810 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
814 main() { foo("hello"); }
816 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
817 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
818 AC_DEFINE(HAVE_C99_VSNPRINTF)
821 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
822 AC_TRY_RUN([#include <sys/types.h>
824 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
825 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
826 di->d_name[0] == 0) exit(0); exit(1);} ],
827 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
828 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
829 AC_DEFINE(HAVE_BROKEN_READDIR)
832 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
833 AC_TRY_COMPILE([#include <sys/types.h>
835 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
836 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
837 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
838 AC_DEFINE(HAVE_UTIMBUF)
841 dnl utmp and utmpx come in many flavours
842 dnl We need to check for many of them
843 dnl But we don't need to do each and every one, because our code uses
844 dnl mostly just the utmp (not utmpx) fields.
846 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
848 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
849 AC_TRY_COMPILE([#include <sys/types.h>
851 [struct utmp ut; ut.ut_name[0] = 'a';],
852 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
853 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
854 AC_DEFINE(HAVE_UT_UT_NAME)
857 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
858 AC_TRY_COMPILE([#include <sys/types.h>
860 [struct utmp ut; ut.ut_user[0] = 'a';],
861 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
862 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
863 AC_DEFINE(HAVE_UT_UT_USER)
866 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
867 AC_TRY_COMPILE([#include <sys/types.h>
869 [struct utmp ut; ut.ut_id[0] = 'a';],
870 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
871 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
872 AC_DEFINE(HAVE_UT_UT_ID)
875 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
876 AC_TRY_COMPILE([#include <sys/types.h>
878 [struct utmp ut; ut.ut_host[0] = 'a';],
879 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
880 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
881 AC_DEFINE(HAVE_UT_UT_HOST)
884 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
885 AC_TRY_COMPILE([#include <sys/types.h>
887 [struct utmp ut; time_t t; ut.ut_time = t;],
888 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
889 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
890 AC_DEFINE(HAVE_UT_UT_TIME)
893 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
894 AC_TRY_COMPILE([#include <sys/types.h>
896 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
897 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
898 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
899 AC_DEFINE(HAVE_UT_UT_TV)
902 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
903 AC_TRY_COMPILE([#include <sys/types.h>
905 [struct utmp ut; ut.ut_type = 0;],
906 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
907 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
908 AC_DEFINE(HAVE_UT_UT_TYPE)
911 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
912 AC_TRY_COMPILE([#include <sys/types.h>
914 [struct utmp ut; ut.ut_pid = 0;],
915 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
916 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
917 AC_DEFINE(HAVE_UT_UT_PID)
920 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
921 AC_TRY_COMPILE([#include <sys/types.h>
923 [struct utmp ut; ut.ut_exit.e_exit = 0;],
924 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
925 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
926 AC_DEFINE(HAVE_UT_UT_EXIT)
929 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
930 AC_TRY_COMPILE([#include <sys/types.h>
932 [struct utmp ut; ut.ut_addr = 0;],
933 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
934 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
935 AC_DEFINE(HAVE_UT_UT_ADDR)
938 if test x$ac_cv_func_pututline = xyes ; then
939 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
940 AC_TRY_COMPILE([#include <sys/types.h>
942 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
943 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
944 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
945 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
949 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
950 AC_TRY_COMPILE([#include <sys/types.h>
952 [struct utmpx ux; ux.ut_syslen = 0;],
953 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
954 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
955 AC_DEFINE(HAVE_UX_UT_SYSLEN)
958 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
960 #include <sys/types.h>
963 #define F_GETLEASE 1025
966 int fd = open("/dev/null", O_RDONLY);
967 return fcntl(fd, F_GETLEASE, 0) == -1;
970 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
971 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
972 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
975 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
977 #include <sys/types.h>
981 #define F_NOTIFY 1026
984 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
987 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
988 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
989 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
992 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
994 #include <sys/types.h>
997 #include <sys/file.h>
1000 #define LOCK_READ 64
1003 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1006 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1007 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1008 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1014 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1015 AC_TRY_COMPILE([#include <sys/types.h>
1016 #include <fcntl.h>],
1017 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1018 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1019 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1020 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1023 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1024 AC_TRY_RUN([#include <sys/types.h>
1025 #include <sys/capability.h>
1028 if ((cap = cap_get_proc()) == NULL)
1030 cap->cap_effective |= CAP_NETWORK_MGT;
1031 cap->cap_inheritable |= CAP_NETWORK_MGT;
1036 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1037 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1038 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1042 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1043 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1046 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1047 AC_TRY_COMPILE([#include <sys/types.h>
1048 #if defined(HAVE_RPC_RPC_H)
1049 #include <rpc/rpc.h>
1052 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1053 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1054 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1057 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1058 AC_TRY_COMPILE([#include <sys/types.h>
1059 #if defined(HAVE_RPC_RPC_H)
1060 #include <rpc/rpc.h>
1063 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1064 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1065 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1068 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1069 AC_TRY_COMPILE([#include <sys/types.h>
1070 #if defined(HAVE_RPC_RPC_H)
1071 #include <rpc/rpc.h>
1074 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1075 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1076 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1079 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1080 AC_TRY_COMPILE([#include <sys/types.h>
1081 #if defined(HAVE_RPC_RPC_H)
1082 #include <rpc/rpc.h>
1085 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1086 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1087 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1091 dnl Some systems (SCO) have a problem including
1092 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1093 dnl as a #define in <prot.h> and as part of an enum
1097 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1098 AC_TRY_COMPILE([#include <sys/types.h>
1099 #ifdef HAVE_SYS_SECURITY_H
1100 #include <sys/security.h>
1102 #endif /* HAVE_SYS_SECURITY_H */
1103 #if defined(HAVE_RPC_RPC_H)
1104 #include <rpc/rpc.h>
1107 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1108 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1109 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1112 AC_MSG_CHECKING([for test routines])
1113 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1115 AC_MSG_ERROR([cant find test code. Aborting config]),
1116 AC_MSG_WARN([cannot run when cross-compiling]))
1118 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1119 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1120 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1121 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1122 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1125 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1126 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1127 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1128 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1129 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1132 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1133 SAVE_CPPFLAGS="$CPPFLAGS"
1134 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1136 #define REPLACE_GETPASS 1
1137 #define NO_CONFIG_H 1
1138 #define main dont_declare_main
1139 #include "${srcdir-.}/lib/getsmbpass.c"
1141 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1142 CPPFLAGS="$SAVE_CPPFLAGS"
1144 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1145 AC_DEFINE(REPLACE_GETPASS)
1148 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1151 #include <sys/types.h>
1152 #include <netinet/in.h>
1153 #ifdef HAVE_ARPA_INET_H
1154 #include <arpa/inet.h>
1156 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1157 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1158 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1160 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1161 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1162 AC_DEFINE(REPLACE_INET_NTOA)
1165 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1166 AC_TRY_RUN([#include <stdlib.h>
1167 #include <sys/types.h>
1168 #include <sys/stat.h>
1172 char tpl[20]="/tmp/test.XXXXXX";
1173 int fd = mkstemp(tpl);
1174 if (fd == -1) exit(1);
1176 if (fstat(fd, &st) != 0) exit(1);
1177 if ((st.st_mode & 0777) != 0600) exit(1);
1180 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1181 samba_cv_HAVE_SECURE_MKSTEMP=no,
1182 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1183 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1184 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1187 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1188 AC_TRY_RUN([#include <unistd.h>
1189 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1190 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1191 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1192 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1195 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1196 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1197 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1198 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1199 AC_DEFINE(HAVE_ROOT)
1201 AC_MSG_WARN(running as non-root will disable some tests)
1205 # look for a method of finding the list of network interfaces
1207 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1209 #define HAVE_IFACE_AIX 1
1210 #define AUTOCONF_TEST 1
1211 #include "confdefs.h"
1212 #include "${srcdir-.}/lib/interfaces.c"],
1213 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1214 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1215 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1218 if test $iface = no; then
1219 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1221 #define HAVE_IFACE_IFCONF 1
1222 #define AUTOCONF_TEST 1
1223 #include "confdefs.h"
1224 #include "${srcdir-.}/lib/interfaces.c"],
1225 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1226 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1227 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1231 if test $iface = no; then
1232 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1234 #define HAVE_IFACE_IFREQ 1
1235 #define AUTOCONF_TEST 1
1236 #include "confdefs.h"
1237 #include "${srcdir-.}/lib/interfaces.c"],
1238 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1239 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1240 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1245 ################################################
1246 # look for a method of setting the effective uid
1248 if test $seteuid = no; then
1249 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1251 #define AUTOCONF_TEST 1
1252 #define USE_SETRESUID 1
1253 #include "confdefs.h"
1254 #include "${srcdir-.}/lib/util_sec.c"],
1255 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1256 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1257 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1262 if test $seteuid = no; then
1263 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1265 #define AUTOCONF_TEST 1
1266 #define USE_SETREUID 1
1267 #include "confdefs.h"
1268 #include "${srcdir-.}/lib/util_sec.c"],
1269 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1270 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1271 seteuid=yes;AC_DEFINE(USE_SETREUID)
1275 if test $seteuid = no; then
1276 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1278 #define AUTOCONF_TEST 1
1279 #define USE_SETEUID 1
1280 #include "confdefs.h"
1281 #include "${srcdir-.}/lib/util_sec.c"],
1282 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1283 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1284 seteuid=yes;AC_DEFINE(USE_SETEUID)
1288 if test $seteuid = no; then
1289 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1291 #define AUTOCONF_TEST 1
1292 #define USE_SETUIDX 1
1293 #include "confdefs.h"
1294 #include "${srcdir-.}/lib/util_sec.c"],
1295 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1296 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1297 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1302 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1303 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1304 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1305 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1306 AC_DEFINE(HAVE_MMAP)
1309 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1310 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1311 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1312 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1313 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1316 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1317 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1318 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1319 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1320 AC_DEFINE(HAVE_FCNTL_LOCK)
1323 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1324 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1325 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1326 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1327 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1332 dnl Don't check for 64 bit fcntl locking if we know that the
1333 dnl glibc2.1 broken check has succeeded.
1336 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1338 #if defined(HAVE_UNISTD_H)
1348 #ifdef HAVE_SYS_FCNTL_H
1349 #include <sys/fcntl.h>
1351 main() { struct flock64 fl64;
1352 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1358 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1360 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1361 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1365 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1366 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1367 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1368 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1369 AC_DEFINE(HAVE_TRUNCATED_SALT)
1372 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1373 AC_TRY_COMPILE([#include <sys/acl.h>
1374 #if defined(HAVE_RPCSVC_NIS_H)
1375 #include <rpcsvc/nis.h>
1378 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1379 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1380 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1384 #################################################
1385 # check for smbwrapper support
1386 AC_MSG_CHECKING(whether to use smbwrapper)
1387 AC_ARG_WITH(smbwrapper,
1388 [ --with-smbwrapper Include SMB wrapper support
1389 --without-smbwrapper Don't include SMB wrapper support (default)],
1390 [ case "$withval" in
1393 AC_DEFINE(WITH_SMBWRAPPER)
1394 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1396 if test x$ATTEMPT_WRAP32_BUILD = x; then
1399 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1402 # Conditions under which smbwrapper should not be built.
1404 if test x$PICFLAG = x; then
1405 echo No support for PIC code - disabling smbwrapper and smbsh
1408 elif test x$ac_cv_func_syscall = xno; then
1409 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1421 #################################################
1422 # check for the AFS filesystem
1423 AC_MSG_CHECKING(whether to use AFS)
1425 [ --with-afs Include AFS support
1426 --without-afs Don't include AFS support (default)],
1427 [ case "$withval" in
1440 #################################################
1441 # check for the DFS auth system
1442 AC_MSG_CHECKING(whether to use DFS auth)
1444 [ --with-dfs Include DFS support
1445 --without-dfs Don't include DFS support (default)],
1446 [ case "$withval" in
1458 #################################################
1459 # check for Kerberos IV auth system
1460 AC_MSG_CHECKING(whether to use Kerberos IV)
1462 [ --with-krb4=base-dir Include Kerberos IV support
1463 --without-krb4 Don't include Kerberos IV support (default)],
1464 [ AC_MSG_RESULT(yes)
1465 AC_DEFINE(KRB4_AUTH)
1466 AC_CHECK_LIB(resolv, dn_expand)
1467 LIBS="$LIBS -lkrb -ldes"
1468 CFLAGS="$CFLAGS -I$withval/include"
1469 LDFLAGS="$LDFLAGS -L$withval/lib"],
1473 #################################################
1474 # check for Kerberos 5 auth system
1475 AC_MSG_CHECKING(whether to use Kerberos 5)
1477 [ --with-krb5=base-dir Include Kerberos 5 support
1478 --without-krb5 Don't include Kerberos 5 support (default)],
1479 [ AC_MSG_RESULT(yes)
1480 AC_DEFINE(KRB5_AUTH)
1481 LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
1482 CFLAGS="$CFLAGS -I$withval/include"
1483 LDFLAGS="$LDFLAGS -L$withval/lib"],
1487 #################################################
1488 # check for automount support
1489 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1490 AC_ARG_WITH(automount,
1491 [ --with-automount Include AUTOMOUNT support
1492 --without-automount Don't include AUTOMOUNT support (default)],
1493 [ case "$withval" in
1496 AC_DEFINE(WITH_AUTOMOUNT)
1505 #################################################
1506 # check for smbmount support
1507 AC_MSG_CHECKING(whether to use SMBMOUNT)
1508 AC_ARG_WITH(smbmount,
1509 [ --with-smbmount Include SMBMOUNT (Linux only) support
1510 --without-smbmount Don't include SMBMOUNT support (default)],
1511 [ case "$withval" in
1514 AC_DEFINE(WITH_SMBMOUNT)
1515 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1527 #################################################
1528 # check for a PAM password database
1529 with_pam_for_crypt=no
1530 AC_MSG_CHECKING(whether to use PAM password database)
1532 [ --with-pam Include PAM password database support
1533 --without-pam Don't include PAM password database support (default)],
1534 [ case "$withval" in
1539 with_pam_for_crypt=yes
1548 # we can't build a pam module if we don't have pam.
1549 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1551 #################################################
1552 # check for pam_smbpass support
1553 AC_MSG_CHECKING(whether to use pam_smbpass)
1554 AC_ARG_WITH(pam_smbpass,
1555 [ --with-pam_smbpass Include the smbpass PAM module
1556 --without-pam_smbpass Don't include the smbpass PAM module (default)],
1557 [ case "$withval" in
1561 # Conditions under which pam_smbpass should not be built.
1563 if test x$PICFLAG = x; then
1564 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1566 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1567 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1570 AC_DEFINE(WITH_PAM_SMBPASS)
1571 PAM_MOD="bin/pam_smbpass.so"
1582 ###############################################
1583 # test for where we get crypt() from, but only
1585 if test $with_pam_for_crypt = no; then
1586 AC_CHECK_FUNCS(crypt)
1587 if test x"$ac_cv_func_crypt" = x"no"; then
1588 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1589 AC_DEFINE(HAVE_CRYPT)])
1594 #################################################
1595 # check for a TDB password database
1596 AC_MSG_CHECKING(whether to use TDB password database)
1598 [ --with-tdbsam Include experimental TDB password database
1599 --without-tdbsam Don't include experimental TDB password database (default)],
1600 [ case "$withval" in
1603 AC_DEFINE(WITH_TDBPWD)
1604 # AC_MSG_ERROR([TDB password database not supported in this version.])
1613 #################################################
1614 # check for a LDAP password database
1615 AC_MSG_CHECKING(whether to use LDAP password database)
1617 [ --with-ldap Include LDAP support
1618 --without-ldap Don't include LDAP support (default)],
1619 [ case "$withval" in
1622 AC_DEFINE(WITH_LDAP)
1623 AC_MSG_ERROR([LDAP password database not supported in this version.])
1632 #################################################
1633 # check for a NISPLUS password database
1634 AC_MSG_CHECKING(whether to use NISPLUS password database)
1635 AC_ARG_WITH(nisplus,
1636 [ --with-nisplus Include NISPLUS password database support
1637 --without-nisplus Don't include NISPLUS password database support (default)],
1638 [ case "$withval" in
1641 AC_DEFINE(WITH_NISPLUS)
1650 #################################################
1651 # check for a NISPLUS_HOME support
1652 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1653 AC_ARG_WITH(nisplus-home,
1654 [ --with-nisplus-home Include NISPLUS_HOME support
1655 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
1656 [ case "$withval" in
1659 AC_DEFINE(WITH_NISPLUS_HOME)
1668 #################################################
1669 # check for the secure socket layer
1670 AC_MSG_CHECKING(whether to use SSL)
1672 [ --with-ssl Include SSL support
1673 --without-ssl Don't include SSL support (default)
1674 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
1675 [ case "$withval" in
1679 withval="/usr/local/ssl" # default
1681 if test "${with_sslinc+set}" = set; then
1683 withval="$with_sslinc"
1686 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
1687 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1688 LIBS="-lssl -lcrypto $LIBS"
1689 LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
1692 CFLAGS="-I${withval}/include $CFLAGS"
1693 LIBS="-lssl -lcrypto $LIBS"
1694 LDFLAGS="-L${withval}/lib $LDFLAGS"
1700 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1701 LIBS="-lssl -lcrypto $LIBS"
1702 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
1706 if test ! -d ${withval}; then
1707 echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
1711 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
1721 #################################################
1722 # check for syslog logging
1723 AC_MSG_CHECKING(whether to use syslog logging)
1725 [ --with-syslog Include experimental SYSLOG support
1726 --without-syslog Don't include SYSLOG support (default)],
1727 [ case "$withval" in
1730 AC_DEFINE(WITH_SYSLOG)
1739 #################################################
1740 # check for a shared memory profiling support
1741 AC_MSG_CHECKING(whether to use profiling)
1742 AC_ARG_WITH(profile,
1743 [ --with-profile Include profile support
1744 --without-profile Don't include profile support (default)],
1745 [ case "$withval" in
1748 AC_DEFINE(WITH_PROFILE)
1758 #################################################
1759 # check for experimental netatalk resource fork support
1760 AC_MSG_CHECKING(whether to support netatalk)
1761 AC_ARG_WITH(netatalk,
1762 [ --with-netatalk Include experimental Netatalk support
1763 --without-netatalk Don't include experimental Netatalk support (default)],
1764 [ case "$withval" in
1767 AC_DEFINE(WITH_NETATALK)
1776 #################################################
1777 # check for experimental disk-quotas support
1778 QUOTAOBJS=smbd/noquotas.o
1780 AC_MSG_CHECKING(whether to support disk-quotas)
1782 [ --with-quotas Include experimental disk-quota support
1783 --without-quotas Don't include experimental disk-quota support (default)],
1784 [ case "$withval" in
1787 QUOTAOBJS=smbd/quotas.o
1797 #################################################
1798 # check for experimental utmp accounting
1800 AC_MSG_CHECKING(whether to support utmp accounting)
1802 [ --with-utmp Include experimental utmp accounting
1803 --without-utmp Don't include experimental utmp accounting (default)],
1804 [ case "$withval" in
1807 AC_DEFINE(WITH_UTMP)
1816 #################################################
1817 # check for MS Dfs support
1819 AC_MSG_CHECKING(whether to support Microsoft Dfs)
1821 [ --with-msdfs Include MS Dfs support
1822 --without-msdfs Don't include MS Dfs support (default)],
1823 [ case "$withval" in
1826 AC_DEFINE(WITH_MSDFS)
1835 #################################################
1836 # set private directory location
1837 AC_ARG_WITH(privatedir,
1838 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
1839 [ case "$withval" in
1842 # Just in case anybody calls it without argument
1844 AC_MSG_WARN([--with-privatedir called without argument - will use default])
1845 privatedir='${prefix}/private'
1848 privatedir="$withval"
1851 AC_SUBST(privatedir)],
1852 [privatedir='${prefix}/private'
1853 AC_SUBST(privatedir)]
1856 #################################################
1857 # set lock directory location
1858 AC_ARG_WITH(lockdir,
1859 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
1860 [ case "$withval" in
1863 # Just in case anybody calls it without argument
1865 AC_MSG_WARN([--with-lockdir called without argument - will use default])
1866 lockdir='$(VARDIR)/locks'
1873 [lockdir='$(VARDIR)/locks'
1877 #################################################
1878 # set SWAT directory location
1879 AC_ARG_WITH(swatdir,
1880 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
1881 [ case "$withval" in
1884 # Just in case anybody does it
1886 AC_MSG_WARN([--with-swatdir called without argument - will use default])
1887 swatdir='${prefix}/swat'
1894 [swatdir='${prefix}/swat'
1898 #################################################
1899 # these tests are taken from the GNU fileutils package
1900 AC_CHECKING(how to get filesystem space usage)
1903 # Test for statvfs64.
1904 if test $space = no; then
1906 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
1908 #if defined(HAVE_UNISTD_H)
1911 #include <sys/types.h>
1912 #include <sys/statvfs.h>
1915 struct statvfs64 fsd;
1916 exit (statvfs64 (".", &fsd));
1918 fu_cv_sys_stat_statvfs64=yes,
1919 fu_cv_sys_stat_statvfs64=no,
1920 fu_cv_sys_stat_statvfs64=cross)])
1921 if test $fu_cv_sys_stat_statvfs64 = yes; then
1923 AC_DEFINE(STAT_STATVFS64)
1927 # Perform only the link test since it seems there are no variants of the
1928 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
1929 # because that got a false positive on SCO OSR5. Adding the declaration
1930 # of a `struct statvfs' causes this test to fail (as it should) on such
1931 # systems. That system is reported to work fine with STAT_STATFS4 which
1932 # is what it gets when this test fails.
1933 if test $space = no; then
1935 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
1936 [AC_TRY_LINK([#include <sys/types.h>
1937 #include <sys/statvfs.h>],
1938 [struct statvfs fsd; statvfs (0, &fsd);],
1939 fu_cv_sys_stat_statvfs=yes,
1940 fu_cv_sys_stat_statvfs=no)])
1941 if test $fu_cv_sys_stat_statvfs = yes; then
1943 AC_DEFINE(STAT_STATVFS)
1947 if test $space = no; then
1948 # DEC Alpha running OSF/1
1949 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
1950 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
1952 #include <sys/param.h>
1953 #include <sys/types.h>
1954 #include <sys/mount.h>
1959 exit (statfs (".", &fsd, sizeof (struct statfs)));
1961 fu_cv_sys_stat_statfs3_osf1=yes,
1962 fu_cv_sys_stat_statfs3_osf1=no,
1963 fu_cv_sys_stat_statfs3_osf1=no)])
1964 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
1965 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
1967 AC_DEFINE(STAT_STATFS3_OSF1)
1971 if test $space = no; then
1973 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
1974 member (AIX, 4.3BSD)])
1975 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
1977 #ifdef HAVE_SYS_PARAM_H
1978 #include <sys/param.h>
1980 #ifdef HAVE_SYS_MOUNT_H
1981 #include <sys/mount.h>
1983 #ifdef HAVE_SYS_VFS_H
1984 #include <sys/vfs.h>
1990 exit (statfs (".", &fsd));
1992 fu_cv_sys_stat_statfs2_bsize=yes,
1993 fu_cv_sys_stat_statfs2_bsize=no,
1994 fu_cv_sys_stat_statfs2_bsize=no)])
1995 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
1996 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
1998 AC_DEFINE(STAT_STATFS2_BSIZE)
2002 if test $space = no; then
2004 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2005 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2006 [AC_TRY_RUN([#include <sys/types.h>
2007 #include <sys/statfs.h>
2011 exit (statfs (".", &fsd, sizeof fsd, 0));
2013 fu_cv_sys_stat_statfs4=yes,
2014 fu_cv_sys_stat_statfs4=no,
2015 fu_cv_sys_stat_statfs4=no)])
2016 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2017 if test $fu_cv_sys_stat_statfs4 = yes; then
2019 AC_DEFINE(STAT_STATFS4)
2023 if test $space = no; then
2025 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2026 member (4.4BSD and NetBSD)])
2027 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2028 [AC_TRY_RUN([#include <sys/types.h>
2029 #ifdef HAVE_SYS_PARAM_H
2030 #include <sys/param.h>
2032 #ifdef HAVE_SYS_MOUNT_H
2033 #include <sys/mount.h>
2039 exit (statfs (".", &fsd));
2041 fu_cv_sys_stat_statfs2_fsize=yes,
2042 fu_cv_sys_stat_statfs2_fsize=no,
2043 fu_cv_sys_stat_statfs2_fsize=no)])
2044 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2045 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2047 AC_DEFINE(STAT_STATFS2_FSIZE)
2051 if test $space = no; then
2053 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2054 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2055 [AC_TRY_RUN([#include <sys/types.h>
2056 #ifdef HAVE_SYS_PARAM_H
2057 #include <sys/param.h>
2059 #ifdef HAVE_SYS_MOUNT_H
2060 #include <sys/mount.h>
2062 #ifdef HAVE_SYS_FS_TYPES_H
2063 #include <sys/fs_types.h>
2068 /* Ultrix's statfs returns 1 for success,
2069 0 for not mounted, -1 for failure. */
2070 exit (statfs (".", &fsd) != 1);
2072 fu_cv_sys_stat_fs_data=yes,
2073 fu_cv_sys_stat_fs_data=no,
2074 fu_cv_sys_stat_fs_data=no)])
2075 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2076 if test $fu_cv_sys_stat_fs_data = yes; then
2078 AC_DEFINE(STAT_STATFS2_FS_DATA)
2083 # As a gating factor for large file support, in order to
2084 # use <4GB files we must have the following minimal support
2086 # long long, and a 64 bit off_t or off64_t.
2087 # If we don't have all of these then disable large
2090 AC_MSG_CHECKING([if large file support can be enabled])
2092 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2093 #include <sys/types.h>
2099 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2100 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2101 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2103 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
2105 AC_ARG_WITH(spinlocks, [ --with-spinlocks use spin locks instead of fcntl locks ])
2106 if test "x$with_spinlocks" = "xyes"; then
2107 AC_DEFINE(USE_SPINLOCKS)
2111 AC_DEFINE(SPARC_SPINLOCKS)
2114 i386|i486|i586|i686)
2115 AC_DEFINE(INTEL_SPINLOCKS)
2119 AC_DEFINE(MIPS_SPINLOCKS)
2123 AC_DEFINE(POWERPC_SPINLOCKS)
2128 #################################################
2129 # check for ACL support
2131 AC_MSG_CHECKING(whether to support ACLs)
2132 AC_ARG_WITH(acl-support,
2133 [ --with-acl-support Include ACL support
2134 --without-acl-support Don't include ACL support (default)],
2135 [ case "$withval" in
2140 AC_MSG_RESULT(Using UnixWare ACLs)
2141 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2144 AC_MSG_RESULT(Using solaris ACLs)
2145 AC_DEFINE(HAVE_SOLARIS_ACLS)
2148 AC_MSG_RESULT(Using IRIX ACLs)
2149 AC_DEFINE(HAVE_IRIX_ACLS)
2152 AC_MSG_RESULT(Using AIX ACLs)
2153 AC_DEFINE(HAVE_AIX_ACLS)
2156 AC_CHECK_LIB(acl,acl_get_file)
2157 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2158 AC_TRY_LINK([#include <sys/types.h>
2159 #include <sys/acl.h>],
2160 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2161 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2162 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2163 AC_MSG_RESULT(Using posix ACLs)
2164 AC_DEFINE(HAVE_POSIX_ACLS)
2165 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2166 AC_TRY_LINK([#include <sys/types.h>
2167 #include <sys/acl.h>],
2168 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2169 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2170 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2171 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2179 AC_DEFINE(HAVE_NO_ACLS)
2182 AC_DEFINE(HAVE_NO_ACLS)
2186 #################################################
2187 # check whether winbind is supported on this platform
2189 AC_MSG_CHECKING(whether to compile winbind)
2193 WINBIND_TARGETS="$WINBIND_TARGETS \$(WINBIND_PROGS)"
2196 winbind_no_reason=", unsupported on $host_os"
2200 AC_ARG_WITH(winbind,
2201 [ --with-winbind Build winbind library (default, if supported by OS)
2202 --without-winbind Don't build winbind library],
2212 if test x"$WINBIND_TARGETS" = x; then
2213 AC_MSG_RESULT(no$winbind_no_reason)
2218 AC_SUBST(WINBIND_TARGETS)
2220 #################################################
2221 # final configure stuff
2223 echo "checking configure summary"
2224 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2225 echo "configure OK";,
2226 AC_MSG_ERROR([summary failure. Aborting config]),:)
2231 AC_OUTPUT(include/stamp-h Makefile)