summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-08-02 19:40:27 +0000
committermidipix <writeonce@midipix.org>2019-08-02 19:40:27 +0000
commitfe59d49a412bc0d399f439af52cc010f9d4a1d88 (patch)
treee54067f7b196198d2ea46be7f8c9cb8436c667b2
parent724fbc5ff7174cf2d710d6d839b46794d5150329 (diff)
downloadmmglue-fe59d49a412bc0d399f439af52cc010f9d4a1d88.tar.bz2
mmglue-fe59d49a412bc0d399f439af52cc010f9d4a1d88.tar.xz
project: custom cfgdefs: integrated arch-specific and fallback alltypes.sed.
-rw-r--r--project/arch.mk13
-rw-r--r--project/config/cfgdefs.in3
-rw-r--r--project/config/cfgdefs.sh7
-rw-r--r--project/headers.mk4
4 files changed, 25 insertions, 2 deletions
diff --git a/project/arch.mk b/project/arch.mk
index 76bca17..8f6a112 100644
--- a/project/arch.mk
+++ b/project/arch.mk
@@ -38,3 +38,16 @@ endif
install-target-sys-headers: $(TARGET_SYS_HEADERS)
mkdir -p $(DESTDIR)$(INCLUDEDIR)/sys
cp -p $(TARGET_SYS_HEADERS) $(DESTDIR)$(INCLUDEDIR)/sys
+
+
+
+# fallback alltypes.sed
+build/alltypes.sed:
+ touch $@
+
+clean-alltypes-sed:
+ rm -f build/alltypes.sed
+
+clean: clean-alltypes-sed
+
+.PHONY: clean-alltypes-sed
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
index 28f9ec4..bbad445 100644
--- a/project/config/cfgdefs.in
+++ b/project/config/cfgdefs.in
@@ -10,6 +10,9 @@ LIBC_EXCL_FILES = @libc_excl_files@
# port source directory
PORT_DIR = @port_dir@
+# alltypes.sed
+ALLTYPES_SED = @alltypes_sed@
+
# source tree (atomic.h vs. atomic_arch.h)
CFLAGS_CONFIG += @libc_source_tree@
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 574577f..168e961 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -85,6 +85,12 @@ cfgdefs_set_libc_options()
libc_source_tree='-D__LIBC_LEGACY_SOURCE_TREE'
fi
+ if [ -f $arch_dir/arch/$mb_arch/bits/alltypes.sed ]; then
+ alltypes_sed=$arch_dir/arch/$mb_arch/bits/alltypes.sed
+ else
+ alltypes_sed=build/alltypes.sed
+ fi
+
if [ _${libc_no_complex:-} = _yes ]; then
libc_deps=
libc_excl_files='$(filter ./src/complex/%, $(libc_all_files))'
@@ -107,6 +113,7 @@ cfgdefs_output_custom_defs()
-e 's^@libc_excl_files@^'"$libc_excl_files"'^g' \
-e 's/@libc_source_tree@/'"$libc_source_tree"'/g' \
-e 's/@libc_syscall_arch@/'"$libc_syscall_arch"'/g' \
+ -e 's!@alltypes_sed@!'"$alltypes_sed"'!g' \
"$mb_project_dir/project/config/cfgdefs.in" \
| sed -e 's/[ \t]*$//g' \
>> "$mb_pwd/cfgdefs.mk"
diff --git a/project/headers.mk b/project/headers.mk
index 996a846..201188e 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -14,13 +14,13 @@ ARCH_GEN_H = $(ALLTYPES_H) $(SYSCALL_H)
ALLTYPES_DEPS = \
$(PORT_DIR)/arch/$(ARCH)/bits/alltypes.h.in \
- $(PORT_DIR)/arch/$(ARCH)/bits/alltypes.sed \
+ $(ALLTYPES_SED) \
$(SOURCE_DIR)/include/alltypes.h.in \
$(SOURCE_DIR)/tools/mkalltypes.sed \
| build/include/bits/
$(ALLTYPES_H): $(ALLTYPES_DEPS)
- sed -f $(PORT_DIR)/arch/$(ARCH)/bits/alltypes.sed \
+ sed -f $(ALLTYPES_SED) \
-f $(SOURCE_DIR)/tools/mkalltypes.sed \
$(PORT_DIR)/arch/$(ARCH)/bits/alltypes.h.in \
$(SOURCE_DIR)/include/alltypes.h.in > $@