add more files pulled in via yesterday's gnulib upgrade

* gnulib/m4/multiarch.m4: New file.
* gnulib/m4/hostent.m4: New file.
* gnulib/m4/servent.m4: New file.
* .x-sc_prohibit_gethostby: Exempt all gnulib/m4/* files, so
hostent.m4's uses of gethostbyname and gethostbyaddr do not
trigger a "make syntax-check" failure.
This commit is contained in:
Jim Meyering 2009-01-07 17:11:02 +00:00
parent 55d0a68596
commit 7386d78e6d
5 changed files with 175 additions and 1 deletions

View File

@ -1,3 +1,3 @@
gnulib/lib/getaddrinfo.c
gnulib/m4/getaddrinfo.m4
gnulib/m4/
src/xend_internal.c

View File

@ -1,5 +1,13 @@
Wed Jan 7 17:12:33 +0100 2009 Jim Meyering <meyering@redhat.com>
add more files pulled in via yesterday's gnulib upgrade
* gnulib/m4/multiarch.m4: New file.
* gnulib/m4/hostent.m4: New file.
* gnulib/m4/servent.m4: New file.
* .x-sc_prohibit_gethostby: Exempt all gnulib/m4/* files, so
hostent.m4's uses of gethostbyname and gethostbyaddr do not
trigger a "make syntax-check" failure.
bootstrap: pull in gnulib's ioctl module
* bootstrap: Invoke gnulib-tool with its --no-vc-files
option, since we version-control the files it imports.

45
gnulib/m4/hostent.m4 Normal file
View File

@ -0,0 +1,45 @@
# hostent.m4 serial 1
dnl Copyright (C) 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.
AC_DEFUN([gl_HOSTENT],
[
dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
dnl gethostbyaddr() defined?
dnl - On Solaris, they are in libnsl. Ignore libxnet.
dnl - On Haiku, they are in libnetwork.
dnl - On BeOS, they are in libnet.
dnl - On native Windows, they are in ws2_32.dll.
dnl - Otherwise they are in libc.
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
HOSTENT_LIB=
gl_saved_libs="$LIBS"
AC_SEARCH_LIBS([gethostbyname], [nsl network net],
[if test "$ac_cv_search_gethostbyname" != "none required"; then
HOSTENT_LIB="$ac_cv_search_gethostbyname"
fi])
LIBS="$gl_saved_libs"
if test -z "$HOSTENT_LIB"; then
AC_CHECK_FUNCS([gethostbyname], , [
AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32],
[gl_cv_w32_gethostbyname],
[gl_cv_w32_gethostbyname=no
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
AC_TRY_LINK([
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <stddef.h>
], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes])
LIBS="$gl_save_LIBS"
])
if test "$gl_cv_w32_gethostbyname" = "yes"; then
HOSTENT_LIB="-lws2_32"
fi
])
fi
AC_SUBST([HOSTENT_LIB])
])

74
gnulib/m4/multiarch.m4 Normal file
View File

@ -0,0 +1,74 @@
# multiarch.m4 serial 3
dnl Copyright (C) 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.
# Determine whether the compiler is or may be producing universal binaries.
#
# On MacOS X 10.5 and later systems, the user can create libraries and
# executables that work on multiple system types--known as "fat" or
# "universal" binaries--by specifying multiple '-arch' options to the
# compiler but only a single '-arch' option to the preprocessor. Like
# this:
#
# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
# CPP="gcc -E" CXXCPP="g++ -E"
#
# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
AC_DEFUN([gl_MULTIARCH],
[
dnl This AC_REQUIRE is not necessary in theory. It works around a bug in
dnl autoconf <= 2.63: AC_REQUIRE invocations inside AC_REQUIREd macros are
dnl being handled better than AC_REQUIRE invocations inside normally invoked
dnl macros.
AC_REQUIRE([gl_MULTIARCH_BODY])
])
AC_DEFUN([gl_MULTIARCH_BODY],
[
dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
gl_cv_c_multiarch=no
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifndef __APPLE_CC__
not a universal capable compiler
#endif
typedef int dummy;
]])],
[
dnl Check for potential -arch flags. It is not universal unless
dnl there are at least two -arch flags with different values.
arch=
prev=
for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
if test -n "$prev"; then
case $word in
i?86 | x86_64 | ppc | ppc64)
if test -z "$arch" || test "$arch" = "$word"; then
arch="$word"
else
gl_cv_c_multiarch=yes
fi
;;
esac
prev=
else
if test "x$word" = "x-arch"; then
prev=arch
fi
fi
done
])
if test $gl_cv_c_multiarch = yes; then
AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
[Define if the compiler is building for multiple architectures of Apple platforms at once.])
APPLE_UNIVERSAL_BUILD=1
else
APPLE_UNIVERSAL_BUILD=0
fi
AC_SUBST([APPLE_UNIVERSAL_BUILD])
])

47
gnulib/m4/servent.m4 Normal file
View File

@ -0,0 +1,47 @@
# servent.m4 serial 1
dnl Copyright (C) 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.
AC_DEFUN([gl_SERVENT],
[
dnl Where are getservent(), setservent(), endservent(), getservbyname(),
dnl getservbyport() defined?
dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(),
dnl getprotobynumber() defined?
dnl - On Solaris, they are in libsocket. Ignore libxnet.
dnl - On Haiku, they are in libnetwork.
dnl - On BeOS, they are in libnet.
dnl - On native Windows, they are in ws2_32.dll.
dnl - Otherwise they are in libc.
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
SERVENT_LIB=
gl_saved_libs="$LIBS"
AC_SEARCH_LIBS([getservbyname], [socket network net],
[if test "$ac_cv_search_getservbyname" != "none required"; then
SERVENT_LIB="$ac_cv_search_getservbyname"
fi])
LIBS="$gl_saved_libs"
if test -z "$SERVENT_LIB"; then
AC_CHECK_FUNCS([getservbyname], , [
AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32],
[gl_cv_w32_getservbyname],
[gl_cv_w32_getservbyname=no
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
AC_TRY_LINK([
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <stddef.h>
], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes])
LIBS="$gl_save_LIBS"
])
if test "$gl_cv_w32_getservbyname" = "yes"; then
SERVENT_LIB="-lws2_32"
fi
])
fi
AC_SUBST([SERVENT_LIB])
])