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)
12 [ --with-fhs Use FHS-compliant paths (default=no)],
13 codepagedir="\$(DATADIR)/samba/codepages"
14 configdir="${sysconfdir}/samba"
15 lockdir="\${VARDIR}/cache/samba"
16 logfilebase="\${VARDIR}/log/samba"
17 privatedir="\${CONFIGDIR}/private"
18 swatdir="\${DATADIR}/samba/swat",
19 codepagedir="\$(LIBDIR)/codepages"
20 configdir="\$(LIBDIR)"
21 lockdir="\$(VARDIR)/locks"
22 logfilebase="\$(VARDIR)"
23 privatedir="\${prefix}/private"
24 swatdir="\${prefix}/swat")
26 #################################################
27 # set private directory location
28 AC_ARG_WITH(privatedir,
29 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
33 # Just in case anybody calls it without argument
35 AC_MSG_WARN([--with-privatedir called without argument - will use default])
42 #################################################
43 # set lock directory location
45 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
49 # Just in case anybody calls it without argument
51 AC_MSG_WARN([--with-lockdir called without argument - will use default])
58 #################################################
59 # set SWAT directory location
61 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
65 # Just in case anybody does it
67 AC_MSG_WARN([--with-swatdir called without argument - will use default])
74 #################################################
75 # set configuration directory location
76 AC_ARG_WITH(configdir,
77 [ --with-configdir=DIR Where to put configuration files (\$libdir)],
81 # Just in case anybody does it
83 AC_MSG_WARN([--with-configdir called without argument - will use default])
90 #################################################
91 # set codepage directory location
92 AC_ARG_WITH(codepagedir,
93 [ --with-codepagedir=DIR Where to put codepage files (\$libdir/codepages)],
97 # Just in case anybody does it
99 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
102 codepagedir="$withval"
107 AC_SUBST(codepagedir)
110 AC_SUBST(logfilebase)
116 dnl Unique-to-Samba variables we'll be playing with.
131 AC_SUBST(LIBSMBCLIENT_SHARED)
132 AC_SUBST(LIBSMBCLIENT)
134 # compile with optimization and without debugging by default
135 CFLAGS="-O ${CFLAGS}"
138 [ --enable-debug Turn on compiler debugging information (default=no)],
139 [if eval "test x$enable_debug = xyes"; then
140 CFLAGS="${CFLAGS} -g"
145 dnl Checks for programs.
150 dnl Check if C compiler understands -c and -o at the same time
152 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
159 dnl Check if the C compiler understands volatile (it should, being ANSI).
160 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
161 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
162 samba_cv_volatile=yes,samba_cv_volatile=no)])
163 if test x"$samba_cv_volatile" = x"yes"; then
164 AC_DEFINE(HAVE_VOLATILE)
171 dnl Add #include for broken IRIX header files
173 *irix6*) AC_ADD_INCLUDE(<standards.h>)
177 AC_VALIDATE_CACHE_SYSTEM_TYPE
180 # Config CPPFLAG settings for strange OS's that must be set
181 # before other tests.
184 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
187 # mmap on HPUX is completely broken...
188 AC_DEFINE(MMAP_BLACKLIST)
189 if test $ac_cv_prog_cc_Ae = yes; then
190 CPPFLAGS="$CPPFLAGS -Ae"
193 # Defines needed for HPUX support.
194 # HPUX has bigcrypt but (sometimes?) doesn't use it for
195 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
199 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
200 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
203 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
204 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
209 # AIX4.x doesn't even admit to having large
210 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
213 AC_MSG_RESULT([enabling large file support])
214 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
217 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
218 # to the existance of large files..
219 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
220 # recommendations on large file support, however it makes the
221 # compile work using gcc 2.7 and 2.8, whereas using the Sun
222 # recommendation makes the compile fail on gcc2.7. JRA.
226 5.0*|5.1*|5.2*|5.3*|5.5*)
227 AC_MSG_RESULT([no large file support])
230 AC_MSG_RESULT([enabling large file support])
231 if test "$ac_cv_prog_gcc" = yes; then
232 ${CC-cc} -v >conftest.c 2>&1
233 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
235 case "$ac_cv_gcc_compiler_version_number" in
236 *"gcc version 2.6"*|*"gcc version 2.7"*)
237 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
240 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
244 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
250 # Tests needed for SINIX large file support.
253 if test $host = mips-sni-sysv4 ; then
254 AC_MSG_CHECKING([for LFS support])
255 old_CPPFLAGS="$CPPFLAGS"
256 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
260 #if _LFS64_LARGEFILE == 1
265 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
266 CPPFLAGS="$old_CPPFLAGS"
267 if test x$SINIX_LFS_SUPPORT = xyes ; then
268 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
269 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
270 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
271 LIBS="`getconf LFS64_LIBS` $LIBS"
273 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
277 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
280 AC_MSG_CHECKING([for LFS support])
281 old_CPPFLAGS="$CPPFLAGS"
282 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
285 #include <sys/utsname.h>
287 #if _LFS64_LARGEFILE == 1
292 /* Ensure this is glibc 2.2 or higher */
293 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
294 int libc_major = __GLIBC__;
295 int libc_minor = __GLIBC_MINOR__;
303 /* Ensure this is kernel 2.4 or higher */
306 release = uts.release;
307 major = atoi(strsep(&release, "."));
308 minor = atoi(strsep(&release, "."));
310 if (major > 2 || (major == 2 && minor > 3))
317 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
318 CPPFLAGS="$old_CPPFLAGS"
319 if test x$LINUX_LFS_SUPPORT = xyes ; then
320 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
322 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
326 AC_MSG_CHECKING([for LFS support])
327 old_CPPFLAGS="$CPPFLAGS"
328 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
332 #if _LFS64_LARGEFILE == 1
337 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
338 CPPFLAGS="$old_CPPFLAGS"
339 if test x$GLIBC_LFS_SUPPORT = xyes ; then
340 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
342 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
352 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
353 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
354 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
355 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
356 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
357 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
358 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
359 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h)
362 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
363 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
367 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
368 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
369 if test x"$ac_cv_header_shadow_h" = x"yes"; then
370 AC_DEFINE(HAVE_SHADOW_H)
374 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
375 AC_CHECK_HEADERS(nss.h nss_common.h sys/security.h security/pam_appl.h security/pam_modules.h)
376 AC_CHECK_HEADERS(stropts.h poll.h)
377 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
378 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
380 # For experimental utmp support (lastlog on some BSD-like systems)
381 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
383 # For quotas on Veritas VxFS filesystems
384 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
386 AC_CHECK_SIZEOF(int,cross)
387 AC_CHECK_SIZEOF(long,cross)
388 AC_CHECK_SIZEOF(short,cross)
403 AC_CHECK_TYPE(ino_t,unsigned)
404 AC_CHECK_TYPE(loff_t,off_t)
405 AC_CHECK_TYPE(offset_t,loff_t)
406 AC_CHECK_TYPE(ssize_t, int)
407 AC_CHECK_TYPE(wchar_t, unsigned short)
409 ############################################
410 # for cups support we need libcups, and a handful of header files
412 AC_CHECK_LIB(cups,httpConnect)
414 # I wonder if there is a nicer way of doing this?
416 if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
417 AC_CHECK_HEADERS(cups/cups.h cups/language.h)
418 if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
419 if test x"$ac_cv_header_cups_language_h" = x"yes"; then
425 ############################################
426 # we need libdl for PAM and the new VFS code
427 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
428 AC_DEFINE(HAVE_LIBDL)])
430 ############################################
431 # check for unix domain sockets
432 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
434 #include <sys/types.h>
437 #include <sys/socket.h>
438 #include <sys/un.h>],
440 struct sockaddr_un sunaddr;
441 sunaddr.sun_family = AF_UNIX;
443 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
444 if test x"$samba_cv_unixsocket" = x"yes"; then
445 AC_DEFINE(HAVE_UNIXSOCKET)
448 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
450 #include <sys/types.h>
455 #include <sys/socket.h>],[socklen_t i = 0],
456 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
457 if test x"$samba_cv_socklen_t" = x"yes"; then
458 AC_DEFINE(HAVE_SOCKLEN_T_TYPE)
461 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
463 #include <sys/types.h>
468 #include <signal.h>],[sig_atomic_t i = 0],
469 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
470 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
471 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
474 # stupid headers have the functions but no declaration. grrrr.
475 AC_HAVE_DECL(errno, [#include <errno.h>])
476 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
477 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
478 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
479 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
480 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
481 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
483 # and glibc has setresuid under linux but the function does
484 # nothing until kernel 2.1.44! very dumb.
485 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
486 AC_TRY_RUN([#include <errno.h>
487 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
488 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
489 if test x"$samba_cv_have_setresuid" = x"yes"; then
490 AC_DEFINE(HAVE_SETRESUID)
493 # Do the same check for setresguid...
495 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
496 AC_TRY_RUN([#include <unistd.h>
498 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
499 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
500 if test x"$samba_cv_have_setresgid" = x"yes"; then
501 AC_DEFINE(HAVE_SETRESGID)
506 ###############################################
507 # Readline included by default unless explicitly asked not to
508 test "${with_readline+set}" != "set" && with_readline=yes
510 # test for where we get readline() from
511 AC_MSG_CHECKING(whether to use readline)
512 AC_ARG_WITH(readline,
513 [ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto)],
514 [ case "$with_readline" in
518 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
519 AC_CHECK_HEADERS(readline/history.h)
521 AC_CHECK_HEADERS(readline.h readline/readline.h,[
522 for termlib in ncurses curses termcap terminfo termlib; do
523 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
525 AC_CHECK_LIB(readline, rl_callback_handler_install,
526 [TERMLIBS="-lreadline $TERMLIBS"
527 AC_DEFINE(HAVE_LIBREADLINE)
528 break], [TERMLIBS=], $TERMLIBS)])
536 # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
537 # alternate readline path
539 _cppflags=${CPPFLAGS}
541 # Add additional search path
542 LDFLAGS="-L$with_readline/lib $LDFLAGS"
543 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
545 AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
546 AC_CHECK_HEADERS(readline/history.h)
548 AC_CHECK_HEADERS(readline.h readline/readline.h,[
549 for termlib in ncurses curses termcap terminfo termlib; do
550 AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
552 AC_CHECK_LIB(readline, rl_callback_handler_install,
553 [TERMLDFLAGS="-L$with_readline/lib"
554 TERMCPPFLAGS="-I$with_readline/include"
555 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
556 TERMLIBS="-lreadline $TERMLIBS"
557 AC_DEFINE(HAVE_LIBREADLINE)
558 break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
566 AC_SUBST(TERMLDFLAGS)
568 # The following test taken from the cvs sources
569 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
570 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
571 # libsocket.so which has a bad implementation of gethostbyname (it
572 # only looks in /etc/hosts), so we only look for -lsocket if we need
574 AC_CHECK_FUNCS(connect)
575 if test x"$ac_cv_func_connect" = x"no"; then
578 *) AC_CHECK_LIB(nsl_s, printf) ;;
582 *) AC_CHECK_LIB(nsl, printf) ;;
586 *) AC_CHECK_LIB(socket, connect) ;;
590 *) AC_CHECK_LIB(inet, connect) ;;
592 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
594 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
595 test x"$ac_cv_lib_inet_connect" = x"yes"; then
596 # ac_cv_func_connect=yes
597 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
598 AC_DEFINE(HAVE_CONNECT)
602 ###############################################
603 # test for where we get get_yp_default_domain() from
604 AC_CHECK_FUNCS(yp_get_default_domain)
605 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
606 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
607 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
610 # Check if we have execl, if not we need to compile smbrun.
611 AC_CHECK_FUNCS(execl)
612 if test x"$ac_cv_func_execl" = x"no"; then
618 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot)
619 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
620 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
621 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
622 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
623 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
624 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
625 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
626 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
628 # syscall() is needed for smbwrapper.
629 AC_CHECK_FUNCS(syscall)
631 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
632 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
633 AC_CHECK_FUNCS(__getcwd _getcwd)
634 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
635 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
636 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
637 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
638 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
639 AC_CHECK_FUNCS(_write __write _fork __fork)
640 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
641 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
642 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
643 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
644 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
647 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
650 if test x$ac_cv_func_stat64 = xno ; then
651 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
653 #if defined(HAVE_UNISTD_H)
656 #include <sys/stat.h>
657 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
658 AC_MSG_RESULT([$ac_cv_func_stat64])
659 if test x$ac_cv_func_stat64 = xyes ; then
660 AC_DEFINE(HAVE_STAT64)
664 if test x$ac_cv_func_lstat64 = xno ; then
665 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
667 #if defined(HAVE_UNISTD_H)
670 #include <sys/stat.h>
671 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
672 AC_MSG_RESULT([$ac_cv_func_lstat64])
673 if test x$ac_cv_func_lstat64 = xyes ; then
674 AC_DEFINE(HAVE_LSTAT64)
678 if test x$ac_cv_func_fstat64 = xno ; then
679 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
681 #if defined(HAVE_UNISTD_H)
684 #include <sys/stat.h>
685 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
686 AC_MSG_RESULT([$ac_cv_func_fstat64])
687 if test x$ac_cv_func_fstat64 = xyes ; then
688 AC_DEFINE(HAVE_FSTAT64)
693 # If no strcasecmp, check for it in some known places
694 # It is in -lresolv on ReliantUNIX and UnixWare
695 # -lresolve *must* follow -lnsl for name resolution to work properly
698 if test x$ac_cv_func_strcasecmp = xno ; then
699 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
700 AC_DEFINE(HAVE_STRCASECMP))
704 # Check for the functions putprpwnam, set_auth_parameters,
705 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
706 # Needed for OSF1 and HPUX.
709 AC_LIBTESTFUNC(security, putprpwnam)
710 AC_LIBTESTFUNC(sec, putprpwnam)
712 AC_LIBTESTFUNC(security, set_auth_parameters)
713 AC_LIBTESTFUNC(sec, set_auth_parameters)
715 # UnixWare 7.x has its getspnam in -lgen
716 AC_LIBTESTFUNC(gen, getspnam)
718 AC_LIBTESTFUNC(security, getspnam)
719 AC_LIBTESTFUNC(sec, getspnam)
721 AC_LIBTESTFUNC(security, bigcrypt)
722 AC_LIBTESTFUNC(sec, bigcrypt)
724 AC_LIBTESTFUNC(security, getprpwnam)
725 AC_LIBTESTFUNC(sec, getprpwnam)
727 # this bit needs to be modified for each OS that is suported by
728 # smbwrapper. You need to specify how to created a shared library and
729 # how to compile C code to produce PIC object files
731 # these are the defaults, good for lots of systems
738 # Assume non-shared by default and override below
741 # and these are for particular systems
743 *linux*) AC_DEFINE(LINUX)
748 *solaris*) AC_DEFINE(SUNOS5)
750 *sunos*) AC_DEFINE(SUNOS4)
752 *bsd*) LDSHFLAGS="-shared -Bshareable"
754 *irix*) AC_DEFINE(IRIX)
756 *irix6*) AC_DEFINE(IRIX6)
759 ATTEMPT_WRAP32_BUILD=yes
761 *aix*) AC_DEFINE(AIX)
762 # AIX is too ugly for now
764 *hpux*) AC_DEFINE(HPUX)
766 # Use special PIC flags for the native HP-UX compiler.
767 if test $ac_cv_prog_cc_Ae = yes; then
772 *qnx*) AC_DEFINE(QNX);;
773 *osf*) AC_DEFINE(OSF1);;
774 *sco*) AC_DEFINE(SCO);;
775 *next2*) AC_DEFINE(NEXT2);;
776 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
779 *-univel-*) if [ test "$GCC" != yes ]; then
780 AC_DEFINE(HAVE_MEMSET)
784 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
788 if [ test "$GCC" != yes ]; then
789 AC_DEFINE(HAVE_MEMSET)
795 # try to work out how to produce pic code with this compiler
796 AC_PROG_CC_FLAG(fpic)
797 if test $ac_cv_prog_cc_fpic = yes; then
800 if test x$PICFLAG = x; then
801 AC_PROG_CC_FLAG(KPIC)
802 if test $ac_cv_prog_cc_KPIC = yes; then
806 if test x$PICFLAG = x; then
807 AC_PROG_CC_FLAG(Kpic)
808 if test $ac_cv_prog_cc_Kpic = yes; then
815 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
816 AC_TRY_RUN([#include <stdio.h>
817 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
818 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
819 if test x"$samba_cv_have_longlong" = x"yes"; then
820 AC_DEFINE(HAVE_LONGLONG)
824 # Check if the compiler supports the LL prefix on long long integers.
827 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
828 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
829 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
830 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
831 AC_DEFINE(COMPILER_SUPPORTS_LL)
835 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
836 AC_TRY_RUN([#include <stdio.h>
837 #include <sys/stat.h>
838 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
839 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
840 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
841 AC_DEFINE(SIZEOF_OFF_T,8)
844 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
846 #if defined(HAVE_UNISTD_H)
850 #include <sys/stat.h>
851 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
852 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
853 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
854 AC_DEFINE(HAVE_OFF64_T)
857 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
858 AC_TRY_RUN([#include <stdio.h>
859 #include <sys/stat.h>
860 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
861 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
862 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
863 AC_DEFINE(SIZEOF_INO_T,8)
866 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
868 #if defined(HAVE_UNISTD_H)
872 #include <sys/stat.h>
873 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
874 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
875 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
876 AC_DEFINE(HAVE_INO64_T)
879 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
881 #if defined(HAVE_UNISTD_H)
884 #include <sys/types.h>
885 #include <dirent.h>],
886 [struct dirent64 de;],
887 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
888 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
889 AC_DEFINE(HAVE_STRUCT_DIRENT64)
892 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
893 AC_TRY_RUN([#include <stdio.h>
894 main() { char c; c=250; exit((c > 0)?0:1); }],
895 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
896 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
897 AC_DEFINE(HAVE_UNSIGNED_CHAR)
900 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
901 AC_TRY_COMPILE([#include <sys/types.h>
902 #include <sys/socket.h>
903 #include <netinet/in.h>],
904 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
905 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
906 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
907 AC_DEFINE(HAVE_SOCK_SIN_LEN)
910 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
911 AC_TRY_COMPILE([#include <sys/types.h>
913 void seekdir(DIR *d, long loc) { return; }],[return 0;],
914 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
915 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
916 AC_DEFINE(SEEKDIR_RETURNS_VOID)
919 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
920 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
921 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
922 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
923 AC_DEFINE(HAVE_FILE_MACRO)
926 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
927 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
928 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
929 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
930 AC_DEFINE(HAVE_FUNCTION_MACRO)
933 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
935 #include <sys/time.h>
937 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
938 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
939 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
940 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
943 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
945 #include <sys/types.h>
947 void foo(const char *format, ...) {
952 va_start(ap, format);
953 len = vsnprintf(0, 0, format, ap);
955 if (len != 5) exit(1);
957 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
961 main() { foo("hello"); }
963 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
964 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
965 AC_DEFINE(HAVE_C99_VSNPRINTF)
968 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
969 AC_TRY_RUN([#include <sys/types.h>
971 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
972 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
973 di->d_name[0] == 0) exit(0); exit(1);} ],
974 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
975 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
976 AC_DEFINE(HAVE_BROKEN_READDIR)
979 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
980 AC_TRY_COMPILE([#include <sys/types.h>
982 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
983 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
984 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
985 AC_DEFINE(HAVE_UTIMBUF)
988 dnl utmp and utmpx come in many flavours
989 dnl We need to check for many of them
990 dnl But we don't need to do each and every one, because our code uses
991 dnl mostly just the utmp (not utmpx) fields.
993 AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
995 AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
996 AC_TRY_COMPILE([#include <sys/types.h>
998 [struct utmp ut; ut.ut_name[0] = 'a';],
999 samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
1000 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
1001 AC_DEFINE(HAVE_UT_UT_NAME)
1004 AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
1005 AC_TRY_COMPILE([#include <sys/types.h>
1007 [struct utmp ut; ut.ut_user[0] = 'a';],
1008 samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
1009 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
1010 AC_DEFINE(HAVE_UT_UT_USER)
1013 AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
1014 AC_TRY_COMPILE([#include <sys/types.h>
1016 [struct utmp ut; ut.ut_id[0] = 'a';],
1017 samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
1018 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
1019 AC_DEFINE(HAVE_UT_UT_ID)
1022 AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
1023 AC_TRY_COMPILE([#include <sys/types.h>
1025 [struct utmp ut; ut.ut_host[0] = 'a';],
1026 samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
1027 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
1028 AC_DEFINE(HAVE_UT_UT_HOST)
1031 AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
1032 AC_TRY_COMPILE([#include <sys/types.h>
1034 [struct utmp ut; time_t t; ut.ut_time = t;],
1035 samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
1036 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
1037 AC_DEFINE(HAVE_UT_UT_TIME)
1040 AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
1041 AC_TRY_COMPILE([#include <sys/types.h>
1043 [struct utmp ut; struct timeval tv; ut.ut_tv = tv;],
1044 samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
1045 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
1046 AC_DEFINE(HAVE_UT_UT_TV)
1049 AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
1050 AC_TRY_COMPILE([#include <sys/types.h>
1052 [struct utmp ut; ut.ut_type = 0;],
1053 samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
1054 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
1055 AC_DEFINE(HAVE_UT_UT_TYPE)
1058 AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
1059 AC_TRY_COMPILE([#include <sys/types.h>
1061 [struct utmp ut; ut.ut_pid = 0;],
1062 samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
1063 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
1064 AC_DEFINE(HAVE_UT_UT_PID)
1067 AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
1068 AC_TRY_COMPILE([#include <sys/types.h>
1070 [struct utmp ut; ut.ut_exit.e_exit = 0;],
1071 samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
1072 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
1073 AC_DEFINE(HAVE_UT_UT_EXIT)
1076 AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
1077 AC_TRY_COMPILE([#include <sys/types.h>
1079 [struct utmp ut; ut.ut_addr = 0;],
1080 samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
1081 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
1082 AC_DEFINE(HAVE_UT_UT_ADDR)
1085 if test x$ac_cv_func_pututline = xyes ; then
1086 AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
1087 AC_TRY_COMPILE([#include <sys/types.h>
1089 [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
1090 samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
1091 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
1092 AC_DEFINE(PUTUTLINE_RETURNS_UTMP)
1096 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
1097 AC_TRY_COMPILE([#include <sys/types.h>
1098 #include <utmpx.h>],
1099 [struct utmpx ux; ux.ut_syslen = 0;],
1100 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
1101 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
1102 AC_DEFINE(HAVE_UX_UT_SYSLEN)
1105 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1107 #include <sys/types.h>
1110 #define F_GETLEASE 1025
1113 int fd = open("/dev/null", O_RDONLY);
1114 return fcntl(fd, F_GETLEASE, 0) == -1;
1117 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1118 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1119 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
1122 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1124 #include <sys/types.h>
1128 #define F_NOTIFY 1026
1131 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1134 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1135 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1136 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
1139 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1141 #include <sys/types.h>
1144 #include <sys/file.h>
1146 #define LOCK_MAND 32
1147 #define LOCK_READ 64
1150 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1153 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1154 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1155 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
1161 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1162 AC_TRY_COMPILE([#include <sys/types.h>
1163 #include <fcntl.h>],
1164 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1165 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1166 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1167 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
1170 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1171 AC_TRY_RUN([#include <sys/types.h>
1172 #include <sys/capability.h>
1175 if ((cap = cap_get_proc()) == NULL)
1177 cap->cap_effective |= CAP_NETWORK_MGT;
1178 cap->cap_inheritable |= CAP_NETWORK_MGT;
1183 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1184 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1185 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
1189 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
1190 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
1193 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
1194 AC_TRY_COMPILE([#include <sys/types.h>
1195 #if defined(HAVE_RPC_RPC_H)
1196 #include <rpc/rpc.h>
1199 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
1200 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
1201 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
1204 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
1205 AC_TRY_COMPILE([#include <sys/types.h>
1206 #if defined(HAVE_RPC_RPC_H)
1207 #include <rpc/rpc.h>
1210 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
1211 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
1212 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
1215 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
1216 AC_TRY_COMPILE([#include <sys/types.h>
1217 #if defined(HAVE_RPC_RPC_H)
1218 #include <rpc/rpc.h>
1221 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
1222 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
1223 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
1226 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
1227 AC_TRY_COMPILE([#include <sys/types.h>
1228 #if defined(HAVE_RPC_RPC_H)
1229 #include <rpc/rpc.h>
1232 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
1233 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
1234 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
1238 dnl Some systems (SCO) have a problem including
1239 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
1240 dnl as a #define in <prot.h> and as part of an enum
1244 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
1245 AC_TRY_COMPILE([#include <sys/types.h>
1246 #ifdef HAVE_SYS_SECURITY_H
1247 #include <sys/security.h>
1249 #endif /* HAVE_SYS_SECURITY_H */
1250 #if defined(HAVE_RPC_RPC_H)
1251 #include <rpc/rpc.h>
1254 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
1255 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
1256 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
1259 AC_MSG_CHECKING([for test routines])
1260 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
1262 AC_MSG_ERROR([cant find test code. Aborting config]),
1263 AC_MSG_WARN([cannot run when cross-compiling]))
1265 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1266 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
1267 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1268 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1269 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
1272 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1273 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
1274 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1275 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1276 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
1279 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1280 SAVE_CPPFLAGS="$CPPFLAGS"
1281 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
1283 #define REPLACE_GETPASS 1
1284 #define NO_CONFIG_H 1
1285 #define main dont_declare_main
1286 #include "${srcdir-.}/lib/getsmbpass.c"
1288 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1289 CPPFLAGS="$SAVE_CPPFLAGS"
1291 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1292 AC_DEFINE(REPLACE_GETPASS)
1295 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1298 #include <sys/types.h>
1299 #include <netinet/in.h>
1300 #ifdef HAVE_ARPA_INET_H
1301 #include <arpa/inet.h>
1303 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1304 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1305 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1307 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1308 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1309 AC_DEFINE(REPLACE_INET_NTOA)
1312 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1313 AC_TRY_RUN([#include <stdlib.h>
1314 #include <sys/types.h>
1315 #include <sys/stat.h>
1319 char tpl[20]="/tmp/test.XXXXXX";
1320 int fd = mkstemp(tpl);
1321 if (fd == -1) exit(1);
1323 if (fstat(fd, &st) != 0) exit(1);
1324 if ((st.st_mode & 0777) != 0600) exit(1);
1327 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1328 samba_cv_HAVE_SECURE_MKSTEMP=no,
1329 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1330 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1331 AC_DEFINE(HAVE_SECURE_MKSTEMP)
1334 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1335 AC_TRY_RUN([#include <unistd.h>
1336 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1337 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1338 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1339 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
1342 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1343 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1344 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1345 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1346 AC_DEFINE(HAVE_ROOT)
1348 AC_MSG_WARN(running as non-root will disable some tests)
1352 # look for a method of finding the list of network interfaces
1354 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1356 #define HAVE_IFACE_AIX 1
1357 #define AUTOCONF_TEST 1
1358 #include "confdefs.h"
1359 #include "${srcdir-.}/lib/interfaces.c"],
1360 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1361 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1362 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
1365 if test $iface = no; then
1366 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1368 #define HAVE_IFACE_IFCONF 1
1369 #define AUTOCONF_TEST 1
1370 #include "confdefs.h"
1371 #include "${srcdir-.}/lib/interfaces.c"],
1372 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1373 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1374 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
1378 if test $iface = no; then
1379 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1381 #define HAVE_IFACE_IFREQ 1
1382 #define AUTOCONF_TEST 1
1383 #include "confdefs.h"
1384 #include "${srcdir-.}/lib/interfaces.c"],
1385 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1386 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1387 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
1392 ################################################
1393 # look for a method of setting the effective uid
1395 if test $seteuid = no; then
1396 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1398 #define AUTOCONF_TEST 1
1399 #define USE_SETRESUID 1
1400 #include "confdefs.h"
1401 #include "${srcdir-.}/lib/util_sec.c"],
1402 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1403 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1404 seteuid=yes;AC_DEFINE(USE_SETRESUID)
1409 if test $seteuid = no; then
1410 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1412 #define AUTOCONF_TEST 1
1413 #define USE_SETREUID 1
1414 #include "confdefs.h"
1415 #include "${srcdir-.}/lib/util_sec.c"],
1416 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1417 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1418 seteuid=yes;AC_DEFINE(USE_SETREUID)
1422 if test $seteuid = no; then
1423 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1425 #define AUTOCONF_TEST 1
1426 #define USE_SETEUID 1
1427 #include "confdefs.h"
1428 #include "${srcdir-.}/lib/util_sec.c"],
1429 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1430 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1431 seteuid=yes;AC_DEFINE(USE_SETEUID)
1435 if test $seteuid = no; then
1436 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1438 #define AUTOCONF_TEST 1
1439 #define USE_SETUIDX 1
1440 #include "confdefs.h"
1441 #include "${srcdir-.}/lib/util_sec.c"],
1442 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1443 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1444 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1449 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1450 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1451 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1452 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1453 AC_DEFINE(HAVE_MMAP)
1456 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1457 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1458 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1459 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1460 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1463 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1464 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1465 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1466 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1467 AC_DEFINE(HAVE_FCNTL_LOCK)
1470 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1471 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1472 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1473 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1474 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1479 dnl Don't check for 64 bit fcntl locking if we know that the
1480 dnl glibc2.1 broken check has succeeded.
1483 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1485 #if defined(HAVE_UNISTD_H)
1495 #ifdef HAVE_SYS_FCNTL_H
1496 #include <sys/fcntl.h>
1498 main() { struct flock64 fl64;
1499 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1505 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1507 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1508 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1512 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1513 AC_TRY_COMPILE([#include <sys/acl.h>
1514 #if defined(HAVE_RPCSVC_NIS_H)
1515 #include <rpcsvc/nis.h>
1518 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1519 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1520 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1524 #################################################
1525 # check for smbwrapper support
1526 AC_MSG_CHECKING(whether to use smbwrapper)
1527 AC_ARG_WITH(smbwrapper,
1528 [ --with-smbwrapper Include SMB wrapper support (default=no)],
1529 [ case "$withval" in
1532 AC_DEFINE(WITH_SMBWRAPPER)
1533 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1535 if test x$ATTEMPT_WRAP32_BUILD = x; then
1538 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1541 # Conditions under which smbwrapper should not be built.
1543 if test x$PICFLAG = x; then
1544 echo No support for PIC code - disabling smbwrapper and smbsh
1547 elif test x$ac_cv_func_syscall = xno; then
1548 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1560 #################################################
1561 # check for the AFS filesystem
1562 AC_MSG_CHECKING(whether to use AFS)
1564 [ --with-afs Include AFS support (default=no)],
1565 [ case "$withval" in
1578 #################################################
1579 # check for the DFS auth system
1580 AC_MSG_CHECKING(whether to use DCE/DFS auth)
1582 [ --with-dce-dfs Include DCE/DFS support (default=no)],
1583 [ case "$withval" in
1595 #################################################
1596 # check for Kerberos IV auth system
1597 AC_MSG_CHECKING(whether to use Kerberos IV)
1599 [ --with-krb4=base-dir Include Kerberos IV support (default=no)],
1600 [ case "$withval" in
1603 AC_DEFINE(KRB4_AUTH)
1604 AC_CHECK_LIB(resolv, dn_expand)
1605 LIBS="$LIBS -lkrb -ldes"
1606 CFLAGS="$CFLAGS -I$withval/include"
1607 LDFLAGS="$LDFLAGS -L$withval/lib"
1616 #################################################
1617 # check for Kerberos 5 auth system
1618 AC_MSG_CHECKING(whether to use Kerberos 5)
1620 [ --with-krb5=base-dir Include Kerberos 5 support (default=no)],
1621 [ case "$withval" in
1624 AC_DEFINE(KRB5_AUTH)
1625 LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
1626 CFLAGS="$CFLAGS -I$withval/include"
1627 LDFLAGS="$LDFLAGS -L$withval/lib"
1636 #################################################
1637 # check for automount support
1638 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1639 AC_ARG_WITH(automount,
1640 [ --with-automount Include AUTOMOUNT support (default=no)],
1641 [ case "$withval" in
1644 AC_DEFINE(WITH_AUTOMOUNT)
1653 #################################################
1654 # check for smbmount support
1655 AC_MSG_CHECKING(whether to use SMBMOUNT)
1656 AC_ARG_WITH(smbmount,
1657 [ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
1658 [ case "$withval" in
1663 AC_DEFINE(WITH_SMBMOUNT)
1664 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1667 AC_MSG_ERROR(not on a linux system!)
1681 #################################################
1682 # check for a PAM password database
1683 with_pam_for_crypt=no
1684 AC_MSG_CHECKING(whether to use PAM password database)
1686 [ --with-pam Include PAM password database support (default=no)],
1687 [ case "$withval" in
1692 with_pam_for_crypt=yes
1701 # we can't build a pam module if we don't have pam.
1702 AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
1704 #################################################
1705 # check for pam_smbpass support
1706 AC_MSG_CHECKING(whether to use pam_smbpass)
1707 AC_ARG_WITH(pam_smbpass,
1708 [ --with-pam_smbpass Include the smbpass PAM module (default=no)],
1709 [ case "$withval" in
1713 # Conditions under which pam_smbpass should not be built.
1715 if test x$PICFLAG = x; then
1716 AC_MSG_RESULT([No support for PIC code - disabling pam_smbpass])
1718 elif test x$ac_cv_lib_pam_pam_get_data = xno; then
1719 AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
1722 AC_DEFINE(WITH_PAM_SMBPASS)
1723 PAM_MOD="bin/pam_smbpass.so"
1734 ###############################################
1735 # test for where we get crypt() from, but only
1737 if test $with_pam_for_crypt = no; then
1738 AC_CHECK_FUNCS(crypt)
1739 if test x"$ac_cv_func_crypt" = x"no"; then
1740 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
1741 AC_DEFINE(HAVE_CRYPT)])
1746 ## moved after the check for -lcrypt in order to
1747 ## ensure that the necessary libraries are included
1748 ## check checking for truncated salt. Wrapped by the
1749 ## $with_pam_for_crypt variable as above --jerry
1751 if test $with_pam_for_crypt = no; then
1752 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1753 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1754 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1755 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1756 AC_DEFINE(HAVE_TRUNCATED_SALT)
1761 ########################################################################################
1763 ## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
1765 ########################################################################################
1767 ## set the with_smbpasswd_sam as the default
1768 with_smbpasswd_sam=yes
1772 #################################################
1773 # check for a TDB password database
1774 AC_MSG_CHECKING(whether to use TDB SAM database)
1776 [ --with-tdbsam Include experimental TDB SAM support (default=no)],
1777 [ case "$withval" in
1780 AC_DEFINE(WITH_TDB_SAM)
1781 with_smbpasswd_sam=no
1790 #################################################
1791 # check for a LDAP password database
1792 AC_MSG_CHECKING(whether to use LDAP SAM database)
1793 AC_ARG_WITH(ldapsam,
1794 [ --with-ldapsam Include experimental LDAP SAM support (default=no)],
1795 [ case "$withval" in
1798 AC_DEFINE(WITH_LDAP_SAM)
1799 LIBS="-lldap -llber -lresolv $LIBS"
1800 with_smbpasswd_sam=no
1809 #################################################
1810 # check for a NISPLUS password database
1811 AC_MSG_CHECKING(whether to use NISPLUS SAM database)
1812 AC_ARG_WITH(nisplussam,
1813 [ --with-nisplussam Include NISPLUS SAM support (default=no)],
1814 [ case "$withval" in
1817 AC_DEFINE(WITH_NISPLUS_SAM)
1818 with_smbpasswd_sam=no
1827 ################################################
1828 # This test should come last because the
1829 # smbpasswd SAM is only used if another format
1830 # has not been defined
1831 AC_MSG_CHECKING(whether to use traditional smbpasswd file)
1832 if test $with_smbpasswd_sam = yes; then
1834 AC_DEFINE(WITH_SMBPASSWD_SAM)
1841 ########################################################################################
1843 ## END OF TESTS FOR SAM BACKENDS.
1845 ########################################################################################
1847 #################################################
1848 # check for a NISPLUS_HOME support
1849 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1850 AC_ARG_WITH(nisplus-home,
1851 [ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
1852 [ case "$withval" in
1855 AC_DEFINE(WITH_NISPLUS_HOME)
1864 #################################################
1865 # check for the secure socket layer
1866 AC_MSG_CHECKING(whether to use SSL)
1868 [ --with-ssl Include SSL support (default=no)
1869 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
1870 --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
1871 [ case "$withval" in
1875 withval="/usr/local/ssl" # default
1877 if test "${with_sslinc+set}" = set; then
1879 withval="$with_sslinc"
1882 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
1883 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1886 CFLAGS="-I${withval} $CFLAGS"
1892 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1896 if test "${with_ssllib+set}" = set; then
1898 withval="$with_ssllib"
1901 echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
1902 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
1905 LDFLAGS="-L${withval}/lib $LDFLAGS"
1911 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
1915 LIBS="-lssl -lcrypto $LIBS"
1917 # if test ! -d ${withval}; then
1918 # echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
1922 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
1932 #################################################
1933 # check for syslog logging
1934 AC_MSG_CHECKING(whether to use syslog logging)
1936 [ --with-syslog Include experimental SYSLOG support (default=no)],
1937 [ case "$withval" in
1940 AC_DEFINE(WITH_SYSLOG)
1949 #################################################
1950 # check for a shared memory profiling support
1951 AC_MSG_CHECKING(whether to use profiling)
1952 AC_ARG_WITH(profiling-data,
1953 [ --with-profiling-data Include gathering source code profile information (default=no)],
1954 [ case "$withval" in
1957 AC_DEFINE(WITH_PROFILE)
1967 #################################################
1968 # check for experimental disk-quotas support
1969 QUOTAOBJS=smbd/noquotas.o
1971 AC_MSG_CHECKING(whether to support disk-quotas)
1973 [ --with-quotas Include experimental disk-quota support (default=no)],
1974 [ case "$withval" in
1977 QUOTAOBJS=smbd/quotas.o
1980 # Check for kernel 2.4.x quota braindamage...
1981 AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
1982 AC_TRY_COMPILE([#include <stdio.h>
1983 #include <sys/types.h>
1984 #include <asm/types.h>
1985 #include <linux/quota.h>
1987 #include <linux/unistd.h>],[struct mem_dqblk D;],
1988 samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
1989 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
1990 AC_DEFINE(LINUX_QUOTAS_2)
1992 AC_DEFINE(LINUX_QUOTAS_1)
2007 #################################################
2008 # check for experimental utmp accounting
2010 AC_MSG_CHECKING(whether to support utmp accounting)
2012 [ --with-utmp Include experimental utmp accounting (default=no)],
2013 [ case "$withval" in
2016 AC_DEFINE(WITH_UTMP)
2025 #################################################
2026 # check for MS Dfs support
2028 AC_MSG_CHECKING(whether to support Microsoft Dfs)
2030 [ --with-msdfs Include MS Dfs support (default=no)],
2031 [ case "$withval" in
2034 AC_DEFINE(WITH_MSDFS)
2043 #################################################
2044 # check for Samba VFS support
2046 AC_MSG_CHECKING(whether to support the experimantal Samba vfs)
2048 [ --with-vfs Include Samba vfs support (default=no)],
2049 [ case "$withval" in
2062 #################################################
2063 # should we build libsmbclient?
2065 LIBSMBCLIENT_SHARED=
2067 AC_MSG_CHECKING(whether to build the libsmbclient shared library)
2068 AC_ARG_WITH(libsmbclient,
2069 [ --with-libsmbclient Build the libsmbclient shared library (default=no)],
2070 [ case "$withval" in
2072 if test $BLDSHARED = true; then
2073 LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
2074 LIBSMBCLIENT=libsmbclient
2077 AC_MSG_RESULT(no shared library support)
2087 #################################################
2088 # these tests are taken from the GNU fileutils package
2089 AC_CHECKING(how to get filesystem space usage)
2092 # Test for statvfs64.
2093 if test $space = no; then
2095 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
2097 #if defined(HAVE_UNISTD_H)
2100 #include <sys/types.h>
2101 #include <sys/statvfs.h>
2104 struct statvfs64 fsd;
2105 exit (statvfs64 (".", &fsd));
2107 fu_cv_sys_stat_statvfs64=yes,
2108 fu_cv_sys_stat_statvfs64=no,
2109 fu_cv_sys_stat_statvfs64=cross)])
2110 if test $fu_cv_sys_stat_statvfs64 = yes; then
2112 AC_DEFINE(STAT_STATVFS64)
2116 # Perform only the link test since it seems there are no variants of the
2117 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2118 # because that got a false positive on SCO OSR5. Adding the declaration
2119 # of a `struct statvfs' causes this test to fail (as it should) on such
2120 # systems. That system is reported to work fine with STAT_STATFS4 which
2121 # is what it gets when this test fails.
2122 if test $space = no; then
2124 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2125 [AC_TRY_LINK([#include <sys/types.h>
2126 #include <sys/statvfs.h>],
2127 [struct statvfs fsd; statvfs (0, &fsd);],
2128 fu_cv_sys_stat_statvfs=yes,
2129 fu_cv_sys_stat_statvfs=no)])
2130 if test $fu_cv_sys_stat_statvfs = yes; then
2132 AC_DEFINE(STAT_STATVFS)
2136 if test $space = no; then
2137 # DEC Alpha running OSF/1
2138 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2139 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2141 #include <sys/param.h>
2142 #include <sys/types.h>
2143 #include <sys/mount.h>
2148 exit (statfs (".", &fsd, sizeof (struct statfs)));
2150 fu_cv_sys_stat_statfs3_osf1=yes,
2151 fu_cv_sys_stat_statfs3_osf1=no,
2152 fu_cv_sys_stat_statfs3_osf1=no)])
2153 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2154 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2156 AC_DEFINE(STAT_STATFS3_OSF1)
2160 if test $space = no; then
2162 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2163 member (AIX, 4.3BSD)])
2164 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2166 #ifdef HAVE_SYS_PARAM_H
2167 #include <sys/param.h>
2169 #ifdef HAVE_SYS_MOUNT_H
2170 #include <sys/mount.h>
2172 #ifdef HAVE_SYS_VFS_H
2173 #include <sys/vfs.h>
2179 exit (statfs (".", &fsd));
2181 fu_cv_sys_stat_statfs2_bsize=yes,
2182 fu_cv_sys_stat_statfs2_bsize=no,
2183 fu_cv_sys_stat_statfs2_bsize=no)])
2184 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2185 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2187 AC_DEFINE(STAT_STATFS2_BSIZE)
2191 if test $space = no; then
2193 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2194 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2195 [AC_TRY_RUN([#include <sys/types.h>
2196 #include <sys/statfs.h>
2200 exit (statfs (".", &fsd, sizeof fsd, 0));
2202 fu_cv_sys_stat_statfs4=yes,
2203 fu_cv_sys_stat_statfs4=no,
2204 fu_cv_sys_stat_statfs4=no)])
2205 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2206 if test $fu_cv_sys_stat_statfs4 = yes; then
2208 AC_DEFINE(STAT_STATFS4)
2212 if test $space = no; then
2214 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2215 member (4.4BSD and NetBSD)])
2216 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2217 [AC_TRY_RUN([#include <sys/types.h>
2218 #ifdef HAVE_SYS_PARAM_H
2219 #include <sys/param.h>
2221 #ifdef HAVE_SYS_MOUNT_H
2222 #include <sys/mount.h>
2228 exit (statfs (".", &fsd));
2230 fu_cv_sys_stat_statfs2_fsize=yes,
2231 fu_cv_sys_stat_statfs2_fsize=no,
2232 fu_cv_sys_stat_statfs2_fsize=no)])
2233 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2234 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2236 AC_DEFINE(STAT_STATFS2_FSIZE)
2240 if test $space = no; then
2242 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2243 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2244 [AC_TRY_RUN([#include <sys/types.h>
2245 #ifdef HAVE_SYS_PARAM_H
2246 #include <sys/param.h>
2248 #ifdef HAVE_SYS_MOUNT_H
2249 #include <sys/mount.h>
2251 #ifdef HAVE_SYS_FS_TYPES_H
2252 #include <sys/fs_types.h>
2257 /* Ultrix's statfs returns 1 for success,
2258 0 for not mounted, -1 for failure. */
2259 exit (statfs (".", &fsd) != 1);
2261 fu_cv_sys_stat_fs_data=yes,
2262 fu_cv_sys_stat_fs_data=no,
2263 fu_cv_sys_stat_fs_data=no)])
2264 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2265 if test $fu_cv_sys_stat_fs_data = yes; then
2267 AC_DEFINE(STAT_STATFS2_FS_DATA)
2272 # As a gating factor for large file support, in order to
2273 # use <4GB files we must have the following minimal support
2275 # long long, and a 64 bit off_t or off64_t.
2276 # If we don't have all of these then disable large
2279 AC_MSG_CHECKING(checking if large file support can be enabled)
2281 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
2282 #include <sys/types.h>
2288 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
2289 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
2291 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
2296 AC_ARG_WITH(spinlocks,
2297 [ --with-spinlocks Use spin locks instead of fcntl locks (default=no)])
2298 if test "x$with_spinlocks" = "xyes"; then
2299 AC_DEFINE(USE_SPINLOCKS)
2303 AC_DEFINE(SPARC_SPINLOCKS)
2306 i386|i486|i586|i686)
2307 AC_DEFINE(INTEL_SPINLOCKS)
2311 AC_DEFINE(MIPS_SPINLOCKS)
2315 AC_DEFINE(POWERPC_SPINLOCKS)
2320 #################################################
2321 # check for ACL support
2323 AC_MSG_CHECKING(whether to support ACLs)
2324 AC_ARG_WITH(acl-support,
2325 [ --with-acl-support Include ACL support (default=no)],
2326 [ case "$withval" in
2331 AC_MSG_RESULT(Using UnixWare ACLs)
2332 AC_DEFINE(HAVE_UNIXWARE_ACLS)
2335 AC_MSG_RESULT(Using solaris ACLs)
2336 AC_DEFINE(HAVE_SOLARIS_ACLS)
2339 AC_MSG_RESULT(Using IRIX ACLs)
2340 AC_DEFINE(HAVE_IRIX_ACLS)
2343 AC_MSG_RESULT(Using AIX ACLs)
2344 AC_DEFINE(HAVE_AIX_ACLS)
2347 AC_MSG_RESULT(Using Tru64 ACLs)
2348 AC_DEFINE(HAVE_TRU64_ACLS)
2352 AC_CHECK_LIB(acl,acl_get_file)
2353 AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
2354 AC_TRY_LINK([#include <sys/types.h>
2355 #include <sys/acl.h>],
2356 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
2357 samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
2358 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
2359 AC_MSG_RESULT(Using posix ACLs)
2360 AC_DEFINE(HAVE_POSIX_ACLS)
2361 AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
2362 AC_TRY_LINK([#include <sys/types.h>
2363 #include <sys/acl.h>],
2364 [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
2365 samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
2366 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
2367 AC_DEFINE(HAVE_ACL_GET_PERM_NP)
2375 AC_DEFINE(HAVE_NO_ACLS)
2378 AC_DEFINE(HAVE_NO_ACLS)
2382 #################################################
2383 # check for the historical SAMBA installation
2385 if test "x$prefix" = xNONE -a "$sbindir" = "\${exec_prefix}/sbin"; then
2386 # Put all binaries under the /usr/local/samba/bin directory.
2390 #################################################
2391 # Check whether winbind is supported on this platform. If so we need to
2392 # build and install client programs (WINBIND_TARGETS), sbin programs
2393 # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
2395 AC_MSG_CHECKING(whether to build winbind)
2397 # Initially, the value of $host_os decides whether winbind is supported
2405 winbind_no_reason=", unsupported on $host_os"
2409 # Check the setting of --with-winbindd
2411 AC_ARG_WITH(winbind,
2412 [ --with-winbind Build winbind (default, if supported by OS)],
2425 # We need unix domain sockets for winbind
2427 if test x"$HAVE_WINBIND" = x"yes"; then
2428 if test x"$samba_cv_unixsocket" = x"no"; then
2429 winbind_no_reason=", no unix domain socket support on $host_os"
2434 # Display test results
2436 if test x"$HAVE_WINBIND" = x"yes"; then
2440 WINBIND_TARGETS="bin/wbinfo"
2441 WINBIND_STARGETS="bin/winbindd"
2442 WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
2446 WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
2450 AC_MSG_RESULT(no$winbind_no_reason)
2455 WINBIND_PAM_TARGETS=""
2458 # Substitution time!
2460 AC_SUBST(WINBIND_TARGETS)
2461 AC_SUBST(WINBIND_STARGETS)
2462 AC_SUBST(WINBIND_LTARGETS)
2463 AC_SUBST(WINBIND_PAM_TARGETS)
2465 #################################################
2466 # final configure stuff
2467 echo "checking configure summary"
2468 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
2469 echo "configure OK";,
2470 AC_MSG_ERROR([summary failure. Aborting config]),:)
2475 AC_OUTPUT(include/stamp-h Makefile)