configure.ac: fix protobuf config

Bug description: frr_init load zebra_fpm.so error. Zebra can't
  find function `zfpm_protobuf_encode_route` in symbol table.

  Bug trigger condition ( CI have this set ):
    ./configure --enable-protobuf=no --enable-fpm=yes
    /usr/lib/frr/zebra -M fpm

  Cause: Macro `HAVE_PROTOBUF` and compile condition variable
  `HAVE_PROTOBUF`  in `configure.ac ` is not consistent. When
  configure `disable-protobuf`, compile condition variable
  `HAVE_PROTOBUF` is 0, but the macro is 1. It leads to zebra
  load protobuf module, but protobuf module is not linked.

  Fix: add a same condition statement to the macro define.

Signed-off-by: 乐倚 <lwb406054@alibaba-inc.com>
This commit is contained in:
乐倚 2023-08-23 08:42:33 +00:00
parent 451fb24b17
commit 9fbab41212

View file

@ -1385,7 +1385,9 @@ if test "$enable_protobuf3" = "yes"; then
[PROTO3=false && AC_MSG_FAILURE([protobuf3 requested but protobuf-c.h not found. Install protobuf-c.])])
fi
AC_DEFINE([HAVE_PROTOBUF], [1], [protobuf])
if test "$enable_protobuf" != "no"; then
AC_DEFINE([HAVE_PROTOBUF], [1], [protobuf])
fi
#
# End of logic for protobuf support.
#