Whamcloud - gitweb
LU-17243 build: compatibility updates for kernel 6.6
[fs/lustre-release.git] / config / lustre-build.m4
1 # SPDX-License-Identifier: GPL-2.0
2
3 #
4 # This file is part of Lustre, http://www.lustre.org/
5 #
6 # config/lustre-build.m4
7 #
8 # Generic Lustre configuration options
9 #
10
11 #
12 # LB_CANONICAL_SYSTEM
13 #
14 # fixup $target_os for use in other places
15 #
16 AC_DEFUN([LB_CANONICAL_SYSTEM], [
17 case $target_os in
18         linux*)
19                 lb_target_os="linux"
20                 ;;
21 esac
22 AC_SUBST(lb_target_os)
23 ]) # LB_CANONICAL_SYSTEM
24
25 #
26 # LB_DOWNSTREAM_RELEASE (DEPRECATED)
27 #
28 AC_DEFUN([LB_DOWNSTREAM_RELEASE],
29 [AC_ARG_WITH([downstream-release],,
30         AC_MSG_ERROR([--downstream-release was deprecated.  Please read Documentation/versioning.txt.])
31 )]) # LB_DOWNSTREAM_RELEASE
32
33 #
34 # LB_CHECK_FILE
35 #
36 # Check for file existence even when cross compiling
37 # $1 - file to check
38 # $2 - do 'yes'
39 # $3 - do 'no'
40 #
41 AC_DEFUN([LB_CHECK_FILE], [
42 AS_VAR_PUSHDEF([lb_file], [lb_cv_file_$1])dnl
43 AC_CACHE_CHECK([for $1], lb_file, [
44 AS_IF([test -r "$1"],
45         [AS_VAR_SET(lb_file, [yes])],
46         [AS_VAR_SET(lb_file, [no])])
47 ])
48 AS_VAR_IF([lb_file], [yes], [$2], [$3])[]dnl
49 AS_VAR_POPDEF([lb_file])dnl
50 ]) # LB_CHECK_FILE
51
52 #
53 # LB_ARG_LIBS_INCLUDES
54 #
55 # support for --with-foo, --with-foo-includes, and --with-foo-libs in
56 # a single magical macro
57 #
58 AC_DEFUN([LB_ARG_LIBS_INCLUDES], [
59 lb_pathvar="m4_bpatsubst([$2], -, _)"
60 AC_MSG_CHECKING([for $1])
61 AC_ARG_WITH([$2],
62         AS_HELP_STRING([--with-$2=path],
63                 [path to $1]),
64         [], [withval=$4])
65 AS_IF([test "x$withval" = xyes],
66         [eval "$lb_pathvar='$3'"],
67         [eval "$lb_pathvar='$withval'"])
68 AC_MSG_RESULT([${!lb_pathvar:-no}])
69
70 AS_IF([test "x${!lb_pathvar}" != x -a "x${!lb_pathvar}" != xno], [
71         AC_MSG_CHECKING([for $1 includes])
72         AC_ARG_WITH([$2-includes],
73                 AS_HELP_STRING([--with-$2-includes=path],
74                         [path to $1 includes]),
75                 [], [withval="yes"])
76
77         lb_includevar="${lb_pathvar}_includes"
78         AS_IF([test "x$withval" = xyes],
79                 [eval "${lb_includevar}='${!lb_pathvar}/include'"],
80                 [eval "${lb_includevar}='$withval'"])
81         AC_MSG_RESULT([${!lb_includevar}])
82
83         AC_MSG_CHECKING([for $1 libs])
84         AC_ARG_WITH([$2-libs],
85                 AS_HELP_STRING([--with-$2-libs=path],
86                         [path to $1 libs]),
87                 [], [withval="yes"])
88
89         lb_libvar="${lb_pathvar}_libs"
90         AS_IF([test "x$withval" = xyes],
91                 [eval "${lb_libvar}='${!lb_pathvar}/lib'"],
92                 [eval "${lb_libvar}='$withval'"])
93         AC_MSG_RESULT([${!lb_libvar}])
94 ])
95 ]) # LB_ARG_LIBS_INCLUDES
96
97 #
98 # LB_PATH_LUSTREIOKIT
99 #
100 # We no longer handle external lustre-iokit
101 #
102 AC_DEFUN([LB_PATH_LUSTREIOKIT], [
103 AC_MSG_CHECKING([whether to build iokit])
104 AC_ARG_ENABLE([iokit],
105         AS_HELP_STRING([--disable-iokit],
106                 [disable iokit (default is enable)]),
107         [], [enable_iokit="yes"])
108 AC_MSG_RESULT([$enable_iokit])
109 AS_IF([test "x$enable_iokit" = xyes],
110         [LUSTREIOKIT_SUBDIR="lustre-iokit"],
111         [LUSTREIOKIT_SUBDIR=""])
112 AC_SUBST(LUSTREIOKIT_SUBDIR)
113 AM_CONDITIONAL([BUILD_LUSTREIOKIT], [test "x$enable_iokit" = xyes])
114 ]) # LB_PATH_LUSTREIOKIT
115
116 #
117 # LB_LIBMOUNT
118 #
119 # Check whether build with libmount for mount.lustre.
120 # libmount is part of the util-linux since v2.18.
121 # We need it to manipulate utab file.
122 #
123 AC_DEFUN([LB_LIBMOUNT], [
124 AC_CHECK_HEADER([libmount/libmount.h], [
125         AC_CHECK_LIB([mount], [mnt_update_set_fs], [
126                 LDLIBMOUNT="-lmount"
127                 AC_SUBST(LDLIBMOUNT)
128                 with_libmount="yes"
129         ],[with_libmount="no"])
130 ], [with_libmount="no"])
131 AC_MSG_CHECKING([whether to build with libmount])
132 AS_IF([test "x$with_libmount" = xyes], [
133         AC_MSG_RESULT([yes])
134 ], [
135         AC_MSG_RESULT([no])
136         AC_MSG_ERROR([libmount development package is required])
137 ])
138 ]) # LB_LIBMOUNT
139
140 #
141 # LB_CONFIG_MODULES
142 #
143 # Build kernel modules?
144 #
145 AC_DEFUN([LB_CONFIG_MODULES], [
146 AC_MSG_CHECKING([whether to build Linux kernel modules])
147 AC_ARG_ENABLE([modules],
148         AS_HELP_STRING([--disable-modules],
149                 [disable building of Lustre kernel modules]),
150         [ AC_DEFINE(HAVE_NATIVE_LINUX_CLIENT, 1, [support native Linux client])], [
151                 LC_TARGET_SUPPORTED([enable_modules="yes"],
152                                     [enable_modules="no"])
153         ])
154 AC_MSG_RESULT([$enable_modules ($target_os)])
155
156 AS_IF([test "x$enable_modules" = xyes], [
157         AS_IF([test "x$FLEX" = "x"], [AC_MSG_ERROR([flex package is required to build kernel modules])])
158         AS_IF([test "x$BISON" = "x"], [AC_MSG_ERROR([bison package is required to build kernel modules])])
159         AS_CASE([$target_os],
160                 [linux*], [
161                         # Ensure SUBARCH is defined
162                         SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/' -e 's/armv7.*/arm/')
163
164                         # Run serial tests
165                         LB_PROG_LINUX
166                         LIBCFS_PROG_LINUX
167                         LN_PROG_LINUX
168                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR])
169                         LC_PROG_LINUX
170
171                         # Run 'early' checks. The results of these are used in
172                         # other configure tests:
173                         LIBCFS_SRC_LOCKDEP_IS_HELD
174                         LIBCFS_SRC_HAVE_WAIT_BIT_HEADER
175                         LIBCFS_SRC_LINUX_BLK_INTEGRITY_HEADER
176                         LIBCFS_SRC_HAVE_MMAP_LOCK
177
178                         LB2_LINUX_TEST_COMPILE_ALL([early],
179                                 [for available lustre kapi interfaces])
180
181                         LIBCFS_LOCKDEP_IS_HELD
182                         LIBCFS_HAVE_WAIT_BIT_HEADER
183                         LIBCFS_LINUX_BLK_INTEGRITY_HEADER
184                         LIBCFS_HAVE_MMAP_LOCK
185
186                         # Run any parallel compile tests
187                         LB_PROG_LINUX_SRC
188                         LIBCFS_PROG_LINUX_SRC
189                         LN_PROG_LINUX_SRC
190                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR_SRC])
191                         LC_PROG_LINUX_SRC
192
193                         LB2_LINUX_TEST_COMPILE_ALL([lustre],
194                                 [for available lustre kapi interfaces])
195
196                         # Collect parallel compile tests results
197                         LB_PROG_LINUX_RESULTS
198                         LIBCFS_PROG_LINUX_RESULTS
199                         LN_PROG_LINUX_RESULTS
200                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR_RESULTS])
201                         LC_PROG_LINUX_RESULTS
202
203                 ], [*], [
204                         # This is strange - Lustre supports a target we don't
205                         AC_MSG_ERROR([Modules are not supported on $target_os])
206         ])
207         # Use OpenSFS UAPI header path instead of linux kernel
208         CPPFLAGS="-I$PWD/lnet/include/uapi -I$PWD/lustre/include/uapi $CPPFLAGS"
209 ])
210 ]) # LB_CONFIG_MODULES
211
212 #
213 # LB_CONFIG_UTILS
214 #
215 # Build utils?
216 #
217 AC_DEFUN([LB_CONFIG_UTILS], [
218 AC_MSG_CHECKING([whether to build Lustre utilities])
219 AC_ARG_ENABLE([utils],
220         AS_HELP_STRING([--disable-utils],
221                 [disable building of Lustre utility programs]),
222         [], [enable_utils="yes"])
223 AC_MSG_RESULT([$enable_utils])
224 ]) # LB_CONFIG_UTILS
225
226 #
227 # LB_CONFIG_LUTF
228 #
229 # Build LNet Unit Test Framework?
230 #
231 AC_DEFUN([LB_CONFIG_LUTF], [
232 AX_PYTHON_DEVEL()
233 AS_IF([test "x$enable_dist" != xno], [
234         enable_lutf="yes"
235 ], [
236   AS_IF([test "x$PYTHON_VERSION_CHECK" = xno], [
237         enable_lutf="no"
238   ], [
239         AX_PKG_SWIG(2.0, [ enable_lutf="yes" ],
240                          [ enable_lutf="no" ])
241   ])
242 ])
243 AC_ARG_ENABLE([lutf],
244         AS_HELP_STRING([--disable-lutf],
245                 [disable building of LUTF]),
246         [], [enable_lutf="yes"])
247 AC_MSG_CHECKING([whether to build LUTF (LNet Unit Test Framework)])
248 AC_MSG_RESULT([$enable_lutf])
249 ]) # LB_CONFIG_LUTF
250
251 #
252 # LB_CONFIG_TESTS
253 #
254 # Build Lustre/LNet regression tests?
255 #
256 AC_DEFUN([LB_CONFIG_TESTS], [
257 AC_MSG_CHECKING([whether to build Lustre tests])
258 AC_ARG_ENABLE([tests],
259         AS_HELP_STRING([--disable-tests],
260                 [disable building of Lustre tests]),
261         [], [enable_tests="yes"])
262 AC_MSG_RESULT([$enable_tests])
263 ]) # LB_CONFIG_TESTS
264
265 #
266 # LB_CONFIG_DIST
267 #
268 # Just enough configure so that "make dist" is useful
269 #
270 # this simply re-adjusts some defaults, which of course can be overridden
271 # on the configure line after the --for-dist option
272 #
273 AC_DEFUN([LB_CONFIG_DIST], [
274 AC_MSG_CHECKING([whether to configure just enough for make dist])
275 AC_ARG_ENABLE([dist],
276         AS_HELP_STRING([--enable-dist],
277                         [only configure enough for make dist]),
278         [], [enable_dist="no"])
279 AC_MSG_RESULT([$enable_dist])
280 AS_IF([test "x$enable_dist" != xno], [
281         enable_doc="no"
282         enable_utils="no"
283         enable_tests="no"
284         enable_modules="no"
285 ])
286 ]) # LB_CONFIG_DIST
287
288 #
289 # LB_CONFIG_DOCS
290 #
291 # Build docs?
292 #
293 AC_DEFUN([LB_CONFIG_DOCS], [
294 AC_MSG_CHECKING([whether to build Lustre docs])
295 AC_ARG_ENABLE([doc],
296         AS_HELP_STRING([--disable-doc],
297                         [skip creation of pdf documentation]),
298         [], [enable_doc="no"])
299 AC_MSG_RESULT([$enable_doc])
300 AS_IF([test "x$enable_doc" = xyes],
301         [ENABLE_DOC=1], [ENABLE_DOC=0])
302 AC_SUBST(ENABLE_DOC)
303 ]) # LB_CONFIG_DOCS
304
305 #
306 # LB_CONFIG_MANPAGES
307 #
308 # Build manpages?
309 #
310 AC_DEFUN([LB_CONFIG_MANPAGES], [
311 AC_MSG_CHECKING([whether to build Lustre manpages])
312 AC_ARG_ENABLE([manpages],
313         AS_HELP_STRING([--disable-manpages],
314                         [skip creation and inclusion of man pages (default is enable)]),
315         [], [enable_manpages="yes"])
316 AC_MSG_RESULT([$enable_manpages])
317 ]) # LB_CONFIG_MANPAGES
318
319 #
320 # LB_CONFIG_HEADERS
321 #
322 # add -include config.h
323 #
324 AC_DEFUN([LB_CONFIG_HEADERS], [
325 AC_CONFIG_HEADERS([config.h])
326 CPPFLAGS="-include $PWD/undef.h -include $PWD/config.h $CPPFLAGS"
327 EXTRA_KCFLAGS="-include $PWD/undef.h -include $PWD/config.h $EXTRA_KCFLAGS"
328 AC_SUBST(EXTRA_KCFLAGS)
329 ]) # LB_CONFIG_HEADERS
330
331 #
332 # LB_INCLUDE_RULES
333 #
334 # defines for including the toplevel Rules
335 #
336 AC_DEFUN([LB_INCLUDE_RULES], [
337 INCLUDE_RULES="include $PWD/Rules"
338 AC_SUBST(INCLUDE_RULES)
339 ]) # LB_INCLUDE_RULES
340
341 #
342 # LB_PATH_DEFAULTS
343 #
344 # 'fixup' default paths
345 #
346 AC_DEFUN([LB_PATH_DEFAULTS], [
347 # directories for binaries
348 AC_PREFIX_DEFAULT([/usr])
349
350 sysconfdir='/etc'
351 AC_SUBST(sysconfdir)
352
353 # Directories for documentation and demos.
354 docdir='${datadir}/doc/$(PACKAGE)'
355 AC_SUBST(docdir)
356
357 LIBCFS_PATH_DEFAULTS
358 LN_PATH_DEFAULTS
359 LC_PATH_DEFAULTS
360 ]) # LB_PATH_DEFAULTS
361
362 #
363 # LB_CONDITIONALS
364 #
365 # AM_CONDITIONAL instances for everything
366 # (so that portals/lustre can disable some if needed)
367 #
368 AC_DEFUN([LB_CONDITIONALS], [
369 AM_CONDITIONAL([PLUGINS], [test x$enable_shared = xyes])
370 AM_CONDITIONAL([MODULES], [test x$enable_modules = xyes])
371 AM_CONDITIONAL([UTILS], [test x$enable_utils = xyes])
372 AM_CONDITIONAL([TESTS], [test x$enable_tests = xyes])
373 AM_CONDITIONAL([DOC], [test x$ENABLE_DOC = x1])
374 AM_CONDITIONAL([MANPAGES], [test x$enable_manpages = xyes])
375 AM_CONDITIONAL([LINUX], [test x$lb_target_os = xlinux])
376 AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes])
377 AM_CONDITIONAL([RHEL], [test -f /etc/redhat-release -o -f /etc/openEuler-release])
378 AM_CONDITIONAL([SUSE], [test -f /etc/SUSE-brand -o -f /etc/SuSE-release])
379 AM_CONDITIONAL([UBUNTU], [test x$UBUNTU_KERNEL = xyes])
380 AM_CONDITIONAL([BUILD_LUTF], [test x$enable_lutf = xyes])
381 AM_CONDITIONAL([DEQUOTE_CC_VERSION_TEXT], [test x$lb_cv_dequote_CC_VERSION_TEXT = xyes])
382
383 LN_CONDITIONALS
384 LC_CONDITIONALS
385 ]) # LB_CONDITIONALS
386
387 #
388 # LB_CONFIG_FILES
389 #
390 # build-specific config files
391 #
392 AC_DEFUN([LB_CONFIG_FILES], [
393         AC_CONFIG_FILES([
394                 Makefile
395                 autoMakefile]
396                 config/Makefile
397                 [Rules:build/Rules.in]
398                 AC_PACKAGE_TARNAME[.spec]
399                 AC_PACKAGE_TARNAME[-dkms.spec]
400                 ldiskfs/Makefile
401                 ldiskfs/autoMakefile
402                 lustre/utils/lustre.pc
403                 lustre-iokit/Makefile
404                 lustre-iokit/obdfilter-survey/Makefile
405                 lustre-iokit/ost-survey/Makefile
406                 lustre-iokit/sgpdd-survey/Makefile
407                 lustre-iokit/mds-survey/Makefile
408                 lustre-iokit/ior-survey/Makefile
409                 lustre-iokit/stats-collect/Makefile
410                 lustre-iokit/lst-survey/Makefile
411         )
412 ])
413
414 #
415 # LB_CONFIG_SERVERS
416 #
417 AC_DEFUN([LB_CONFIG_SERVERS], [
418 AC_ARG_ENABLE([server],
419         AS_HELP_STRING([--disable-server],
420                         [disable Lustre server support]), [
421                 AS_IF([test x$enable_server != xyes -a x$enable_server != xno],
422                         [AC_MSG_ERROR([server valid options are "yes" or "no"])])
423                 AS_IF([test x$enable_server = xyes -a x$enable_dist = xyes],
424                         [AC_MSG_ERROR([--enable-server cannot be used with --enable-dist])])
425         ], [
426                 AS_IF([test x$enable_dist = xyes],
427                         [enable_server=no], [enable_server=maybe])
428         ])
429
430 # There are at least two good reasons why we should really run
431 # LB_CONFIG_MODULES elsewhere before the call to LB_CONFIG_SERVERS:
432 # LB_CONFIG_MODULES needs to be run for client support even when
433 # servers are disabled, and because module support is actually a
434 # prerequisite of server support.  However, some things under
435 # LB_CONFIG_MODULES need us to already have checked for --disable-server,
436 # before running, so until LB_CONFIG_MODULES can be reorganized, we
437 # call it here.
438 LB_CONFIG_MODULES
439 AS_IF([test x$enable_modules = xno], [enable_server=no])
440 LB_CONFIG_LDISKFS
441 LB_CONFIG_ZFS
442
443 # If no backends were configured, and the user did not explicitly
444 # require servers to be enabled, we just disable servers.
445 AS_IF([test x$enable_ldiskfs = xno -a x$enable_zfs = xno], [
446         AS_CASE([$enable_server],
447                 [maybe], [enable_server=no],
448                 [yes], [AC_MSG_ERROR([cannot enable servers, no backends were configured])])
449         ], [
450                 AS_IF([test x$enable_server = xmaybe], [enable_server=yes])
451         ])
452
453 AC_MSG_CHECKING([whether to build Lustre server support])
454 AC_MSG_RESULT([$enable_server])
455 AS_IF([test x$enable_server = xyes], [
456         AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
457         AC_SUBST(ENABLE_SERVER, yes)
458 ], [
459         AC_SUBST(ENABLE_SERVER, no)
460 ])
461 ]) # LB_CONFIG_SERVERS
462
463 #
464 # LB_CONFIG_RPMBUILD_OPTIONS
465 #
466 # The purpose of this function is to assemble command line options
467 # for the rpmbuild command based on the options passed to the configure
468 # script, and also upon the decisions that configure makes based on
469 # the tests that it runs.
470 # These strings can be passed to rpmbuild on the command line
471 # in the Make targets named "rpms" and "srpm".
472 #
473 AC_DEFUN([LB_CONFIG_RPMBUILD_OPTIONS], [
474 RPMBINARGS=
475 CONFIGURE_ARGS=
476 eval set -- $ac_configure_args
477 for arg; do
478         case $arg in
479                 --*dir=* ) ;;
480                 -C | --cache-file=* ) ;;
481                 --prefix=* | --*-prefix=* ) ;;
482                 --enable-dist ) ;;
483                 --with-kmp-moddir=* ) ;;
484                 --with-linux=* | --with-linux-obj=* ) ;;
485                 --enable-shared | --disable-shared ) ;;
486                 --enable-static | --disable-static ) ;;
487                 --enable-ldiskfs | --disable-ldiskfs ) ;;
488                 --enable-modules | --disable-modules ) ;;
489                 --enable-server | --disable-server ) ;;
490                 --enable-tests | --disable-tests ) ;;
491                 --enable-utils | --disable-utils ) ;;
492                 --enable-iokit | --disable-iokit ) ;;
493                 --enable-manpages | --disable-manpages ) ;;
494                 * ) CONFIGURE_ARGS="$CONFIGURE_ARGS '$arg'" ;;
495         esac
496 done
497 if test -n "$CONFIGURE_ARGS" ; then
498         RPMBINARGS="$RPMBINARGS --define \"configure_args $CONFIGURE_ARGS\""
499 fi
500 if test -n "$LINUX" ; then
501         RPMBINARGS="$RPMBINARGS --define \"kdir $LINUX\""
502         if test -n "$LINUX_OBJ" -a "$LINUX_OBJ" != x"$LINUX" ; then
503                 RPMBINARGS="$RPMBINARGS --define \"kobjdir $LINUX_OBJ\""
504         fi
505 fi
506 if test x$enable_modules != xyes ; then
507         RPMBINARGS="$RPMBINARGS --without lustre_modules"
508 fi
509 if test x$enable_tests != xyes ; then
510         RPMBINARGS="$RPMBINARGS --without lustre_tests"
511 fi
512 if test x$enable_lutf != xyes ; then
513         RPMBINARGS="$RPMBINARGS --without lustre_tests_lutf"
514 fi
515 if test x$enable_utils != xyes ; then
516         RPMBINARGS="$RPMBINARGS --without lustre_utils"
517 fi
518 if test x$enable_server != xyes ; then
519         RPMBINARGS="$RPMBINARGS --without servers"
520 fi
521 if test x$enable_ldiskfs != xyes ; then
522         RPMBINARGS="$RPMBINARGS --without ldiskfs"
523 fi
524 if test x$enable_zfs = xyes ; then
525         RPMBINARGS="$RPMBINARGS --with zfs"
526 fi
527 if test x$enable_gss_keyring = xyes ; then
528         RPMBINARGS="$RPMBINARGS --with gss_keyring --with gss"
529 fi
530 if test x$enable_gss = xyes ; then
531         RPMBINARGS="$RPMBINARGS --with gss"
532         AC_SUBST(ENABLE_GSS, yes)
533 elif test x$enable_gss = xno ; then
534         RPMBINARGS="$RPMBINARGS --without gss"
535         AC_SUBST(ENABLE_GSS, no)
536 fi
537 if test x$enable_crypto = xyes ; then
538         RPMBINARGS="$RPMBINARGS --with crypto"
539         AC_SUBST(ENABLE_CRYPTO, yes)
540 elif test x$enable_crypto = xno ; then
541         RPMBINARGS="$RPMBINARGS --without crypto"
542         AC_SUBST(ENABLE_CRYPTO, no)
543 fi
544 if test x$enable_multiple_lnds = xyes ; then
545         RPMBINARGS="$RPMBINARGS --with multiple_lnds"
546 else
547         RPMBINARGS="$RPMBINARGS --without multiple_lnds"
548 fi
549 if test x$EXTERNAL_KO2IBLND = xyes ; then
550         RPMBINARGS="$RPMBINARGS --with mofed"
551 else
552         RPMBINARGS="$RPMBINARGS --without mofed"
553 fi
554 if test x$BUILT_IN_KO2IBLND = xyes ; then
555         RPMBINARGS="$RPMBINARGS --with o2ib"
556 else
557         RPMBINARGS="$RPMBINARGS --without o2ib"
558 fi
559 if test x$KFILND = xkfilnd ; then
560         RPMBINARGS="$RPMBINARGS --with kfi"
561 else
562         RPMBINARGS="$RPMBINARGS --without kfi"
563 fi
564 if test x$ENABLE_GNI = xyes ; then
565         RPMBINARGS="$RPMBINARGS --with gni"
566 else
567         RPMBINARGS="$RPMBINARGS --without gni"
568 fi
569 if test x$enable_iokit != xyes ; then
570         RPMBINARGS="$RPMBINARGS --without lustre_iokit"
571 fi
572 if test x$enable_manpages != xyes ; then
573         RPMBINARGS="$RPMBINARGS --without manpages"
574 fi
575 if test x$enable_shared != xyes ; then
576         RPMBINARGS="$RPMBINARGS --without shared"
577 fi
578 if test x$enable_static != xyes ; then
579         RPMBINARGS="$RPMBINARGS --without static"
580 fi
581 if test x$enable_mpitests != xyes ; then
582         RPMBINARGS="$RPMBINARGS --without mpi"
583 fi
584
585 RPMBUILD_BINARY_ARGS=$RPMBINARGS
586
587 AC_SUBST(RPMBUILD_BINARY_ARGS)
588 ]) # LB_CONFIG_RPMBUILD_OPTIONS
589
590 #
591 # LB_CONFIG_CACHE_OPTIONS
592 #
593 # Propagate config cache option
594 #
595 AC_DEFUN([LB_CONFIG_CACHE_OPTIONS], [
596 CONFIG_CACHE_FILE=
597 if test -f "$cache_file"; then
598         CONFIG_CACHE_FILE=$(readlink --canonicalize "$cache_file")
599 fi
600 AC_SUBST(CONFIG_CACHE_FILE)
601 ]) # LB_CONFIG_CACHE_OPTIONS
602
603 #
604 # LB_CONFIGURE
605 #
606 # main configure steps
607 #
608 AC_DEFUN([LB_CONFIGURE], [
609 AC_MSG_NOTICE([Lustre base checks
610 ==============================================================================])
611 LB_CANONICAL_SYSTEM
612
613 LB_CONFIG_DIST
614
615 LB_DOWNSTREAM_RELEASE
616 LB_USES_DPKG
617
618 LB_INCLUDE_RULES
619
620 LB_PATH_DEFAULTS
621
622 LC_OSD_ADDON
623
624 LB_CONFIG_DOCS
625 LB_CONFIG_MANPAGES
626 LB_CONFIG_UTILS
627 LB_CONFIG_TESTS
628 LB_CONFIG_LUTF
629 LC_CONFIG_CLIENT
630 LB_CONFIG_MPITESTS
631 LB_CONFIG_SERVERS
632 LC_CONFIG_CRYPTO
633 LC_GLIBC_SUPPORT_COPY_FILE_RANGE
634 LC_OPENSSL_SSK
635
636 # Tests depends from utils (multiop from liblustreapi)
637 AS_IF([test "x$enable_utils" = xno], [enable_tests="no"])
638
639 AS_IF([test "x$enable_utils" = xyes], [
640         LC_OPENSSL_GETSEPOL
641         LC_CONFIG_GETSEPOL
642         LC_FID2PATH_ANON_UNION
643 ])
644 AS_IF([test "x$enable_tests" = xyes], [
645         LC_HAVE_LIBAIO
646         LC_GLIBC_SUPPORT_FHANDLES
647 ])
648
649 LIBCFS_CONFIG_CDEBUG
650 LC_QUOTA
651
652 AS_IF([test "x$enable_dist" != xno], [],[LB_LIBMOUNT])
653 LB_PATH_LUSTREIOKIT
654
655 LB_DEFINE_E2FSPROGS_NAMES
656
657 LIBCFS_CONFIGURE
658 LN_CONFIGURE
659 LC_CONFIGURE
660
661 LB_CONDITIONALS
662 LB_CONFIG_HEADERS
663
664 LPLUG_CONFIGURE
665 LIBCFS_CONFIG_FILES
666 LB_CONFIG_FILES
667 LN_CONFIG_FILES
668 LC_CONFIG_FILES
669 LPLUG_CONFIG_FILES
670
671 AC_SUBST(ac_configure_args)
672
673 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
674 AC_SUBST(MOSTLYCLEANFILES)
675
676 LB_CONFIG_RPMBUILD_OPTIONS
677 LB_CONFIG_CACHE_OPTIONS
678
679 AS_IF([test -d $TEST_DIR -a "x${PARALLEL_BUILD_OPT}" != "xdebug"], [
680         AC_MSG_NOTICE([remove temporary parallel configure dir $TEST_DIR])
681         rm -rf $TEST_DIR
682 ])
683
684 AC_OUTPUT
685 ]) # LB_CONFIGURE