This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Partial fix for --program-suffix ignore



Ok, It's in.  For reference, here's the patch I committed, minus the
new configure:

PS: Next time, please be careful about tab-space conversions.  I had
to re-tabify the patch manually before it applied cleanly.

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.11797
diff -p -3 -r1.11797 ChangeLog
*** ChangeLog	2001/11/08 19:20:35	1.11797
--- ChangeLog	2001/11/08 20:06:47
***************
*** 1,3 ****
--- 1,17 ----
+ 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>
  
  	* config/mips/mips.c (save_restore_insns): Remove GP from the
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.767
diff -p -3 -r1.767 Makefile.in
*** Makefile.in	2001/11/07 16:34:36	1.767
--- Makefile.in	2001/11/08 20:07:01
*************** HOST_DOPRINT=$(DOPRINT)
*** 482,499 ****
  HOST_STRSTR=$(STRSTR)
  
  # Actual name to use when installing a native compiler.
! GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t`
! CPP_INSTALL_NAME = `t='$(program_transform_name)'; echo cpp | sed -e $$t`
! PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t`
! UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t`
! GCOV_INSTALL_NAME = `t='$(program_transform_name)'; echo gcov | sed -e $$t`
! GCCBUG_INSTALL_NAME = `t='$(program_transform_name)'; echo gccbug | sed -e $$t`
  
  # Actual name to use when installing a cross-compiler.
! GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t`
! CPP_CROSS_NAME = `t='$(program_transform_cross_name)'; echo cpp | sed -e $$t`
! PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t`
! UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t`
  
  # Choose the real default target.
  ALL=all.internal
--- 482,500 ----
  HOST_STRSTR=$(STRSTR)
  
  # Actual name to use when installing a native compiler.
! GCC_INSTALL_NAME = `echo gcc|sed '$(program_transform_name)'`
! GCC_TARGET_INSTALL_NAME = $(target_alias)-`echo gcc|sed '$(program_transform_name)'`
! CPP_INSTALL_NAME = `echo cpp|sed '$(program_transform_name)'`
! PROTOIZE_INSTALL_NAME = `echo protoize|sed '$(program_transform_name)'`
! UNPROTOIZE_INSTALL_NAME = `echo unprotoize|sed '$(program_transform_name)'`
! 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.
! GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'`
! CPP_CROSS_NAME = `echo cpp|sed '$(program_transform_cross_name)'`
! PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'`
! UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'`
  
  # Choose the real default target.
  ALL=all.internal
