Patchwork Non portable sed invocation in libgcc configury

login
register
mail settings
Submitter Martin Husemann
Date March 23, 2014, 12:30 p.m.
Message ID <20140323123010.GA23018@mail.duskware.de>
Download mbox | patch
Permalink /patch/332884/
State New
Headers show

Comments

Martin Husemann - March 23, 2014, 12:30 p.m.
This version seems to work for me - but do you really want to go on
this slippery ice?

Martin
Andreas Schwab - March 23, 2014, 12:54 p.m.
Martin Husemann <martin@NetBSD.org> writes:

> This version seems to work for me - but do you really want to go on
> this slippery ice?

If you want to be portable you cannot use -r anyway.

Andreas.

Patch

--- libgcc/config/t-hardfp.orig	2014-02-07 08:46:34.000000000 +0100
+++ libgcc/config/t-hardfp	2014-03-23 13:25:44.000000000 +0100
@@ -51,11 +51,11 @@ 
 		    	      $(subst M,$(pair),truncM2))
 
 # Regexp for matching a floating-point mode.
-hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /\\|/g')
+hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g')
 
 # Regexp for matching the end of a function name, after the last
 # floating-point mode.
-hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /\\|/g')
+hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /|/g')
 
 # Add -D options to define:
 #   FUNC: the function name (e.g. __addsf3)
@@ -64,7 +64,7 @@ 
 #   TYPE: the last floating-point mode (e.g. sf)
 hardfp_defines_for = \
   $(shell echo $1 | \
-    sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
+    sed -r 's/(.*)($(hardfp_mode_regexp))($(hardfp_suffix_regexp)|.*)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
 
 hardfp-o = $(patsubst %,%$(objext),$(hardfp_func_list))
 $(hardfp-o): %$(objext): $(srcdir)/config/hardfp.c