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 pammodulesdir="\${LIBDIR}/security"
26 configdir="\${LIBDIR}"
27 swatdir="\${prefix}/swat"
28 codepagedir="\${LIBDIR}"
29 statedir="\${LOCKDIR}"
30 cachedir="\${LOCKDIR}"
33 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
36 lockdir="\${VARDIR}/lib/samba"
37 piddir="\${VARDIR}/run"
38 mandir="\${prefix}/share/man"
39 logfilebase="\${VARDIR}/log/samba"
40 privatedir="\${CONFIGDIR}/private"
41 test "${libdir}" || libdir="\${prefix}/lib/samba"
42 configdir="\${sysconfdir}/samba"
43 swatdir="\${DATADIR}/samba/swat"
44 codepagedir="\${LIBDIR}"
45 statedir="\${VARDIR}/lib/samba"
46 cachedir="\${VARDIR}/lib/samba"
47 AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
51 #################################################
52 # set private directory location
53 AC_ARG_WITH(privatedir,
54 [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
58 # Just in case anybody calls it without argument
60 AC_MSG_WARN([--with-privatedir called without argument - will use default])
67 #################################################
68 # set root sbin directory location
69 AC_ARG_WITH(rootsbindir,
70 [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
74 # Just in case anybody calls it without argument
76 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
79 rootsbindir="$withval"
83 #################################################
84 # set lock directory location
86 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
90 # Just in case anybody calls it without argument
92 AC_MSG_WARN([--with-lockdir called without argument - will use default])
99 #################################################
100 # set pid directory location
102 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
106 # Just in case anybody calls it without argument
108 AC_MSG_WARN([--with-piddir called without argument - will use default])
115 #################################################
116 # set SWAT directory location
118 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
122 # Just in case anybody does it
124 AC_MSG_WARN([--with-swatdir called without argument - will use default])
131 #################################################
132 # set configuration directory location
133 AC_ARG_WITH(configdir,
134 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
138 # Just in case anybody does it
140 AC_MSG_WARN([--with-configdir called without argument - will use default])
147 #################################################
148 # set log directory location
149 AC_ARG_WITH(logfilebase,
150 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
154 # Just in case anybody does it
156 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
159 logfilebase="$withval"
164 #################################################
165 # set ctdb source directory location
167 [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
170 AC_MSG_WARN([--with-ctdb called without argument])
177 #################################################
178 # set lib directory location
180 [AS_HELP_STRING([--with-libdir=DIR], [Where to put libdir ($libdir)])],
184 # Just in case anybody does it
186 AC_MSG_WARN([--with-libdir without argument - will use default])
193 #################################################
194 # set PAM modules directory location
195 AC_ARG_WITH(pammodulesdir,
196 [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
200 # Just in case anybody calls it without argument
202 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
205 pammodulesdir="$withval"
209 #################################################
210 # set man directory location
212 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
216 # Just in case anybody does it
218 AC_MSG_WARN([--with-mandir without argument - will use default])
228 AC_SUBST(logfilebase)
234 AC_SUBST(codepagedir)
237 AC_SUBST(rootsbindir)
238 AC_SUBST(pammodulesdir)
240 #################################################
241 # set prefix for 'make test'
242 selftest_prefix="./st"
243 AC_SUBST(selftest_prefix)
244 AC_ARG_WITH(selftest-prefix,
245 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
248 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
251 selftest_prefix="$withval"
256 #################################################
257 # set path of samba4's smbtorture
259 AC_SUBST(smbtorture4_path)
260 AC_ARG_WITH(smbtorture4_path,
261 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
264 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
267 smbtorture4_path="$withval"
268 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
269 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
275 ## check for --enable-debug first before checking CFLAGS before
276 ## so that we don't mix -O and -g
279 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
280 [if eval "test x$enable_debug = xyes"; then
285 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
286 [if eval "test x$enable_developer = xyes"; then
292 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
293 [if eval "test x$enable_krb5developer = xyes"; then
300 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
302 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
303 # Should have been in framework $withval/CoreFoundation.framework/Headers.
305 $withval/CoreFoundation/StringEncodings.subproj \
306 $withval/StringEncodings.subproj \
307 $withval/CoreFoundation.framework/Headers \
311 if test -r $d/CFStringEncodingConverter.h; then
312 ln -sfh $d include/CoreFoundation