linux-alternate-kernel-builddir-20081012
authorStefaan De Roeck <stefaan.deroeck@gmail.com>
Sun, 12 Oct 2008 19:01:58 +0000 (19:01 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 12 Oct 2008 19:01:58 +0000 (19:01 +0000)
LICENSE IPL10
FIXES 121354

add support for KBUILD_OUTPUT=... builds.

acinclude.m4
src/cf/linux-test1.m4
src/config/Makefile.config.in
src/libafs/MakefileProto.LINUX.in

index 3ff7263..985b6ef 100644 (file)
@@ -190,6 +190,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
@@ -334,15 +338,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])
@@ -361,7 +370,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
@@ -1574,6 +1583,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)
index 8c82baa..98bdc45 100644 (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
index e4f6dba..3078b2d 100644 (file)
@@ -49,6 +49,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@
index 0502124..7d58fdf 100644 (file)
@@ -64,6 +64,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>
@@ -299,7 +300,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)