Skip to content

Commit

Permalink
Add `--with-toolexeclibdir=' configuration option
Browse files Browse the repository at this point in the history
Provide means, in the form of a `--with-toolexeclibdir=' configuration
option, to override the default installation directory for target
libraries, otherwise known as $toolexeclibdir.  This is so that it is
possible to get newly-built libraries, particularly the shared ones,
installed in a common place, so that they can be readily used by the
target system as their host libraries, possibly over NFS, without a need
to manually copy them over from the currently hardcoded location they
would otherwise be installed in.

In the presence of the `--enable-version-specific-runtime-libs' option
and for configurations building native GCC the option is ignored.

	config/
	* toolexeclibdir.m4: New file.

	gcc/
	* doc/install.texi (Cross-Compiler-Specific Options): Document
	`--with-toolexeclibdir' option.

	libada/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libatomic/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libffi/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libgcc/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libgfortran/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libgomp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libhsail-rt/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libitm/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libobjc/
	* Makefile.in (aclocal_deps): Add `toolexeclibdir.m4'.
	* aclocal.m4: Include `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	liboffloadmic/
	* plugin/configure.ac: Handle `--with-toolexeclibdir='.
	* plugin/Makefile.in: Regenerate.
	* plugin/aclocal.m4: Regenerate.
	* plugin/configure: Regenerate.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libphobos/
	* m4/druntime.m4: Handle `--with-toolexeclibdir='.
	* m4/Makefile.in: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libquadmath/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libsanitizer/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

	libssp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libstdc++-v3/
	* acinclude.m4: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libvtv/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	zlib/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
  • Loading branch information
Maciej W. Rozycki committed Jan 24, 2020
1 parent e3fe007 commit e8e6697
Show file tree
Hide file tree
Showing 119 changed files with 1,009 additions and 87 deletions.
4 changes: 4 additions & 0 deletions config/ChangeLog
@@ -1,3 +1,7 @@
2020-01-24 Maciej W. Rozycki <macro@wdc.com>

* toolexeclibdir.m4: New file.

2019-09-10 Christophe Lyon <christophe.lyon@st.com>

* futex.m4: Handle *-uclinux*.
Expand Down
31 changes: 31 additions & 0 deletions config/toolexeclibdir.m4
@@ -0,0 +1,31 @@
dnl toolexeclibdir override support.
dnl Copyright (C) 2020 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; see the file COPYING3. If not see
dnl <http://www.gnu.org/licenses/>.

AC_DEFUN([GCC_WITH_TOOLEXECLIBDIR],
[AC_ARG_WITH(toolexeclibdir,
[AS_HELP_STRING([--with-toolexeclibdir=DIR],
[install libraries built with a cross compiler within DIR])],
[dnl
case ${with_toolexeclibdir} in
/)
;;
*/)
with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
;;
esac],
[with_toolexeclibdir=no])
])
5 changes: 5 additions & 0 deletions gcc/ChangeLog
@@ -1,3 +1,8 @@
2020-01-24 Maciej W. Rozycki <macro@wdc.com>

* doc/install.texi (Cross-Compiler-Specific Options): Document
`--with-toolexeclibdir' option.

2020-01-24 Hans-Peter Nilsson <hp@axis.com>

* target.def (flags_regnum): Also mention effect on delay slot filling.
Expand Down
4 changes: 4 additions & 0 deletions gcc/doc/install.texi
Expand Up @@ -2207,6 +2207,10 @@ target if target binutils supported.
The following options only apply to building cross compilers.

@table @code
@item --with-toolexeclibdir=@var{dir}
Specify the installation directory for libraries built with a cross compiler.
The default is @option{$@{gcc_tooldir@}/lib}.

@item --with-sysroot
@itemx --with-sysroot=@var{dir}
Tells GCC to consider @var{dir} as the root of a tree that contains
Expand Down
6 changes: 6 additions & 0 deletions libada/ChangeLog
@@ -1,3 +1,9 @@
2020-01-24 Maciej W. Rozycki <macro@wdc.com>

* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
* configure.ac: Handle `--with-toolexeclibdir='.
* configure: Regenerate.

2020-01-01 Jakub Jelinek <jakub@redhat.com>

