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