Skip to content

Commit 90d6966

Browse files
nealfragergithub-cygwin
authored andcommitted
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 <[email protected]> Co-developed-by: Chris Wardman <[email protected]>
1 parent 276dd12 commit 90d6966

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

configure

+30-2
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ infodir
755755
docdir
756756
oldincludedir
757757
includedir
758+
runstatedir
758759
localstatedir
759760
sharedstatedir
760761
sysconfdir
@@ -822,6 +823,7 @@ enable_stage1_languages
822823
enable_objc_gc
823824
with_build_sysroot
824825
with_debug_prefix_map
826+
with_tooldir
825827
with_build_config
826828
enable_vtable_verify
827829
enable_serial_configure
@@ -915,6 +917,7 @@ datadir='${datarootdir}'
915917
sysconfdir='${prefix}/etc'
916918
sharedstatedir='${prefix}/com'
917919
localstatedir='${prefix}/var'
920+
runstatedir='${localstatedir}/run'
918921
includedir='${prefix}/include'
919922
oldincludedir='/usr/include'
920923
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1167,6 +1170,15 @@ do
11671170
| -silent | --silent | --silen | --sile | --sil)
11681171
silent=yes ;;
11691172

1173+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1174+
| --runstate | --runstat | --runsta | --runst | --runs \
1175+
| --run | --ru | --r)
1176+
ac_prev=runstatedir ;;
1177+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1178+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1179+
| --run=* | --ru=* | --r=*)
1180+
runstatedir=$ac_optarg ;;
1181+
11701182
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11711183
ac_prev=sbindir ;;
11721184
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1304,7 +1316,7 @@ fi
13041316
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
13051317
datadir sysconfdir sharedstatedir localstatedir includedir \
13061318
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1307-
libdir localedir mandir
1319+
libdir localedir mandir runstatedir
13081320
do
13091321
eval ac_val=\$$ac_var
13101322
# Remove trailing slashes.
@@ -1464,6 +1476,7 @@ Fine tuning of the installation directories:
14641476
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14651477
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14661478
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1479+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14671480
--libdir=DIR object code libraries [EPREFIX/lib]
14681481
--includedir=DIR C header files [PREFIX/include]
14691482
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1592,6 +1605,7 @@ Optional Packages:
15921605
use sysroot as the system root during the build
15931606
--with-debug-prefix-map='A=B C=D ...'
15941607
map A to B, C to D ... in debug information
1608+
--with-tooldir=PATH use given path to install target tools after build
15951609
--with-build-config='NAME NAME2...'
15961610
use config/NAME.mk build configuration
15971611
--with-build-time-tools=PATH
@@ -7057,7 +7071,21 @@ esac
70577071

70587072
# Some systems (e.g., one of the i386-aix systems the gas testers are
70597073
# using) don't handle "\$" correctly, so don't use it here.
7060-
tooldir='${exec_prefix}'/${target_noncanonical}
7074+
7075+
# Check whether --with-tooldir was given.
7076+
if test "${with_tooldir+set}" = set; then :
7077+
withval=$with_tooldir; case x"$withval" in #(
7078+
x/*) :
7079+
;; #(
7080+
*) :
7081+
as_fn_error $? "argument to --with-tooldir must be an absolute path" "$LINENO" 5 ;;
7082+
esac
7083+
7084+
else
7085+
with_tooldir='${exec_prefix}'/${target_noncanonical}
7086+
fi
7087+
7088+
tooldir=${with_tooldir}
70617089
build_tooldir=${tooldir}
70627090

70637091
# Create a .gdbinit file which runs the one in srcdir

configure.ac

+9-1
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,15 @@ esac
25992599

26002600
# Some systems (e.g., one of the i386-aix systems the gas testers are
26012601
# using) don't handle "\$" correctly, so don't use it here.
2602-
tooldir='${exec_prefix}'/${target_noncanonical}
2602+
AC_ARG_WITH([tooldir],
2603+
[AS_HELP_STRING([--with-tooldir=PATH],
2604+
[use given path to install target tools after build])],
2605+
[AS_CASE([x"$withval"],
2606+
[x/*],,
2607+
[AC_MSG_ERROR([argument to --with-tooldir must be an absolute path])])
2608+
],
2609+
[with_tooldir='${exec_prefix}'/${target_noncanonical}])
2610+
tooldir=${with_tooldir}
26032611
build_tooldir=${tooldir}
26042612

26052613
# Create a .gdbinit file which runs the one in srcdir

0 commit comments

Comments
 (0)