1 dnl -*- mode: m4-mode -*-
2 dnl Process this file with autoconf to produce a configure script.
4 dnl disabled 2.53 requirement - we do work with 2.52 on suse 7.3 for example
8 AC_INIT(include/includes.h)
9 AC_CONFIG_HEADER(include/config.h)
14 #################################################
15 # Directory handling stuff to support both the
16 # legacy SAMBA directories and FHS compliant
18 AC_PREFIX_DEFAULT(/usr/local/samba)
21 [ --with-fhs Use FHS-compliant paths (default=no)],
22 configdir="${sysconfdir}/samba"
23 lockdir="\${VARDIR}/cache/samba"
24 piddir="\${VARDIR}/run/samba"
25 logfilebase="\${VARDIR}/log/samba"
26 privatedir="\${CONFIGDIR}/private"
27 libdir="\${prefix}/lib/samba"
28 swatdir="\${DATADIR}/samba/swat",
29 configdir="\${LIBDIR}"
30 logfilebase="\${VARDIR}"
31 lockdir="\${VARDIR}/locks"
32 piddir="\${VARDIR}/locks"
33 privatedir="\${prefix}/private"
34 swatdir="\${prefix}/swat")
36 #################################################
37 # set private directory location
38 AC_ARG_WITH(privatedir,
39 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
43 # Just in case anybody calls it without argument
45 AC_MSG_WARN([--with-privatedir called without argument - will use default])
52 #################################################
53 # set lock directory location
55 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
59 # Just in case anybody calls it without argument
61 AC_MSG_WARN([--with-lockdir called without argument - will use default])
68 #################################################
69 # set pid directory location
71 [ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)],
75 # Just in case anybody calls it without argument
77 AC_MSG_WARN([--with-piddir called without argument - will use default])
84 #################################################
85 # set configuration directory location
86 AC_ARG_WITH(configdir,
87 [ --with-configdir=DIR Where to put configuration files (\$libdir)],
91 # Just in case anybody does it
93 AC_MSG_WARN([--with-configdir called without argument - will use default])
100 #################################################
101 # set log directory location
102 AC_ARG_WITH(logfilebase,
103 [ --with-logfilebase=DIR Where to put log files (\$(VARDIR))],
107 # Just in case anybody does it
109 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
112 logfilebase="$withval"
119 AC_SUBST(logfilebase)
124 dnl Unique-to-Samba variables we'll be playing with.
134 AC_SUBST(INSTALLCLIENTCMD_SH)
135 AC_SUBST(INSTALLCLIENTCMD_A)
136 AC_SUBST(LIBSMBCLIENT_SHARED)
137 AC_SUBST(LIBSMBCLIENT)
141 AC_SUBST(SHLIB_PROGS)
143 AC_SUBST(EXTRA_BIN_PROGS)
144 AC_SUBST(EXTRA_SBIN_PROGS)
145 AC_SUBST(EXTRA_ALL_TARGETS)
148 [ --enable-debug Turn on compiler debugging information (default=no)],
149 [if eval "test x$enable_debug = xyes"; then
150 CFLAGS="${CFLAGS} -gstabs"
153 AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
154 [if eval "test x$enable_developer = xyes"; then
156 CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
159 AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
160 [if eval "test x$enable_krb5developer = xyes"; then
162 CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
165 sinclude(build/m4/rewrite.m4)
167 dnl exclude these modules
168 AC_ARG_WITH(exclude-modules,
169 [ --with-exclude-modules=MODULES Comma-seperated list of names of modules to exclude from build],
170 [ if test $withval; then
171 for i in `echo $withval | sed -e's/,/ /g'`
177 dnl Always built these modules shared
178 AC_ARG_WITH(shared-modules,
179 [ --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared],
180 [ if test $withval; then
181 for i in `echo $withval | sed -e's/,/ /g'`
183 eval MODULE_$i=SHARED
187 dnl Always built these modules static
188 AC_ARG_WITH(static-modules,
189 [ --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in],
190 [ if test $withval; then
191 for i in `echo $withval | sed -e's/,/ /g'`
193 eval MODULE_$i=STATIC
197 sinclude(nsswitch/config.m4)
198 sinclude(lib/popt/config.m4)
199 sinclude(lib/iconv.m4)
200 sinclude(lib/basic.m4)
201 sinclude(lib/ldb/config.m4)
202 sinclude(lib/cmdline/config.m4)
203 sinclude(param/config.m4)
204 sinclude(libcli/config.m4)
205 sinclude(librpc/config.m4)
206 sinclude(libcli/libsmb.m4)
207 sinclude(smbd/process_model.m4)
208 sinclude(smb_server/config.m4)
209 sinclude(auth/config.m4)
210 sinclude(passdb/config.m4)
211 sinclude(ntvfs/config.m4)
212 sinclude(rpc_server/config.m4)
213 sinclude(lib/registry/config.m4)
214 sinclude(torture/config.m4)
216 #######################################
217 # Check for comparison_fn_t
218 AC_CACHE_CHECK([for comparison_fn_t],samba_cv_HAVE_COMPARISON_FN_T,[
221 int list_find(const void *needle,
222 const void *base, size_t nmemb, size_t size, comparison_fn_t comp_fn)
227 samba_cv_HAVE_COMPARISON_FN_T=yes,samba_cv_HAVE_COMPARISON_FN_T=no)
229 if test x"$samba_cv_HAVE_COMPARISON_FN_T" = x"yes"; then
230 AC_DEFINE(HAVE_COMPARISON_FN_T,1,[Whether or not we have comparison_fn_t])
233 ########################################################
234 # Compile with LDAP support?
236 with_ldap_support=auto
237 AC_MSG_CHECKING([for LDAP support])
240 [ --with-ldap LDAP support (default yes)],
243 with_ldap_support=$withval
247 AC_MSG_RESULT($with_ldap_support)
251 if test x"$with_ldap_support" != x"no"; then
253 ##################################################################
254 # first test for ldap.h and lber.h
255 # (ldap.h is required for this test)
256 AC_CHECK_HEADERS(ldap.h lber.h)
258 if test x"$ac_cv_header_ldap_h" != x"yes"; then
259 if test x"$with_ldap_support" = x"yes"; then
260 AC_MSG_ERROR(ldap.h is needed for LDAP support)
262 AC_MSG_WARN(ldap.h is needed for LDAP support)
269 if test x"$with_ldap_support" != x"no"; then
272 ##################################################################
273 # we might need the lber lib on some systems. To avoid link errors
274 # this test must be before the libldap test
275 AC_CHECK_LIB_EXT(lber, LDAP_LIBS, ber_scanf)
277 ########################################################
278 # now see if we can find the ldap libs in standard paths
279 AC_CHECK_LIB_EXT(ldap, LDAP_LIBS, ldap_init)
281 AC_CHECK_FUNC_EXT(ldap_domain2hostlist,$LDAP_LIBS)
283 ########################################################
284 # If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
285 # Check found in pam_ldap 145.
286 AC_CHECK_FUNC_EXT(ldap_set_rebind_proc,$LDAP_LIBS)
288 LIBS="$LIBS $LDAP_LIBS"
289 AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, smb_ldap_cv_ldap_set_rebind_proc, [
293 [ldap_set_rebind_proc(0, 0, 0);],
294 [smb_ldap_cv_ldap_set_rebind_proc=3],
295 [smb_ldap_cv_ldap_set_rebind_proc=2]
299 AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $smb_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
301 AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS)
303 if test x"$ac_cv_lib_ext_ldap_ldap_init" = x"yes" -a x"$ac_cv_func_ext_ldap_domain2hostlist" = x"yes"; then
304 AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
305 default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
306 SMBLDAP="lib/smbldap.o"
307 with_ldap_support=yes
308 AC_MSG_CHECKING(whether LDAP support is used)
311 if test x"$with_ldap_support" = x"yes"; then
312 AC_MSG_ERROR(libldap is needed for LDAP support)
314 AC_MSG_WARN(libldap is needed for LDAP support)
323 AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules])
325 #################################################
326 # do extra things if we are running insure
328 if test "${ac_cv_prog_CC}" = "insure"; then
329 CPPFLAGS="$CPPFLAGS -D__INSURE__"
332 #################################################
333 # final configure stuff
335 AC_MSG_CHECKING([configure summary])
336 AC_TRY_RUN([#include "${srcdir-.}/build/tests/summary.c"],
338 AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
339 AC_MSG_WARN([cannot run when cross-compiling]))
344 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
345 LIB_REMOVE_USR_LIB(LDFLAGS)
346 LIB_REMOVE_USR_LIB(LIBS)
348 dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
349 CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
350 CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)