[libvirt] 3 small patches

Jim Meyering jim at meyering.net
Wed Jan 7 15:48:36 UTC 2009


1: cvs-ignore a stray, generated file
2: bootstrap: pull in gnulib's ioctl module (Daniel Berrange will
    use it shortly)
3: add more files pulled in via yesterday's gnulib upgrade

The third is highest priority, since without it, running
autogen.sh from just-checked-out sources fails due to 3 missing
.m4 files.  This isn't the first time that's happened.  I tracked
the problem to the way gnulib-tool updates .cvsignore files to
mark pulled-in files as ignored, by default.  That made it
hard to use vc tools like cvs or git to identify new files.
The 2nd patch adds gnulib-tools' --no-vc-files option to inhibit
that behavior.

>From 4b63b91ff4b8308cfde641686ea22ff51499bb00 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Wed, 7 Jan 2009 15:43:41 +0100
Subject: [PATCH 1/3] ignore generated libvirtd.logrotate.

* qemud/.cvsignore: Add libvirtd.logrotate.
* qemud/.gitignore: Regenerate.
---
 qemud/.cvsignore |   13 +++++++------
 qemud/.gitignore |   13 +++++++------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/qemud/.cvsignore b/qemud/.cvsignore
index 04fed54..38cf28d 100644
--- a/qemud/.cvsignore
+++ b/qemud/.cvsignore
@@ -1,11 +1,12 @@
-Makefile
-Makefile.in
+*.gcda
+*.gcno
+*.la
+*.lo
 .deps
 .libs
-*.lo
-*.la
+Makefile
+Makefile.in
 libvirt_qemud
 libvirtd
 libvirtd.init
-*.gcno
-*.gcda
+libvirtd.logrotate
diff --git a/qemud/.gitignore b/qemud/.gitignore
index 04fed54..38cf28d 100644
--- a/qemud/.gitignore
+++ b/qemud/.gitignore
@@ -1,11 +1,12 @@
-Makefile
-Makefile.in
+*.gcda
+*.gcno
+*.la
+*.lo
 .deps
 .libs
-*.lo
-*.la
+Makefile
+Makefile.in
 libvirt_qemud
 libvirtd
 libvirtd.init
-*.gcno
-*.gcda
+libvirtd.logrotate
--
1.6.1.121.g866a4a


>From 8d6654775a277eca6bf52b011671920091cde9a4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Wed, 7 Jan 2009 16:11:02 +0100
Subject: [PATCH 2/3] 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.
This tells it not to mark imported files as cvs-ignored.
(modules): Add ioctl.
* gnulib/lib/ioctl.c: New file.
* gnulib/lib/sys_ioctl.in.h: New file.
* gnulib/tests/sys_ioctl.in.h: Removed.
* gnulib/tests/ioctl.c: Removed.
* gnulib/lib/Makefile.am: Update.
* gnulib/m4/gnulib-cache.m4: Likewise.
* gnulib/m4/gnulib-comp.m4: Likewise.
* gnulib/tests/Makefile.am: Likewise.
* gnulib/lib/.cvsignore: Ignore sys_ioctl.h.
* gnulib/lib/.gitignore: Regenerate.
---
 bootstrap                            |    2 +
 gnulib/lib/.cvsignore                |    1 +
 gnulib/lib/.gitignore                |    1 +
 gnulib/lib/Makefile.am               |   38 +++++++++++++++++++++++++++++++++-
 gnulib/{tests => lib}/ioctl.c        |    8 +++---
 gnulib/{tests => lib}/sys_ioctl.in.h |    8 +++---
 gnulib/m4/gnulib-cache.m4            |    4 ++-
 gnulib/m4/gnulib-comp.m4             |   22 +++++++++---------
 gnulib/tests/Makefile.am             |   36 --------------------------------
 9 files changed, 63 insertions(+), 57 deletions(-)
 rename gnulib/{tests => lib}/ioctl.c (78%)
 rename gnulib/{tests => lib}/sys_ioctl.in.h (85%)

diff --git a/bootstrap b/bootstrap
index c5487b2..38dd3ae 100755
--- a/bootstrap
+++ b/bootstrap
@@ -73,6 +73,7 @@ gethostname
 getpass
 gettext
 inet_pton
+ioctl
 mkstemp
 mktempd
 perror
@@ -100,6 +101,7 @@ vc-list-files
 #   put *.[ch] files in new gnulib/lib/ dir.

 $gnulib_tool			\
+  --no-vc-files			\
   --lgpl=2			\
   --with-tests			\
   --m4-base=gnulib/m4		\
diff --git a/gnulib/lib/.cvsignore b/gnulib/lib/.cvsignore
index 5a82aa0..9d6b35f 100644
--- a/gnulib/lib/.cvsignore
+++ b/gnulib/lib/.cvsignore
@@ -16,6 +16,7 @@ stdint.h
 stdio.h
 stdlib.h
 string.h
+sys_ioctl.h
 sys_select.h
 sys_socket.h
 sys_stat.h
