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