37c0927d447d9a823693bce1fd9f2978df900478
[openafs.git] / src / cf / options.m4
1
2 AC_DEFUN([OPENAFS_OPTIONS],[
3
4 dnl System identity.
5 AC_ARG_WITH([afs-sysname],
6     [AS_HELP_STRING([--with-afs-sysname=sys], [use sys for the afs sysname])
7 ])
8
9 dnl General feature options.
10 AC_ARG_ENABLE([namei-fileserver],
11     [AS_HELP_STRING([--enable-namei-fileserver],
12         [force compilation of namei fileserver in preference to inode
13          fileserver])],
14     [],
15     [enable_namei_fileserver="default"])
16 AC_ARG_ENABLE([supergroups],
17     [AS_HELP_STRING([--enable-supergroups],
18         [enable support for nested pts groups])],
19     [],
20     [enable_supergroups="no"])
21 AC_ARG_ENABLE([bitmap-later],
22     [AS_HELP_STRING([--enable-bitmap-later],
23         [enable fast startup of file server by not reading bitmap till
24          needed])],
25     [AS_IF([test x"$withval" = xyes],
26         [AC_MSG_WARN([bitmap-later is only used by non-demand-attach
27             fileservers.  Please migrate to demand-attach instead.])])],
28     [enable_bitmap_later="no"])
29 AC_ARG_ENABLE([unix-sockets],
30     [AS_HELP_STRING([--disable-unix-sockets],
31         [disable use of unix domain sockets for fssync (defaults to enabled)])],
32     [],
33     [enable_unix_sockets="yes"])
34 AC_ARG_ENABLE([tivoli-tsm],
35     [AS_HELP_STRING([--enable-tivoli-tsm],
36         [enable use of the Tivoli TSM API libraries for butc support])],
37     [],
38     [enable_tivoli_tsm="no"])
39 AC_ARG_ENABLE([pthreaded-ubik],
40     [AS_HELP_STRING([--disable-pthreaded-ubik],
41         [disable installation of pthreaded ubik applications (defaults to
42          enabled)])],
43     [],
44     [enable_pthreaded_ubik="yes"])
45 AC_ARG_ENABLE([ubik-read-while-write],
46     [AS_HELP_STRING([--enable-ubik-read-while-write],
47         [enable vlserver read from db cache during write locks (EXPERIMENTAL)])],
48     [],
49     [enable_ubik_read_while_write="no"])
50
51 dnl Kernel module build options.
52 AC_ARG_WITH([linux-kernel-headers],
53     [AS_HELP_STRING([--with-linux-kernel-headers=path],
54         [use the kernel headers found at path (optional, defaults to
55          /lib/modules/`uname -r`/build, then /lib/modules/`uname -r`/source,
56          and lastly /usr/src/linux)])
57 ])
58 AC_ARG_WITH([linux-kernel-build],
59     [AS_HELP_STRING([--with-linux-kernel-build=path],
60         [use the kernel build found at path(optional, defaults to
61         kernel headers path)]
62 )])
63 AC_ARG_WITH([bsd-kernel-headers],
64     [AS_HELP_STRING([--with-bsd-kernel-headers=path],
65         [use the kernel headers found at path (optional, defaults to
66          /usr/src/sys)])
67 ])
68 AC_ARG_WITH([bsd-kernel-build],
69     [AS_HELP_STRING([--with-bsd-kernel-build=path],
70         [use the kernel build found at path (optional, defaults to
71          KSRC/i386/compile/GENERIC)])
72 ])
73 AC_ARG_WITH([linux-kernel-packaging],
74     [AS_HELP_STRING([--with-linux-kernel-packaging],
75         [use standard naming conventions to aid Linux kernel build packaging
76          (disables MPS, sets the kernel module name to openafs.ko, and
77          installs kernel modules into the standard Linux location)])],
78     [AC_SUBST([LINUX_KERNEL_PACKAGING], [yes])
79      AC_SUBST([LINUX_LIBAFS_NAME], [openafs])],
80     [AC_SUBST([LINUX_LIBAFS_NAME], [libafs])
81 ])
82 AC_ARG_ENABLE([kernel-module],
83     [AS_HELP_STRING([--disable-kernel-module],
84         [disable compilation of the kernel module (defaults to enabled)])],
85     [],
86     [enable_kernel_module="yes"])
87 AC_ARG_ENABLE([redhat-buildsys],
88     [AS_HELP_STRING([--enable-redhat-buildsys],
89         [enable compilation of the redhat build system kernel (defaults to
90          disabled)])],
91     [],
92     [enable_redhat_buildsys="no"])
93
94 dnl Installation locations.
95 AC_ARG_ENABLE([transarc-paths],
96     [AS_HELP_STRING([--enable-transarc-paths],
97         [use Transarc style paths like /usr/afs and /usr/vice])],
98     [],
99     [enable_transarc_paths="no"])
100
101 dnl Deprecated crypto
102 AC_ARG_ENABLE([kauth],
103     [AS_HELP_STRING([--enable-kauth],
104         [install the deprecated kauth server, pam modules, and utilities
105          (defaults to disabled)])],
106     [enable_pam="yes"],
107     [enable_kauth="no"
108      enable_pam="no"])
109
110 dnl modern crypto
111 AC_ARG_ENABLE([rxgk],
112 dnl Note that this flag only dictates whether or not rxgk support is turned on
113 dnl in various daemons, utilities, etc. Without this flag, we still always try
114 dnl to build rxgk when we can (when a suitable gssapi is available).
115     [AS_HELP_STRING([--enable-rxgk],
116         [Include experimental support for the RXGK security class (defaults to disabled)])],
117     [],
118     [enable_rxgk="no"])
119
120 dnl Optimization and debugging flags.
121 AC_ARG_ENABLE([strip-binaries],
122     [AS_HELP_STRING([--disable-strip-binaries],
123         [disable stripping of symbol information from binaries (defaults to
124          enabled)])],
125     [],
126     [enable_strip_binaries="maybe"])
127 AC_ARG_ENABLE([debug],
128     [AS_HELP_STRING([--enable-debug],
129         [enable compilation of the user space code with debugging information
130          (defaults to disabled)])],
131     [],
132     [enable_debug="no"])
133 AC_ARG_ENABLE([optimize],
134     [AS_HELP_STRING([--disable-optimize],
135         [disable optimization for compilation of the user space code (defaults
136          to enabled)])],
137     [],
138     [enable_optimize="yes"])
139 AC_ARG_ENABLE([warnings],
140     [AS_HELP_STRING([--enable-warnings],
141         [enable compilation warnings when building with gcc (defaults to
142          disabled)])],
143     [],
144     [enable_warnings="no"])
145 AC_ARG_ENABLE([checking],
146     [AS_HELP_STRING([--enable-checking],
147         [turn compilation warnings into errors when building with gcc (defaults
148          to disabled)])],
149     [enable_checking="$enableval"],
150     [enable_checking="no"])
151 AC_ARG_ENABLE([debug-locks],
152     [AS_HELP_STRING([--enable-debug-locks],
153         [turn on lock debugging assertions (defaults to disabled)])],
154     [enable_debug_locks="$enableval"],
155     [enable_debug_locks="no"])
156 AC_ARG_ENABLE([debug-kernel],
157     [AS_HELP_STRING([--enable-debug-kernel],
158         [enable compilation of the kernel module with debugging information
159          (defaults to disabled)])],
160     [],
161     [enable_debug_kernel="no"])
162 AC_ARG_ENABLE([optimize-kernel],
163     [AS_HELP_STRING([--disable-optimize-kernel],
164         [disable compilation of the kernel module with optimization (defaults
165          based on platform)])],
166     [],
167     [enable_optimize_kernel=""])
168 AC_ARG_ENABLE([debug-lwp],
169     [AS_HELP_STRING([--enable-debug-lwp],
170         [enable compilation of the LWP code with debugging information
171          (defaults to disabled)])],
172     [],
173     [enable_debug_lwp="no"])
174 AC_ARG_ENABLE([optimize-lwp],
175     [AS_HELP_STRING([--disable-optimize-lwp],
176         [disable optimization for compilation of the LWP code (defaults to
177          enabled)])],
178     [],
179     [enable_optimize_lwp="yes"])
180 AC_ARG_ENABLE([debug-pam],
181     [AS_HELP_STRING([--enable-debug-pam],
182         [enable compilation of the PAM code with debugging information
183          (defaults to disabled)])],
184     [],
185     [enable_debug_pam="no"])
186 AC_ARG_ENABLE([optimize-pam],
187     [AS_HELP_STRING([--disable-optimize-pam],
188         [disable optimization for compilation of the PAM code (defaults to
189          enabled)])],
190     [],
191     [enable_optimize_pam="yes"])
192 AC_ARG_ENABLE([linux-syscall-probing],
193     [AS_HELP_STRING([--enable-linux-syscall-probing],
194         [enable Linux syscall probing (defaults to autodetect)])],
195     [],
196     [enable_linux_syscall_probing="maybe"])
197 AC_ARG_ENABLE([linux-d_splice_alias-extra-iput],
198     [AS_HELP_STRING([--enable-linux-d_splice_alias-extra-iput],
199         [Linux kernels in the 3.17 series prior to 3.17.3 had a bug
200          wherein error returns from the d_splice_alias() function were
201          leaking a reference on the inode.  The bug was fixed for the
202          3.17.3 kernel, and the possibility of an error return was only
203          introduced in kernel 3.17, so only the narrow range of kernels
204          is affected.  Enable this option for builds on systems with
205          kernels affected by this bug, to manually release the reference
206          on error returns and correct the reference counting.
207          Linux commit 51486b900ee92856b977eacfc5bfbe6565028070 (or
208          equivalent) is the fix for the upstream bug, so if such a commit
209          is present, leave this option disabled.  We apologize
210          that you are required to know this about your running kernel,
211          but luckily only a narrow range of versions is affected.])],
212     [],
213     [enable_linux_d_splice_alias_extra_iput="no"])
214 AC_ARG_WITH([crosstools-dir],
215     [AS_HELP_STRING([--with-crosstools-dir=path],
216         [use path for native versions of rxgen, compile_et and config])
217 ])
218
219 AC_ARG_WITH([xslt-processor],
220         AS_HELP_STRING([--with-xslt-processor=ARG],
221         [which XSLT processor to use (possible choices are: libxslt, saxon, xalan-j, xsltproc)]),
222         [XSLTPROC="$withval"],
223         [AC_CHECK_PROGS([XSLTPROC], [libxslt saxon xalan-j xsltproc], [echo])])
224
225 AC_ARG_WITH([html-xsl],
226         AS_HELP_STRING([--with-html-xsl],
227         [build HTML documentation using this stylesheet (default is html/chunk.dsl; specify either html/chunk.xsl or html/docbook.xsl)]),
228         [HTML_XSL="$withval"],
229         [HTML_XSL="html/chunk.xsl"])
230
231 AC_ARG_WITH([docbook2pdf],
232         AS_HELP_STRING([--with-docbook2pdf=ARG],
233         [which Docbook to PDF utility to use (possible choices are: fop, dblatex, docbook2pdf)]),
234         [DOCBOOK2PDF="$withval"],
235         [AC_CHECK_PROGS([DOCBOOK2PDF], [fop dblatex docbook2pdf], [echo])])
236
237 AC_ARG_WITH([docbook-stylesheets],
238         AS_HELP_STRING([--with-docbook-stylesheets=ARG],
239         [location of DocBook stylesheets (default is to search a set of likely paths)]),
240         [DOCBOOK_STYLESHEETS="$withval"],
241         [OPENAFS_SEARCH_DIRLIST([DOCBOOK_STYLESHEETS],
242                 [/usr/share/xml/docbook/stylesheet/nwalsh/current \
243                  /usr/share/xml/docbook/stylesheet/nwalsh \
244                  /usr/share/xml/docbook/xsl-stylesheets \
245                  /usr/share/sgml/docbook/docbook-xsl-stylesheets \
246                  /usr/share/sgml/docbook/xsl-stylesheets \
247                  /usr/share/docbook-xsl \
248                  /usr/share/sgml/docbkxsl \
249                  /usr/local/share/xsl/docbook \
250                  /sw/share/xml/xsl/docbook-xsl \
251                  /opt/local/share/xsl/docbook-xsl],
252                 [$HTML_XSL])
253            AS_IF([test "x$DOCBOOK_STYLESHEETS" = "x"],
254                 [AC_MSG_WARN(Docbook stylesheets not found; some documentation can't be built)
255            ])
256         ])
257
258 AC_ARG_WITH([dot],
259         AS_HELP_STRING([--with-dot@<:@=PATH@:>@],
260         [use graphviz dot to generate dependency graphs with doxygen (defaults to autodetect)]),
261         [], [with_dot="maybe"])
262
263 enable_login="no"
264
265 ])
266
267 AC_DEFUN([OPENAFS_OPTION_TESTS],[
268 # Fast restart
269 if test "$enable_supergroups" = "yes"; then
270         AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups])
271 fi
272
273 if test "$enable_bitmap_later" = "yes"; then
274         AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later])
275 fi
276
277 if test "$enable_unix_sockets" = "yes"; then
278         AC_DEFINE(USE_UNIX_SOCKETS, 1, [define if you want to use UNIX sockets for fssync.])
279         USE_UNIX_SOCKETS="yes"
280 else
281         USE_UNIX_SOCKETS="no"
282 fi
283 AC_SUBST(USE_UNIX_SOCKETS)
284
285 if test "$enable_ubik_read_while_write" = "yes"; then
286         AC_DEFINE(UBIK_READ_WHILE_WRITE, 1, [define if you want to enable ubik read while write])
287 fi
288
289 if test "$enable_namei_fileserver" = "yes"; then
290         AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
291         VFSCK=""
292 else
293         if test "$enable_namei_fileserver" = "default"; then
294                 case $host in
295                         *-solaris2.10*)
296                                 AC_MSG_WARN(Some Solaris 10 versions are not safe with the inode fileserver. Forcing namei. Override with --disable-namei-fileserver)
297                                 AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
298                                 VFSCK=""
299                                 ;;
300                         *-solaris2.11*)
301                                 AC_MSG_WARN(Solaris 11 versions are not safe with the inode fileserver. Forcing namei. Override with --disable-namei-fileserver)
302                                 AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
303                                 VFSCK=""
304                                 ;;
305                         *)
306                                 VFSCK="vfsck"
307                                 ;;
308                 esac
309         else
310                 VFSCK="vfsck"
311         fi
312 fi
313 ])
314
315 AC_DEFUN([OPENAFS_MORE_OPTION_TESTS],[
316 if test "$enable_debug_locks" = yes; then
317         AC_DEFINE(OPR_DEBUG_LOCKS, 1, [turn on lock debugging in opr])
318 fi
319
320 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
321         HAVE_PAM="yes"
322 else
323         HAVE_PAM="no"
324 fi
325 AC_SUBST(HAVE_PAM)
326
327 if test "$enable_login" = yes; then
328         BUILD_LOGIN="yes"
329 else
330         BUILD_LOGIN="no"
331 fi
332 AC_SUBST(BUILD_LOGIN)
333
334 if test "$enable_kauth" = yes; then
335         INSTALL_KAUTH="yes"
336 else
337         INSTALL_KAUTH="no"
338 fi
339 AC_SUBST(INSTALL_KAUTH)
340 ])
341
342 AC_DEFUN([OPENAFS_YET_MORE_OPTION_TESTS],[
343 if test "x$enable_kernel_module" = "xyes"; then
344 ENABLE_KERNEL_MODULE=libafs
345 fi
346
347 if test "x$enable_pthreaded_ubik" = "xyes"; then
348 ENABLE_PTHREADED_UBIK=yes
349 fi
350 ])