2 dnl Samba3 build environment path checks
4 dnl Copyright (C) Michael Adam 2008
6 dnl Released under the GNU General Public License
7 dnl http://www.gnu.org/licenses/
10 AC_LIBREPLACE_LOCATION_CHECKS
12 #################################################
13 # Directory handling stuff to support both the
14 # legacy SAMBA directories and FHS compliant
16 AC_PREFIX_DEFAULT(/usr/local/samba)
18 rootsbindir="\${SBINDIR}"
19 lockdir="\${VARDIR}/locks"
20 piddir="\${VARDIR}/locks"
21 test "${mandir}" || mandir="\${prefix}/man"
22 logfilebase="\${VARDIR}"
23 privatedir="\${prefix}/private"
24 test "${libdir}" || libdir="\${prefix}/lib"
25 modulesdir="${libdir}"
26 pammodulesdir="${libdir}/security"
28 swatdir="\${prefix}/swat"
29 codepagedir="\${MODULESDIR}"
30 statedir="\${LOCKDIR}"
31 cachedir="\${LOCKDIR}"
34 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
37 lockdir="\${VARDIR}/lib/samba"
38 piddir="\${VARDIR}/run"
39 mandir="\${prefix}/share/man"
40 logfilebase="\${VARDIR}/log/samba"
41 privatedir="\${CONFIGDIR}/private"
42 test "${libdir}" || libdir="\${prefix}/lib"
43 modulesdir="${libdir}/samba"
44 configdir="\${sysconfdir}/samba"
45 swatdir="\${DATADIR}/samba/swat"
46 codepagedir="\${MODULESDIR}"
47 statedir="\${VARDIR}/lib/samba"
48 cachedir="\${VARDIR}/lib/samba"
49 AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
53 #################################################
54 # set private directory location
55 AC_ARG_WITH(privatedir,
56 [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
60 # Just in case anybody calls it without argument
62 AC_MSG_WARN([--with-privatedir called without argument - will use default])
69 #################################################
70 # set root sbin directory location
71 AC_ARG_WITH(rootsbindir,
72 [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
76 # Just in case anybody calls it without argument
78 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
81 rootsbindir="$withval"
85 #################################################
86 # set lock directory location
88 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
92 # Just in case anybody calls it without argument
94 AC_MSG_WARN([--with-lockdir called without argument - will use default])
101 #################################################
102 # set pid directory location
104 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
108 # Just in case anybody calls it without argument
110 AC_MSG_WARN([--with-piddir called without argument - will use default])
117 #################################################
118 # set SWAT directory location
120 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
124 # Just in case anybody does it
126 AC_MSG_WARN([--with-swatdir called without argument - will use default])
133 #################################################
134 # set configuration directory location
135 AC_ARG_WITH(configdir,
136 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
140 # Just in case anybody does it
142 AC_MSG_WARN([--with-configdir called without argument - will use default])
149 #################################################
150 # set log directory location
151 AC_ARG_WITH(logfilebase,
152 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
156 # Just in case anybody does it
158 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
161 logfilebase="$withval"
166 #################################################
167 # set ctdb source directory location
169 [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
172 AC_MSG_WARN([--with-ctdb called without argument])
179 #################################################
180 # set shared modules (internal lib) directory location
181 AC_ARG_WITH(modulesdir,
182 [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
186 # Just in case anybody does it
188 AC_MSG_WARN([--with-modulesdir without argument - will use default])
191 modulesdir="$withval"
195 #################################################
196 # set PAM modules directory location
197 AC_ARG_WITH(pammodulesdir,
198 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
202 # Just in case anybody calls it without argument
204 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
207 pammodulesdir="$withval"
211 #################################################
212 # set man directory location
214 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
218 # Just in case anybody does it
220 AC_MSG_WARN([--with-mandir without argument - will use default])
230 AC_SUBST(logfilebase)
236 AC_SUBST(codepagedir)
239 AC_SUBST(rootsbindir)
240 AC_SUBST(pammodulesdir)
243 #################################################
244 # set prefix for 'make test'
245 selftest_prefix="./st"
246 AC_SUBST(selftest_prefix)
247 AC_ARG_WITH(selftest-prefix,
248 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
251 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
254 selftest_prefix="$withval"
259 #################################################
260 # set path of samba4's smbtorture
262 AC_SUBST(smbtorture4_path)
263 AC_ARG_WITH(smbtorture4_path,
264 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
267 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
270 smbtorture4_path="$withval"
271 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
272 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
278 ## check for --enable-debug first before checking CFLAGS before
279 ## so that we don't mix -O and -g
282 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
283 [if eval "test x$enable_debug = xyes"; then
288 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
289 [if eval "test x$enable_developer = xyes"; then
295 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
296 [if eval "test x$enable_krb5developer = xyes"; then
303 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
304 [if eval "test x$enable_picky_developer = xyes"; then
311 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
313 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
314 # Should have been in framework $withval/CoreFoundation.framework/Headers.
316 $withval/CoreFoundation/StringEncodings.subproj \
317 $withval/StringEncodings.subproj \
318 $withval/CoreFoundation.framework/Headers \
322 if test -r $d/CFStringEncodingConverter.h; then
323 ln -sfh $d include/CoreFoundation