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