Commit 13681906 by Maciej W. Rozycki Committed by Maciej W. Rozycki

libada: Respect `--enable-version-specific-runtime-libs'

Respect the `--enable-version-specific-runtime-libs' configuration
option in libada/, so that shared gnatlib libraries will be installed
in non-version-specific $(toolexeclibdir) if requested.  In a
cross-compilation environment this helps setting up a consistent
sysroot, which can then be shared between the host and the target
system.

This lets one have `libgnarl-10.so' and `libgnat-10.so' installed in say
/usr/lib and /usr/$(target_alias)/lib for a native and a cross-build
respectively, rather than in /usr/lib/gcc/$(target_alias)/10.0.0/adalib.

Update the settings of $(toolexecdir) and $(toolexeclibdir), unused till
now, to keep the current arrangement in the version-specific case and
make the new option to be enabled by default, unlike with the other
target libraries, so as to keep existing people's build infrastructure
unaffected.

Of course if someone does use `--disable-version-specific-runtime-libs'
already, then the installation location of shared gnatlib libraries will
change, but presumably this is what they do want anyway as the current
situation where the option is ignored in libada/ only is an anomaly
really rather than one that is expected or desired.

	gcc/ada/
	* gcc-interface/Makefile.in (ADA_RTL_DSO_DIR): New variable.
	(install-gnatlib): Use it in place of ADA_RTL_OBJ_DIR for shared
	library installation.

	libada/
	* Makefile.in (toolexecdir, toolexeclibdir): New variables.
	(LIBADA_FLAGS_TO_PASS): Add `toolexeclibdir'.
	* configure.ac: Add `--enable-version-specific-runtime-libs'.
	Update version-specific `toolexecdir' and `toolexeclibdir' from
	ADA_RTL_OBJ_DIR from gcc/ada/gcc-interface/Makefile.in.
	* configure: Regenerate.