Update copyright years.
Expand Down
1 change: 1 addition & 0 deletions libada/Makefile.in
Expand Up @@ -186,6 +186,7 @@ configure_deps = \
$(srcdir)/../config/multi.m4 \
$(srcdir)/../config/override.m4 \
$(srcdir)/../config/picflag.m4 \
$(srcdir)/../config/toolexeclibdir.m4 \
$(srcdir)/../config/unwind_ipinfo.m4

$(srcdir)/configure: @MAINT@ $(configure_deps)
Expand Down
29 changes: 28 additions & 1 deletion libada/configure
Expand Up @@ -704,6 +704,7 @@ enable_option_checking
with_build_libsubdir
enable_version_specific_runtime_libs
enable_maintainer_mode
with_toolexeclibdir
enable_multilib
enable_shared
with_system_libunwind
Expand Down Expand Up @@ -1339,6 +1340,9 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-build-libsubdir=DIR Directory where to find libraries for build system
--with-toolexeclibdir=DIR
install libraries built with a cross compiler within
DIR
--with-system-libunwind use installed libunwind
--with-gcc-major-version-only
use only GCC major number in filesystem paths
Expand Down Expand Up @@ -2249,6 +2253,22 @@ else
fi
# Check whether --with-toolexeclibdir was given.
if test "${with_toolexeclibdir+set}" = set; then :
withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
/)
;;
*/)
with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
;;
esac
else
with_toolexeclibdir=no
fi
# Default to --enable-multilib
# Check whether --enable-multilib was given.
if test "${enable_multilib+set}" = set; then :
Expand Down Expand Up @@ -2301,7 +2321,14 @@ case ${enable_version_specific_runtime_libs} in
test x"$with_cross_host" != x"no"; then
# Install a library built with a cross compiler in tooldir, not libdir.
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
case ${with_toolexeclibdir} in
no)
toolexeclibdir='$(toolexecdir)/lib'
;;
*)
toolexeclibdir=${with_toolexeclibdir}
;;
esac
else
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
toolexeclibdir='$(libdir)'
Expand Down
12 changes: 11 additions & 1 deletion libada/configure.ac
Expand Up @@ -19,6 +19,7 @@ sinclude(../config/acx.m4)
sinclude(../config/multi.m4)
sinclude(../config/override.m4)
sinclude(../config/picflag.m4)
sinclude(../config/toolexeclibdir.m4)
sinclude(../config/unwind_ipinfo.m4)

AC_INIT
Expand Down Expand Up @@ -67,6 +68,8 @@ AC_ARG_ENABLE([maintainer-mode],
[MAINT='#'])
AC_SUBST([MAINT])dnl

GCC_WITH_TOOLEXECLIBDIR

AM_ENABLE_MULTILIB(, ..)
# Calculate toolexeclibdir
# Also toolexecdir, though it's only used in toolexeclibdir
Expand All @@ -83,7 +86,14 @@ case ${enable_version_specific_runtime_libs} in
test x"$with_cross_host" != x"no"; then
# Install a library built with a cross compiler in tooldir, not libdir.
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
case ${with_toolexeclibdir} in
no)
toolexeclibdir='$(toolexecdir)/lib'
;;
*)
toolexeclibdir=${with_toolexeclibdir}
;;
esac
else
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
toolexeclibdir='$(libdir)'
Expand Down
8 changes: 8 additions & 0 deletions libatomic/ChangeLog
@@ -1,3 +1,11 @@
2020-01-24 Maciej W. Rozycki <macro@wdc.com>

