Commit 38fcd392 authored by kenton@google.com's avatar kenton@google.com

Minor compatibility tweaks for FreeBSD.

parent 7b7a80ea
...@@ -254,18 +254,11 @@ unittest_proto_middleman: $(protoc_inputs) ...@@ -254,18 +254,11 @@ unittest_proto_middleman: $(protoc_inputs)
else else
# This rule is a little weird. The first prereq is the protoc executable # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
# and the rest are its inputs. Therefore, $^ -- which expands to the # relative to srcdir, which may not be the same as the current directory when
# list of prereqs -- is actually a valid command. We have to place "./" in # building out-of-tree.
# front of it in case protoc is in the current directory. protoc allows
# flags to appear after input file names, so we happily stick the flags on
# the end.
#
# For reference, if we didn't have to worry about VPATH (i.e., building from
# a directory other than the package root), we could have just written this:
# ./protoc$(EXEEXT) -I$(srcdir) --cpp_out=. $(protoc_inputs)
unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs) unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
./$^ -I$(srcdir) --cpp_out=. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) )
touch unittest_proto_middleman touch unittest_proto_middleman
endif endif
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
# #
# Test protoc's zip output mode. # Test protoc's zip output mode.
function fail { fail() {
echo "$@" >&2 echo "$@" >&2
exit 1 exit 1
} }
......
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