From 38fcd39227f3fb220dc4ac381c1617c49a0215e3 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Fri, 8 Jan 2010 04:48:19 +0000 Subject: Minor compatibility tweaks for FreeBSD. --- src/Makefile.am | 15 ++++----------- src/google/protobuf/compiler/zip_output_unittest.sh | 2 +- 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 } -- cgit v1.2.3