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.
17 # compile with optimisation and without debugging by default
20 dnl Checks for programs.
25 dnl Check if C compiler understands -c and -o at the same time
27 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
34 dnl Check if the C compiler understands volatile (it should, being ANSI).
35 AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
36 AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
37 samba_cv_volatile=yes,samba_cv_volatile=no)])
38 if test x"$samba_cv_volatile" = x"yes"; then
39 AC_DEFINE(HAVE_VOLATILE)
45 AC_VALIDATE_CACHE_SYSTEM_TYPE
49 # Config CPPFLAG settings for strange OS's that must be set
53 # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
56 if test $ac_cv_prog_cc_Ae = yes; then
57 CPPFLAGS="$CPPFLAGS -Ae"
60 # Defines needed for HPUX support.
61 # HPUX has bigcrypt but (sometimes?) doesn't use it for
62 # password hashing - hence the USE_BOTH_CRYPT_CALLS define.
66 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE"
67 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
70 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE"
71 AC_DEFINE(USE_BOTH_CRYPT_CALLS)
76 # AIX4.x doesn't even admit to having large
77 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
80 AC_MSG_RESULT([enabling large file support])
81 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
84 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
85 # to the existance of large files..
86 # Note that -D_LARGEFILE64_SOURCE is different from the Sun
87 # recommendations on large file support, however it makes the
88 # compile work using gcc 2.7 and 2.8, whereas using the Sun
89 # recommendation makes the compile fail on gcc2.7. JRA.
94 AC_MSG_RESULT([enabling large file support])
95 if test "$ac_cv_prog_gcc" = yes; then
96 ${CC-cc} -v >conftest.c 2>&1
97 ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
99 case "$ac_cv_gcc_compiler_version_number" in
100 *"gcc version 2.6"*|*"gcc version 2.7"*)
101 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
104 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
108 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
114 # Tests needed for SINIX large file support.
117 if test $host = mips-sni-sysv4 ; then
118 AC_MSG_CHECKING([for LFS support])
119 old_CPPFLAGS="$CPPFLAGS"
120 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
124 #if _LFS64_LARGEFILE == 1
129 }], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
130 CPPFLAGS="$old_CPPFLAGS"
131 if test x$SINIX_LFS_SUPPORT = xyes ; then
132 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
133 CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
134 LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
135 LIBS="`getconf LFS64_LIBS` $LIBS"
137 AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
142 # Tests needed for glibc 2.1 large file support.
145 AC_MSG_CHECKING([for LFS support])
146 old_CPPFLAGS="$CPPFLAGS"
147 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
151 #if _LFS64_LARGEFILE == 1
156 }], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
157 CPPFLAGS="$old_CPPFLAGS"
158 if test x$GLIBC_LFS_SUPPORT = xyes ; then
159 CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
161 AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
171 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
172 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
173 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
174 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
175 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
176 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
177 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
179 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
180 # This causes configure to fail to detect it. Check for shadow separately on HPUX.
184 AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
185 ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
186 if test x"$ac_cv_header_shadow_h" = x"yes"; then
187 AC_DEFINE(HAVE_SHADOW_H)
191 AC_CHECK_HEADERS(shadow.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
192 AC_CHECK_HEADERS(sys/security.h security/pam_appl.h)
193 AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
194 AC_CHECK_HEADERS(readline/history.h sys/capability.h syscall.h sys/syscall.h)
195 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
197 AC_CHECK_SIZEOF(int,cross)
198 AC_CHECK_SIZEOF(long,cross)
199 AC_CHECK_SIZEOF(short,cross)
214 AC_CHECK_TYPE(ino_t,unsigned)
215 AC_CHECK_TYPE(loff_t,off_t)
216 AC_CHECK_TYPE(offset_t,loff_t)
217 AC_CHECK_TYPE(ssize_t, int)
219 # we need libdl for PAM and the new VFS code
220 AC_CHECK_LIB(dl,main)
222 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
224 #include <sys/types.h>
229 #include <signal.h>],[sig_atomic_t i = 0],
230 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
231 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
232 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
235 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
236 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
237 samba_cv_errno=yes,samba_cv_have_errno=no)])
238 if test x"$samba_cv_errno" = x"yes"; then
239 AC_DEFINE(HAVE_ERRNO_DECL)
242 # stupid glibc has the functions but no declaration. grrrr.
243 AC_CACHE_CHECK([for setresuid declaration],samba_cv_have_setresuid_decl,[
244 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresuid],
245 samba_cv_have_setresuid_decl=yes,samba_cv_have_setresuid_decl=no)])
246 if test x"$samba_cv_have_setresuid_decl" = x"yes"; then
247 AC_DEFINE(HAVE_SETRESUID_DECL)
250 # stupid glibc has the functions but no declaration. grrrr.
251 AC_CACHE_CHECK([for setresgid declaration],samba_cv_have_setresgid_decl,[
252 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresgid],
253 samba_cv_have_setresgid_decl=yes,samba_cv_have_setresgid_decl=no)])
254 if test x"$samba_cv_have_setresgid_decl" = x"yes"; then
255 AC_DEFINE(HAVE_SETRESGID_DECL)
258 # stupid glibc has the functions but no declaration. grrrr.
259 AC_CACHE_CHECK([for crypt declaration],samba_cv_have_crypt_decl,[
260 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)crypt],
261 samba_cv_have_crypt_decl=yes,samba_cv_have_crypt_decl=no)])
262 if test x"$samba_cv_have_crypt_decl" = x"yes"; then
263 AC_DEFINE(HAVE_CRYPT_DECL)
266 # and glibc has setresuid under linux but the function does
267 # nothing until kernel 2.1.44! very dumb.
268 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
269 AC_TRY_RUN([#include <errno.h>
270 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
271 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
272 if test x"$samba_cv_have_setresuid" = x"yes"; then
273 AC_DEFINE(HAVE_SETRESUID)
276 # Do the same check for setresguid...
278 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
279 AC_TRY_RUN([#include <unistd.h>
281 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
282 samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
283 if test x"$samba_cv_have_setresgid" = x"yes"; then
284 AC_DEFINE(HAVE_SETRESGID)
289 ###############################################
290 # test for where we get crypt() from
291 AC_CHECK_FUNCS(crypt)
292 if test x"$ac_cv_func_crypt" = x"no"; then
293 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
294 AC_DEFINE(HAVE_CRYPT)])
298 ###############################################
299 # test for where we get readline() from
300 if test "$ac_cv_header_readline_h" = "yes" ||
301 test "$ac_cv_header_readline_readline_h" = "yes"; then
302 AC_CHECK_LIB(readline,readline)
306 # The following test taken from the cvs sources
307 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
308 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
309 # libsocket.so which has a bad implementation of gethostbyname (it
310 # only looks in /etc/hosts), so we only look for -lsocket if we need
312 AC_CHECK_FUNCS(connect)
313 if test x"$ac_cv_func_connect" = x"no"; then
316 *) AC_CHECK_LIB(nsl_s, printf) ;;
320 *) AC_CHECK_LIB(nsl, printf) ;;
324 *) AC_CHECK_LIB(socket, connect) ;;
328 *) AC_CHECK_LIB(inet, connect) ;;
330 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
332 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
333 test x"$ac_cv_lib_inet_connect" = x"yes"; then
334 # ac_cv_func_connect=yes
335 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
336 AC_DEFINE(HAVE_CONNECT)
340 # Check if we have execl, if not we need to compile smbrun.
341 AC_CHECK_FUNCS(execl)
342 if test x"$ac_cv_func_execl" = x"no"; then
348 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod chroot)
349 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
350 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
351 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
352 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf setreuid setregid seteuid setegid)
353 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate stat64 fstat64)
354 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
355 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid yp_get_default_domain getpwanam)
356 AC_CHECK_FUNCS(srandom random srand rand setenv usleep mmap64 strcasecmp)
358 # syscall() is needed for smbwrapper.
359 AC_CHECK_FUNCS(syscall)
361 AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
362 AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
363 AC_CHECK_FUNCS(__getcwd _getcwd)
364 AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
365 AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
366 AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
367 AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
368 AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
369 AC_CHECK_FUNCS(_write __write _fork __fork)
370 AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
371 AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
372 AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
373 AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
374 AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
377 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
380 if test x$ac_cv_func_stat64 = xno ; then
381 AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
383 #if defined(HAVE_UNISTD_H)
386 #include <sys/stat.h>
387 ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
388 AC_MSG_RESULT([$ac_cv_func_stat64])
389 if test x$ac_cv_func_stat64 = xyes ; then
390 AC_DEFINE(HAVE_STAT64)
394 if test x$ac_cv_func_lstat64 = xno ; then
395 AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
397 #if defined(HAVE_UNISTD_H)
400 #include <sys/stat.h>
401 ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
402 AC_MSG_RESULT([$ac_cv_func_lstat64])
403 if test x$ac_cv_func_lstat64 = xyes ; then
404 AC_DEFINE(HAVE_LSTAT64)
408 if test x$ac_cv_func_fstat64 = xno ; then
409 AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
411 #if defined(HAVE_UNISTD_H)
414 #include <sys/stat.h>
415 ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
416 AC_MSG_RESULT([$ac_cv_func_fstat64])
417 if test x$ac_cv_func_fstat64 = xyes ; then
418 AC_DEFINE(HAVE_FSTAT64)
423 # If no strcasecmp, check for it in some known places
424 # It is in -lresolv on ReliantUNIX and UnixWare
425 # -lresolve *must* follow -lnsl for name resolution to work properly
428 if test x$ac_cv_func_strcasecmp = xno ; then
429 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
430 AC_DEFINE(HAVE_STRCASECMP))
434 # Check for the functions putprpwnam, set_auth_parameters,
435 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
436 # Needed for OSF1 and HPUX.
439 AC_LIBTESTFUNC(security, putprpwnam)
440 AC_LIBTESTFUNC(sec, putprpwnam)
442 AC_LIBTESTFUNC(security, set_auth_parameters)
443 AC_LIBTESTFUNC(sec, set_auth_parameters)
445 AC_LIBTESTFUNC(security, getspnam)
446 AC_LIBTESTFUNC(sec, getspnam)
448 AC_LIBTESTFUNC(security, bigcrypt)
449 AC_LIBTESTFUNC(sec, bigcrypt)
451 AC_LIBTESTFUNC(security, getprpwnam)
452 AC_LIBTESTFUNC(sec, getprpwnam)
454 # this bit needs to be modified for each OS that is suported by
455 # smbwrapper. You need to specify how to created a shared library and
456 # how to compile C code to produce PIC object files
458 # these are the defaults, good for lots of systems
462 # and these are for particular systems
464 *linux*) AC_DEFINE(LINUX);;
465 *solaris*) AC_DEFINE(SUNOS5)
468 *sunos*) AC_DEFINE(SUNOS4)
471 *bsd*) LDSHFLAGS="-shared -Bshareable"
473 *irix*) AC_DEFINE(IRIX)
475 *irix6*) AC_DEFINE(IRIX6)
478 ATTEMPT_WRAP32_BUILD=yes
480 *aix*) AC_DEFINE(AIX);;
481 *hpux*) AC_DEFINE(HPUX);;
482 *qnx*) AC_DEFINE(QNX);;
483 *osf*) AC_DEFINE(OSF1);;
484 *sco*) AC_DEFINE(SCO);;
485 *next2*) AC_DEFINE(NEXT2);;
486 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
489 *-univel-*) if [ test "$GCC" != yes ]; then
490 AC_DEFINE(HAVE_MEMSET)
494 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
498 if [ test "$GCC" != yes ]; then
499 AC_DEFINE(HAVE_MEMSET)
505 # try to work out how to produce pic code with this compiler
507 AC_PROG_CC_FLAG(fpic)
508 if test $ac_cv_prog_cc_fpic = yes; then
511 if test x$PICFLAG = x; then
512 AC_PROG_CC_FLAG(Kpic)
513 if test $ac_cv_prog_cc_Kpic = yes; then
517 if test x$PICFLAG = x; then
518 AC_PROG_CC_FLAG(KPIC)
519 if test $ac_cv_prog_cc_KPIC = yes; then
526 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
527 AC_TRY_RUN([#include <stdio.h>
528 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
529 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
530 if test x"$samba_cv_have_longlong" = x"yes"; then
531 AC_DEFINE(HAVE_LONGLONG)
534 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
535 AC_TRY_RUN([#include <stdio.h>
536 #include <sys/stat.h>
537 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
538 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
539 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
540 AC_DEFINE(SIZEOF_OFF_T,8)
543 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
545 #if defined(HAVE_UNISTD_H)
549 #include <sys/stat.h>
550 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
551 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
552 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
553 AC_DEFINE(HAVE_OFF64_T)
556 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
557 AC_TRY_RUN([#include <stdio.h>
558 #include <sys/stat.h>
559 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
560 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
561 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
562 AC_DEFINE(SIZEOF_INO_T,8)
565 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
567 #if defined(HAVE_UNISTD_H)
571 #include <sys/stat.h>
572 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
573 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
574 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
575 AC_DEFINE(HAVE_INO64_T)
578 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
580 #if defined(HAVE_UNISTD_H)
583 #include <sys/types.h>
584 #include <dirent.h>],
585 [struct dirent64 de;],
586 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
587 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
588 AC_DEFINE(HAVE_STRUCT_DIRENT64)
591 AC_CACHE_CHECK([for union semun],samba_cv_HAVE_UNION_SEMUN,[
593 #include <sys/types.h>
596 main() { union semun ss; exit(0); }],
597 samba_cv_HAVE_UNION_SEMUN=yes,samba_cv_HAVE_UNION_SEMUN=no,samba_cv_HAVE_UNION_SEMUN=cross)])
598 if test x"$samba_cv_HAVE_UNION_SEMUN" = x"yes"; then
599 AC_DEFINE(HAVE_UNION_SEMUN)
602 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
603 AC_TRY_RUN([#include <stdio.h>
604 main() { char c; c=250; exit((c > 0)?0:1); }],
605 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
606 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
607 AC_DEFINE(HAVE_UNSIGNED_CHAR)
610 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
611 AC_TRY_COMPILE([#include <sys/types.h>
612 #include <sys/socket.h>
613 #include <netinet/in.h>],
614 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
615 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
616 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
617 AC_DEFINE(HAVE_SOCK_SIN_LEN)
620 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
621 AC_TRY_COMPILE([#include <sys/types.h>
623 void seekdir(DIR *d, long loc) { return; }],[return 0;],
624 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
625 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
626 AC_DEFINE(SEEKDIR_RETURNS_VOID)
629 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
630 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
631 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
632 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
633 AC_DEFINE(HAVE_FILE_MACRO)
636 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
637 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
638 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
639 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
640 AC_DEFINE(HAVE_FUNCTION_MACRO)
643 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
645 #include <sys/time.h>
647 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
648 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
649 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
650 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
654 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
655 AC_TRY_RUN([#include <sys/types.h>
657 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
658 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
659 di->d_name[0] == 0) exit(0); exit(1);} ],
660 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
661 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
662 AC_DEFINE(HAVE_BROKEN_READDIR)
665 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
666 AC_TRY_COMPILE([#include <sys/types.h>
668 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
669 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
670 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
671 AC_DEFINE(HAVE_UTIMBUF)
674 AC_CACHE_CHECK([for kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS,[
675 AC_TRY_COMPILE([#include <sys/types.h>
677 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
678 samba_cv_HAVE_KERNEL_OPLOCKS=yes,samba_cv_HAVE_KERNEL_OPLOCKS=no)])
679 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then
680 AC_DEFINE(HAVE_KERNEL_OPLOCKS)
683 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
684 AC_TRY_RUN([#include <sys/types.h>
685 #include <sys/capability.h>
688 if ((cap = cap_get_proc()) == NULL)
690 cap->cap_effective |= CAP_NETWORK_MGT;
691 cap->cap_inheritable |= CAP_NETWORK_MGT;
696 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
697 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
698 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
702 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
703 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
706 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
707 AC_TRY_COMPILE([#include <sys/types.h>
708 #if defined(HAVE_RPC_RPC_H)
712 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
713 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
714 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
717 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
718 AC_TRY_COMPILE([#include <sys/types.h>
719 #if defined(HAVE_RPC_RPC_H)
723 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
724 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
725 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
728 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
729 AC_TRY_COMPILE([#include <sys/types.h>
730 #if defined(HAVE_RPC_RPC_H)
734 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
735 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
736 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
739 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
740 AC_TRY_COMPILE([#include <sys/types.h>
741 #if defined(HAVE_RPC_RPC_H)
745 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
746 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
747 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
751 dnl Some systems (SCO) have a problem including
752 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
753 dnl as a #define in <prot.h> and as part of an enum
757 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
758 AC_TRY_COMPILE([#include <sys/types.h>
759 #ifdef HAVE_SYS_SECURITY_H
760 #include <sys/security.h>
762 #endif /* HAVE_SYS_SECURITY_H */
763 #if defined(HAVE_RPC_RPC_H)
767 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
768 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
769 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
772 AC_MSG_CHECKING([for test routines])
773 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
775 AC_MSG_ERROR([cant find test code. Aborting config]),
776 AC_MSG_WARN([cannot run when cross-compiling]))
778 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
779 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
780 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
781 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
782 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
785 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
786 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
787 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
788 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
789 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
792 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
793 SAVE_CPPFLAGS="$CPPFLAGS"
794 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
796 #define REPLACE_GETPASS 1
797 #define NO_CONFIG_H 1
798 #define main dont_declare_main
799 #include "${srcdir-.}/lib/getsmbpass.c"
801 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
802 CPPFLAGS="$SAVE_CPPFLAGS"
804 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
805 AC_DEFINE(REPLACE_GETPASS)
808 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
811 #include <sys/types.h>
812 #include <netinet/in.h>
813 #ifdef HAVE_ARPA_INET_H
814 #include <arpa/inet.h>
816 main() { struct in_addr ip; ip.s_addr = 0x12345678;
817 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
818 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
820 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
821 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
822 AC_DEFINE(REPLACE_INET_NTOA)
825 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
826 AC_TRY_RUN([main() { exit(getuid() != 0); }],
827 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
828 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
831 AC_MSG_WARN(running as non-root will disable some tests)
835 AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
837 #define HAVE_NETMASK_IFCONF 1
839 #include "confdefs.h"
840 #include "${srcdir-.}/lib/netmask.c"],
841 samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
842 if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
843 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF)
846 if test $netmask = no; then
847 AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
849 #define HAVE_NETMASK_IFREQ 1
851 #include "confdefs.h"
852 #include "${srcdir-.}/lib/netmask.c"],
853 samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
854 if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
855 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ)
859 if test $netmask = no; then
860 AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
862 #define HAVE_NETMASK_AIX 1
864 #include "confdefs.h"
865 #include "${srcdir-.}/lib/netmask.c"],
866 samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
867 if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
868 netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX)
872 AC_CACHE_CHECK([for trapdoor seteuid],samba_cv_HAVE_TRAPDOOR_UID,[
873 AC_TRY_RUN([#include "${srcdir-.}/tests/trapdoor.c"],
874 samba_cv_HAVE_TRAPDOOR_UID=no,samba_cv_HAVE_TRAPDOOR_UID=yes,:)])
875 if test x"$samba_cv_HAVE_TRAPDOOR_UID" = x"yes"; then
876 AC_DEFINE(HAVE_TRAPDOOR_UID)
879 AC_CACHE_CHECK([for shared mmap],samba_cv_HAVE_SHARED_MMAP,[
880 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
881 samba_cv_HAVE_SHARED_MMAP=yes,samba_cv_HAVE_SHARED_MMAP=no,samba_cv_HAVE_SHARED_MMAP=cross)])
882 if test x"$samba_cv_HAVE_SHARED_MMAP" = x"yes"; then
883 AC_DEFINE(HAVE_SHARED_MMAP)
887 AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
888 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
889 samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
890 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
891 AC_DEFINE(FTRUNCATE_NEEDS_ROOT)
894 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
895 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
896 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
897 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
898 AC_DEFINE(HAVE_FCNTL_LOCK)
901 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
903 #if defined(HAVE_UNISTD_H)
913 #ifdef HAVE_SYS_FCNTL_H
914 #include <sys/fcntl.h>
916 main() { struct flock64 fl64;
917 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
923 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
924 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
925 AC_DEFINE(HAVE_STRUCT_FLOCK64)
928 AC_CACHE_CHECK([for sysv ipc],samba_cv_HAVE_SYSV_IPC,[
929 AC_TRY_RUN([#include "${srcdir-.}/tests/sysv_ipc.c"],
930 samba_cv_HAVE_SYSV_IPC=yes,samba_cv_HAVE_SYSV_IPC=no,samba_cv_HAVE_SYSV_IPC=cross)])
931 if test x"$samba_cv_HAVE_SYSV_IPC" = x"yes"; then
932 AC_DEFINE(HAVE_SYSV_IPC)
935 AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
936 AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
937 samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
938 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
939 AC_DEFINE(HAVE_TRUNCATED_SALT)
942 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
943 AC_TRY_COMPILE([#include <sys/acl.h>
944 #if defined(HAVE_RPCSVC_NIS_H)
945 #include <rpcsvc/nis.h>
948 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
949 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
950 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
954 #################################################
955 # check for smbwrapper support
956 AC_MSG_CHECKING(whether to use smbwrapper)
957 AC_ARG_WITH(smbwrapper,
958 [ --with-smbwrapper Include SMB wrapper support
959 --without-smbwrapper Don't include SMB wrapper support (default)],
963 AC_DEFINE(WITH_SMBWRAPPER)
964 WRAP="bin/smbsh bin/smbwrapper.so"
966 if test x$ATTEMPT_WRAP32_BUILD = x; then
969 WRAP32=bin/smbwrapper.32.so
972 # Conditions under which smbwrapper should not be built.
974 if test x$PICFLAG = x; then
975 echo No support for PIC code - disabling smbwrapper and smbsh
978 elif test x$ac_cv_func_syscall = xno; then
979 AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
991 #################################################
992 # check for the AFS filesystem
993 AC_MSG_CHECKING(whether to use AFS)
995 [ --with-afs Include AFS support
996 --without-afs Don't include AFS support (default)],
1010 #################################################
1011 # check for the DFS auth system
1012 AC_MSG_CHECKING(whether to use DFS auth)
1014 [ --with-dfs Include DFS support
1015 --without-dfs Don't include DFS support (default)],
1016 [ case "$withval" in
1028 #################################################
1029 # check for Kerberos IV auth system
1030 AC_MSG_CHECKING(whether to use Kerberos IV)
1032 [ --with-krb4=base-dir Include Kerberos IV support
1033 --whithout-krb4 Don't include Kerbers IV support (default)],
1034 [ AC_MSG_RESULT(yes)
1035 AC_DEFINE(KRB4_AUTH)
1036 AC_CHECK_LIB(resolv, dn_expand)
1037 LIBS="$LIBS -lkrb -ldes"
1038 CFLAGS="$CFLAGS -I$withval/include"
1039 LDFLAGS="$LDFLAGS -L$withval/lib"],
1043 #################################################
1044 # check for Kerberos 5 auth system
1045 AC_MSG_CHECKING(whether to use Kerberos 5)
1047 [ --with-krb5=base-dir Include Kerberos 5 support
1048 --whithout-krb5 Don't include Kerbers 5 support (default)],
1049 [ AC_MSG_RESULT(yes)
1050 AC_DEFINE(KRB5_AUTH)
1051 LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
1052 CFLAGS="$CFLAGS -I$withval/include"
1053 LDFLAGS="$LDFLAGS -L$withval/lib"],
1057 #################################################
1058 # check for automount support
1059 AC_MSG_CHECKING(whether to use AUTOMOUNT)
1060 AC_ARG_WITH(automount,
1061 [ --with-automount Include AUTOMOUNT support
1062 --without-automount Don't include AUTOMOUNT support (default)],
1063 [ case "$withval" in
1066 AC_DEFINE(WITH_AUTOMOUNT)
1075 #################################################
1076 # check for smbmount support
1077 AC_MSG_CHECKING(whether to use SMBMOUNT)
1078 AC_ARG_WITH(smbmount,
1079 [ --with-smbmount Include SMBMOUNT (Linux only) support
1080 --without-smbmount Don't include SMBMOUNT support (default)],
1081 [ case "$withval" in
1084 AC_DEFINE(WITH_SMBMOUNT)
1085 MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
1097 #################################################
1098 # check for a PAM password database
1099 AC_MSG_CHECKING(whether to use PAM password database)
1101 [ --with-pam Include PAM password database support
1102 --without-pam Don't include PAM password database support (default)],
1103 [ case "$withval" in
1117 #################################################
1118 # check for a LDAP password database
1119 AC_MSG_CHECKING(whether to use LDAP password database)
1121 [ --with-ldap Include LDAP support
1122 --without-ldap Don't include LDAP support (default)],
1123 [ case "$withval" in
1126 AC_DEFINE(WITH_LDAP)
1135 #################################################
1136 # check for a NISPLUS password database
1137 AC_MSG_CHECKING(whether to use NISPLUS password database)
1138 AC_ARG_WITH(nisplus,
1139 [ --with-nisplus Include NISPLUS password database support
1140 --without-nisplus Don't include NISPLUS password database support (default)],
1141 [ case "$withval" in
1144 AC_DEFINE(WITH_NISPLUS)
1153 #################################################
1154 # check for a NISPLUS_HOME support
1155 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
1156 AC_ARG_WITH(nisplus-home,
1157 [ --with-nisplus-home Include NISPLUS_HOME support
1158 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
1159 [ case "$withval" in
1162 AC_DEFINE(WITH_NISPLUS_HOME)
1171 #################################################
1172 # check for the secure socket layer
1173 AC_MSG_CHECKING(whether to use SSL)
1175 [ --with-ssl Include SSL support
1176 --without-ssl Don't include SSL support (default)
1177 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
1178 [ case "$withval" in
1182 withval="/usr/local/ssl" # default
1184 if test "${with_sslinc+set}" = set; then
1186 withval="$with_sslinc"
1189 echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
1190 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1191 LIBS="-lssl -lcrypto $LIBS"
1192 LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
1195 CFLAGS="-I${withval}/include $CFLAGS"
1196 LIBS="-lssl -l crypto $LIBS"
1197 LDFLAGS="-L${withval}/lib $LDFLAGS"
1203 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
1204 LIBS="-lssl -lcrypto $LIBS"
1205 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
1209 if test ! -d ${withval}; then
1210 echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
1214 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
1224 #################################################
1225 # check for experimental mmap support
1226 AC_MSG_CHECKING(whether to use MMAP)
1228 [ --with-mmap Include experimental MMAP support
1229 --without-mmap Don't include MMAP support (default)],
1230 [ case "$withval" in
1233 AC_DEFINE(WITH_MMAP)
1242 #################################################
1243 # check for syslog logging
1244 AC_MSG_CHECKING(whether to use syslog logging)
1246 [ --with-syslog Include experimental SYSLOG support
1247 --without-syslog Don't include SYSLOG support (default)],
1248 [ case "$withval" in
1251 AC_DEFINE(WITH_SYSLOG)
1260 #################################################
1261 # check for experimental netatalk resource fork support
1262 AC_MSG_CHECKING(whether to support netatalk)
1263 AC_ARG_WITH(netatalk,
1264 [ --with-netatalk Include experimental Netatalk support
1265 --without-netatalk Don't include experimental Netatalk support (default)],
1266 [ case "$withval" in
1269 AC_DEFINE(WITH_NETATALK)
1278 #################################################
1279 # check for experimental disk-quotas support
1280 QUOTAOBJS=noquotas.o
1282 AC_MSG_CHECKING(whether to support disk-quotas)
1284 [ --with-quotas Include experimental disk-quota support
1285 --without-quotas Don't include experimental disk-quota support (default)],
1286 [ case "$withval" in
1299 #################################################
1300 # set private directory location
1301 AC_ARG_WITH(privatedir,
1302 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
1303 [ case "$withval" in
1306 # Just in case anybody calls it without argument
1308 AC_MSG_WARN([--with-privatedir called without argument - will use default])
1309 privatedir='${prefix}/private'
1312 privatedir="$withval"
1315 AC_SUBST(privatedir)],
1316 [privatedir='${prefix}/private'
1317 AC_SUBST(privatedir)]
1320 #################################################
1321 # set lock directory location
1322 AC_ARG_WITH(lockdir,
1323 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
1324 [ case "$withval" in
1327 # Just in case anybody calls it without argument
1329 AC_MSG_WARN([--with-lockdir called without argument - will use default])
1330 lockdir='$(VARDIR)/locks'
1337 [lockdir='$(VARDIR)/locks'
1341 #################################################
1342 # set SWAT directory location
1343 AC_ARG_WITH(swatdir,
1344 [ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
1345 [ case "$withval" in
1348 # Just in case anybody does it
1350 AC_MSG_WARN([--with-swatdir called without argument - will use default])
1351 swatdir='${prefix}/swat'
1358 [swatdir='${prefix}/swat'
1362 #################################################
1363 # these tests are taken from the GNU fileutils package
1364 AC_CHECKING(how to get filesystem space usage)
1367 # Test for statvfs64.
1368 if test $space = no; then
1370 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
1372 #if defined(HAVE_UNISTD_H)
1375 #include <sys/types.h>
1376 #include <sys/statvfs.h>
1379 struct statvfs64 fsd;
1380 exit (statvfs64 (".", &fsd));
1382 fu_cv_sys_stat_statvfs64=yes,
1383 fu_cv_sys_stat_statvfs64=no,
1384 fu_cv_sys_stat_statvfs64=cross)])
1385 if test $fu_cv_sys_stat_statvfs64 = yes; then
1387 AC_DEFINE(STAT_STATVFS64)
1391 # Perform only the link test since it seems there are no variants of the
1392 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
1393 # because that got a false positive on SCO OSR5. Adding the declaration
1394 # of a `struct statvfs' causes this test to fail (as it should) on such
1395 # systems. That system is reported to work fine with STAT_STATFS4 which
1396 # is what it gets when this test fails.
1397 if test $space = no; then
1399 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
1400 [AC_TRY_LINK([#include <sys/types.h>
1401 #include <sys/statvfs.h>],
1402 [struct statvfs fsd; statvfs (0, &fsd);],
1403 fu_cv_sys_stat_statvfs=yes,
1404 fu_cv_sys_stat_statvfs=no)])
1405 if test $fu_cv_sys_stat_statvfs = yes; then
1407 AC_DEFINE(STAT_STATVFS)
1411 if test $space = no; then
1412 # DEC Alpha running OSF/1
1413 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
1414 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
1416 #include <sys/param.h>
1417 #include <sys/types.h>
1418 #include <sys/mount.h>
1423 exit (statfs (".", &fsd, sizeof (struct statfs)));
1425 fu_cv_sys_stat_statfs3_osf1=yes,
1426 fu_cv_sys_stat_statfs3_osf1=no,
1427 fu_cv_sys_stat_statfs3_osf1=no)])
1428 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
1429 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
1431 AC_DEFINE(STAT_STATFS3_OSF1)
1435 if test $space = no; then
1437 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
1438 member (AIX, 4.3BSD)])
1439 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
1441 #ifdef HAVE_SYS_PARAM_H
1442 #include <sys/param.h>
1444 #ifdef HAVE_SYS_MOUNT_H
1445 #include <sys/mount.h>
1447 #ifdef HAVE_SYS_VFS_H
1448 #include <sys/vfs.h>
1454 exit (statfs (".", &fsd));
1456 fu_cv_sys_stat_statfs2_bsize=yes,
1457 fu_cv_sys_stat_statfs2_bsize=no,
1458 fu_cv_sys_stat_statfs2_bsize=no)])
1459 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
1460 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
1462 AC_DEFINE(STAT_STATFS2_BSIZE)
1466 if test $space = no; then
1468 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
1469 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
1470 [AC_TRY_RUN([#include <sys/types.h>
1471 #include <sys/statfs.h>
1475 exit (statfs (".", &fsd, sizeof fsd, 0));
1477 fu_cv_sys_stat_statfs4=yes,
1478 fu_cv_sys_stat_statfs4=no,
1479 fu_cv_sys_stat_statfs4=no)])
1480 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
1481 if test $fu_cv_sys_stat_statfs4 = yes; then
1483 AC_DEFINE(STAT_STATFS4)
1487 if test $space = no; then
1489 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
1490 member (4.4BSD and NetBSD)])
1491 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
1492 [AC_TRY_RUN([#include <sys/types.h>
1493 #ifdef HAVE_SYS_PARAM_H
1494 #include <sys/param.h>
1496 #ifdef HAVE_SYS_MOUNT_H
1497 #include <sys/mount.h>
1503 exit (statfs (".", &fsd));
1505 fu_cv_sys_stat_statfs2_fsize=yes,
1506 fu_cv_sys_stat_statfs2_fsize=no,
1507 fu_cv_sys_stat_statfs2_fsize=no)])
1508 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
1509 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
1511 AC_DEFINE(STAT_STATFS2_FSIZE)
1515 if test $space = no; then
1517 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
1518 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
1519 [AC_TRY_RUN([#include <sys/types.h>
1520 #ifdef HAVE_SYS_PARAM_H
1521 #include <sys/param.h>
1523 #ifdef HAVE_SYS_MOUNT_H
1524 #include <sys/mount.h>
1526 #ifdef HAVE_SYS_FS_TYPES_H
1527 #include <sys/fs_types.h>
1532 /* Ultrix's statfs returns 1 for success,
1533 0 for not mounted, -1 for failure. */
1534 exit (statfs (".", &fsd) != 1);
1536 fu_cv_sys_stat_fs_data=yes,
1537 fu_cv_sys_stat_fs_data=no,
1538 fu_cv_sys_stat_fs_data=no)])
1539 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
1540 if test $fu_cv_sys_stat_fs_data = yes; then
1542 AC_DEFINE(STAT_STATFS2_FS_DATA)
1547 # As a gating factor for large file support, in order to
1548 # use <4GB files we must have the following minimal support
1550 # long long, and a 64 bit off_t or off64_t.
1551 # If we don't have all of these then disable large
1554 echo "checking if large file support can be enabled"
1556 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
1557 #include <sys/types.h>
1563 samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
1564 if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
1566 AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
1571 echo "checking configure summary"
1572 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
1573 echo "configure OK";,
1574 AC_MSG_ERROR([summary failure. Aborting config]),:)
1579 AC_OUTPUT(include/stamp-h Makefile)