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]
Other format: [Raw text]

RE: PATCH : Re: Fix STAGE_PREFIX in Makefile.in [take 2}


 --- Alexandre Oliva <aoliva@redhat.com> wrote: > On Nov 29, 2001, Danny
Smith <danny_r_smith_2001@yahoo.co.nz> wrote:

> Nesting backticks isn't portable, not even if they're
> backslash-quoted.
> 
> How about getting a variable that outputs stage prefix, in such a way
> that you can feed its output directly to
> prepend_dotdot_to_relative_paths?  Then, you don't need the nested
> echo.  I.e., something like:
> 
> echo_quoted_stage_prefix="case '\\\$(STAGE_PREFIX)' in stage*) echo
> '\\\$(STAGE_PREFIX)' | ...
> 
> 
> "STAGE_PREFIX=`@echo_quoted_stage_prefix@ |
> $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
> 

Thanks.  Here is the revised patch.

The attached patch fixes the breakage reported on i386-pc-mingw32
(http://gcc.gnu.org/ml/gcc-patches/2001-11/msg01953.html) following recent
changes to STAGE_PREFIX in Makefile.in
(http://gcc.gnu.org/ml/gcc-patches/2001-11/msg01864.html)

It also removes the non-portable use of nested backticks pointed out by
"Alexandre Oliva" <aoliva@redhat.com>
 

This patch is relevant to hosts that lack symbolic links.

Successfully tested by rebuild of i386-pc-mingw32 (without symbolic links),
configured with:
../gcc/configure --with-gcc-version-trigger=/develop/gcc/gcc/gcc/version.c
--with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw
 --enable-sjlj-exceptions --enable-threads --disable-nls
 --enable-languages=c++,f77 --disable-win32-registry 

Bootstrap in progress.

Changelog

2001-11-30  Danny Smith  <dannysmith@users.sourceforge.net>

	* configure.in (quoted_cc_set_by_configure): Rename to
	echo_quoted_cc_set_by_configure), removing backslashed
	backticks.
	(echo_quoted_stage_prefix_set_by_configure): Add 
	echo_quoted version of stage_prefix_set_by_configure.
	* Makefile.in (SUBDIR_FLAGS_TO_PASS): Use echo_quoted
	versions when setting CC and STAGE_PREFIX.
	* configure: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.560
diff -u -p -r1.560 configure.in
--- configure.in	2001/11/29 16:50:06	1.560
+++ configure.in	2001/11/30 00:09:22
@@ -1011,8 +1011,9 @@ rm -f symtest.tem
 if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
 then
 	cc_set_by_configure="\$(CC)"
-	quoted_cc_set_by_configure="\$(CC)"
+	echo_quoted_cc_set_by_configure="\$(CC)"
 	stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
+	echo_quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
 else
 	rm -f symtest.tem
 	if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
@@ -1022,8 +1023,9 @@ else
 		symbolic_link="cp"
 	fi
 	cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e
's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
-	quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo
'\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
+	echo_quoted_cc_set_by_configure="case '\\\$(CC)' in stage*) echo
'\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac"
 	stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo
'\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo
'\$(STAGE_PREFIX)';; esac\`"
+	echo_quoted_stage_prefix_set_by_configure="case '\\\$(STAGE_PREFIX)' in
stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo
'\\\$(STAGE_PREFIX)';; esac"
 fi
 rm -f symtest.tem
 
@@ -2165,7 +2167,7 @@ AC_SUBST(build_xm_file)
 AC_SUBST(build_xm_defines)
 AC_SUBST(check_languages)
 AC_SUBST(cc_set_by_configure)
-AC_SUBST(quoted_cc_set_by_configure)
+AC_SUBST(echo_quoted_cc_set_by_configure)
 AC_SUBST(cpp_install_dir)
 AC_SUBST(dep_host_xmake_file)
 AC_SUBST(dep_tmake_file)
@@ -2197,6 +2199,7 @@ AC_SUBST(objc_boehm_gc)
 AC_SUBST(out_file)
 AC_SUBST(out_object_file)
 AC_SUBST(stage_prefix_set_by_configure)
+AC_SUBST(echo_quoted_stage_prefix_set_by_configure)
 AC_SUBST(symbolic_link)
 AC_SUBST(thread_file)
 AC_SUBST(tm_file_list)
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.795
diff -u -p -r1.795 Makefile.in
--- Makefile.in	2001/11/29 17:12:52	1.795
+++ Makefile.in	2001/11/30 00:09:54
@@ -711,8 +711,8 @@ PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
 	-e 's|%% *|../|g' \
 	-e 's|%||g'
 SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
-	"CC=`echo @quoted_cc_set_by_configure@ |
$(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`" \
-	"STAGE_PREFIX=`echo @stage_prefix_set_by_configure@ |
$(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
+	"CC=`@echo_quoted_cc_set_by_configure@ |
$(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`" \
+	"STAGE_PREFIX=`@echo_quoted_stage_prefix_set_by_configure@ |
$(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
 #
 # Lists of files for various purposes.
 
 
Index: configure
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure,v
retrieving revision 1.570
diff -u -p -r1.570 configure
--- configure	2001/11/29 16:50:07	1.570
+++ configure	2001/11/30 00:13:32
@@ -6832,8 +6832,9 @@ rm -f symtest.tem
 if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
 then
 	cc_set_by_configure="\$(CC)"
-	quoted_cc_set_by_configure="\$(CC)"
+	echo_quoted_cc_set_by_configure="\$(CC)"
 	stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
+	echo_quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
 else
 	rm -f symtest.tem
 	if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
@@ -6843,8 +6844,9 @@ else
 		symbolic_link="cp"
 	fi
 	cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e
's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
-	quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo
'\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
+	echo_quoted_cc_set_by_configure="case '\\\$(CC)' in stage*) echo
'\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac"
 	stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo
'\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo
'\$(STAGE_PREFIX)';; esac\`"
+	echo_quoted_stage_prefix_set_by_configure="case '\\\$(STAGE_PREFIX)' in
stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo
'\\\$(STAGE_PREFIX)';; esac"
 fi
 rm -f symtest.tem
 
@@ -6967,7 +6969,7 @@ fi
 
 # Figure out what assembler we will be using.
 echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:6971: checking what assembler to use" >&5
+echo "configure:6973: checking what assembler to use" >&5
 gcc_cv_as=
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
@@ -7053,7 +7055,7 @@ fi
 
 # Figure out what nm we will be using.
 echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:7057: checking what nm to use" >&5
+echo "configure:7059: checking what nm to use" >&5
 if test -x nm$host_exeext; then
 	gcc_cv_nm=./nm$host_exeext
 elif test x$host = x$target; then
@@ -7064,7 +7066,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6
 
 # Figure out what objdump we will be using.
 echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
-echo "configure:7068: checking what objdump to use" >&5
+echo "configure:7070: checking what objdump to use" >&5
 if test -x objdump$host_exeext; then
 	gcc_cv_objdump=./objdump$host_exeext
 elif test x$host = x$target; then
@@ -7075,7 +7077,7 @@ echo "$ac_t""$gcc_cv_objdump" 1>&6
 
 # Figure out what assembler alignment features are present.
 echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:7079: checking assembler alignment features" >&5
+echo "configure:7081: checking assembler alignment features" >&5
 gcc_cv_as_alignment_features=none
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
 	# Gas version 2.6 and later support for .balign and .p2align.
@@ -7123,7 +7125,7 @@ fi
 echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
 
 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:7127: checking assembler subsection support" >&5
+echo "configure:7129: checking assembler subsection support" >&5
 gcc_cv_as_subsections=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version"
-ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf'
../gas/Makefile > /dev/null; then
@@ -7163,7 +7165,7 @@ fi
 echo "$ac_t""$gcc_cv_as_subsections" 1>&6
 
 echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:7167: checking assembler weak support" >&5
+echo "configure:7169: checking assembler weak support" >&5
 gcc_cv_as_weak=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version"
-ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -7186,7 +7188,7 @@ fi
 echo "$ac_t""$gcc_cv_as_weak" 1>&6
 
 echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:7190: checking assembler hidden support" >&5
+echo "configure:7192: checking assembler hidden support" >&5
 gcc_cv_as_hidden=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version"
-ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf'
../gas/Makefile > /dev/null; then
@@ -7210,7 +7212,7 @@ fi
 echo "$ac_t""$gcc_cv_as_hidden" 1>&6
 
 echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
-echo "configure:7214: checking assembler leb128 support" >&5
+echo "configure:7216: checking assembler leb128 support" >&5
 gcc_cv_as_leb128=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version"
-ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf'
../gas/Makefile > /dev/null; then
@@ -7255,7 +7257,7 @@ fi
 echo "$ac_t""$gcc_cv_as_leb128" 1>&6
 
 echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
-echo "configure:7259: checking assembler eh_frame optimization" >&5
+echo "configure:7261: checking assembler eh_frame optimization" >&5
 gcc_cv_as_eh_frame=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version"
-ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf'
../gas/Makefile > /dev/null; then
@@ -7336,7 +7338,7 @@ fi
 echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
 
 echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
-echo "configure:7340: checking assembler section merging support" >&5
+echo "configure:7342: checking assembler section merging support" >&5
 gcc_cv_as_shf_merge=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version"
-ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf'
../gas/Makefile > /dev/null; then
@@ -7361,7 +7363,7 @@ echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
 case "$target" in 
   sparc*-*-*)
     echo $ac_n "checking assembler .register pseudo-op support""... $ac_c"
1>&6
-echo "configure:7365: checking assembler .register pseudo-op support" >&5
+echo "configure:7367: checking assembler .register pseudo-op support" >&5
 if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set";
then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7389,7 +7391,7 @@ EOF
     fi
 
     echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:7393: checking assembler supports -relax" >&5
+echo "configure:7395: checking assembler supports -relax" >&5
 if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7419,7 +7421,7 @@ EOF
     case "$tm_file" in
     *64*)
 	echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""...
$ac_c" 1>&6
-echo "configure:7423: checking for 64 bit support in assembler
($gcc_cv_as)" >&5
+echo "configure:7425: checking for 64 bit support in assembler
($gcc_cv_as)" >&5
 if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7464,7 +7466,7 @@ EOF
 
     if test "x$gcc_cv_as_flags64" != xno; then
 	echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c"
1>&6
-echo "configure:7468: checking for assembler offsetable %lo() support" >&5
+echo "configure:7470: checking for assembler offsetable %lo() support" >&5
 if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set";
then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7504,7 +7506,7 @@ EOF
 
   i[34567]86-*-* | x86_64-*-*)
     echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:7508: checking assembler instructions" >&5
+echo "configure:7510: checking assembler instructions" >&5
     gcc_cv_as_instructions=
     if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version
!= x; then
       if test "$gcc_cv_gas_major_version" -eq 2 -a
"$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2;
then
@@ -7531,7 +7533,7 @@ EOF
     echo "$ac_t""$gcc_cv_as_instructions" 1>&6
 
     echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c"
1>&6
-echo "configure:7535: checking assembler GOTOFF in data directives" >&5
+echo "configure:7537: checking assembler GOTOFF in data directives" >&5
     gcc_cv_as_gotoff_in_data=no
     if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version
!= x
     then
@@ -7561,7 +7563,7 @@ EOF
 esac
 
 echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:7565: checking assembler dwarf2 debug_line support" >&5
+echo "configure:7567: checking assembler dwarf2 debug_line support" >&5
 gcc_cv_as_dwarf2_debug_line=no
 # ??? Not all targets support dwarf2 debug_line, even within a version
 # of gas.  Moreover, we need to emit a valid instruction to trigger any
@@ -7617,7 +7619,7 @@ fi
 echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
 
 echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
-echo "configure:7621: checking assembler --gdwarf2 support" >&5
+echo "configure:7623: checking assembler --gdwarf2 support" >&5
 gcc_cv_as_gdwarf2_flag=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x;
 then
@@ -7646,7 +7648,7 @@ fi
 echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
 
 echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
-echo "configure:7650: checking assembler --gstabs support" >&5
+echo "configure:7652: checking assembler --gstabs support" >&5
 gcc_cv_as_gstabs_flag=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version !=
x;
 then
@@ -7816,7 +7818,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of
Makefiles""... $ac_c" 1>&6
-echo "configure:7820: checking whether to enable maintainer-specific
portions of Makefiles" >&5
+echo "configure:7822: checking whether to enable maintainer-specific
portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode
was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -8127,6 +8129,7 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configur
 
 
 
+
 # Echo that links are built
 if test x$host = x$target
 then
@@ -8395,7 +8398,7 @@ s%@build_xm_file@%$build_xm_file%g
 s%@build_xm_defines@%$build_xm_defines%g
 s%@check_languages@%$check_languages%g
 s%@cc_set_by_configure@%$cc_set_by_configure%g
-s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
+s%@echo_quoted_cc_set_by_configure@%$echo_quoted_cc_set_by_configure%g
 s%@cpp_install_dir@%$cpp_install_dir%g
 s%@dep_host_xmake_file@%$dep_host_xmake_file%g
 s%@dep_tmake_file@%$dep_tmake_file%g
@@ -8427,6 +8430,7 @@ s%@objc_boehm_gc@%$objc_boehm_gc%g
 s%@out_file@%$out_file%g
 s%@out_object_file@%$out_object_file%g
 s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
+s%@echo_quoted_stage_prefix_set_by_configure@%$echo_quoted_stage_prefix_set_by_configure%g
 s%@symbolic_link@%$symbolic_link%g
 s%@thread_file@%$thread_file%g
 s%@tm_file_list@%$tm_file_list%g

http://shopping.yahoo.com.au - Yahoo! Shopping
- Get organised for Christmas early this year!


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