mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
DEVEL15-linux-kbuild-configure-20070104
FIXES 40604
Test whether Linux kernel builds work at all before going into specific
builds so that we can fail earlier with a better error message. Try to
put more errors from the kernel build into config.log.
(cherry picked from commit 182a18931a
)
This commit is contained in:
parent
7d1dfe11dd
commit
3458f6630e
@ -594,6 +594,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
||||
[LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
|
||||
)
|
||||
|
||||
LINUX_KERNEL_COMPILE_WORKS
|
||||
LINUX_CONFIG_H_EXISTS
|
||||
LINUX_COMPLETION_H_EXISTS
|
||||
LINUX_DEFINES_FOR_EACH_PROCESS
|
||||
|
@ -1,16 +1,14 @@
|
||||
# AC_TRY_KBUILD26([INCLUDES], [FUNCTION-BODY],
|
||||
# [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
|
||||
#
|
||||
AC_DEFUN([AC_TRY_KBUILD26], [
|
||||
rm -fr conftest.dir
|
||||
if mkdir conftest.dir; then
|
||||
cd conftest.dir
|
||||
cat >Makefile <<_ACEOF
|
||||
AC_DEFUN([AC_TRY_KBUILD26],[ rm -fr conftest.dir
|
||||
if mkdir conftest.dir &&
|
||||
cat >conftest.dir/Makefile <<_ACEOF &&
|
||||
CFLAGS += $CPPFLAGS
|
||||
|
||||
obj-m += conftest.o
|
||||
_ACEOF
|
||||
cat >conftest.c <<\_ACEOF
|
||||
cat >conftest.dir/conftest.c <<\_ACEOF &&
|
||||
#include <linux/module.h>
|
||||
$1
|
||||
|
||||
@ -21,11 +19,17 @@ $2
|
||||
|
||||
MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
|
||||
_ACEOF
|
||||
cd ..
|
||||
fi
|
||||
AS_IF(AC_RUN_LOG([make -C $LINUX_KERNEL_PATH M=`pwd`/conftest.dir modules > /dev/null]),
|
||||
[$3], [$4])
|
||||
rm -fr conftest.dir])
|
||||
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
|
||||
then [$3]
|
||||
else
|
||||
sed '/^ *+/d' conftest.err >&AS_MESSAGE_LOG_FD
|
||||
echo "$as_me: failed using Makefile:" >&AS_MESSAGE_LOG_FD
|
||||
sed 's/^/| /' conftest.dir/Makefile >&AS_MESSAGE_LOG_FD
|
||||
echo "$as_me: and program was:" >&AS_MESSAGE_LOG_FD
|
||||
sed 's/^/| /' conftest.dir/conftest.c >&AS_MESSAGE_LOG_FD
|
||||
[$4]
|
||||
fi; rm -fr conftest.err conftest.dir])
|
||||
|
||||
|
||||
# AC_TRY_KBUILD24([INCLUDES], [FUNCTION-BODY],
|
||||
@ -47,3 +51,9 @@ AC_DEFUN([AC_TRY_KBUILD], [
|
||||
else
|
||||
AC_TRY_KBUILD24([$1], [$2], [$3], [$4])
|
||||
fi])
|
||||
|
||||
AC_DEFUN([LINUX_KERNEL_COMPILE_WORKS], [
|
||||
AC_MSG_CHECKING([for linux kernel module build works])
|
||||
AC_TRY_KBUILD([],[],:,AC_MSG_RESULT(no)
|
||||
AC_MSG_FAILURE([Fix problem or use --disable-kernel-module...]))
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
Loading…
Reference in New Issue
Block a user