diff --git a/gnulib/lib/.gitignore b/gnulib/lib/.gitignore
index 5a82aa0..9d6b35f 100644
--- a/gnulib/lib/.gitignore
+++ b/gnulib/lib/.gitignore
@@ -16,6 +16,7 @@ stdint.h
 stdio.h
 stdlib.h
 string.h
+sys_ioctl.h
 sys_select.h
 sys_socket.h
 sys_stat.h
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index 528142e..746881c 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify

 AUTOMAKE_OPTIONS = 1.5 gnits

@@ -291,6 +291,15 @@ EXTRA_DIST += intprops.h

 ## end   gnulib module intprops

+## begin gnulib module ioctl
+
+
+EXTRA_DIST += ioctl.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += ioctl.c
+
+## end   gnulib module ioctl
+
 ## begin gnulib module link-warning

 LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
@@ -831,6 +840,33 @@ EXTRA_libgnu_la_SOURCES += strsep.c

 ## end   gnulib module strsep

+## begin gnulib module sys_ioctl
+
+BUILT_SOURCES += $(SYS_IOCTL_H)
+
+# We need the following in order to create <sys/ioctl.h> when the system
+# does not have a complete one.
+sys/ioctl.h: sys_ioctl.in.h
+	@MKDIR_P@ sys
+	rm -f $@-t $@
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
+	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
+	      -e 's|@''GNULIB_IOCTL''@|$(GNULIB_IOCTL)|g' \
+	      -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
+	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+	      < $(srcdir)/sys_ioctl.in.h; \
+	} > $@-t
+	mv $@-t $@
+MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_ioctl.in.h
+
+## end   gnulib module sys_ioctl
+
 ## begin gnulib module sys_select

 BUILT_SOURCES += $(SYS_SELECT_H)
diff --git a/gnulib/tests/ioctl.c b/gnulib/lib/ioctl.c
similarity index 78%
rename from gnulib/tests/ioctl.c
rename to gnulib/lib/ioctl.c
index a23d363..77e0101 100644
--- a/gnulib/tests/ioctl.c
+++ b/gnulib/lib/ioctl.c
@@ -3,16 +3,16 @@
    Copyright (C) 2008 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GNU Lesser General Public License for more details.

-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

 /* Written by Paolo Bonzini */
diff --git a/gnulib/tests/sys_ioctl.in.h b/gnulib/lib/sys_ioctl.in.h
similarity index 85%
rename from gnulib/tests/sys_ioctl.in.h
rename to gnulib/lib/sys_ioctl.in.h
index 65c2c4a..6ce02d4 100644
--- a/gnulib/tests/sys_ioctl.in.h
+++ b/gnulib/lib/sys_ioctl.in.h
@@ -2,16 +2,16 @@
    Copyright (C) 2008 Free Software Foundation, Inc.

    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3, or (at your option)
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1, or (at your option)
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GNU Lesser General Public License for more details.

-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4
index 9eb6064..77a285f 100644
--- a/gnulib/m4/gnulib-cache.m4
+++ b/gnulib/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@


 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify

 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
@@ -28,6 +28,7 @@ gl_MODULES([
   getpass
   gettext
   inet_pton
+  ioctl
   mkstemp
   mktempd
   perror
@@ -61,3 +62,4 @@ gl_MAKEFILE_NAME([])
 gl_LIBTOOL
 gl_MACRO_PREFIX([gl])
 gl_PO_DOMAIN([])
+gl_VC_FILES([false])
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index 072b9f0..1393b97 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -82,6 +82,13 @@ AC_SUBST([LTALLOCA])
   gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
   gl_INET_PTON
   gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([ioctl])
+    gl_REPLACE_SYS_IOCTL_H
+  fi
+  gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
+  gl_MODULE_INDICATOR([ioctl])
   gl_FUNC_LSEEK
   gl_UNISTD_MODULE_INDICATOR([lseek])
   gl_FUNC_LSTAT
@@ -141,6 +148,8 @@ AC_SUBST([LTALLOCA])
   gl_STRING_MODULE_INDICATOR([strnlen])
   gl_FUNC_STRSEP
   gl_STRING_MODULE_INDICATOR([strsep])
+  gl_SYS_IOCTL_H
+  AC_PROG_MKDIR_P
   gl_HEADER_SYS_SELECT
   AC_PROG_MKDIR_P
   gl_HEADER_SYS_SOCKET
@@ -213,13 +222,6 @@ AC_SUBST([LTALLOCA])
   gl_SYS_SOCKET_MODULE_INDICATOR([bind])
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])
   if test "$ac_cv_header_winsock2_h" = yes; then
-    AC_LIBOBJ([ioctl])
-    gl_REPLACE_SYS_IOCTL_H
-  fi
-  gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
-  gl_MODULE_INDICATOR([ioctl])
-  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
-  if test "$ac_cv_header_winsock2_h" = yes; then
     AC_LIBOBJ([listen])
   fi
   gl_SYS_SOCKET_MODULE_INDICATOR([listen])
