diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2021-03-24 10:32:50 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-04-13 12:55:33 +0200 |
commit | 80bd01ef831fbbb08f883a76576eba128ca1c385 (patch) | |
tree | 94f9b4f7728aad142e902ed37121a7133bc90f14 /newlib/Makefile.am | |
parent | 20d00819984058e439cfe40818f81d7315c89201 (diff) | |
download | newlib-80bd01ef831fbbb08f883a76576eba128ca1c385.zip newlib-80bd01ef831fbbb08f883a76576eba128ca1c385.tar.gz newlib-80bd01ef831fbbb08f883a76576eba128ca1c385.tar.bz2 |
Add build mechanism to share common header files between machines
So far the build mechanism in newlib only allowed to either define
machine-specific headers, or headers shared between all machines.
In some cases, architectures are sufficiently alike to share header
files between them, but not with other architectures. A good example
is ix86 vs. x86_64, which share certain traits with each other, but
not with other architectures.
Introduce a new configure variable called "shared_machine_dir". This
dir can then be used for headers shared between architectures.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/Makefile.am')
-rw-r--r-- | newlib/Makefile.am | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 809d492..03390cd 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -237,6 +237,23 @@ stmp-targ-include: config.status $(MAKE) targ-include/sys \ targ-include/machine \ targ-include/bits + -if [ -n "$(shared_machine_dir)" ]; then \ + for i in $(srcdir)/libc/machine/$(shared_machine_dir)/machine/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/machine/`basename $$i`; \ + else true; fi ; \ + done; \ + for i in $(srcdir)/libc/machine/$(shared_machine_dir)/sys/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/sys/`basename $$i`; \ + else true; fi ; \ + done; \ + for i in $(srcdir)/libc/machine/$(shared_machine_dir)/include/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/`basename $$i`; \ + else true; fi ; \ + done; \ + fi -for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ if [ -f $$i ]; then \ cp $$i targ-include/machine/`basename $$i`; \ @@ -315,6 +332,13 @@ endif for i in $(srcdir)/libc/include/machine/*.h; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ done; \ + if [ -n "$(shared_machine_dir)" ]; then \ + for i in $(srcdir)/libc/machine/$(shared_machine_dir)/machine/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ + else true; fi ; \ + done; \ + fi ; \ for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ if [ -f $$i ]; then \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ @@ -332,6 +356,18 @@ endif for i in $(srcdir)/libc/include/sys/*.h; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ done; \ + if [ -n "$(shared_machine_dir)" ]; then \ + for i in $(srcdir)/libc/machine/$(shared_machine_dir)/sys/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ + else true; fi ; \ + done ; \ + for i in $(srcdir)/libc/machine/$(shared_machine_dir)/include/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \ + else true; fi ; \ + done ; \ + fi ; \ for i in $(srcdir)/libc/machine/$(machine_dir)/sys/*.h; do \ if [ -f $$i ]; then \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ |