Whamcloud - gitweb
LU-17110 llite: fix slab corruption with fm_extent_count=0
[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_PATH_SNMP
142 #
143 # check for in-tree snmp support
144 #
145 AC_DEFUN([LB_PATH_SNMP], [
146 LB_CHECK_FILE([$srcdir/snmp/lustre-snmp.c], [SNMP_DIST_SUBDIR="snmp"])
147 AC_SUBST(SNMP_DIST_SUBDIR)
148 AC_SUBST(SNMP_SUBDIR)
149 ]) # LB_PATH_SNMP
150
151 #
152 # LB_CONFIG_MODULES
153 #
154 # Build kernel modules?
155 #
156 AC_DEFUN([LB_CONFIG_MODULES], [
157 AC_MSG_CHECKING([whether to build Linux kernel modules])
158 AC_ARG_ENABLE([modules],
159         AS_HELP_STRING([--disable-modules],
160                 [disable building of Lustre kernel modules]),
161         [ AC_DEFINE(HAVE_NATIVE_LINUX_CLIENT, 1, [support native Linux client])], [
162                 LC_TARGET_SUPPORTED([enable_modules="yes"],
163                                     [enable_modules="no"])
164         ])
165 AC_MSG_RESULT([$enable_modules ($target_os)])
166
167 AS_IF([test "x$enable_modules" = xyes], [
168         AS_IF([test "x$FLEX" = "x"], [AC_MSG_ERROR([flex package is required to build kernel modules])])
169         AS_IF([test "x$BISON" = "x"], [AC_MSG_ERROR([bison package is required to build kernel modules])])
170         AS_CASE([$target_os],
171                 [linux*], [
172                         # Ensure SUBARCH is defined
173                         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/')
174
175                         # Run serial tests
176                         LB_PROG_LINUX
177                         LIBCFS_PROG_LINUX
178                         LN_PROG_LINUX
179                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR])
180                         LC_PROG_LINUX
181
182                         # Run 'early' checks. The results of these are used in
183                         # other configure tests:
184                         LIBCFS_SRC_LOCKDEP_IS_HELD
185                         LIBCFS_SRC_HAVE_WAIT_BIT_HEADER
186                         LIBCFS_SRC_LINUX_BLK_INTEGRITY_HEADER
187
188                         LB2_LINUX_TEST_COMPILE_ALL([early],
189                                 [for available lustre kapi interfaces])
190
191                         LIBCFS_LOCKDEP_IS_HELD
192                         LIBCFS_HAVE_WAIT_BIT_HEADER
193                         LIBCFS_LINUX_BLK_INTEGRITY_HEADER
194
195                         # Run any parallel compile tests
196                         LB_PROG_LINUX_SRC
197                         LIBCFS_PROG_LINUX_SRC
198                         LN_PROG_LINUX_SRC
199                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR_SRC])
200                         LC_PROG_LINUX_SRC
201
202                         LB2_LINUX_TEST_COMPILE_ALL([lustre],
203                                 [for available lustre kapi interfaces])
204
205                         # Collect parallel compile tests results
206                         LB_PROG_LINUX_RESULTS
207                         LIBCFS_PROG_LINUX_RESULTS
208                         LN_PROG_LINUX_RESULTS
209                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR_RESULTS])
210                         LC_PROG_LINUX_RESULTS
211
212                 ], [*], [
213                         # This is strange - Lustre supports a target we don't
214                         AC_MSG_ERROR([Modules are not supported on $target_os])
215         ])
216         # Use OpenSFS UAPI header path instead of linux kernel
217         CPPFLAGS="-I$PWD/lnet/include/uapi -I$PWD/lustre/include/uapi $CPPFLAGS"
218 ])
219 ]) # LB_CONFIG_MODULES
220
221 #
222 # LB_CONFIG_UTILS
223 #
224 # Build utils?
225 #
226 AC_DEFUN([LB_CONFIG_UTILS], [
227 AC_MSG_CHECKING([whether to build Lustre utilities])
228 AC_ARG_ENABLE([utils],
229         AS_HELP_STRING([--disable-utils],
230                 [disable building of Lustre utility programs]),
231         [], [enable_utils="yes"])
232 AC_MSG_RESULT([$enable_utils])
233 ]) # LB_CONFIG_UTILS
234
235 #
236 # LB_CONFIG_TESTS
237 #
238 # Build tests?
239 #
240 AC_DEFUN([LB_CONFIG_TESTS], [
241 AC_MSG_CHECKING([whether to build Lustre tests])
242 AC_ARG_ENABLE([tests],
243         AS_HELP_STRING([--disable-tests],
244                 [disable building of Lustre tests]),
245         [], [enable_tests="yes"])
246
247 #
248 # Check to see if we can build the lutf
249 #
250 AX_PYTHON_DEVEL()
251 AS_IF([test "x$enable_dist" != xno], [
252         enable_lutf="yes"
253 ], [
254   AS_IF([test "x$PYTHON_VERSION_CHECK" = xno], [
255         enable_lutf="no"
256   ], [
257         AX_PKG_SWIG(2.0, [ enable_lutf="yes" ],
258                          [ enable_lutf="no" ])
259   ])
260 ])
261
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_iokit != xyes ; then
545         RPMBINARGS="$RPMBINARGS --without lustre_iokit"
546 fi
547 if test x$enable_snmp != xyes ; then
548         RPMBINARGS="$RPMBINARGS --without snmp"
549 fi
550 if test x$enable_manpages != xyes ; then
551         RPMBINARGS="$RPMBINARGS --without manpages"
552 fi
553 if test x$enable_shared != xyes ; then
554         RPMBINARGS="$RPMBINARGS --without shared"
555 fi
556 if test x$enable_static != xyes ; then
557         RPMBINARGS="$RPMBINARGS --without static"
558 fi
559 if test x$enable_mpitests != xyes ; then
560         RPMBINARGS="$RPMBINARGS --without mpi"
561 fi
562
563 RPMBUILD_BINARY_ARGS=$RPMBINARGS
564
565 AC_SUBST(RPMBUILD_BINARY_ARGS)
566 ]) # LB_CONFIG_RPMBUILD_OPTIONS
567
568 #
569 # LB_CONFIG_CACHE_OPTIONS
570 #
571 # Propagate config cache option
572 #
573 AC_DEFUN([LB_CONFIG_CACHE_OPTIONS], [
574 CONFIG_CACHE_FILE=
575 if test -f "$cache_file"; then
576         CONFIG_CACHE_FILE=$(readlink --canonicalize "$cache_file")
577 fi
578 AC_SUBST(CONFIG_CACHE_FILE)
579 ]) # LB_CONFIG_CACHE_OPTIONS
580
581 #
582 # LB_CONFIGURE
583 #
584 # main configure steps
585 #
586 AC_DEFUN([LB_CONFIGURE], [
587 AC_MSG_NOTICE([Lustre base checks
588 ==============================================================================])
589 LB_CANONICAL_SYSTEM
590
591 LB_CONFIG_DIST
592
593 LB_DOWNSTREAM_RELEASE
594 LB_USES_DPKG
595
596 LB_INCLUDE_RULES
597
598 LB_PATH_DEFAULTS
599
600 LC_OSD_ADDON
601
602 LB_CONFIG_DOCS
603 LB_CONFIG_MANPAGES
604 LB_CONFIG_UTILS
605 LB_CONFIG_TESTS
606 LC_CONFIG_CLIENT
607 LB_CONFIG_MPITESTS
608 LB_CONFIG_SERVERS
609 LC_CONFIG_CRYPTO
610 LC_GLIBC_SUPPORT_COPY_FILE_RANGE
611 LC_OPENSSL_SSK
612
613 # Tests depends from utils (multiop from liblustreapi)
614 AS_IF([test "x$enable_utils" = xno], [enable_tests="no"])
615
616 AS_IF([test "x$enable_utils" = xyes], [
617         LC_OPENSSL_GETSEPOL
618         LC_FID2PATH_ANON_UNION
619 ])
620 AS_IF([test "x$enable_tests" = xyes], [
621         LC_HAVE_LIBAIO
622         LC_GLIBC_SUPPORT_FHANDLES
623 ])
624
625 LIBCFS_CONFIG_CDEBUG
626 LC_QUOTA
627
628 AS_IF([test "x$enable_dist" != xno], [],[LB_LIBMOUNT])
629 LB_PATH_SNMP
630 LB_PATH_LUSTREIOKIT
631
632 LB_DEFINE_E2FSPROGS_NAMES
633
634 LIBCFS_CONFIGURE
635 LN_CONFIGURE
636 LC_CONFIGURE
637 AS_IF([test -n "$SNMP_DIST_SUBDIR"], [LS_CONFIGURE])
638
639 LB_CONDITIONALS
640 LB_CONFIG_HEADERS
641
642 LPLUG_CONFIGURE
643 LIBCFS_CONFIG_FILES
644 LB_CONFIG_FILES
645 LN_CONFIG_FILES
646 LC_CONFIG_FILES
647 LPLUG_CONFIG_FILES
648 AS_IF([test -n "$SNMP_DIST_SUBDIR"], [LS_CONFIG_FILES])
649
650 AC_SUBST(ac_configure_args)
651
652 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
653 AC_SUBST(MOSTLYCLEANFILES)
654
655 LB_CONFIG_RPMBUILD_OPTIONS
656 LB_CONFIG_CACHE_OPTIONS
657
658 AS_IF([test -d $TEST_DIR -a "x${PARALLEL_BUILD_OPT}" != "xdebug"], [
659         AC_MSG_NOTICE([remove temporary parallel configure dir $TEST_DIR])
660         rm -rf $TEST_DIR
661 ])
662
663 AC_OUTPUT
664 ]) # LB_CONFIGURE