]>
Commit | Line | Data |
---|---|---|
e3e0caa5 PL |
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"], [ | |
0f6388ed | 12 | PKG_CHECK_MODULES([PROTOBUF], [protobuf], [ : ], [ : ]) |
e3e0caa5 PL |
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 | ]) |