@@ -227,8 +229,6 @@ AC_SUBST([LTALLOCA])
   gl_SOCKETS
   gt_TYPE_WCHAR_T
   gt_TYPE_WINT_T
-  gl_SYS_IOCTL_H
-  AC_PROG_MKDIR_P
   AC_CHECK_FUNCS([shutdown])
   abs_aux_dir=`cd "$ac_aux_dir"; pwd`
   AC_SUBST([abs_aux_dir])
@@ -354,6 +354,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/inet_ntop.c
   lib/inet_pton.c
   lib/intprops.h
+  lib/ioctl.c
   lib/lseek.c
   lib/lstat.c
   lib/malloc.c
@@ -388,6 +389,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/strndup.c
   lib/strnlen.c
   lib/strsep.c
+  lib/sys_ioctl.in.h
   lib/sys_select.in.h
   lib/sys_socket.in.h
   lib/sys_stat.in.h
@@ -535,10 +537,8 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-wchar.c
   tests=lib/accept.c
   tests=lib/bind.c
-  tests=lib/ioctl.c
   tests=lib/listen.c
   tests=lib/sockets.c
   tests=lib/sockets.h
-  tests=lib/sys_ioctl.in.h
   tests=lib/w32sock.h
 ])
diff --git a/gnulib/tests/Makefile.am b/gnulib/tests/Makefile.am
index 4273d6c..ea40a21 100644
--- a/gnulib/tests/Makefile.am
+++ b/gnulib/tests/Makefile.am
@@ -150,15 +150,6 @@ EXTRA_DIST += test-gettimeofday.c

 ## end   gnulib module gettimeofday-tests

-## begin gnulib module ioctl
-
-
-EXTRA_DIST += ioctl.c w32sock.h
-
-EXTRA_libtests_a_SOURCES += ioctl.c
-
-## end   gnulib module ioctl
-
 ## begin gnulib module listen


@@ -298,33 +289,6 @@ EXTRA_DIST += test-string.c

 ## end   gnulib module string-tests

-## begin gnulib module sys_ioctl
-
-BUILT_SOURCES += $(SYS_IOCTL_H)
-
-# We need the following in order to create <sys/ioctl.h> when the system
-# does not have a complete one.
-sys/ioctl.h: sys_ioctl.in.h
-	@MKDIR_P@ sys
-	rm -f $@-t $@
-	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-	  sed -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-	      -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
-	      -e 's|@''GNULIB_IOCTL''@|$(GNULIB_IOCTL)|g' \
-	      -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-	      < $(srcdir)/sys_ioctl.in.h; \
-	} > $@-t
-	mv $@-t $@
-MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t
-MOSTLYCLEANDIRS += sys
-
-EXTRA_DIST += sys_ioctl.in.h
-
-## end   gnulib module sys_ioctl
-
 ## begin gnulib module sys_select-tests

 TESTS += test-sys_select
--
1.6.1.121.g866a4a


>From ca8eae50325df82b8f44d75bb80c3812d07fc30c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Wed, 7 Jan 2009 16:13:08 +0100
Subject: [PATCH 3/3] 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 does not
trigger a "make syntax-check" failure.
---
 .x-sc_prohibit_gethostby |    2 +-
 gnulib/m4/hostent.m4     |   45 ++++++++++++++++++++++++++++
 gnulib/m4/multiarch.m4   |   74 ++++++++++++++++++++++++++++++++++++++++++++++
 gnulib/m4/servent.m4     |   47 +++++++++++++++++++++++++++++
 4 files changed, 167 insertions(+), 1 deletions(-)
 create mode 100644 gnulib/m4/hostent.m4
 create mode 100644 gnulib/m4/multiarch.m4
 create mode 100644 gnulib/m4/servent.m4

diff --git a/.x-sc_prohibit_gethostby b/.x-sc_prohibit_gethostby
index d74ea40..c771142 100644
--- a/.x-sc_prohibit_gethostby
+++ b/.x-sc_prohibit_gethostby
@@ -1,3 +1,3 @@
 gnulib/lib/getaddrinfo.c
-gnulib/m4/getaddrinfo.m4
+gnulib/m4/
 src/xend_internal.c
diff --git a/gnulib/m4/hostent.m4 b/gnulib/m4/hostent.m4
new file mode 100644
index 0000000..4a96af7
--- /dev/null
+++ b/gnulib/m4/hostent.m4
@@ -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])
+])
diff --git a/gnulib/m4/multiarch.m4 b/gnulib/m4/multiarch.m4
new file mode 100644
index 0000000..7b73e15
--- /dev/null
+++ b/gnulib/m4/multiarch.m4
@@ -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])
+])
diff --git a/gnulib/m4/servent.m4 b/gnulib/m4/servent.m4
new file mode 100644
index 0000000..242f9e3
--- /dev/null
+++ b/gnulib/m4/servent.m4
@@ -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])
+])
--
1.6.1.121.g866a4a




More information about the libvir-list mailing list