1 AC_DEFUN([PDNS_WITH_PROTOBUF], [
2 AC_MSG_CHECKING([if we need to link in protobuf])
3 AC_ARG_WITH([protobuf],
4 AS_HELP_STRING([--with-protobuf],[enable protobuf support @<:@default=auto@:>@]),
5 [with_protobuf=$withval],
8 AC_MSG_RESULT([$with_protobuf])
10 AS_IF([test "x$with_protobuf" != "xno"], [
11 AS_IF([test "x$with_protobuf" = "xyes" -o "x$with_protobuf" = "xauto"], [
12 PKG_CHECK_MODULES([PROTOBUF], [protobuf], [ : ], [ : ])
13 AC_CHECK_PROG([PROTOC], [protoc], [protoc])
16 AS_IF([test "x$with_protobuf" = "xyes"], [
17 AS_IF([test x"$PROTOBUF_LIBS" = "x"], [
18 AC_MSG_ERROR([Protobuf requested but libraries were not found])
20 AS_IF([test x"$PROTOC" = "x"], [
21 AC_MSG_ERROR([Protobuf requested but the protobuf compiler was not found])
24 AM_CONDITIONAL([HAVE_PROTOBUF], [test x"$PROTOBUF_LIBS" != "x"])
25 AM_CONDITIONAL([HAVE_PROTOC], [test x"$PROTOC" != "x"])
26 AS_IF([test x"$PROTOBUF_LIBS" != "x"], [AC_DEFINE([HAVE_PROTOBUF], [1], [Define if using protobuf.])])