From-SVN: r276424
parent 8951374d
2019-10-01 Maciej W. Rozycki <macro@wdc.com> 2019-10-01 Maciej W. Rozycki <macro@wdc.com>
* gcc-interface/Makefile.in (ADA_RTL_DSO_DIR): New variable.
(install-gnatlib): Use it in place of ADA_RTL_OBJ_DIR for shared
library installation.
2019-10-01 Maciej W. Rozycki <macro@wdc.com>
* gcc-interface/Make-lang.in (ada.install-common): Split into... * gcc-interface/Make-lang.in (ada.install-common): Split into...
(gnat-install-tools, gnat-install-lib): ... these. (gnat-install-tools, gnat-install-lib): ... these.
......
...@@ -534,15 +534,15 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs ...@@ -534,15 +534,15 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs
for file in gnat gnarl; do \ for file in gnat gnarl; do \
if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \ if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
$(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \ $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(DESTDIR)$(ADA_RTL_OBJ_DIR); \ $(DESTDIR)$(ADA_RTL_DSO_DIR); \
fi; \ fi; \
if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \ if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
$(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \ $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \ $(DESTDIR)$(ADA_RTL_DSO_DIR)/lib$${file}$(soext); \
fi; \ fi; \
if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \ if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
$(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \ $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
$(DESTDIR)$(ADA_RTL_OBJ_DIR); \ $(DESTDIR)$(ADA_RTL_DSO_DIR); \
fi; \ fi; \
done done
# This copy must be done preserving the date on the original file. # This copy must be done preserving the date on the original file.
...@@ -882,6 +882,7 @@ b_gnatm.o : b_gnatm.adb ...@@ -882,6 +882,7 @@ b_gnatm.o : b_gnatm.adb
ADA_INCLUDE_DIR = $(libsubdir)/adainclude ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
ADA_RTL_DSO_DIR = $(toolexeclibdir)
# Special flags # Special flags
......
2019-10-01 Maciej W. Rozycki <macro@wdc.com>
* Makefile.in (toolexecdir, toolexeclibdir): New variables.
(LIBADA_FLAGS_TO_PASS): Add `toolexeclibdir'.
* configure.ac: Add `--enable-version-specific-runtime-libs'.
Update version-specific `toolexecdir' and `toolexeclibdir' from
ADA_RTL_OBJ_DIR from gcc/ada/gcc-interface/Makefile.in.
* configure: Regenerate.
2019-01-01 Jakub Jelinek <jakub@redhat.com> 2019-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years. Update copyright years.
......
...@@ -38,6 +38,8 @@ target = @target@ ...@@ -38,6 +38,8 @@ target = @target@
prefix = @prefix@ prefix = @prefix@
# Nonstandard autoconf-set variables. # Nonstandard autoconf-set variables.
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
enable_shared = @enable_shared@ enable_shared = @enable_shared@
LN_S=@LN_S@ LN_S=@LN_S@
...@@ -88,6 +90,7 @@ LIBADA_FLAGS_TO_PASS = \ ...@@ -88,6 +90,7 @@ LIBADA_FLAGS_TO_PASS = \
"TRACE=$(TRACE)" \ "TRACE=$(TRACE)" \
"MULTISUBDIR=$(MULTISUBDIR)" \ "MULTISUBDIR=$(MULTISUBDIR)" \
"libsubdir=$(libsubdir)" \ "libsubdir=$(libsubdir)" \
"toolexeclibdir=$(toolexeclibdir)" \
"objext=$(objext)" \ "objext=$(objext)" \
"prefix=$(prefix)" \ "prefix=$(prefix)" \
"exeext=.exeext.should.not.be.used " \ "exeext=.exeext.should.not.be.used " \
......
...@@ -702,6 +702,7 @@ ac_subst_files='' ...@@ -702,6 +702,7 @@ ac_subst_files=''
ac_user_opts=' ac_user_opts='
enable_option_checking enable_option_checking
with_build_libsubdir with_build_libsubdir
enable_version_specific_runtime_libs
enable_maintainer_mode enable_maintainer_mode
enable_multilib enable_multilib
enable_shared enable_shared
...@@ -1325,6 +1326,9 @@ Optional Features: ...@@ -1325,6 +1326,9 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
--enable-maintainer-mode --enable-maintainer-mode
enable make rules and dependencies not useful (and enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer sometimes confusing) to the casual installer
...@@ -2215,6 +2219,22 @@ target_subdir=${target_noncanonical} ...@@ -2215,6 +2219,22 @@ target_subdir=${target_noncanonical}
# Command-line options. # Command-line options.
# Check whether --enable-version-specific-runtime-libs was given.
if test "${enable_version_specific_runtime_libs+set}" = set; then :
enableval=$enable_version_specific_runtime_libs; case "$enableval" in
yes|no)
;;
*)
as_fn_error $? "--enable-version-specific-runtime-libs must be yes or no" "$LINENO" 5
;;
esac
else
enable_version_specific_runtime_libs=yes
fi
# Very limited version of AC_MAINTAINER_MODE. # Very limited version of AC_MAINTAINER_MODE.
# Check whether --enable-maintainer-mode was given. # Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then : if test "${enable_maintainer_mode+set}" = set; then :
...@@ -2273,8 +2293,8 @@ case ${enable_version_specific_runtime_libs} in ...@@ -2273,8 +2293,8 @@ case ${enable_version_specific_runtime_libs} in
# Need the gcc compiler version to know where to install libraries # Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option # and header files if --enable-version-specific-runtime-libs option
# is selected. # is selected.
toolexecdir='$(libdir)/gcc/$(target_alias)' toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' toolexeclibdir='$(toolexecdir)/$(version)$(MULTISUBDIR)/adalib'
;; ;;
no) no)
if test -n "$with_cross_host" && if test -n "$with_cross_host" &&
...@@ -2295,7 +2315,6 @@ case ${enable_version_specific_runtime_libs} in ...@@ -2295,7 +2315,6 @@ case ${enable_version_specific_runtime_libs} in
esac esac
#TODO: toolexeclibdir is currently disregarded
# Check the compiler. # Check the compiler.
# The same as in boehm-gc and libstdc++. Have to borrow it from there. # The same as in boehm-gc and libstdc++. Have to borrow it from there.
......
...@@ -38,6 +38,21 @@ ACX_NONCANONICAL_TARGET ...@@ -38,6 +38,21 @@ ACX_NONCANONICAL_TARGET
GCC_TOPLEV_SUBDIRS GCC_TOPLEV_SUBDIRS
# Command-line options. # Command-line options.
AC_ARG_ENABLE(version-specific-runtime-libs,
[AS_HELP_STRING([--enable-version-specific-runtime-libs],
[specify that runtime libraries should be
installed in a compiler-specific directory])],
[case "$enableval" in
yes|no)
;;
*)
AC_MSG_ERROR([--enable-version-specific-runtime-libs must be yes or no])
;;
esac],
[enable_version_specific_runtime_libs=yes]
)
# Very limited version of AC_MAINTAINER_MODE. # Very limited version of AC_MAINTAINER_MODE.
AC_ARG_ENABLE([maintainer-mode], AC_ARG_ENABLE([maintainer-mode],
[AC_HELP_STRING([--enable-maintainer-mode], [AC_HELP_STRING([--enable-maintainer-mode],
...@@ -60,8 +75,8 @@ case ${enable_version_specific_runtime_libs} in ...@@ -60,8 +75,8 @@ case ${enable_version_specific_runtime_libs} in
# Need the gcc compiler version to know where to install libraries # Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option # and header files if --enable-version-specific-runtime-libs option
# is selected. # is selected.
toolexecdir='$(libdir)/gcc/$(target_alias)' toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' toolexeclibdir='$(toolexecdir)/$(version)$(MULTISUBDIR)/adalib'
;; ;;
no) no)
if test -n "$with_cross_host" && if test -n "$with_cross_host" &&
...@@ -82,7 +97,6 @@ case ${enable_version_specific_runtime_libs} in ...@@ -82,7 +97,6 @@ case ${enable_version_specific_runtime_libs} in
esac esac
AC_SUBST(toolexecdir) AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir) AC_SUBST(toolexeclibdir)
#TODO: toolexeclibdir is currently disregarded
# Check the compiler. # Check the compiler.
# The same as in boehm-gc and libstdc++. Have to borrow it from there. # The same as in boehm-gc and libstdc++. Have to borrow it from there.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment