Adriaan van Os wrote:
To check it, I just tried with minised, and it works fine. Could you send me or point me to the source code of Apple's sed? (I don't use Mac OS, but given the source, I could probably try it under Linux.) When I know what doesn't work, I might be able to amend the script.
Darwin source can be found at http://www.opensource.apple.com/darwinsource/, e.g. http://www.opensource.apple.com/darwinsource/tarballs/apsl/text_cmds-68.tar.gz (free registration is required) or (if that's a problem) http://www.microbizz.nl/text_cmds-68.tar.gz
The last link gives me a zero-length file.
Adriaan van Os wrote:
Frank Heckenbach wrote:
Peter Schorn wrote:
- Using sed 4.1.4. instead of the Apple supplied version of sed
(maybe it would help to add an sed check in mk-t-inc).
Which sed feature or invocation is problematic actually? I tried not to use any GNU sed specific feature in this script.
I will follow up with that.
The gcc/p/utils/tree.inc created with the darwin system-installed sed ends with:
SN (gpc_type_PObjectType) SN (inoutres_variable_node) SN (null_pseudo_const_node)}
{$endif}
It doesn't have any of the
DEFTREECODE (ERROR_MARK, "error_mark", 'x', 0) DEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', 0) ..... DEFTREECODE (RANGE_CHECK_EXPR, "range_check_expr", 'e', 3) DEFTREECODE (IO_RANGE_CHECK_EXPR, "io_range_check_expr", 'e', 3) #endif
that popup after rebuilding with gnu-sed-4.1.4 installed.
So it's the last "sed" invocation in the script that fails.
There may be a missing semicolon. At least I thought sed requires a ";" (or newline) before "}", and some examples I've just checked seem to suggest so, so I'm a bit surprised GNU sed works without it.
Otherwise I don't see any of the typical problems I've had with other seds here.
--- p/utils/mk-t-inc.orig Sat Apr 19 03:03:24 2008 +++ p/utils/mk-t-inc Sat Apr 19 03:03:57 2008 @@ -72,5 +72,5 @@ cat "$GCCDIR/tree.def" echo 'DEFTREECODE (LAST_AND_UNUSED_C_TREE_CODE, "unused", '"'x', 0)" sed -e '/#ifdef EGCS/,${/#ifdef EGCS/d;/#else/,/#endif/d;}' "$GCCDIR/p/p-tree.def" -} | sed -ne ':loop;/\$/{N;b loop};/^DEFTREECODE/{s,/*.**/,,;s/["'"'"']x["'"'"'].*/'"'x', 0)/;p;};/^#/p" +} | sed -ne ':loop;/\$/{N;b loop;};/^DEFTREECODE/{s,/*.**/,,;s/["'"'"']x["'"'"'].*/'"'x', 0)/;p;};/^#/p" } > "$2" || { rm -f "$2"; false; }
Also, there is the following problem when using the darwin system-installed sed rm -rf p/docdemos ../../gcc-3.4.6/gcc/p/script/mkdir-p p/docdemos [...]
For docdemos that's expected, as the extraction script needs full regex features. But docdemos are not essential for building GPC, so it lets you skip this step.
Frank