summaryrefslogtreecommitdiff
path: root/extra/config/conf-header.sh
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-02-14 08:21:06 +0000
committerMike Frysinger <vapier@gentoo.org>2007-02-14 08:21:06 +0000
commit43a95b8896b0d271de3bbb28cc18810f39b2e15b (patch)
treed5a2c3215fb3de4cefaedb54b7d607cf0a951595 /extra/config/conf-header.sh
parent38d85080f672b7f1815e81e6f10b4d4e1e2d45aa (diff)
pull latest kconfig from kernel
Diffstat (limited to 'extra/config/conf-header.sh')
-rwxr-xr-xextra/config/conf-header.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/extra/config/conf-header.sh b/extra/config/conf-header.sh
new file mode 100755
index 000000000..90dfa999a
--- /dev/null
+++ b/extra/config/conf-header.sh
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+
+# Turn .config into a header file
+
+if [ -z "$1" ] ; then
+ echo "Usage: conf-header.sh <.config>"
+ exit 1
+fi
+
+cat <<EOF
+#if !defined __FEATURES_H && !defined __need_uClibc_config_h
+# error Never include <bits/uClibc_config.h> directly; use <features.h> instead
+#endif
+
+#define __UCLIBC_MAJOR__ ${MAJOR_VERSION}
+#define __UCLIBC_MINOR__ ${MINOR_VERSION}
+#define __UCLIBC_SUBLEVEL__ ${SUBLEVEL}
+EOF
+
+exec \
+sed \
+ -e '/^#$/d' \
+ -e '/^[^#]/s:^\([^=]*\)=\(.*\):#define __\1__ \2:' \
+ -e '/^#define /s: y$: 1:' \
+ -e '/^# .* is not set$/s:^# \(.*\) is not set$:#undef __\1__:' \
+ -e 's:^# \(.*\)$:/* \1 */:' \
+ $1