public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs
@ 2022-01-28  0:33 Mike Frysinger
  2022-01-28  0:33 ` [PATCH 2/3] newlib: use abs_newlib_basedir for -I paths Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-01-28  0:33 UTC (permalink / raw)
  To: newlib; +Cc: jon.turney

When using the top-level configure script but subdir Makefiles, the
newlib_basedir value gets a bit out of sync: it's relative to where
configure lives, not where the Makefile lives.  Move the abs setting
from the top-level configure script into acinclude.m4 so we can rely
on it being available everywhere.  Although this commit doesn't use
it anywhere, just lays the groundwork.
---
 newlib/Makefile.in                                       | 1 +
 newlib/acinclude.m4                                      | 3 +++
 newlib/configure                                         | 9 ++++++---
 newlib/configure.ac                                      | 1 -
 newlib/libc/Makefile.in                                  | 1 +
 newlib/libc/argz/Makefile.in                             | 1 +
 newlib/libc/configure                                    | 8 ++++++--
 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/a29k/Makefile.in                     | 1 +
 newlib/libc/machine/aarch64/Makefile.in                  | 1 +
 newlib/libc/machine/amdgcn/Makefile.in                   | 1 +
 newlib/libc/machine/arc/Makefile.in                      | 1 +
 newlib/libc/machine/arm/Makefile.in                      | 1 +
 newlib/libc/machine/bfin/Makefile.in                     | 1 +
 newlib/libc/machine/cr16/Makefile.in                     | 1 +
 newlib/libc/machine/cris/Makefile.in                     | 1 +
 newlib/libc/machine/crx/Makefile.in                      | 1 +
 newlib/libc/machine/csky/Makefile.in                     | 1 +
 newlib/libc/machine/d10v/Makefile.in                     | 1 +
 newlib/libc/machine/d30v/Makefile.in                     | 1 +
 newlib/libc/machine/epiphany/Makefile.in                 | 1 +
 newlib/libc/machine/fr30/Makefile.in                     | 1 +
 newlib/libc/machine/frv/Makefile.in                      | 1 +
 newlib/libc/machine/ft32/Makefile.in                     | 1 +
 newlib/libc/machine/h8300/Makefile.in                    | 1 +
 newlib/libc/machine/h8500/Makefile.in                    | 1 +
 newlib/libc/machine/hppa/Makefile.in                     | 1 +
 newlib/libc/machine/i386/Makefile.in                     | 1 +
 newlib/libc/machine/i960/Makefile.in                     | 1 +
 newlib/libc/machine/iq2000/Makefile.in                   | 1 +
 newlib/libc/machine/lm32/Makefile.in                     | 1 +
 newlib/libc/machine/m32c/Makefile.in                     | 1 +
 newlib/libc/machine/m32r/Makefile.in                     | 1 +
 newlib/libc/machine/m68hc11/Makefile.in                  | 1 +
 newlib/libc/machine/m68k/Makefile.in                     | 1 +
 newlib/libc/machine/m88k/Makefile.in                     | 1 +
 newlib/libc/machine/mep/Makefile.in                      | 1 +
 newlib/libc/machine/microblaze/Makefile.in               | 1 +
 newlib/libc/machine/mips/Makefile.in                     | 1 +
 newlib/libc/machine/mn10200/Makefile.in                  | 1 +
 newlib/libc/machine/mn10300/Makefile.in                  | 1 +
 newlib/libc/machine/moxie/Makefile.in                    | 1 +
 newlib/libc/machine/msp430/Makefile.in                   | 1 +
 newlib/libc/machine/mt/Makefile.in                       | 1 +
 newlib/libc/machine/nds32/Makefile.in                    | 1 +
 newlib/libc/machine/necv70/Makefile.in                   | 1 +
 newlib/libc/machine/nios2/Makefile.in                    | 1 +
 newlib/libc/machine/nvptx/Makefile.in                    | 1 +
 newlib/libc/machine/or1k/Makefile.in                     | 1 +
 newlib/libc/machine/powerpc/Makefile.in                  | 1 +
 newlib/libc/machine/pru/Makefile.in                      | 1 +
 newlib/libc/machine/riscv/Makefile.in                    | 1 +
 newlib/libc/machine/rl78/Makefile.in                     | 1 +
 newlib/libc/machine/rx/Makefile.in                       | 1 +
 newlib/libc/machine/sh/Makefile.in                       | 1 +
 newlib/libc/machine/sparc/Makefile.in                    | 1 +
 newlib/libc/machine/spu/Makefile.in                      | 1 +
 newlib/libc/machine/tic4x/Makefile.in                    | 1 +
 newlib/libc/machine/tic6x/Makefile.in                    | 1 +
 newlib/libc/machine/tic80/Makefile.in                    | 1 +
 newlib/libc/machine/v850/Makefile.in                     | 1 +
 newlib/libc/machine/visium/Makefile.in                   | 1 +
 newlib/libc/machine/w65/Makefile.in                      | 1 +
 newlib/libc/machine/x86_64/Makefile.in                   | 1 +
 newlib/libc/machine/xc16x/Makefile.in                    | 1 +
 newlib/libc/machine/xstormy16/Makefile.in                | 1 +
 newlib/libc/machine/z8k/Makefile.in                      | 1 +
 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/sys/a29khif/Makefile.in                      | 1 +
 newlib/libc/sys/amdgcn/Makefile.in                       | 1 +
 newlib/libc/sys/arm/Makefile.in                          | 1 +
 newlib/libc/sys/d10v/Makefile.in                         | 1 +
 newlib/libc/sys/decstation/Makefile.in                   | 1 +
 newlib/libc/sys/epiphany/Makefile.in                     | 1 +
 newlib/libc/sys/h8300hms/Makefile.in                     | 1 +
 newlib/libc/sys/h8500hms/Makefile.in                     | 1 +
 newlib/libc/sys/linux/Makefile.in                        | 1 +
 newlib/libc/sys/linux/argp/Makefile.in                   | 1 +
 newlib/libc/sys/linux/cmath/Makefile.in                  | 1 +
 newlib/libc/sys/linux/configure                          | 8 ++++++--
 newlib/libc/sys/linux/dl/Makefile.in                     | 1 +
 newlib/libc/sys/linux/iconv/Makefile.in                  | 1 +
 newlib/libc/sys/linux/intl/Makefile.in                   | 1 +
 newlib/libc/sys/linux/linuxthreads/Makefile.in           | 1 +
 newlib/libc/sys/linux/linuxthreads/configure             | 8 ++++++--
 newlib/libc/sys/linux/linuxthreads/machine/Makefile.in   | 1 +
 newlib/libc/sys/linux/linuxthreads/machine/configure     | 8 ++++++--
 .../libc/sys/linux/linuxthreads/machine/i386/Makefile.in | 1 +
 .../libc/sys/linux/linuxthreads/machine/i386/configure   | 8 ++++++--
 newlib/libc/sys/linux/machine/Makefile.in                | 1 +
 newlib/libc/sys/linux/machine/configure                  | 8 ++++++--
 newlib/libc/sys/linux/machine/i386/Makefile.in           | 1 +
 newlib/libc/sys/linux/machine/i386/configure             | 8 ++++++--
 newlib/libc/sys/linux/net/Makefile.in                    | 1 +
 newlib/libc/sys/m88kbug/Makefile.in                      | 1 +
 newlib/libc/sys/mmixware/Makefile.in                     | 1 +
 newlib/libc/sys/netware/Makefile.in                      | 1 +
 newlib/libc/sys/or1k/Makefile.in                         | 1 +
 newlib/libc/sys/phoenix/Makefile.in                      | 1 +
 newlib/libc/sys/phoenix/configure                        | 4 ++++
 newlib/libc/sys/phoenix/machine/Makefile.in              | 1 +
 newlib/libc/sys/phoenix/machine/arm/Makefile.in          | 1 +
 newlib/libc/sys/phoenix/machine/arm/configure            | 4 ++++
 newlib/libc/sys/phoenix/machine/configure                | 4 ++++
 newlib/libc/sys/rdos/Makefile.in                         | 1 +
 newlib/libc/sys/rtems/Makefile.in                        | 1 +
 newlib/libc/sys/sh/Makefile.in                           | 1 +
 newlib/libc/sys/sparc64/Makefile.in                      | 1 +
 newlib/libc/sys/sun4/Makefile.in                         | 1 +
 newlib/libc/sys/sysmec/Makefile.in                       | 1 +
 newlib/libc/sys/sysnec810/Makefile.in                    | 1 +
 newlib/libc/sys/sysnecv850/Makefile.in                   | 1 +
 newlib/libc/sys/sysvi386/Makefile.in                     | 1 +
 newlib/libc/sys/sysvnecv70/Makefile.in                   | 1 +
 newlib/libc/sys/tic80/Makefile.in                        | 1 +
 newlib/libc/sys/tirtos/Makefile.in                       | 1 +
 newlib/libc/sys/w65/Makefile.in                          | 1 +
 newlib/libc/sys/z8ksim/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 +
 newlib/libm/Makefile.in                                  | 1 +
 newlib/libm/common/Makefile.in                           | 1 +
 newlib/libm/complex/Makefile.in                          | 1 +
 newlib/libm/configure                                    | 8 ++++++--
 newlib/libm/fenv/Makefile.in                             | 1 +
 newlib/libm/machine/aarch64/Makefile.in                  | 1 +
 newlib/libm/machine/arm/Makefile.in                      | 1 +
 newlib/libm/machine/i386/Makefile.in                     | 1 +
 newlib/libm/machine/mips/Makefile.in                     | 1 +
 newlib/libm/machine/nds32/Makefile.in                    | 1 +
 newlib/libm/machine/powerpc/Makefile.in                  | 1 +
 newlib/libm/machine/pru/Makefile.in                      | 1 +
 newlib/libm/machine/riscv/Makefile.in                    | 1 +
 newlib/libm/machine/sparc/Makefile.in                    | 1 +
 newlib/libm/machine/spu/Makefile.in                      | 1 +
 newlib/libm/machine/x86_64/Makefile.in                   | 1 +
 newlib/libm/math/Makefile.in                             | 1 +
 newlib/libm/mathfp/Makefile.in                           | 1 +
 156 files changed, 211 insertions(+), 20 deletions(-)

diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4
index 755f6e1165f0..888d417943e3 100644
--- a/newlib/acinclude.m4
+++ b/newlib/acinclude.m4
@@ -109,6 +109,9 @@ else
 fi
 AC_SUBST(newlib_basedir)
 
+abs_newlib_basedir=`cd "${newlib_basedir}" && pwd`
+AC_SUBST(abs_newlib_basedir)
+
 AC_CANONICAL_HOST
 
 AM_INIT_AUTOMAKE([foreign no-installinfo no-dependencies no-dist no-define subdir-objects 1.15.1])
diff --git a/newlib/configure.ac b/newlib/configure.ac
index 13f318922605..3758739ad40a 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -315,7 +315,6 @@ AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue)
 # These get added in the top-level configure.in, except in the case where
 # newlib is being built natively.
 LIBC_INCLUDE_GREP=`echo ${CC} | grep \/libc\/include`
-abs_newlib_basedir=`cd ${newlib_basedir} && pwd`
 if test -z "${LIBC_INCLUDE_GREP}"; then
   CC_FOR_NEWLIB="${CC} -I$PWD/targ-include -I${abs_newlib_basedir}/libc/include"
 else
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] newlib: use abs_newlib_basedir for -I paths
  2022-01-28  0:33 [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Mike Frysinger
@ 2022-01-28  0:33 ` Mike Frysinger
  2022-01-28  0:33 ` [PATCH 3/3] newlib: fix cygwin -I path Mike Frysinger
  2022-01-31 13:16 ` [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Corinna Vinschen
  2 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-01-28  0:33 UTC (permalink / raw)
  To: newlib; +Cc: jon.turney

When we had configure scripts in subdirs, the newlib_basedir value
was computed relative to that, and it'd be the same when used in the
Makefile in the same dir.  With many subdir configure scripts removed,
the top-level configure & Makefile can't use the same relative path.
So switch the subdir Makefiles over to abs_newlib_basedir when they
use -I to find source headers.

Do this for all subdirs, even ones with configure scripts and where
newlib_basedir works.  This makes the code consistent, and avoids
surprises if the configure script is ever removed in the future as
part of merging to the higher level.

Some of the subdirs were using -I$(newlib_basedir)/../newlib/ for
some reason.  Collapse those too since newlib_basedir points to the
newlib source tree already.
---
 newlib/libc/machine/i386/Makefile.am      | 2 +-
 newlib/libc/machine/i386/Makefile.in      | 2 +-
 newlib/libc/machine/xstormy16/Makefile.am | 4 ++--
 newlib/libc/machine/xstormy16/Makefile.in | 4 ++--
 newlib/libc/sys/arm/Makefile.am           | 2 +-
 newlib/libc/sys/arm/Makefile.in           | 2 +-
 newlib/libm/machine/aarch64/Makefile.am   | 2 +-
 newlib/libm/machine/aarch64/Makefile.in   | 2 +-
 newlib/libm/machine/arm/Makefile.am       | 2 +-
 newlib/libm/machine/arm/Makefile.in       | 2 +-
 newlib/libm/machine/i386/Makefile.am      | 2 +-
 newlib/libm/machine/i386/Makefile.in      | 2 +-
 newlib/libm/machine/mips/Makefile.am      | 2 +-
 newlib/libm/machine/mips/Makefile.in      | 2 +-
 newlib/libm/machine/nds32/Makefile.am     | 2 +-
 newlib/libm/machine/nds32/Makefile.in     | 2 +-
 newlib/libm/machine/powerpc/Makefile.am   | 2 +-
 newlib/libm/machine/powerpc/Makefile.in   | 2 +-
 newlib/libm/machine/pru/Makefile.am       | 2 +-
 newlib/libm/machine/pru/Makefile.in       | 2 +-
 newlib/libm/machine/riscv/Makefile.am     | 2 +-
 newlib/libm/machine/riscv/Makefile.in     | 2 +-
 newlib/libm/machine/sparc/Makefile.am     | 2 +-
 newlib/libm/machine/sparc/Makefile.in     | 2 +-
 newlib/libm/machine/spu/Makefile.am       | 2 +-
 newlib/libm/machine/spu/Makefile.in       | 2 +-
 newlib/libm/machine/x86_64/Makefile.am    | 2 +-
 newlib/libm/machine/x86_64/Makefile.in    | 2 +-
 28 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/newlib/libc/machine/i386/Makefile.am b/newlib/libc/machine/i386/Makefile.am
index 8b851f5ace55..311d1b9f50a0 100644
--- a/newlib/libc/machine/i386/Makefile.am
+++ b/newlib/libc/machine/i386/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
diff --git a/newlib/libc/machine/xstormy16/Makefile.am b/newlib/libc/machine/xstormy16/Makefile.am
index b0b72bc0f935..c20b01cfb053 100644
--- a/newlib/libc/machine/xstormy16/Makefile.am
+++ b/newlib/libc/machine/xstormy16/Makefile.am
@@ -1,8 +1,8 @@
 ## Process this file with automake to generate Makefile.in
 
-# hack: putting $(newlib_basedir)/libm/common into AM_CPPFLAGS forces automake
+# hack: putting $(abs_newlib_basedir)/libm/common into AM_CPPFLAGS forces automake
 # to output a definition for newlib_basedir.
-AM_CPPFLAGS = -I $(newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
diff --git a/newlib/libc/sys/arm/Makefile.am b/newlib/libc/sys/arm/Makefile.am
index b88c30c5a5ee..dda6ffb8a8ce 100644
--- a/newlib/libc/sys/arm/Makefile.am
+++ b/newlib/libc/sys/arm/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -I$(newlib_basedir)/libc/machine/arm
+AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -I$(abs_newlib_basedir)/libc/machine/arm
 
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
diff --git a/newlib/libm/machine/aarch64/Makefile.am b/newlib/libm/machine/aarch64/Makefile.am
index 1073ddcf944f..7679f89ff9e5 100644
--- a/newlib/libm/machine/aarch64/Makefile.am
+++ b/newlib/libm/machine/aarch64/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/arm/Makefile.am b/newlib/libm/machine/arm/Makefile.am
index 30ab57b00644..01ebac9f63f0 100644
--- a/newlib/libm/machine/arm/Makefile.am
+++ b/newlib/libm/machine/arm/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/i386/Makefile.am b/newlib/libm/machine/i386/Makefile.am
index 85e9a0299ef4..a5e95fe4d720 100644
--- a/newlib/libm/machine/i386/Makefile.am
+++ b/newlib/libm/machine/i386/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
diff --git a/newlib/libm/machine/mips/Makefile.am b/newlib/libm/machine/mips/Makefile.am
index 67e551ec5f63..d1c1edc7c942 100644
--- a/newlib/libm/machine/mips/Makefile.am
+++ b/newlib/libm/machine/mips/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/nds32/Makefile.am b/newlib/libm/machine/nds32/Makefile.am
index 85da0861a2d6..6e63d1aa8a36 100644
--- a/newlib/libm/machine/nds32/Makefile.am
+++ b/newlib/libm/machine/nds32/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 if HAS_NDS32_FPU_SP_FALSE
diff --git a/newlib/libm/machine/powerpc/Makefile.am b/newlib/libm/machine/powerpc/Makefile.am
index 353d0395d756..6d5571ed8b67 100644
--- a/newlib/libm/machine/powerpc/Makefile.am
+++ b/newlib/libm/machine/powerpc/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/pru/Makefile.am b/newlib/libm/machine/pru/Makefile.am
index e85e45b3f345..f7e329899f5f 100644
--- a/newlib/libm/machine/pru/Makefile.am
+++ b/newlib/libm/machine/pru/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/riscv/Makefile.am b/newlib/libm/machine/riscv/Makefile.am
index 38519251b42e..7a9e559eef79 100644
--- a/newlib/libm/machine/riscv/Makefile.am
+++ b/newlib/libm/machine/riscv/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/sparc/Makefile.am b/newlib/libm/machine/sparc/Makefile.am
index c2b89ecd38c3..e065fd0195c3 100644
--- a/newlib/libm/machine/sparc/Makefile.am
+++ b/newlib/libm/machine/sparc/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/spu/Makefile.am b/newlib/libm/machine/spu/Makefile.am
index 1a575df95f18..e5e630deea03 100644
--- a/newlib/libm/machine/spu/Makefile.am
+++ b/newlib/libm/machine/spu/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
diff --git a/newlib/libm/machine/x86_64/Makefile.am b/newlib/libm/machine/x86_64/Makefile.am
index 6c30f4364877..58a62fbb623a 100644
--- a/newlib/libm/machine/x86_64/Makefile.am
+++ b/newlib/libm/machine/x86_64/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AM_CPPFLAGS = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
+AM_CPPFLAGS = -I $(abs_newlib_basedir)/libm/common $(NEWLIB_CFLAGS) \
 	$(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 LIB_SOURCES = \
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] newlib: fix cygwin -I path
  2022-01-28  0:33 [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Mike Frysinger
  2022-01-28  0:33 ` [PATCH 2/3] newlib: use abs_newlib_basedir for -I paths Mike Frysinger
@ 2022-01-28  0:33 ` Mike Frysinger
  2022-01-31 13:16 ` [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Corinna Vinschen
  2 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-01-28  0:33 UTC (permalink / raw)
  To: newlib; +Cc: jon.turney

This code snippet assumed it was only ever run in the top configure
script where srcdir would point to newlib/ which is parallel to the
winsup/ tree.  This is incorrect for all of the subdir configure
scripts leading to bad -I flags in $(CC).  Switch it over to the
new abs_newlib_basedir which should work in all subdirs.
---
 newlib/configure.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/configure.host b/newlib/configure.host
index ca6b46f03e09..bf4a555e6da7 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -641,7 +641,7 @@ esac
 
 case "${host}" in
   *-*-cygwin*)
-	test -z "$cygwin_srcdir" && cygwin_srcdir=`cd ${srcdir}/../winsup/cygwin; pwd`
+	test -z "$cygwin_srcdir" && cygwin_srcdir="${abs_newlib_basedir}/../winsup/cygwin"
 	export cygwin_srcdir
 	default_newlib_io_c99_formats="yes"
 	default_newlib_io_long_long="yes"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs
  2022-01-28  0:33 [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Mike Frysinger
  2022-01-28  0:33 ` [PATCH 2/3] newlib: use abs_newlib_basedir for -I paths Mike Frysinger
  2022-01-28  0:33 ` [PATCH 3/3] newlib: fix cygwin -I path Mike Frysinger
@ 2022-01-31 13:16 ` Corinna Vinschen
  2022-02-01  3:10   ` Mike Frysinger
  2 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2022-01-31 13:16 UTC (permalink / raw)
  To: newlib

On Jan 27 19:33, Mike Frysinger wrote:
> When using the top-level configure script but subdir Makefiles, the
> newlib_basedir value gets a bit out of sync: it's relative to where
> configure lives, not where the Makefile lives.  Move the abs setting
> from the top-level configure script into acinclude.m4 so we can rely
> on it being available everywhere.  Although this commit doesn't use
> it anywhere, just lays the groundwork.

Patchset looks ok to me.  Would you mind to send patchsets consisting
of more than a single patch with a cover-letter?  It's just easier
to discusss the entire patchset vs. discussing single patches.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs
  2022-01-31 13:16 ` [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Corinna Vinschen
@ 2022-02-01  3:10   ` Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-02-01  3:10 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

On 31 Jan 2022 14:16, Corinna Vinschen wrote:
> On Jan 27 19:33, Mike Frysinger wrote:
> > When using the top-level configure script but subdir Makefiles, the
> > newlib_basedir value gets a bit out of sync: it's relative to where
> > configure lives, not where the Makefile lives.  Move the abs setting
> > from the top-level configure script into acinclude.m4 so we can rely
> > on it being available everywhere.  Although this commit doesn't use
> > it anywhere, just lays the groundwork.
> 
> Patchset looks ok to me.  Would you mind to send patchsets consisting
> of more than a single patch with a cover-letter?  It's just easier
> to discusss the entire patchset vs. discussing single patches.

sure, if you prefer
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-01  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28  0:33 [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Mike Frysinger
2022-01-28  0:33 ` [PATCH 2/3] newlib: use abs_newlib_basedir for -I paths Mike Frysinger
2022-01-28  0:33 ` [PATCH 3/3] newlib: fix cygwin -I path Mike Frysinger
2022-01-31 13:16 ` [PATCH 1/3] newlib: export abs_newlib_basedir for all subdirs Corinna Vinschen
2022-02-01  3:10   ` Mike Frysinger

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).