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 ncalrpcdir="\${VARDIR}/ncalrpc"
22 test "${mandir}" || mandir="\${prefix}/man"
23 logfilebase="\${VARDIR}"
24 privatedir="\${prefix}/private"
25 test "${libdir}" || libdir="\${prefix}/lib"
26 modulesdir="${libdir}"
27 pammodulesdir="${libdir}/security"
29 swatdir="\${prefix}/swat"
30 codepagedir="\${MODULESDIR}"
31 statedir="\${LOCKDIR}"
32 cachedir="\${LOCKDIR}"
35 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
38 lockdir="\${VARDIR}/lib/samba"
39 piddir="\${VARDIR}/run"
40 mandir="\${prefix}/share/man"
41 logfilebase="\${VARDIR}/log/samba"
42 privatedir="\${CONFIGDIR}/private"
43 test "${libdir}" || libdir="\${prefix}/lib"
44 modulesdir="${libdir}/samba"
45 configdir="\${sysconfdir}/samba"
46 swatdir="\${DATADIR}/samba/swat"
47 codepagedir="\${MODULESDIR}"
48 statedir="\${VARDIR}/lib/samba"
49 cachedir="\${VARDIR}/lib/samba"
50 ncalrpcdir="\${VARDIR}/ncalrpc"
51 AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
55 #################################################
56 # set private directory location
57 AC_ARG_WITH(privatedir,
58 [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
62 # Just in case anybody calls it without argument
64 AC_MSG_WARN([--with-privatedir called without argument - will use default])
71 #################################################
72 # set root sbin directory location
73 AC_ARG_WITH(rootsbindir,
74 [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
78 # Just in case anybody calls it without argument
80 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
83 rootsbindir="$withval"
87 #################################################
88 # set lock directory location
90 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
94 # Just in case anybody calls it without argument
96 AC_MSG_WARN([--with-lockdir called without argument - will use default])
103 #################################################
104 # set pid directory location
106 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
110 # Just in case anybody calls it without argument
112 AC_MSG_WARN([--with-piddir called without argument - will use default])
119 #################################################
120 # set ncalrpc directory location
121 AC_ARG_WITH(ncalprcdir,
122 [AS_HELP_STRING([--with-ncalprcdir=DIR], [Where to put ncalrpc sockets ($ac_default_prefix/var/ncalrpc)])],
126 # Just in case anybody calls it without argument
128 AC_MSG_WARN([--with-ncalrpcdir called without argument - will use default])
131 ncalrpcdir="$withval"
135 #################################################
136 # set SWAT directory location
138 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
142 # Just in case anybody does it
144 AC_MSG_WARN([--with-swatdir called without argument - will use default])
151 #################################################
152 # set configuration directory location
153 AC_ARG_WITH(configdir,
154 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
158 # Just in case anybody does it
160 AC_MSG_WARN([--with-configdir called without argument - will use default])
167 #################################################
168 # set log directory location
169 AC_ARG_WITH(logfilebase,
170 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
174 # Just in case anybody does it
176 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
179 logfilebase="$withval"
184 #################################################
185 # set ctdb source directory location
187 [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
190 AC_MSG_WARN([--with-ctdb called without argument])
197 #################################################
198 # set shared modules (internal lib) directory location
199 AC_ARG_WITH(modulesdir,
200 [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
204 # Just in case anybody does it
206 AC_MSG_WARN([--with-modulesdir without argument - will use default])
209 modulesdir="$withval"
213 #################################################
214 # set PAM modules directory location
215 AC_ARG_WITH(pammodulesdir,
216 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
220 # Just in case anybody calls it without argument
222 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
225 pammodulesdir="$withval"
229 #################################################
230 # set man directory location
232 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
236 # Just in case anybody does it
238 AC_MSG_WARN([--with-mandir without argument - will use default])
249 AC_SUBST(logfilebase)
255 AC_SUBST(codepagedir)
258 AC_SUBST(rootsbindir)
259 AC_SUBST(pammodulesdir)
262 #################################################
263 # set prefix for 'make test'
264 selftest_prefix="./st"
265 AC_SUBST(selftest_prefix)
266 AC_ARG_WITH(selftest-prefix,
267 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
270 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
273 selftest_prefix="$withval"
278 #################################################
279 # set shrdir for 'make test'
281 AC_SUBST(selftest_shrdir)
282 AC_ARG_WITH(selftest-shrdir,
283 [AS_HELP_STRING([--with-selftest-shrdir=DIR], [The share directory that make test will be run against ($selftest_shrdir)])],
286 AC_MSG_WARN([--with-selftest-shrdir called without argument - will use default])
289 selftest_shrdir="$withval"
294 #################################################
295 # set path of samba4's smbtorture
297 AC_SUBST(smbtorture4_path)
298 AC_ARG_WITH(smbtorture4_path,
299 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
302 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
305 smbtorture4_path="$withval"
306 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
307 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
313 ## check for --enable-debug first before checking CFLAGS before
314 ## so that we don't mix -O and -g
317 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
318 [if eval "test x$enable_debug = xyes"; then
324 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
325 [if eval "test x$enable_developer = xyes"; then
331 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
332 [if eval "test x$enable_krb5developer = xyes"; then
339 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
340 [if eval "test x$enable_picky_developer = xyes"; then
347 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
349 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
350 # Should have been in framework $withval/CoreFoundation.framework/Headers.
352 $withval/CoreFoundation/StringEncodings.subproj \
353 $withval/StringEncodings.subproj \
354 $withval/CoreFoundation.framework/Headers \
358 if test -r $d/CFStringEncodingConverter.h; then
359 ln -sfh $d include/CoreFoundation