configure.in 20 KB

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