* configure.ac: Handle `--with-toolexeclibdir='.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* testsuite/Makefile.in: Regenerate.

2020-01-01 Jakub Jelinek <jakub@redhat.com>

Update copyright years.
Expand Down
1 change: 1 addition & 0 deletions libatomic/Makefile.in
Expand Up @@ -106,6 +106,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/stdint.m4 \
$(top_srcdir)/../config/toolexeclibdir.m4 \
$(top_srcdir)/../config/warnings.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
Expand Down
1 change: 1 addition & 0 deletions libatomic/aclocal.m4
Expand Up @@ -1194,6 +1194,7 @@ m4_include([../config/lthostflags.m4])
m4_include([../config/multi.m4])
m4_include([../config/override.m4])
m4_include([../config/stdint.m4])
m4_include([../config/toolexeclibdir.m4])
m4_include([../config/warnings.m4])
m4_include([../ltoptions.m4])
m4_include([../ltsugar.m4])
Expand Down
33 changes: 30 additions & 3 deletions libatomic/configure
Expand Up @@ -794,6 +794,7 @@ enable_version_specific_runtime_libs
enable_generated_files_in_srcdir
enable_silent_rules
enable_multilib
with_toolexeclibdir
enable_dependency_tracking
enable_shared
enable_static
Expand Down Expand Up @@ -1459,6 +1460,9 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-toolexeclibdir=DIR
install libraries built with a cross compiler within
DIR
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
Expand Down Expand Up @@ -3343,6 +3347,22 @@ fi
ac_config_commands="$ac_config_commands default-1"



# Check whether --with-toolexeclibdir was given.
if test "${with_toolexeclibdir+set}" = set; then :
withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
/)
;;
*/)
with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
;;
esac
else
with_toolexeclibdir=no
fi



# Calculate toolexeclibdir
# Also toolexecdir, though it's only used in toolexeclibdir
case ${enable_version_specific_runtime_libs} in
Expand All @@ -3358,7 +3378,14 @@ case ${enable_version_specific_runtime_libs} in
test x"$with_cross_host" != x"no"; then
# Install a library built with a cross compiler in tooldir, not libdir.
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
case ${with_toolexeclibdir} in
no)
toolexeclibdir='$(toolexecdir)/lib'
;;
*)
toolexeclibdir=${with_toolexeclibdir}
;;
esac
else
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
toolexeclibdir='$(libdir)'
Expand Down Expand Up @@ -11360,7 +11387,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11363 "configure"
#line 11390 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -11466,7 +11493,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11469 "configure"
#line 11496 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down
11 changes: 10 additions & 1 deletion libatomic/configure.ac
Expand Up @@ -84,6 +84,8 @@ target_alias=${target_alias-$host_alias}
AM_INIT_AUTOMAKE([1.9.0 foreign no-dist -Wall -Wno-portability -Wno-override])
AM_ENABLE_MULTILIB(, ..)

GCC_WITH_TOOLEXECLIBDIR

# Calculate toolexeclibdir
# Also toolexecdir, though it's only used in toolexeclibdir
case ${enable_version_specific_runtime_libs} in
Expand All @@ -99,7 +101,14 @@ case ${enable_version_specific_runtime_libs} in
test x"$with_cross_host" != x"no"; then
# Install a library built with a cross compiler in tooldir, not libdir.
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
case ${with_toolexeclibdir} in
no)
toolexeclibdir='$(toolexecdir)/lib'
;;
*)
toolexeclibdir=${with_toolexeclibdir}
;;
esac
else
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
toolexeclibdir='$(libdir)'
Expand Down
1 change: 1 addition & 0 deletions libatomic/testsuite/Makefile.in
Expand Up @@ -97,6 +97,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/stdint.m4 \
$(top_srcdir)/../config/toolexeclibdir.m4 \
$(top_srcdir)/../config/warnings.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
Expand Down
10 changes: 10 additions & 0 deletions libffi/ChangeLog
@@ -1,3 +1,13 @@
2020-01-24 Maciej W. Rozycki <macro@wdc.com>

* configure.ac: Handle `--with-toolexeclibdir='.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* include/Makefile.in: Regenerate.
* man/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

2019-09-27 Maciej W. Rozycki <macro@wdc.com>

* configure: Regenerate.
Expand Down
1 change: 1 addition & 0 deletions libffi/Makefile.in
Expand Up @@ -103,6 +103,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/toolexeclibdir.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
Expand Down
1 change: 1 addition & 0 deletions libffi/aclocal.m4
Expand Up @@ -1193,6 +1193,7 @@ m4_include([../config/depstand.m4])
m4_include([../config/lead-dot.m4])
m4_include([../config/multi.m4])
m4_include([../config/override.m4])
m4_include([../config/toolexeclibdir.m4])
m4_include([../libtool.m4])
m4_include([../ltoptions.m4])
m4_include([../ltsugar.m4])
Expand Down

0 comments on commit e8e6697

Please sign in to comment.