DEVEL15-linux-alternate-kernel-builddir-20081012

LICENSE IPL10
FIXES 121354

add support for KBUILD_OUTPUT=... builds.


(cherry picked from commit 726fc5b8425eb7bbaab4bdde38d977382dc17a9d)
This commit is contained in:
Stefaan De Roeck 2008-10-12 19:02:18 +00:00 committed by Derrick Brashear
parent a88cf69421
commit d4d0c44755
4 changed files with 22 additions and 10 deletions

View File

@ -195,6 +195,10 @@ AC_ARG_WITH([linux-kernel-headers],
[AS_HELP_STRING([--with-linux-kernel-headers=path],
[use the kernel headers found at path (optional, defaults to
/usr/src/linux-2.4, then /usr/src/linux)])])
AC_ARG_WITH([linux-kernel-build],
[AS_HELP_STRING([--with-linux-kernel-build=path],
[use the kernel build found at path(optional, defaults to
/usr/src/linux-2.4, then /usr/src/linux)])])
AC_ARG_WITH([bsd-kernel-headers],
[AS_HELP_STRING([--with-bsd-kernel-headers=path],
[use the kernel headers found at path (optional, defaults to
@ -339,15 +343,20 @@ case $system in
LINUX_KERNEL_PATH="/usr/src/linux"
fi
fi
if test -f "$LINUX_KERNEL_PATH/include/linux/utsrelease.h"; then
linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/utsrelease.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
if test "$with_linux_kernel_build" != "x"; then
LINUX_KERNEL_BUILD="$with_linux_kernel_build"
else
LINUX_KERNEL_BUILD=$LINUX_KERNEL_PATH
fi
if test -f "$LINUX_KERNEL_BUILD/include/linux/utsrelease.h"; then
linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/linux/utsrelease.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
LINUX_VERSION="$linux_kvers"
else
if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
if test -f "$LINUX_KERNEL_BUILD/include/linux/version.h"; then
linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
if test "x$linux_kvers" = "x"; then
if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
if test -f "$LINUX_KERNEL_BUILD/include/linux/version-up.h"; then
linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
if test "x$linux_kvers" = "x"; then
AC_MSG_ERROR(Linux headers lack version definition [2])
@ -366,7 +375,7 @@ case $system in
enable_kernel_module="no"
fi
fi
if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
if test ! -f "$LINUX_KERNEL_BUILD/include/linux/autoconf.h"; then
enable_kernel_module="no"
fi
if test "x$enable_kernel_module" = "xno"; then
@ -1583,6 +1592,7 @@ AC_SUBST(ENABLE_KERNEL_MODULE)
AC_SUBST(ENABLE_PTHREADED_UBIK)
AC_SUBST(LIB_AFSDB)
AC_SUBST(LINUX_KERNEL_PATH)
AC_SUBST(LINUX_KERNEL_BUILD)
AC_SUBST(HOST_CPU)
AC_SUBST(BSD_KERNEL_PATH)
AC_SUBST(BSD_KERNEL_BUILD)

View File

@ -27,8 +27,8 @@ $2
MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
_ACEOF
echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD &&
make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err &&
echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD &&
make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err &&
! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
then [$3]
else

View File

@ -48,6 +48,7 @@ LEX = @LEX@
LIB_AFSDB = @LIB_AFSDB@
LIBS = @LIBS@
LINUX_KERNEL_PATH = @LINUX_KERNEL_PATH@
LINUX_KERNEL_BUILD = @LINUX_KERNEL_BUILD@
LINUX_LIBAFS_NAME=@LINUX_LIBAFS_NAME@
LINUX_KERNEL_PACKAGING=@LINUX_KERNEL_PACKAGING@
LINUX_VERSION = @LINUX_VERSION@

View File

@ -60,6 +60,7 @@ COMMON_KERN_CFLAGS=$(KERN_DBG) $(KERN_OPTMZ) @LINUX_GCC_KOPTS@
COMMON_DEFINES=-D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
LINUX_KERNEL_BUILD=@LINUX_KERNEL_BUILD@
# System specific build commands and flags
<linux26 linux_26>
@ -295,7 +296,7 @@ ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko
.FORCE:
${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE
env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common
env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules
env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules
<all -linux26 -linux_26 -umlinux26>
${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)