[PATCH 3/7] newlib: libc: merge machine/ trampoline up a level

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
The machine/{configure,Makefile} files exist only to fan out to the
specific machine/$arch/ subdir.  We already have all that same info
in the libc/ dir itself, so by moving the recursive configure and
make calls into it, we can cut off this logic entirely and save the
overhead.

For arches that don't have a machine subdir, it means they can skip
the logic entirely.  Although there's prob not too many of those.
---
 newlib/libc/Makefile.am                  |    10 +-
 newlib/libc/Makefile.in                  |    16 +-
 newlib/libc/argz/Makefile.in             |     1 +
 newlib/libc/configure                    |   211 +-
 newlib/libc/configure.ac                 |    73 +-
 newlib/libc/ctype/Makefile.in            |     1 +
 newlib/libc/errno/Makefile.in            |     1 +
 newlib/libc/iconv/Makefile.in            |     1 +
 newlib/libc/iconv/ccs/Makefile.in        |     1 +
 newlib/libc/iconv/ccs/binary/Makefile.in |     1 +
 newlib/libc/iconv/ces/Makefile.in        |     1 +
 newlib/libc/iconv/lib/Makefile.in        |     1 +
 newlib/libc/locale/Makefile.in           |     1 +
 newlib/libc/machine/Makefile.am          |    26 -
 newlib/libc/machine/Makefile.in          |   649 -
 newlib/libc/machine/aclocal.m4           |  1178 --
 newlib/libc/machine/configure            | 14514 ---------------------
 newlib/libc/machine/configure.ac         |    89 -
 newlib/libc/misc/Makefile.in             |     1 +
 newlib/libc/posix/Makefile.in            |     1 +
 newlib/libc/reent/Makefile.in            |     1 +
 newlib/libc/search/Makefile.in           |     1 +
 newlib/libc/signal/Makefile.in           |     1 +
 newlib/libc/ssp/Makefile.in              |     1 +
 newlib/libc/stdio/Makefile.in            |     1 +
 newlib/libc/stdio64/Makefile.in          |     1 +
 newlib/libc/stdlib/Makefile.in           |     1 +
 newlib/libc/string/Makefile.in           |     1 +
 newlib/libc/syscalls/Makefile.in         |     1 +
 newlib/libc/time/Makefile.in             |     1 +
 newlib/libc/unix/Makefile.in             |     1 +
 newlib/libc/xdr/Makefile.in              |     1 +
 32 files changed, 316 insertions(+), 16473 deletions(-)
 delete mode 100644 newlib/libc/machine/Makefile.am
 delete mode 100644 newlib/libc/machine/Makefile.in
 delete mode 100644 newlib/libc/machine/aclocal.m4
 delete mode 100755 newlib/libc/machine/configure
 delete mode 100644 newlib/libc/machine/configure.ac

diff --git a/newlib/libc/Makefile.am b/newlib/libc/Makefile.am
index cdeaf84c4e21..4700f46993ce 100644
--- a/newlib/libc/Makefile.am
+++ b/newlib/libc/Makefile.am
@@ -39,8 +39,14 @@ endif
 # The order of SUBDIRS is important for the integrated documentation.
 # Do not change the order without considering the doc impact.
 SUBDIRS = argz stdlib ctype search $(STDIO_SUBDIR) $(STDIO64_SUBDIR) string $(SIGNAL_SUBDIR) time locale sys reent \
-	errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) $(NEWLIB_ICONV_DIRS) \
-	$(XDR_SUBDIR) ssp .
+	errno misc $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) $(NEWLIB_ICONV_DIRS) \
+	$(XDR_SUBDIR) ssp
+if HAVE_LIBC_MACHINE_DIR
+SUBDIRS += $(LIBC_MACHINE_DIR)
+endif
+# NB: This must come last to avoid parallel build issues with current lib.a
+# accumulation logic.
+SUBDIRS += .
 
 noinst_DATA = $(CRT0)
 
diff --git a/newlib/libc/configure.ac b/newlib/libc/configure.ac
index 9ed0a5a2e059..2521d6cec432 100644
--- a/newlib/libc/configure.ac
+++ b/newlib/libc/configure.ac
@@ -58,7 +58,7 @@ if test "${use_libtool}" = "yes"; then
 LT_INIT([win32-dll])
 fi
 
-AC_CONFIG_SUBDIRS(machine sys)
+AC_CONFIG_SUBDIRS(sys)
 
 CRT0=
 if test "x${have_crt0}" = "xyes"; then
@@ -182,13 +182,80 @@ AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes")
 dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
 AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x)
 
+LIBC_MACHINE_LIB=
 if test -n "${machine_dir}"; then
