From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 1EE5F385842D; Tue, 23 Jan 2024 08:51:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EE5F385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705999879; bh=spXs5p4qSGwwrMpprg4neWqP8AHoSNGNihJnOB5pzik=; h=From:To:Subject:Date:From; b=BW9i0aBokbovFFozE2M+JUt718j9ZVfLcpZVJOmaB7Knr9pqOE1zi2YZe1kOr99Ge hus53uAC3NbAuIFrsrNC7zsFdK1dIr+NkOamo9+OvyX+WlVkzZpwXucuey2UchJw2W q1nWh6gySZl6eEN/Jiwdy+H7ajJTO0EK4V9pnEos= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org, newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] configure.ac: configurable tooldir install path X-Act-Checkin: newlib-cygwin X-Git-Author: Neal Frager X-Git-Refname: refs/heads/main X-Git-Oldrev: 276dd12f69b1cf113a009da331d3bcfc4783fdce X-Git-Newrev: 90d6966b88392dbcef01c64766eb452c645a7bfe Message-Id: <20240123085119.1EE5F385842D@sourceware.org> Date: Tue, 23 Jan 2024 08:51:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D90d6966b883= 92dbcef01c64766eb452c645a7bfe commit 90d6966b88392dbcef01c64766eb452c645a7bfe Author: Neal Frager AuthorDate: Thu Jan 11 18:30:19 2024 +0000 Commit: Corinna Vinschen CommitDate: Tue Jan 23 09:49:03 2024 +0100 configure.ac: configurable tooldir install path =20 This patch is required to fix how the newlib headers are installed when using a sysroot install directory. =20 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 =20 ${exec_prefix} provides the .../host/usr/arm-none-eabi/sysroot path ${target_noncanonical} provides an extra arm-none-eabi/ that must be re= moved. =20 With this patch, users can specify the tooldir path that is needed. =20 Signed-off-by: Neal Frager Co-developed-by: Chris Wardman 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=3D'${datarootdir}' sysconfdir=3D'${prefix}/etc' sharedstatedir=3D'${prefix}/com' localstatedir=3D'${prefix}/var' +runstatedir=3D'${localstatedir}/run' includedir=3D'${prefix}/include' oldincludedir=3D'/usr/include' docdir=3D'${datarootdir}/doc/${PACKAGE}' @@ -1167,6 +1170,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=3Dyes ;; =20 + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=3Drunstatedir ;; + -runstatedir=3D* | --runstatedir=3D* | --runstatedi=3D* | --runstated=3D= * \ + | --runstate=3D* | --runstat=3D* | --runsta=3D* | --runst=3D* | --runs= =3D* \ + | --run=3D* | --ru=3D* | --r=3D*) + runstatedir=3D$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=3Dsbindir ;; -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \ @@ -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=3D\$$ac_var # Remove trailing slashes. @@ -1464,6 +1476,7 @@ Fine tuning of the installation directories: --sysconfdir=3DDIR read-only single-machine data [PREFIX/etc] --sharedstatedir=3DDIR modifiable architecture-independent data [PREF= IX/com] --localstatedir=3DDIR modifiable single-machine data [PREFIX/var] + --runstatedir=3DDIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=3DDIR object code libraries [EPREFIX/lib] --includedir=3DDIR C header files [PREFIX/include] --oldincludedir=3DDIR 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=3D'A=3DB C=3DD ...' map A to B, C to D ... in debug information + --with-tooldir=3DPATH use given path to install target tools after b= uild --with-build-config=3D'NAME NAME2...' use config/NAME.mk build configuration --with-build-time-tools=3DPATH @@ -7057,7 +7071,21 @@ esac =20 # 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=3D'${exec_prefix}'/${target_noncanonical} + +# Check whether --with-tooldir was given. +if test "${with_tooldir+set}" =3D set; then : + withval=3D$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=3D'${exec_prefix}'/${target_noncanonical} +fi + +tooldir=3D${with_tooldir} build_tooldir=3D${tooldir} =20 # 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 =20 # 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=3D'${exec_prefix}'/${target_noncanonical} +AC_ARG_WITH([tooldir], + [AS_HELP_STRING([--with-tooldir=3DPATH], + [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=3D'${exec_prefix}'/${target_noncanonical}]) +tooldir=3D${with_tooldir} build_tooldir=3D${tooldir} =20 # Create a .gdbinit file which runs the one in srcdir