From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id BE5513858D37 for ; Sun, 23 Jan 2022 05:41:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE5513858D37 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 1B1BF342E42; Sun, 23 Jan 2022 05:41:01 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH] newlib: powerpc: move libc machine list to Makefile Date: Sun, 23 Jan 2022 00:41:03 -0500 Message-Id: <20220123054103.23253-1-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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 05:41:05 -0000 This makes the makefile logic a bit cleaner so we don't have two files maintaining lists of sources & objects. Since the logic is tied to cpu capabilities, past those boolean settings down from the configure logic to the makefile logic. This will also make it easier to throw away the configure script in a follow up commit and just keep the makefile. --- newlib/libc/machine/powerpc/Makefile.am | 35 +++++++++++++++++++-- newlib/libc/machine/powerpc/Makefile.in | 34 +++++++++++++++++++-- newlib/libc/machine/powerpc/configure | 39 +++++++++++++++++++----- newlib/libc/machine/powerpc/configure.ac | 14 ++++----- 4 files changed, 101 insertions(+), 21 deletions(-) diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am index e8a0f8fa012d..cb046334efff 100644 --- a/newlib/libc/machine/powerpc/Makefile.am +++ b/newlib/libc/machine/powerpc/Makefile.am @@ -10,8 +10,39 @@ AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib lib_a_SOURCES = setjmp.S lib_a_CFLAGS=$(AM_CFLAGS) -lib_a_LIBADD = @extra_objs@ -lib_a_DEPENDENCIES = @extra_objs@ +lib_a_LIBADD = +if HAVE_POWERPC_ALTIVEC +lib_a_LIBADD += \ + lib_a-vfprintf.o \ + lib_a-vfscanf.o \ + lib_a-vec_malloc.o \ + lib_a-vec_calloc.o \ + lib_a-vec_free.o \ + lib_a-vec_realloc.o \ + lib_a-vec_mallocr.o \ + lib_a-vec_callocr.o \ + lib_a-vec_reallocr.o +endif +if HAVE_POWERPC_SPE +lib_a_LIBADD += \ + lib_a-atosfix16.o \ + lib_a-atosfix32.o \ + lib_a-atosfix64.o \ + lib_a-atoufix16.o \ + lib_a-atoufix32.o \ + lib_a-atoufix64.o \ + lib_a-simdldtoa.o \ + lib_a-strtosfix16.o \ + lib_a-strtosfix32.o \ + lib_a-strtosfix64.o \ + lib_a-strtoufix16.o \ + lib_a-strtoufix32.o \ + lib_a-strtoufix64.o \ + lib_a-ufix64toa.o \ + lib_a-vfprintf.o \ + lib_a-vfscanf.o +endif +lib_a_DEPENDENCIES = $(lib_a_LIBADD) EXTRA_lib_a_SOURCES = \ vfprintf.c vfscanf.c \ vec_malloc.c vec_calloc.c vec_free.c vec_realloc.c vec_mallocr.c \ diff --git a/newlib/libc/machine/powerpc/configure.ac b/newlib/libc/machine/powerpc/configure.ac index e86ac6efbc90..fca0dd19737d 100644 --- a/newlib/libc/machine/powerpc/configure.ac +++ b/newlib/libc/machine/powerpc/configure.ac @@ -9,16 +9,14 @@ AC_CONFIG_AUX_DIR(../../../..) NEWLIB_CONFIGURE(../../..) -extra_objs= +HAVE_POWERPC_ALTIVEC=no +HAVE_POWERPC_SPE=no case $host in - powerpc*-*altivec*) - extra_objs="lib_a-vfprintf.o lib_a-vfscanf.o lib_a-vec_malloc.o lib_a-vec_calloc.o lib_a-vec_free.o lib_a-vec_realloc.o lib_a-vec_mallocr.o lib_a-vec_callocr.o lib_a-vec_reallocr.o" - ;; - powerpc*-*spe*) - extra_objs="lib_a-atosfix16.o lib_a-atosfix32.o lib_a-atosfix64.o lib_a-atoufix16.o lib_a-atoufix32.o lib_a-atoufix64.o lib_a-simdldtoa.o lib_a-strtosfix16.o lib_a-strtosfix32.o lib_a-strtosfix64.o lib_a-strtoufix16.o lib_a-strtoufix32.o lib_a-strtoufix64.o lib_a-ufix64toa.o lib_a-vfprintf.o lib_a-vfscanf.o" - ;; + powerpc*-*altivec*) HAVE_POWERPC_ALTIVEC=yes ;; + powerpc*-*spe*) HAVE_POWERPC_SPE=yes ;; esac -AC_SUBST(extra_objs) +AM_CONDITIONAL(HAVE_POWERPC_ALTIVEC, [test "$HAVE_POWERPC_ALTIVEC" = yes]) +AM_CONDITIONAL(HAVE_POWERPC_SPE, [test "$HAVE_POWERPC_SPE" = yes]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT -- 2.34.1