*************** install-driver: installdirs xgcc$(exeext
*** 2650,2656 ****
  	  $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
  	  rm -f $(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); \
  	fi
  
  # Install the info files.
--- 2651,2657 ----
  	  $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
  	  rm -f $(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)/$(GCC_TARGET_INSTALL_NAME)$(exeext); \
  	fi
  
  # Install the info files.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.552
diff -p -3 -r1.552 configure.in
*** configure.in	2001/11/06 02:39:47	1.552
--- configure.in	2001/11/08 20:07:12
*************** AC_SUBST(enable_shared)
*** 335,340 ****
--- 335,343 ----
  # Determine the host, build, and target systems
  AC_CANONICAL_SYSTEM
  
+ # Set program_transform_name
+ AC_ARG_PROGRAM
+ 
  # Find the native compiler
  AC_PROG_CC
  AC_PROG_CC_C_O
Index: cp/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ChangeLog,v
retrieving revision 1.2542
diff -p -3 -r1.2542 ChangeLog
*** ChangeLog	2001/11/06 21:12:09	1.2542
--- ChangeLog	2001/11/08 20:07:41
***************
*** 1,3 ****
--- 1,11 ----
+ 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>
  
  	* Make-lang.in: Update.
Index: cp/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/Make-lang.in,v
retrieving revision 1.96
diff -p -3 -r1.96 Make-lang.in
*** Make-lang.in	2001/11/06 21:12:10	1.96
--- Make-lang.in	2001/11/08 20:07:44
***************
*** 38,51 ****
  # - define the names for selecting the language in LANGUAGES.
  
  # Actual names to use when installing a native compiler.
! CXX_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t`
! GXX_INSTALL_NAME = `t='$(program_transform_name)'; echo g++ | sed $$t`
! DEMANGLER_INSTALL_NAME = `t='$(program_transform_name)'; echo c++filt | sed $$t`
  
  # Actual names to use when installing a cross-compiler.
! CXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t`
! GXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g++ | sed $$t`
! DEMANGLER_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++filt | sed $$t`
  
  # The name to use for the demangler program.
  DEMANGLER_PROG = c++filt$(exeext)
--- 38,53 ----
  # - define the names for selecting the language in LANGUAGES.
  
  # Actual names to use when installing a native compiler.
! CXX_INSTALL_NAME = `echo c++|sed '$(program_transform_name)'`
! GXX_INSTALL_NAME = `echo g++|sed '$(program_transform_name)'`
! 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.
! CXX_CROSS_NAME = `echo c++|sed '$(program_transform_cross_name)'`
! GXX_CROSS_NAME = `echo g++|sed '$(program_transform_cross_name)'`
! DEMANGLER_CROSS_NAME = `echo c++filt|sed '$(program_transform_cross_name)'`
  
  # The name to use for the demangler program.
  DEMANGLER_PROG = c++filt$(exeext)
*************** c++.install-common: installdirs
*** 162,171 ****
  	    chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
  	    rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
  	    $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
! 	    rm -f $(bindir)/$(target_alias)-g++$(exeext); \
! 	    $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-g++$(exeext); \
! 	    rm -f $(bindir)/$(target_alias)-c++$(exeext); \
! 	    $(LN) $(bindir)/$(CXX_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-c++$(exeext); \
  	  fi ; \
  	  if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
  	    if [ -f g++-cross$(exeext) ] ; then \
--- 164,173 ----
  	    chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
  	    rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
  	    $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
! 	    rm -f $(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
! 	    $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
! 	    rm -f $(bindir)/$(CXX_TARGET_INSTALL_NAME)$(exeext); \
! 	    $(LN) $(bindir)/$(CXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_TARGET_INSTALL_NAME)$(exeext); \
  	  fi ; \
  	  if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
  	    if [ -f g++-cross$(exeext) ] ; then \
Index: f/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/ChangeLog,v
retrieving revision 1.382
diff -p -3 -r1.382 ChangeLog
*** ChangeLog	2001/11/08 00:07:57	1.382
--- ChangeLog	2001/11/08 20:07:53
***************
*** 1,3 ****
--- 1,8 ----
+ 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>
  
  	* Make-lang.in: Add rules for building g77.1.
Index: f/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/Make-lang.in,v
retrieving revision 1.94
diff -p -3 -r1.94 Make-lang.in
*** Make-lang.in	2001/11/08 00:07:57	1.94
--- Make-lang.in	2001/11/08 20:07:55
***************
*** 39,48 ****
  # $(srcdir) must be set to the gcc/ source directory (not gcc/f/).
  #
  # Actual name to use when installing a native compiler.
! G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t`
  
  # Actual name to use when installing a cross-compiler.
! G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t`
  
  # Some versions of `touch' (such as the version on Solaris 2.8) 
  # do not correctly set the timestamp due to buggy versions of `utime'
--- 39,48 ----
  # $(srcdir) must be set to the gcc/ source directory (not gcc/f/).
  #
  # Actual name to use when installing a native compiler.
! G77_INSTALL_NAME = `echo g77|sed '$(program_transform_name)'`
  
  # Actual name to use when installing a cross-compiler.
! G77_CROSS_NAME = `echo g77|sed '$(program_transform_cross_name)'`
  
  # Some versions of `touch' (such as the version on Solaris 2.8) 
  # do not correctly set the timestamp due to buggy versions of `utime'
Index: java/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/ChangeLog,v
retrieving revision 1.837
diff -p -3 -r1.837 ChangeLog
*** ChangeLog	2001/11/08 15:38:10	1.837
--- ChangeLog	2001/11/08 20:09:00
***************
*** 1,3 ****
--- 1,10 ----
+ 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>
  
  	* parse.y (trap_overflow_corner_case): New rule.
Index: java/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.71
diff -p -3 -r1.71 Make-lang.in
*** Make-lang.in	2001/11/06 21:12:12	1.71
--- Make-lang.in	2001/11/08 20:09:01
***************
*** 42,51 ****
  # - define the names for selecting the language in LANGUAGES.
  
  # Actual names to use when installing a native compiler.
! JAVA_INSTALL_NAME = `t='$(program_transform_name)'; echo gcj | sed $$t`
  
  # Actual names to use when installing a cross-compiler.
! JAVA_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcj | sed $$t`
  
  GCJ = gcj
  
--- 42,51 ----
  # - define the names for selecting the language in LANGUAGES.
  
  # Actual names to use when installing a native compiler.
! JAVA_INSTALL_NAME = `echo gcj|sed '$(program_transform_name)'` 
  
  # Actual names to use when installing a cross-compiler.
! JAVA_CROSS_NAME = `echo gcj|sed '$(program_transform_cross_name)'` 
  
  GCJ = gcj
  
*************** java.install-common: installdirs
*** 170,179 ****
  	  fi ; \
  	fi ; \
          for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \
            if [ -f $$tool$(exeext) ]; then \
! 	    rm -f $(bindir)/$$tool$(exeext); \
! 	    $(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool$(exeext); \
! 	    chmod a+x $(bindir)/$$tool$(exeext); \
            fi ; \
         done
  
--- 170,180 ----
  	  fi ; \
  	fi ; \
          for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \
+ 	  tool_transformed_name=`echo $$tool|sed '$(program_transform_name)'`; \
            if [ -f $$tool$(exeext) ]; then \
! 	    rm -f $(bindir)/$$tool_transformed_name$(exeext); \
! 	    $(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool_transformed_name$(exeext); \
! 	    chmod a+x $(bindir)/$$tool_transformed_name$(exeext); \
            fi ; \
         done
  
Index: doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.76
diff -p -3 -r1.76 install.texi
*** install.texi	2001/11/06 20:05:07	1.76
--- install.texi	2001/11/08 20:09:12
*************** the installation directory for G++ heade
*** 363,368 ****
--- 363,413 ----
  
  @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}
  Specify the
  installation directory for local include files.  The default is


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]