public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] configure.ac: configurable tooldir install path
@ 2024-01-23  8:51 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2024-01-23  8:51 UTC (permalink / raw)
  To: cygwin-cvs, newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=90d6966b88392dbcef01c64766eb452c645a7bfe

commit 90d6966b88392dbcef01c64766eb452c645a7bfe
Author:     Neal Frager <neal.frager@amd.com>
AuthorDate: Thu Jan 11 18:30:19 2024 +0000
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Tue Jan 23 09:49:03 2024 +0100

    configure.ac: configurable tooldir install path
    
    This patch is required to fix how the newlib headers are installed
    when using a sysroot install directory.
    
    The cross compiler expects headers to be in
    .../host/usr/arm-none-eabi/sysroot/usr/include/newlib.h
    by default newlib installed the headers into
    .../host/usr/arm-none-eabi/sysroot/usr/arm-none-eabi/include/newlib.h
    
    ${exec_prefix} provides the .../host/usr/arm-none-eabi/sysroot path
    ${target_noncanonical} provides an extra arm-none-eabi/ that must be removed.
    
    With this patch, users can specify the tooldir path that is needed.
    
    Signed-off-by: Neal Frager <neal.frager@amd.com>
    Co-developed-by: Chris Wardman <cjwfirmware@vxmdesign.com>

Diff:
---
 configure    | 32 ++++++++++++++++++++++++++++++--
 configure.ac | 10 +++++++++-
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index eb0ba840b1ac..947715305636 100755
--- a/configure
+++ b/configure
@@ -755,6 +755,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -822,6 +823,7 @@ enable_stage1_languages
 enable_objc_gc
 with_build_sysroot
 with_debug_prefix_map
+with_tooldir
 with_build_config
 enable_vtable_verify
 enable_serial_configure
@@ -915,6 +917,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1167,6 +1170,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1304,7 +1316,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1464,6 +1476,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1592,6 +1605,7 @@ Optional Packages:
                           use sysroot as the system root during the build
   --with-debug-prefix-map='A=B C=D ...'
                           map A to B, C to D ... in debug information
+  --with-tooldir=PATH     use given path to install target tools after build
   --with-build-config='NAME NAME2...'
                           use config/NAME.mk build configuration
   --with-build-time-tools=PATH
@@ -7057,7 +7071,21 @@ esac
 
 # Some systems (e.g., one of the i386-aix systems the gas testers are
 # using) don't handle "\$" correctly, so don't use it here.
-tooldir='${exec_prefix}'/${target_noncanonical}
+
+# Check whether --with-tooldir was given.
+if test "${with_tooldir+set}" = set; then :
+  withval=$with_tooldir; case x"$withval" in #(
+  x/*) :
+     ;; #(
+  *) :
+    as_fn_error $? "argument to --with-tooldir must be an absolute path" "$LINENO" 5 ;;
+esac
+
+else
+  with_tooldir='${exec_prefix}'/${target_noncanonical}
+fi
+
+tooldir=${with_tooldir}
 build_tooldir=${tooldir}
 
 # Create a .gdbinit file which runs the one in srcdir
diff --git a/configure.ac b/configure.ac
index f1bb72100655..05ddf69870e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2599,7 +2599,15 @@ esac
 
 # Some systems (e.g., one of the i386-aix systems the gas testers are
 # using) don't handle "\$" correctly, so don't use it here.
-tooldir='${exec_prefix}'/${target_noncanonical}
+AC_ARG_WITH([tooldir],
+  [AS_HELP_STRING([--with-tooldir=PATH],
+		[use given path to install target tools after build])],
+  [AS_CASE([x"$withval"],
+	[x/*],,
+	[AC_MSG_ERROR([argument to --with-tooldir must be an absolute path])])
+  ],
+  [with_tooldir='${exec_prefix}'/${target_noncanonical}])
+tooldir=${with_tooldir}
 build_tooldir=${tooldir}
 
 # Create a .gdbinit file which runs the one in srcdir

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-23  8:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23  8:51 [newlib-cygwin/main] configure.ac: configurable tooldir install path Corinna Vinschen

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