+  case ${machine_dir} in
+    a29k) AC_CONFIG_SUBDIRS(machine/a29k) ;;
+    aarch64) AC_CONFIG_SUBDIRS(machine/aarch64) ;;
+    amdgcn) AC_CONFIG_SUBDIRS(machine/amdgcn) ;;
+    arc) AC_CONFIG_SUBDIRS(machine/arc) ;;
+    arm) AC_CONFIG_SUBDIRS(machine/arm) ;;
+    bfin) AC_CONFIG_SUBDIRS(machine/bfin) ;;
+    cr16) AC_CONFIG_SUBDIRS(machine/cr16) ;;
+    cris) AC_CONFIG_SUBDIRS(machine/cris) ;;
+    crx) AC_CONFIG_SUBDIRS(machine/crx) ;;
+    csky) AC_CONFIG_SUBDIRS(machine/csky) ;;
+    d10v) AC_CONFIG_SUBDIRS(machine/d10v) ;;
+    d30v) AC_CONFIG_SUBDIRS(machine/d30v) ;;
+    epiphany) AC_CONFIG_SUBDIRS(machine/epiphany) ;;
+    fr30) AC_CONFIG_SUBDIRS(machine/fr30) ;;
+    frv) AC_CONFIG_SUBDIRS(machine/frv) ;;
+    ft32) AC_CONFIG_SUBDIRS(machine/ft32) ;;
+    h8300) AC_CONFIG_SUBDIRS(machine/h8300) ;;
+    h8500) AC_CONFIG_SUBDIRS(machine/h8500) ;;
+    hppa) AC_CONFIG_SUBDIRS(machine/hppa) ;;
+    i386) AC_CONFIG_SUBDIRS(machine/i386) ;;
+    i960) AC_CONFIG_SUBDIRS(machine/i960) ;;
+    iq2000) AC_CONFIG_SUBDIRS(machine/iq2000) ;;
+    lm32) AC_CONFIG_SUBDIRS(machine/lm32) ;;
+    m32c) AC_CONFIG_SUBDIRS(machine/m32c) ;;
+    m32r) AC_CONFIG_SUBDIRS(machine/m32r) ;;
+    m68hc11) AC_CONFIG_SUBDIRS(machine/m68hc11) ;;
+    m68k) AC_CONFIG_SUBDIRS(machine/m68k) ;;
+    m88k) AC_CONFIG_SUBDIRS(machine/m88k) ;;
+    mep) AC_CONFIG_SUBDIRS(machine/mep) ;;
+    microblaze) AC_CONFIG_SUBDIRS(machine/microblaze) ;;
+    mips) AC_CONFIG_SUBDIRS(machine/mips) ;;
+    riscv) AC_CONFIG_SUBDIRS(machine/riscv) ;;
+    mn10200) AC_CONFIG_SUBDIRS(machine/mn10200) ;;
+    mn10300) AC_CONFIG_SUBDIRS(machine/mn10300) ;;
+    moxie) AC_CONFIG_SUBDIRS(machine/moxie) ;;
+    msp430) AC_CONFIG_SUBDIRS(machine/msp430) ;;
+    mt) AC_CONFIG_SUBDIRS(machine/mt) ;;
+    nds32) AC_CONFIG_SUBDIRS(machine/nds32) ;;
+    necv70) AC_CONFIG_SUBDIRS(machine/necv70) ;;
+    nios2) AC_CONFIG_SUBDIRS(machine/nios2) ;;
+    nvptx) AC_CONFIG_SUBDIRS(machine/nvptx) ;;
+    or1k) AC_CONFIG_SUBDIRS(machine/or1k) ;;
+    powerpc) AC_CONFIG_SUBDIRS(machine/powerpc) ;;
+    pru) AC_CONFIG_SUBDIRS(machine/pru) ;;
+    rl78) AC_CONFIG_SUBDIRS(machine/rl78) ;;
+    rx) AC_CONFIG_SUBDIRS(machine/rx) ;;
+    sh) AC_CONFIG_SUBDIRS(machine/sh) ;;
+    sparc) AC_CONFIG_SUBDIRS(machine/sparc) ;;
+    spu) AC_CONFIG_SUBDIRS(machine/spu) ;;
+    tic4x) AC_CONFIG_SUBDIRS(machine/tic4x) ;;
+    tic6x) AC_CONFIG_SUBDIRS(machine/tic6x) ;;
+    tic80) AC_CONFIG_SUBDIRS(machine/tic80) ;;
+    v850) AC_CONFIG_SUBDIRS(machine/v850) ;;
+    visium) AC_CONFIG_SUBDIRS(machine/visium) ;;
+    w65) AC_CONFIG_SUBDIRS(machine/w65) ;;
+    x86_64) AC_CONFIG_SUBDIRS(machine/x86_64) ;;
+    xc16x) AC_CONFIG_SUBDIRS(machine/xc16x) ;;
+    xstormy16) AC_CONFIG_SUBDIRS(machine/xstormy16) ;;
+    z8k) AC_CONFIG_SUBDIRS(machine/z8k) ;;
+    *) AC_MSG_ERROR([unsupported machine_dir "${machine_dir}"]) ;;
+  esac
+
+  LIBC_MACHINE_DIR=machine/${machine_dir}
   if test "${use_libtool}" = "yes"; then
-    LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
+    LIBC_MACHINE_LIB=${LIBC_MACHINE_DIR}/lib${machine_dir}.${aext}
   else
-    LIBC_MACHINE_LIB=machine/lib.${aext}
+    LIBC_MACHINE_LIB=${LIBC_MACHINE_DIR}/lib.${aext}
   fi
 fi
+AM_CONDITIONAL(HAVE_LIBC_MACHINE_DIR, test "x${LIBC_MACHINE_DIR}" != x)
+AC_SUBST(LIBC_MACHINE_DIR)
 AC_SUBST(LIBC_MACHINE_LIB)
 AC_SUBST(machine_dir)
 AC_SUBST(shared_machine_dir)
diff --git a/newlib/libc/iconv/ccs/binary/Makefile.in b/newlib/libc/iconv/ccs/binary/Makefile.in
index a6bd94360c77..67d441c7a133 100644
--- a/newlib/libc/iconv/ccs/binary/Makefile.in
+++ b/newlib/libc/iconv/ccs/binary/Makefile.in
@@ -192,6 +192,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
+LIBC_MACHINE_DIR = @LIBC_MACHINE_DIR@
 LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
 LIBC_POSIX_DEF = @LIBC_POSIX_DEF@
 LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.