i18n/l10n pam_winbind
[samba.git] / source / m4 / check_path.m4
1 dnl
2 dnl Samba3 build environment path checks
3 dnl
4 dnl Copyright (C) Michael Adam 2008
5 dnl
6 dnl Released under the GNU General Public License
7 dnl http://www.gnu.org/licenses/
8 dnl
9
10 AC_LIBREPLACE_LOCATION_CHECKS
11
12 #################################################
13 # Directory handling stuff to support both the
14 # legacy SAMBA directories and FHS compliant
15 # ones...
16 AC_PREFIX_DEFAULT(/usr/local/samba)
17
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"
27 configdir="${libdir}"
28 swatdir="\${prefix}/swat"
29 codepagedir="\${MODULESDIR}"
30 statedir="\${LOCKDIR}"
31 cachedir="\${LOCKDIR}"
32 localedir="\${prefix}/share/locale"
33
34 AC_ARG_WITH(fhs,
35 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
36 [ case "$withval" in
37   yes)
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])
51     ;;
52   esac])
53
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)])],
58 [ case "$withval" in
59   yes|no)
60   #
61   # Just in case anybody calls it without argument
62   #
63     AC_MSG_WARN([--with-privatedir called without argument - will use default])
64   ;;
65   * )
66     privatedir="$withval"
67     ;;
68   esac])
69
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)])],
74 [ case "$withval" in
75   yes|no)
76   #
77   # Just in case anybody calls it without argument
78   #
79     AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
80   ;;
81   * )
82     rootsbindir="$withval"
83     ;;
84   esac])
85
86 #################################################
87 # set lock directory location
88 AC_ARG_WITH(lockdir,
89 [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
90 [ case "$withval" in
91   yes|no)
92   #
93   # Just in case anybody calls it without argument
94   #
95     AC_MSG_WARN([--with-lockdir called without argument - will use default])
96   ;;
97   * )
98     lockdir="$withval"
99     ;;
100   esac])
101
102 #################################################
103 # set pid directory location
104 AC_ARG_WITH(piddir,
105 [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
106 [ case "$withval" in
107   yes|no)
108   #
109   # Just in case anybody calls it without argument
110   #
111     AC_MSG_WARN([--with-piddir called without argument - will use default])
112   ;;
113   * )
114     piddir="$withval"
115     ;;
116   esac])
117
118 #################################################
119 # set SWAT directory location
120 AC_ARG_WITH(swatdir,
121 [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
122 [ case "$withval" in
123   yes|no)
124   #
125   # Just in case anybody does it
126   #
127     AC_MSG_WARN([--with-swatdir called without argument - will use default])
128   ;;
129   * )
130     swatdir="$withval"
131     ;;
132   esac])
133
134 #################################################
135 # set configuration directory location
136 AC_ARG_WITH(configdir,
137 [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
138 [ case "$withval" in
139   yes|no)
140   #
141   # Just in case anybody does it
142   #
143     AC_MSG_WARN([--with-configdir called without argument - will use default])
144   ;;
145   * )
146     configdir="$withval"
147     ;;
148   esac])
149
150 #################################################
151 # set log directory location
152 AC_ARG_WITH(logfilebase,
153 [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
154 [ case "$withval" in
155   yes|no)
156   #
157   # Just in case anybody does it
158   #
159     AC_MSG_WARN([--with-logfilebase called without argument - will use default])
160   ;;
161   * )
162     logfilebase="$withval"
163     ;;
164   esac])
165
166
167 #################################################
168 # set ctdb source directory location
169 AC_ARG_WITH(ctdb,
170 [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
171 [ case "$withval" in
172   yes|no)
173     AC_MSG_WARN([--with-ctdb called without argument])
174   ;;
175   * )
176     ctdbdir="$withval"
177     ;;
178   esac])
179
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)])],
184 [ case "$withval" in
185   yes|no)
186   #
187   # Just in case anybody does it
188   #
189     AC_MSG_WARN([--with-modulesdir without argument - will use default])
190   ;;
191   * )
192     modulesdir="$withval"
193     ;;
194   esac])
195
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)])],
200 [ case "$withval" in
201   yes|no)
202   #
203   # Just in case anybody calls it without argument
204   #
205     AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
206   ;;
207   * )
208     pammodulesdir="$withval"
209     ;;
210   esac])
211
212 #################################################
213 # set man directory location
214 AC_ARG_WITH(mandir,
215 [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
216 [ case "$withval" in
217   yes|no)
218   #
219   # Just in case anybody does it
220   #
221     AC_MSG_WARN([--with-mandir without argument - will use default])
222   ;;
223   * )
224     mandir="$withval"
225     ;;
226   esac])
227
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)],
232 [ case "$withval" in
233   yes|no)
234     #
235     # Just in case anybody does it
236     #
237     AC_MSG_WARN([--with-localedir called without argument - will use default])
238   ;;
239   *)
240   localedir="$withval"
241   ;;
242   esac])
243
244
245 AC_SUBST(configdir)
246 AC_SUBST(lockdir)
247 AC_SUBST(piddir)
248 AC_SUBST(logfilebase)
249 AC_SUBST(ctdbdir)
250 AC_SUBST(privatedir)
251 AC_SUBST(swatdir)
252 AC_SUBST(bindir)
253 AC_SUBST(sbindir)
254 AC_SUBST(codepagedir)
255 AC_SUBST(statedir)
256 AC_SUBST(cachedir)
257 AC_SUBST(rootsbindir)
258 AC_SUBST(pammodulesdir)
259 AC_SUBST(modulesdir)
260 AC_SUBST(localedir)
261
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)])],
268 [ case "$withval" in
269   yes|no)
270     AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
271   ;;
272   * )
273     selftest_prefix="$withval"
274     ;;
275   esac
276 ])
277
278 #################################################
279 # set path of samba4's smbtorture
280 smbtorture4_path=""
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)])],
284 [ case "$withval" in
285   yes|no)
286     AC_MSG_ERROR([--with-smbtorture4-path should take a path])
287   ;;
288   * )
289     smbtorture4_path="$withval"
290     if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
291         AC_MSG_ERROR(['$smbtorture_path' does not  exist!])
292     fi
293   ;;
294  esac
295 ])
296
297 ## check for --enable-debug first before checking CFLAGS before
298 ## so that we don't mix -O and -g
299 debug=no
300 AC_ARG_ENABLE(debug,
301 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
302     [if eval "test x$enable_debug = xyes"; then
303         debug=yes
304     fi])
305
306 developer=no
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
309         debug=yes
310         developer=yes
311     fi])
312
313 krb5developer=no
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
316         debug=yes
317         developer=yes
318         krb5_developer=yes
319     fi])
320
321 picky_developer=no
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
324         debug=yes
325         developer=yes
326         picky_developer=yes
327     fi])
328
329 AC_ARG_WITH(cfenc,
330 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
331 [
332 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
333 # Should have been in framework $withval/CoreFoundation.framework/Headers.
334 for d in \
335     $withval/CoreFoundation/StringEncodings.subproj \
336     $withval/StringEncodings.subproj \
337     $withval/CoreFoundation.framework/Headers \
338     $withval/Headers \
339     $withval
340 do
341     if test -r $d/CFStringEncodingConverter.h; then
342         ln -sfh $d include/CoreFoundation
343     fi
344 done
345 ])
346