r12301: FHS 2.2 says that /var/cache/* contains only cached data, which can we remove...
[kai/samba.git] / source / build / m4 / check_path.m4
1 dnl SMB Build Environment Path Checks
2 dnl -------------------------------------------------------
3 dnl  Copyright (C) Stefan (metze) Metzmacher 2004
4 dnl  Released under the GNU GPL
5 dnl -------------------------------------------------------
6 dnl
7
8 #################################################
9 # Directory handling stuff to support both the
10 # legacy SAMBA directories and FHS compliant
11 # ones...
12 AC_PREFIX_DEFAULT(/usr/local/samba)
13
14 AC_ARG_WITH(fhs, 
15 [  --with-fhs              Use FHS-compliant paths (default=no)],
16     configdir="${sysconfdir}/samba"
17     lockdir="\${localstatedir}/lib/samba"
18     piddir="\${localstatedir}/run/samba"
19     logfilebase="\${localstatedir}/log/samba"
20     privatedir="\${CONFIGDIR}/private"
21     libdir="\${prefix}/lib/samba"
22     swatdir="\${datadir}/samba/swat",
23     configdir="\${LIBDIR}"
24     logfilebase="\${localstatedir}"
25     lockdir="\${localstatedir}/locks"
26     piddir="\${localstatedir}/locks"
27     privatedir="\${prefix}/private"
28     swatdir="\${prefix}/swat")
29
30 #################################################
31 # set private directory location
32 AC_ARG_WITH(privatedir,
33 [  --with-privatedir=DIR   Where to put smbpasswd ($ac_default_prefix/private)],
34 [ case "$withval" in
35   yes|no)
36   #
37   # Just in case anybody calls it without argument
38   #
39     AC_MSG_WARN([--with-privatedir called without argument - will use default])
40   ;;
41   * )
42     privatedir="$withval"
43     ;;
44   esac])
45
46 #################################################
47 # set lock directory location
48 AC_ARG_WITH(lockdir,
49 [  --with-lockdir=DIR      Where to put lock files ($ac_default_prefix/var/locks)],
50 [ case "$withval" in
51   yes|no)
52   #
53   # Just in case anybody calls it without argument
54   #
55     AC_MSG_WARN([--with-lockdir called without argument - will use default])
56   ;;
57   * )
58     lockdir="$withval"
59     ;;
60   esac])
61
62 #################################################
63 # set pid directory location
64 AC_ARG_WITH(piddir,
65 [  --with-piddir=DIR       Where to put pid files ($ac_default_prefix/var/locks)],
66 [ case "$withval" in
67   yes|no)
68   #
69   # Just in case anybody calls it without argument
70   #
71     AC_MSG_WARN([--with-piddir called without argument - will use default])
72   ;;
73   * )
74     piddir="$withval"
75     ;;
76   esac])
77
78 #################################################
79 # set configuration directory location
80 AC_ARG_WITH(configdir,
81 [  --with-configdir=DIR    Where to put configuration files (\$libdir)],
82 [ case "$withval" in
83   yes|no)
84   #
85   # Just in case anybody does it
86   #
87     AC_MSG_WARN([--with-configdir called without argument - will use default])
88   ;;
89   * )
90     configdir="$withval"
91     ;;
92   esac])
93
94 #################################################
95 # set log directory location
96 AC_ARG_WITH(logfilebase,
97 [  --with-logfilebase=DIR  Where to put log files (\$(VARDIR))],
98 [ case "$withval" in
99   yes|no)
100   #
101   # Just in case anybody does it
102   #
103     AC_MSG_WARN([--with-logfilebase called without argument - will use default])
104   ;;
105   * )
106     logfilebase="$withval"
107     ;;
108   esac])
109
110
111 #################################################
112 # set swat directory location
113 AC_ARG_WITH(swatdir,
114 [  --with-swatdir=DIR    Where to put configuration files (\$swatdir)],
115 [ case "$withval" in
116   yes|no)
117     AC_MSG_WARN([--with-swatdir called without argument - will use default])
118   ;;
119   * )
120     swatdir="$withval"
121     ;;
122   esac])
123
124 #################################################
125 # set lib directory location
126 AC_ARG_WITH(libdir,
127 [  --with-libdir=DIR    Where to put modules files (\$libdir)],
128 [ case "$withval" in
129   yes|no)
130     AC_MSG_WARN([--with-libdir called without argument - will use default])
131   ;;
132   * )
133     libdir="$withval"
134     ;;
135   esac])
136
137 AC_SUBST(configdir)
138 AC_SUBST(lockdir)
139 AC_SUBST(piddir)
140 AC_SUBST(logfilebase)
141 AC_SUBST(privatedir)
142 AC_SUBST(bindir)
143 AC_SUBST(sbindir)
144 AC_SUBST(swatdir)
145
146 #################################################
147 # set prefix for 'make test'
148 selftest_prefix="./"
149 AC_SUBST(selftest_prefix)
150 AC_ARG_WITH(selftest-prefix,
151 [  --with-selftest-prefix=DIR    The prefix where make test will be runned (\$selftest_prefix)],
152 [ case "$withval" in
153   yes|no)
154     AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
155   ;;
156   * )
157     selftest_prefix="$withval"
158     ;;
159   esac])
160
161 debug=no
162 AC_ARG_ENABLE(debug,
163 [  --enable-debug          Turn on compiler debugging information (default=no)],
164     [if test x$enable_debug = xyes; then
165         debug=yes
166     fi])
167
168 developer=no
169 AC_SUBST(developer)
170 AC_ARG_ENABLE(developer,
171 [  --enable-developer      Turn on developer warnings and debugging (default=no)],
172     [if test x$enable_developer = xyes; then
173         debug=yes
174         developer=yes
175     fi])
176
177 experimental=no
178 AC_ARG_ENABLE(experimental,
179 [  --enable-experimental   Turn on experimental features (default=no)],
180     [if test x$enable_experimental = xyes; then
181         experimental=yes
182     fi])
183
184 dnl disable these external libs 
185 AC_ARG_WITH(disable-ext-lib,
186 [  --with-disable-ext-lib=LIB Comma-seperated list of external libraries],
187 [ if test $withval; then
188         for i in `echo $withval | sed -e's/,/ /g'`
189         do
190                 eval SMB_EXT_LIB_$i=NO
191         done
192 fi ])
193
194 dnl exclude these modules 
195 AC_ARG_WITH(exclude-modules,
196 [  --with-exclude-modules=MODULES Comma-seperated list of names of modules to exclude from build],
197 [ if test $withval; then
198         for i in `echo $withval | sed -e's/,/ /g'`
199         do
200                 eval SMB_MODULE_$i=NOT
201         done
202 fi ])
203
204 dnl Always built these modules shared
205 AC_ARG_WITH(shared-modules,
206 [  --with-shared-modules=MODULES  Comma-seperated list of names of modules to build shared],
207 [ if test $withval; then
208         for i in `echo $withval | sed -e's/,/ /g'`
209         do
210                 eval SMB_MODULE_$i=SHARED
211         done
212 fi ])
213
214 dnl Always built these modules static
215 AC_ARG_WITH(static-modules,
216 [  --with-static-modules=MODULES  Comma-seperated list of names of modules to statically link in],
217 [ if test $withval; then
218         for i in `echo $withval | sed -e's/,/ /g'`
219         do
220                 eval SMB_MODULE_$i=STATIC
221         done
222 fi ])