Commit b21d216c by Andreas Franck Committed by DJ Delorie

configure.in: Add AC_ARG_PROGRAM to support program name transformation with --program-prefix...

* configure.in: Add AC_ARG_PROGRAM to support program name
transformation with --program-prefix, --program-suffix and
--program-transform-name.
* Makefile.in (GCC_INSTALL_NAME, CPP_INSTALL_NAME,
PROTOIZE_INSTALL_NAME, UNPROTOIZE_INSTALL_NAME, GCOV_INSTALL_NAME,
GCCBUG_INSTALL_NAME, GCC_CROSS_NAME, CPP_CROSS_NAME,
PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): Handle
program_transform_name the way suggested by autoconf.
(GCC_TARGET_INSTALL_NAME): Define.
(install-driver): Use the transformed target alias name.


* Make-lang.in (CXX_INSTALL_NAME, GXX_CROSS_NAME,
DEMANGLER_CROSS_NAME): Handle program_transform_name the way
suggested by autoconf.
(GXX_TARGET_INSTALL_NAME, CXX_TARGET_INSTALL_NAME): Define.
(c++.install-common): Use the transformed target alias names.

* Make-lang.in (G77_INSTALL_NAME, G77_CROSS_NAME): Handle
program_transform_name the way suggested by autoconf.

* Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
program_transform_name the way suggested by autoconf.
(java.install-common): Also transform auxiliary program names with
program_transform_name.

