source: vendor/3.6.23/source3/m4/check_path.m4

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 12.7 KB
Line 
1dnl
2dnl Samba3 build environment path checks
3dnl
4dnl Copyright (C) Michael Adam 2008
5dnl
6dnl Released under the GNU General Public License
7dnl http://www.gnu.org/licenses/
8dnl
9
10AC_LIBREPLACE_LOCATION_CHECKS
11
12#################################################
13# Directory handling stuff to support both the
14# legacy SAMBA directories and FHS compliant
15# ones...
16AC_PREFIX_DEFAULT(/usr/local/samba)
17
18rootsbindir="\${SBINDIR}"
19lockdir="\${VARDIR}/locks"
20piddir="\${VARDIR}/locks"
21ncalrpcdir="\${VARDIR}/ncalrpc"
22nmbdsocketdir="\${VARDIR}/nmbd"
23test "${mandir}" || mandir="\${prefix}/man"
24logfilebase="\${VARDIR}"
25privatedir="\${prefix}/private"
26test "${libdir}" || libdir="\${prefix}/lib"
27modulesdir="${libdir}"
28pammodulesdir="${libdir}/security"
29configdir="${libdir}"
30swatdir="\${prefix}/swat"
31codepagedir="\${MODULESDIR}"
32statedir="\${LOCKDIR}"
33cachedir="\${LOCKDIR}"
34localedir="\${prefix}/share/locale"
35
36AC_ARG_WITH(fhs,
37[AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
38[ case "$withval" in
39 yes)
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])
54 ;;
55 esac])
56
57#################################################
58# set private directory location
59AC_ARG_WITH(privatedir,
60[AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
61[ case "$withval" in
62 yes|no)
63 #
64 # Just in case anybody calls it without argument
65 #
66 AC_MSG_WARN([--with-privatedir called without argument - will use default])
67 ;;
68 * )
69 privatedir="$withval"
70 ;;
71 esac])
72
73#################################################
74# set root sbin directory location
75AC_ARG_WITH(rootsbindir,
76[AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
77[ case "$withval" in
78 yes|no)
79 #
80 # Just in case anybody calls it without argument
81 #
82 AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
83 ;;
84 * )
85 rootsbindir="$withval"
86 ;;
87 esac])
88
89#################################################
90# set lock directory location
91AC_ARG_WITH(lockdir,
92[AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
93[ case "$withval" in
94 yes|no)
95 #
96 # Just in case anybody calls it without argument
97 #
98 AC_MSG_WARN([--with-lockdir called without argument - will use default])
99 ;;
100 * )
101 lockdir="$withval"
102 ;;
103 esac])
104
105#################################################
106# set state directory location
107AC_ARG_WITH(statedir,
108[AS_HELP_STRING([--with-statedir=DIR], [Where to put persistent state files ($ac_default_prefix/var/locks)])],
109[ case "$withval" in
110 yes|no)
111 #
112 # Just in case anybody calls it without argument
113 #
114 AC_MSG_WARN([--with-statedir called without argument - will use default])
115 ;;
116 * )
117 statedir="$withval"
118 ;;
119 esac])
120
121#################################################
122# set cache directory location
123AC_ARG_WITH(cachedir,
124[AS_HELP_STRING([--with-cachedir=DIR], [Where to put temporary cache files ($ac_default_prefix/var/locks)])],
125[ case "$withval" in
126 yes|no)
127 #
128 # Just in case anybody calls it without argument
129 #
130 AC_MSG_WARN([--with-cachedir called without argument - will use default])
131 ;;
132 * )
133 cachedir="$withval"
134 ;;
135 esac])
136
137#################################################
138# set pid directory location
139AC_ARG_WITH(piddir,
140[AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
141[ case "$withval" in
142 yes|no)
143 #
144 # Just in case anybody calls it without argument
145 #
146 AC_MSG_WARN([--with-piddir called without argument - will use default])
147 ;;
148 * )
149 piddir="$withval"
150 ;;
151 esac])
152
153#################################################
154# set ncalrpc directory location
155AC_ARG_WITH(ncalrpcdir,
156[AS_HELP_STRING([--with-ncalrpcdir=DIR], [Where to put ncalrpc sockets ($ac_default_prefix/var/ncalrpc)])],
157[ case "$withval" in
158 yes|no)
159 #
160 # Just in case anybody calls it without argument
161 #
162 AC_MSG_WARN([--with-ncalrpcdir called without argument - will use default])
163 ;;
164 * )
165 ncalrpcdir="$withval"
166 ;;
167 esac])
168
169#################################################
170# set nmbd socket directory location
171AC_ARG_WITH(nmbdsocketdir,
172[AS_HELP_STRING([--with-nmbdsocketdir=DIR], [Where to put the nmbd socket directory ($ac_default_prefix/var/nmbd)])],
173[ case "$withval" in
174 yes|no)
175 #
176 # Just in case anybody calls it without argument
177 #
178 AC_MSG_WARN([--with-nmbdsocketdir called without argument - will use default])
179 ;;
180 * )
181 nmbdsocketdir="$withval"
182 ;;
183 esac])
184
185#################################################
186# set SWAT directory location
187AC_ARG_WITH(swatdir,
188[AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
189[ case "$withval" in
190 yes|no)
191 #
192 # Just in case anybody does it
193 #
194 AC_MSG_WARN([--with-swatdir called without argument - will use default])
195 ;;
196 * )
197 swatdir="$withval"
198 ;;
199 esac])
200
201#################################################
202# set configuration directory location
203AC_ARG_WITH(configdir,
204[AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
205[ case "$withval" in
206 yes|no)
207 #
208 # Just in case anybody does it
209 #
210 AC_MSG_WARN([--with-configdir called without argument - will use default])
211 ;;
212 * )
213 configdir="$withval"
214 ;;
215 esac])
216
217#################################################
218# set log directory location
219AC_ARG_WITH(logfilebase,
220[AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
221[ case "$withval" in
222 yes|no)
223 #
224 # Just in case anybody does it
225 #
226 AC_MSG_WARN([--with-logfilebase called without argument - will use default])
227 ;;
228 * )
229 logfilebase="$withval"
230 ;;
231 esac])
232
233
234#################################################
235# set shared modules (internal lib) directory location
236AC_ARG_WITH(modulesdir,
237[AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
238[ case "$withval" in
239 yes|no)
240 #
241 # Just in case anybody does it
242 #
243 AC_MSG_WARN([--with-modulesdir without argument - will use default])
244 ;;
245 * )
246 modulesdir="$withval"
247 ;;
248 esac])
249
250#################################################
251# set PAM modules directory location
252AC_ARG_WITH(pammodulesdir,
253[AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
254[ case "$withval" in
255 yes|no)
256 #
257 # Just in case anybody calls it without argument
258 #
259 AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
260 ;;
261 * )
262 pammodulesdir="$withval"
263 ;;
264 esac])
265
266#################################################
267# set man directory location
268AC_ARG_WITH(mandir,
269[AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
270[ case "$withval" in
271 yes|no)
272 #
273 # Just in case anybody does it
274 #
275 AC_MSG_WARN([--with-mandir without argument - will use default])
276 ;;
277 * )
278 mandir="$withval"
279 ;;
280 esac])
281
282################################################
283# set locale directory location
284AC_ARG_WITH(localedir,
285[AS_HELP_STRING([--with-localedir=DIR],[Where to put po files ($ac_default_prefix/share/locale)])],
286[ case "$withval" in
287 yes|no)
288 #
289 # Just in case anybody does it
290 #
291 AC_MSG_WARN([--with-localedir called without argument - will use default])
292 ;;
293 *)
294 localedir="$withval"
295 ;;
296 esac])
297
298#################################################
299# set codepage directory location
300AC_ARG_WITH(codepagedir,
301[AS_HELP_STRING([--with-codepagedir=DIR], [Where to put codepages ($ac_default_prefix/lib/samba)])],
302[ case "$withval" in
303 yes|no)
304 #
305 # Just in case anybody calls it without argument
306 #
307 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
308 ;;
309 * )
310 codepagedir="$withval"
311 ;;
312 esac])
313
314
315AC_SUBST(configdir)
316AC_SUBST(lockdir)
317AC_SUBST(piddir)
318AC_SUBST(nmbdsocketdir)
319AC_SUBST(ncalrpcdir)
320AC_SUBST(logfilebase)
321AC_SUBST(privatedir)
322AC_SUBST(swatdir)
323AC_SUBST(bindir)
324AC_SUBST(sbindir)
325AC_SUBST(codepagedir)
326AC_SUBST(statedir)
327AC_SUBST(cachedir)
328AC_SUBST(rootsbindir)
329AC_SUBST(pammodulesdir)
330AC_SUBST(modulesdir)
331AC_SUBST(localedir)
332
333#################################################
334# set prefix for 'make test'
335selftest_prefix="./st"
336AC_SUBST(selftest_prefix)
337AC_ARG_WITH(selftest-prefix,
338[AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
339[ case "$withval" in
340 yes|no)
341 AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
342 ;;
343 * )
344 selftest_prefix="$withval"
345 ;;
346 esac
347])
348
349#################################################
350# set shrdir for 'make test'
351selftest_shrdir=""
352AC_SUBST(selftest_shrdir)
353AC_ARG_WITH(selftest-shrdir,
354[AS_HELP_STRING([--with-selftest-shrdir=DIR], [The share directory that make test will be run against ($selftest_shrdir)])],
355[ case "$withval" in
356 yes|no)
357 AC_MSG_WARN([--with-selftest-shrdir called without argument - will use default])
358 ;;
359 * )
360 selftest_shrdir="-s $withval"
361 ;;
362 esac
363])
364
365#################################################
366# set path of samba4's smbtorture
367smbtorture4_path=""
368AC_SUBST(smbtorture4_path)
369smbtorture4_option=""
370AC_SUBST(smbtorture4_option)
371AC_ARG_WITH(smbtorture4_path,
372[AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
373[ case "$withval" in
374 yes|no)
375 AC_MSG_ERROR([--with-smbtorture4-path should take a path])
376 ;;
377 * )
378 smbtorture4_path="$withval"
379 if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
380 AC_MSG_ERROR(['$smbtorture_path' does not exist!])
381 fi
382 smbtorture4_option="-t $withval"
383 ;;
384 esac
385])
386
387#################################################
388# set custom conf for make test
389selftest_custom_conf=""
390AC_SUBST(selftest_custom_conf)
391AC_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)])],
393[ case "$withval" in
394 yes|no)
395 AC_MSG_ERROR([--with-selftest-custom-conf should take a path])
396 ;;
397 * )
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!])
401 fi
402 selftest_custom_conf="-c $withval"
403 ;;
404 esac
405])
406
407## check for --enable-debug first before checking CFLAGS before
408## so that we don't mix -O and -g
409debug=no
410AC_ARG_ENABLE(debug,
411[AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
412 [if eval "test x$enable_debug = xyes"; then
413 debug=yes
414 fi])
415
416AC_SUBST(developer)
417developer=no
418AC_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
420 debug=yes
421 developer=yes
422 fi])
423
424krb5developer=no
425AC_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
427 debug=yes
428 developer=yes
429 krb5_developer=yes
430 fi])
431
432picky_developer=no
433AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
434 [if eval "test x$enable_picky_developer = xyes"; then
435 debug=yes
436 developer=yes
437 picky_developer=yes
438 fi])
439
440AC_ARG_WITH(cfenc,
441[AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
442[
443# May be in source $withval/CoreFoundation/StringEncodings.subproj.
444# Should have been in framework $withval/CoreFoundation.framework/Headers.
445for d in \
446 $withval/CoreFoundation/StringEncodings.subproj \
447 $withval/StringEncodings.subproj \
448 $withval/CoreFoundation.framework/Headers \
449 $withval/Headers \
450 $withval
451do
452 if test -r $d/CFStringEncodingConverter.h; then
453 ln -sfh $d include/CoreFoundation
454 fi
455done
456])
457
Note: See TracBrowser for help on using the repository browser.