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