X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=config%2Flustre-build.m4;h=765c021e28bca94e7f003c248b06ab82b0aac9a2;hp=3963c3b9379a1a2b5ba9b2d4747c5afb8bec3a75;hb=829ccf49b1923065b4bdb483a61506b3d0652290;hpb=fdd5596593050d22feef05ecba6ba53c65cb3397 diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 3963c3b..765c021 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -1,14 +1,4 @@ # -# LB_CHECK_VERSION -# -# Verify that LUSTRE_VERSION was defined properly -# -AC_DEFUN([LB_CHECK_VERSION], [ -AS_IF([test "LUSTRE_VERSION" = "LUSTRE""_VERSION"], - [AC_MSG_ERROR([This script was not built with a version number.])]) -]) # LB_CHECK_VERSION - -# # LB_CANONICAL_SYSTEM # # fixup $target_os for use in other places @@ -23,84 +13,12 @@ AC_SUBST(lb_target_os) ]) # LB_CANONICAL_SYSTEM # -# LB_DOWNSTREAM_RELEASE +# LB_DOWNSTREAM_RELEASE (DEPRECATED) # AC_DEFUN([LB_DOWNSTREAM_RELEASE], -[AC_ARG_WITH([downstream-release], - AC_HELP_STRING([--with-downstream-release=string], - [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]), - [DOWNSTREAM_RELEASE=$with_downstream_release], - [ # if not specified, see if it's in the META file - AS_IF([test -f META], - [DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)]) - ]) -AC_SUBST(DOWNSTREAM_RELEASE) -]) # LB_DOWNSTREAM_RELEASE - -# -# LB_BUILDID -# -# Check if the source is a GA release and if not, set a "BUILDID" -# -# Currently there are at least two ways/modes of/for doing this. One -# is if we are in a valid git repository, the other is if we are in a -# non-git source tree of some form. Building the latter from the former -# will be handled here. -AC_DEFUN([LB_BUILDID], [ -AC_CACHE_CHECK([for buildid], [lb_cv_buildid], [ -lb_cv_buildid="" -AS_IF([git branch >/dev/null 2>&1], [ - ffw=0 - hash="" - ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags) - if [[[ $ver = *-*-* ]]]; then - hash=${ver##*-} - ffw=${ver#*-} - ffw=${ffw%-*} - ver=${ver%%-*} - fi - # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]] - # here but the portability of the regex on the right is dismal - # (thanx suse) - if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then - ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \ - -e 's/_RC[[0-9]].*$//' -e 's/_/./g') - fi - - # a "lustre fix" value of .0 should be truncated - if [[[ $ver = *.*.*.0 ]]]; then - ver=${ver%.0} - fi - # ditto for a "lustre fix" value of _0 - if [[[ $ver = v*_*_*_0 ]]]; then - ver=${ver%_0} - fi - if [[[ $ver = v*_*_* ]]]; then - ver=${ver#v} - ver=${ver//_/.} - fi - - if test "$ver" != "$VERSION"; then - AC_MSG_WARN([most recent tag found: $ver does not match current version $VERSION.]) - fi - - if test "$ffw" != "0"; then - lb_cv_buildid="$hash" - fi -], [test -f META], [ - lb_cv_buildid=$(sed -ne '/^BUILDID =/s/.*= *//p' META) -]) -]) -AS_IF([test -z "$lb_cv_buildid"], [ - AC_MSG_WARN([ - -FIXME: I don't know how to deal with source trees outside of git that -don't have a META file. Not setting a buildid. -]) -]) -BUILDID=$lb_cv_buildid -AC_SUBST(BUILDID) -]) # LB_BUILDID +[AC_ARG_WITH([downstream-release],, + AC_MSG_ERROR([--downstream-release was deprecated. Please read Documentation/versioning.txt.]) +)]) # LB_DOWNSTREAM_RELEASE # # LB_CHECK_FILE @@ -199,6 +117,30 @@ AC_SUBST(LIBCFS_SUBDIR) ]) # LB_LIBCFS_DIR # +# LB_LIBMOUNT +# +# Check whether build with libmount for mount.lustre. +# libmount is part of the util-linux since v2.18. +# We need it to manipulate utab file. +# +AC_DEFUN([LB_LIBMOUNT], [ +AC_CHECK_HEADER([libmount/libmount.h], [ + AC_CHECK_LIB([mount], [mnt_update_set_fs], [ + LDLIBMOUNT="-lmount" + AC_SUBST(LDLIBMOUNT) + AC_DEFINE(HAVE_LIBMOUNT, 1, [build with libmount]) + with_libmount="yes" + ],[with_libmount="no"]) +], [with_libmount="no"]) +AC_MSG_CHECKING([whether to build with libmount]) +AS_IF([test "x$with_libmount" = xyes], [ + AC_MSG_RESULT([yes]) +], [ + AC_MSG_RESULT([no]) +]) +]) # LB_LIBMOUNT + +# # LB_PATH_SNMP # # check for in-tree snmp support @@ -320,13 +262,6 @@ AC_ARG_ENABLE([manpages], [skip creation and inclusion of man pages (default is enable)]), [], [enable_manpages="yes"]) AC_MSG_RESULT([$enable_manpages]) -AS_IF([test "x$enable_manpages" = xyes], [ -AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], []) - if test "x$RST2MAN" = "x"; then - AC_MSG_ERROR( - [rst2man is needed to build the man pages. Install python-docutils.]) -fi -]) ]) # LB_CONFIG_MANPAGES # @@ -336,8 +271,8 @@ fi # AC_DEFUN([LB_CONFIG_HEADERS], [ AC_CONFIG_HEADERS([config.h]) -CPPFLAGS="-include $PWD/config.h $CPPFLAGS" -EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS" +CPPFLAGS="-include $PWD/undef.h -include $PWD/config.h $CPPFLAGS" +EXTRA_KCFLAGS="-include $PWD/undef.h -include $PWD/config.h $EXTRA_KCFLAGS" AC_SUBST(EXTRA_KCFLAGS) ]) # LB_CONFIG_HEADERS @@ -360,11 +295,11 @@ AC_DEFUN([LB_PATH_DEFAULTS], [ # directories for binaries AC_PREFIX_DEFAULT([/usr]) -sysconfdir='$(CROSS_PATH)/etc' +sysconfdir='/etc' AC_SUBST(sysconfdir) # Directories for documentation and demos. -docdir='$(datadir)/doc/$(PACKAGE)' +docdir='${datadir}/doc/$(PACKAGE)' AC_SUBST(docdir) LIBCFS_PATH_DEFAULTS @@ -434,7 +369,7 @@ AS_IF([test x$target_cpu = "xx86_64" -a x$target_vendor != "xk1om"], LIBCFS_CONDITIONALS LN_CONDITIONALS LC_CONDITIONALS -]) # LB_CONTITIONALS +]) # LB_CONDITIONALS # # LB_CONFIG_FILES @@ -449,9 +384,6 @@ AC_DEFUN([LB_CONFIG_FILES], [ [Rules:build/Rules.in] AC_PACKAGE_TARNAME[.spec] AC_PACKAGE_TARNAME[-dkms.spec] - contrib/Makefile - contrib/lbuild/Makefile - contrib/scripts/Makefile ldiskfs/Makefile ldiskfs/autoMakefile lustre-iokit/Makefile @@ -462,6 +394,8 @@ AC_DEFUN([LB_CONFIG_FILES], [ lustre-iokit/ior-survey/Makefile lustre-iokit/stats-collect/Makefile ) + AC_CONFIG_FILES([lustre/scripts/dkms.mkconf], + [chmod +x lustre/scripts/dkms.mkconf]) ]) # @@ -532,6 +466,8 @@ for arg; do --with-release=* ) ;; --with-kmp-moddir=* ) ;; --with-linux=* | --with-linux-obj=* ) ;; + --enable-shared | --disable-shared ) ;; + --enable-static | --disable-static ) ;; --enable-ldiskfs | --disable-ldiskfs ) ;; --enable-modules | --disable-modules ) ;; --enable-server | --disable-server ) ;; @@ -555,24 +491,6 @@ fi if test -n "$KMP_MODDIR" ; then RPMBINARGS="$RPMBINARGS --define \"kmoddir $KMP_MODDIR\"" fi -if test -n "$CROSS_PATH" ; then - if test x$enable_server = xyes ; then - echo -e "\n" - "*** Don't support cross compilation for the Intel(R) Xeon Phi(TM) card.\n" - exit 1 - fi - CROSS_SUFFIX="-mic" - RPMBINARGS="$RPMBINARGS --define \"post_script build/gen_filelist.sh\"" - RPMBINARGS="$RPMBINARGS --define \"cross_path $CROSS_PATH\"" - RPMBINARGS="$RPMBINARGS --define \"rootdir %{cross_path}\"" - RPMBINARGS="$RPMBINARGS --define \"_prefix %{cross_path}/usr\"" - RPMBINARGS="$RPMBINARGS --define \"_mandir %{_prefix}/share/man\"" - RPMBINARGS="$RPMBINARGS --define \"_sysconfdir %{cross_path}/etc\"" - RPMBINARGS="$RPMBINARGS --define \"make_args $CROSS_VARS\"" - if test x$CC_TARGET_ARCH = x"x86_64-k1om-linux" ; then - RPMBINARGS="$RPMBINARGS --define \"cross_requires intel-mic-gpl\"" - fi -fi if test x$enable_modules != xyes ; then RPMBINARGS="$RPMBINARGS --without lustre_modules" fi @@ -584,9 +502,6 @@ if test x$enable_utils != xyes ; then fi if test x$enable_server != xyes ; then RPMBINARGS="$RPMBINARGS --without servers" - if test -n "$CROSS_SUFFIX" ; then - RPMBINARGS="$RPMBINARGS --define \"lustre_name lustre-client$CROSS_SUFFIX\"" - fi fi if test x$enable_ldiskfs != xyes ; then RPMBINARGS="$RPMBINARGS --without ldiskfs" @@ -603,6 +518,12 @@ fi if test x$enable_manpages != xyes ; then RPMBINARGS="$RPMBINARGS --without manpages" fi +if test x$enable_shared != xyes ; then + RPMBINARGS="$RPMBINARGS --without shared" +fi +if test x$enable_static != xyes ; then + RPMBINARGS="$RPMBINARGS --without static" +fi RPMBUILD_BINARY_ARGS=$RPMBINARGS @@ -623,7 +544,6 @@ LB_CONFIG_DIST LB_DOWNSTREAM_RELEASE LB_USES_DPKG -LB_BUILDID LB_LIBCFS_DIR @@ -650,6 +570,7 @@ m4_ifdef([LC_NODEMAP_PROC_DEBUG], [LC_NODEMAP_PROC_DEBUG]) LIBCFS_CONFIG_CDEBUG LC_QUOTA +LB_LIBMOUNT LB_PATH_SNMP LB_PATH_LUSTREIOKIT