public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH] newlib: powerpc: move libc machine list to Makefile
Date: Sun, 23 Jan 2022 00:41:03 -0500	[thread overview]
Message-ID: <20220123054103.23253-1-vapier@gentoo.org> (raw)

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


             reply	other threads:[~2022-01-23  5:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-23  5:41 Mike Frysinger [this message]
2022-01-24 16:41 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220123054103.23253-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).