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 nmbdsocketdir="${lockdir}/.nmbd"
23 test "${mandir}" || mandir="\${prefix}/man"
24 logfilebase="\${VARDIR}"
25 privatedir="\${prefix}/private"
26 test "${libdir}" || libdir="\${prefix}/lib"
27 modulesdir="${libdir}"
28 pammodulesdir="${libdir}/security"
30 swatdir="\${prefix}/swat"
31 codepagedir="\${MODULESDIR}"
32 statedir="\${LOCKDIR}"
33 cachedir="\${LOCKDIR}"
34 localedir="\${prefix}/share/locale"
37 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
40 lockdir="\${VARDIR}/lib/samba"
41 piddir="\${VARDIR}/run"
42 mandir="\${prefix}/share/man"
43 logfilebase="\${VARDIR}/log/samba"
44 privatedir="\${CONFIGDIR}/private"
45 test "${libdir}" || libdir="\${prefix}/lib"
46 modulesdir="${libdir}/samba"
47 configdir="\${sysconfdir}/samba"
48 swatdir="\${DATADIR}/samba/swat"
49 codepagedir="\${MODULESDIR}"
50 statedir="\${VARDIR}/lib/samba"
51 cachedir="\${VARDIR}/lib/samba"
52 ncalrpcdir="\${VARDIR}/ncalrpc"
53 AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
57 #################################################
58 # set private directory location
59 AC_ARG_WITH(privatedir,
60 [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
64 # Just in case anybody calls it without argument
66 AC_MSG_WARN([--with-privatedir called without argument - will use default])
73 #################################################
74 # set root sbin directory location
75 AC_ARG_WITH(rootsbindir,
76 [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
80 # Just in case anybody calls it without argument
82 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
85 rootsbindir="$withval"
89 #################################################
90 # set lock directory location
92 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
96 # Just in case anybody calls it without argument
98 AC_MSG_WARN([--with-lockdir called without argument - will use default])
105 #################################################
106 # set state directory location
107 AC_ARG_WITH(statedir,
108 [AS_HELP_STRING([--with-statedir=DIR], [Where to put persistent state files ($ac_default_prefix/var/locks)])],
112 # Just in case anybody calls it without argument
114 AC_MSG_WARN([--with-statedir called without argument - will use default])
121 #################################################
122 # set cache directory location
123 AC_ARG_WITH(cachedir,
124 [AS_HELP_STRING([--with-cachedir=DIR], [Where to put temporary cache files ($ac_default_prefix/var/locks)])],
128 # Just in case anybody calls it without argument
130 AC_MSG_WARN([--with-cachedir called without argument - will use default])
137 #################################################
138 # set pid directory location
140 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
144 # Just in case anybody calls it without argument
146 AC_MSG_WARN([--with-piddir called without argument - will use default])
153 #################################################
154 # set ncalrpc directory location
155 AC_ARG_WITH(ncalrpcdir,
156 [AS_HELP_STRING([--with-ncalrpcdir=DIR], [Where to put ncalrpc sockets ($ac_default_prefix/var/ncalrpc)])],
160 # Just in case anybody calls it without argument
162 AC_MSG_WARN([--with-ncalrpcdir called without argument - will use default])
165 ncalrpcdir="$withval"
169 #################################################
170 # set nmbd socket directory location
171 AC_ARG_WITH(nmbdsocketdir,
172 [AS_HELP_STRING([--with-nmbdsocketdir=DIR], [Where to put the nmbd socket directory (${lockdir}/.nmbd)])],
176 # Just in case anybody calls it without argument
178 AC_MSG_WARN([--with-nmbdsocketdir called without argument - will use default])
181 nmbdsocketdir="$withval"
185 #################################################
186 # set SWAT directory location
188 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
192 # Just in case anybody does it
194 AC_MSG_WARN([--with-swatdir called without argument - will use default])
201 #################################################
202 # set configuration directory location
203 AC_ARG_WITH(configdir,
204 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
208 # Just in case anybody does it
210 AC_MSG_WARN([--with-configdir called without argument - will use default])
217 #################################################
218 # set log directory location
219 AC_ARG_WITH(logfilebase,
220 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
224 # Just in case anybody does it
226 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
229 logfilebase="$withval"
234 #################################################
235 # set shared modules (internal lib) directory location
236 AC_ARG_WITH(modulesdir,
237 [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
241 # Just in case anybody does it
243 AC_MSG_WARN([--with-modulesdir without argument - will use default])
246 modulesdir="$withval"
250 #################################################
251 # set PAM modules directory location
252 AC_ARG_WITH(pammodulesdir,
253 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
257 # Just in case anybody calls it without argument
259 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
262 pammodulesdir="$withval"
266 #################################################
267 # set man directory location
269 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
273 # Just in case anybody does it
275 AC_MSG_WARN([--with-mandir without argument - will use default])
282 ################################################
283 # set locale directory location
284 AC_ARG_WITH(localedir,
285 [AS_HELP_STRING([--with-localedir=DIR],[Where to put po files ($ac_default_prefix/share/locale)])],
289 # Just in case anybody does it
291 AC_MSG_WARN([--with-localedir called without argument - will use default])
298 #################################################
299 # set codepage directory location
300 AC_ARG_WITH(codepagedir,
301 [AS_HELP_STRING([--with-codepagedir=DIR], [Where to put codepages ($ac_default_prefix/lib/samba)])],
305 # Just in case anybody calls it without argument
307 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
310 codepagedir="$withval"
318 AC_SUBST(nmbdsocketdir)
320 AC_SUBST(logfilebase)
325 AC_SUBST(codepagedir)
328 AC_SUBST(rootsbindir)
329 AC_SUBST(pammodulesdir)
333 #################################################
334 # set prefix for 'make test'
335 selftest_prefix="./st"
336 AC_SUBST(selftest_prefix)
337 AC_ARG_WITH(selftest-prefix,
338 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
341 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
344 selftest_prefix="$withval"
349 #################################################
350 # set shrdir for 'make test'
352 AC_SUBST(selftest_shrdir)
353 AC_ARG_WITH(selftest-shrdir,
354 [AS_HELP_STRING([--with-selftest-shrdir=DIR], [The share directory that make test will be run against ($selftest_shrdir)])],
357 AC_MSG_WARN([--with-selftest-shrdir called without argument - will use default])
360 selftest_shrdir="-s $withval"
365 #################################################
366 # set path of samba4's smbtorture
368 AC_SUBST(smbtorture4_path)
369 smbtorture4_option=""
370 AC_SUBST(smbtorture4_option)
371 AC_ARG_WITH(smbtorture4_path,
372 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
375 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
378 smbtorture4_path="$withval"
379 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
380 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
382 smbtorture4_option="-t $withval"
387 #################################################
388 # set custom conf for make test
389 selftest_custom_conf=""
390 AC_SUBST(selftest_custom_conf)
391 AC_ARG_WITH(selftest_custom_conf,
392 [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)])],
395 AC_MSG_ERROR([--with-selftest-custom-conf should take a path])
398 selftest_custom_conf="$withval"
399 if test -z "$selftest_custom_conf" -a ! -f $selftest_custom_conf; then
400 AC_MSG_ERROR(['$selftest_custom_conf' does not exist!])
402 selftest_custom_conf="-c $withval"
407 ## check for --enable-debug first before checking CFLAGS before
408 ## so that we don't mix -O and -g
411 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
412 [if eval "test x$enable_debug = xyes"; then
418 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
419 [if eval "test x$enable_developer = xyes"; then
425 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
426 [if eval "test x$enable_krb5developer = xyes"; then
433 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
434 [if eval "test x$enable_picky_developer = xyes"; then
441 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
443 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
444 # Should have been in framework $withval/CoreFoundation.framework/Headers.
446 $withval/CoreFoundation/StringEncodings.subproj \
447 $withval/StringEncodings.subproj \
448 $withval/CoreFoundation.framework/Headers \
452 if test -r $d/CFStringEncodingConverter.h; then
453 ln -sfh $d include/CoreFoundation