bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solaris and inet_pton


From: Bruno Haible
Subject: Re: Solaris and inet_pton
Date: Tue, 3 Nov 2009 01:05:33 +0100
User-agent: KMail/1.9.9

> 2009-11-02  Simon Josefsson  <address@hidden>
>             Bruno Haible  <address@hidden>
> 
>       * m4/inet_ntop.m4 (gl_INET_NTOP): Define also INET_NTOP_LIB.
>       * modules/inet_ntop (Link): New section.
>       Reported by Boyan Kasarov <address@hidden>.

The same problem exists also for the inet_pton module. I'm integrating Paul's
and your ideas, like this:


2009-11-02  Paul Eggert  <address@hidden>
            Simon Josefsson  <address@hidden>
            Bruno Haible  <address@hidden>

        Fix link error on Solaris 8.
        * m4/inet_pton.m4 (gl_INET_PTON): Search for the function inet_pton
        also in libnsl. Define also INET_PTON_LIB.
        * modules/inet_pton (Link): New section.

--- m4/inet_pton.m4.orig        2009-11-03 00:59:42.000000000 +0100
+++ m4/inet_pton.m4     2009-11-03 00:59:20.000000000 +0100
@@ -1,4 +1,4 @@
-# inet_pton.m4 serial 7
+# inet_pton.m4 serial 8
 dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,18 @@
 
   gl_REPLACE_ARPA_INET_H
 
-  AC_REPLACE_FUNCS([inet_pton])
+  dnl Most platforms that provide inet_pton define it in libc.
+  dnl Solaris 8..10 provide inet_pton in libnsl instead.
+  gl_save_LIBS=$LIBS
+  AC_SEARCH_LIBS([inet_pton], [nsl], [],
+    [AC_REPLACE_FUNCS([inet_pton])])
+  LIBS=$gl_save_LIBS
+  INET_PTON_LIB=
+  if test "$ac_cv_search_inet_pton" != "none needed"; then
+    INET_PTON_LIB="$ac_cv_search_inet_pton"
+  fi
+  AC_SUBST([INET_PTON_LIB])
+
   gl_PREREQ_INET_PTON
 ])
 
--- modules/inet_pton.orig      2009-11-03 00:59:42.000000000 +0100
+++ modules/inet_pton   2009-11-03 00:57:26.000000000 +0100
@@ -26,5 +26,8 @@
 Include:
 <arpa/inet.h>
 
+Link:
+$(INET_PTON_LIB)
+
 Maintainer:
 Simon Josefsson, glibc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]