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