When something is set to 'n' on config.mk try to disable it
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 4 Aug 2009 22:42:44 +0000 (15:42 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 4 Aug 2009 22:42:44 +0000 (15:42 -0700)
This doens't work, but at least we tried. This means
if we ever do want to disable something which an old
kernel enabled we'll need to relabelt the kconfig option.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
scripts/gen-compat-autoconf.sh

index d7fad822f5b89afb7d210a89e7300b722f698ed4..6c7cae72f9628253193e0df566d4a1b7f44083b7 100755 (executable)
@@ -42,23 +42,28 @@ DATE=$(date)
 function define_config {
        VAR=$1  
        VALUE=$2
-       echo "#ifndef $VAR"
        case $VALUE in
-       n) # Do nothing
+       n) # Try to undefine it
+               echo "#undef $VAR"
                ;;
        y)
+               echo "#ifndef $VAR"
                echo "#define $VAR 1"
+               echo "#endif /* $VAR */ "
                ;;
        m)
+               echo "#ifndef $VAR"
                echo "#define $VAR 1"
+               echo "#endif /* $VAR */ "
                ;;
        *) # Assume string
                # XXX: add better checks to make sure what was on
                # the right was indeed a string
+               echo "#ifndef $VAR"
                echo "#define $VAR \"$VALUE\""
+               echo "#endif /* $VAR */ "
                ;;
        esac
-       echo "#endif /* $VAR */ "
 }
 
 # This deals with core compat-wireless kernel requirements.