summaryrefslogtreecommitdiffhomepage
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rw-r--r--project/config/cfgdefs.in6
-rw-r--r--project/config/cfgdefs.sh40
2 files changed, 46 insertions, 0 deletions
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
new file mode 100644
index 0000000..4299d59
--- /dev/null
+++ b/project/config/cfgdefs.in
@@ -0,0 +1,6 @@
+# libc
+LIBC_VER = @libc_ver@
+LIBC_MAJOR = @libc_major@
+LIBC_MINOR = @libc_minor@
+LIBC_MICRO = @libc_micro@
+
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index eb04350..20daffc 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -39,8 +39,48 @@ cfgdefs_set_arch()
fi
}
+
+cfgdefs_detect_libc_version()
+{
+ mb_libc_verinfo=$(cat "$mb_source_dir/VERSION")
+
+ case "$mb_libc_verinfo" in
+ *.*.* )
+ libc_ver=${mb_libc_verinfo}
+ libc_major=${mb_libc_verinfo%.*.*}
+ libc_micro=${mb_libc_verinfo#*.*.}
+
+ libc_minor=${libc_ver#*.}
+ libc_minor=${libc_minor%.*}
+ ;;
+ * )
+ error_msg "Could not properly parse $mb_source_dir/VERSION"
+ exit 2
+ esac
+}
+
+
+cfgdefs_output_custom_defs()
+{
+ sed \
+ -e 's/@libc_ver@/'"$libc_ver"'/g' \
+ -e 's/@libc_major@/'"$libc_major"'/g' \
+ -e 's/@libc_minor@/'"$libc_minor"'/g' \
+ -e 's/@libc_micro@/'"$libc_micro"'/g' \
+ "$mb_project_dir/project/config/cfgdefs.in" \
+ | sed -e 's/[ \t]*$//g' \
+ >> "$mb_pwd/cfgdefs.mk"
+}
+
+
# arch
cfgdefs_set_arch
+# libc version info
+cfgdefs_detect_libc_version
+
+# cfgdefs.in --> cfgdefs.mk
+cfgdefs_output_custom_defs
+
# all done
return 0