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 <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4677
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
/lustre.spec
/Module.symvers
/Modules.symvers
+!Makefile
#
# 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
# sles8-update_rcfile_setting.sh \
# update_oldconfig
-MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
+MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
# Override the default distclean, which removes Makefile
distclean: distclean-recursive
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 \
# see notes in Rules.in
UML_CFLAGS='-O0'
AC_MSG_RESULT(yes)
- else
+ else
AC_MSG_RESULT([no])
fi
else
#
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])])
#
# 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
+ ])
])
#
#
# 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
+ ])
])
#
# 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
AC_DEFUN([LC_MODULE_LOADING],
[AC_MSG_CHECKING([if kernel module loading is possible])
LB_LINUX_TRY_MAKE([
- #include <linux/kmod.h>
-],[
- int myretval=ENOSYS ;
- return myretval;
+ #include <linux/kmod.h>
],[
- $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([])
])
])
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
])
[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
#
# 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)
])
#
#
# 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)
])
#
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
# 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
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 <<EOF
+Installation instructions for the package $cmd on $dist_id are not known.
+If you know how to install the required package, please file a bug at
+http://bugs.whamcloud.com/ and include your distribution and the output from:
+"lsb_release -is" is: "$dist_id"
+EOF
+ ;;
esac
exit 1
}
check_version() {
- 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
+ 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 <<EOF
+ if [ ! -d "$dir" ] ; then
+ cat >&2 <<EOF
Your tree seems to be missing $dir.
Please read README.lustrecvs for details.
EOF
- exit 1
- fi
- ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
+ exit 1
+ fi
+ ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
done
# optional directories for Lustre
for dir in $OPTIONAL_DIRS; do
- if [ -d "$dir" ] ; then
- ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
- fi
+ if [ -d "$dir" ] ; then
+ ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
+ fi
done
found=false
for AMVER in 1.9 1.10 1.11; do
- if which automake-$AMVER 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"
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"
# 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