summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--m4/arpa_inet_h.m421
-rw-r--r--modules/arpa_inet6
-rw-r--r--modules/inet_ntop1
-rw-r--r--modules/inet_pton1
5 files changed, 42 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e81a4e3d6e..2e0ac514e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-04-23 Simon Josefsson <simon@josefsson.org>
+
+ * lib/arpa_inet.in.h: New file.
+
+ * modules/arpa_inet (Files): Add lib/arpa_inet.in.h.
+ (Makefile.am): Sed in substitute header file.
+
+ * m4/arpa_inet_h.m4: Add gl_ARPA_INET_H_DEFAULTS and
+ gl_ARPA_INET_MODULE_INDICATOR. Use them.
+
+ * modules/inet_ntop (configure.ac): Use
+ gl_ARPA_INET_MODULE_INDICATOR.
+
+ * modules/inet_pton (configure.ac): Use
+ gl_ARPA_INET_MODULE_INDICATOR.
+
2008-04-22 Jim Meyering <meyering@redhat.com>
* modules/verify (License): Re-license as LGPLv2+.
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index d01d0984e3..8f530c5e7a 100644
--- a/m4/arpa_inet_h.m4
+++ b/m4/arpa_inet_h.m4
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 1
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 2
+dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,6 +8,10 @@ dnl Written by Simon Josefsson
AC_DEFUN([gl_HEADER_ARPA_INET],
[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
AC_CHECK_HEADERS_ONCE([arpa/inet.h])
if test $ac_cv_header_arpa_inet_h = yes; then
ARPA_INET_H=''
@@ -16,3 +20,16 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
fi
AC_SUBST(ARPA_INET_H)
])
+
+AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+ GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
+[
+ GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
+ GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
+])
diff --git a/modules/arpa_inet b/modules/arpa_inet
index 5193952323..e5934accbf 100644
--- a/modules/arpa_inet
+++ b/modules/arpa_inet
@@ -2,6 +2,7 @@ Description:
A <arpa/inet.h> for systems lacking it (e.g., Mingw).
Files:
+lib/arpa_inet.in.h
m4/arpa_inet_h.m4
Depends-on:
@@ -20,7 +21,10 @@ arpa/inet.h:
@MKDIR_P@ arpa
rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- echo '#include <sys/socket.h>'; \
+ sed \
+ -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
+ -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
+ < $(srcdir)/arpa_inet.in.h; \
} > $@-t
mv $@-t $@
MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
diff --git a/modules/inet_ntop b/modules/inet_ntop
index 544ab87111..1779359ea5 100644
--- a/modules/inet_ntop
+++ b/modules/inet_ntop
@@ -14,6 +14,7 @@ netinet_in
configure.ac:
gl_INET_NTOP
+gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
Makefile.am:
diff --git a/modules/inet_pton b/modules/inet_pton
index c9a4fac326..3b6166d800 100644
--- a/modules/inet_pton
+++ b/modules/inet_pton
@@ -14,6 +14,7 @@ netinet_in
configure.ac:
gl_INET_PTON
+gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
Makefile.am: