1 From 46339bdf619b93dfa05d5f004d062671d3dc26d2 Mon Sep 17 00:00:00 2001
2 From: Mathieu Othacehe <m.othacehe@gmail.com>
3 Date: Tue, 24 Mar 2020 13:50:56 +0100
4 Subject: [PATCH] toolexec
7 gcc/doc/install.texi | 4 ++++
8 libatomic/configure | 33 ++++++++++++++++++++++---
9 libffi/configure | 33 ++++++++++++++++++++++---
10 libgcc/configure | 38 +++++++++++++++++++++++++++--
11 libgomp/configure | 33 ++++++++++++++++++++++---
12 libhsail-rt/configure | 33 ++++++++++++++++++++++---
13 libitm/configure | 33 ++++++++++++++++++++++---
14 liboffloadmic/configure | 33 ++++++++++++++++++++++---
15 liboffloadmic/plugin/configure | 33 ++++++++++++++++++++++---
16 libquadmath/configure | 33 ++++++++++++++++++++++---
17 libsanitizer/configure | 33 ++++++++++++++++++++++---
18 libssp/configure | 33 ++++++++++++++++++++++---
19 libstdc++-v3/configure | 44 ++++++++++++++++++++++++++--------
20 13 files changed, 374 insertions(+), 42 deletions(-)
22 diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
23 index 77ba08d3f21..28cb6d88da8 100644
24 --- a/gcc/doc/install.texi
25 +++ b/gcc/doc/install.texi
26 @@ -2083,6 +2083,10 @@ shorthand for
27 The following options only apply to building cross compilers.
30 +@item --with-toolexeclibdir=@var{dir}
31 +Specify the installation directory for libraries built with a cross compiler.
32 +The default is @option{$@{gcc_tooldir@}/lib}.
35 @itemx --with-sysroot=@var{dir}
36 Tells GCC to consider @var{dir} as the root of a tree that contains
37 diff --git a/libatomic/configure b/libatomic/configure
38 index 2ae9b8d40f3..0fa531ec4a3 100755
39 --- a/libatomic/configure
40 +++ b/libatomic/configure
41 @@ -755,6 +755,7 @@ enable_option_checking
42 enable_version_specific_runtime_libs
43 enable_generated_files_in_srcdir
46 enable_dependency_tracking
49 @@ -1414,6 +1415,9 @@ Optional Features:
51 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
52 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
53 + --with-toolexeclibdir=DIR
54 + install libraries built with a cross compiler within
56 --with-pic try to use only PIC/non-PIC objects [default=use
58 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
59 @@ -3185,6 +3189,22 @@ fi
60 ac_config_commands="$ac_config_commands default-1"
64 +# Check whether --with-toolexeclibdir was given.
65 +if test "${with_toolexeclibdir+set}" = set; then :
66 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
70 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
74 + with_toolexeclibdir=no
79 # Calculate toolexeclibdir
80 # Also toolexecdir, though it's only used in toolexeclibdir
81 case ${enable_version_specific_runtime_libs} in
82 @@ -3200,7 +3220,14 @@ case ${enable_version_specific_runtime_libs} in
83 test x"$with_cross_host" != x"no"; then
84 # Install a library built with a cross compiler in tooldir, not libdir.
85 toolexecdir='$(exec_prefix)/$(target_alias)'
86 - toolexeclibdir='$(toolexecdir)/lib'
87 + case ${with_toolexeclibdir} in
89 + toolexeclibdir='$(toolexecdir)/lib'
92 + toolexeclibdir=${with_toolexeclibdir}
96 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
97 toolexeclibdir='$(libdir)'
98 @@ -11115,7 +11142,7 @@ else
99 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
100 lt_status=$lt_dlunknown
101 cat > conftest.$ac_ext <<_LT_EOF
102 -#line 11118 "configure"
103 +#line 11145 "configure"
104 #include "confdefs.h"
107 @@ -11221,7 +11248,7 @@ else
108 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
109 lt_status=$lt_dlunknown
110 cat > conftest.$ac_ext <<_LT_EOF
111 -#line 11224 "configure"
112 +#line 11251 "configure"
113 #include "confdefs.h"
116 diff --git a/libffi/configure b/libffi/configure
117 index 790a291011f..6e37039e84c 100755
118 --- a/libffi/configure
119 +++ b/libffi/configure
120 @@ -777,6 +777,7 @@ enable_debug
126 with_gcc_major_version_only
128 @@ -1436,6 +1437,9 @@ Optional Packages:
129 --with-pic try to use only PIC/non-PIC objects [default=use
131 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
132 + --with-toolexeclibdir=DIR
133 + install libraries built with a cross compiler within
135 --with-gcc-major-version-only
136 use only GCC major number in filesystem paths
138 @@ -11390,7 +11394,7 @@ else
139 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
140 lt_status=$lt_dlunknown
141 cat > conftest.$ac_ext <<_LT_EOF
142 -#line 11393 "configure"
143 +#line 11397 "configure"
144 #include "confdefs.h"
147 @@ -11496,7 +11500,7 @@ else
148 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
149 lt_status=$lt_dlunknown
150 cat > conftest.$ac_ext <<_LT_EOF
151 -#line 11499 "configure"
152 +#line 11507 "configure"
153 #include "confdefs.h"
156 @@ -16002,10 +16006,33 @@ $as_echo "#define USING_PURIFY 1" >>confdefs.h
161 +# Check whether --with-toolexeclibdir was given.
162 +if test "${with_toolexeclibdir+set}" = set; then :
163 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
167 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
171 + with_toolexeclibdir=no
176 if test -n "$with_cross_host" &&
177 test x"$with_cross_host" != x"no"; then
178 toolexecdir='$(exec_prefix)/$(target_alias)'
179 - toolexeclibdir='$(toolexecdir)/lib'
180 + case ${with_toolexeclibdir} in
182 + toolexeclibdir='$(toolexecdir)/lib'
185 + toolexeclibdir=${with_toolexeclibdir}
189 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
190 toolexeclibdir='$(libdir)'
191 diff --git a/libgcc/configure b/libgcc/configure
192 index 441601a1f76..976827dc57e 100644
193 --- a/libgcc/configure
194 +++ b/libgcc/configure
195 @@ -669,6 +669,7 @@ enable_shared
198 enable_version_specific_runtime_libs
201 enable_maintainer_mode
203 @@ -1329,6 +1330,9 @@ Optional Packages:
204 --with-aix-soname=aix|svr4|both
205 shared library versioning (aka "SONAME") variant to
207 + --with-toolexeclibdir=DIR
208 + install libraries built with a cross compiler within
210 --with-slibdir=DIR shared libraries in DIR LIBDIR
211 --with-build-libsubdir=DIR Directory where to find libraries for build system
212 --with-system-libunwind use installed libunwind
213 @@ -2403,6 +2407,22 @@ fi
214 $as_echo "$version_specific_libs" >&6; }
217 +# Check whether --with-toolexeclibdir was given.
218 +if test "${with_toolexeclibdir+set}" = set; then :
219 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
223 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
227 + with_toolexeclibdir=no
233 # Check whether --with-slibdir was given.
234 if test "${with_slibdir+set}" = set; then :
235 withval=$with_slibdir; slibdir="$with_slibdir"
236 @@ -2410,7 +2430,14 @@ else
237 if test "${version_specific_libs}" = yes; then
238 slibdir='$(libsubdir)'
239 elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
240 - slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
241 + case ${with_toolexeclibdir} in
243 + slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
246 + slibdir=${with_toolexeclibdir}
252 @@ -2640,7 +2667,14 @@ case ${version_specific_libs} in
253 test x"$with_cross_host" != x"no"; then
254 # Install a library built with a cross compiler in tooldir, not libdir.
255 toolexecdir='$(exec_prefix)/$(target_noncanonical)'
256 - toolexeclibdir='$(toolexecdir)/lib'
257 + case ${with_toolexeclibdir} in
259 + toolexeclibdir='$(toolexecdir)/lib'
262 + toolexeclibdir=${with_toolexeclibdir}
266 toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
267 toolexeclibdir='$(libdir)'
268 diff --git a/libgomp/configure b/libgomp/configure
269 index 06166c66120..6b3beae0f63 100755
270 --- a/libgomp/configure
271 +++ b/libgomp/configure
272 @@ -782,6 +782,7 @@ enable_option_checking
273 enable_version_specific_runtime_libs
274 enable_generated_files_in_srcdir
277 enable_dependency_tracking
280 @@ -1455,6 +1456,9 @@ Optional Features:
282 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
283 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
284 + --with-toolexeclibdir=DIR
285 + install libraries built with a cross compiler within
287 --with-pic try to use only PIC/non-PIC objects [default=use
289 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
290 @@ -3338,6 +3342,22 @@ fi
291 ac_config_commands="$ac_config_commands default-1"
295 +# Check whether --with-toolexeclibdir was given.
296 +if test "${with_toolexeclibdir+set}" = set; then :
297 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
301 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
305 + with_toolexeclibdir=no
310 # Calculate toolexeclibdir
311 # Also toolexecdir, though it's only used in toolexeclibdir
312 case ${enable_version_specific_runtime_libs} in
313 @@ -3353,7 +3373,14 @@ case ${enable_version_specific_runtime_libs} in
314 test x"$with_cross_host" != x"no"; then
315 # Install a library built with a cross compiler in tooldir, not libdir.
316 toolexecdir='$(exec_prefix)/$(target_alias)'
317 - toolexeclibdir='$(toolexecdir)/lib'
318 + case ${with_toolexeclibdir} in
320 + toolexeclibdir='$(toolexecdir)/lib'
323 + toolexeclibdir=${with_toolexeclibdir}
327 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
328 toolexeclibdir='$(libdir)'
329 @@ -11155,7 +11182,7 @@ else
330 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
331 lt_status=$lt_dlunknown
332 cat > conftest.$ac_ext <<_LT_EOF
333 -#line 11158 "configure"
334 +#line 11185 "configure"
335 #include "confdefs.h"
338 @@ -11261,7 +11288,7 @@ else
339 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
340 lt_status=$lt_dlunknown
341 cat > conftest.$ac_ext <<_LT_EOF
342 -#line 11264 "configure"
343 +#line 11295 "configure"
344 #include "confdefs.h"
347 diff --git a/libhsail-rt/configure b/libhsail-rt/configure
348 index a4fcc10c1f9..1b4f2a953d0 100755
349 --- a/libhsail-rt/configure
350 +++ b/libhsail-rt/configure
351 @@ -737,6 +737,7 @@ enable_option_checking
352 enable_maintainer_mode
353 enable_dependency_tracking
354 enable_version_specific_runtime_libs
359 @@ -1395,6 +1396,9 @@ Optional Features:
361 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
362 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
363 + --with-toolexeclibdir=DIR
364 + install libraries built with a cross compiler within
366 --with-pic try to use only PIC/non-PIC objects [default=use
368 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
369 @@ -4418,6 +4422,22 @@ fi
370 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_version_specific_runtime_libs" >&5
371 $as_echo "$enable_version_specific_runtime_libs" >&6; }
374 +# Check whether --with-toolexeclibdir was given.
375 +if test "${with_toolexeclibdir+set}" = set; then :
376 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
380 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
384 + with_toolexeclibdir=no
389 # Calculate toolexeclibdir
390 # Also toolexecdir, though it's only used in toolexeclibdir
391 case ${enable_version_specific_runtime_libs} in
392 @@ -4433,7 +4453,14 @@ case ${enable_version_specific_runtime_libs} in
393 test x"$with_cross_host" != x"no"; then
394 # Install a library built with a cross compiler in tooldir, not libdir.
395 toolexecdir='$(exec_prefix)/$(target_alias)'
396 - toolexeclibdir='$(toolexecdir)/lib'
397 + case ${with_toolexeclibdir} in
399 + toolexeclibdir='$(toolexecdir)/lib'
402 + toolexeclibdir=${with_toolexeclibdir}
406 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
407 toolexeclibdir='$(libdir)'
408 @@ -10973,7 +11000,7 @@ else
409 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
410 lt_status=$lt_dlunknown
411 cat > conftest.$ac_ext <<_LT_EOF
412 -#line 10976 "configure"
413 +#line 11003 "configure"
414 #include "confdefs.h"
417 @@ -11079,7 +11106,7 @@ else
418 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
419 lt_status=$lt_dlunknown
420 cat > conftest.$ac_ext <<_LT_EOF
421 -#line 11082 "configure"
422 +#line 11113 "configure"
423 #include "confdefs.h"
426 diff --git a/libitm/configure b/libitm/configure
427 index 96c494d4a3f..ed47fab3c83 100644
428 --- a/libitm/configure
429 +++ b/libitm/configure
430 @@ -766,6 +766,7 @@ enable_option_checking
431 enable_version_specific_runtime_libs
432 enable_generated_files_in_srcdir
435 enable_dependency_tracking
438 @@ -1430,6 +1431,9 @@ Optional Features:
440 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
441 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
442 + --with-toolexeclibdir=DIR
443 + install libraries built with a cross compiler within
445 --with-pic try to use only PIC/non-PIC objects [default=use
447 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
448 @@ -3371,6 +3375,22 @@ fi
449 ac_config_commands="$ac_config_commands default-1"
453 +# Check whether --with-toolexeclibdir was given.
454 +if test "${with_toolexeclibdir+set}" = set; then :
455 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
459 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
463 + with_toolexeclibdir=no
468 # Calculate toolexeclibdir
469 # Also toolexecdir, though it's only used in toolexeclibdir
470 case ${enable_version_specific_runtime_libs} in
471 @@ -3386,7 +3406,14 @@ case ${enable_version_specific_runtime_libs} in
472 test x"$with_cross_host" != x"no"; then
473 # Install a library built with a cross compiler in tooldir, not libdir.
474 toolexecdir='$(exec_prefix)/$(target_alias)'
475 - toolexeclibdir='$(toolexecdir)/lib'
476 + case ${with_toolexeclibdir} in
478 + toolexeclibdir='$(toolexecdir)/lib'
481 + toolexeclibdir=${with_toolexeclibdir}
485 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
486 toolexeclibdir='$(libdir)'
487 @@ -11794,7 +11821,7 @@ else
488 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
489 lt_status=$lt_dlunknown
490 cat > conftest.$ac_ext <<_LT_EOF
491 -#line 11797 "configure"
492 +#line 11824 "configure"
493 #include "confdefs.h"
496 @@ -11900,7 +11927,7 @@ else
497 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
498 lt_status=$lt_dlunknown
499 cat > conftest.$ac_ext <<_LT_EOF
500 -#line 11903 "configure"
501 +#line 11934 "configure"
502 #include "confdefs.h"
505 diff --git a/liboffloadmic/configure b/liboffloadmic/configure
506 index f873716991b..6dfe9e37642 100644
507 --- a/liboffloadmic/configure
508 +++ b/liboffloadmic/configure
509 @@ -739,6 +739,7 @@ enable_maintainer_mode
510 enable_dependency_tracking
512 enable_version_specific_runtime_libs
517 @@ -1397,6 +1398,9 @@ Optional Features:
519 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
520 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
521 + --with-toolexeclibdir=DIR
522 + install libraries built with a cross compiler within
524 --with-pic try to use only PIC/non-PIC objects [default=use
526 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
527 @@ -5003,6 +5007,22 @@ else
532 +# Check whether --with-toolexeclibdir was given.
533 +if test "${with_toolexeclibdir+set}" = set; then :
534 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
538 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
542 + with_toolexeclibdir=no
547 # Calculate toolexeclibdir.
548 # Also toolexecdir, though it's only used in toolexeclibdir.
549 case ${enable_version_specific_runtime_libs} in
550 @@ -5018,7 +5038,14 @@ case ${enable_version_specific_runtime_libs} in
551 test x"$with_cross_host" != x"no"; then
552 # Install a library built with a cross compiler in tooldir, not libdir.
553 toolexecdir='$(exec_prefix)/$(target_alias)'
554 - toolexeclibdir='$(toolexecdir)/lib'
555 + case ${with_toolexeclibdir} in
557 + toolexeclibdir='$(toolexecdir)/lib'
560 + toolexeclibdir=${with_toolexeclibdir}
564 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
565 toolexeclibdir='$(libdir)'
566 @@ -11108,7 +11135,7 @@ else
567 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
568 lt_status=$lt_dlunknown
569 cat > conftest.$ac_ext <<_LT_EOF
570 -#line 11111 "configure"
571 +#line 11138 "configure"
572 #include "confdefs.h"
575 @@ -11214,7 +11241,7 @@ else
576 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
577 lt_status=$lt_dlunknown
578 cat > conftest.$ac_ext <<_LT_EOF
579 -#line 11217 "configure"
580 +#line 11248 "configure"
581 #include "confdefs.h"
584 diff --git a/liboffloadmic/plugin/configure b/liboffloadmic/plugin/configure
585 index c031eb3e7fa..570758344b4 100644
586 --- a/liboffloadmic/plugin/configure
587 +++ b/liboffloadmic/plugin/configure
588 @@ -735,6 +735,7 @@ enable_maintainer_mode
589 enable_dependency_tracking
591 enable_version_specific_runtime_libs
596 @@ -1394,6 +1395,9 @@ Optional Features:
598 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
599 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
600 + --with-toolexeclibdir=DIR
601 + install libraries built with a cross compiler within
603 --with-pic try to use only PIC/non-PIC objects [default=use
605 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
606 @@ -4311,6 +4315,22 @@ fi
607 $as_echo "$enable_version_specific_runtime_libs" >&6; }
611 +# Check whether --with-toolexeclibdir was given.
612 +if test "${with_toolexeclibdir+set}" = set; then :
613 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
617 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
621 + with_toolexeclibdir=no
626 # Calculate toolexeclibdir.
627 # Also toolexecdir, though it's only used in toolexeclibdir.
628 case ${enable_version_specific_runtime_libs} in
629 @@ -4326,7 +4346,14 @@ case ${enable_version_specific_runtime_libs} in
630 test x"$with_cross_host" != x"no"; then
631 # Install a library built with a cross compiler in tooldir, not libdir.
632 toolexecdir='$(exec_prefix)/$(target_alias)'
633 - toolexeclibdir='$(toolexecdir)/lib'
634 + case ${with_toolexeclibdir} in
636 + toolexeclibdir='$(toolexecdir)/lib'
639 + toolexeclibdir=${with_toolexeclibdir}
643 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
644 toolexeclibdir='$(libdir)'
645 @@ -10815,7 +10842,7 @@ else
646 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
647 lt_status=$lt_dlunknown
648 cat > conftest.$ac_ext <<_LT_EOF
649 -#line 10818 "configure"
650 +#line 10845 "configure"
651 #include "confdefs.h"
654 @@ -10921,7 +10948,7 @@ else
655 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
656 lt_status=$lt_dlunknown
657 cat > conftest.$ac_ext <<_LT_EOF
658 -#line 10924 "configure"
659 +#line 10955 "configure"
660 #include "confdefs.h"
663 diff --git a/libquadmath/configure b/libquadmath/configure
664 index 76a2c20b7e1..e887071aeb2 100755
665 --- a/libquadmath/configure
666 +++ b/libquadmath/configure
667 @@ -749,6 +749,7 @@ enable_fast_install
670 enable_maintainer_mode
673 enable_generated_files_in_srcdir
674 with_gcc_major_version_only
675 @@ -1408,6 +1409,9 @@ Optional Packages:
676 --with-pic try to use only PIC/non-PIC objects [default=use
678 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
679 + --with-toolexeclibdir=DIR
680 + install libraries built with a cross compiler within
682 --with-gcc-major-version-only
683 use only GCC major number in filesystem paths
685 @@ -10572,7 +10576,7 @@ else
686 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
687 lt_status=$lt_dlunknown
688 cat > conftest.$ac_ext <<_LT_EOF
689 -#line 10575 "configure"
690 +#line 10579 "configure"
691 #include "confdefs.h"
694 @@ -10678,7 +10682,7 @@ else
695 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
696 lt_status=$lt_dlunknown
697 cat > conftest.$ac_ext <<_LT_EOF
698 -#line 10681 "configure"
699 +#line 10689 "configure"
700 #include "confdefs.h"
703 @@ -11917,6 +11921,22 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
704 ac_compiler_gnu=$ac_cv_c_compiler_gnu
708 +# Check whether --with-toolexeclibdir was given.
709 +if test "${with_toolexeclibdir+set}" = set; then :
710 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
714 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
718 + with_toolexeclibdir=no
723 # Calculate toolexeclibdir
724 # Also toolexecdir, though it's only used in toolexeclibdir
725 case ${version_specific_libs} in
726 @@ -11932,7 +11952,14 @@ case ${version_specific_libs} in
727 test x"$with_cross_host" != x"no"; then
728 # Install a library built with a cross compiler in tooldir, not libdir.
729 toolexecdir='$(exec_prefix)/$(target_alias)'
730 - toolexeclibdir='$(toolexecdir)/lib'
731 + case ${with_toolexeclibdir} in
733 + toolexeclibdir='$(toolexecdir)/lib'
736 + toolexeclibdir=${with_toolexeclibdir}
740 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
741 toolexeclibdir='$(libdir)'
742 diff --git a/libsanitizer/configure b/libsanitizer/configure
743 index a3a08d635f4..5f4cdcad38d 100755
744 --- a/libsanitizer/configure
745 +++ b/libsanitizer/configure
746 @@ -767,6 +767,7 @@ enable_multilib
747 enable_version_specific_runtime_libs
748 enable_dependency_tracking
749 enable_maintainer_mode
754 @@ -1425,6 +1426,9 @@ Optional Features:
756 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
757 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
758 + --with-toolexeclibdir=DIR
759 + install libraries built with a cross compiler within
761 --with-pic try to use only PIC/non-PIC objects [default=use
763 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
764 @@ -4773,6 +4777,22 @@ fi
769 +# Check whether --with-toolexeclibdir was given.
770 +if test "${with_toolexeclibdir+set}" = set; then :
771 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
775 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
779 + with_toolexeclibdir=no
784 # Calculate toolexeclibdir
785 # Also toolexecdir, though it's only used in toolexeclibdir
786 case ${version_specific_libs} in
787 @@ -4788,7 +4808,14 @@ case ${version_specific_libs} in
788 test x"$with_cross_host" != x"no"; then
789 # Install a library built with a cross compiler in tooldir, not libdir.
790 toolexecdir='$(exec_prefix)/$(target_alias)'
791 - toolexeclibdir='$(toolexecdir)/lib'
792 + case ${with_toolexeclibdir} in
794 + toolexeclibdir='$(toolexecdir)/lib'
797 + toolexeclibdir=${with_toolexeclibdir}
801 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
802 toolexeclibdir='$(libdir)'
803 @@ -12032,7 +12059,7 @@ else
804 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
805 lt_status=$lt_dlunknown
806 cat > conftest.$ac_ext <<_LT_EOF
807 -#line 12035 "configure"
808 +#line 12062 "configure"
809 #include "confdefs.h"
812 @@ -12138,7 +12165,7 @@ else
813 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
814 lt_status=$lt_dlunknown
815 cat > conftest.$ac_ext <<_LT_EOF
816 -#line 12141 "configure"
817 +#line 12168 "configure"
818 #include "confdefs.h"
821 diff --git a/libssp/configure b/libssp/configure
822 index ee1751d20db..3273cd40ab1 100755
823 --- a/libssp/configure
824 +++ b/libssp/configure
825 @@ -743,6 +743,7 @@ with_pic
830 with_gcc_major_version_only
832 ac_precious_vars='build_alias
833 @@ -1389,6 +1390,9 @@ Optional Packages:
834 --with-pic try to use only PIC/non-PIC objects [default=use
836 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
837 + --with-toolexeclibdir=DIR
838 + install libraries built with a cross compiler within
840 --with-gcc-major-version-only
841 use only GCC major number in filesystem paths
843 @@ -10671,7 +10675,7 @@ else
844 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
845 lt_status=$lt_dlunknown
846 cat > conftest.$ac_ext <<_LT_EOF
847 -#line 10674 "configure"
848 +#line 10678 "configure"
849 #include "confdefs.h"
852 @@ -10777,7 +10781,7 @@ else
853 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
854 lt_status=$lt_dlunknown
855 cat > conftest.$ac_ext <<_LT_EOF
856 -#line 10780 "configure"
857 +#line 10784 "configure"
858 #include "confdefs.h"
861 @@ -11039,6 +11043,22 @@ esac
866 +# Check whether --with-toolexeclibdir was given.
867 +if test "${with_toolexeclibdir+set}" = set; then :
868 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
872 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
876 + with_toolexeclibdir=no
881 # Calculate toolexeclibdir
882 # Also toolexecdir, though it's only used in toolexeclibdir
883 case ${version_specific_libs} in
884 @@ -11054,7 +11074,14 @@ case ${version_specific_libs} in
885 test x"$with_cross_host" != x"no"; then
886 # Install a library built with a cross compiler in tooldir, not libdir.
887 toolexecdir='$(exec_prefix)/$(target_alias)'
888 - toolexeclibdir='$(toolexecdir)/lib'
889 + case ${with_toolexeclibdir} in
891 + toolexeclibdir='$(toolexecdir)/lib'
894 + toolexeclibdir=${with_toolexeclibdir}
898 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
899 toolexeclibdir='$(libdir)'
900 diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
901 index de8390703e2..88de3f728d4 100755
902 --- a/libstdc++-v3/configure
903 +++ b/libstdc++-v3/configure
904 @@ -903,6 +903,7 @@ enable_libstdcxx_threads
905 enable_libstdcxx_filesystem_ts
907 enable_version_specific_runtime_libs
909 with_gcc_major_version_only
911 ac_precious_vars='build_alias
912 @@ -1623,6 +1624,9 @@ Optional Packages:
913 set the std::string ABI to use by default
914 --with-gxx-include-dir=DIR
915 installation directory for include files
916 + --with-toolexeclibdir=DIR
917 + install libraries built with a cross compiler within
919 --with-gcc-major-version-only
920 use only GCC major number in filesystem paths
922 @@ -11606,7 +11610,7 @@ else
923 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
924 lt_status=$lt_dlunknown
925 cat > conftest.$ac_ext <<_LT_EOF
926 -#line 11609 "configure"
927 +#line 11613 "configure"
928 #include "confdefs.h"
931 @@ -11712,7 +11716,7 @@ else
932 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
933 lt_status=$lt_dlunknown
934 cat > conftest.$ac_ext <<_LT_EOF
935 -#line 11715 "configure"
936 +#line 11723 "configure"
937 #include "confdefs.h"
940 @@ -15398,7 +15402,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
941 # Fake what AC_TRY_COMPILE does.
943 cat > conftest.$ac_ext << EOF
944 -#line 15401 "configure"
945 +#line 15409 "configure"
948 typedef bool atomic_type;
949 @@ -15433,7 +15437,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
952 cat > conftest.$ac_ext << EOF
953 -#line 15436 "configure"
954 +#line 15440 "configure"
957 typedef short atomic_type;
958 @@ -15468,7 +15472,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
961 cat > conftest.$ac_ext << EOF
962 -#line 15471 "configure"
963 +#line 15475 "configure"
966 // NB: _Atomic_word not necessarily int.
967 @@ -15504,7 +15508,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
970 cat > conftest.$ac_ext << EOF
971 -#line 15507 "configure"
972 +#line 15511 "configure"
975 typedef long long atomic_type;
976 @@ -15585,7 +15589,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
977 # unnecessary for this test.
979 cat > conftest.$ac_ext << EOF
980 -#line 15588 "configure"
981 +#line 15592 "configure"
985 @@ -15627,7 +15631,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
986 # unnecessary for this test.
988 cat > conftest.$ac_ext << EOF
989 -#line 15630 "configure"
990 +#line 15634 "configure"
991 template<typename T1, typename T2>
993 { typedef T2 type; };
994 @@ -15661,7 +15665,7 @@ $as_echo "$enable_int128" >&6; }
997 cat > conftest.$ac_ext << EOF
998 -#line 15664 "configure"
999 +#line 15668 "configure"
1000 template<typename T1, typename T2>
1002 { typedef T2 type; };
1003 @@ -81674,6 +81678,19 @@ fi
1004 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs" >&5
1005 $as_echo "$version_specific_libs" >&6; }
1007 +# Check whether --with-toolexeclibdir was given.
1008 +if test "${with_toolexeclibdir+set}" = set; then :
1009 + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
1013 + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
1017 + with_toolexeclibdir=no
1020 # Default case for install directory for include files.
1021 if test $version_specific_libs = no && test $gxx_include_dir = no; then
1022 gxx_include_dir='include/c++/${gcc_version}'
1023 @@ -81704,7 +81721,14 @@ $as_echo "$version_specific_libs" >&6; }
1024 if test -n "$with_cross_host" &&
1025 test x"$with_cross_host" != x"no"; then
1026 glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
1027 - glibcxx_toolexeclibdir='${toolexecdir}/lib'
1028 + case ${with_toolexeclibdir} in
1030 + glibcxx_toolexeclibdir='${toolexecdir}/lib'
1033 + glibcxx_toolexeclibdir=${with_toolexeclibdir}
1037 glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
1038 glibcxx_toolexeclibdir='${libdir}'