configure.ac 18 KB

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