autoconf: refactor acinclude.m4
[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          then /usr/src/linux-2.4, 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 Optimization and debugging flags.
111 AC_ARG_ENABLE([strip-binaries],
112     [AS_HELP_STRING([--disable-strip-binaries],
113         [disable stripping of symbol information from binaries (defaults to
114          enabled)])],
115     [],
116     [enable_strip_binaries="maybe"])
117 AC_ARG_ENABLE([debug],
118     [AS_HELP_STRING([--enable-debug],
119         [enable compilation of the user space code with debugging information
120          (defaults to disabled)])],
121     [],
122     [enable_debug="no"])
123 AC_ARG_ENABLE([optimize],
124     [AS_HELP_STRING([--disable-optimize],
125         [disable optimization for compilation of the user space code (defaults
126          to enabled)])],
127     [],
128     [enable_optimize="yes"])
129 AC_ARG_ENABLE([warnings],
130     [AS_HELP_STRING([--enable-warnings],
131         [enable compilation warnings when building with gcc (defaults to
132          disabled)])],
133     [],
134     [enable_warnings="no"])
135 AC_ARG_ENABLE([checking],
136     [AS_HELP_STRING([--enable-checking],
137         [turn compilation warnings into errors when building with gcc (defaults
138          to disabled)])],
139     [enable_checking="$enableval"],
140     [enable_checking="no"])
141 AC_ARG_ENABLE([debug-locks],
142     [AS_HELP_STRING([--enable-debug-locks],
143         [turn on lock debugging assertions (defaults to disabled)])],
144     [enable_debug_locks="$enableval"],
145     [enable_debug_locks="no"])
146 AC_ARG_ENABLE([debug-kernel],
147     [AS_HELP_STRING([--enable-debug-kernel],
148         [enable compilation of the kernel module with debugging information
149          (defaults to disabled)])],
150     [],
151     [enable_debug_kernel="no"])
152 AC_ARG_ENABLE([optimize-kernel],
153     [AS_HELP_STRING([--disable-optimize-kernel],
154         [disable compilation of the kernel module with optimization (defaults
155          based on platform)])],
156     [],
157     [enable_optimize_kernel=""])
158 AC_ARG_ENABLE([debug-lwp],
159     [AS_HELP_STRING([--enable-debug-lwp],
160         [enable compilation of the LWP code with debugging information
161          (defaults to disabled)])],
162     [],
163     [enable_debug_lwp="no"])
164 AC_ARG_ENABLE([optimize-lwp],
165     [AS_HELP_STRING([--disable-optimize-lwp],
166         [disable optimization for compilation of the LWP code (defaults to
167          enabled)])],
168     [],
169     [enable_optimize_lwp="yes"])
170 AC_ARG_ENABLE([debug-pam],
171     [AS_HELP_STRING([--enable-debug-pam],
172         [enable compilation of the PAM code with debugging information
173          (defaults to disabled)])],
174     [],
175     [enable_debug_pam="no"])
176 AC_ARG_ENABLE([optimize-pam],
177     [AS_HELP_STRING([--disable-optimize-pam],
178         [disable optimization for compilation of the PAM code (defaults to
179          enabled)])],
180     [],
181     [enable_optimize_pam="yes"])
182 AC_ARG_ENABLE([linux-syscall-probing],
183     [AS_HELP_STRING([--enable-linux-syscall-probing],
184         [enable Linux syscall probing (defaults to autodetect)])],
185     [],
186     [enable_linux_syscall_probing="maybe"])
187 AC_ARG_ENABLE([linux-d_splice_alias-extra-iput],
188     [AS_HELP_STRING([--enable-linux-d_splice_alias-extra-iput],
189         [Linux kernels in the 3.17 series prior to 3.17.3 had a bug
190          wherein error returns from the d_splice_alias() function were
191          leaking a reference on the inode.  The bug was fixed for the
192          3.17.3 kernel, and the possibility of an error return was only
193          introduced in kernel 3.17, so only the narrow range of kernels
194          is affected.  Enable this option for builds on systems with
195          kernels affected by this bug, to manually release the reference
196          on error returns and correct the reference counting.
197          Linux commit 51486b900ee92856b977eacfc5bfbe6565028070 (or
198          equivalent) is the fix for the upstream bug, so if such a commit
199          is present, leave this option disabled.  We apologize
200          that you are required to know this about your running kernel,
201          but luckily only a narrow range of versions is affected.])],
202     [],
203     [enable_linux_d_splice_alias_extra_iput="no"])
204 AC_ARG_WITH([crosstools-dir],
205     [AS_HELP_STRING([--with-crosstools-dir=path],
206         [use path for native versions of rxgen, compile_et and config])
207 ])
208
209 AC_ARG_WITH([xslt-processor],
210         AS_HELP_STRING([--with-xslt-processor=ARG],
211         [which XSLT processor to use (possible choices are: libxslt, saxon, xalan-j, xsltproc)]),
212         [XSLTPROC="$withval"],
213         [AC_CHECK_PROGS([XSLTPROC], [libxslt saxon xalan-j xsltproc], [echo])])
214
215 AC_ARG_WITH([html-xsl],
216         AS_HELP_STRING([--with-html-xsl],
217         [build HTML documentation using this stylesheet (default is html/chunk.dsl; specify either html/chunk.xsl or html/docbook.xsl)]),
218         [HTML_XSL="$withval"],
219         [HTML_XSL="html/chunk.xsl"])
220
221 AC_ARG_WITH([docbook2pdf],
222         AS_HELP_STRING([--with-docbook2pdf=ARG],
223         [which Docbook to PDF utility to use (possible choices are: fop, dblatex, docbook2pdf)]),
224         [DOCBOOK2PDF="$withval"],
225         [AC_CHECK_PROGS([DOCBOOK2PDF], [fop dblatex docbook2pdf], [echo])])
226
227 AC_ARG_WITH([docbook-stylesheets],
228         AS_HELP_STRING([--with-docbook-stylesheets=ARG],
229         [location of DocBook stylesheets (default is to search a set of likely paths)]),
230         [DOCBOOK_STYLESHEETS="$withval"],
231         [OPENAFS_SEARCH_DIRLIST([DOCBOOK_STYLESHEETS],
232                 [/usr/share/xml/docbook/stylesheet/nwalsh/current \
233                  /usr/share/xml/docbook/stylesheet/nwalsh \
234                  /usr/share/xml/docbook/xsl-stylesheets \
235                  /usr/share/sgml/docbook/docbook-xsl-stylesheets \
236                  /usr/share/sgml/docbook/xsl-stylesheets \
237                  /usr/share/docbook-xsl \
238                  /usr/share/sgml/docbkxsl \
239                  /usr/local/share/xsl/docbook \
240                  /sw/share/xml/xsl/docbook-xsl \
241                  /opt/local/share/xsl/docbook-xsl],
242                 [$HTML_XSL])
243            AS_IF([test "x$DOCBOOK_STYLESHEETS" = "x"],
244                 [AC_WARN([Docbook stylesheets not found; some documentation can't be built])
245            ])
246         ])
247
248 AC_ARG_WITH([dot],
249         AS_HELP_STRING([--with-dot@<:@=PATH@:>@],
250         [use graphviz dot to generate dependency graphs with doxygen (defaults to autodetect)]),
251         [], [with_dot="maybe"])
252
253 enable_login="no"
254
255 ])
256
257 AC_DEFUN([OPENAFS_OPTION_TESTS],[
258 # Fast restart
259 if test "$enable_supergroups" = "yes"; then
260         AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups])
261 fi
262
263 if test "$enable_bitmap_later" = "yes"; then
264         AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later])
265 fi
266
267 if test "$enable_unix_sockets" = "yes"; then
268         AC_DEFINE(USE_UNIX_SOCKETS, 1, [define if you want to use UNIX sockets for fssync.])
269         USE_UNIX_SOCKETS="yes"
270 else
271         USE_UNIX_SOCKETS="no"
272 fi
273 AC_SUBST(USE_UNIX_SOCKETS)
274
275 if test "$enable_ubik_read_while_write" = "yes"; then
276         AC_DEFINE(UBIK_READ_WHILE_WRITE, 1, [define if you want to enable ubik read while write])
277 fi
278
279 if test "$enable_namei_fileserver" = "yes"; then
280         AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
281         VFSCK=""
282 else
283         if test "$enable_namei_fileserver" = "default"; then
284                 case $host in
285                         *-solaris2.10*)
286                                 AC_MSG_WARN(Some Solaris 10 versions are not safe with the inode fileserver. Forcing namei. Override with --disable-namei-fileserver)
287                                 AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
288                                 VFSCK=""
289                                 ;;
290                         *-solaris2.11*)
291                                 AC_MSG_WARN(Solaris 11 versions are not safe with the inode fileserver. Forcing namei. Override with --disable-namei-fileserver)
292                                 AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
293                                 VFSCK=""
294                                 ;;
295                         *)
296                                 VFSCK="vfsck"
297                                 ;;
298                 esac
299         else
300                 VFSCK="vfsck"
301         fi
302 fi
303 ])
304
305 AC_DEFUN([OPENAFS_MORE_OPTION_TESTS],[
306 if test "$enable_debug_locks" = yes; then
307         AC_DEFINE(OPR_DEBUG_LOCKS, 1, [turn on lock debugging in opr])
308 fi
309
310 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
311         HAVE_PAM="yes"
312 else
313         HAVE_PAM="no"
314 fi
315 AC_SUBST(HAVE_PAM)
316
317 if test "$enable_login" = yes; then
318         BUILD_LOGIN="yes"
319 else
320         BUILD_LOGIN="no"
321 fi
322 AC_SUBST(BUILD_LOGIN)
323
324 if test "$enable_kauth" = yes; then
325         INSTALL_KAUTH="yes"
326 else
327         INSTALL_KAUTH="no"
328 fi
329 AC_SUBST(INSTALL_KAUTH)
330 ])
331
332 AC_DEFUN([OPENAFS_YET_MORE_OPTION_TESTS],[
333 if test "x$enable_kernel_module" = "xyes"; then
334 ENABLE_KERNEL_MODULE=libafs
335 fi
336
337 if test "x$enable_pthreaded_ubik" = "xyes"; then
338 ENABLE_PTHREADED_UBIK=yes
339 fi
340 ])