From-SVN: r46856
parent c8a14e0e
2001-11-08 Andreas Franck <afranck@gmx.de>
* configure.in: Add AC_ARG_PROGRAM to support program name
transformation with --program-prefix, --program-suffix and
--program-transform-name.
* configure: Regenerated.
* Makefile.in (GCC_INSTALL_NAME, CPP_INSTALL_NAME,
PROTOIZE_INSTALL_NAME, UNPROTOIZE_INSTALL_NAME, GCOV_INSTALL_NAME,
GCCBUG_INSTALL_NAME, GCC_CROSS_NAME, CPP_CROSS_NAME,
PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): Handle
program_transform_name the way suggested by autoconf.
(GCC_TARGET_INSTALL_NAME): Define.
(install-driver): Use the transformed target alias name.
2001-11-08 Richard Henderson <rth@redhat.com> 2001-11-08 Richard Henderson <rth@redhat.com>
* config/mips/mips.c (save_restore_insns): Remove GP from the * config/mips/mips.c (save_restore_insns): Remove GP from the
......
...@@ -482,18 +482,19 @@ HOST_DOPRINT=$(DOPRINT) ...@@ -482,18 +482,19 @@ HOST_DOPRINT=$(DOPRINT)
HOST_STRSTR=$(STRSTR) HOST_STRSTR=$(STRSTR)
# Actual name to use when installing a native compiler. # Actual name to use when installing a native compiler.
GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t` GCC_INSTALL_NAME = `echo gcc|sed '$(program_transform_name)'`
CPP_INSTALL_NAME = `t='$(program_transform_name)'; echo cpp | sed -e $$t` GCC_TARGET_INSTALL_NAME = $(target_alias)-`echo gcc|sed '$(program_transform_name)'`
PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t` CPP_INSTALL_NAME = `echo cpp|sed '$(program_transform_name)'`
UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t` PROTOIZE_INSTALL_NAME = `echo protoize|sed '$(program_transform_name)'`
GCOV_INSTALL_NAME = `t='$(program_transform_name)'; echo gcov | sed -e $$t` UNPROTOIZE_INSTALL_NAME = `echo unprotoize|sed '$(program_transform_name)'`
GCCBUG_INSTALL_NAME = `t='$(program_transform_name)'; echo gccbug | sed -e $$t` GCOV_INSTALL_NAME = `echo gcov|sed '$(program_transform_name)'`
GCCBUG_INSTALL_NAME = `echo gccbug|sed '$(program_transform_name)'`
# Actual name to use when installing a cross-compiler. # Actual name to use when installing a cross-compiler.
GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t` GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'`
CPP_CROSS_NAME = `t='$(program_transform_cross_name)'; echo cpp | sed -e $$t` CPP_CROSS_NAME = `echo cpp|sed '$(program_transform_cross_name)'`
PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t` PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'`
UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t` UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'`
# Choose the real default target. # Choose the real default target.
ALL=all.internal ALL=all.internal
...@@ -2650,7 +2651,7 @@ install-driver: installdirs xgcc$(exeext) ...@@ -2650,7 +2651,7 @@ install-driver: installdirs xgcc$(exeext)
$(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \ rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \
$(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \ $(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \
mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \ mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(GCC_TARGET_INSTALL_NAME)$(exeext); \
fi fi
# Install the info files. # Install the info files.
......
...@@ -335,6 +335,9 @@ AC_SUBST(enable_shared) ...@@ -335,6 +335,9 @@ AC_SUBST(enable_shared)
# Determine the host, build, and target systems # Determine the host, build, and target systems
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# Set program_transform_name
AC_ARG_PROGRAM
# Find the native compiler # Find the native compiler
AC_PROG_CC AC_PROG_CC
AC_PROG_CC_C_O AC_PROG_CC_C_O
......
2001-11-08 Andreas Franck <afranck@gmx.de>
* Make-lang.in (CXX_INSTALL_NAME, GXX_CROSS_NAME,
DEMANGLER_CROSS_NAME): Handle program_transform_name the way
suggested by autoconf.
(GXX_TARGET_INSTALL_NAME, CXX_TARGET_INSTALL_NAME): Define.
(c++.install-common): Use the transformed target alias names.
2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk> 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk>
* Make-lang.in: Update. * Make-lang.in: Update.
......
...@@ -38,14 +38,16 @@ ...@@ -38,14 +38,16 @@
# - define the names for selecting the language in LANGUAGES. # - define the names for selecting the language in LANGUAGES.
# Actual names to use when installing a native compiler. # Actual names to use when installing a native compiler.
CXX_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t` CXX_INSTALL_NAME = `echo c++|sed '$(program_transform_name)'`
GXX_INSTALL_NAME = `t='$(program_transform_name)'; echo g++ | sed $$t` GXX_INSTALL_NAME = `echo g++|sed '$(program_transform_name)'`
DEMANGLER_INSTALL_NAME = `t='$(program_transform_name)'; echo c++filt | sed $$t` DEMANGLER_INSTALL_NAME = `echo c++filt|sed '$(program_transform_name)'`
CXX_TARGET_INSTALL_NAME = $(target_alias)-`echo c++|sed '$(program_transform_name)'`
GXX_TARGET_INSTALL_NAME = $(target_alias)-`echo g++|sed '$(program_transform_name)'`
# Actual names to use when installing a cross-compiler. # Actual names to use when installing a cross-compiler.
CXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t` CXX_CROSS_NAME = `echo c++|sed '$(program_transform_cross_name)'`
GXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g++ | sed $$t` GXX_CROSS_NAME = `echo g++|sed '$(program_transform_cross_name)'`
DEMANGLER_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++filt | sed $$t` DEMANGLER_CROSS_NAME = `echo c++filt|sed '$(program_transform_cross_name)'`
# The name to use for the demangler program. # The name to use for the demangler program.
DEMANGLER_PROG = c++filt$(exeext) DEMANGLER_PROG = c++filt$(exeext)
...@@ -162,10 +164,10 @@ c++.install-common: installdirs ...@@ -162,10 +164,10 @@ c++.install-common: installdirs
chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \ chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \ rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
$(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \ $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
rm -f $(bindir)/$(target_alias)-g++$(exeext); \ rm -f $(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
$(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-g++$(exeext); \ $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
rm -f $(bindir)/$(target_alias)-c++$(exeext); \ rm -f $(bindir)/$(CXX_TARGET_INSTALL_NAME)$(exeext); \
$(LN) $(bindir)/$(CXX_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-c++$(exeext); \ $(LN) $(bindir)/$(CXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_TARGET_INSTALL_NAME)$(exeext); \
fi ; \ fi ; \
if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \ if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
if [ -f g++-cross$(exeext) ] ; then \ if [ -f g++-cross$(exeext) ] ; then \
......
...@@ -363,6 +363,51 @@ the installation directory for G++ header files. The default is ...@@ -363,6 +363,51 @@ the installation directory for G++ header files. The default is
@end table @end table
@item --program-prefix=@var{prefix}
GCC supports some transformations of the names of its programs when
installing them. This option prepends @var{prefix} to the names of
programs to install in @var{bindir} (see above). For example, specifying
@option{--program-prefix=foo-} would result in @samp{gcc}
being installed as @file{/usr/local/bin/foo-gcc}.
@item --program-suffix=@var{suffix}
Appends @var{suffix} to the names of programs to install in @var{bindir}
(see above). For example, specifying @option{--program-suffix=-3.1}
would result in @samp{gcc} being installed as
@file{/usr/local/bin/gcc-3.1}.
@item --program-transform-name=@var{pattern}
Applies the @samp{sed} script @var{pattern} to be applied to the names
of programs to install in @var{bindir} (see above). @var{pattern} has to
consist of one or more basic @samp{sed} editing commands, separated by
semicolons. For example, if you want the @samp{gcc} program name to be
transformed to the installed program @file{/usr/local/bin/myowngcc} and
the @samp{g++} program name to be transformed to
@file{/usr/local/bin/gspecial++} without changing other program names,
you could use the pattern
@option{--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'}
to achieve this effect.
All three options can be combined and used together, resulting in more
complex conversion patterns. As a basic rule, @var{prefix} (and
@var{suffix}) are prepended (appended) before further transformations
can happen with a special transformation script @var{pattern}.
As currently implemented, this options only take effect for native
builds; cross compiler binaries' names are not transformed even when a
transformation is explicitly asked for by one of this options.
For native builds, some of the installed programs are also installed
with the target alias in front of their name, as in
@samp{i686-pc-linux-gnu-gcc}. All of the above transformations happen
before the target alias is prepended to the name - so, specifying
@option{--program-prefix=foo-} and @option{program-suffix=-3.1}, the
resulting binary would be installed as
@file{/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1}.
As a last shortcoming, none of the installed CHILL and Ada programs are
transformed yet, which will be fixed in some time.
@item --with-local-prefix=@var{dirname} @item --with-local-prefix=@var{dirname}
Specify the Specify the
installation directory for local include files. The default is installation directory for local include files. The default is
......
2001-11-08 Andreas Franck <afranck@gmx.de>
* Make-lang.in (G77_INSTALL_NAME, G77_CROSS_NAME): Handle
program_transform_name the way suggested by autoconf.
2001-11-08 Toon Moene <toon@moene.indiv.nluug.nl> 2001-11-08 Toon Moene <toon@moene.indiv.nluug.nl>
* Make-lang.in: Add rules for building g77.1. * Make-lang.in: Add rules for building g77.1.
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
# $(srcdir) must be set to the gcc/ source directory (not gcc/f/). # $(srcdir) must be set to the gcc/ source directory (not gcc/f/).
# #
# Actual name to use when installing a native compiler. # Actual name to use when installing a native compiler.
G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t` G77_INSTALL_NAME = `echo g77|sed '$(program_transform_name)'`
# Actual name to use when installing a cross-compiler. # Actual name to use when installing a cross-compiler.
G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t` G77_CROSS_NAME = `echo g77|sed '$(program_transform_cross_name)'`
# Some versions of `touch' (such as the version on Solaris 2.8) # Some versions of `touch' (such as the version on Solaris 2.8)
# do not correctly set the timestamp due to buggy versions of `utime' # do not correctly set the timestamp due to buggy versions of `utime'
......
2001-11-08 Andreas Franck <afranck@gmx.de>
* Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
program_transform_name the way suggested by autoconf.
(java.install-common): Also transform auxiliary program names with
program_transform_name.
2001-11-08 Tom Tromey <tromey@cygnus.com> 2001-11-08 Tom Tromey <tromey@cygnus.com>
* parse.y (trap_overflow_corner_case): New rule. * parse.y (trap_overflow_corner_case): New rule.
......
...@@ -42,10 +42,10 @@ ...@@ -42,10 +42,10 @@
# - define the names for selecting the language in LANGUAGES. # - define the names for selecting the language in LANGUAGES.
# Actual names to use when installing a native compiler. # Actual names to use when installing a native compiler.
JAVA_INSTALL_NAME = `t='$(program_transform_name)'; echo gcj | sed $$t` JAVA_INSTALL_NAME = `echo gcj|sed '$(program_transform_name)'`
# Actual names to use when installing a cross-compiler. # Actual names to use when installing a cross-compiler.
JAVA_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcj | sed $$t` JAVA_CROSS_NAME = `echo gcj|sed '$(program_transform_cross_name)'`
GCJ = gcj GCJ = gcj
...@@ -170,10 +170,11 @@ java.install-common: installdirs ...@@ -170,10 +170,11 @@ java.install-common: installdirs
fi ; \ fi ; \
fi ; \ fi ; \
for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \ for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \
tool_transformed_name=`echo $$tool|sed '$(program_transform_name)'`; \
if [ -f $$tool$(exeext) ]; then \ if [ -f $$tool$(exeext) ]; then \
rm -f $(bindir)/$$tool$(exeext); \ rm -f $(bindir)/$$tool_transformed_name$(exeext); \
$(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool$(exeext); \ $(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool_transformed_name$(exeext); \
chmod a+x $(bindir)/$$tool$(exeext); \ chmod a+x $(bindir)/$$tool_transformed_name$(exeext); \
fi ; \ fi ; \
done done
......
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