diff options
author | Brian Behlendorf <[email protected]> | 2009-05-19 11:42:39 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-05-19 11:42:39 -0700 |
commit | bf338d8d09b410884be526ed4f11b6030244dbfa (patch) | |
tree | 4a6bdc6adc8421f153339726c3076bbe47b1fe40 /config/spl-build.m4 | |
parent | f8b2932a43d955d804731c3ad03c7a47177f481c (diff) |
SLES10 Fixes (part 1):
- Exclude -obj when detecting installed kernel source.
- Detect -obj directory for out of tree kernel builds.
- Allow kernel build system to set CC to ensure -m64 is set properly.
This is an issue on 64-bit SLES systems which by default always
build 32-bit binaries (unlike RHEL/Fedora which default to 64-bit)
Diffstat (limited to 'config/spl-build.m4')
-rw-r--r-- | config/spl-build.m4 | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 1013e1f4c..76fa96ff9 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -11,12 +11,12 @@ AC_DEFUN([SPL_AC_KERNEL], [ AC_MSG_CHECKING([kernel source directory]) if test -z "$kernelsrc"; then - kernelbuild= - sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* 2>/dev/null | tail -1` + sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* \ + 2>/dev/null | grep -v obj | tail -1` if test -e ${sourcelink}; then kernelsrc=`readlink -f ${sourcelink}` - kernelbuild=${kernelsrc} + kernelbuild= else AC_MSG_RESULT([Not found]) AC_MSG_ERROR([ @@ -31,6 +31,11 @@ AC_DEFUN([SPL_AC_KERNEL], [ AC_MSG_RESULT([$kernelsrc]) AC_MSG_CHECKING([kernel build directory]) + if test -z "$kernelbuild" && test -d ${kernelsrc}-obj; then + kernelbuild=${kernelsrc}-obj/`arch`/`arch` + else + kernelbuild=${kernelsrc} + fi AC_MSG_RESULT([$kernelbuild]) AC_MSG_CHECKING([kernel source version]) @@ -232,7 +237,7 @@ AC_DEFUN([SPL_LINUX_COMPILE_IFELSE], [ rm -Rf build && mkdir -p build echo "obj-m := conftest.o" >build/Makefile AS_IF( - [AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], + [AC_TRY_COMMAND(cp conftest.c build && make [$2] LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], [$4], [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])] ) |