Skip to contentSkip to conversation

batman-adv: Generate config compatible with kbuild macros

PATCH Applied Sven Eckelmann 2 participants 2 messages Dec 9, 2011 – Dec 10, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Generate config compatible with kbuild macros

Linux 3.0-rc1-30-g2a11c8e introduced the macros IS_ENABLED, IS_BUILTIN and IS_MODULE that can be used to identify which state a tristate option had. The compat-autoconf.h needs to provide additional precompiler variables that these marcros can use.

---
 gen-compat-autoconf.sh |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
gen-compat-autoconf.sh +8 -1
index 440accc..1a020c1 100755
@@ -12,15 +12,22 @@ gen_config() {
 	VALUE="${2}"
 
 	echo "#undef ${KEY}"
+	echo "#undef __enabled_${KEY}"
+	echo "#undef __enabled_${KEY}_MODULE"
 	case "${VALUE}" in
 	y)
 		echo "#define ${KEY} 1"
+		echo "#define __enabled_${KEY} 1"
+		echo "#define __enabled_${KEY}_MODULE 0"
 		;;
 	m)
 		echo "#define ${KEY} 1"
+		echo "#define __enabled_${KEY} 0"
+		echo "#define __enabled_${KEY}_MODULE 1"
 		;;
 	n)
-		# leave it undefined
+		echo "#define __enabled_${KEY} 0"
+		echo "#define __enabled_${KEY}_MODULE 0"
 		;;
 	*)
 		echo "#define ${KEY} \"${VALUE}\""
Signature · 1 line
1.7.7.3
#1 lore raw
Quoted 4 lines · On Friday, December 09, 2011 17:18:27 Sven Eckelmann wrote:

Linux 3.0-rc1-30-g2a11c8e introduced the macros IS_ENABLED, IS_BUILTIN and IS_MODULE that can be used to identify which state a tristate option had. The compat-autoconf.h needs to provide additional precompiler variables that these marcros can use.

Applied in revision 24d65d3.

Thanks,
Marek