From: Christopher J. Morrone Date: Sat, 24 Nov 2012 03:12:06 +0000 (-0800) Subject: LU-1199 build: Fix style and indention in build system files X-Git-Tag: 2.3.57~26 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1e880bbcfc69f50b770f16de7b86d17c6ae18284 LU-1199 build: Fix style and indention in build system files Fix indentation by replacing spaces with tabs. Remove stray whitespace at end of lines. Command substitution changed from `...` notation to $(...) notation. The latter is part of the POSIX 1003.2, and is supported by Debian's dash shell, so it is relativly portable these days. build/Makefile is checked in to git, not auto-generated by the build system. Therefore a !Makefile exception is added to build/.gitignore. Also, in build/autogen.sh, fix default setting of the IFS variable to be a space and a tab, rather than 9 spaces. I believe the 9 spaces were a result of a bad cut-and-paste. Change-Id: I46270d808d7fe036f748da1cb45826bb42ab01e2 Signed-off-by: Christopher J. Morrone Reviewed-on: http://review.whamcloud.com/4677 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Brian J. Murrell --- diff --git a/build/.gitignore b/build/.gitignore index 86d4cb0..fff7fcd 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -4,3 +4,4 @@ /lustre.spec /Module.symvers /Modules.symvers +!Makefile diff --git a/build/Makefile b/build/Makefile index 5efb738..da0cda4 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,7 +1,7 @@ # # There are four ways this Makefile can be called: # -# +# # 1. As a subdirectory from the toplevel, for automake # # 2. A wrapper around the kernel's makefile when building modules, to diff --git a/build/autoMakefile.am b/build/autoMakefile.am index d6034df..cca8e28 100644 --- a/build/autoMakefile.am +++ b/build/autoMakefile.am @@ -11,7 +11,7 @@ # sles8-update_rcfile_setting.sh \ # update_oldconfig -MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ +MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ # Override the default distclean, which removes Makefile distclean: distclean-recursive diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index e7b8471..297fa4f 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -5,8 +5,8 @@ AUTOMAKE_OPTIONS = foreign FIND_TAG_FILES_CMD = find $(top_srcdir) \ - -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage -prune -false -o\ - -type f -name '*.[hc]' + -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage \ + -prune -false -o -type f -name '*.[hc]' MAKEEACHSUBDIR = \ for subdir in $(RPM_SUBDIRS) ; do \ diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index 94dd8cf..d933e26 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -354,7 +354,7 @@ if test -e $LINUX/include/asm-um ; then # see notes in Rules.in UML_CFLAGS='-O0' AC_MSG_RESULT(yes) - else + else AC_MSG_RESULT([no]) fi else @@ -420,7 +420,7 @@ AC_DEFUN([LB_LINUX_ARCH], # AC_DEFUN([LB_LINUX_TRY_COMPILE], [LB_LINUX_COMPILE_IFELSE( - [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])], + [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])], [modules], [test -s build/conftest.o], [$3], [$4])]) @@ -430,21 +430,21 @@ AC_DEFUN([LB_LINUX_TRY_COMPILE], # # check if a given config option is defined # -AC_DEFUN([LB_LINUX_CONFIG], -[AC_MSG_CHECKING([if Linux was built with CONFIG_$1]) -LB_LINUX_TRY_COMPILE([ -#include <$AUTOCONF_HDIR/autoconf.h> -],[ -#ifndef CONFIG_$1 -#error CONFIG_$1 not #defined -#endif -],[ -AC_MSG_RESULT([yes]) -$2 -],[ -AC_MSG_RESULT([no]) -$3 -]) +AC_DEFUN([LB_LINUX_CONFIG],[ + AC_MSG_CHECKING([if Linux was built with CONFIG_$1]) + LB_LINUX_TRY_COMPILE([ + #include <$AUTOCONF_HDIR/autoconf.h> + ],[ + #ifndef CONFIG_$1 + #error CONFIG_$1 not #defined + #endif + ],[ + AC_MSG_RESULT([yes]) + $2 + ],[ + AC_MSG_RESULT([no]) + $3 + ]) ]) # @@ -452,21 +452,21 @@ $3 # # check if a given config option is builtin or as module # -AC_DEFUN([LB_LINUX_CONFIG_IM], -[AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module]) -LB_LINUX_TRY_COMPILE([ -#include <$AUTOCONF_HDIR/autoconf.h> -],[ -#if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE)) -#error CONFIG_$1 and CONFIG_$1_MODULE not #defined -#endif -],[ -AC_MSG_RESULT([yes]) -$2 -],[ -AC_MSG_RESULT([no]) -$3 -]) +AC_DEFUN([LB_LINUX_CONFIG_IM],[ + AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module]) + LB_LINUX_TRY_COMPILE([ + #include <$AUTOCONF_HDIR/autoconf.h> + ],[ + #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE)) + #error CONFIG_$1 and CONFIG_$1_MODULE not #defined + #endif + ],[ + AC_MSG_RESULT([yes]) + $2 + ],[ + AC_MSG_RESULT([no]) + $3 + ]) ]) # @@ -475,7 +475,11 @@ $3 # like LB_LINUX_TRY_COMPILE, but with different arguments # AC_DEFUN([LB_LINUX_TRY_MAKE], -[LB_LINUX_COMPILE_IFELSE([AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])], [$3], [$4], [$5], [$6])]) + [LB_LINUX_COMPILE_IFELSE( + [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])], + [$3], [$4], [$5], [$6] + )] +) # # LB_LINUX_CONFIG_BIG_STACK @@ -569,23 +573,26 @@ fi AC_DEFUN([LC_MODULE_LOADING], [AC_MSG_CHECKING([if kernel module loading is possible]) LB_LINUX_TRY_MAKE([ - #include -],[ - int myretval=ENOSYS ; - return myretval; + #include ],[ - $makerule LUSTRE_KERNEL_TEST=conftest.i + int myretval=ENOSYS ; + return myretval; ],[ - grep request_module build/conftest.i | grep -v `grep "int myretval=" build/conftest.i | cut -d= -f2 | cut -d" " -f1` >/dev/null + $makerule LUSTRE_KERNEL_TEST=conftest.i +],[dnl + grep request_module build/conftest.i |dnl + grep -v `grep "int myretval=" build/conftest.i |dnl + cut -d= -f2 | cut -d" " -f1`dnl + >/dev/null dnl ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1, - [kernel module loading is possible]) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1, + [kernel module loading is possible]) ],[ - AC_MSG_RESULT(no) - AC_MSG_WARN([]) - AC_MSG_WARN([Kernel module loading support is highly recommended.]) - AC_MSG_WARN([]) + AC_MSG_RESULT(no) + AC_MSG_WARN([]) + AC_MSG_WARN([Kernel module loading support is highly recommended.]) + AC_MSG_WARN([]) ]) ]) @@ -648,25 +655,25 @@ AC_DEFUN([LB_CHECK_SYMBOL_EXPORT], grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null rc=$? if test $rc -ne 0; then - export=0 - for file in $2; do - grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null - rc=$? - if test $rc -eq 0; then - export=1 - break; + export=0 + for file in $2; do + grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null + rc=$? + if test $rc -eq 0; then + export=1 + break; + fi + done + if test $export -eq 0; then + AC_MSG_RESULT([no]) + $4 + else + AC_MSG_RESULT([yes]) + $3 fi - done - if test $export -eq 0; then - AC_MSG_RESULT([no]) - $4 - else - AC_MSG_RESULT([yes]) - $3 - fi else - AC_MSG_RESULT([yes]) - $3 + AC_MSG_RESULT([yes]) + $3 fi ]) diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4 index c75eee2..a851d08 100644 --- a/build/autoconf/lustre-build.m4 +++ b/build/autoconf/lustre-build.m4 @@ -120,9 +120,9 @@ AC_DEFUN([LB_CHECK_FILE], [AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl AC_CACHE_CHECK([for $1], lb_File, [if test -r "$1"; then - AS_VAR_SET(lb_File, yes) + AS_VAR_SET(lb_File, yes) else - AS_VAR_SET(lb_File, no) + AS_VAR_SET(lb_File, no) fi]) AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl AS_VAR_POPDEF([lb_File])dnl @@ -578,11 +578,11 @@ AC_SUBST(ENABLE_INIT_SCRIPTS) # # add -include config.h # -AC_DEFUN([LB_CONFIG_HEADERS], -[AC_CONFIG_HEADERS([config.h]) -CPPFLAGS="-include $PWD/config.h $CPPFLAGS" -EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS" -AC_SUBST(EXTRA_KCFLAGS) +AC_DEFUN([LB_CONFIG_HEADERS],[ + AC_CONFIG_HEADERS([config.h]) + CPPFLAGS="-include $PWD/config.h $CPPFLAGS" + EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS" + AC_SUBST(EXTRA_KCFLAGS) ]) # @@ -590,9 +590,9 @@ AC_SUBST(EXTRA_KCFLAGS) # # defines for including the toplevel Rules # -AC_DEFUN([LB_INCLUDE_RULES], -[INCLUDE_RULES="include $PWD/Rules" -AC_SUBST(INCLUDE_RULES) +AC_DEFUN([LB_INCLUDE_RULES],[ + INCLUDE_RULES="include $PWD/Rules" + AC_SUBST(INCLUDE_RULES) ]) # @@ -659,7 +659,7 @@ AC_CHECK_SIZEOF(unsigned long long, 0) echo "---> size SIZEOF $SIZEOF_unsigned_long_long" echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long" if test $ac_cv_sizeof_unsigned_long_long != 8 ; then - AC_MSG_ERROR([** we assume that sizeof(long long) == 8. Tell phil@clusterfs.com]) + AC_MSG_ERROR([** we assume that sizeof(long long) == 8.]) fi if test $target_cpu == "powerpc64"; then diff --git a/build/autogen.sh b/build/autogen.sh index cd7e601..f2582b8 100644 --- a/build/autogen.sh +++ b/build/autogen.sh @@ -2,27 +2,31 @@ # taken from gnome-common/macros2/autogen.sh compare_versions() { - ch_min_version=$1 - ch_actual_version=$2 - ch_status=0 - IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." - set $ch_actual_version - for ch_min in $ch_min_version; do - ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes - if [ -z "$ch_min" ]; then break; fi - if [ -z "$ch_cur" ]; then ch_status=1; break; fi - if [ $ch_cur -gt $ch_min ]; then break; fi - if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi - done - IFS="$ch_save_IFS" - return $ch_status + ch_min_version=$1 + ch_actual_version=$2 + ch_status=0 + IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." + set $ch_actual_version + for ch_min in $ch_min_version; do + # remove letter suffixes + ch_cur=$(echo $1 | sed 's/[^0-9].*$//'); shift + if [ -z "$ch_min" ]; then break; fi + if [ -z "$ch_cur" ]; then ch_status=1; break; fi + if [ $ch_cur -gt $ch_min ]; then break; fi + if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi + done + IFS="$ch_save_IFS" + return $ch_status } error_msg() { - echo "$cmd is $1. Version $required (or higher) is required to build Lustre." + echo "$cmd is $1. Version $required (or higher) is"\ + " required to build Lustre." if [ ! -x /usr/bin/lsb_release ]; then - echo "lsb_release could not be found. If it were available more help on how to resolve this\nsituation would be available." + echo "lsb_release could not be found. "\ + "If it were available more help on how to resolve this" + echo "situation would be available." exit 1 fi @@ -35,71 +39,77 @@ error_msg() { Ubuntu|Debian) howto "apt-get install $cmd" ;; CentOS|RedHat*|Fedora*) howto "yum install $cmd" ;; SUSE*) howto "yast -i $cmd" ;; - *) echo -e "\nInstallation instructions for the package $cmd on $dist_id are not known.\nIf you know how to install the required package, please file a bug at\nhttp://bugs.whamcloud.com/ and include your distribution and the output from:\n\"lsb_release -is\" is: \"$dist_id\"" ;; + *) cat <= $required... " - if ! $cmd --version >/dev/null ; then - error_msg "missing" - fi - version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }") - echo "found $version" - if ! compare_versions "$required" "$version" ; then - error_msg "too old" - fi + local tool + local cmd + local required + local version + + tool=$1 + cmd=$2 + required=$3 + echo -n "checking for $cmd >= $required... " + if ! $cmd --version >/dev/null ; then + error_msg "missing" + fi + version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }") + echo "found $version" + if ! compare_versions "$required" "$version" ; then + error_msg "too old" + fi } echo "Checking for a complete tree..." if [ -d kernel_patches ] ; then # This is ldiskfs - REQUIRED_DIRS="build" - CONFIGURE_DIRS="" + REQUIRED_DIRS="build" + CONFIGURE_DIRS="" else - REQUIRED_DIRS="build libcfs lnet lustre" - OPTIONAL_DIRS="snmp portals" - CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs" + REQUIRED_DIRS="build libcfs lnet lustre" + OPTIONAL_DIRS="snmp portals" + CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs" fi for dir in $REQUIRED_DIRS ; do - if [ ! -d "$dir" ] ; then - cat >&2 <&2 < /dev/null; then - found=true - break - fi + if which automake-$AMVER 2> /dev/null; then + found=true + break + fi done if ! $found; then - cmd=automake required="1.9" error_msg "not found" - exit 1 + cmd=automake required="1.9" error_msg "not found" + exit 1 fi [ "${AMVER#1.}" -ge "10" ] && AMOPT="-W no-portability" @@ -109,16 +119,16 @@ check_version autoconf autoconf "2.57" run_cmd() { - cmd="$@" - echo -n "Running $cmd" - eval $cmd - res=$? - if [ $res -ne 0 ]; then - echo " failed: $res" - echo "Aborting" - exit 1 - fi - echo + cmd="$@" + echo -n "Running $cmd" + eval $cmd + res=$? + if [ $res -ne 0 ]; then + echo " failed: $res" + echo "Aborting" + exit 1 + fi + echo } export ACLOCAL="aclocal-$AMVER" @@ -131,10 +141,10 @@ run_cmd autoconf # Run autogen.sh in these directories for dir in $CONFIGURE_DIRS; do - if [ -d $dir ] ; then - pushd $dir >/dev/null - echo "Running autogen for $dir..." - run_cmd "sh autogen.sh" - popd >/dev/null - fi + if [ -d $dir ] ; then + pushd $dir >/dev/null + echo "Running autogen for $dir..." + run_cmd "sh autogen.sh" + popd >/dev/null + fi done