git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jeffrey Walton <noloader@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Fix inet_ntop and inet_pton on Solaris
Date: Fri, 14 Feb 2020 01:50:41 -0500	[thread overview]
Message-ID: <20200214065041.GF605125@coredump.intra.peff.net> (raw)
In-Reply-To: <CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com>

On Mon, Feb 03, 2020 at 10:22:46AM -0500, Jeffrey Walton wrote:

> inet_ntop and inet_pton were not being detected properly on modern on
> Solaris. This patch revisits the the socket gear configuration on
> SunOS and brings it up to date for Solaris 11.
> 
> According to configure.ac, the three or four functions of interest
> include hstrerror, inet_ntop and inet_pton. The libraries of interest
> are -lresolv -lsocket -lnsl. The configure tests now look for
> inet_ntop and inet_pton in -lsocket -lnsl per the man page. If not
> found, the configure tests fall back to existing behavior by searching
> in -lresolv. And if not found in -lresolv, then NO_INET_NTOP and
> NO_INET_PTON are set.

This makes sense, and the patch looks plausibly correct (which is the
best I can say given my general lack of autoconf knowledge).

I was a little surprised by this hunk:

> diff --git a/Makefile b/Makefile
> index 09f98b777c..7166b19ab4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1461,15 +1461,15 @@ ifndef LIBC_CONTAINS_LIBINTL
>  	EXTLIBS += -lintl
>  endif
>  endif
> +ifdef NEEDS_RESOLV
> +	EXTLIBS += -lresolv
> +endif
>  ifdef NEEDS_SOCKET
>  	EXTLIBS += -lsocket
>  endif
>  ifdef NEEDS_NSL
>  	EXTLIBS += -lnsl
>  endif
> -ifdef NEEDS_RESOLV
> -	EXTLIBS += -lresolv
> -endif

But I guess it is trying to mimic the "-lresolv -lsocket -lnsl" order
you mentioned in the Solaris manpage. You should be able to test if
that's necessary by compiling with:

  make NEEDS_RESOLV=Yes NEEDS_SOCKET=Yes NEEDS_NSL=Yes

If so, that ordering switch could probably happen as a separate commit
before the configure.ac change.

> diff --git a/configure.ac b/configure.ac
> index 66aedb9288..b83a0e970d 100644
> --- a/configure.ac
> +++ b/configure.ac

The rest of it looks OK to me. Do you want to send it as a regular Git
patch with a commit message and your signoff (see SubmittingPatches)?

-Peff

      parent reply	other threads:[~2020-02-14  6:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 15:22 Fix inet_ntop and inet_pton on Solaris Jeffrey Walton
2020-02-04  0:00 ` Jeffrey Walton
2020-02-14  6:50 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214065041.GF605125@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=noloader@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).