mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 22:01:02 +08:00
configure.ac: use $protobuf_CFLAGS to find protobuf header files
the protobuf header files may be installed in a non-standard location and thus we need to use the CFLAGS registered for protobuf in pkg-config in order to find them. based on a patch from Andrei Nigmatulin.
This commit is contained in:
parent
66005093be
commit
e633dda6e4
@ -39,9 +39,14 @@ AC_ARG_ENABLE([protoc],
|
|||||||
if test "x$enable_protoc" != "xno"; then
|
if test "x$enable_protoc" != "xno"; then
|
||||||
AC_LANG_PUSH([C++])
|
AC_LANG_PUSH([C++])
|
||||||
PKG_CHECK_MODULES([protobuf], [protobuf])
|
PKG_CHECK_MODULES([protobuf], [protobuf])
|
||||||
|
|
||||||
|
save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
CPPFLAGS="$save_CPPFLAGS $protobuf_CFLAGS"
|
||||||
AC_CHECK_HEADERS([google/protobuf/compiler/command_line_interface.h],
|
AC_CHECK_HEADERS([google/protobuf/compiler/command_line_interface.h],
|
||||||
[],
|
[],
|
||||||
[AC_MSG_ERROR([required protobuf header file not found])])
|
[AC_MSG_ERROR([required protobuf header file not found])])
|
||||||
|
CPPFLAGS="$save_CPPFLAGS"
|
||||||
|
|
||||||
AC_PATH_PROG(PROTOC, protoc)
|
AC_PATH_PROG(PROTOC, protoc)
|
||||||
if test -z "$PROTOC"; then
|
if test -z "$PROTOC"; then
|
||||||
AC_MSG_ERROR([Please install the protobuf compiler from https://code.google.com/p/protobuf/.])
|
AC_MSG_ERROR([Please install the protobuf compiler from https://code.google.com/p/protobuf/.])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user