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"
27 configdir="\${LIBDIR}"
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/samba"
43 modulesdir="\${LIBDIR}"
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 lib directory location
182 [AS_HELP_STRING([--with-libdir=DIR], [Where to put libdir ($libdir)])],
186 # Just in case anybody does it
188 AC_MSG_WARN([--with-libdir without argument - will use default])
195 #################################################
196 # set shared modules (internal lib) directory location
197 AC_ARG_WITH(modulesdir,
198 [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
202 # Just in case anybody does it
204 AC_MSG_WARN([--with-modulesdir without argument - will use default])
207 modulesdir="$withval"
211 #################################################
212 # set PAM modules directory location
213 AC_ARG_WITH(pammodulesdir,
214 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
218 # Just in case anybody calls it without argument
220 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
223 pammodulesdir="$withval"
227 #################################################
228 # set man directory location
230 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
234 # Just in case anybody does it
236 AC_MSG_WARN([--with-mandir without argument - will use default])
246 AC_SUBST(logfilebase)
252 AC_SUBST(codepagedir)
255 AC_SUBST(rootsbindir)
256 AC_SUBST(pammodulesdir)
259 #################################################
260 # set prefix for 'make test'
261 selftest_prefix="./st"
262 AC_SUBST(selftest_prefix)
263 AC_ARG_WITH(selftest-prefix,
264 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
267 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
270 selftest_prefix="$withval"
275 #################################################
276 # set path of samba4's smbtorture
278 AC_SUBST(smbtorture4_path)
279 AC_ARG_WITH(smbtorture4_path,
280 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
283 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
286 smbtorture4_path="$withval"
287 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
288 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
294 ## check for --enable-debug first before checking CFLAGS before
295 ## so that we don't mix -O and -g
298 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
299 [if eval "test x$enable_debug = xyes"; then
304 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
305 [if eval "test x$enable_developer = xyes"; then
311 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
312 [if eval "test x$enable_krb5developer = xyes"; then
319 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
320 [if eval "test x$enable_picky_developer = xyes"; then
327 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
329 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
330 # Should have been in framework $withval/CoreFoundation.framework/Headers.
332 $withval/CoreFoundation/StringEncodings.subproj \
333 $withval/StringEncodings.subproj \
334 $withval/CoreFoundation.framework/Headers \
338 if test -r $d/CFStringEncodingConverter.h; then
339 ln -sfh $d include/CoreFoundation