Thread (24 messages) 24 messages, 8 authors, 2016-06-15

[PATCH] configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIBGEN tests

flat view
DORMANTno replies

From: Brandon Casey <hidden>
Date: 2016-06-15 22:47:05
Subsystem: the rest · Maintainer: Linus Torvalds

From: Brandon Casey <redacted>

The "action" parameters for these two tests were supplied incorrectly for
the way the tests were implemented.  The tests check whether a program
which calls hstrerror() or basename() successfully links when -lresolv or
-lgen are used, respectively.  A successful linking would result in
NEEDS_RESOLV or NEEDS_LIBGEN being unset, and failure would result in
setting the respective variable.

Aside from that issue, the tests did not handle the case where neither
library was necessary for accessing the functions in question.  So solve
both of these issues by re-working the two tests so that their form is like
the NEEDS_SOCKET test which attempts to link with just the c library, and
if it fails then assumes that the additional library is necessary and sets
the appropriate variable.

Signed-off-by: Brandon Casey <redacted>
---


Maybe this is the appropriate thing to do?

-brandon


 configure.ac |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 74d0af5..ba44cf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -479,13 +479,13 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
 # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
 # Notably on Solaris hstrerror resides in libresolv and on Solaris 7
 # inet_ntop and inet_pton additionally reside there.
-AC_CHECK_LIB([resolv], [hstrerror],
+AC_CHECK_LIB([c], [hstrerror],
 [NEEDS_RESOLV=],
 [NEEDS_RESOLV=YesPlease])
 AC_SUBST(NEEDS_RESOLV)
 test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
 
-AC_CHECK_LIB([gen], [basename],
+AC_CHECK_LIB([c], [basename],
 [NEEDS_LIBGEN=],
 [NEEDS_LIBGEN=YesPlease])
 AC_SUBST(NEEDS_LIBGEN)
-- 
1.6.3.1.24.g152f4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help