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
7 AC_INIT(include/includes.h)
8 AC_CONFIG_HEADER(include/config.h)
13 SMB_VERSION_STRING=`cat include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
14 echo "SAMBA VERSION: ${SMB_VERSION_STRING}"
16 #################################################
17 # Directory handling stuff to support both the
18 # legacy SAMBA directories and FHS compliant
20 AC_PREFIX_DEFAULT(/usr/local/samba)
23 [ --with-fhs Use FHS-compliant paths (default=no)],
24 configdir="${sysconfdir}/samba"
25 lockdir="\${VARDIR}/cache/samba"
26 piddir="\${VARDIR}/run/samba"
27 logfilebase="\${VARDIR}/log/samba"
28 privatedir="\${CONFIGDIR}/private"
29 libdir="\${prefix}/lib/samba"
30 swatdir="\${DATADIR}/samba/swat",
31 configdir="\${LIBDIR}"
32 logfilebase="\${VARDIR}"
33 lockdir="\${VARDIR}/locks"
34 piddir="\${VARDIR}/locks"
35 privatedir="\${prefix}/private"
36 swatdir="\${prefix}/swat")
38 #################################################
39 # set private directory location
40 AC_ARG_WITH(privatedir,
41 [ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
45 # Just in case anybody calls it without argument
47 AC_MSG_WARN([--with-privatedir called without argument - will use default])
54 #################################################
55 # set lock directory location
57 [ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
61 # Just in case anybody calls it without argument
63 AC_MSG_WARN([--with-lockdir called without argument - will use default])
70 #################################################
71 # set pid directory location
73 [ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)],
77 # Just in case anybody calls it without argument
79 AC_MSG_WARN([--with-piddir called without argument - will use default])
86 #################################################
87 # set configuration directory location
88 AC_ARG_WITH(configdir,
89 [ --with-configdir=DIR Where to put configuration files (\$libdir)],
93 # Just in case anybody does it
95 AC_MSG_WARN([--with-configdir called without argument - will use default])
102 #################################################
103 # set log directory location
104 AC_ARG_WITH(logfilebase,
105 [ --with-logfilebase=DIR Where to put log files (\$(VARDIR))],
109 # Just in case anybody does it
111 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
114 logfilebase="$withval"
121 AC_SUBST(logfilebase)
126 dnl Unique-to-Samba variables we'll be playing with.
136 AC_SUBST(INSTALLCLIENTCMD_SH)
137 AC_SUBST(INSTALLCLIENTCMD_A)
138 AC_SUBST(LIBSMBCLIENT_SHARED)
139 AC_SUBST(LIBSMBCLIENT)
143 AC_SUBST(SHLIB_PROGS)
145 AC_SUBST(EXTRA_BIN_PROGS)
146 AC_SUBST(EXTRA_SBIN_PROGS)
147 AC_SUBST(EXTRA_ALL_TARGETS)
151 [ --enable-debug Turn on compiler debugging information (default=no)],
152 [if eval "test x$enable_debug = xyes"; then
154 CFLAGS="${CFLAGS} -g"
158 AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
159 [if eval "test x$enable_developer = xyes"; then
161 CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
164 AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
165 [if eval "test x$enable_krb5developer = xyes"; then
167 CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
171 AC_ARG_ENABLE(experimental, [ --enable-experimental Turn on experimental features (default=no)],
172 [if eval "test x$enable_experimental = xyes"; then
176 sinclude(build/m4/rewrite.m4)
178 dnl exclude these modules
179 AC_ARG_WITH(exclude-modules,
180 [ --with-exclude-modules=MODULES Comma-seperated list of names of modules to exclude from build],
181 [ if test $withval; then
182 for i in `echo $withval | sed -e's/,/ /g'`
184 eval SMB_MODULE_$i=NOT
188 dnl Always built these modules shared
189 AC_ARG_WITH(shared-modules,
190 [ --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared],
191 [ if test $withval; then
192 for i in `echo $withval | sed -e's/,/ /g'`
194 eval SMB_MODULE_$i=SHARED
198 dnl Always built these modules static
199 AC_ARG_WITH(static-modules,
200 [ --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in],
201 [ if test $withval; then
202 for i in `echo $withval | sed -e's/,/ /g'`
204 eval SMB_MODULE_$i=STATIC
208 SMB_INCLUDE_M4(lib/popt/config.m4)
209 SMB_INCLUDE_M4(lib/iconv.m4)
210 SMB_INCLUDE_M4(lib/basic.m4)
211 SMB_INCLUDE_M4(lib/tdb/config.m4)
212 SMB_INCLUDE_M4(lib/ldb/config.m4)
213 SMB_INCLUDE_M4(lib/cmdline/config.m4)
214 SMB_INCLUDE_M4(param/config.m4)
215 SMB_INCLUDE_M4(libcli/config.m4)
216 SMB_INCLUDE_M4(librpc/config.m4)
217 SMB_INCLUDE_M4(libcli/libsmb.m4)
218 SMB_INCLUDE_M4(smbd/process_model.m4)
219 SMB_INCLUDE_M4(smb_server/config.m4)
220 SMB_INCLUDE_M4(auth/config.m4)
221 SMB_INCLUDE_M4(ntvfs/config.m4)
222 SMB_INCLUDE_M4(rpc_server/config.m4)
223 SMB_INCLUDE_M4(lib/registry/config.m4)
224 SMB_INCLUDE_M4(torture/config.m4)
225 SMB_INCLUDE_M4(scripting/config.m4)
226 SMB_INCLUDE_M4(client/config.m4)
227 SMB_INCLUDE_M4(utils/config.m4)
228 SMB_INCLUDE_M4(smbd/config.m4)
231 ALLLIBS_CFLAGS="$CFLAGS"
232 ALLLIBS_CPPFLAGS="$CPPFLAGS"
233 ALLLIBS_LDFLAGS="$LDFLAGS"
235 SMB_EXT_LIB_ENABLE(ALLLIBS,YES)
240 [${ALLLIBS_CPPFLAGS}],
241 [${ALLLIBS_LDFLAGS}])
243 AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules])
245 #################################################
246 # do extra things if we are running insure
248 if test "${ac_cv_prog_CC}" = "insure"; then
249 CPPFLAGS="$CPPFLAGS -D__INSURE__"
252 #################################################
253 # final configure stuff
255 AC_MSG_CHECKING([configure summary])
256 AC_TRY_RUN([#include "${srcdir-.}/build/tests/summary.c"],
258 AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
259 AC_MSG_WARN([cannot run when cross-compiling]))
264 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
265 LIB_REMOVE_USR_LIB(LDFLAGS)
266 LIB_REMOVE_USR_LIB(LIBS)
268 dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
269 CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
270 CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
272 SMB_AC_OUTPUT(Makefile)