diff options
author | midipix <writeonce@midipix.org> | 2020-07-05 10:03:29 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2020-07-05 10:03:29 +0000 |
commit | e160db81029cb36806a5411cfdb889de16137b8c (patch) | |
tree | e8027bef6ad03bfe3f7cc75f9178cde7d5254d86 | |
parent | b9fc046f3ccc8bc3fde925c9c028389edac95f35 (diff) | |
download | mmglue-e160db81029cb36806a5411cfdb889de16137b8c.tar.bz2 mmglue-e160db81029cb36806a5411cfdb889de16137b8c.tar.xz |
project: added mallocng support.
-rw-r--r-- | project/common.mk | 2 | ||||
-rw-r--r-- | project/config/cfgdefs.in | 3 | ||||
-rw-r--r-- | project/config/cfgdefs.sh | 14 |
3 files changed, 19 insertions, 0 deletions
diff --git a/project/common.mk b/project/common.mk index af5155e..cbe8ecb 100644 --- a/project/common.mk +++ b/project/common.mk @@ -1,6 +1,7 @@ libc_src_dirs = $(SOURCE_DIR)/src/*/ libc_src_dirs += $(SOURCE_DIR)/crt/ libc_src_dirs += $(SOURCE_DIR)/ldso/ +libc_src_dirs += $(SOURCE_DIR)/$(MALLOC_SUBDIR)/ ifeq ($(PORT_DIR),$(PROJECT_DIR)) libc_src_dirs += $(PROJECT_DIR)/src/*/ @@ -64,6 +65,7 @@ libc_tree_dirs = $(subst $(SOURCE_DIR)/,./, \ libc_tree_dirs += ./crt/ ./crt/$(ARCH)/ libc_tree_dirs += ./ldso/ ./ldso/$(ARCH)/ +libc_tree_dirs += $(MALLOC_SUBDIR) # depend on all headers 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 |