Ticket #2740: code cleanup before 4.8.2 release.
[midnight-commander.git] / src / vfs / smbfs / helpers / configure.ac
blob060e372d090172d61ccb745105465308e1a513b0
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(include/includes.h)
3 AC_PREREQ(2.52)
4 AC_CONFIG_HEADER(include/config.h)
5 AC_CONFIG_AUX_DIR(../../../../config)
6 # we want to be compatibe with older versions of Samba
7 AC_PREFIX_DEFAULT(/usr/local/samba)
8 AC_SYS_LARGEFILE
10 dnl Unique-to-Samba variables we'll be playing with.
11 AC_SUBST(SHELL)
12 AC_SUBST(MPROGS)
13 AC_SUBST(LDSHFLAGS)
14 AC_SUBST(HOST_OS)
15 AC_SUBST(WRAP)
16 AC_SUBST(WRAP32)
18 # compile with optimization and without debugging by default
19 CFLAGS=${CFLAGS-"-O"}
21 dnl Checks for programs.
22 AC_PROG_CC
23 AC_PROG_INSTALL
24 AC_PROG_AWK
25 AC_CHECK_TOOL(AR, ar, ar)
27 dnl Check if C compiler understands -c and -o at the same time
28 AC_PROG_CC_C_O
29 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
30       BROKEN_CC=
31 else
32       BROKEN_CC=#
34 AC_SUBST(BROKEN_CC)
36 AC_CANONICAL_HOST
37 AC_VALIDATE_CACHE_SYSTEM_TYPE
38 SAMBA_MAINTAINER_MODE
40 AC_INLINE
41 AC_HEADER_DIRENT
42 AC_HEADER_TIME
43 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
44 AC_CHECK_HEADERS(unistd.h utime.h sys/id.h limits.h memory.h net/if.h)
45 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
46 AC_CHECK_HEADERS(sys/param.h ctype.h sys/resource.h sys/ioctl.h sys/mode.h)
47 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h sys/socket.h)
48 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h)
49 AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
50 AC_CHECK_HEADERS(netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
51 AC_CHECK_HEADERS(sys/security.h security/pam_appl.h)
52 AC_CHECK_HEADERS(stropts.h poll.h syscall.h sys/syscall.h)
53 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h)
55 AC_CHECK_SIZEOF(int)
56 AC_CHECK_SIZEOF(long)
57 AC_CHECK_SIZEOF(short)
58 AC_CHECK_SIZEOF(off_t)
59 AC_CHECK_SIZEOF(ino_t)
61 AC_C_CONST
62 AC_C_INLINE
63 AC_C_BIGENDIAN
64 AC_C_CHAR_UNSIGNED
66 AC_TYPE_SIGNAL
67 AC_TYPE_UID_T
68 AC_TYPE_MODE_T
69 AC_TYPE_OFF_T
70 AC_TYPE_SIZE_T
71 AC_TYPE_PID_T
72 AC_CHECK_TYPE(ino_t,unsigned)
73 AC_CHECK_TYPE(loff_t,off_t)
74 AC_CHECK_TYPE(offset_t,off_t)
75 AC_CHECK_TYPE(ssize_t, int)
77 # we need libdl for PAM and the new VFS code
78 AC_CHECK_LIB(dl,main)
80 # stupid glibc has the functions but no declaration. grrrr.
81 AC_CACHE_CHECK([for crypt declaration],samba_cv_have_crypt_decl,[
82     AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)crypt],
83         samba_cv_have_crypt_decl=yes,samba_cv_have_crypt_decl=no)])
84 if test x"$samba_cv_have_crypt_decl" = x"yes"; then
85     AC_DEFINE(HAVE_CRYPT_DECL, 1, [Define if crypt() is declared])
88 AC_FUNC_MEMCMP
90 ###############################################
91 # test for where we get crypt() from
92 AC_CHECK_FUNCS(crypt)
93 if test x"$ac_cv_func_crypt" = x"no"; then
94     AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
95         AC_DEFINE(HAVE_CRYPT)])
99 # The following test taken from the cvs sources
100 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
101 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
102 # libsocket.so which has a bad implementation of gethostbyname (it
103 # only looks in /etc/hosts), so we only look for -lsocket if we need
104 # it.
105 AC_CHECK_FUNCS(connect)
106 if test x"$ac_cv_func_connect" = x"no"; then
107     case "$LIBS" in
108     *-lnsl*) ;;
109     *) AC_CHECK_LIB(nsl_s, printf) ;;
110     esac
111     case "$LIBS" in
112     *-lnsl*) ;;
113     *) AC_CHECK_LIB(nsl, printf) ;;
114     esac
115     case "$LIBS" in
116     *-lsocket*) ;;
117     *) AC_CHECK_LIB(socket, connect) ;;
118     esac
119     case "$LIBS" in
120     *-linet*) ;;
121     *) AC_CHECK_LIB(inet, connect) ;;
122     esac
123     dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
124     dnl has been cached.
125     if test x"$ac_cv_lib_socket_connect" = x"yes" || 
126        test x"$ac_cv_lib_inet_connect" = x"yes"; then
127         # ac_cv_func_connect=yes
128         # don't!  it would cause AC_CHECK_FUNC to succeed next time configure is run
129         AC_DEFINE(HAVE_CONNECT)
130     fi
133 AC_CHECK_FUNCS(waitpid getcwd strtoul chown chmod)
134 AC_CHECK_FUNCS(fstat utime utimes getrlimit fsync memset)
135 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid pipe crypt16 getauthuid)
136 AC_CHECK_FUNCS(sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
137 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf)
138 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename)
139 AC_CHECK_FUNCS(grantpt dup2 yp_get_default_domain getpwanam)
140 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp)
142 AC_CHECK_FUNCS(getdents)
143 AC_CHECK_FUNCS(llseek)
146 # If no strcasecmp, check for it in some known places
147 # It is in -lresolv on ReliantUNIX and UnixWare
148 #   -lresolve *must* follow -lnsl for name resolution to work properly
151 if test x$ac_cv_func_strcasecmp = xno ; then
152         AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
153                 AC_DEFINE(HAVE_STRCASECMP))
157 # Check for the functions putprpwnam, set_auth_parameters,
158 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
159 # Needed for OSF1 and HPUX.
162 AC_LIBTESTFUNC(security, putprpwnam)
163 AC_LIBTESTFUNC(sec, putprpwnam)
165 AC_LIBTESTFUNC(security, set_auth_parameters)
166 AC_LIBTESTFUNC(sec, set_auth_parameters)
168 AC_LIBTESTFUNC(security, getspnam)
169 AC_LIBTESTFUNC(sec, getspnam)
171 AC_LIBTESTFUNC(security, bigcrypt)
172 AC_LIBTESTFUNC(sec, bigcrypt)
174 AC_LIBTESTFUNC(security, getprpwnam)
175 AC_LIBTESTFUNC(sec, getprpwnam)
177 # this bit needs to be modified for each OS that is suported by
178 # smbwrapper. You need to specify how to created a shared library and
179 # how to compile C code to produce PIC object files
181 # these are the defaults, good for lots of systems
182 HOST_OS="$host_os"
183 LDSHFLAGS="-shared"
185 # and these are for particular systems
186 case "$host_os" in
187                 *linux*)   AC_DEFINE(LINUX, 1, [Define on Linux]);;
188                 *solaris*) AC_DEFINE(SUNOS5, 1, [Define on SunOS 5 (Solaris)])
189                                         LDSHFLAGS="-G"
190                 ;;
191                 *sunos*) AC_DEFINE(SUNOS4, 1, [Define on SunOS 4])
192                                         LDSHFLAGS=""
193                 ;;
194                 *bsd*) LDSHFLAGS="-shared -Bshareable"
195                 ;;
196                 *irix*) AC_DEFINE(IRIX, 1, [Define on IRIX])
197                         case "$host_os" in
198                         *irix6*) AC_DEFINE(IRIX6, 1, [Define on IRIX 6])
199                         ;;
200                         esac
201                         ATTEMPT_WRAP32_BUILD=yes
202                 ;;
203                 *aix*) AC_DEFINE(AIX, 1, [Define on AIX]);;
204                 *hpux*) AC_DEFINE(HPUX, 1, [Define on HP-UX]);;
205                 *qnx*) AC_DEFINE(QNX, 1, [Define on QNX]);;
206                 *osf*) AC_DEFINE(OSF1, 1, [Define on OSF1]);;
207                 *sco*) AC_DEFINE(SCO, 1, [Define on SCO]);;
208                 *next2*) AC_DEFINE(NEXT2, 1, [Define on NeXT 2]);;
209                 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
210                 *sysv4*)
211                         case "$host" in
212                                 *-univel-*)     if [ test "$GCC" != yes ]; then
213                                                                         AC_DEFINE(HAVE_MEMSET)
214                                                                 fi
215                                                                 LDSHFLAGS="-G"
216                                 ;;
217                         esac
218                         ;;
219                 *sysv5*)
220                         if [ test "$GCC" != yes ]; then
221                                 AC_DEFINE(HAVE_MEMSET)
222                         fi
223                         LDSHFLAGS="-G"
224                         ;;
225 esac
227 ################
229 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
230 AC_TRY_RUN([
231 #include <stdio.h>
232 #include <stdlib.h>
233 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
234 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
235 if test x"$samba_cv_have_longlong" = x"yes"; then
236     AC_DEFINE(HAVE_LONGLONG, 1, [Define if long long is usable])
239 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
240 AC_TRY_COMPILE([#include <sys/types.h>
241 #include <sys/socket.h>
242 #include <netinet/in.h>],
243 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
244 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
245 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
246     AC_DEFINE(HAVE_SOCK_SIN_LEN, 1, [Define if struct sockaddr_in has sin_len field])
249 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
250 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
251 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
252 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
253     AC_DEFINE(HAVE_FILE_MACRO, 1, [Define if __FILE__ macro is supported])
256 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
257 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
258 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
259 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
260     AC_DEFINE(HAVE_FUNCTION_MACRO, 1, [Define if __FUNCTION__ macro is supported])
263 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
264 AC_TRY_RUN([
265 #include <sys/time.h>
266 #include <unistd.h>
267 #include <stdlib.h>
268 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
269            samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
270 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
271     AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [Define if gettimeofday takes tz argument])
275 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
276 AC_TRY_RUN([
277 #include <sys/types.h>
278 #include <stdlib.h>
279 #include <dirent.h>
280 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
281 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
282 di->d_name[0] == 0) exit(0); exit(1);} ],
283 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
284 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
285     AC_DEFINE(HAVE_BROKEN_READDIR, 1, [Define if readdir() is broken])
288 AC_CACHE_CHECK([for kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS,[
289 AC_TRY_COMPILE([#include <sys/types.h>
290 #include <fcntl.h>],
291 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
292 samba_cv_HAVE_KERNEL_OPLOCKS=yes,samba_cv_HAVE_KERNEL_OPLOCKS=no)])
293 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then
294     AC_DEFINE(HAVE_KERNEL_OPLOCKS, 1, [Define to use kernel oplock capabilities])
298 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
299 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
302 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
303 AC_TRY_COMPILE([#include <sys/types.h>
304 #if defined(HAVE_RPC_RPC_H)
305 #include <rpc/rpc.h>
306 #endif],
307 [int16 testvar;],
308 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
309 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
310     AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines int16])
313 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
314 AC_TRY_COMPILE([#include <sys/types.h>
315 #if defined(HAVE_RPC_RPC_H)
316 #include <rpc/rpc.h>
317 #endif],
318 [uint16 testvar;],
319 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
320 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
321     AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines uint16])
324 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
325 AC_TRY_COMPILE([#include <sys/types.h>
326 #if defined(HAVE_RPC_RPC_H)
327 #include <rpc/rpc.h>
328 #endif],
329 [int32 testvar;],
330 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
331 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
332     AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines int32])
335 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
336 AC_TRY_COMPILE([#include <sys/types.h>
337 #if defined(HAVE_RPC_RPC_H)
338 #include <rpc/rpc.h>
339 #endif],
340 [uint32 testvar;],
341 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
342 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
343     AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines uint32])
347 dnl Some systems (SCO) have a problem including
348 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
349 dnl as a #define in <prot.h> and as part of an enum
350 dnl in <rpc/rpc.h>.
353 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
354 AC_TRY_COMPILE([#include <sys/types.h>
355 #ifdef HAVE_SYS_SECURITY_H
356 #include <sys/security.h>
357 #include <prot.h>
358 #endif  /* HAVE_SYS_SECURITY_H */
359 #if defined(HAVE_RPC_RPC_H)
360 #include <rpc/rpc.h>
361 #endif],
362 [int testvar;],
363 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
364 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
365     AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT, 1, [Define if rpc/rpc.h defines AUTH_ERROR])
368 netmask=no;
369 AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
370 AC_TRY_RUN([
371 #define HAVE_NETMASK_IFCONF 1
372 #define AUTOCONF 1
373 #include "confdefs.h"
374 #include "${srcdir-.}/lib/netmask.c"],
375            samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
376 if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
377     netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF, 1, [Define to use IFCONF style netmask])
380 if test $netmask = no; then
381 AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
382 AC_TRY_RUN([
383 #define HAVE_NETMASK_IFREQ 1
384 #define AUTOCONF 1
385 #include "confdefs.h"
386 #include "${srcdir-.}/lib/netmask.c"],
387            samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
388 if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
389     netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ, 1, [Define to use IFREQ style netmask])
393 if test $netmask = no; then
394 AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
395 AC_TRY_RUN([
396 #define HAVE_NETMASK_AIX 1
397 #define AUTOCONF 1
398 #include "confdefs.h"
399 #include "${srcdir-.}/lib/netmask.c"],
400            samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
401 if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
402     netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX, 1, [Define to use AIX style netmask])
407 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
408 AC_TRY_COMPILE([#include <sys/acl.h>
409 #if defined(HAVE_RPCSVC_NIS_H)
410 #include <rpcsvc/nis.h>
411 #endif],
412 [return 0;],
413 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
414 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
415     AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES, 1,
416               [Define if sys/acl.h and rpcsvc/nis.h cannot be included together])
420 #################################################
421 # check for a LDAP password database
422 AC_MSG_CHECKING([whether to use LDAP password database])
423 AC_ARG_WITH(ldap,
424 [  --with-ldap     Include LDAP support
425   --without-ldap  Don't include LDAP support (default)],
426 [ case "$withval" in
427   yes)
428     AC_MSG_RESULT(yes)
429     AC_DEFINE(WITH_LDAP, 1, [Define to enable LDAP support])
430     ;;
431   *)
432     AC_MSG_RESULT(no)
433     ;;
434   esac ],
435   AC_MSG_RESULT(no)
438 #################################################
439 # check for a NISPLUS password database
440 AC_MSG_CHECKING([whether to use NISPLUS password database])
441 AC_ARG_WITH(nisplus,
442 [  --with-nisplus     Include NISPLUS password database support
443   --without-nisplus  Don't include NISPLUS password database support (default)],
444 [ case "$withval" in
445   yes)
446     AC_MSG_RESULT(yes)
447     AC_DEFINE(WITH_NISPLUS, 1, [Define to enable NIS+ support])
448     ;;
449   *)
450     AC_MSG_RESULT(no)
451     ;;
452   esac ],
453   AC_MSG_RESULT(no)
456 #################################################
457 # check for a NISPLUS_HOME support 
458 AC_MSG_CHECKING([whether to use NISPLUS_HOME])
459 AC_ARG_WITH(nisplus-home,
460 [  --with-nisplus-home     Include NISPLUS_HOME support
461   --without-nisplus-home  Don't include NISPLUS_HOME support (default)],
462 [ case "$withval" in
463   yes)
464     AC_MSG_RESULT(yes)
465     AC_DEFINE(WITH_NISPLUS_HOME, 1, [Define to support NISPLUS_HOME variable])
466     ;;
467   *)
468     AC_MSG_RESULT(no)
469     ;;
470   esac ],
471   AC_MSG_RESULT(no)
474 #################################################
475 # check for the secure socket layer
476 AC_MSG_CHECKING([whether to use SSL])
477 AC_ARG_WITH(ssl,
478 [  --with-ssl     Include SSL support
479   --without-ssl  Don't include SSL support (default)
480   --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
481 [ case "$withval" in
482   yes)
483     AC_MSG_RESULT(yes)
484     AC_DEFINE(WITH_SSL, 1, [Define to enable SSL support])
485     withval="/usr/local/ssl"     # default
487     if test "${with_sslinc+set}" = set; then
489         withval="$with_sslinc"
490         case "$withval" in
491         yes|no)
492           AC_MSG_WARN([--with-sslinc called without argument - will use default])
493           CFLAGS="-I/usr/local/ssl/include $CFLAGS"
494           LIBS="-lssl -lcrypto $LIBS"
495           LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
496         ;;
497         * )
498           CFLAGS="-I${withval}/include $CFLAGS"
499           LIBS="-lssl -l crypto $LIBS"
500           LDFLAGS="-L${withval}/lib $LDFLAGS"
501         ;;
502         esac
504     else
506         CFLAGS="-I/usr/local/ssl/include $CFLAGS"   
507         LIBS="-lssl -lcrypto $LIBS"
508         LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
510     fi
512     if test ! -d ${withval}; then
513       AC_MSG_ERROR([called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config])
514     fi 
516     CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS"  # Damn, SSLeay defines its own
518     ;;
519   *)
520     AC_MSG_RESULT(no)
521     ;;
522   esac ],
523   AC_MSG_RESULT(no)
526 ####################################################
527 # get variables from parent process (main configure)
528 # set configuration directory location
529 if test -n "$SMBCONFIGDIR"; then
530     configdir="$SMBCONFIGDIR"
531 else
532     configdir="\$(LIBDIR)"
534 # set codepage directory location
535 if test -n "$SMBCODEPAGEDIR"; then
536     codepagedir="$SMBCODEPAGEDIR"
537 elif test -n "$SMBCONFIGDIR"; then
538     codepagedir="$SMBCONFIGDIR/codepages"
539 else
540     codepagedir="\$(LIBDIR)/codepages"
542 ####################################################
544 AC_MSG_CHECKING([configure summary])
545 AC_TRY_RUN([
546 #include <stdio.h>
547 #include <stdlib.h>
548 #include <unistd.h>
550 main()
552 #if !(defined(HAVE_NETMASK_IFCONF) || defined(HAVE_NETMASK_IFREQ) || defined(HAVE_NETMASK_AIX))
553     printf("WARNING: No automated netmask determination - use an interfaces line\n");
554 #endif
556 #if !((defined(HAVE_RANDOM) || defined(HAVE_RAND)) && (defined(HAVE_SRANDOM) || defined(HAVE_SRAND)))
557     printf("ERROR: No random or srandom routine!\n");
558     exit(1);
559 #endif
561     exit(0);
564            AC_MSG_RESULT(OK);,
565            AC_MSG_RESULT(failure)
566            AC_MSG_ERROR([Aborting config]),:)
568 builddir=`pwd`
569 AC_SUBST(builddir)
570 AC_SUBST(configdir)
571 AC_SUBST(codepagedir)
573 AC_OUTPUT([include/stamp-h Makefile])