]> git.ipfire.org Git - thirdparty/pdns.git/blob - m4/pdns_with_protobuf.m4
Merge pull request #8223 from PowerDNS/omoerbeek-patch-1
[thirdparty/pdns.git] / m4 / pdns_with_protobuf.m4
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],
6 [with_protobuf=auto],
7 )
8 AC_MSG_RESULT([$with_protobuf])
9
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])
14 ])
15 ])
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])
19 ])
20 AS_IF([test x"$PROTOC" = "x"], [
21 AC_MSG_ERROR([Protobuf requested but the protobuf compiler was not found])
22 ])
23 ])
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.])])
27 ])