Skip to content

Commit 0585c3e

Browse files
committed
Autoconf and changelog note for #999
- Merge #999: Search for protobuf-c with pkg-config.
1 parent 0b74f2a commit 0585c3e

File tree

2 files changed

+92
-10
lines changed

2 files changed

+92
-10
lines changed

configure

Lines changed: 89 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ DNSTAP_SOCKET_TESTBIN
655655
DNSTAP_SOCKET_PATH
656656
opt_dnstap_socket_path
657657
ENABLE_DNSTAP
658+
PROTOBUFC_LIBS
659+
PROTOBUFC_CFLAGS
658660
PROTOC_C
659661
UBSYMS
660662
EXTRALINK
@@ -926,7 +928,9 @@ SYSTEMD_CFLAGS
926928
SYSTEMD_LIBS
927929
SYSTEMD_DAEMON_CFLAGS
928930
SYSTEMD_DAEMON_LIBS
929-
PYTHON_VERSION'
931+
PYTHON_VERSION
932+
PROTOBUFC_CFLAGS
933+
PROTOBUFC_LIBS'
930934

931935

932936
# Initialize some variables set by options.
@@ -1718,6 +1722,10 @@ Some influential environment variables:
17181722
The installed Python version to use, for example '2.3'. This
17191723
string will be appended to the Python interpreter canonical
17201724
name.
1725+
PROTOBUFC_CFLAGS
1726+
C compiler flags for PROTOBUFC, overriding pkg-config
1727+
PROTOBUFC_LIBS
1728+
linker flags for PROTOBUFC, overriding pkg-config
17211729

17221730
Use these variables to override the choices made by `configure' or to help
17231731
it to find libraries and programs with nonstandard names/locations.
@@ -21392,15 +21400,86 @@ if test "${with_protobuf_c+set}" = set; then :
2139221400

2139321401
else
2139421402

21395-
# workaround for protobuf-c includes at old dir before protobuf-c-1.0.0
21396-
if test -f /usr/include/google/protobuf-c/protobuf-c.h; then
21397-
CFLAGS="$CFLAGS -I/usr/include/google"
21398-
else
21399-
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h; then
21400-
CFLAGS="$CFLAGS -I/usr/local/include/google"
21401-
LDFLAGS="$LDFLAGS -L/usr/local/lib"
21402-
fi
21403-
fi
21403+
21404+
21405+
pkg_failed=no
21406+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PROTOBUFC" >&5
21407+
$as_echo_n "checking for PROTOBUFC... " >&6; }
21408+
21409+
if test -n "$PROTOBUFC_CFLAGS"; then
21410+
pkg_cv_PROTOBUFC_CFLAGS="$PROTOBUFC_CFLAGS"
21411+
elif test -n "$PKG_CONFIG"; then
21412+
if test -n "$PKG_CONFIG" && \
21413+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libprotobuf-c\""; } >&5
21414+
($PKG_CONFIG --exists --print-errors "libprotobuf-c") 2>&5
21415+
ac_status=$?
21416+
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
21417+
test $ac_status = 0; }; then
21418+
pkg_cv_PROTOBUFC_CFLAGS=`$PKG_CONFIG --cflags "libprotobuf-c" 2>/dev/null`
21419+
test "x$?" != "x0" && pkg_failed=yes
21420+
else
21421+
pkg_failed=yes
21422+
fi
21423+
else
21424+
pkg_failed=untried
21425+
fi
21426+
if test -n "$PROTOBUFC_LIBS"; then
21427+
pkg_cv_PROTOBUFC_LIBS="$PROTOBUFC_LIBS"
21428+
elif test -n "$PKG_CONFIG"; then
21429+
if test -n "$PKG_CONFIG" && \
21430+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libprotobuf-c\""; } >&5
21431+
($PKG_CONFIG --exists --print-errors "libprotobuf-c") 2>&5
21432+
ac_status=$?
21433+
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
21434+
test $ac_status = 0; }; then
21435+
pkg_cv_PROTOBUFC_LIBS=`$PKG_CONFIG --libs "libprotobuf-c" 2>/dev/null`
21436+
test "x$?" != "x0" && pkg_failed=yes
21437+
else
21438+
pkg_failed=yes
21439+
fi
21440+
else
21441+
pkg_failed=untried
21442+
fi
21443+
21444+
21445+
21446+
if test $pkg_failed = yes; then
21447+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21448+
$as_echo "no" >&6; }
21449+
21450+
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
21451+
_pkg_short_errors_supported=yes
21452+
else
21453+
_pkg_short_errors_supported=no
21454+
fi
21455+
if test $_pkg_short_errors_supported = yes; then
21456+
PROTOBUFC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libprotobuf-c" 2>&1`
21457+
else
21458+
PROTOBUFC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libprotobuf-c" 2>&1`
21459+
fi
21460+
# Put the nasty error message in config.log where it belongs
21461+
echo "$PROTOBUFC_PKG_ERRORS" >&5
21462+
21463+
21464+
as_fn_error $? "The protobuf-c package was not found with pkg-config. Please install protobuf-c!" "$LINENO" 5
21465+
21466+
elif test $pkg_failed = untried; then
21467+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21468+
$as_echo "no" >&6; }
21469+
21470+
as_fn_error $? "The protobuf-c package was not found with pkg-config. Please install protobuf-c!" "$LINENO" 5
21471+
21472+
else
21473+
PROTOBUFC_CFLAGS=$pkg_cv_PROTOBUFC_CFLAGS
21474+
PROTOBUFC_LIBS=$pkg_cv_PROTOBUFC_LIBS
21475+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
21476+
$as_echo "yes" >&6; }
21477+
21478+
CFLAGS="$CFLAGS $PROTOBUFC_CFLAGS"
21479+
LIBS="$LIBS $PROTOBUFC_LIBS"
21480+
21481+
fi
21482+
2140421483

2140521484
fi
2140621485

doc/Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
30 January 2024: Wouter
2+
- Merge #999: Search for protobuf-c with pkg-config.
3+
14
23 January 2024: Yorgos
25
- Update message TTL when using cached RRSETs. It could result in
36
non-expired messages with expired RRSETs (non-usable messages by

0 commit comments

Comments
 (0)