diff mbox series

[v5,1/1] configure.ac: configurable tooldir install path

Message ID 20240111183019.121397-1-neal.frager@amd.com
State New
Headers show
Series [v5,1/1] configure.ac: configurable tooldir install path | expand

Commit Message

Frager, Neal Jan. 11, 2024, 6:30 p.m. UTC
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>
---
V1->V2:
 - migrated patch to configure.ac
 - changed option name to --with-tooldir=PATH
V2->V3:
 - removed quotes around ${with_tooldir}
V3->V4:
 - migrated case to AS_CASE
 - migrated AC_MSG_WARN to AC_MSG_ERROR
V4->V5:
 - remove unnecessary with_tooldir clear when erroring out
---
 configure.ac | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Frager, Neal Jan. 22, 2024, 9:31 a.m. UTC | #1
Hello Mike, Jeff,

Just a friendly reminder regarding this patch.  Have you had
a chance to review v5 yet?

Thank you for your support.

Best regards,
Neal Frager
AMD

> ---
> configure.ac | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index f1bb72100..0badf1d30 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
> -- 
> 2.25.1
Mike Frysinger Jan. 22, 2024, 1:12 p.m. UTC | #2
On 22 Jan 2024 09:31, Frager, Neal wrote:
> Just a friendly reminder regarding this patch.  Have you had
> a chance to review v5 yet?

seems OK to me, although i don't use tooldir.
up to Jeff or Corinna at this point.
-mike
Corinna Vinschen Jan. 23, 2024, 8:53 a.m. UTC | #3
On Jan 11 18:30, Neal Frager wrote:
> 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>
> ---
> V1->V2:
>  - migrated patch to configure.ac
>  - changed option name to --with-tooldir=PATH
> V2->V3:
>  - removed quotes around ${with_tooldir}
> V3->V4:
>  - migrated case to AS_CASE
>  - migrated AC_MSG_WARN to AC_MSG_ERROR
> V4->V5:
>  - remove unnecessary with_tooldir clear when erroring out
> ---
>  configure.ac | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f1bb72100..0badf1d30 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
> -- 
> 2.25.1

Pushed.


Thanks,
Corinna
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index f1bb72100..0badf1d30 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