aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-01-08 04:48:19 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-01-08 04:48:19 +0000
commit38fcd39227f3fb220dc4ac381c1617c49a0215e3 (patch)
tree4caa6a35834581833bfef685e0d583564b58293a
parent7b7a80eae4f46cca5d3a2781b4412ef769856cdb (diff)
downloadprotobuf-38fcd39227f3fb220dc4ac381c1617c49a0215e3.tar.gz
protobuf-38fcd39227f3fb220dc4ac381c1617c49a0215e3.tar.bz2
protobuf-38fcd39227f3fb220dc4ac381c1617c49a0215e3.zip
Minor compatibility tweaks for FreeBSD.
-rw-r--r--src/Makefile.am15
-rwxr-xr-xsrc/google/protobuf/compiler/zip_output_unittest.sh2
2 files changed, 5 insertions, 12 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5d874d16..35f5c0c5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -254,18 +254,11 @@ unittest_proto_middleman: $(protoc_inputs)
else
-# This rule is a little weird. The first prereq is the protoc executable
-# and the rest are its inputs. Therefore, $^ -- which expands to the
-# list of prereqs -- is actually a valid command. We have to place "./" in
-# 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)
+# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
+# relative to srcdir, which may not be the same as the current directory when
+# building out-of-tree.
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
endif
diff --git a/src/google/protobuf/compiler/zip_output_unittest.sh b/src/google/protobuf/compiler/zip_output_unittest.sh
index fac27257..259d5d21 100755
--- a/src/google/protobuf/compiler/zip_output_unittest.sh
+++ b/src/google/protobuf/compiler/zip_output_unittest.sh
@@ -34,7 +34,7 @@
#
# Test protoc's zip output mode.
-function fail {
+fail() {
echo "$@" >&2
exit 1
}