From e1e044da017af74d69cf30c2af0006bc628e2c07 Mon Sep 17 00:00:00 2001 From: Robert Edmonds Date: Fri, 28 Mar 2014 13:23:37 -0400 Subject: [PATCH] configure.ac: search the pkg-config exec_prefix for the protobuf compiler protoc may not be on the default PATH, so augment $PATH with the executable path registered by pkg-config for the protobuf package. additionally declare PROTOC as a precious variable, thus allowing it to be explicitly set by the user at ./configure time. based on a patch from Andrei Nigmatulin. --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fea83c5..d8009b9 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,9 @@ if test "x$enable_protoc" != "xno"; then [AC_MSG_ERROR([required protobuf header file not found])]) CPPFLAGS="$save_CPPFLAGS" - AC_PATH_PROG(PROTOC, protoc) + AC_ARG_VAR([PROTOC], [protobuf compiler command]) + AC_PATH_PROG([PROTOC], [protoc], [], + [`$PKG_CONFIG --variable=exec_prefix protobuf`/bin:$PATH]) if test -z "$PROTOC"; then AC_MSG_ERROR([Please install the protobuf compiler from https://code.google.com/p/protobuf/.]) fi