From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 5C05E3858C60 for ; Sun, 23 Jan 2022 06:04:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C05E3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id B0F31343155; Sun, 23 Jan 2022 06:04:30 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH 1/7] newlib: libm: merge machine/ trampoline up a level Date: Sun, 23 Jan 2022 01:04:23 -0500 Message-Id: <20220123060429.16293-2-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220123060429.16293-1-vapier@gentoo.org> References: <20220123060429.16293-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2022 06:04:33 -0000 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 libm/ 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. --- newlib/libm/Makefile.am | 5 +- newlib/libm/Makefile.in | 6 +- newlib/libm/common/Makefile.in | 1 + newlib/libm/complex/Makefile.in | 1 + newlib/libm/configure | 71 +- newlib/libm/configure.ac | 25 +- newlib/libm/fenv/Makefile.in | 1 + newlib/libm/machine/Makefile.am | 26 - newlib/libm/machine/Makefile.in | 650 -- newlib/libm/machine/aclocal.m4 | 1178 --- newlib/libm/machine/configure | 14383 ----------------------------- newlib/libm/machine/configure.ac | 53 - newlib/libm/math/Makefile.in | 1 + newlib/libm/mathfp/Makefile.in | 1 + 14 files changed, 93 insertions(+), 16309 deletions(-) delete mode 100644 newlib/libm/machine/Makefile.am delete mode 100644 newlib/libm/machine/Makefile.in delete mode 100644 newlib/libm/machine/aclocal.m4 delete mode 100755 newlib/libm/machine/configure delete mode 100644 newlib/libm/machine/configure.ac diff --git a/newlib/libm/Makefile.am b/newlib/libm/Makefile.am index 8d355cbf6f69..5165ff34b9c0 100644 --- a/newlib/libm/Makefile.am +++ b/newlib/libm/Makefile.am @@ -6,7 +6,10 @@ else MATHDIR = math endif -SUBDIRS = $(MATHDIR) common complex fenv machine +SUBDIRS = $(MATHDIR) common complex fenv +if HAVE_LIBM_MACHINE_DIR +SUBDIRS += $(LIBM_MACHINE_DIR) +endif libm_la_LDFLAGS = -Xcompiler -nostdlib diff --git a/newlib/libm/configure.ac b/newlib/libm/configure.ac index 3f9c01e1563f..44d3391bd60c 100644 --- a/newlib/libm/configure.ac +++ b/newlib/libm/configure.ac @@ -27,20 +27,35 @@ if test "${use_libtool}" = "yes"; then LT_INIT([win32-dll]) fi -AC_CONFIG_SUBDIRS(machine) - AC_TYPE_LONG_DOUBLE AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes") LIBM_MACHINE_LIB= if test -n "${libm_machine_dir}"; then + case ${libm_machine_dir} in + aarch64) AC_CONFIG_SUBDIRS(machine/aarch64) ;; + arm) AC_CONFIG_SUBDIRS(machine/arm) ;; + i386) AC_CONFIG_SUBDIRS(machine/i386) ;; + nds32) AC_CONFIG_SUBDIRS(machine/nds32) ;; + pru) AC_CONFIG_SUBDIRS(machine/pru) ;; + spu) AC_CONFIG_SUBDIRS(machine/spu) ;; + riscv) AC_CONFIG_SUBDIRS(machine/riscv) ;; + x86_64) AC_CONFIG_SUBDIRS(machine/x86_64) ;; + powerpc) AC_CONFIG_SUBDIRS(machine/powerpc) ;; + sparc) AC_CONFIG_SUBDIRS(machine/sparc) ;; + mips) AC_CONFIG_SUBDIRS(machine/mips) ;; + *) AC_MSG_ERROR([unsupported libm_machine_dir "${libm_machine_dir}"]) ;; + esac + + LIBM_MACHINE_DIR=machine/${libm_machine_dir} if test "${use_libtool}" = "yes"; then - LIBM_MACHINE_LIB=machine/${libm_machine_dir}/lib${libm_machine_dir}.${aext} + LIBM_MACHINE_LIB=${LIBM_MACHINE_DIR}/lib${libm_machine_dir}.${aext} else - LIBM_MACHINE_LIB=machine/lib.${aext} + LIBM_MACHINE_LIB=${LIBM_MACHINE_DIR}/lib.${aext} fi fi - +AM_CONDITIONAL(HAVE_LIBM_MACHINE_DIR, test "x${LIBM_MACHINE_DIR}" != x) +AC_SUBST(LIBM_MACHINE_DIR) AC_SUBST(LIBM_MACHINE_LIB) AC_CONFIG_FILES([Makefile math/Makefile mathfp/Makefile common/Makefile complex/Makefile fenv/Makefile]) -- 2.34.1