Whamcloud - gitweb
LU-5262 osd: only allow set size for regular file
[fs/lustre-release.git] / config / lustre-build.m4
1 #
2 # LB_CHECK_VERSION
3 #
4 # Verify that LUSTRE_VERSION was defined properly
5 #
6 AC_DEFUN([LB_CHECK_VERSION], [
7 AS_IF([test "LUSTRE_VERSION" = "LUSTRE""_VERSION"],
8         [AC_MSG_ERROR([This script was not built with a version number.])])
9 ]) # LB_CHECK_VERSION
10
11 #
12 # LB_CANONICAL_SYSTEM
13 #
14 # fixup $target_os for use in other places
15 #
16 AC_DEFUN([LB_CANONICAL_SYSTEM], [
17 case $target_os in
18         linux*)
19                 lb_target_os="linux"
20                 ;;
21         darwin*)
22                 lb_target_os="darwin"
23                 ;;
24         solaris*)
25                 lb_target_os="SunOS"
26                 ;;
27 esac
28 AC_SUBST(lb_target_os)
29 ]) # LB_CANONICAL_SYSTEM
30
31 #
32 # LB_DOWNSTREAM_RELEASE
33 #
34 AC_DEFUN([LB_DOWNSTREAM_RELEASE],
35 [AC_ARG_WITH([downstream-release],
36         AC_HELP_STRING([--with-downstream-release=string],
37                 [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]),
38         [DOWNSTREAM_RELEASE=$with_downstream_release],
39         [ # if not specified, see if it's in the META file
40         AS_IF([test -f META],
41                 [DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)])
42         ])
43 AC_SUBST(DOWNSTREAM_RELEASE)
44 ]) # LB_DOWNSTREAM_RELEASE
45
46 #
47 # LB_BUILDID
48 #
49 # Check if the source is a GA release and if not, set a "BUILDID"
50 #
51 # Currently there are at least two ways/modes of/for doing this.  One
52 # is if we are in a valid git repository, the other is if we are in a
53 # non-git source tree of some form.  Building the latter from the former
54 # will be handled here.
55 AC_DEFUN([LB_BUILDID], [
56 AC_CACHE_CHECK([for buildid], [lb_cv_buildid], [
57 lb_cv_buildid=""
58 AS_IF([git branch >/dev/null 2>&1], [
59         ffw=0
60         hash=""
61         ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags)
62         if [[[ $ver = *-*-* ]]]; then
63                 hash=${ver##*-}
64                 ffw=${ver#*-}
65                 ffw=${ffw%-*}
66                 ver=${ver%%-*}
67         fi
68         # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]]
69         # here but the portability of the regex on the right is dismal
70         # (thanx suse)
71         if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then
72                 ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \
73                                       -e 's/_RC[[0-9]].*$//' -e 's/_/./g')
74         fi
75
76         # a "lustre fix" value of .0 should be truncated
77         if [[[ $ver = *.*.*.0 ]]]; then
78                 ver=${ver%.0}
79         fi
80         # ditto for a "lustre fix" value of _0
81         if [[[ $ver = v*_*_*_0 ]]]; then
82                 ver=${ver%_0}
83         fi
84         if [[[ $ver = v*_*_* ]]]; then
85                 ver=${ver#v}
86                 ver=${ver//_/.}
87         fi
88
89         if test "$ver" != "$VERSION"; then
90                 AC_MSG_WARN([most recent tag found: $ver does not match current version $VERSION.])
91         fi
92
93         if test "$ffw" != "0"; then
94                 lb_cv_buildid="$hash"
95         fi
96 ], [test -f META], [
97         lb_cv_buildid=$(sed -ne '/^BUILDID =/s/.*= *//p' META)
98 ])
99 ])
100 AS_IF([test -z "$lb_cv_buildid"], [
101         AC_MSG_WARN([
102
103 FIXME: I don't know how to deal with source trees outside of git that
104 don't have a META file. Not setting a buildid.
105 ])
106 ])
107 BUILDID=$lb_cv_buildid
108 AC_SUBST(BUILDID)
109 ]) # LB_BUILDID
110
111 #
112 # LB_CHECK_FILE
113 #
114 # Check for file existance even when cross compiling
115 # $1 - file to check
116 # $2 - do 'yes'
117 # $3 - do 'no'
118 #
119 AC_DEFUN([LB_CHECK_FILE], [
120 AS_VAR_PUSHDEF([lb_file], [lb_cv_file_$1])dnl
121 AC_CACHE_CHECK([for $1], lb_file, [
122 AS_IF([test -r "$1"],
123         [AS_VAR_SET(lb_file, [yes])],
124         [AS_VAR_SET(lb_file, [no])])
125 ])
126 AS_VAR_IF([lb_file], [yes], [$2], [$3])[]dnl
127 AS_VAR_POPDEF([lb_file])dnl
128 ]) # LB_CHECK_FILE
129
130 #
131 # LB_ARG_LIBS_INCLUDES
132 #
133 # support for --with-foo, --with-foo-includes, and --with-foo-libs in
134 # a single magical macro
135 #
136 AC_DEFUN([LB_ARG_LIBS_INCLUDES], [
137 lb_pathvar="m4_bpatsubst([$2], -, _)"
138 AC_MSG_CHECKING([for $1])
139 AC_ARG_WITH([$2],
140         AC_HELP_STRING([--with-$2=path],
141                 [path to $1]),
142         [], [withval=$4])
143 AS_IF([test "x$withval" = xyes],
144         [eval "$lb_pathvar='$3'"],
145         [eval "$lb_pathvar='$withval'"])
146 AC_MSG_RESULT([${!lb_pathvar:-no}])
147
148 AS_IF([test "x${!lb_pathvar}" != x -a "x${!lb_pathvar}" != xno], [
149         AC_MSG_CHECKING([for $1 includes])
150         AC_ARG_WITH([$2-includes],
151                 AC_HELP_STRING([--with-$2-includes=path],
152                         [path to $1 includes]),
153                 [], [withval="yes"])
154
155         lb_includevar="${lb_pathvar}_includes"
156         AS_IF([test "x$withval" = xyes],
157                 [eval "${lb_includevar}='${!lb_pathvar}/include'"],
158                 [eval "${lb_includevar}='$withval'"])
159         AC_MSG_RESULT([${!lb_includevar}])
160
161         AC_MSG_CHECKING([for $1 libs])
162         AC_ARG_WITH([$2-libs],
163                 AC_HELP_STRING([--with-$2-libs=path],
164                         [path to $1 libs]),
165                 [], [withval="yes"])
166
167         lb_libvar="${lb_pathvar}_libs"
168         AS_IF([test "x$withval" = xyes],
169                 [eval "${lb_libvar}='${!lb_pathvar}/lib'"],
170                 [eval "${lb_libvar}='$withval'"])
171         AC_MSG_RESULT([${!lb_libvar}])
172 ])
173 ]) # LB_ARG_LIBS_INCLUDES
174
175 #
176 # LB_PATH_LUSTREIOKIT
177 #
178 # We no longer handle external lustre-iokit
179 #
180 AC_DEFUN([LB_PATH_LUSTREIOKIT], [
181 AC_MSG_CHECKING([whether to build iokit])
182 AC_ARG_ENABLE([iokit],
183         AC_HELP_STRING([--disable-iokit],
184                 [disable iokit (default is enable)]),
185         [], [enable_iokit="yes"])
186 AC_MSG_RESULT([$enable_iokit])
187 AS_IF([test "x$enable_iokit" = xyes],
188         [LUSTREIOKIT_SUBDIR="lustre-iokit"],
189         [LUSTREIOKIT_SUBDIR=""])
190 AC_SUBST(LUSTREIOKIT_SUBDIR)
191 AM_CONDITIONAL([BUILD_LUSTREIOKIT], [test "x$enable_iokit" = xyes])
192 ]) # LB_PATH_LUSTREIOKIT
193
194 # Define no libcfs by default.
195 AC_DEFUN([LB_LIBCFS_DIR], [
196 AS_IF([test "x$libcfs_is_module" = xyes], [
197                 LIBCFS_INCLUDE_DIR="libcfs/include"
198                 LIBCFS_SUBDIR="libcfs"
199         ], [
200                 LIBCFS_INCLUDE_DIR="lnet/include"
201                 LIBCFS_SUBDIR=""
202         ])
203 AC_SUBST(LIBCFS_INCLUDE_DIR)
204 AC_SUBST(LIBCFS_SUBDIR)
205 ]) # LB_LIBCFS_DIR
206
207 #
208 # LB_PATH_SNMP
209 #
210 # check for in-tree snmp support
211 #
212 AC_DEFUN([LB_PATH_SNMP], [
213 LB_CHECK_FILE([$srcdir/snmp/lustre-snmp.c], [SNMP_DIST_SUBDIR="snmp"])
214 AC_SUBST(SNMP_DIST_SUBDIR)
215 AC_SUBST(SNMP_SUBDIR)
216 ]) # LB_PATH_SNMP
217
218 #
219 # LB_CONFIG_MODULES
220 #
221 # Build kernel modules?
222 #
223 AC_DEFUN([LB_CONFIG_MODULES], [
224 AC_MSG_CHECKING([whether to build Linux kernel modules])
225 AC_ARG_ENABLE([modules],
226         AC_HELP_STRING([--disable-modules],
227                 [disable building of Lustre kernel modules]),
228         [], [
229                 LC_TARGET_SUPPORTED([enable_modules="yes"],
230                                     [enable_modules="no"])
231         ])
232 AC_MSG_RESULT([$enable_modules ($target_os)])
233
234 AS_IF([test "x$enable_modules" = xyes], [
235         AS_CASE([$target_os],
236                 [linux*], [
237                         LB_PROG_LINUX
238                         LIBCFS_PROG_LINUX
239                         LN_PROG_LINUX
240                         AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR])
241                         LC_PROG_LINUX
242                 ], [darwin*], [
243                         LB_PROG_DARWIN
244                         LIBCFS_PROG_DARWIN
245                 ], [*], [
246                         # This is strange - Lustre supports a target we don't
247                         AC_MSG_ERROR([Modules are not supported on $target_os])
248                 ])
249         ])
250 ]) # LB_CONFIG_MODULES
251
252 #
253 # LB_CONFIG_UTILS
254 #
255 # Build utils?
256 #
257 AC_DEFUN([LB_CONFIG_UTILS], [
258 AC_MSG_CHECKING([whether to build Lustre utilities])
259 AC_ARG_ENABLE([utils],
260         AC_HELP_STRING([--disable-utils],
261                 [disable building of Lustre utility programs]),
262         [], [enable_utils="yes"])
263 AC_MSG_RESULT([$enable_utils])
264 AS_IF([test "x$enable_utils" = xyes], [LB_CONFIG_INIT_SCRIPTS])
265 ]) # LB_CONFIG_UTILS
266
267 #
268 # LB_CONFIG_TESTS
269 #
270 # Build tests?
271 #
272 AC_DEFUN([LB_CONFIG_TESTS], [
273 AC_MSG_CHECKING([whether to build Lustre tests])
274 AC_ARG_ENABLE([tests],
275         AC_HELP_STRING([--disable-tests],
276                 [disable building of Lustre tests]),
277         [], [enable_tests="yes"])
278 AC_MSG_RESULT([$enable_tests])
279 ]) # LB_CONFIG_TESTS
280
281 #
282 # LB_CONFIG_DIST
283 #
284 # Just enough configure so that "make dist" is useful
285 #
286 # this simply re-adjusts some defaults, which of course can be overridden
287 # on the configure line after the --for-dist option
288 #
289 AC_DEFUN([LB_CONFIG_DIST], [
290 AC_MSG_CHECKING([whether to configure just enough for make dist])
291 AC_ARG_ENABLE([dist],
292         AC_HELP_STRING([--enable-dist],
293                         [only configure enough for make dist]),
294         [], [enable_dist="no"])
295 AC_MSG_RESULT([$enable_dist])
296 AS_IF([test "x$enable_dist" != xno], [
297         enable_doc="no"
298         enable_utils="no"
299         enable_tests="no"
300         enable_modules="no"
301 ])
302 ]) # LB_CONFIG_DIST
303
304 #
305 # LB_CONFIG_DOCS
306 #
307 # Build docs?
308 #
309 AC_DEFUN([LB_CONFIG_DOCS], [
310 AC_MSG_CHECKING([whether to build Lustre docs])
311 AC_ARG_ENABLE([doc],
312         AC_HELP_STRING([--disable-doc],
313                         [skip creation of pdf documentation]),
314         [], [enable_doc="no"])
315 AC_MSG_RESULT([$enable_doc])
316 AS_IF([test "x$enable_doc" = xyes],
317         [ENABLE_DOC=1], [ENABLE_DOC=0])
318 AC_SUBST(ENABLE_DOC)
319 ]) # LB_CONFIG_DOCS
320
321 #
322 # LB_CONFIG_INIT_SCRIPTS
323 #
324 # our init scripts only work on red hat linux
325 #
326 AC_DEFUN([LB_CONFIG_INIT_SCRIPTS], [
327 ENABLE_INIT_SCRIPTS=0
328 AS_IF([test x$enable_utils = xyes], [
329         AC_CACHE_CHECK([whether to install init scripts], [lb_cv_enable_init_scripts], [
330         # our scripts only work on red hat systems
331         AS_IF([test -f /etc/init.d/functions -a -f /etc/sysconfig/network],
332                 [lb_cv_enable_init_scripts="yes"],
333                 [lb_cv_enable_init_scripts="no"])
334         ])
335         AS_IF([test "x$lb_cv_enable_init_scripts" = xyes],
336                 [ENABLE_INIT_SCRIPTS=1])
337 ])
338 AC_SUBST(ENABLE_INIT_SCRIPTS)
339 ])
340
341 #
342 # LB_CONFIG_HEADERS
343 #
344 # add -include config.h
345 #
346 AC_DEFUN([LB_CONFIG_HEADERS], [
347 AC_CONFIG_HEADERS([config.h])
348 CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
349 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
350 AC_SUBST(EXTRA_KCFLAGS)
351 ]) # LB_CONFIG_HEADERS
352
353 #
354 # LB_INCLUDE_RULES
355 #
356 # defines for including the toplevel Rules
357 #
358 AC_DEFUN([LB_INCLUDE_RULES], [
359 INCLUDE_RULES="include $PWD/Rules"
360 AC_SUBST(INCLUDE_RULES)
361 ]) # LB_INCLUDE_RULES
362
363 #
364 # LB_PATH_DEFAULTS
365 #
366 # 'fixup' default paths
367 #
368 AC_DEFUN([LB_PATH_DEFAULTS], [
369 # directories for binaries
370 AC_PREFIX_DEFAULT([/usr])
371
372 sysconfdir='$(CROSS_PATH)/etc'
373 AC_SUBST(sysconfdir)
374
375 # Directories for documentation and demos.
376 docdir='$(datadir)/doc/$(PACKAGE)'
377 AC_SUBST(docdir)
378
379 LIBCFS_PATH_DEFAULTS
380 LN_PATH_DEFAULTS
381 LC_PATH_DEFAULTS
382 ]) # LB_PATH_DEFAULTS
383
384 #
385 # LB_PROG_CC
386 #
387 # checks on the C compiler
388 #
389 AC_DEFUN([LB_PROG_CC], [
390 AC_PROG_RANLIB
391 AC_CHECK_TOOL(LD, [ld], [no])
392 AC_CHECK_TOOL(OBJDUMP, [objdump], [no])
393 AC_CHECK_TOOL(STRIP, [strip], [no])
394
395 # ---------  unsigned long long sane? -------
396 AC_CHECK_SIZEOF(unsigned long long, 0)
397 AS_IF([test $ac_cv_sizeof_unsigned_long_long != 8],
398         [AC_MSG_ERROR([we assume that sizeof(unsigned long long) == 8.])])
399
400 AS_IF([test $target_cpu = powerpc64], [
401         AC_MSG_WARN([set compiler with -m64])
402         CFLAGS="$CFLAGS -m64"
403         CC="$CC -m64"
404 ])
405
406 CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include $CPPFLAGS"
407
408 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
409 AC_SUBST(LLCPPFLAGS)
410
411 # Add _GNU_SOURCE for strnlen on linux
412 LLCFLAGS="-g -Wall -fPIC -D_GNU_SOURCE"
413 AC_SUBST(LLCFLAGS)
414
415 CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
416 AC_SUBST(CCASFLAGS)
417
418 # everyone builds against lnet and lustre
419 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include"
420 AC_SUBST(EXTRA_KCFLAGS)
421 ]) # LB_PROG_CC
422
423 #
424 # LB_CONDITIONALS
425 #
426 # AM_CONDITIONAL instances for everything
427 # (so that portals/lustre can disable some if needed)
428 #
429 AC_DEFUN([LB_CONDITIONALS], [
430 AM_CONDITIONAL([MODULES], [test x$enable_modules = xyes])
431 AM_CONDITIONAL([UTILS], [test x$enable_utils = xyes])
432 AM_CONDITIONAL([TESTS], [test x$enable_tests = xyes])
433 AM_CONDITIONAL([DOC], [test x$ENABLE_DOC = x1])
434 AM_CONDITIONAL([INIT_SCRIPTS], [test x$ENABLE_INIT_SCRIPTS = x1])
435 AM_CONDITIONAL([LINUX], [test x$lb_target_os = xlinux])
436 AM_CONDITIONAL([DARWIN], [test x$lb_target_os = xdarwin])
437 AM_CONDITIONAL([SUNOS], [test x$lb_target_os = xSunOS])
438 AM_CONDITIONAL([USES_DPKG], [test x$uses_dpkg = xyes])
439 AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes])
440
441 # Sanity check for PCLMULQDQ instruction availability
442 # PCLMULQDQ instruction is a new instruction available beginning with
443 # the all new Core processor family based on the 32nm microarchitecture
444 # codename Westmere. So, $target_cpu = x86_64 should have this instruction
445 # except MIC microarchitecture (k1om).
446 AM_CONDITIONAL(HAVE_PCLMULQDQ, test x$target_cpu = "xx86_64" -a x$target_vendor != "xk1om")
447 AS_IF([test x$target_cpu = "xx86_64" -a x$target_vendor != "xk1om"],
448         [AC_DEFINE(HAVE_PCLMULQDQ, 1, [have PCLMULQDQ instruction])])
449
450 LB_DARWIN_CONDITIONALS
451
452 LIBCFS_CONDITIONALS
453 LN_CONDITIONALS
454 LC_CONDITIONALS
455 ]) # LB_CONTITIONALS
456
457 #
458 # LB_CONFIG_FILES
459 #
460 # build-specific config files
461 #
462 AC_DEFUN([LB_CONFIG_FILES], [
463         AC_CONFIG_FILES([
464                 Makefile
465                 autoMakefile]
466                 config/Makefile
467                 [Rules:build/Rules.in]
468                 AC_PACKAGE_TARNAME[.spec]
469                 AC_PACKAGE_TARNAME[-dkms.spec]
470                 contrib/Makefile
471                 contrib/lbuild/Makefile
472                 contrib/scripts/Makefile
473                 ldiskfs/Makefile
474                 ldiskfs/autoMakefile
475                 lustre-iokit/Makefile
476                 lustre-iokit/obdfilter-survey/Makefile
477                 lustre-iokit/ost-survey/Makefile
478                 lustre-iokit/sgpdd-survey/Makefile
479                 lustre-iokit/mds-survey/Makefile
480                 lustre-iokit/ior-survey/Makefile
481                 lustre-iokit/stats-collect/Makefile
482         )
483 ])
484
485 #
486 # LB_CONFIG_SERVERS
487 #
488 AC_DEFUN([LB_CONFIG_SERVERS], [
489 AC_ARG_ENABLE([server],
490         AC_HELP_STRING([--disable-server],
491                         [disable Lustre server support]), [
492                 AS_IF([test x$enable_server != xyes -a x$enable_server != xno],
493                         [AC_MSG_ERROR([server valid options are "yes" or "no"])])
494                 AS_IF([test x$enable_server = xyes -a x$enable_dist = xyes],
495                         [AC_MSG_ERROR([--enable-server cannot be used with --enable-dist])])
496         ], [
497                 AS_IF([test x$enable_dist = xyes],
498                         [enable_server=no], [enable_server=maybe])
499         ])
500
501 # There are at least two good reasons why we should really run
502 # LB_CONFIG_MODULES elsewhere before the call to LB_CONFIG_SERVERS:
503 # LB_CONFIG_MODULES needs to be run for client support even when
504 # servers are disabled, and because module support is actually a
505 # prerequisite of server support.  However, some things under
506 # LB_CONFIG_MODULES need us to already have checked for --disable-server,
507 # before running, so until LB_CONFIG_MODULES can be reorganized, we
508 # call it here.
509 LB_CONFIG_MODULES
510 AS_IF([test x$enable_modules = xno], [enable_server=no])
511 LB_CONFIG_LDISKFS
512 LB_CONFIG_ZFS
513
514 # If no backends were configured, and the user did not explicitly
515 # require servers to be enabled, we just disable servers.
516 AS_IF([test x$enable_ldiskfs = xno -a x$enable_zfs = xno], [
517         AS_CASE([$enable_server],
518                 [maybe], [enable_server=no],
519                 [yes], [AC_MSG_ERROR([cannot enable servers, no backends were configured])])
520         ], [
521                 AS_IF([test x$enable_server = xmaybe], [enable_server=yes])
522         ])
523
524 AC_MSG_CHECKING([whether to build Lustre server support])
525 AC_MSG_RESULT([$enable_server])
526 AS_IF([test x$enable_server = xyes],
527         [AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])])
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 descisions 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 RPMSRCARGS=
543 CONFIGURE_ARGS=
544 eval set -- $ac_configure_args
545 for arg; do
546         case $arg in
547                 --with-release=* ) ;;
548                 --with-kmp-moddir=* ) ;;
549                 --with-linux=* | --with-linux-obj=* ) ;;
550                 --enable-tests | --disable-tests ) ;;
551                 --enable-modules | --disable-modules ) ;;
552                 * ) CONFIGURE_ARGS="$CONFIGURE_ARGS '$arg'" ;;
553         esac
554 done
555 if test -n "$CONFIGURE_ARGS" ; then
556         RPMBINARGS="$RPMBINARGS --define \"configure_args $CONFIGURE_ARGS\""
557 fi
558 if test -n "$LINUX" ; then
559         RPMBINARGS="$RPMBINARGS --define \"kdir $LINUX\""
560         if test -n "$LINUX_OBJ" -a "$LINUX_OBJ" != x"$LINUX" ; then
561                 RPMBINARGS="$RPMBINARGS --define \"kobjdir $LINUX_OBJ\""
562         fi
563 fi
564 if test -n "$KMP_MODDIR" ; then
565         RPMBINARGS="$RPMBINARGS --define \"kmoddir $KMP_MODDIR\""
566 fi
567 if test -n "$CROSS_PATH" ; then
568         if test x$enable_server = xyes ; then
569                 echo -e "\n"
570                 "*** Don't support cross compilation for the Intel(R) Xeon Phi(TM) card.\n"
571                 exit 1
572         fi
573         CROSS_SUFFIX="-mic"
574         RPMBINARGS="$RPMBINARGS --define \"post_script build/gen_filelist.sh\""
575         RPMBINARGS="$RPMBINARGS --define \"cross_path $CROSS_PATH\""
576         RPMBINARGS="$RPMBINARGS --define \"rootdir %{cross_path}\""
577         RPMBINARGS="$RPMBINARGS --define \"_prefix %{cross_path}/usr\""
578         RPMBINARGS="$RPMBINARGS --define \"_mandir %{_prefix}/share/man\""
579         RPMBINARGS="$RPMBINARGS --define \"_sysconfdir %{cross_path}/etc\""
580         RPMBINARGS="$RPMBINARGS --define \"make_args $CROSS_VARS\""
581         if test x$CC_TARGET_ARCH = x"x86_64-k1om-linux" ; then
582                 RPMBINARGS="$RPMBINARGS --define \"cross_requires intel-mic-gpl\""
583         fi
584 fi
585 if test x$enable_modules != xyes ; then
586         RPMBINARGS="$RPMBINARGS --without lustre_modules"
587 fi
588 if test x$enable_tests != xyes ; then
589         RPMBINARGS="$RPMBINARGS --without lustre_tests"
590         RPMSRCARGS="$RPMSRCARGS --without lustre_tests"
591 fi
592 if test x$enable_server != xyes ; then
593         RPMBINARGS="$RPMBINARGS --without servers"
594         if test -n "$CROSS_SUFFIX" ; then
595                 RPMBINARGS="$RPMBINARGS --define \"lustre_name lustre-client$CROSS_SUFFIX\""
596         fi
597 fi
598 if test x$enable_ldiskfs != xyes ; then
599         RPMBINARGS="$RPMBINARGS --without ldiskfs"
600 fi
601 if test x$enable_zfs = xyes ; then
602         RPMBINARGS="$RPMBINARGS --with zfs"
603 fi
604 if test x$enable_iokit != xyes ; then
605         RPMBINARGS="$RPMBINARGS --without lustre_iokit"
606         RPMSRCARGS="$RPMSRCARGS --without lustre_iokit"
607 fi
608
609 RPMBUILD_BINARY_ARGS=$RPMBINARGS
610 RPMBUILD_SOURCE_ARGS=$RPMSRCARGS
611
612 AC_SUBST(RPMBUILD_BINARY_ARGS)
613 AC_SUBST(RPMBUILD_SOURCE_ARGS)
614 ]) # LB_CONFIG_RPMBUILD_OPTIONS
615
616 #
617 # LB_CONFIGURE
618 #
619 # main configure steps
620 #
621 AC_DEFUN([LB_CONFIGURE], [
622 AC_MSG_NOTICE([Lustre base checks
623 ==============================================================================])
624 LB_CANONICAL_SYSTEM
625
626 LB_CONFIG_DIST
627
628 LB_DOWNSTREAM_RELEASE
629 LB_USES_DPKG
630 LB_BUILDID
631
632 LB_LIBCFS_DIR
633
634 LB_INCLUDE_RULES
635
636 LB_PATH_DEFAULTS
637
638 LB_PROG_CC
639
640 LC_OSD_ADDON
641
642 LB_CONFIG_DOCS
643 LB_CONFIG_UTILS
644 LB_CONFIG_TESTS
645 LC_CONFIG_CLIENT
646 LB_CONFIG_MPITESTS
647 LB_CONFIG_SERVERS
648
649 # two macros for cmd3
650 m4_ifdef([LC_CONFIG_SPLIT], [LC_CONFIG_SPLIT])
651 m4_ifdef([LC_NODEMAP_PROC_DEBUG], [LC_NODEMAP_PROC_DEBUG])
652 LN_CONFIG_CDEBUG
653 LC_QUOTA
654
655 LN_CONFIG_USERSPACE
656
657 LB_PATH_SNMP
658 LB_PATH_LUSTREIOKIT
659
660 LB_DEFINE_E2FSPROGS_NAMES
661
662 LIBCFS_CONFIGURE
663 LN_CONFIGURE
664 LC_CONFIGURE
665 AS_IF([test -n "$SNMP_DIST_SUBDIR"], [LS_CONFIGURE])
666
667 LB_CONDITIONALS
668 LB_CONFIG_HEADERS
669
670 LIBCFS_CONFIG_FILES
671 LB_CONFIG_FILES
672 LN_CONFIG_FILES
673 LC_CONFIG_FILES
674 AS_IF([test -n "$SNMP_DIST_SUBDIR"], [LS_CONFIG_FILES])
675
676 AC_SUBST(ac_configure_args)
677
678 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
679 AC_SUBST(MOSTLYCLEANFILES)
680
681 LB_CONFIG_RPMBUILD_OPTIONS
682
683 AC_OUTPUT
684
685 cat <<_ACEOF
686
687 CC:            $CC
688 LD:            $LD
689 CPPFLAGS:      $CPPFLAGS
690 LLCPPFLAGS:    $LLCPPFLAGS
691 CFLAGS:        $CFLAGS
692 EXTRA_KCFLAGS: $EXTRA_KCFLAGS
693 LLCFLAGS:      $LLCFLAGS
694
695 Type 'make' to build Lustre.
696 _ACEOF
697 ]) # LB_CONFIGURE