1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(include/includes.h)
3 AC_CONFIG_HEADER(include/config.h)
4 # we want to be compatibe with older versions of Samba
5 AC_PREFIX_DEFAULT(/usr/local/samba)
7 dnl Unique-to-Samba variables we'll be playing with.
18 # compile with optimisation and without debugging by default
21 dnl Checks for programs.
26 AC_SUBST(LIBTOOL_DEPS)
28 dnl Check if C compiler understands -c and -o at the same time
30 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
37 dnl Check if the C compiler understands volatile (it should, being ANSI).
38 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
39 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
40 samba_cv_volatile=yes,samba_cv_volatile=no)])
41 if test x"$samba_cv_volatile" = x"yes"; then
42 AC_DEFINE(HAVE_VOLATILE)
49 dnl Add #include for broken IRIX header files
51 *irix*) AC_ADD_INCLUDE(<standards.h>)
55 AC_VALIDATE_CACHE_SYSTEM_TYPE
58 # Config CPPFLAG settings for strange OS's that must be set
62 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
65 if test $ac_cv_prog_cc_Ae = yes; then
66 CPPFLAGS="$CPPFLAGS -Ae"
69 # Defines needed for HPUX support.
70 # HPUX has bigcrypt but (sometimes?) doesn't use it for
71 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
75 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
76 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
79 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
80 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
85 # AIX4.x doesn't even admit to having large
86 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
89 AC_MSG_RESULT([enabling large file support])
90 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
93 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
94 # to the existance of large files..
95 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
96 # recommendations on large file support, however it makes the
97 # compile work using gcc 2.7 and 2.8, whereas using the Sun
98 # recommendation makes the compile fail on gcc2.7. JRA.
103 AC_MSG_RESULT([enabling large file support])
104 if test "$ac_cv_prog_gcc" = yes; then
105 ${CC-cc} -v >conftest.c 2>&1
106 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
108 case "$ac_cv_gcc_compiler_version_number" in
109 *"gcc version 2.6"*|*"gcc version 2.7"*)
110 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
113 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
117 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
123 # Tests needed for SINIX large file support.
126 if test $host = mips-sni-sysv4 ; then
127 AC_MSG_CHECKING([for LFS support])
128 old_CPPFLAGS="$CPPFLAGS"
129 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
133 #if _LFS64_LARGEFILE == 1
138 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
139 CPPFLAGS="$old_CPPFLAGS"
140 if test x$SINIX_LFS_SUPPORT = xyes ; then
141 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
142 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
143 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
144 LIBS="`getconf LFS64_LIBS` $LIBS"
146 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
151 # Tests needed for glibc 2.1 large file support.
154 AC_MSG_RESULT([disabling large file support for glibc2.1 on Linux])
157 AC_MSG_CHECKING([for LFS support])
158 old_CPPFLAGS="$CPPFLAGS"
159 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
163 #if _LFS64_LARGEFILE == 1
168 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
169 CPPFLAGS="$old_CPPFLAGS"
170 if test x$GLIBC_LFS_SUPPORT = xyes ; then
171 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
173 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
183 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
184 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
185 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
186 AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
187 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
188 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
189 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
191 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
192 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
196 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
197 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
198 if test x"$ac_cv_header_shadow_h" = x"yes"; then
199 AC_DEFINE(HAVE_SHADOW_H)
203 AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
204 AC_CHECK_HEADERS(nss.h sys/security.h security/pam_appl.h)
205 AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
206 AC_CHECK_HEADERS(readline/history.h sys/capability.h syscall.h sys/syscall.h)
207 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
209 # For experimental utmp support
210 AC_CHECK_HEADERS(utmp.h utmpx.h)
212 AC_CHECK_SIZEOF(int,cross)
213 AC_CHECK_SIZEOF(long,cross)
214 AC_CHECK_SIZEOF(short,cross)
229 AC_CHECK_TYPE(ino_t,unsigned)
230 AC_CHECK_TYPE(loff_t,off_t)
231 AC_CHECK_TYPE(offset_t,loff_t)
232 AC_CHECK_TYPE(ssize_t, int)
233 AC_CHECK_TYPE(wchar_t, unsigned short)
235 # we need libcups for CUPS support...
236 AC_CHECK_LIB(cups,httpConnect)
238 # we need libdl for PAM and the new VFS code
239 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
240 AC_DEFINE(HAVE_LIBDL)])
242 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
244 #include <sys/types.h>
249 #include <signal.h>],[sig_atomic_t i = 0],
250 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
251 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
252 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
255 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
256 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
257 samba_cv_errno=yes,samba_cv_have_errno=no)])
258 if test x"$samba_cv_errno" = x"yes"; then
259 AC_DEFINE(HAVE_ERRNO_DECL)
262 # stupid glibc has the functions but no declaration. grrrr.
263 AC_CACHE_CHECK([for setresuid declaration],samba_cv_have_setresuid_decl,[
264 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresuid],
265 samba_cv_have_setresuid_decl=yes,samba_cv_have_setresuid_decl=no)])
266 if test x"$samba_cv_have_setresuid_decl" = x"yes"; then
267 AC_DEFINE(HAVE_SETRESUID_DECL)
270 # stupid glibc has the functions but no declaration. grrrr.
271 AC_CACHE_CHECK([for setresgid declaration],samba_cv_have_setresgid_decl,[
272 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresgid],
273 samba_cv_have_setresgid_decl=yes,samba_cv_have_setresgid_decl=no)])
274 if test x"$samba_cv_have_setresgid_decl" = x"yes"; then
275 AC_DEFINE(HAVE_SETRESGID_DECL)
278 # and glibc has setresuid under linux but the function does
279 # nothing until kernel 2.1.44! very dumb.
280 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
281 AC_TRY_RUN([#include <errno.h>
282 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
283 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
284 if test x"$samba_cv_have_setresuid" = x"yes"; then
285 AC_DEFINE(HAVE_SETRESUID)
288 # Do the same check for setresguid...
290 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
291 AC_TRY_RUN([#include <unistd.h>
293 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
294 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
295 if test x"$samba_cv_have_setresgid" = x"yes"; then
296 AC_DEFINE(HAVE_SETRESGID)
301 ###############################################
302 # test for where we get crypt() from
303 AC_CHECK_FUNCS(crypt)
304 if test x"$ac_cv_func_crypt" = x"no"; then
305 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
306 AC_DEFINE(HAVE_CRYPT)])
310 ###############################################
311 # test for where we get readline() from
312 if test "$ac_cv_header_readline_h" = "yes" ||
313 test "$ac_cv_header_readline_readline_h" = "yes"; then
314 AC_CHECK_LIB(readline,readline)
318 # The following test taken from the cvs sources
319 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
320 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
321 # libsocket.so which has a bad implementation of gethostbyname (it
322 # only looks in /etc/hosts), so we only look for -lsocket if we need
324 AC_CHECK_FUNCS(connect)
325 if test x"$ac_cv_func_connect" = x"no"; then
328 *) AC_CHECK_LIB(nsl_s, printf) ;;
332 *) AC_CHECK_LIB(nsl, printf) ;;
336 *) AC_CHECK_LIB(socket, connect) ;;
340 *) AC_CHECK_LIB(inet, connect) ;;
342 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
344 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
345 test x"$ac_cv_lib_inet_connect" = x"yes"; then
346 # ac_cv_func_connect=yes
347 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
348 AC_DEFINE(HAVE_CONNECT)
352 ###############################################
353 # test for where we get get_yp_default_domain() from
354 AC_CHECK_FUNCS(yp_get_default_domain)
355 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
356 AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl";
357 AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)])
360 # Check if we have execl, if not we need to compile smbrun.
361 AC_CHECK_FUNCS(execl)
362 if test x"$ac_cv_func_execl" = x"no"; then
368 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod chroot)
369 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
370 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
371 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
372 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
373 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
374 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
375 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
376 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl)
378 # syscall() is needed for smbwrapper.
379 AC_CHECK_FUNCS(syscall)
381 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
382 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
383 AC_CHECK_FUNCS(__getcwd _getcwd)
384 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
385 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
386 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
387 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
388 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
389 AC_CHECK_FUNCS(_write __write _fork __fork)
390 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
391 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
392 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
393 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
394 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
397 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
400 if test x$ac_cv_func_stat64 = xno ; then
401 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
403 #if defined(HAVE_UNISTD_H)
406 #include <sys/stat.h>
407 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
408 AC_MSG_RESULT([$ac_cv_func_stat64])
409 if test x$ac_cv_func_stat64 = xyes ; then
410 AC_DEFINE(HAVE_STAT64)
414 if test x$ac_cv_func_lstat64 = xno ; then
415 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
417 #if defined(HAVE_UNISTD_H)
420 #include <sys/stat.h>
421 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
422 AC_MSG_RESULT([$ac_cv_func_lstat64])
423 if test x$ac_cv_func_lstat64 = xyes ; then
424 AC_DEFINE(HAVE_LSTAT64)
428 if test x$ac_cv_func_fstat64 = xno ; then
429 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
431 #if defined(HAVE_UNISTD_H)
434 #include <sys/stat.h>
435 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
436 AC_MSG_RESULT([$ac_cv_func_fstat64])
437 if test x$ac_cv_func_fstat64 = xyes ; then
438 AC_DEFINE(HAVE_FSTAT64)
443 # If no strcasecmp, check for it in some known places
444 # It is in -lresolv on ReliantUNIX and UnixWare
445 # -lresolve *must* follow -lnsl for name resolution to work properly
448 if test x$ac_cv_func_strcasecmp = xno ; then
449 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
450 AC_DEFINE(HAVE_STRCASECMP))
454 # Check for the functions putprpwnam, set_auth_parameters,
455 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
456 # Needed for OSF1 and HPUX.
459 AC_LIBTESTFUNC(security, putprpwnam)
460 AC_LIBTESTFUNC(sec, putprpwnam)
462 AC_LIBTESTFUNC(security, set_auth_parameters)
463 AC_LIBTESTFUNC(sec, set_auth_parameters)
465 # UnixWare 7.x has its getspnam in -lgen
466 AC_LIBTESTFUNC(gen, getspnam)
468 AC_LIBTESTFUNC(security, getspnam)
469 AC_LIBTESTFUNC(sec, getspnam)
471 AC_LIBTESTFUNC(security, bigcrypt)
472 AC_LIBTESTFUNC(sec, bigcrypt)
474 AC_LIBTESTFUNC(security, getprpwnam)
475 AC_LIBTESTFUNC(sec, getprpwnam)
477 # this bit needs to be modified for each OS that is suported by
478 # smbwrapper. You need to specify how to created a shared library and
479 # how to compile C code to produce PIC object files
481 # these are the defaults, good for lots of systems
487 # and these are for particular systems
489 *linux*) AC_DEFINE(LINUX);;
490 *solaris*) AC_DEFINE(SUNOS5)
493 *sunos*) AC_DEFINE(SUNOS4)
496 *bsd*) LDSHFLAGS="-shared -Bshareable"
498 *irix*) AC_DEFINE(IRIX)
500 *irix6*) AC_DEFINE(IRIX6)
503 ATTEMPT_WRAP32_BUILD=yes
505 *aix*) AC_DEFINE(AIX);;
506 *hpux*) AC_DEFINE(HPUX)
508 # Use special PIC flags for the native HP-UX compiler.
509 if test $ac_cv_prog_cc_Ae = yes; then
514 *qnx*) AC_DEFINE(QNX);;
515 *osf*) AC_DEFINE(OSF1);;
516 *sco*) AC_DEFINE(SCO);;
517 *next2*) AC_DEFINE(NEXT2);;
518 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
521 *-univel-*) if [ test "$GCC" != yes ]; then
522 AC_DEFINE(HAVE_MEMSET)
526 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
530 if [ test "$GCC" != yes ]; then
531 AC_DEFINE(HAVE_MEMSET)
537 # try to work out how to produce pic code with this compiler
538 AC_PROG_CC_FLAG(fpic)
539 if test $ac_cv_prog_cc_fpic = yes; then
542 if test x$PICFLAG = x; then
543 AC_PROG_CC_FLAG(Kpic)
544 if test $ac_cv_prog_cc_Kpic = yes; then
548 if test x$PICFLAG = x; then
549 AC_PROG_CC_FLAG(KPIC)
550 if test $ac_cv_prog_cc_KPIC = yes; then
557 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
558 AC_TRY_RUN([#include <stdio.h>
559 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
560 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
561 if test x"$samba_cv_have_longlong" = x"yes"; then
562 AC_DEFINE(HAVE_LONGLONG)
566 # Check if the compiler supports the LL prefix on long long integers.
569 AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
570 AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
571 samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
572 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
573 AC_DEFINE(COMPILER_SUPPORTS_LL)
577 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
578 AC_TRY_RUN([#include <stdio.h>
579 #include <sys/stat.h>
580 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
581 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
582 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
583 AC_DEFINE(SIZEOF_OFF_T,8)
586 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
588 #if defined(HAVE_UNISTD_H)
592 #include <sys/stat.h>
593 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
594 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
595 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
596 AC_DEFINE(HAVE_OFF64_T)
599 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
600 AC_TRY_RUN([#include <stdio.h>
601 #include <sys/stat.h>
602 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
603 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
604 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
605 AC_DEFINE(SIZEOF_INO_T,8)
608 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
610 #if defined(HAVE_UNISTD_H)
614 #include <sys/stat.h>
615 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
616 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
617 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
618 AC_DEFINE(HAVE_INO64_T)
621 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
623 #if defined(HAVE_UNISTD_H)
626 #include <sys/types.h>
627 #include <dirent.h>],
628 [struct dirent64 de;],
629 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
630 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
631 AC_DEFINE(HAVE_STRUCT_DIRENT64)
634 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
635 AC_TRY_RUN([#include <stdio.h>
636 main() { char c; c=250; exit((c > 0)?0:1); }],
637 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
638 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
639 AC_DEFINE(HAVE_UNSIGNED_CHAR)
642 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
643 AC_TRY_COMPILE([#include <sys/types.h>
644 #include <sys/socket.h>
645 #include <netinet/in.h>],
646 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
647 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
648 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
649 AC_DEFINE(HAVE_SOCK_SIN_LEN)
652 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
653 AC_TRY_COMPILE([#include <sys/types.h>
655 void seekdir(DIR *d, long loc) { return; }],[return 0;],
656 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
657 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
658 AC_DEFINE(SEEKDIR_RETURNS_VOID)
661 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
662 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
663 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
664 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
665 AC_DEFINE(HAVE_FILE_MACRO)
668 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
669 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
670 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
671 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
672 AC_DEFINE(HAVE_FUNCTION_MACRO)
675 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
677 #include <sys/time.h>
679 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
680 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
681 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
682 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
686 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
687 AC_TRY_RUN([#include <sys/types.h>
689 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
690 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
691 di->d_name[0] == 0) exit(0); exit(1);} ],
692 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
693 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
694 AC_DEFINE(HAVE_BROKEN_READDIR)
697 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
698 AC_TRY_COMPILE([#include <sys/types.h>
700 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
701 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
702 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
703 AC_DEFINE(HAVE_UTIMBUF)
706 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
707 AC_TRY_COMPILE([#include <utmpx.h>],
708 [struct utmpx ux; ux.ut_syslen = 0;],
709 samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
710 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
711 AC_DEFINE(HAVE_UX_UT_SYSLEN)
714 AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
716 #include <sys/types.h>
719 #define F_GETLEASE 1025
722 int fd = open("/dev/null", O_RDONLY);
723 return fcntl(fd, F_GETLEASE, 0) == -1;
726 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
727 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
728 AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX)
731 AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
733 #include <sys/types.h>
737 #define F_NOTIFY 1026
740 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
743 samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
744 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
745 AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY)
748 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
750 #include <sys/types.h>
753 #include <sys/file.h>
759 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
762 samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
763 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
764 AC_DEFINE(HAVE_KERNEL_SHARE_MODES)
770 AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
771 AC_TRY_COMPILE([#include <sys/types.h>
773 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
774 samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
775 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
776 AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX)
779 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
780 AC_TRY_RUN([#include <sys/types.h>
781 #include <sys/capability.h>
784 if ((cap = cap_get_proc()) == NULL)
786 cap->cap_effective |= CAP_NETWORK_MGT;
787 cap->cap_inheritable |= CAP_NETWORK_MGT;
792 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
793 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
794 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
798 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
799 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
802 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
803 AC_TRY_COMPILE([#include <sys/types.h>
804 #if defined(HAVE_RPC_RPC_H)
808 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
809 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
810 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
813 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
814 AC_TRY_COMPILE([#include <sys/types.h>
815 #if defined(HAVE_RPC_RPC_H)
819 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
820 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
821 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
824 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
825 AC_TRY_COMPILE([#include <sys/types.h>
826 #if defined(HAVE_RPC_RPC_H)
830 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
831 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
832 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
835 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
836 AC_TRY_COMPILE([#include <sys/types.h>
837 #if defined(HAVE_RPC_RPC_H)
841 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
842 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
843 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
847 dnl Some systems (SCO) have a problem including
848 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
849 dnl as a #define in <prot.h> and as part of an enum
853 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
854 AC_TRY_COMPILE([#include <sys/types.h>
855 #ifdef HAVE_SYS_SECURITY_H
856 #include <sys/security.h>
858 #endif /* HAVE_SYS_SECURITY_H */
859 #if defined(HAVE_RPC_RPC_H)
863 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
864 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
865 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
868 AC_MSG_CHECKING([for test routines])
869 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
871 AC_MSG_ERROR([cant find test code. Aborting config]),
872 AC_MSG_WARN([cannot run when cross-compiling]))
874 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
875 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
876 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
877 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
878 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
881 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
882 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
883 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
884 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
885 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
888 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
889 SAVE_CPPFLAGS="$CPPFLAGS"
890 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
892 #define REPLACE_GETPASS 1
893 #define NO_CONFIG_H 1
894 #define main dont_declare_main
895 #include "${srcdir-.}/lib/getsmbpass.c"
897 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
898 CPPFLAGS="$SAVE_CPPFLAGS"
900 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
901 AC_DEFINE(REPLACE_GETPASS)
904 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
907 #include <sys/types.h>
908 #include <netinet/in.h>
909 #ifdef HAVE_ARPA_INET_H
910 #include <arpa/inet.h>
912 main() { struct in_addr ip; ip.s_addr = 0x12345678;
913 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
914 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
916 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
917 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
918 AC_DEFINE(REPLACE_INET_NTOA)
921 AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
922 AC_TRY_RUN([#include <unistd.h>
923 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
924 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
925 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
926 AC_DEFINE(SYSCONF_SC_NGROUPS_MAX)
929 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
930 AC_TRY_RUN([main() { exit(getuid() != 0); }],
931 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
932 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
935 AC_MSG_WARN(running as non-root will disable some tests)
939 # look for a method of finding the list of network interfaces
941 AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
943 #define HAVE_IFACE_AIX 1
944 #define AUTOCONF_TEST 1
945 #include "confdefs.h"
946 #include "${srcdir-.}/lib/interfaces.c"],
947 samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
948 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
949 iface=yes;AC_DEFINE(HAVE_IFACE_AIX)
952 if test $iface = no; then
953 AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
955 #define HAVE_IFACE_IFCONF 1
956 #define AUTOCONF_TEST 1
957 #include "confdefs.h"
958 #include "${srcdir-.}/lib/interfaces.c"],
959 samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
960 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
961 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF)
965 if test $iface = no; then
966 AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
968 #define HAVE_IFACE_IFREQ 1
969 #define AUTOCONF_TEST 1
970 #include "confdefs.h"
971 #include "${srcdir-.}/lib/interfaces.c"],
972 samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
973 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
974 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ)
979 ################################################
980 # look for a method of setting the effective uid
982 if test $seteuid = no; then
983 AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
985 #define AUTOCONF_TEST 1
986 #define USE_SETRESUID 1
987 #include "confdefs.h"
988 #include "${srcdir-.}/lib/util_sec.c"],
989 samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
990 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
991 seteuid=yes;AC_DEFINE(USE_SETRESUID)
996 if test $seteuid = no; then
997 AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
999 #define AUTOCONF_TEST 1
1000 #define USE_SETREUID 1
1001 #include "confdefs.h"
1002 #include "${srcdir-.}/lib/util_sec.c"],
1003 samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
1004 if test x"$samba_cv_USE_SETREUID" = x"yes"; then
1005 seteuid=yes;AC_DEFINE(USE_SETREUID)
1009 if test $seteuid = no; then
1010 AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
1012 #define AUTOCONF_TEST 1
1013 #define USE_SETEUID 1
1014 #include "confdefs.h"
1015 #include "${srcdir-.}/lib/util_sec.c"],
1016 samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
1017 if test x"$samba_cv_USE_SETEUID" = x"yes"; then
1018 seteuid=yes;AC_DEFINE(USE_SETEUID)
1022 if test $seteuid = no; then
1023 AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
1025 #define AUTOCONF_TEST 1
1026 #define USE_SETUIDX 1
1027 #include "confdefs.h"
1028 #include "${srcdir-.}/lib/util_sec.c"],
1029 samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
1030 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
1031 seteuid=yes;AC_DEFINE(USE_SETUIDX)
1036 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
1037 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
1038 samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
1039 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
1040 AC_DEFINE(HAVE_MMAP)
1043 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
1044 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
1045 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
1046 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
1047 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
1050 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
1051 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
1052 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
1053 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
1054 AC_DEFINE(HAVE_FCNTL_LOCK)
1057 AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
1058 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
1059 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
1060 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
1061 AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS)
1066 dnl Don't check for 64 bit fcntl locking if we know that the
1067 dnl glibc2.1 broken check has succeeded.
1070 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
1072 #if defined(HAVE_UNISTD_H)
1082 #ifdef HAVE_SYS_FCNTL_H
1083 #include <sys/fcntl.h>
1085 main() { struct flock64 fl64;
1086 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
1092 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
1094 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
1095 AC_DEFINE(HAVE_STRUCT_FLOCK64)
1099 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
1100 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
1101 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
1102 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
1103 AC_DEFINE(HAVE_TRUNCATED_SALT)
1106 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
1107 AC_TRY_COMPILE([#include <sys/acl.h>
1108 #if defined(HAVE_RPCSVC_NIS_H)
1109 #include <rpcsvc/nis.h>
1112 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
1113 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
1114 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
1118 #################################################
1119 # check for smbwrapper support
1120 AC_MSG_CHECKING(whether to use smbwrapper)
1121 AC_ARG_WITH(smbwrapper,
1122 [ --with-smbwrapper Include SMB wrapper support
1123 --without-smbwrapper Don't include SMB wrapper support (default)],
1124 [ case "$withval" in
1127 AC_DEFINE(WITH_SMBWRAPPER)
1128 WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
1130 if test x$ATTEMPT_WRAP32_BUILD = x; then
1133 WRAP32=bin/smbwrapper.32.$SHLIBEXT
1136 # Conditions under which smbwrapper should not be built.
1138 if test x$PICFLAG = x; then
1139 echo No support for PIC code - disabling smbwrapper and smbsh
1142 elif test x$ac_cv_func_syscall = xno; then
1143 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
1155 #################################################
1156 # check for the AFS filesystem
1157 AC_MSG_CHECKING(whether to use AFS)
1159 [ --with-afs Include AFS support
1160 --without-afs Don't include AFS support (default)],
1161 [ case "$withval" in
1174 #################################################
1175 # check for the DFS auth system
1176 AC_MSG_CHECKING(whether to use DFS auth)
1178 [ --with-dfs Include DFS support
1179 --without-dfs Don't include DFS support (default)],
1180 [ case "$withval" in
1192 #################################################
1193 # check for Kerberos IV auth system
1194 AC_MSG_CHECKING(whether to use Kerberos IV)
1196 [ --with-krb4=base-dir Include Kerberos IV support
1197 --without-krb4 Don't include Kerberos IV support (default)],
1198 [ AC_MSG_RESULT(yes)
1199 AC_DEFINE(KRB4_AUTH)
1200 AC_CHECK_LIB(resolv, dn_expand)
1201 LIBS="$LIBS -lkrb -ldes"
1202 CFLAGS="$CFLAGS -I$withval/include"
1203 LDFLAGS="$LDFLAGS -L$withval/lib"],
1207 #################################################
1208 # check for Kerberos 5 auth system
1209 AC_MSG_CHECKING(whether to use Kerberos 5)
1211 [ --with-krb5=base-dir Include Kerberos 5 support
1212 --without-krb5 Don't include Kerberos 5 support (default)],
1213 [ AC_MSG_RESULT(yes)
1214 AC_DEFINE(KRB5_AUTH)
1215 LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
1216 CFLAGS="$CFLAGS -I$withval/include"
1217 LDFLAGS="$LDFLAGS -L$withval/lib"],
1221 #################################################
1222 # check for automount support
1223 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1224 AC_ARG_WITH(automount,
1225 [ --with-automount Include AUTOMOUNT support
1226 --without-automount Don't include AUTOMOUNT support (default)],
1227 [ case "$withval" in
1230 AC_DEFINE(WITH_AUTOMOUNT)
1239 #################################################
1240 # check for smbmount support
1241 AC_MSG_CHECKING(whether to use SMBMOUNT)
1242 AC_ARG_WITH(smbmount,
1243 [ --with-smbmount Include SMBMOUNT (Linux only) support
1244 --without-smbmount Don't include SMBMOUNT support (default)],
1245 [ case "$withval" in
1248 AC_DEFINE(WITH_SMBMOUNT)
1249 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1261 #################################################
1262 # check for a PAM password database
1263 AC_MSG_CHECKING(whether to use PAM password database)
1265 [ --with-pam Include PAM password database support
1266 --without-pam Don't include PAM password database support (default)],
1267 [ case "$withval" in
1281 #################################################
1282 # check for a LDAP password database
1283 AC_MSG_CHECKING(whether to use LDAP password database)
1285 [ --with-ldap Include LDAP support
1286 --without-ldap Don't include LDAP support (default)],
1287 [ case "$withval" in
1290 AC_DEFINE(WITH_LDAP)
1291 AC_MSG_ERROR([LDAP password database not supported in this version.])
1300 #################################################
1301 # check for a NISPLUS password database
1302 AC_MSG_CHECKING(whether to use NISPLUS password database)
1303 AC_ARG_WITH(nisplus,
1304 [ --with-nisplus Include NISPLUS password database support
1305 --without-nisplus Don't include NISPLUS password database support (default)],
1306 [ case "$withval" in
1309 AC_DEFINE(WITH_NISPLUS)
1318 #################################################
1319 # check for a NISPLUS_HOME support
1320 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1321 AC_ARG_WITH(nisplus-home,
1322 [ --with-nisplus-home Include NISPLUS_HOME support
1323 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
1324 [ case "$withval" in
1327 AC_DEFINE(WITH_NISPLUS_HOME)
1336 #################################################
1337 # check for the secure socket layer
1338 AC_MSG_CHECKING(whether to use SSL)
1340 [ --with-ssl Include SSL support
1341 --without-ssl Don't include SSL support (default)
1342 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
1343 [ case "$withval" in
1347 withval="/usr/local/ssl" # default
1349 if test "${with_sslinc+set}" = set; then
1351 withval="$with_sslinc"
1354 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
1355 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1356 LIBS="-lssl -lcrypto $LIBS"
1357 LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
1360 CFLAGS="-I${withval}/include $CFLAGS"
1361 LIBS="-lssl -lcrypto $LIBS"
1362 LDFLAGS="-L${withval}/lib $LDFLAGS"
1368 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1369 LIBS="-lssl -lcrypto $LIBS"
1370 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
1374 if test ! -d ${withval}; then
1375 echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
1379 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
1389 #################################################
1390 # check for syslog logging
1391 AC_MSG_CHECKING(whether to use syslog logging)
1393 [ --with-syslog Include experimental SYSLOG support
1394 --without-syslog Don't include SYSLOG support (default)],
1395 [ case "$withval" in
1398 AC_DEFINE(WITH_SYSLOG)
1407 #################################################
1408 # check for a shared memory profiling support
1409 AC_MSG_CHECKING(whether to use profiling)
1410 AC_ARG_WITH(profile,
1411 [ --with-profile Include profile support
1412 --without-profile Don't include profile support (default)],
1413 [ case "$withval" in
1416 AC_DEFINE(WITH_PROFILE)
1426 #################################################
1427 # check for experimental netatalk resource fork support
1428 AC_MSG_CHECKING(whether to support netatalk)
1429 AC_ARG_WITH(netatalk,
1430 [ --with-netatalk Include experimental Netatalk support
1431 --without-netatalk Don't include experimental Netatalk support (default)],
1432 [ case "$withval" in
1435 AC_DEFINE(WITH_NETATALK)
1444 #################################################
1445 # check for experimental disk-quotas support
1446 QUOTAOBJS=smbd/noquotas.o
1448 AC_MSG_CHECKING(whether to support disk-quotas)
1450 [ --with-quotas Include experimental disk-quota support
1451 --without-quotas Don't include experimental disk-quota support (default)],
1452 [ case "$withval" in
1455 QUOTAOBJS=smbd/quotas.o
1465 #################################################
1466 # check for experimental utmp accounting
1468 AC_MSG_CHECKING(whether to support utmp accounting)
1470 [ --with-utmp Include experimental utmp accounting
1471 --without-utmp Don't include experimental utmp accounting (default)],
1472 [ case "$withval" in
1475 AC_DEFINE(WITH_UTMP)
1484 #################################################
1485 # check for MS Dfs support
1487 AC_MSG_CHECKING(whether to support Microsoft Dfs)
1489 [ --with-msdfs Include MS Dfs support
1490 --without-msdfs Don't include MS Dfs support (default)],
1491 [ case "$withval" in
1494 AC_DEFINE(WITH_MSDFS)
1503 #################################################
1504 # set private directory location
1505 AC_ARG_WITH(privatedir,
1506 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
1507 [ case "$withval" in
1510 # Just in case anybody calls it without argument
1512 AC_MSG_WARN([--with-privatedir called without argument - will use default])
1513 privatedir='${prefix}/private'
1516 privatedir="$withval"
1519 AC_SUBST(privatedir)],
1520 [privatedir='${prefix}/private'
1521 AC_SUBST(privatedir)]
1524 #################################################
1525 # set lock directory location
1526 AC_ARG_WITH(lockdir,
1527 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
1528 [ case "$withval" in
1531 # Just in case anybody calls it without argument
1533 AC_MSG_WARN([--with-lockdir called without argument - will use default])
1534 lockdir='$(VARDIR)/locks'
1541 [lockdir='$(VARDIR)/locks'
1545 #################################################
1546 # set SWAT directory location
1547 AC_ARG_WITH(swatdir,
1548 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
1549 [ case "$withval" in
1552 # Just in case anybody does it
1554 AC_MSG_WARN([--with-swatdir called without argument - will use default])
1555 swatdir='${prefix}/swat'
1562 [swatdir='${prefix}/swat'
1566 #################################################
1567 # these tests are taken from the GNU fileutils package
1568 AC_CHECKING(how to get filesystem space usage)
1571 # Test for statvfs64.
1572 if test $space = no; then
1574 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
1576 #if defined(HAVE_UNISTD_H)
1579 #include <sys/types.h>
1580 #include <sys/statvfs.h>
1583 struct statvfs64 fsd;
1584 exit (statvfs64 (".", &fsd));
1586 fu_cv_sys_stat_statvfs64=yes,
1587 fu_cv_sys_stat_statvfs64=no,
1588 fu_cv_sys_stat_statvfs64=cross)])
1589 if test $fu_cv_sys_stat_statvfs64 = yes; then
1591 AC_DEFINE(STAT_STATVFS64)
1595 # Perform only the link test since it seems there are no variants of the
1596 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
1597 # because that got a false positive on SCO OSR5. Adding the declaration
1598 # of a `struct statvfs' causes this test to fail (as it should) on such
1599 # systems. That system is reported to work fine with STAT_STATFS4 which
1600 # is what it gets when this test fails.
1601 if test $space = no; then
1603 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
1604 [AC_TRY_LINK([#include <sys/types.h>
1605 #include <sys/statvfs.h>],
1606 [struct statvfs fsd; statvfs (0, &fsd);],
1607 fu_cv_sys_stat_statvfs=yes,
1608 fu_cv_sys_stat_statvfs=no)])
1609 if test $fu_cv_sys_stat_statvfs = yes; then
1611 AC_DEFINE(STAT_STATVFS)
1615 if test $space = no; then
1616 # DEC Alpha running OSF/1
1617 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
1618 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
1620 #include <sys/param.h>
1621 #include <sys/types.h>
1622 #include <sys/mount.h>
1627 exit (statfs (".", &fsd, sizeof (struct statfs)));
1629 fu_cv_sys_stat_statfs3_osf1=yes,
1630 fu_cv_sys_stat_statfs3_osf1=no,
1631 fu_cv_sys_stat_statfs3_osf1=no)])
1632 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
1633 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
1635 AC_DEFINE(STAT_STATFS3_OSF1)
1639 if test $space = no; then
1641 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
1642 member (AIX, 4.3BSD)])
1643 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
1645 #ifdef HAVE_SYS_PARAM_H
1646 #include <sys/param.h>
1648 #ifdef HAVE_SYS_MOUNT_H
1649 #include <sys/mount.h>
1651 #ifdef HAVE_SYS_VFS_H
1652 #include <sys/vfs.h>
1658 exit (statfs (".", &fsd));
1660 fu_cv_sys_stat_statfs2_bsize=yes,
1661 fu_cv_sys_stat_statfs2_bsize=no,
1662 fu_cv_sys_stat_statfs2_bsize=no)])
1663 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
1664 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
1666 AC_DEFINE(STAT_STATFS2_BSIZE)
1670 if test $space = no; then
1672 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
1673 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
1674 [AC_TRY_RUN([#include <sys/types.h>
1675 #include <sys/statfs.h>
1679 exit (statfs (".", &fsd, sizeof fsd, 0));
1681 fu_cv_sys_stat_statfs4=yes,
1682 fu_cv_sys_stat_statfs4=no,
1683 fu_cv_sys_stat_statfs4=no)])
1684 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
1685 if test $fu_cv_sys_stat_statfs4 = yes; then
1687 AC_DEFINE(STAT_STATFS4)
1691 if test $space = no; then
1693 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
1694 member (4.4BSD and NetBSD)])
1695 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
1696 [AC_TRY_RUN([#include <sys/types.h>
1697 #ifdef HAVE_SYS_PARAM_H
1698 #include <sys/param.h>
1700 #ifdef HAVE_SYS_MOUNT_H
1701 #include <sys/mount.h>
1707 exit (statfs (".", &fsd));
1709 fu_cv_sys_stat_statfs2_fsize=yes,
1710 fu_cv_sys_stat_statfs2_fsize=no,
1711 fu_cv_sys_stat_statfs2_fsize=no)])
1712 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
1713 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
1715 AC_DEFINE(STAT_STATFS2_FSIZE)
1719 if test $space = no; then
1721 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
1722 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
1723 [AC_TRY_RUN([#include <sys/types.h>
1724 #ifdef HAVE_SYS_PARAM_H
1725 #include <sys/param.h>
1727 #ifdef HAVE_SYS_MOUNT_H
1728 #include <sys/mount.h>
1730 #ifdef HAVE_SYS_FS_TYPES_H
1731 #include <sys/fs_types.h>
1736 /* Ultrix's statfs returns 1 for success,
1737 0 for not mounted, -1 for failure. */
1738 exit (statfs (".", &fsd) != 1);
1740 fu_cv_sys_stat_fs_data=yes,
1741 fu_cv_sys_stat_fs_data=no,
1742 fu_cv_sys_stat_fs_data=no)])
1743 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
1744 if test $fu_cv_sys_stat_fs_data = yes; then
1746 AC_DEFINE(STAT_STATFS2_FS_DATA)
1751 # As a gating factor for large file support, in order to
1752 # use <4GB files we must have the following minimal support
1754 # long long, and a 64 bit off_t or off64_t.
1755 # If we don't have all of these then disable large
1758 echo "checking if large file support can be enabled"
1760 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
1761 #include <sys/types.h>
1767 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
1768 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
1770 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
1775 echo "checking configure summary"
1776 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
1777 echo "configure OK";,
1778 AC_MSG_ERROR([summary failure. Aborting config]),:)
1783 AC_OUTPUT(include/stamp-h Makefile)