summaryrefslogtreecommitdiffhomepage
path: root/project/config
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-07-05 10:03:29 +0000
committermidipix <writeonce@midipix.org>2020-07-05 10:03:29 +0000
commite160db81029cb36806a5411cfdb889de16137b8c (patch)
treee8027bef6ad03bfe3f7cc75f9178cde7d5254d86 /project/config
parentb9fc046f3ccc8bc3fde925c9c028389edac95f35 (diff)
downloadmmglue-e160db81029cb36806a5411cfdb889de16137b8c.tar.bz2
mmglue-e160db81029cb36806a5411cfdb889de16137b8c.tar.xz
project: added mallocng support.
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.in3
-rw-r--r--project/config/cfgdefs.sh14
2 files changed, 17 insertions, 0 deletions
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
index d8b3bb5..95db393 100644
--- a/project/config/cfgdefs.in
+++ b/project/config/cfgdefs.in
@@ -23,6 +23,9 @@ CFLAGS_CONFIG += @libc_source_tree@
# libgcc, libgcc_eh
LIBC_DEPS += @libc_deps@
+# mallocng */
+MALLOC_SUBDIR = @malloc_subdir@
+
# syscall.h
build/syscall_h.tag: build/@libc_syscall_arch@
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 994ef54..a9cb7c4 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -126,6 +126,16 @@ cfgdefs_set_libc_cflags()
}
+cfgdefs_set_malloc_options()
+{
+ if [ -d $mb_source_dir/src/malloc/mallocng ]; then
+ malloc_subdir='src/malloc/mallocng'
+ else
+ malloc_subdir='src/malloc/oldmalloc'
+ fi
+}
+
+
cfgdefs_output_custom_defs()
{
sed \
@@ -140,6 +150,7 @@ cfgdefs_output_custom_defs()
-e 's/@libc_syscall_arch@/'"$libc_syscall_arch"'/g' \
-e 's/@libc_td_tid_addr@/'"$libc_td_tid_addr"'/g' \
-e 's!@alltypes_sed@!'"$alltypes_sed"'!g' \
+ -e 's!@malloc_subdir@!'"$malloc_subdir"'!g' \
"$mb_project_dir/project/config/cfgdefs.in" \
| sed -e 's/[ \t]*$//g' \
>> "$mb_pwd/cfgdefs.mk"
@@ -158,6 +169,9 @@ cfgdefs_set_libc_options
# libc (variant-specific) cflags
cfgdefs_set_libc_cflags
+# malloc implementation variant
+cfgdefs_set_malloc_options
+
# cfgdefs.in --> cfgdefs.mk
cfgdefs_output_custom_defs