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}"
32 localedir="\${prefix}/share/locale"
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 AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
54 #################################################
55 # set private directory location
56 AC_ARG_WITH(privatedir,
57 [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
61 # Just in case anybody calls it without argument
63 AC_MSG_WARN([--with-privatedir called without argument - will use default])
70 #################################################
71 # set root sbin directory location
72 AC_ARG_WITH(rootsbindir,
73 [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
77 # Just in case anybody calls it without argument
79 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
82 rootsbindir="$withval"
86 #################################################
87 # set lock directory location
89 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
93 # Just in case anybody calls it without argument
95 AC_MSG_WARN([--with-lockdir called without argument - will use default])
102 #################################################
103 # set pid directory location
105 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
109 # Just in case anybody calls it without argument
111 AC_MSG_WARN([--with-piddir called without argument - will use default])
118 #################################################
119 # set SWAT directory location
121 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
125 # Just in case anybody does it
127 AC_MSG_WARN([--with-swatdir called without argument - will use default])
134 #################################################
135 # set configuration directory location
136 AC_ARG_WITH(configdir,
137 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
141 # Just in case anybody does it
143 AC_MSG_WARN([--with-configdir called without argument - will use default])
150 #################################################
151 # set log directory location
152 AC_ARG_WITH(logfilebase,
153 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
157 # Just in case anybody does it
159 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
162 logfilebase="$withval"
167 #################################################
168 # set ctdb source directory location
170 [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
173 AC_MSG_WARN([--with-ctdb called without argument])
180 #################################################
181 # set shared modules (internal lib) directory location
182 AC_ARG_WITH(modulesdir,
183 [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
187 # Just in case anybody does it
189 AC_MSG_WARN([--with-modulesdir without argument - will use default])
192 modulesdir="$withval"
196 #################################################
197 # set PAM modules directory location
198 AC_ARG_WITH(pammodulesdir,
199 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
203 # Just in case anybody calls it without argument
205 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
208 pammodulesdir="$withval"
212 #################################################
213 # set man directory location
215 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
219 # Just in case anybody does it
221 AC_MSG_WARN([--with-mandir without argument - will use default])
228 ################################################
229 # set locale directory location
230 AC_ARG_WITH(localedir,
231 [ --with-localedir=DIR Where to put po files ($ac_default_prefix/share/locale)],
235 # Just in case anybody does it
237 AC_MSG_WARN([--with-localedir called without argument - will use default])
248 AC_SUBST(logfilebase)
254 AC_SUBST(codepagedir)
257 AC_SUBST(rootsbindir)
258 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 path of samba4's smbtorture
281 AC_SUBST(smbtorture4_path)
282 AC_ARG_WITH(smbtorture4_path,
283 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
286 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
289 smbtorture4_path="$withval"
290 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
291 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
297 ## check for --enable-debug first before checking CFLAGS before
298 ## so that we don't mix -O and -g
301 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
302 [if eval "test x$enable_debug = xyes"; then
307 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
308 [if eval "test x$enable_developer = xyes"; then
314 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
315 [if eval "test x$enable_krb5developer = xyes"; then
322 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
323 [if eval "test x$enable_picky_developer = xyes"; then
330 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
332 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
333 # Should have been in framework $withval/CoreFoundation.framework/Headers.
335 $withval/CoreFoundation/StringEncodings.subproj \
336 $withval/StringEncodings.subproj \
337 $withval/CoreFoundation.framework/Headers \
341 if test -r $d/CFStringEncodingConverter.h; then
342 ln -sfh $d include/CoreFoundation