Agreed. Here's a _part_ of what I use currently for this purpose:
AC_SUBST(KVERS)
AC_MSG_CHECKING(for kernel version)
KVERS=`sed -n 's:^#define *UTS_RELEASE *\"\([^"]*\).*$:\1:p' $KINC/linux/version.h`
AC_MSG_RESULT($KVERS)
AC_MSG_CHECKING(for SMP)
smp=0
case "$KVERS" in
2.0.*|2.1.*) AX_EGREP([^ *SMP *= *1], $KSRC/Makefile, smp=1) ;;
2.2.*) AX_EGREP([^ *\#define *CONFIG_SMP], $KINC/linux/autoconf.h, smp=1)
esac
test "$smp" = 1 && AC_DEFINE(__SMP__)
AX_MSG_RESULT_YN($smp)
(AX_EGREP is basically "egrep for regex $1 in file $2").
That's just ugly (and I'm not sure when exactly SMP became a config
option, so I don't know if that is 100% correct).
What I've seen so far for compilation of external modules includes:
1. telling the user to twiddle a lot of options in the Makefile by
hand (CIPE up to 1.2, ftape)
2. large and complicated Makefile hacks (lm_sensors)
3. large and complicated autoconf hacks like above (CIPE 1.3, ALSA)
4. using the kernel Makefile with special options (bttv)
Option 1 is bound to fail for a nontrivial number of users.
How well option 2 does I don't know, at least the lm_sensors makefiles
are broken for other reasons.
Option 3 works well if it weren't for the aesthetics. ;-)
Option 4 has an unfortunate side-effect inside the kernel tree: it
stores the module name somewhere, so the next "make clean modules
install_modules" cycle will complain about missing modules.
So here are two 2.3 wishlist items from an external module
maintainer's POV:
- something that allows easy and standardized compilation of external
modules. Perhaps a Makefile snippet or an aclocal.m4 snippet or both
which can be included by the module.
- This may be controversial, but I'd like that MODVERSIONS become
mandatory when enabling modules. On the not-so-high-traffic CIPE
mailing list 80% of the reported problems are caused by a kernel/module
version mismatch; I wonder how more popular projects deal with that.
Or even another scheme which does the same checking as MODVERSIONS
but with less compilation hassle...
Olaf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/