1 dnl Checks for programs.
3 AC_PATH_PROG(PERL, perl)
4 if test x"$PERL" = x""; then
5 AC_MSG_WARN([No version of perl was not found!])
6 AC_MSG_ERROR([Please Install perl from http://www.perl.com/])
8 if test x"$debug" = x"yes";then
15 # compile with optimization and without debugging by default, but
16 # allow people to set their own preference.
17 if test "x$CFLAGS" = x
22 dnl Check if we use GNU ld
26 dnl needed before AC_TRY_COMPILE
29 dnl look for executable suffix
32 dnl Check if C compiler understands -c and -o at the same time
34 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
41 AC_CACHE_CHECK([that the C compiler can precompile header files],samba_cv_precompiled_headers, [
42 dnl Check whether the compiler can generate precompiled headers
44 if ${CC-cc} conftest.h 2> /dev/null && test -f conftest.h.gch; then
45 samba_cv_precompiled_headers=yes
47 samba_cv_precompiled_headers=no
50 if test x"$samba_cv_precompiled_headers" = x"yes"; then
53 AC_SUBST(PCH_AVAILABLE)
56 dnl Check if the C compiler understands volatile (it should, being ANSI).
57 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
58 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
59 samba_cv_volatile=yes,samba_cv_volatile=no)])
60 if test x"$samba_cv_volatile" = x"yes"; then
61 AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
67 dnl Add #include for broken IRIX header files
69 *irix6*) AC_ADD_INCLUDE(<standards.h>)
73 AC_VALIDATE_CACHE_SYSTEM_TYPE
78 AC_CHECK_HEADERS(stdbool.h)
80 AC_CHECK_SIZEOF(short,cross)
81 AC_CHECK_SIZEOF(int,cross)
82 AC_CHECK_SIZEOF(long,cross)
83 AC_CHECK_SIZEOF(long long,cross)
84 if test x"$ac_cv_type_long_long" != x"yes";then
85 AC_MSG_ERROR([Sorry we need type 'long long'])
87 if test $ac_cv_sizeof_long_long -lt 8;then
88 AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
93 # Config CPPFLAG settings for strange OS's that must be set
97 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
101 # mmap on HPUX is completely broken...
102 AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
103 if test $ac_cv_prog_cc_Ae = yes; then
104 CPPFLAGS="$CPPFLAGS -Ae"
107 # Defines needed for HPUX support.
108 # HPUX has bigcrypt but (sometimes?) doesn't use it for
109 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
113 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
114 AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
115 AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
116 AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
117 AC_DEFINE(_ALIGNMENT_REQUIRED,1,[Required alignment])
118 AC_DEFINE(_MAX_ALIGNMENT,4,[Maximum alignment])
121 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
122 AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
123 AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
124 AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
125 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to use large file support])
126 AC_DEFINE(_ALIGNMENT_REQUIRED, 1, [Required alignment])
127 AC_DEFINE(_MAX_ALIGNMENT, 4, [Maximum alignment])
134 # CRAY Unicos has broken const handling
136 AC_MSG_RESULT([disabling const])
137 CPPFLAGS="$CPPFLAGS -Dconst="
141 # AIX4.x doesn't even admit to having large
142 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
145 AC_MSG_RESULT([enabling large file support])
146 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
147 AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support])
150 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
151 # to the existance of large files..
152 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
153 # recommendations on large file support, however it makes the
154 # compile work using gcc 2.7 and 2.8, whereas using the Sun
155 # recommendation makes the compile fail on gcc2.7. JRA.
159 5.0*|5.1*|5.2*|5.3*|5.5*)
160 AC_MSG_RESULT([no large file support])
163 AC_MSG_RESULT([enabling large file support])
164 if test "$ac_cv_prog_gcc" = yes; then
165 ${CC-cc} -v >conftest.c 2>&1
166 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
168 case "$ac_cv_gcc_compiler_version_number" in
169 *"gcc version 2.6"*|*"gcc version 2.7"*)
170 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
171 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
174 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
175 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
176 AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
180 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
181 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
182 AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
188 # VOS may need to have POSIX support and System V compatibility enabled.
195 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=199506L"
196 AC_DEFINE(_POSIX_C_SOURCE, 199506L, [Whether to enable POSIX support])
200 *-D_SYSV*|*-D_SVID_SOURCE*)
203 CPPFLAGS="$CPPFLAGS -D_SYSV"
204 AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
208 # Tests needed for SINIX large file support.
211 if test $host = mips-sni-sysv4 ; then
212 AC_MSG_CHECKING([for LFS support])
213 old_CPPFLAGS="$CPPFLAGS"
214 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
218 #if _LFS64_LARGEFILE == 1
223 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
224 CPPFLAGS="$old_CPPFLAGS"
225 if test x$SINIX_LFS_SUPPORT = xyes ; then
226 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
227 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
228 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
229 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
230 LIBS="`getconf LFS64_LIBS` $LIBS"
232 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
236 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
239 AC_MSG_CHECKING([for LFS support])
240 old_CPPFLAGS="$CPPFLAGS"
241 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
244 #include <sys/utsname.h>
248 #if _LFS64_LARGEFILE == 1
253 /* Ensure this is glibc 2.2 or higher */
254 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
255 int libc_major = __GLIBC__;
256 int libc_minor = __GLIBC_MINOR__;
264 /* Ensure this is kernel 2.4 or higher */
267 release = uts.release;
268 major = atoi(strsep(&release, "."));
269 minor = atoi(strsep(&release, "."));
271 if (major > 2 || (major == 2 && minor > 3))
278 ], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
279 CPPFLAGS="$old_CPPFLAGS"
280 if test x$LINUX_LFS_SUPPORT = xyes ; then
281 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
282 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
283 AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
284 AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
286 AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
290 AC_MSG_CHECKING([for LFS support])
291 old_CPPFLAGS="$CPPFLAGS"
292 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
296 #if _LFS64_LARGEFILE == 1
301 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
302 CPPFLAGS="$old_CPPFLAGS"
303 if test x$GLIBC_LFS_SUPPORT = xyes ; then
304 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
305 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
306 AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
308 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
317 AC_CHECK_HEADERS(arpa/inet.h sys/select.h fcntl.h sys/fcntl.h sys/time.h)
318 AC_CHECK_HEADERS(utime.h grp.h sys/id.h limits.h memory.h net/if.h)
319 AC_CHECK_HEADERS(compat.h)
320 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
321 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
322 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
323 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
324 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h)
325 AC_CHECK_HEADERS(sys/syslog.h syslog.h)
328 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
329 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
333 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
334 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
335 if test x"$ac_cv_header_shadow_h" = x"yes"; then
336 AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h])
341 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
342 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
343 AC_CHECK_HEADERS(stropts.h)
344 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
345 AC_CHECK_HEADERS(sys/acl.h)
361 AC_CHECK_TYPE(ino_t,unsigned)
362 AC_CHECK_TYPE(loff_t,off_t)
363 AC_CHECK_TYPE(offset_t,loff_t)
364 AC_CHECK_TYPE(ssize_t, int)
365 AC_CHECK_TYPE(wchar_t, unsigned short)
366 AC_CHECK_TYPE(uint_t, unsigned int)
368 ############################################
369 # we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
370 AC_SEARCH_LIBS(dlopen, [dl])
371 # dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
373 ############################################
374 # check if the compiler can do immediate structures
375 AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
379 typedef struct {unsigned x;} FOOBAR;
380 #define X_FOOBAR(x) ((FOOBAR) { x })
381 #define FOO_ONE X_FOOBAR(1)
389 samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
390 if test x"$samba_cv_immediate_structures" = x"yes"; then
391 AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
394 ############################################
395 # check for unix domain sockets
396 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
398 #include <sys/types.h>
401 #include <sys/socket.h>
402 #include <sys/un.h>],
404 struct sockaddr_un sunaddr;
405 sunaddr.sun_family = AF_UNIX;
407 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
408 if test x"$samba_cv_unixsocket" = x"yes"; then
409 AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
413 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
415 #include <sys/types.h>
420 #include <sys/socket.h>],[socklen_t i = 0],
421 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
422 if test x"$samba_cv_socklen_t" = x"yes"; then
423 AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t])
426 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
428 #include <sys/types.h>
433 #include <signal.h>],[sig_atomic_t i = 0],
434 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
435 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
436 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
439 # stupid headers have the functions but no declaration. grrrr.
440 AC_HAVE_DECL(errno, [#include <errno.h>])
441 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
442 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
443 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
444 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
445 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
446 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
448 # and glibc has setresuid under linux but the function does
449 # nothing until kernel 2.1.44! very dumb.
450 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
451 AC_TRY_RUN([#include <errno.h>
452 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
453 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
454 if test x"$samba_cv_have_setresuid" = x"yes"; then
455 AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid])
458 # Do the same check for setresguid...
460 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
461 AC_TRY_RUN([#include <unistd.h>
463 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
464 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
465 if test x"$samba_cv_have_setresgid" = x"yes"; then
466 AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid])
471 # The following test taken from the cvs sources
472 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
473 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
474 # libsocket.so which has a bad implementation of gethostbyname (it
475 # only looks in /etc/hosts), so we only look for -lsocket if we need
477 AC_CHECK_FUNCS(connect)
478 if test x"$ac_cv_func_connect" = x"no"; then
481 *) AC_CHECK_LIB(nsl_s, printf) ;;
485 *) AC_CHECK_LIB(nsl, printf) ;;
489 *) AC_CHECK_LIB(socket, connect) ;;
493 *) AC_CHECK_LIB(inet, connect) ;;
495 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
497 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
498 test x"$ac_cv_lib_inet_connect" = x"yes"; then
499 # ac_cv_func_connect=yes
500 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
501 AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
505 ###############################################
506 # test for where we get yp_get_default_domain() from
507 AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
508 AC_CHECK_FUNCS(yp_get_default_domain)
510 # Check if we have execl, if not we need to compile smbrun.
511 AC_CHECK_FUNCS(execl)
512 if test x"$ac_cv_func_execl" = x"no"; then
513 EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
516 AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
517 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
518 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
519 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
520 AC_CHECK_FUNCS(initgroups select rdchk getgrnam getgrent pathconf realpath)
521 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
522 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
523 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
524 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
525 AC_CHECK_FUNCS(syslog vsyslog getgrouplist timegm)
526 # setbuffer, shmget, shm_open are needed for smbtorture
527 AC_CHECK_FUNCS(setbuffer shmget shm_open)
529 # syscall() is needed for smbwrapper.
530 AC_CHECK_FUNCS(syscall)
532 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
533 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
534 AC_CHECK_FUNCS(__getcwd _getcwd)
535 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
536 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
537 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
538 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
539 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
540 AC_CHECK_FUNCS(getdirentries _write __write _fork __fork)
541 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
542 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
543 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
544 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
545 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
548 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
551 if test x$ac_cv_func_stat64 = xno ; then
552 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
554 #if defined(HAVE_UNISTD_H)
557 #include <sys/stat.h>
558 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
559 AC_MSG_RESULT([$ac_cv_func_stat64])
560 if test x$ac_cv_func_stat64 = xyes ; then
561 AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available])
565 if test x$ac_cv_func_lstat64 = xno ; then
566 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
568 #if defined(HAVE_UNISTD_H)
571 #include <sys/stat.h>
572 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
573 AC_MSG_RESULT([$ac_cv_func_lstat64])
574 if test x$ac_cv_func_lstat64 = xyes ; then
575 AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available])
579 if test x$ac_cv_func_fstat64 = xno ; then
580 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
582 #if defined(HAVE_UNISTD_H)
585 #include <sys/stat.h>
586 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
587 AC_MSG_RESULT([$ac_cv_func_fstat64])
588 if test x$ac_cv_func_fstat64 = xyes ; then
589 AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available])
593 #####################################
594 # we might need the resolv library on some systems
595 AC_CHECK_LIB(resolv, dn_expand)
598 # Check for the functions putprpwnam, set_auth_parameters,
599 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
600 # Needed for OSF1 and HPUX.
603 AC_LIBTESTFUNC(security, putprpwnam)
604 AC_LIBTESTFUNC(sec, putprpwnam)
606 AC_LIBTESTFUNC(security, set_auth_parameters)
607 AC_LIBTESTFUNC(sec, set_auth_parameters)
609 # UnixWare 7.x has its getspnam in -lgen
610 AC_LIBTESTFUNC(gen, getspnam)
612 AC_LIBTESTFUNC(security, getspnam)
613 AC_LIBTESTFUNC(sec, getspnam)
615 AC_LIBTESTFUNC(security, bigcrypt)
616 AC_LIBTESTFUNC(sec, bigcrypt)
618 AC_LIBTESTFUNC(security, getprpwnam)
619 AC_LIBTESTFUNC(sec, getprpwnam)
621 # Assume non-shared by default and override below
624 # these are the defaults, good for lots of systems
634 if test "$enable_shared" = "yes"; then
635 # this bit needs to be modified for each OS that is suported by
636 # smbwrapper. You need to specify how to created a shared library and
637 # how to compile C code to produce PIC object files
639 AC_MSG_CHECKING([ability to build shared libraries])
641 # and these are for particular systems
643 *linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux])
646 DYNEXP="-Wl,--export-dynamic"
648 SONAMEFLAG="-Wl,-soname="
649 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
651 *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
655 if test "${GCC}" = "yes"; then
657 if test "${ac_cv_prog_gnu_ld}" = "yes"; then
662 ## ${CFLAGS} added for building 64-bit shared
663 ## libs using Sun's Compiler
664 LDSHFLAGS="-G \${CFLAGS}"
668 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
670 *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
674 PICFLAG="-KPIC" # Is this correct for SunOS
675 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
677 *netbsd* | *freebsd*) BLDSHARED="true"
679 DYNEXP="-Wl,--export-dynamic"
680 SONAMEFLAG="-Wl,-soname,"
681 PICFLAG="-fPIC -DPIC"
682 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
684 *openbsd*) BLDSHARED="true"
686 DYNEXP="-Wl,-Bdynamic"
687 SONAMEFLAG="-Wl,-soname,"
689 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
691 *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
693 *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
696 ATTEMPT_WRAP32_BUILD=yes
698 LDSHFLAGS="-set_version sgi1.0 -shared"
699 SONAMEFLAG="-soname "
701 if test "${GCC}" = "yes"; then
706 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
708 *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
710 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
711 DYNEXP="-Wl,-brtl,-bexpall"
713 if test "${GCC}" != "yes"; then
714 ## for funky AIX compiler using strncpy()
715 CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
718 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block])
720 *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
722 # Use special PIC flags for the native HP-UX compiler.
723 if test $ac_cv_prog_cc_Ae = yes; then
726 LDSHFLAGS="-B symbolic -b -z"
731 AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
733 *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
734 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
736 *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
739 SONAMEFLAG="-Wl,-soname,"
741 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
743 *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
744 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
746 *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
749 SONAMEFLAG="-Wl,-soname,"
751 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
753 *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2])
754 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
756 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
757 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
759 *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
761 *-univel-*) if [ test "$GCC" != yes ]; then
762 AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
767 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
769 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
772 *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
773 if [ test "$GCC" != yes ]; then
774 AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
777 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
779 *vos*) AC_DEFINE(STAT_ST_BLOCKSIZE,4096)
784 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
788 AC_MSG_RESULT($BLDSHARED)
789 AC_MSG_CHECKING([linker flags for shared libraries])
790 AC_MSG_RESULT([$LDSHFLAGS])
791 AC_MSG_CHECKING([compiler flags for position-independent code])
792 AC_MSG_RESULT([$PICFLAGS])
795 #######################################################
796 # test whether building a shared library actually works
797 if test $BLDSHARED = true; then
798 AC_CACHE_CHECK([whether building shared libraries actually works],
799 [ac_cv_shlib_works],[
801 # try building a trivial shared library
802 if test "$PICSUFFIX" = "po"; then
803 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/build/tests/shlib.c &&
804 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
805 ac_cv_shlib_works=yes
807 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.$PICSUFFIX ${srcdir-.}/build/tests/shlib.c &&
808 mv shlib.$PICSUFFIX shlib.po &&
809 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
810 ac_cv_shlib_works=yes
812 rm -f shlib.so shlib.po
814 if test $ac_cv_shlib_works = no; then
821 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
822 AC_TRY_RUN([#include <stdio.h>
823 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
824 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
825 if test x"$samba_cv_have_longlong" = x"yes"; then
826 AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
830 # Check if the compiler supports the LL prefix on long long integers.
833 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
834 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
835 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
836 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
837 AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers])
841 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
842 AC_TRY_RUN([#include <stdio.h>
843 #include <sys/stat.h>
844 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
845 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
846 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
847 AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type])
850 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
852 #if defined(HAVE_UNISTD_H)
856 #include <sys/stat.h>
857 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
858 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
859 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
860 AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
863 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
864 AC_TRY_RUN([#include <stdio.h>
865 #include <sys/stat.h>
866 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
867 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
868 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
869 AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type])
872 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
874 #if defined(HAVE_UNISTD_H)
878 #include <sys/stat.h>
879 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
880 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
881 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
882 AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available])
885 AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
887 #if defined(HAVE_UNISTD_H)
891 #include <sys/stat.h>
892 main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
893 samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
894 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
895 AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available])
898 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
900 #if defined(HAVE_UNISTD_H)
903 #include <sys/types.h>
904 #include <dirent.h>],
905 [struct dirent64 de;],
906 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
907 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
908 AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available])
911 AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
913 #if defined(HAVE_UNISTD_H)
916 #include <sys/types.h>
917 main() { dev_t dev; int i = major(dev); return 0; }],
918 samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
919 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
920 AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available])
923 AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
925 #if defined(HAVE_UNISTD_H)
928 #include <sys/types.h>
929 main() { dev_t dev; int i = minor(dev); return 0; }],
930 samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
931 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
932 AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available])
935 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
936 AC_TRY_RUN([#include <stdio.h>
937 main() { char c; c=250; exit((c > 0)?0:1); }],
938 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
939 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
940 AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available])
943 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
944 AC_TRY_COMPILE([#include <sys/types.h>
945 #include <sys/socket.h>
946 #include <netinet/in.h>],
947 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
948 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
949 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
950 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
953 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
954 AC_TRY_COMPILE([#include <sys/types.h>
956 void seekdir(DIR *d, long loc) { return; }],[return 0;],
957 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
958 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
959 AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void])
962 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
963 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
964 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
965 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
966 AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
969 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
971 #include <sys/time.h>
973 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
974 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
975 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
976 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
979 AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[
980 AC_TRY_LINK([#include <stdarg.h>
981 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
982 samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)])
983 if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
984 AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available])
987 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
989 #include <sys/types.h>
991 void foo(const char *format, ...) {
996 va_start(ap, format);
997 len = vsnprintf(buf, 0, format, ap);
999 if (len != 5) exit(1);
1001 va_start(ap, format);
1002 len = vsnprintf(0, 0, format, ap);
1004 if (len != 5) exit(1);
1006 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1010 main() { foo("hello"); }
1012 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
1013 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1014 AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
1017 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1018 AC_TRY_RUN([#include <sys/types.h>
1020 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1021 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1022 di->d_name[0] == 0) exit(0); exit(1);} ],
1023 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
1024 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1025 AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken])
1028 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1029 AC_TRY_COMPILE([#include <sys/types.h>
1030 #include <utime.h>],
1031 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1032 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
1033 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
1034 AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available])
1037 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1039 #include <sys/types.h>
1042 #define F_GETLEASE 1025
1045 int fd = open("/dev/null", O_RDONLY);
1046 return fcntl(fd, F_GETLEASE, 0) == -1;
1049 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1050 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1051 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks])
1054 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1056 #include <sys/types.h>
1060 #define F_NOTIFY 1026
1063 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1066 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1067 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1068 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes])
1071 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1073 #include <sys/types.h>
1076 #include <sys/file.h>
1078 #define LOCK_MAND 32
1079 #define LOCK_READ 64
1082 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1085 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1086 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1087 AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes])
1093 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1094 AC_TRY_COMPILE([#include <sys/types.h>
1095 #include <fcntl.h>],
1096 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1097 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1098 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1099 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
1102 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1103 AC_TRY_RUN([#include <sys/types.h>
1104 #include <sys/capability.h>
1107 if ((cap = cap_get_proc()) == NULL)
1109 cap->cap_effective |= CAP_NETWORK_MGT;
1110 cap->cap_inheritable |= CAP_NETWORK_MGT;
1115 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1116 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1117 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
1120 AC_MSG_CHECKING([for test routines])
1121 AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"],
1123 AC_MSG_ERROR([cant find test code. Aborting config]),
1124 AC_MSG_WARN([cannot run when cross-compiling]))
1126 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1127 AC_TRY_RUN([#include "${srcdir-.}/build/tests/ftruncate.c"],
1128 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1129 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1130 AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
1133 AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
1134 AC_TRY_RUN([#include "${srcdir-.}/build/tests/unixsock.c"],
1135 samba_cv_HAVE_WORKING_AF_LOCAL=yes,
1136 samba_cv_HAVE_WORKING_AF_LOCAL=no,
1137 samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
1138 if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
1140 AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
1143 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1144 AC_TRY_RUN([#include "${srcdir-.}/build/tests/getgroups.c"],
1145 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1146 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1147 AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken])
1150 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1151 SAVE_CPPFLAGS="$CPPFLAGS"
1152 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/smbwrapper"
1154 #define REPLACE_GETPASS 1
1155 #define NO_CONFIG_H 1
1156 #define main dont_declare_main
1157 #include "${srcdir-.}/lib/getsmbpass.c"
1159 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1160 CPPFLAGS="$SAVE_CPPFLAGS"
1162 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1163 AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
1166 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1169 #include <sys/types.h>
1170 #include <netinet/in.h>
1171 #ifdef HAVE_ARPA_INET_H
1172 #include <arpa/inet.h>
1174 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1175 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1176 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1178 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1179 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1180 AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
1183 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1184 AC_TRY_RUN([#include <stdlib.h>
1185 #include <sys/types.h>
1186 #include <sys/stat.h>
1190 char tpl[20]="/tmp/test.XXXXXX";
1191 int fd = mkstemp(tpl);
1192 if (fd == -1) exit(1);
1194 if (fstat(fd, &st) != 0) exit(1);
1195 if ((st.st_mode & 0777) != 0600) exit(1);
1198 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1199 samba_cv_HAVE_SECURE_MKSTEMP=no,
1200 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1201 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1202 AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
1205 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1206 AC_TRY_RUN([#include <unistd.h>
1207 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1208 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1209 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1210 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available])
1213 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1214 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1215 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1216 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1217 AC_DEFINE(HAVE_ROOT,1,[Whether current user is root])
1219 AC_MSG_WARN(running as non-root will disable some tests)
1223 # look for a method of finding the list of network interfaces
1225 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1227 #define HAVE_IFACE_AIX 1
1228 #define AUTOCONF_TEST 1
1229 #include "confdefs.h"
1230 #include "${srcdir-.}/lib/interfaces.c"],
1231 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1232 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1233 iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
1236 if test $iface = no; then
1237 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1239 #define HAVE_IFACE_IFCONF 1
1240 #define AUTOCONF_TEST 1
1241 #include "confdefs.h"
1242 #include "${srcdir-.}/lib/interfaces.c"],
1243 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1244 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1245 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
1249 if test $iface = no; then
1250 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1252 #define HAVE_IFACE_IFREQ 1
1253 #define AUTOCONF_TEST 1
1254 #include "confdefs.h"
1255 #include "${srcdir-.}/lib/interfaces.c"],
1256 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1257 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1258 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
1263 ################################################
1264 # look for a method of setting the effective uid
1266 if test $seteuid = no; then
1267 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1269 #define AUTOCONF_TEST 1
1270 #define USE_SETRESUID 1
1271 #include "confdefs.h"
1272 #include "${srcdir-.}/lib/util_sec.c"],
1273 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1274 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1275 seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
1280 if test $seteuid = no; then
1281 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1283 #define AUTOCONF_TEST 1
1284 #define USE_SETREUID 1
1285 #include "confdefs.h"
1286 #include "${srcdir-.}/lib/util_sec.c"],
1287 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1288 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1289 seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
1293 if test $seteuid = no; then
1294 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1296 #define AUTOCONF_TEST 1
1297 #define USE_SETEUID 1
1298 #include "confdefs.h"
1299 #include "${srcdir-.}/lib/util_sec.c"],
1300 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1301 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1302 seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available])
1306 if test $seteuid = no; then
1307 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1309 #define AUTOCONF_TEST 1
1310 #define USE_SETUIDX 1
1311 #include "confdefs.h"
1312 #include "${srcdir-.}/lib/util_sec.c"],
1313 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1314 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1315 seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available])
1320 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1321 AC_TRY_RUN([#include "${srcdir-.}/build/tests/shared_mmap.c"],
1322 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1323 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1324 AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
1327 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1328 AC_TRY_RUN([#include "${srcdir-.}/build/tests/ftruncroot.c"],
1329 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1330 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1331 AC_DEFINE(FTRUNCATE_NEEDS_ROOT,1,[Whether ftruncate() needs root])
1334 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1335 AC_TRY_RUN([#include "${srcdir-.}/build/tests/fcntl_lock.c"],
1336 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1337 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1338 AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available])
1341 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1342 AC_TRY_RUN([#include "${srcdir-.}/build/tests/fcntl_lock64.c"],
1343 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1344 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1345 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken])
1350 dnl Don't check for 64 bit fcntl locking if we know that the
1351 dnl glibc2.1 broken check has succeeded.
1354 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1356 #if defined(HAVE_UNISTD_H)
1366 #ifdef HAVE_SYS_FCNTL_H
1367 #include <sys/fcntl.h>
1369 main() { struct flock64 fl64;
1370 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1376 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1378 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1379 AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available])
1383 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1384 AC_TRY_COMPILE([#include <sys/types.h>
1385 #include <sys/stat.h>
1386 #include <unistd.h>],
1387 [struct stat st; st.st_blocks = 0;],
1388 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1389 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1390 AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property])
1393 AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[
1394 AC_TRY_COMPILE([#include <sys/types.h>
1395 #include <sys/stat.h>
1396 #include <unistd.h>],
1397 [struct stat st; st.st_blksize = 0;],
1398 samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)])
1399 if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then
1400 AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property])
1405 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1407 #ifdef HAVE_SYS_VFS_H
1408 #include <sys/vfs.h>
1410 #ifdef HAVE_SYS_CAPABILITY_H
1411 #include <sys/capability.h>
1414 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1415 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1416 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
1421 AC_SUBST(SMBD_EXTRA_OBJS)
1422 AC_SUBST(SMBD_EXTRA_LIBS)
1424 SMB_INCLUDE_M4(libads/config.m4)
1426 ###############################################
1427 # test for where we get crypt() from
1428 AC_SEARCH_LIBS(crypt, [crypt],
1429 [test "$ac_cv_search_crypt" = "none required" || AUTHLIBS="-lcrypt $AUTHLIBS"
1430 AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
1433 ## moved after the check for -lcrypt in order to
1434 ## ensure that the necessary libraries are included
1435 ## check checking for truncated salt. Wrapped by the
1436 ## $with_pam_for_crypt variable as above --jerry
1438 if test x"$with_pam_for_crypt" != x"yes"; then
1439 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1441 LIBS="$AUTHLIBS $LIBS"
1442 AC_TRY_RUN([#include "${srcdir-.}/build/tests/crypttest.c"],
1443 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)
1444 LIBS="$crypt_LIBS"])
1445 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1446 AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt])
1450 #################################################
1451 # these tests are taken from the GNU fileutils package
1452 AC_CHECKING(how to get filesystem space usage)
1455 # Test for statvfs64.
1456 if test $space = no; then
1458 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
1460 #if defined(HAVE_UNISTD_H)
1463 #include <sys/types.h>
1464 #include <sys/statvfs.h>
1467 struct statvfs64 fsd;
1468 exit (statvfs64 (".", &fsd));
1470 fu_cv_sys_stat_statvfs64=yes,
1471 fu_cv_sys_stat_statvfs64=no,
1472 fu_cv_sys_stat_statvfs64=cross)])
1473 if test $fu_cv_sys_stat_statvfs64 = yes; then
1475 AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
1479 # Perform only the link test since it seems there are no variants of the
1480 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
1481 # because that got a false positive on SCO OSR5. Adding the declaration
1482 # of a `struct statvfs' causes this test to fail (as it should) on such
1483 # systems. That system is reported to work fine with STAT_STATFS4 which
1484 # is what it gets when this test fails.
1485 if test $space = no; then
1487 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
1488 [AC_TRY_LINK([#include <sys/types.h>
1489 #include <sys/statvfs.h>],
1490 [struct statvfs fsd; statvfs (0, &fsd);],
1491 fu_cv_sys_stat_statvfs=yes,
1492 fu_cv_sys_stat_statvfs=no)])
1493 if test $fu_cv_sys_stat_statvfs = yes; then
1495 AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
1499 if test $space = no; then
1500 # DEC Alpha running OSF/1
1501 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
1502 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
1504 #include <sys/param.h>
1505 #include <sys/types.h>
1506 #include <sys/mount.h>
1511 exit (statfs (".", &fsd, sizeof (struct statfs)));
1513 fu_cv_sys_stat_statfs3_osf1=yes,
1514 fu_cv_sys_stat_statfs3_osf1=no,
1515 fu_cv_sys_stat_statfs3_osf1=no)])
1516 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
1517 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
1519 AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
1523 if test $space = no; then
1525 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
1526 member (AIX, 4.3BSD)])
1527 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
1529 #ifdef HAVE_SYS_PARAM_H
1530 #include <sys/param.h>
1532 #ifdef HAVE_SYS_MOUNT_H
1533 #include <sys/mount.h>
1535 #ifdef HAVE_SYS_VFS_H
1536 #include <sys/vfs.h>
1542 exit (statfs (".", &fsd));
1544 fu_cv_sys_stat_statfs2_bsize=yes,
1545 fu_cv_sys_stat_statfs2_bsize=no,
1546 fu_cv_sys_stat_statfs2_bsize=no)])
1547 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
1548 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
1550 AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
1554 if test $space = no; then
1556 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
1557 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
1558 [AC_TRY_RUN([#include <sys/types.h>
1559 #include <sys/statfs.h>
1563 exit (statfs (".", &fsd, sizeof fsd, 0));
1565 fu_cv_sys_stat_statfs4=yes,
1566 fu_cv_sys_stat_statfs4=no,
1567 fu_cv_sys_stat_statfs4=no)])
1568 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
1569 if test $fu_cv_sys_stat_statfs4 = yes; then
1571 AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
1575 if test $space = no; then
1577 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
1578 member (4.4BSD and NetBSD)])
1579 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
1580 [AC_TRY_RUN([#include <sys/types.h>
1581 #ifdef HAVE_SYS_PARAM_H
1582 #include <sys/param.h>
1584 #ifdef HAVE_SYS_MOUNT_H
1585 #include <sys/mount.h>
1591 exit (statfs (".", &fsd));
1593 fu_cv_sys_stat_statfs2_fsize=yes,
1594 fu_cv_sys_stat_statfs2_fsize=no,
1595 fu_cv_sys_stat_statfs2_fsize=no)])
1596 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
1597 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
1599 AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
1603 if test $space = no; then
1605 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
1606 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
1607 [AC_TRY_RUN([#include <sys/types.h>
1608 #ifdef HAVE_SYS_PARAM_H
1609 #include <sys/param.h>
1611 #ifdef HAVE_SYS_MOUNT_H
1612 #include <sys/mount.h>
1614 #ifdef HAVE_SYS_FS_TYPES_H
1615 #include <sys/fs_types.h>
1620 /* Ultrix's statfs returns 1 for success,
1621 0 for not mounted, -1 for failure. */
1622 exit (statfs (".", &fsd) != 1);
1624 fu_cv_sys_stat_fs_data=yes,
1625 fu_cv_sys_stat_fs_data=no,
1626 fu_cv_sys_stat_fs_data=no)])
1627 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
1628 if test $fu_cv_sys_stat_fs_data = yes; then
1630 AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
1635 # As a gating factor for large file support, in order to
1636 # use <4GB files we must have the following minimal support
1638 # long long, and a 64 bit off_t or off64_t.
1639 # If we don't have all of these then disable large
1642 AC_MSG_CHECKING([if large file support can be enabled])
1644 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
1645 #include <sys/types.h>
1651 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
1652 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
1653 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled])
1655 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
1657 #######################################
1658 # Check for comparison_fn_t
1659 AC_CACHE_CHECK([for comparison_fn_t],samba_cv_HAVE_COMPARISON_FN_T,[
1662 int list_find(const void *needle,
1663 const void *base, size_t nmemb, size_t size, comparison_fn_t comp_fn)
1668 samba_cv_HAVE_COMPARISON_FN_T=yes,samba_cv_HAVE_COMPARISON_FN_T=no)
1670 if test x"$samba_cv_HAVE_COMPARISON_FN_T" = x"yes"; then
1671 AC_DEFINE(HAVE_COMPARISON_FN_T,1,[Whether or not we have comparison_fn_t])