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 AC_CONFIG_AUX_DIR(../../config)
5 # we want to be compatibe with older versions of Samba
6 AC_PREFIX_DEFAULT(/usr/local/samba)
8 dnl Unique-to-Samba variables we'll be playing with.
16 # compile with optimisation and without debugging by default
19 dnl Checks for programs.
23 AC_CHECK_TOOL(AR, ar, ar)
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
53 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
54 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
55 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
56 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
57 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
58 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
59 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
60 AC_CHECK_HEADERS(netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
61 AC_CHECK_HEADERS(sys/security.h security/pam_appl.h)
62 AC_CHECK_HEADERS(stropts.h poll.h sys/capability.h syscall.h sys/syscall.h)
63 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
65 AC_CHECK_SIZEOF(int,cross)
66 AC_CHECK_SIZEOF(long,cross)
67 AC_CHECK_SIZEOF(short,cross)
82 AC_CHECK_TYPE(ino_t,unsigned)
83 AC_CHECK_TYPE(loff_t,off_t)
84 AC_CHECK_TYPE(offset_t,off_t)
85 AC_CHECK_TYPE(ssize_t, int)
87 # we need libdl for PAM and the new VFS code
90 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
92 #include <sys/types.h>
97 #include <signal.h>],[sig_atomic_t i = 0],
98 samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
99 if test x"$samba_cv_sig_atomic_t" = x"yes"; then
100 AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
103 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
104 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
105 samba_cv_errno=yes,samba_cv_have_errno=no)])
106 if test x"$samba_cv_errno" = x"yes"; then
107 AC_DEFINE(HAVE_ERRNO_DECL)
110 # stupid glibc has the functions but no declaration. grrrr.
111 AC_CACHE_CHECK([for crypt declaration],samba_cv_have_crypt_decl,[
112 AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)crypt],
113 samba_cv_have_crypt_decl=yes,samba_cv_have_crypt_decl=no)])
114 if test x"$samba_cv_have_crypt_decl" = x"yes"; then
115 AC_DEFINE(HAVE_CRYPT_DECL)
120 ###############################################
121 # test for where we get crypt() from
122 AC_CHECK_FUNCS(crypt)
123 if test x"$ac_cv_func_crypt" = x"no"; then
124 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
125 AC_DEFINE(HAVE_CRYPT)])
129 # The following test taken from the cvs sources
130 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
131 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
132 # libsocket.so which has a bad implementation of gethostbyname (it
133 # only looks in /etc/hosts), so we only look for -lsocket if we need
135 AC_CHECK_FUNCS(connect)
136 if test x"$ac_cv_func_connect" = x"no"; then
139 *) AC_CHECK_LIB(nsl_s, printf) ;;
143 *) AC_CHECK_LIB(nsl, printf) ;;
147 *) AC_CHECK_LIB(socket, connect) ;;
151 *) AC_CHECK_LIB(inet, connect) ;;
153 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
155 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
156 test x"$ac_cv_lib_inet_connect" = x"yes"; then
157 # ac_cv_func_connect=yes
158 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
159 AC_DEFINE(HAVE_CONNECT)
163 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod)
164 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
165 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
166 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
167 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf setreuid setregid seteuid setegid)
168 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate)
169 AC_CHECK_FUNCS(atexit grantpt dup2)
170 AC_CHECK_FUNCS(setluid yp_get_default_domain getpwanam)
171 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp)
173 AC_CHECK_FUNCS(getdents)
174 AC_CHECK_FUNCS(llseek)
177 # If no strcasecmp, check for it in some known places
178 # It is in -lresolv on ReliantUNIX and UnixWare
179 # -lresolve *must* follow -lnsl for name resolution to work properly
182 if test x$ac_cv_func_strcasecmp = xno ; then
183 AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
184 AC_DEFINE(HAVE_STRCASECMP))
188 # Check for the functions putprpwnam, set_auth_parameters,
189 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
190 # Needed for OSF1 and HPUX.
193 AC_LIBTESTFUNC(security, putprpwnam)
194 AC_LIBTESTFUNC(sec, putprpwnam)
196 AC_LIBTESTFUNC(security, set_auth_parameters)
197 AC_LIBTESTFUNC(sec, set_auth_parameters)
199 AC_LIBTESTFUNC(security, getspnam)
200 AC_LIBTESTFUNC(sec, getspnam)
202 AC_LIBTESTFUNC(security, bigcrypt)
203 AC_LIBTESTFUNC(sec, bigcrypt)
205 AC_LIBTESTFUNC(security, getprpwnam)
206 AC_LIBTESTFUNC(sec, getprpwnam)
208 # this bit needs to be modified for each OS that is suported by
209 # smbwrapper. You need to specify how to created a shared library and
210 # how to compile C code to produce PIC object files
212 # these are the defaults, good for lots of systems
216 # and these are for particular systems
218 *linux*) AC_DEFINE(LINUX);;
219 *solaris*) AC_DEFINE(SUNOS5)
222 *sunos*) AC_DEFINE(SUNOS4)
225 *bsd*) LDSHFLAGS="-shared -Bshareable"
227 *irix*) AC_DEFINE(IRIX)
229 *irix6*) AC_DEFINE(IRIX6)
232 ATTEMPT_WRAP32_BUILD=yes
234 *aix*) AC_DEFINE(AIX);;
235 *hpux*) AC_DEFINE(HPUX);;
236 *qnx*) AC_DEFINE(QNX);;
237 *osf*) AC_DEFINE(OSF1);;
238 *sco*) AC_DEFINE(SCO);;
239 *next2*) AC_DEFINE(NEXT2);;
240 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
243 *-univel-*) if [ test "$GCC" != yes ]; then
244 AC_DEFINE(HAVE_MEMSET)
248 *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
252 if [ test "$GCC" != yes ]; then
253 AC_DEFINE(HAVE_MEMSET)
261 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
262 AC_TRY_RUN([#include <stdio.h>
263 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
264 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
265 if test x"$samba_cv_have_longlong" = x"yes"; then
266 AC_DEFINE(HAVE_LONGLONG)
269 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
270 AC_TRY_RUN([#include <stdio.h>
271 #include <sys/stat.h>
272 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
273 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
274 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
275 AC_DEFINE(SIZEOF_OFF_T,8)
278 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
280 #if defined(HAVE_UNISTD_H)
284 #include <sys/stat.h>
285 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
286 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
287 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
288 AC_DEFINE(HAVE_OFF64_T)
291 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
292 AC_TRY_RUN([#include <stdio.h>
293 #include <sys/stat.h>
294 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
295 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
296 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
297 AC_DEFINE(SIZEOF_INO_T,8)
300 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
302 #if defined(HAVE_UNISTD_H)
306 #include <sys/stat.h>
307 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
308 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
309 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
310 AC_DEFINE(HAVE_INO64_T)
313 AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
315 #if defined(HAVE_UNISTD_H)
318 #include <sys/types.h>
319 #include <dirent.h>],
320 [struct dirent64 de;],
321 samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
322 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
323 AC_DEFINE(HAVE_STRUCT_DIRENT64)
326 AC_CACHE_CHECK([for union semun],samba_cv_HAVE_UNION_SEMUN,[
328 #include <sys/types.h>
331 main() { union semun ss; exit(0); }],
332 samba_cv_HAVE_UNION_SEMUN=yes,samba_cv_HAVE_UNION_SEMUN=no,samba_cv_HAVE_UNION_SEMUN=cross)])
333 if test x"$samba_cv_HAVE_UNION_SEMUN" = x"yes"; then
334 AC_DEFINE(HAVE_UNION_SEMUN)
337 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
338 AC_TRY_RUN([#include <stdio.h>
339 main() { char c; c=250; exit((c > 0)?0:1); }],
340 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
341 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
342 AC_DEFINE(HAVE_UNSIGNED_CHAR)
345 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
346 AC_TRY_COMPILE([#include <sys/types.h>
347 #include <sys/socket.h>
348 #include <netinet/in.h>],
349 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
350 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
351 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
352 AC_DEFINE(HAVE_SOCK_SIN_LEN)
355 AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
356 AC_TRY_COMPILE([#include <sys/types.h>
358 void seekdir(DIR *d, long loc) { return; }],[return 0;],
359 samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
360 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
361 AC_DEFINE(SEEKDIR_RETURNS_VOID)
364 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
365 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
366 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
367 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
368 AC_DEFINE(HAVE_FILE_MACRO)
371 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
372 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
373 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
374 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
375 AC_DEFINE(HAVE_FUNCTION_MACRO)
378 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
380 #include <sys/time.h>
382 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
383 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
384 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
385 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
389 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
390 AC_TRY_RUN([#include <sys/types.h>
392 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
393 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
394 di->d_name[0] == 0) exit(0); exit(1);} ],
395 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
396 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
397 AC_DEFINE(HAVE_BROKEN_READDIR)
400 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
401 AC_TRY_COMPILE([#include <sys/types.h>
403 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
404 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
405 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
406 AC_DEFINE(HAVE_UTIMBUF)
409 AC_CACHE_CHECK([for kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS,[
410 AC_TRY_COMPILE([#include <sys/types.h>
412 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
413 samba_cv_HAVE_KERNEL_OPLOCKS=yes,samba_cv_HAVE_KERNEL_OPLOCKS=no)])
414 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then
415 AC_DEFINE(HAVE_KERNEL_OPLOCKS)
418 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
419 AC_TRY_RUN([#include <sys/types.h>
420 #include <sys/capability.h>
423 if ((cap = cap_get_proc()) == NULL)
425 cap->cap_effective |= CAP_NETWORK_MGT;
426 cap->cap_inheritable |= CAP_NETWORK_MGT;
431 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
432 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
433 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
437 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
438 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
441 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
442 AC_TRY_COMPILE([#include <sys/types.h>
443 #if defined(HAVE_RPC_RPC_H)
447 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
448 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
449 AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H)
452 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
453 AC_TRY_COMPILE([#include <sys/types.h>
454 #if defined(HAVE_RPC_RPC_H)
458 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
459 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
460 AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H)
463 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
464 AC_TRY_COMPILE([#include <sys/types.h>
465 #if defined(HAVE_RPC_RPC_H)
469 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
470 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
471 AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H)
474 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
475 AC_TRY_COMPILE([#include <sys/types.h>
476 #if defined(HAVE_RPC_RPC_H)
480 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
481 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
482 AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H)
486 dnl Some systems (SCO) have a problem including
487 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
488 dnl as a #define in <prot.h> and as part of an enum
492 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
493 AC_TRY_COMPILE([#include <sys/types.h>
494 #ifdef HAVE_SYS_SECURITY_H
495 #include <sys/security.h>
497 #endif /* HAVE_SYS_SECURITY_H */
498 #if defined(HAVE_RPC_RPC_H)
502 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
503 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
504 AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT)
507 AC_MSG_CHECKING([for test routines])
508 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
510 AC_MSG_ERROR([cant find test code. Aborting config]),
511 AC_MSG_WARN([cannot run when cross-compiling]))
513 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
514 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
515 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
516 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
517 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
520 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
521 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
522 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
523 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
524 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
527 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
530 #include <sys/types.h>
531 #include <netinet/in.h>
532 #ifdef HAVE_ARPA_INET_H
533 #include <arpa/inet.h>
535 main() { struct in_addr ip; ip.s_addr = 0x12345678;
536 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
537 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
539 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
540 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
541 AC_DEFINE(REPLACE_INET_NTOA)
545 AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
547 #define HAVE_NETMASK_IFCONF 1
549 #include "confdefs.h"
550 #include "${srcdir-.}/lib/netmask.c"],
551 samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
552 if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
553 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF)
556 if test $netmask = no; then
557 AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
559 #define HAVE_NETMASK_IFREQ 1
561 #include "confdefs.h"
562 #include "${srcdir-.}/lib/netmask.c"],
563 samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
564 if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
565 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ)
569 if test $netmask = no; then
570 AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
572 #define HAVE_NETMASK_AIX 1
574 #include "confdefs.h"
575 #include "${srcdir-.}/lib/netmask.c"],
576 samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
577 if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
578 netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX)
583 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
584 AC_TRY_COMPILE([#include <sys/acl.h>
585 #if defined(HAVE_RPCSVC_NIS_H)
586 #include <rpcsvc/nis.h>
589 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
590 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
591 AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
595 #################################################
596 # check for a LDAP password database
597 AC_MSG_CHECKING([whether to use LDAP password database])
599 [ --with-ldap Include LDAP support
600 --without-ldap Don't include LDAP support (default)],
613 #################################################
614 # check for a NISPLUS password database
615 AC_MSG_CHECKING([whether to use NISPLUS password database])
617 [ --with-nisplus Include NISPLUS password database support
618 --without-nisplus Don't include NISPLUS password database support (default)],
622 AC_DEFINE(WITH_NISPLUS)
631 #################################################
632 # check for a NISPLUS_HOME support
633 AC_MSG_CHECKING([whether to use NISPLUS_HOME])
634 AC_ARG_WITH(nisplus-home,
635 [ --with-nisplus-home Include NISPLUS_HOME support
636 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
640 AC_DEFINE(WITH_NISPLUS_HOME)
649 #################################################
650 # check for the secure socket layer
651 AC_MSG_CHECKING([whether to use SSL])
653 [ --with-ssl Include SSL support
654 --without-ssl Don't include SSL support (default)
655 --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
660 withval="/usr/local/ssl" # default
662 if test "${with_sslinc+set}" = set; then
664 withval="$with_sslinc"
667 AC_MSG_WARN([--with-sslinc called without argument - will use default])
668 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
669 LIBS="-lssl -lcrypto $LIBS"
670 LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
673 CFLAGS="-I${withval}/include $CFLAGS"
674 LIBS="-lssl -l crypto $LIBS"
675 LDFLAGS="-L${withval}/lib $LDFLAGS"
681 CFLAGS="-I/usr/local/ssl/include $CFLAGS"
682 LIBS="-lssl -lcrypto $LIBS"
683 LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
687 if test ! -d ${withval}; then
688 AC_MSG_ERROR([called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config])
691 CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
702 #################################################
703 # set private directory location
704 AC_ARG_WITH(privatedir,
705 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
709 # Just in case anybody calls it without argument
711 AC_MSG_WARN([--with-privatedir called without argument - will use default])
712 privatedir='${prefix}/private'
715 privatedir="$withval"
718 AC_SUBST(privatedir)],
719 [privatedir='${prefix}/private'
720 AC_SUBST(privatedir)]
723 #################################################
724 # set lock directory location
726 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
730 # Just in case anybody calls it without argument
732 AC_MSG_WARN([--with-lockdir called without argument - will use default])
733 lockdir='$(VARDIR)/locks'
740 [lockdir='$(VARDIR)/locks'
744 #################################################
745 # set configuration directory location
746 configdir="\$(LIBDIR)"
747 AC_ARG_WITH(configdir,
748 [ --with-configdir=DIR Where to put configuration files (\$libdir)],
752 # Just in case anybody does it
754 AC_MSG_WARN([--with-configdir called without argument - will use default])
763 #################################################
764 # set codepage directory location
765 codepagedir="\$(LIBDIR)/codepages"
766 AC_ARG_WITH(codepagedir,
767 [ --with-codepagedir=DIR Where to put codepage files (\$libdir/codepages)],
771 # Just in case anybody does it
773 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
776 codepagedir="$withval"
780 AC_MSG_CHECKING([configure summary])
781 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
783 AC_MSG_RESULT(failure)
784 AC_MSG_ERROR([Aborting config]),:)
789 AC_SUBST(codepagedir)
791 AC_OUTPUT([include/stamp-h Makefile])