From f43a83555febb00ed687b5074902aef148a600b6 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Wed, 10 Jan 2024 12:09:23 +0100 Subject: [PATCH] Avoid AX_COMPARE_VERSION dependency --- configure.ac | 17 ++++++++++------- devices/Kbuild.in | 2 +- devices/r8169/Kbuild.in | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index aca6e551..538647c0 100644 --- a/configure.ac +++ b/configure.ac @@ -610,26 +610,29 @@ AC_ARG_WITH([r8169-kernel], ] ) -AX_COMPARE_VERSION(["$kernel_r8169"], [ge], [5.0.0], - AC_SUBST(R8169_KERNEL_5, [1]), - AC_SUBST(R8169_KERNEL_5, [0]) -) - if test "x${enable_r8169}" = "x1"; then AC_MSG_CHECKING([for kernel for r8169 driver]) kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^r8169-.*-" | cut -d "-" -f 2 | uniq` - kernels5=`ls -1 ${srcdir}/devices/r8169/ | grep -oE "^r8169_main-.*-" | cut -d "-" -f 2 | uniq` + kernels_subdir=`ls -1 ${srcdir}/devices/r8169/ | grep -oE "^r8169_main-.*-" | cut -d "-" -f 2 | uniq` found=0 - for k in $kernels $kernels5; do + found_subdir=0 + for k in $kernels; do if test "$kernel_r8169" = "$k"; then found=1 fi done + for k in $kernels_subdir; do + if test "$kernel_r8169" = "$k"; then + found=1 + found_subdir=1 + fi + done if test $found -ne 1; then AC_MSG_ERROR([kernel $kernel_r8169 not available for r8169 driver!]) fi + AC_SUBST(R8169_IN_SUBDIR, [$found_subdir]) AC_MSG_RESULT([$kernel_r8169]) fi diff --git a/devices/Kbuild.in b/devices/Kbuild.in index 6de73e03..cf5705dd 100644 --- a/devices/Kbuild.in +++ b/devices/Kbuild.in @@ -83,7 +83,7 @@ ifeq (@ENABLE_IGC@,1) endif ifeq (@ENABLE_R8169@,1) -ifeq (@R8169_KERNEL_5@,1) +ifeq (@R8169_IN_SUBDIR@,1) obj-m += r8169/ else EC_R8169_OBJ := r8169-@KERNEL_R8169@-ethercat.o diff --git a/devices/r8169/Kbuild.in b/devices/r8169/Kbuild.in index a5e1d06f..5535c59e 100644 --- a/devices/r8169/Kbuild.in +++ b/devices/r8169/Kbuild.in @@ -41,7 +41,7 @@ REV := $(shell if test -s $(TOPDIR)/revision; then \ fi) ifeq (@ENABLE_R8169@,1) -ifeq (@R8169_KERNEL_5@,1) +ifeq (@R8169_IN_SUBDIR@,1) obj-m += ec_r8169.o ec_r8169-objs := \