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