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)
367 AC_CHECK_TYPE(int8_t, signed char)
368 AC_CHECK_TYPE(uint8_t, unsigned char)
369 AC_CHECK_TYPE(int16_t, short)
370 AC_CHECK_TYPE(uint16_t, unsigned short)
371 AC_CHECK_TYPE(int32_t, long)
372 AC_CHECK_TYPE(uint32_t, unsigned long)
373 AC_CHECK_TYPE(int64_t, long long)
374 AC_CHECK_TYPE(uint64_t, unsigned long long)
376 ############################################
377 # we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
378 AC_SEARCH_LIBS(dlopen, [dl])
379 # dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
381 ############################################
382 # check if the compiler can do immediate structures
383 AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
387 typedef struct {unsigned x;} FOOBAR;
388 #define X_FOOBAR(x) ((FOOBAR) { x })
389 #define FOO_ONE X_FOOBAR(1)
397 samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
398 if test x"$samba_cv_immediate_structures" = x"yes"; then
399 AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
402 ############################################
403 # check for unix domain sockets
404 AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
406 #include <sys/types.h>
409 #include <sys/socket.h>
410 #include <sys/un.h>],
412 struct sockaddr_un sunaddr;
413 sunaddr.sun_family = AF_UNIX;
415 samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
416 if test x"$samba_cv_unixsocket" = x"yes"; then
417 AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
421 AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
423 #include <sys/types.h>
428 #include <sys/socket.h>],[socklen_t i = 0],
429 samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
430 if test x"$samba_cv_socklen_t" = x"yes"; then
431 AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t])
434 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
436 #include <sys/types.h>
441 #include <signal.h>],[sig_atomic_t i = 0],
442 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
443 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
444 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
447 # stupid headers have the functions but no declaration. grrrr.
448 AC_HAVE_DECL(errno, [#include <errno.h>])
449 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
450 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
451 AC_HAVE_DECL(asprintf, [#include <stdio.h>])
452 AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
453 AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
454 AC_HAVE_DECL(snprintf, [#include <stdio.h>])
456 # and glibc has setresuid under linux but the function does
457 # nothing until kernel 2.1.44! very dumb.
458 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
459 AC_TRY_RUN([#include <errno.h>
460 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
461 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
462 if test x"$samba_cv_have_setresuid" = x"yes"; then
463 AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid])
466 # Do the same check for setresguid...
468 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
469 AC_TRY_RUN([#include <unistd.h>
471 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
472 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
473 if test x"$samba_cv_have_setresgid" = x"yes"; then
474 AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid])
479 # The following test taken from the cvs sources
480 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
481 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
482 # libsocket.so which has a bad implementation of gethostbyname (it
483 # only looks in /etc/hosts), so we only look for -lsocket if we need
485 AC_CHECK_FUNCS(connect)
486 if test x"$ac_cv_func_connect" = x"no"; then
489 *) AC_CHECK_LIB(nsl_s, printf) ;;
493 *) AC_CHECK_LIB(nsl, printf) ;;
497 *) AC_CHECK_LIB(socket, connect) ;;
501 *) AC_CHECK_LIB(inet, connect) ;;
503 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
505 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
506 test x"$ac_cv_lib_inet_connect" = x"yes"; then
507 # ac_cv_func_connect=yes
508 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
509 AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
513 ###############################################
514 # test for where we get yp_get_default_domain() from
515 AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
516 AC_CHECK_FUNCS(yp_get_default_domain)
518 # Check if we have execl, if not we need to compile smbrun.
519 AC_CHECK_FUNCS(execl)
520 if test x"$ac_cv_func_execl" = x"no"; then
521 EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
524 AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
525 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
526 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
527 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
528 AC_CHECK_FUNCS(initgroups select rdchk getgrnam getgrent pathconf realpath)
529 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
530 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
531 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
532 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
533 AC_CHECK_FUNCS(syslog vsyslog getgrouplist timegm)
534 # setbuffer, shmget, shm_open are needed for smbtorture
535 AC_CHECK_FUNCS(setbuffer shmget shm_open)
537 # syscall() is needed for smbwrapper.
538 AC_CHECK_FUNCS(syscall)
540 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
541 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
542 AC_CHECK_FUNCS(__getcwd _getcwd)
543 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
544 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
545 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
546 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
547 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
548 AC_CHECK_FUNCS(getdirentries _write __write _fork __fork)
549 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
550 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
551 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
552 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
553 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
556 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
559 if test x$ac_cv_func_stat64 = xno ; then
560 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
562 #if defined(HAVE_UNISTD_H)
565 #include <sys/stat.h>
566 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
567 AC_MSG_RESULT([$ac_cv_func_stat64])
568 if test x$ac_cv_func_stat64 = xyes ; then
569 AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available])
573 if test x$ac_cv_func_lstat64 = xno ; then
574 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
576 #if defined(HAVE_UNISTD_H)
579 #include <sys/stat.h>
580 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
581 AC_MSG_RESULT([$ac_cv_func_lstat64])
582 if test x$ac_cv_func_lstat64 = xyes ; then
583 AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available])
587 if test x$ac_cv_func_fstat64 = xno ; then
588 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
590 #if defined(HAVE_UNISTD_H)
593 #include <sys/stat.h>
594 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
595 AC_MSG_RESULT([$ac_cv_func_fstat64])
596 if test x$ac_cv_func_fstat64 = xyes ; then
597 AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available])
601 #####################################
602 # we might need the resolv library on some systems
603 AC_CHECK_LIB(resolv, dn_expand)
606 # Check for the functions putprpwnam, set_auth_parameters,
607 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
608 # Needed for OSF1 and HPUX.
611 AC_LIBTESTFUNC(security, putprpwnam)
612 AC_LIBTESTFUNC(sec, putprpwnam)
614 AC_LIBTESTFUNC(security, set_auth_parameters)
615 AC_LIBTESTFUNC(sec, set_auth_parameters)
617 # UnixWare 7.x has its getspnam in -lgen
618 AC_LIBTESTFUNC(gen, getspnam)
620 AC_LIBTESTFUNC(security, getspnam)
621 AC_LIBTESTFUNC(sec, getspnam)
623 AC_LIBTESTFUNC(security, bigcrypt)
624 AC_LIBTESTFUNC(sec, bigcrypt)
626 AC_LIBTESTFUNC(security, getprpwnam)
627 AC_LIBTESTFUNC(sec, getprpwnam)
629 # Assume non-shared by default and override below
632 # these are the defaults, good for lots of systems
642 if test "$enable_shared" = "yes"; then
643 # this bit needs to be modified for each OS that is suported by
644 # smbwrapper. You need to specify how to created a shared library and
645 # how to compile C code to produce PIC object files
647 AC_MSG_CHECKING([ability to build shared libraries])
649 # and these are for particular systems
651 *linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux])
654 DYNEXP="-Wl,--export-dynamic"
656 SONAMEFLAG="-Wl,-soname="
657 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
659 *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
663 if test "${GCC}" = "yes"; then
665 if test "${ac_cv_prog_gnu_ld}" = "yes"; then
670 ## ${CFLAGS} added for building 64-bit shared
671 ## libs using Sun's Compiler
672 LDSHFLAGS="-G \${CFLAGS}"
676 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
678 *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
682 PICFLAG="-KPIC" # Is this correct for SunOS
683 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
685 *netbsd* | *freebsd*) BLDSHARED="true"
687 DYNEXP="-Wl,--export-dynamic"
688 SONAMEFLAG="-Wl,-soname,"
689 PICFLAG="-fPIC -DPIC"
690 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
692 *openbsd*) BLDSHARED="true"
694 DYNEXP="-Wl,-Bdynamic"
695 SONAMEFLAG="-Wl,-soname,"
697 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
699 *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
701 *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
704 ATTEMPT_WRAP32_BUILD=yes
706 LDSHFLAGS="-set_version sgi1.0 -shared"
707 SONAMEFLAG="-soname "
709 if test "${GCC}" = "yes"; then
714 AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
716 *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
718 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
719 DYNEXP="-Wl,-brtl,-bexpall"
721 if test "${GCC}" != "yes"; then
722 ## for funky AIX compiler using strncpy()
723 CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
726 AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block])
728 *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
730 # Use special PIC flags for the native HP-UX compiler.
731 if test $ac_cv_prog_cc_Ae = yes; then
734 LDSHFLAGS="-B symbolic -b -z"
739 AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
741 *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
742 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
744 *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
747 SONAMEFLAG="-Wl,-soname,"
749 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
751 *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
752 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
754 *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
757 SONAMEFLAG="-Wl,-soname,"
759 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
761 *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2])
762 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
764 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
765 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
767 *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
769 *-univel-*) if [ test "$GCC" != yes ]; then
770 AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
775 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
777 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
780 *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
781 if [ test "$GCC" != yes ]; then
782 AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
785 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
787 *vos*) AC_DEFINE(STAT_ST_BLOCKSIZE,4096)
792 AC_DEFINE(STAT_ST_BLOCKSIZE,512)
796 AC_MSG_RESULT($BLDSHARED)
797 AC_MSG_CHECKING([linker flags for shared libraries])
798 AC_MSG_RESULT([$LDSHFLAGS])
799 AC_MSG_CHECKING([compiler flags for position-independent code])
800 AC_MSG_RESULT([$PICFLAGS])
803 #######################################################
804 # test whether building a shared library actually works
805 if test $BLDSHARED = true; then
806 AC_CACHE_CHECK([whether building shared libraries actually works],
807 [ac_cv_shlib_works],[
809 # try building a trivial shared library
810 if test "$PICSUFFIX" = "po"; then
811 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/build/tests/shlib.c &&
812 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
813 ac_cv_shlib_works=yes
815 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.$PICSUFFIX ${srcdir-.}/build/tests/shlib.c &&
816 mv shlib.$PICSUFFIX shlib.po &&
817 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
818 ac_cv_shlib_works=yes
820 rm -f shlib.so shlib.po
822 if test $ac_cv_shlib_works = no; then
829 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
830 AC_TRY_RUN([#include <stdio.h>
831 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
832 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
833 if test x"$samba_cv_have_longlong" = x"yes"; then
834 AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
838 # Check if the compiler supports the LL prefix on long long integers.
841 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
842 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
843 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
844 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
845 AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers])
849 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
850 AC_TRY_RUN([#include <stdio.h>
851 #include <sys/stat.h>
852 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
853 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
854 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
855 AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type])
858 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
860 #if defined(HAVE_UNISTD_H)
864 #include <sys/stat.h>
865 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
866 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
867 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
868 AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
871 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
872 AC_TRY_RUN([#include <stdio.h>
873 #include <sys/stat.h>
874 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
875 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
876 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
877 AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type])
880 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
882 #if defined(HAVE_UNISTD_H)
886 #include <sys/stat.h>
887 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
888 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
889 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
890 AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available])
893 AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
895 #if defined(HAVE_UNISTD_H)
899 #include <sys/stat.h>
900 main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
901 samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
902 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
903 AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available])
906 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
908 #if defined(HAVE_UNISTD_H)
911 #include <sys/types.h>
912 #include <dirent.h>],
913 [struct dirent64 de;],
914 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
915 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
916 AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available])
919 AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
921 #if defined(HAVE_UNISTD_H)
924 #include <sys/types.h>
925 main() { dev_t dev; int i = major(dev); return 0; }],
926 samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
927 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
928 AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available])
931 AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
933 #if defined(HAVE_UNISTD_H)
936 #include <sys/types.h>
937 main() { dev_t dev; int i = minor(dev); return 0; }],
938 samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
939 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
940 AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available])
943 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
944 AC_TRY_RUN([#include <stdio.h>
945 main() { char c; c=250; exit((c > 0)?0:1); }],
946 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
947 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
948 AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available])
951 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
952 AC_TRY_COMPILE([#include <sys/types.h>
953 #include <sys/socket.h>
954 #include <netinet/in.h>],
955 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
956 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
957 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
958 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
961 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
962 AC_TRY_COMPILE([#include <sys/types.h>
964 void seekdir(DIR *d, long loc) { return; }],[return 0;],
965 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
966 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
967 AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void])
970 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
971 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
972 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
973 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
974 AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
977 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
979 #include <sys/time.h>
981 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
982 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
983 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
984 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
987 AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[
988 AC_TRY_LINK([#include <stdarg.h>
989 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
990 samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)])
991 if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
992 AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available])
995 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
997 #include <sys/types.h>
999 void foo(const char *format, ...) {
1004 va_start(ap, format);
1005 len = vsnprintf(buf, 0, format, ap);
1007 if (len != 5) exit(1);
1009 va_start(ap, format);
1010 len = vsnprintf(0, 0, format, ap);
1012 if (len != 5) exit(1);
1014 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
1018 main() { foo("hello"); }
1020 samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
1021 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
1022 AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
1025 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
1026 AC_TRY_RUN([#include <sys/types.h>
1028 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
1029 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
1030 di->d_name[0] == 0) exit(0); exit(1);} ],
1031 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
1032 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
1033 AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken])
1036 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
1037 AC_TRY_COMPILE([#include <sys/types.h>
1038 #include <utime.h>],
1039 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
1040 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
1041 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
1042 AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available])
1045 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
1047 #include <sys/types.h>
1050 #define F_GETLEASE 1025
1053 int fd = open("/dev/null", O_RDONLY);
1054 return fcntl(fd, F_GETLEASE, 0) == -1;
1057 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
1058 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
1059 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks])
1062 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
1064 #include <sys/types.h>
1068 #define F_NOTIFY 1026
1071 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
1074 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
1075 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
1076 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes])
1079 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
1081 #include <sys/types.h>
1084 #include <sys/file.h>
1086 #define LOCK_MAND 32
1087 #define LOCK_READ 64
1090 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
1093 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
1094 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
1095 AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes])
1101 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
1102 AC_TRY_COMPILE([#include <sys/types.h>
1103 #include <fcntl.h>],
1104 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
1105 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
1106 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
1107 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
1110 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
1111 AC_TRY_RUN([#include <sys/types.h>
1112 #include <sys/capability.h>
1115 if ((cap = cap_get_proc()) == NULL)
1117 cap->cap_effective |= CAP_NETWORK_MGT;
1118 cap->cap_inheritable |= CAP_NETWORK_MGT;
1123 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
1124 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
1125 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
1128 AC_MSG_CHECKING([for test routines])
1129 AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"],
1131 AC_MSG_ERROR([cant find test code. Aborting config]),
1132 AC_MSG_WARN([cannot run when cross-compiling]))
1134 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
1135 AC_TRY_RUN([#include "${srcdir-.}/build/tests/ftruncate.c"],
1136 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
1137 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
1138 AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
1141 AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
1142 AC_TRY_RUN([#include "${srcdir-.}/build/tests/unixsock.c"],
1143 samba_cv_HAVE_WORKING_AF_LOCAL=yes,
1144 samba_cv_HAVE_WORKING_AF_LOCAL=no,
1145 samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
1146 if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
1148 AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
1151 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
1152 AC_TRY_RUN([#include "${srcdir-.}/build/tests/getgroups.c"],
1153 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
1154 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
1155 AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken])
1158 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
1159 SAVE_CPPFLAGS="$CPPFLAGS"
1160 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/smbwrapper"
1162 #define REPLACE_GETPASS 1
1163 #define NO_CONFIG_H 1
1164 #define main dont_declare_main
1165 #include "${srcdir-.}/lib/getsmbpass.c"
1167 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
1168 CPPFLAGS="$SAVE_CPPFLAGS"
1170 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
1171 AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
1174 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
1177 #include <sys/types.h>
1178 #include <netinet/in.h>
1179 #ifdef HAVE_ARPA_INET_H
1180 #include <arpa/inet.h>
1182 main() { struct in_addr ip; ip.s_addr = 0x12345678;
1183 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
1184 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
1186 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
1187 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
1188 AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
1191 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
1192 AC_TRY_RUN([#include <stdlib.h>
1193 #include <sys/types.h>
1194 #include <sys/stat.h>
1198 char tpl[20]="/tmp/test.XXXXXX";
1199 int fd = mkstemp(tpl);
1200 if (fd == -1) exit(1);
1202 if (fstat(fd, &st) != 0) exit(1);
1203 if ((st.st_mode & 0777) != 0600) exit(1);
1206 samba_cv_HAVE_SECURE_MKSTEMP=yes,
1207 samba_cv_HAVE_SECURE_MKSTEMP=no,
1208 samba_cv_HAVE_SECURE_MKSTEMP=cross)])
1209 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
1210 AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
1213 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
1214 AC_TRY_RUN([#include <unistd.h>
1215 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
1216 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
1217 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
1218 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available])
1221 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
1222 AC_TRY_RUN([main() { exit(getuid() != 0); }],
1223 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
1224 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
1225 AC_DEFINE(HAVE_ROOT,1,[Whether current user is root])
1227 AC_MSG_WARN(running as non-root will disable some tests)
1231 # look for a method of finding the list of network interfaces
1233 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
1235 #define HAVE_IFACE_AIX 1
1236 #define AUTOCONF_TEST 1
1237 #include "confdefs.h"
1238 #include "${srcdir-.}/lib/interfaces.c"],
1239 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
1240 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
1241 iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
1244 if test $iface = no; then
1245 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
1247 #define HAVE_IFACE_IFCONF 1
1248 #define AUTOCONF_TEST 1
1249 #include "confdefs.h"
1250 #include "${srcdir-.}/lib/interfaces.c"],
1251 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
1252 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
1253 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
1257 if test $iface = no; then
1258 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
1260 #define HAVE_IFACE_IFREQ 1
1261 #define AUTOCONF_TEST 1
1262 #include "confdefs.h"
1263 #include "${srcdir-.}/lib/interfaces.c"],
1264 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
1265 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
1266 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
1271 ################################################
1272 # look for a method of setting the effective uid
1274 if test $seteuid = no; then
1275 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
1277 #define AUTOCONF_TEST 1
1278 #define USE_SETRESUID 1
1279 #include "confdefs.h"
1280 #include "${srcdir-.}/lib/util_sec.c"],
1281 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
1282 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
1283 seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
1288 if test $seteuid = no; then
1289 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
1291 #define AUTOCONF_TEST 1
1292 #define USE_SETREUID 1
1293 #include "confdefs.h"
1294 #include "${srcdir-.}/lib/util_sec.c"],
1295 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1296 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1297 seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
1301 if test $seteuid = no; then
1302 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1304 #define AUTOCONF_TEST 1
1305 #define USE_SETEUID 1
1306 #include "confdefs.h"
1307 #include "${srcdir-.}/lib/util_sec.c"],
1308 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1309 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1310 seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available])
1314 if test $seteuid = no; then
1315 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1317 #define AUTOCONF_TEST 1
1318 #define USE_SETUIDX 1
1319 #include "confdefs.h"
1320 #include "${srcdir-.}/lib/util_sec.c"],
1321 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1322 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1323 seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available])
1328 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1329 AC_TRY_RUN([#include "${srcdir-.}/build/tests/shared_mmap.c"],
1330 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1331 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1332 AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
1335 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1336 AC_TRY_RUN([#include "${srcdir-.}/build/tests/ftruncroot.c"],
1337 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1338 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1339 AC_DEFINE(FTRUNCATE_NEEDS_ROOT,1,[Whether ftruncate() needs root])
1342 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1343 AC_TRY_RUN([#include "${srcdir-.}/build/tests/fcntl_lock.c"],
1344 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1345 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1346 AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available])
1349 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1350 AC_TRY_RUN([#include "${srcdir-.}/build/tests/fcntl_lock64.c"],
1351 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1352 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1353 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken])
1358 dnl Don't check for 64 bit fcntl locking if we know that the
1359 dnl glibc2.1 broken check has succeeded.
1362 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1364 #if defined(HAVE_UNISTD_H)
1374 #ifdef HAVE_SYS_FCNTL_H
1375 #include <sys/fcntl.h>
1377 main() { struct flock64 fl64;
1378 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1384 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1386 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1387 AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available])
1391 AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
1392 AC_TRY_COMPILE([#include <sys/types.h>
1393 #include <sys/stat.h>
1394 #include <unistd.h>],
1395 [struct stat st; st.st_blocks = 0;],
1396 samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
1397 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
1398 AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property])
1401 AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[
1402 AC_TRY_COMPILE([#include <sys/types.h>
1403 #include <sys/stat.h>
1404 #include <unistd.h>],
1405 [struct stat st; st.st_blksize = 0;],
1406 samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)])
1407 if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then
1408 AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property])
1413 AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
1415 #ifdef HAVE_SYS_VFS_H
1416 #include <sys/vfs.h>
1418 #ifdef HAVE_SYS_CAPABILITY_H
1419 #include <sys/capability.h>
1422 samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
1423 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
1424 AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
1429 AC_SUBST(SMBD_EXTRA_OBJS)
1430 AC_SUBST(SMBD_EXTRA_LIBS)
1432 SMB_INCLUDE_M4(libads/config.m4)
1434 ###############################################
1435 # test for where we get crypt() from
1436 AC_SEARCH_LIBS(crypt, [crypt],
1437 [test "$ac_cv_search_crypt" = "none required" || AUTHLIBS="-lcrypt $AUTHLIBS"
1438 AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
1441 ## moved after the check for -lcrypt in order to
1442 ## ensure that the necessary libraries are included
1443 ## check checking for truncated salt. Wrapped by the
1444 ## $with_pam_for_crypt variable as above --jerry
1446 if test x"$with_pam_for_crypt" != x"yes"; then
1447 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1449 LIBS="$AUTHLIBS $LIBS"
1450 AC_TRY_RUN([#include "${srcdir-.}/build/tests/crypttest.c"],
1451 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)
1452 LIBS="$crypt_LIBS"])
1453 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1454 AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt])
1458 #################################################
1459 # these tests are taken from the GNU fileutils package
1460 AC_CHECKING(how to get filesystem space usage)
1463 # Test for statvfs64.
1464 if test $space = no; then
1466 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
1468 #if defined(HAVE_UNISTD_H)
1471 #include <sys/types.h>
1472 #include <sys/statvfs.h>
1475 struct statvfs64 fsd;
1476 exit (statvfs64 (".", &fsd));
1478 fu_cv_sys_stat_statvfs64=yes,
1479 fu_cv_sys_stat_statvfs64=no,
1480 fu_cv_sys_stat_statvfs64=cross)])
1481 if test $fu_cv_sys_stat_statvfs64 = yes; then
1483 AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
1487 # Perform only the link test since it seems there are no variants of the
1488 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
1489 # because that got a false positive on SCO OSR5. Adding the declaration
1490 # of a `struct statvfs' causes this test to fail (as it should) on such
1491 # systems. That system is reported to work fine with STAT_STATFS4 which
1492 # is what it gets when this test fails.
1493 if test $space = no; then
1495 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
1496 [AC_TRY_LINK([#include <sys/types.h>
1497 #include <sys/statvfs.h>],
1498 [struct statvfs fsd; statvfs (0, &fsd);],
1499 fu_cv_sys_stat_statvfs=yes,
1500 fu_cv_sys_stat_statvfs=no)])
1501 if test $fu_cv_sys_stat_statvfs = yes; then
1503 AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
1507 if test $space = no; then
1508 # DEC Alpha running OSF/1
1509 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
1510 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
1512 #include <sys/param.h>
1513 #include <sys/types.h>
1514 #include <sys/mount.h>
1519 exit (statfs (".", &fsd, sizeof (struct statfs)));
1521 fu_cv_sys_stat_statfs3_osf1=yes,
1522 fu_cv_sys_stat_statfs3_osf1=no,
1523 fu_cv_sys_stat_statfs3_osf1=no)])
1524 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
1525 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
1527 AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
1531 if test $space = no; then
1533 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
1534 member (AIX, 4.3BSD)])
1535 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
1537 #ifdef HAVE_SYS_PARAM_H
1538 #include <sys/param.h>
1540 #ifdef HAVE_SYS_MOUNT_H
1541 #include <sys/mount.h>
1543 #ifdef HAVE_SYS_VFS_H
1544 #include <sys/vfs.h>
1550 exit (statfs (".", &fsd));
1552 fu_cv_sys_stat_statfs2_bsize=yes,
1553 fu_cv_sys_stat_statfs2_bsize=no,
1554 fu_cv_sys_stat_statfs2_bsize=no)])
1555 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
1556 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
1558 AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
1562 if test $space = no; then
1564 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
1565 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
1566 [AC_TRY_RUN([#include <sys/types.h>
1567 #include <sys/statfs.h>
1571 exit (statfs (".", &fsd, sizeof fsd, 0));
1573 fu_cv_sys_stat_statfs4=yes,
1574 fu_cv_sys_stat_statfs4=no,
1575 fu_cv_sys_stat_statfs4=no)])
1576 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
1577 if test $fu_cv_sys_stat_statfs4 = yes; then
1579 AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
1583 if test $space = no; then
1585 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
1586 member (4.4BSD and NetBSD)])
1587 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
1588 [AC_TRY_RUN([#include <sys/types.h>
1589 #ifdef HAVE_SYS_PARAM_H
1590 #include <sys/param.h>
1592 #ifdef HAVE_SYS_MOUNT_H
1593 #include <sys/mount.h>
1599 exit (statfs (".", &fsd));
1601 fu_cv_sys_stat_statfs2_fsize=yes,
1602 fu_cv_sys_stat_statfs2_fsize=no,
1603 fu_cv_sys_stat_statfs2_fsize=no)])
1604 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
1605 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
1607 AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
1611 if test $space = no; then
1613 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
1614 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
1615 [AC_TRY_RUN([#include <sys/types.h>
1616 #ifdef HAVE_SYS_PARAM_H
1617 #include <sys/param.h>
1619 #ifdef HAVE_SYS_MOUNT_H
1620 #include <sys/mount.h>
1622 #ifdef HAVE_SYS_FS_TYPES_H
1623 #include <sys/fs_types.h>
1628 /* Ultrix's statfs returns 1 for success,
1629 0 for not mounted, -1 for failure. */
1630 exit (statfs (".", &fsd) != 1);
1632 fu_cv_sys_stat_fs_data=yes,
1633 fu_cv_sys_stat_fs_data=no,
1634 fu_cv_sys_stat_fs_data=no)])
1635 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
1636 if test $fu_cv_sys_stat_fs_data = yes; then
1638 AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
1643 # As a gating factor for large file support, in order to
1644 # use <4GB files we must have the following minimal support
1646 # long long, and a 64 bit off_t or off64_t.
1647 # If we don't have all of these then disable large
1650 AC_MSG_CHECKING([if large file support can be enabled])
1652 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
1653 #include <sys/types.h>
1659 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
1660 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
1661 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled])
1663 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
1665 #######################################
1666 # Check for comparison_fn_t
1667 AC_CACHE_CHECK([for comparison_fn_t],samba_cv_HAVE_COMPARISON_FN_T,[
1670 int list_find(const void *needle,
1671 const void *base, size_t nmemb, size_t size, comparison_fn_t comp_fn)
1676 samba_cv_HAVE_COMPARISON_FN_T=yes,samba_cv_HAVE_COMPARISON_FN_T=no)
1678 if test x"$samba_cv_HAVE_COMPARISON_FN_T" = x"yes"; then
1679 AC_DEFINE(HAVE_COMPARISON_FN_T,1,[Whether or not we have comparison_fn_t])