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)
215 sinclude(scripting/config.m4)
217 AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules])
219 #################################################
220 # do extra things if we are running insure
222 if test "${ac_cv_prog_CC}" = "insure"; then
223 CPPFLAGS="$CPPFLAGS -D__INSURE__"
226 #################################################
227 # final configure stuff
229 AC_MSG_CHECKING([configure summary])
230 AC_TRY_RUN([#include "${srcdir-.}/build/tests/summary.c"],
232 AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
233 AC_MSG_WARN([cannot run when cross-compiling]))
238 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
239 LIB_REMOVE_USR_LIB(LDFLAGS)
240 LIB_REMOVE_USR_LIB(LIBS)
242 dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
243 CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
244 CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)