configure.ac 18 KB

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