"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Anna Vyalkova <cyber+misc@sysrq.in>
Subject:
[PATCH 2/4] portable: fix libs overrided with -lresolv
To:
gameoftrees@openbsd.org
Date:
Wed, 22 Mar 2023 21:58:35 +0500

Download raw body.

Thread
This fixes some checks that failed because -lbsd wasn't included.
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index dd33ca1d0..9e363bbde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -369,6 +369,7 @@ AC_MSG_RESULT($found_b64_ntop)
 libresolv_LIBS=""
 if test "x$found_b64_ntop" = xno; then
 	AC_MSG_CHECKING(for b64_ntop with -lresolv)
+	SAVED_LIBS="$LIBS"
 	LIBS="-lresolv"
 	AC_LINK_IFELSE([AC_LANG_PROGRAM(
 		[
@@ -384,9 +385,11 @@ if test "x$found_b64_ntop" = xno; then
 	)
 	AC_MSG_RESULT($found_b64_ntop)
 	libresolv_LIBS="$LIBS"
+	LIBS="$SAVED_LIBS"
 fi
 if test "x$found_b64_ntop" = xno; then
 	AC_MSG_CHECKING(for b64_ntop with -lnetwork)
+	SAVED_LIBS="$LIBS"
 	LIBS="-lresolv -lnetwork"
 	AC_LINK_IFELSE([AC_LANG_PROGRAM(
 		[
@@ -402,6 +405,7 @@ if test "x$found_b64_ntop" = xno; then
 	)
 	AC_MSG_RESULT($found_b64_ntop)
 	libresolv_LIBS="$LIBS"
+	LIBS="$SAVED_LIBS"
 fi
 
 AM_CONDITIONAL([HAVE_B64], [test "x$found_b64_ntop" = xyes])
-- 
2.40.0