configure.ac 18 KB

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