Commit 5e307067 authored by Andreas Schuh's avatar Andreas Schuh

Merge pull request #143 from schuhschuh/fix-bazel-bulid-osx

fix #133: Use awk instead of sed which would require different options on OS X
parents 58441994 687b2c56
...@@ -47,7 +47,7 @@ genrule( ...@@ -47,7 +47,7 @@ genrule(
outs = [ outs = [
"config.h", "config.h",
], ],
cmd = "sed -r -e 's,^#cmakedefine,// cmakedefine,' $(<) > $(@)", cmd = "awk '{ gsub(/^#cmakedefine/, \"//cmakedefine\"); print; }' $(<) > $(@)",
) )
genrule( genrule(
...@@ -58,7 +58,7 @@ genrule( ...@@ -58,7 +58,7 @@ genrule(
outs = [ outs = [
"gflags.h", "gflags.h",
], ],
cmd = "sed -r -e 's/@[A-Z_]+@//' $(<) > $(@)", cmd = "awk '{ gsub(/@(GFLAGS_ATTRIBUTE_UNUSED|INCLUDE_GFLAGS_NS_H)@/, \"\"); print; }' $(<) > $(@)",
) )
genrule( genrule(
...@@ -69,7 +69,7 @@ genrule( ...@@ -69,7 +69,7 @@ genrule(
outs = [ outs = [
"gflags_completions.h", "gflags_completions.h",
], ],
cmd = "sed -r -e 's/@GFLAGS_NAMESPACE@/gflags/' $(<) > $(@)", cmd = "awk '{ gsub(/@GFLAGS_NAMESPACE@/, \"gflags\"); print; }' $(<) > $(@)",
) )
genrule( genrule(
...@@ -80,12 +80,11 @@ genrule( ...@@ -80,12 +80,11 @@ genrule(
outs = [ outs = [
"gflags_declare.h", "gflags_declare.h",
], ],
cmd = ("sed -r -e '" + cmd = ("awk '{ " +
"s/@GFLAGS_NAMESPACE@/gflags/;" + "gsub(/@GFLAGS_NAMESPACE@/, \"gflags\"); " +
"s/@(HAVE_STDINT_H|HAVE_SYS_TYPES_H|HAVE_INTTYPES_H" + "gsub(/@(HAVE_STDINT_H|HAVE_SYS_TYPES_H|HAVE_INTTYPES_H|GFLAGS_INTTYPES_FORMAT_C99)@/, \"1\"); " +
"|GFLAGS_INTTYPES_FORMAT_C99)@/1/;" + "gsub(/@([A-Z0-9_]+)@/, \"0\"); " +
"s/@([A-Z0-9_]+)@/0/" + "print; }' $(<) > $(@)"),
"' $(<) > $(@)"),
) )
genrule( genrule(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment