summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-01-05 19:06:36 -0500
committermidipix <writeonce@midipix.org>2019-01-09 22:43:13 -0500
commitba16785bd30e652a5d606d7059336e6d6eb7a0c2 (patch)
tree3c3c5458530ccc2c8a0e87863dcc2a93427e6585
parente0aa751ba6857477a0467213cb58d4e864f15adc (diff)
downloadmmglue-ba16785bd30e652a5d606d7059336e6d6eb7a0c2.tar.bz2
mmglue-ba16785bd30e652a5d606d7059336e6d6eb7a0c2.tar.xz
project: custom config: added cfgdefs_detect_libc_version().
-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