FreeBSD 8.x and above have added -r that does exactly same as -E for increased

compatibility with GNU sed. Since FreeBSD still supports 7.x that does not has
-r, so use -E instead.

Reported by:	pointyhat (pav)
This commit is contained in:
Jeremy Messenger 2012-04-27 02:18:49 +00:00
parent 6e27dc9723
commit 4c23dd0061
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=295585

View File

@ -0,0 +1,17 @@
--- build/myocamlbuild_prefix.ml.orig 2012-04-26 21:03:23.000000000 -0500
+++ build/myocamlbuild_prefix.ml 2012-04-26 21:03:35.000000000 -0500
@@ -325,7 +325,13 @@
let sedexpr =
Printf.sprintf "s/^\\?HAS_(%s)://; /HAS_.*:/d" tags
in
- Cmd(S[sed; A"-r"; A sedexpr; P(env "%.mllibp"); Sh">"; P(env "%.mllib")]));
+ (* FreeBSD 8.x and above have added -r that does exactly same as -E
+ for increased compatibility with GNU sed. Since FreeBSD still
+ supports 7.x that does not has -r, so use -E instead. *)
+ if is_fbsd then
+ Cmd(S[sed; A"-E"; A sedexpr; P(env "%.mllibp"); Sh">"; P(env "%.mllib")])
+ else
+ Cmd(S[sed; A"-r"; A sedexpr; P(env "%.mllibp"); Sh">"; P(env "%.mllib")]));
(* Windows specific : redefinition of an existing rule in Ocaml_specific.ml,
Louis please have a look to avoid the two copies at the end