--- a/configure.ac Fri Apr 18 12:01:38 2008 +0000
+++ b/configure.ac Fri Apr 18 12:33:35 2008 +0000
@@ -297,6 +297,61 @@
AC_SUBST(KERNEL_E1000,[$kernele1000])
#------------------------------------------------------------------------------
+# r8169 driver
+#------------------------------------------------------------------------------
+
+AC_ARG_ENABLE([r8169],
+ AS_HELP_STRING([--enable-r8169],
+ [Enable r8169 driver]),
+ [
+ case "${enableval}" in
+ yes) enabler8169=1
+ ;;
+ no) enabler8169=0
+ ;;
+ *) AC_MSG_ERROR([Invalid value for --enable-r8169])
+ ;;
+ esac
+ ],
+ [enabler8169=0] # disabled by default
+)
+
+AM_CONDITIONAL(ENABLE_R8169, test "x$enabler8169" = "x1")
+AC_SUBST(ENABLE_R8169,[$enabler8169])
+
+AC_ARG_WITH([r8169-kernel],
+ AC_HELP_STRING(
+ [--with-r8169-kernel=<X.Y.Z>],
+ [r8169 kernel (only if differing)]
+ ),
+ [
+ kernelr8169=[$withval]
+ ],
+ [
+ kernelr8169=$linuxversion
+ ]
+)
+
+if test "x${enabler8169}" = "x1"; then
+ AC_MSG_CHECKING([for kernel for r8169 driver])
+
+ kernels=`ls -1 devices/ | grep -oE "^r8169-.*-" | cut -d "-" -f 2 | uniq`
+ found=0
+ for k in $kernels; do
+ if test "$kernelr8169" = "$k"; then
+ found=1
+ fi
+ done
+ if test $found -ne 1; then
+ AC_MSG_ERROR([kernel $kernelr8169 not available for r8169 driver!])
+ fi
+
+ AC_MSG_RESULT([$kernelr8169])
+fi
+
+AC_SUBST(KERNEL_R8169,[$kernelr8169])
+
+#------------------------------------------------------------------------------
# RTAI path (optional)
#------------------------------------------------------------------------------