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}"
33 localedir="\${prefix}/share/locale"
36 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
39 lockdir="\${VARDIR}/lib/samba"
40 piddir="\${VARDIR}/run"
41 mandir="\${prefix}/share/man"
42 logfilebase="\${VARDIR}/log/samba"
43 privatedir="\${CONFIGDIR}/private"
44 test "${libdir}" || libdir="\${prefix}/lib"
45 modulesdir="${libdir}/samba"
46 configdir="\${sysconfdir}/samba"
47 swatdir="\${DATADIR}/samba/swat"
48 codepagedir="\${MODULESDIR}"
49 statedir="\${VARDIR}/lib/samba"
50 cachedir="\${VARDIR}/lib/samba"
51 ncalrpcdir="\${VARDIR}/ncalrpc"
52 AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
56 #################################################
57 # set private directory location
58 AC_ARG_WITH(privatedir,
59 [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
63 # Just in case anybody calls it without argument
65 AC_MSG_WARN([--with-privatedir called without argument - will use default])
72 #################################################
73 # set root sbin directory location
74 AC_ARG_WITH(rootsbindir,
75 [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
79 # Just in case anybody calls it without argument
81 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
84 rootsbindir="$withval"
88 #################################################
89 # set lock directory location
91 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
95 # Just in case anybody calls it without argument
97 AC_MSG_WARN([--with-lockdir called without argument - will use default])
104 #################################################
105 # set state directory location
106 AC_ARG_WITH(statedir,
107 [AS_HELP_STRING([--with-statedir=DIR], [Where to put persistent state files ($ac_default_prefix/var/locks)])],
111 # Just in case anybody calls it without argument
113 AC_MSG_WARN([--with-statedir called without argument - will use default])
120 #################################################
121 # set cache directory location
122 AC_ARG_WITH(cachedir,
123 [AS_HELP_STRING([--with-cachedir=DIR], [Where to put temporary cache files ($ac_default_prefix/var/locks)])],
127 # Just in case anybody calls it without argument
129 AC_MSG_WARN([--with-cachedir called without argument - will use default])
136 #################################################
137 # set pid directory location
139 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
143 # Just in case anybody calls it without argument
145 AC_MSG_WARN([--with-piddir called without argument - will use default])
152 #################################################
153 # set ncalrpc directory location
154 AC_ARG_WITH(ncalrpcdir,
155 [AS_HELP_STRING([--with-ncalrpcdir=DIR], [Where to put ncalrpc sockets ($ac_default_prefix/var/ncalrpc)])],
159 # Just in case anybody calls it without argument
161 AC_MSG_WARN([--with-ncalrpcdir called without argument - will use default])
164 ncalrpcdir="$withval"
168 #################################################
169 # set SWAT directory location
171 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
175 # Just in case anybody does it
177 AC_MSG_WARN([--with-swatdir called without argument - will use default])
184 #################################################
185 # set configuration directory location
186 AC_ARG_WITH(configdir,
187 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
191 # Just in case anybody does it
193 AC_MSG_WARN([--with-configdir called without argument - will use default])
200 #################################################
201 # set log directory location
202 AC_ARG_WITH(logfilebase,
203 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
207 # Just in case anybody does it
209 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
212 logfilebase="$withval"
217 #################################################
218 # set shared modules (internal lib) directory location
219 AC_ARG_WITH(modulesdir,
220 [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
224 # Just in case anybody does it
226 AC_MSG_WARN([--with-modulesdir without argument - will use default])
229 modulesdir="$withval"
233 #################################################
234 # set PAM modules directory location
235 AC_ARG_WITH(pammodulesdir,
236 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
240 # Just in case anybody calls it without argument
242 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
245 pammodulesdir="$withval"
249 #################################################
250 # set man directory location
252 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
256 # Just in case anybody does it
258 AC_MSG_WARN([--with-mandir without argument - will use default])
265 ################################################
266 # set locale directory location
267 AC_ARG_WITH(localedir,
268 [AS_HELP_STRING([--with-localedir=DIR],[Where to put po files ($ac_default_prefix/share/locale)])],
272 # Just in case anybody does it
274 AC_MSG_WARN([--with-localedir called without argument - will use default])
281 #################################################
282 # set codepage directory location
283 AC_ARG_WITH(codepagedir,
284 [AS_HELP_STRING([--with-codepagedir=DIR], [Where to put codepages ($ac_default_prefix/lib/samba)])],
288 # Just in case anybody calls it without argument
290 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
293 codepagedir="$withval"
302 AC_SUBST(logfilebase)
307 AC_SUBST(codepagedir)
310 AC_SUBST(rootsbindir)
311 AC_SUBST(pammodulesdir)
315 #################################################
316 # set prefix for 'make test'
317 selftest_prefix="./st"
318 AC_SUBST(selftest_prefix)
319 AC_ARG_WITH(selftest-prefix,
320 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
323 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
326 selftest_prefix="$withval"
331 #################################################
332 # set shrdir for 'make test'
334 AC_SUBST(selftest_shrdir)
335 AC_ARG_WITH(selftest-shrdir,
336 [AS_HELP_STRING([--with-selftest-shrdir=DIR], [The share directory that make test will be run against ($selftest_shrdir)])],
339 AC_MSG_WARN([--with-selftest-shrdir called without argument - will use default])
342 selftest_shrdir="-s $withval"
347 #################################################
348 # set path of samba4's smbtorture
350 AC_SUBST(smbtorture4_path)
351 smbtorture4_option=""
352 AC_SUBST(smbtorture4_option)
353 AC_ARG_WITH(smbtorture4_path,
354 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
357 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
360 smbtorture4_path="$withval"
361 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
362 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
364 smbtorture4_option="-t $withval"
369 #################################################
370 # set custom conf for make test
371 selftest_custom_conf=""
372 AC_SUBST(selftest_custom_conf)
373 AC_ARG_WITH(selftest_custom_conf,
374 [AS_HELP_STRING([--with-selftest-custom-conf=PATH], [An optional custom smb.conf that is included in the server smb.conf during make test(none)])],
377 AC_MSG_ERROR([--with-selftest-custom-conf should take a path])
380 selftest_custom_conf="$withval"
381 if test -z "$selftest_custom_conf" -a ! -f $selftest_custom_conf; then
382 AC_MSG_ERROR(['$selftest_custom_conf' does not exist!])
384 selftest_custom_conf="-c $withval"
389 ## check for --enable-debug first before checking CFLAGS before
390 ## so that we don't mix -O and -g
393 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
394 [if eval "test x$enable_debug = xyes"; then
400 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
401 [if eval "test x$enable_developer = xyes"; then
407 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
408 [if eval "test x$enable_krb5developer = xyes"; then
415 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
416 [if eval "test x$enable_picky_developer = xyes"; then
423 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
425 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
426 # Should have been in framework $withval/CoreFoundation.framework/Headers.
428 $withval/CoreFoundation/StringEncodings.subproj \
429 $withval/StringEncodings.subproj \
430 $withval/CoreFoundation.framework/Headers \
434 if test -r $d/CFStringEncodingConverter.h; then
435 ln -sfh $d include/CoreFoundation