+ AC_ERROR([source dir $KBUILD26 doesn't exist])
+ fi
+
+ # Debian breaks kernel headers into "source" header and "build" headers.
+ # We want the source headers, but $KBUILD26 gives us the "build" headers.
+ # Use heuristics to find the source headers.
+ AC_MSG_CHECKING([for Linux 2.6 source directory])
+ if test -n "$KSRC26"; then
+ KSRC26=`eval echo "$KSRC26"`
+ case $KSRC26 in
+ /*) ;;
+ *) KSRC26=`pwd`/$KSRC26 ;;
+ esac
+ if test ! -e $KSRC26/include/linux/kernel.h; then
+ AC_MSG_ERROR([$KSRC26 is not a kernel source directory)])
+ fi
+ else
+ KSRC26=$KBUILD26
+ if test ! -e $KSRC26/include/linux/kernel.h; then
+ case `echo "$KBUILD26" | sed 's,/*$,,'` in # (
+ */build)
+ KSRC26=`echo "$KBUILD26" | sed 's,/build/*$,/source,'`
+ ;; # (
+ *)
+ KSRC26=`(cd $KBUILD26 && pwd -P) | sed 's,-[[^-]]*$,-common,'`
+ ;;
+ esac
+ fi
+ if test ! -e $KSRC26/include/linux/kernel.h; then
+ AC_MSG_ERROR([cannot find source directory (please use --with-l26-source)])
+ fi