configmodule.m4 revision cc2ee177dbb3befca43e36cfc56778b006c3d050
1dnl Handle the 2.4 module inside module/
2AC_DEFUN([AX_CONFIG_MODULE],
3[
4if test ! -f $KINC/linux/autoconf.h; then
5	AC_MSG_ERROR([no suitably configured kernel include tree found])
6fi
7
8dnl  --- Get Linux kernel version and compile parameters ---
9
10AC_SUBST(KVERS)
11AC_MSG_CHECKING([for kernel version])
12dnl it's like this to handle mandrake's fubar version.h - bug #471448
13eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
14AC_MSG_RESULT([$KVERS])
15case "$KVERS" in
162.2.*|2.4.*) ;;
17*) AC_MSG_ERROR([Unsupported kernel version])
18esac
19
20dnl Check for the minimal kernel version supported
21AC_MSG_CHECKING([kernel version])
22AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
23
24dnl linux/spinlock.h added at some point in past
25AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
26if test -f $KINC/linux/spinlock.h; then
27	EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
28	AC_MSG_RESULT([yes])
29else
30	AC_MSG_RESULT([no])
31fi
32
33AC_MSG_CHECKING([for rtc_lock])
34gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
35if test "$?" -eq 0; then
36	EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
37	AC_MSG_RESULT([yes])
38else
39	AC_MSG_RESULT([no])
40fi
41	 
42arch="unknown"
43AC_MSG_CHECKING(for x86 architecture)
44AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
45AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
46AX_MSG_RESULT_YN($x86)
47test "$x86" = 1 && arch="x86"
48	
49if test "$arch" = "unknown"; then
50	AC_MSG_CHECKING(for ia64 architecture)
51 	AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
52 	AX_MSG_RESULT_YN($ia64)
53 	test "$ia64" = 1 && arch="ia64"
54fi
55
56test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
57
58dnl check to see if kernel verion appropriate for arch
59AC_MSG_CHECKING(arch/kernel version combination)
60case "$arch" in
61ia64)
62	AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
63		AC_MSG_ERROR([unsupported arch/kernel])) ;;
64*) AC_MSG_RESULT([ok])
65esac
66
67dnl for now we do not support PREEMPT patch
68AC_MSG_CHECKING([for preempt patch])
69AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
70AX_MSG_RESULT_YN([$preempt])
71test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
72
73AC_SUBST(KINC)
74
75MODINSTALLDIR=/lib/modules/$KVERS
76 
77OPROFILE_MODULE_ARCH=$arch
78AC_SUBST(OPROFILE_MODULE_ARCH)
79]
80)
81