From 60d5a50f4d3d9e2c2f5a7d42a6859de709bda3f6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 5 Aug 2011 10:54:19 +0100 Subject: [PATCH] daemon: Remove separate configure of daemon subdirectory. Combine the two Gnulib instances together. Add checks from old daemon/configure.ac into configure.ac. Fix daemon/Makefile.am so it is like a normal subdirectory Makefile.am. Because we are now using the replacement strerror_r function from Gnulib (instead of the one from glibc directly), this requires a small change to src/guestfs.c. --- bootstrap | 20 ++++ configure.ac | 114 ++++++++++++++++++++-- daemon/.gitignore | 205 ---------------------------------------- daemon/Makefile.am | 23 ++--- daemon/README | 1 - daemon/configure.ac | 235 ---------------------------------------------- daemon/m4/gnulib-cache.m4 | 63 ------------- m4/.gitignore | 39 ++++++++ src/guestfs.c | 6 -- 9 files changed, 175 insertions(+), 531 deletions(-) delete mode 100644 daemon/.gitignore delete mode 100644 daemon/README delete mode 100644 daemon/configure.ac delete mode 100644 daemon/m4/gnulib-cache.m4 diff --git a/bootstrap b/bootstrap index 0dd31a9..7efd838 100755 --- a/bootstrap +++ b/bootstrap @@ -45,14 +45,21 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool modules=' arpa_inet +byteswap c-ctype closeout +connect error filevercmp +fsusage fts full-read full-write +futimens +getaddrinfo +getline gitlog-to-changelog +glob gnu-make gnumakefile hash @@ -62,12 +69,25 @@ ignore-value lock maintainer-makefile manywarnings +mkdtemp +netdb netinet_in +openat +perror +pread progname +read-file +readlink +select setenv +sleep +socket strchrnul strerror strndup +symlinkat +sys_select +sys_wait vasprintf vc-list-files warnings diff --git a/configure.ac b/configure.ac index 4ac0ad9..eea5952 100644 --- a/configure.ac +++ b/configure.ac @@ -153,14 +153,72 @@ AC_SYS_LARGEFILE dnl Check sizeof long. AC_CHECK_SIZEOF([long]) +dnl Check if dirent (readdir) supports d_type member. +AC_STRUCT_DIRENT_D_TYPE + +dnl Check if stat has the required fields. +AC_STRUCT_ST_BLOCKS +AC_CHECK_MEMBER([struct stat.st_blksize],[ + AC_DEFINE([HAVE_STRUCT_STAT_ST_BLKSIZE],[1],[Define to 1 if 'st_blksize' is a member of 'struct stat'])]) + dnl Define a C symbol for the host CPU architecture. AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.]) dnl Headers. -AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h endian.h byteswap.h]) +AC_CHECK_HEADERS([\ + attr/xattr.h \ + byteswap.h \ + endian.h \ + errno.h \ + printf.h \ + sys/inotify.h \ + sys/socket.h \ + sys/statvfs.h \ + sys/types.h \ + sys/un.h \ + sys/wait.h \ + windows.h \ + sys/xattr.h]) dnl Functions. -AC_CHECK_FUNCS([futimens posix_fallocate]) +AC_CHECK_FUNCS([\ + futimens \ + getxattr \ + htonl \ + htons \ + inotify_init1 \ + lgetxattr \ + listxattr \ + llistxattr \ + lsetxattr \ + lremovexattr \ + mknod \ + ntohl \ + ntohs \ + posix_fallocate \ + realpath \ + removexattr \ + setitimer \ + setxattr \ + sigaction \ + statvfs \ + sync]) + +dnl For modified printf in the daemon, we need glibc either (old-style) +dnl register_printf_function or (new-style) register_printf_specifier. +AC_CHECK_FUNC([register_printf_specifier],[ + AC_DEFINE([HAVE_REGISTER_PRINTF_SPECIFIER],[1], + [Define to 1 if you have new-style register_printf_specifier]) + ],[ + AC_CHECK_FUNC([register_printf_function],[ + AC_DEFINE([HAVE_REGISTER_PRINTF_FUNCTION],[1], + [Define to 1 if you have old-style register_printf_function]) + ],[ + AC_MSG_FAILURE( +[No support for glibc-style extended printf formatters. + +This means you either have a very old glibc (pre-2.0) or you +are using some other libc where this is not supported.])])]) dnl Build the daemon? AC_MSG_CHECKING([if we should build the daemon]) @@ -172,6 +230,18 @@ AC_ARG_ENABLE([daemon], AM_CONDITIONAL([ENABLE_DAEMON],[test "x$enable_daemon" = "xyes"]) AC_MSG_RESULT([$enable_daemon]) +if test "x$enable_daemon" = "xyes"; then + dnl Install the daemon (for libguestfs live service) + AC_MSG_CHECKING([if we should install the daemon]) + AC_ARG_ENABLE([install-daemon], + [AS_HELP_STRING([--enable-install-daemon], + [enable installing the daemon under $sbindir @<:@default=no@:>@])], + [], + [enable_install_daemon=no]) + AM_CONDITIONAL([INSTALL_DAEMON],[test "x$enable_install_daemon" = "xyes"]) + AC_MSG_RESULT([$enable_install_daemon]) +fi + dnl Build the appliance? AC_MSG_CHECKING([if we should build the appliance]) AC_ARG_ENABLE([appliance], @@ -230,6 +300,40 @@ AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) ]) +dnl Check for Augeas (now optional). +AC_CHECK_LIB([augeas],[aug_match],[ + have_augeas=yes + AUGEAS_LIB="-laugeas" + + old_LIBS="$LIBS" + LIBS="$LIBS $AUGEAS_LIB" + dnl Check for functions not available in earlier versions of Augeas. + AC_CHECK_FUNCS([aug_load aug_defvar aug_defnode]) + LIBS="$old_LIBS" + + ],[have_augeas=no]) +if test "x$have_augeas" = "xyes"; then + AC_DEFINE([HAVE_AUGEAS],[1],[Define to 1 if you have Augeas]) +fi +AC_SUBST([AUGEAS_LIB]) + +dnl Check for libselinux (optional). +AC_CHECK_HEADERS([selinux/selinux.h]) +AC_CHECK_LIB([selinux],[setexeccon],[ + have_libselinux="$ac_cv_header_selinux_selinux_h" + SELINUX_LIB="-lselinux" + + old_LIBS="$LIBS" + LIBS="$LIBS $SELINUX_LIB" + AC_CHECK_FUNCS([setcon getcon]) + LIBS="$old_LIBS" + + ],[have_libselinux=no]) +if test "x$have_libselinux" = "xyes"; then + AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) +fi +AC_SUBST([SELINUX_LIB]) + dnl Check for cpio which isn't in the default Pardus install amazingly. AC_CHECK_PROG([CPIO],[cpio],[cpio],[no]) test "x$CPIO" = "xno" && @@ -800,11 +904,6 @@ dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool' AC_SUBST([LIBTOOL]) -dnl Run in subdirs. -if test "x$enable_daemon" = "xyes"; then - AC_CONFIG_SUBDIRS([daemon]) -fi - dnl Produce output files. AC_CONFIG_HEADERS([config.h]) dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html @@ -816,6 +915,7 @@ AC_CONFIG_FILES([Makefile cat/Makefile caution/Makefile csharp/Makefile + daemon/Makefile debian/changelog df/Makefile edit/Makefile diff --git a/daemon/.gitignore b/daemon/.gitignore deleted file mode 100644 index 76cd506..0000000 --- a/daemon/.gitignore +++ /dev/null @@ -1,205 +0,0 @@ -build-aux -lib -link-warning.h -m4/00gnulib.m4 -m4/alloca.m4 -m4/arpa_inet_h.m4 -m4/asm-underscore.m4 -m4/btowc.m4 -m4/byteswap.m4 -m4/canonicalize-lgpl.m4 -m4/chdir-long.m4 -m4/chown.m4 -m4/clock_time.m4 -m4/cloexec.m4 -m4/close.m4 -m4/codeset.m4 -m4/configmake.m4 -m4/d-ino.m4 -m4/d-type.m4 -m4/dirent_h.m4 -m4/dirfd.m4 -m4/dirname.m4 -m4/dos.m4 -m4/double-slash-root.m4 -m4/dup2.m4 -m4/eealloc.m4 -m4/environ.m4 -m4/errno_h.m4 -m4/error.m4 -m4/exitfail.m4 -m4/extensions.m4 -m4/fchdir.m4 -m4/fclose.m4 -m4/fcntl-o.m4 -m4/fcntl-safer.m4 -m4/fcntl.m4 -m4/fcntl_h.m4 -m4/fdopendir.m4 -m4/fflush.m4 -m4/filenamecat.m4 -m4/float_h.m4 -m4/fnmatch.m4 -m4/fpurge.m4 -m4/freading.m4 -m4/fseeko.m4 -m4/fsusage.m4 -m4/ftell.m4 -m4/ftello.m4 -m4/futimens.m4 -m4/getaddrinfo.m4 -m4/getcwd-abort-bug.m4 -m4/getcwd-path-max.m4 -m4/getcwd.m4 -m4/getdelim.m4 -m4/getdtablesize.m4 -m4/getgroups.m4 -m4/getline.m4 -m4/getlogin_r.m4 -m4/getpagesize.m4 -m4/gettime.m4 -m4/gettimeofday.m4 -m4/getugroups.m4 -m4/glibc21.m4 -m4/glob.m4 -m4/gnulib-common.m4 -m4/gnulib-comp.m4 -m4/gnulib-tool.m4 -m4/hash.m4 -m4/hostent.m4 -m4/include_next.m4 -m4/inet_ntop.m4 -m4/inet_pton.m4 -m4/inline.m4 -m4/intlmacosx.m4 -m4/intmax_t.m4 -m4/inttostr.m4 -m4/inttypes-pri.m4 -m4/inttypes.m4 -m4/inttypes_h.m4 -m4/ioctl.m4 -m4/lchown.m4 -m4/lcmessage.m4 -m4/lib-ld.m4 -m4/lib-link.m4 -m4/lib-prefix.m4 -m4/localcharset.m4 -m4/locale-fr.m4 -m4/locale-ja.m4 -m4/locale-zh.m4 -m4/locale_h.m4 -m4/localename.m4 -m4/lock.m4 -m4/longlong.m4 -m4/lseek.m4 -m4/lstat.m4 -m4/malloc.m4 -m4/malloca.m4 -m4/manywarnings.m4 -m4/mbrtowc.m4 -m4/mbsinit.m4 -m4/mbsrtowcs.m4 -m4/mbstate_t.m4 -m4/mbtowc.m4 -m4/memchr.m4 -m4/mempcpy.m4 -m4/memrchr.m4 -m4/mgetgroups.m4 -m4/mkdir.m4 -m4/mkdtemp.m4 -m4/mmap-anon.m4 -m4/mode_t.m4 -m4/multiarch.m4 -m4/netdb_h.m4 -m4/netinet_in_h.m4 -m4/onceonly.m4 -m4/open.m4 -m4/openat.m4 -m4/pathmax.m4 -m4/perror.m4 -m4/pipe.m4 -m4/pread.m4 -m4/printf.m4 -m4/priv-set.m4 -m4/putenv.m4 -m4/rawmemchr.m4 -m4/read-file.m4 -m4/read.m4 -m4/readlink.m4 -m4/realloc.m4 -m4/rmdir.m4 -m4/safe-read.m4 -m4/safe-write.m4 -m4/save-cwd.m4 -m4/select.m4 -m4/servent.m4 -m4/setenv.m4 -m4/setlocale.m4 -m4/size_max.m4 -m4/sleep.m4 -m4/snprintf.m4 -m4/socketlib.m4 -m4/sockets.m4 -m4/socklen.m4 -m4/sockpfaf.m4 -m4/ssize_t.m4 -m4/stat-time.m4 -m4/stat.m4 -m4/stdbool.m4 -m4/stddef_h.m4 -m4/stdint.m4 -m4/stdint_h.m4 -m4/stdio_h.m4 -m4/stdlib_h.m4 -m4/strchrnul.m4 -m4/strdup.m4 -m4/strerror.m4 -m4/strerror_r.m4 -m4/string_h.m4 -m4/strndup.m4 -m4/strnlen.m4 -m4/symlink.m4 -m4/symlinkat.m4 -m4/sys_ioctl_h.m4 -m4/sys_select_h.m4 -m4/sys_socket_h.m4 -m4/sys_stat_h.m4 -m4/sys_time_h.m4 -m4/sys_uio_h.m4 -m4/sys_wait_h.m4 -m4/tempname.m4 -m4/thread.m4 -m4/threadlib.m4 -m4/time_h.m4 -m4/timespec.m4 -m4/ungetc.m4 -m4/unistd-safer.m4 -m4/unistd_h.m4 -m4/unlink.m4 -m4/unlinkdir.m4 -m4/usleep.m4 -m4/utimbuf.m4 -m4/utimecmp.m4 -m4/utimens.m4 -m4/utimes.m4 -m4/vasnprintf.m4 -m4/vasprintf.m4 -m4/warn-on-use.m4 -m4/warnings.m4 -m4/wchar.m4 -m4/wchar_h.m4 -m4/wchar_t.m4 -m4/wcrtomb.m4 -m4/wctob.m4 -m4/wctomb.m4 -m4/wctype.m4 -m4/wctype_h.m4 -m4/wint_t.m4 -m4/write.m4 -m4/xalloc.m4 -m4/xgetcwd.m4 -m4/xsize.m4 -m4/xstrndup.m4 -m4/yield.m4 -mingw32-config.cache -tests diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3fe8c88..2fe6573 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -1,5 +1,5 @@ # libguestfs-daemon -# Copyright (C) 2010 Red Hat Inc. +# Copyright (C) 2011 Red Hat 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 @@ -15,24 +15,15 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -ACLOCAL_AMFLAGS = -I m4 +include $(top_srcdir)/subdir-rules.mk -SUBDIRS = lib tests . - -libsrcdir = $(top_builddir)/../src -generatorsrcdir = $(top_builddir)/../generator +libsrcdir = $(top_builddir)/src generator_built = \ actions.h \ stubs.c \ names.c -.PHONY: force - -$(generator_built): $(generatorsrcdir)/stamp-generator -$(generatorsrcdir)/stamp-generator: force - $(MAKE) -C $(generatorsrcdir) stamp-generator - BUILT_SOURCES = \ $(generator_built) \ guestfs_protocol.c \ @@ -172,7 +163,9 @@ guestfsd_SOURCES = \ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ - lib/libgnu.a \ + $(SELINUX_LIB) \ + $(AUGEAS_LIB) \ + $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ $(HOSTENT_LIB) \ $(INET_NTOP_LIB) \ @@ -181,5 +174,7 @@ guestfsd_LDADD = \ $(LIBINTL) \ $(SERVENT_LIB) -AM_CPPFLAGS = -I$(srcdir)/lib -Ilib +guestfsd_CPPFLAGS = -I$(top_srcdir)/gnulib/lib guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) + +.PHONY: force diff --git a/daemon/README b/daemon/README deleted file mode 100644 index 558d8b1..0000000 --- a/daemon/README +++ /dev/null @@ -1 +0,0 @@ -Please see README in the parent directory. diff --git a/daemon/configure.ac b/daemon/configure.ac deleted file mode 100644 index 7a6c04a..0000000 --- a/daemon/configure.ac +++ /dev/null @@ -1,235 +0,0 @@ -# libguestfs-daemon -# Copyright (C) 2009-2011 Red Hat 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 2 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -AC_INIT([libguestfs-daemon],[1.0.0]) -AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([foreign]) - -m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) -AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. - -AC_CONFIG_MACRO_DIR([m4]) - -dnl If the user specified --enable-32bit, then force the C compiler -dnl to build 32 bit binaries (gcc -m32). -AC_ARG_ENABLE([32bit], - [AS_HELP_STRING([--enable-32bit], [build 32 bit binaries (gcc -m32)])], - [export CC="gcc -m32"], - [enable_32bit=no]) - -dnl Enable packet dumps when in verbose mode. This generates lots -dnl of debug info, only useful for people debugging the RPC mechanism. -AC_ARG_ENABLE([packet-dump], - [AS_HELP_STRING([--enable-packet-dump], - [enable packet dumps in verbose mode @<:@default=no@:>@])], - [AC_DEFINE([ENABLE_PACKET_DUMP],[1],[Enable packet dumps in verbose mode.])], - []) - -dnl Install the daemon (for libguestfs live service) -AC_MSG_CHECKING([if we should install the daemon]) -AC_ARG_ENABLE([install-daemon], - [AS_HELP_STRING([--enable-install-daemon], - [enable installing the daemon under $sbindir @<:@default=no@:>@])], - [], - [enable_install_daemon=no]) -AM_CONDITIONAL([INSTALL_DAEMON],[test "x$enable_install_daemon" = "xyes"]) -AC_MSG_RESULT([$enable_install_daemon]) - -dnl For strchrnul(3), asprintf(3), futimens(2) and getline(3). -AC_GNU_SOURCE - -dnl Check for basic C environment. -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_CPP - -gl_EARLY -gl_INIT - -AC_ARG_ENABLE([gcc-warnings], - [AS_HELP_STRING([--enable-gcc-warnings], - [turn on lots of GCC warnings (for developers)])], - [case $enableval in - yes|no) ;; - *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; - esac - gl_gcc_warnings=$enableval], - [gl_gcc_warnings=no] -) - -if test "$gl_gcc_warnings" = yes; then - gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) - AC_SUBST([WERROR_CFLAGS]) - - nw= - # This, $nw, is the list of warnings we disable. - nw="$nw -Wdeclaration-after-statement" # too useful to forbid - nw="$nw -Waggregate-return" # anachronistic - nw="$nw -Wc++-compat" # We don't care about C++ compilers - nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib - nw="$nw -Wtraditional" # Warns on #elif which we use often - nw="$nw -Wcast-qual" # Too many warnings for now - nw="$nw -Wconversion" # Too many warnings for now - nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings - nw="$nw -Wsign-conversion" # Too many warnings for now - nw="$nw -Wtraditional-conversion" # Too many warnings for now - nw="$nw -Wunreachable-code" # Too many warnings for now - nw="$nw -Wpadded" # Our structs are not padded - nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat - nw="$nw -Wlogical-op" # any use of fwrite provokes this - nw="$nw -Wvla" # two warnings in mount.c - # things I might fix soon: - nw="$nw -Wmissing-format-attribute" # daemon.h's asprintf_nowarn - nw="$nw -Winline" # daemon.h's asprintf_nowarn - nw="$nw -Wshadow" # numerous, plus we're not unanimous - # ?? -Wstrict-overflow - nw="$nw -Wunsafe-loop-optimizations" # just a warning that an optimization - # was not possible, safe to ignore - nw="$nw -Wlong-long" # Allow long long since it's required - # by Python, Ruby and xstrtoll. - nw="$nw -Wstack-protector" # Don't warn about stack-protector - # failures (seen on Ubuntu). - - gl_MANYWARN_ALL_GCC([ws]) - gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) - for w in $ws; do - gl_WARN_ADD([$w]) - done - gl_WARN_ADD([-Wno-unused-parameter]) # stubs.c - gl_WARN_ADD([-Wno-jump-misses-init]) # stubs.c - gl_WARN_ADD([-Wno-unused-variable]) # FIXME: only temporary, for guestfs_protocol.c, etc - - # In spite of excluding -Wlogical-op above, it is enabled, as of - # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c - gl_WARN_ADD([-Wno-logical-op]) - - gl_WARN_ADD([-fdiagnostics-show-option]) - - AC_SUBST([WARN_CFLAGS]) - - AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) - AC_DEFINE([_FORTIFY_SOURCE], [2], - [enable compile-time and run-time bounds-checking, and some warnings]) - AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) -fi - -AC_C_PROTOTYPES -test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant]) - -AM_PROG_CC_C_O - -dnl If the host is Windows, define _WIN32_WINNT to a suitable value. -AC_CANONICAL_HOST -case $host in - *mingw*|*cygwin*|*win32*) CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0500" ;; -esac - -dnl Check support for 64 bit file offsets. -AC_SYS_LARGEFILE - -dnl Check if dirent (readdir) supports d_type member. -AC_STRUCT_DIRENT_D_TYPE - -dnl Check if stat has the required fields. -AC_STRUCT_ST_BLOCKS -AC_CHECK_MEMBER([struct stat.st_blksize],[ - AC_DEFINE([HAVE_STRUCT_STAT_ST_BLKSIZE],[1],[Define to 1 if 'st_blksize' is a member of 'struct stat'])]) - -dnl Check for gperf. -AC_CHECK_PROG([GPERF],[gperf],[gperf],[no]) -test "x$GPERF" = "xno" && - AC_MSG_ERROR([gperf must be installed]) - -dnl Check for Augeas (now optional). -AC_CHECK_LIB([augeas],[aug_match],[ - LIBS="-laugeas $LIBS" - have_augeas=yes - dnl Check for functions not available in earlier versions of Augeas. - AC_CHECK_FUNCS([aug_load aug_defvar aug_defnode]) - ],[have_augeas=no]) -if test "x$have_augeas" = "xyes"; then - AC_DEFINE([HAVE_AUGEAS],[1],[Define to 1 if you have Augeas]) -fi - -dnl Check for libselinux (optional). -AC_CHECK_HEADERS([selinux/selinux.h]) -AC_CHECK_LIB([selinux],[setexeccon],[ - LIBS="-lselinux $LIBS" - have_libselinux="$ac_cv_header_selinux_selinux_h" - AC_CHECK_FUNCS([setcon getcon]) - ],[have_libselinux=no]) -if test "x$have_libselinux" = "xyes"; then - AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) -fi - -dnl Check for XDR library. -AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) - ]) - -dnl Functions which may not be available in older distributions. -AC_CHECK_FUNCS([\ - getxattr \ - htonl \ - htons \ - inotify_init1 \ - lgetxattr \ - listxattr \ - llistxattr \ - lsetxattr \ - lremovexattr \ - mknod \ - ntohl \ - ntohs \ - posix_fallocate \ - realpath \ - removexattr \ - setitimer \ - setxattr \ - sigaction \ - statvfs \ - sync]) - -dnl Headers. -AC_CHECK_HEADERS([\ - attr/xattr.h \ - printf.h \ - sys/inotify.h \ - sys/statvfs.h \ - sys/xattr.h \ - windows.h]) - -dnl For modified printf, we need glibc either (old-style) -dnl register_printf_function or (new-style) register_printf_specifier. -AC_CHECK_FUNC([register_printf_specifier],[ - AC_DEFINE([HAVE_REGISTER_PRINTF_SPECIFIER],[1], - [Define to 1 if you have new-style register_printf_specifier]) - ],[ - AC_CHECK_FUNC([register_printf_function],[ - AC_DEFINE([HAVE_REGISTER_PRINTF_FUNCTION],[1], - [Define to 1 if you have old-style register_printf_function]) - ],[ - AC_MSG_FAILURE( -[No support for glibc-style extended printf formatters. - -This means you either have a very old glibc (pre-2.0) or you -are using some other libc where this is not supported.])])]) - -dnl Produce output files. -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile lib/Makefile tests/Makefile]) -AC_OUTPUT diff --git a/daemon/m4/gnulib-cache.m4 b/daemon/m4/gnulib-cache.m4 deleted file mode 100644 index 27e37ee..0000000 --- a/daemon/m4/gnulib-cache.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2002-2011 Free Software Foundation, Inc. -# -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under -# the same distribution terms as the rest of that program. -# -# Generated by gnulib-tool. -# -# This file represents the specification of how gnulib-tool is used. -# It acts as a cache: It is written and read by gnulib-tool. -# In projects that use version control, this file is meant to be put under -# version control, like the configure.ac and various Makefile.am files. - - -# Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-conditional-dependencies --no-libtool --macro-prefix=gl byteswap c-ctype connect error fsusage futimens getaddrinfo getline glob hash ignore-value manywarnings mkdtemp netdb openat perror pread read-file readlink select sleep socket strchrnul strndup symlinkat sys_select sys_wait vasprintf warnings - -# Specification in the form of a few gnulib-tool.m4 macro invocations: -gl_LOCAL_DIR([]) -gl_MODULES([ - byteswap - c-ctype - connect - error - fsusage - futimens - getaddrinfo - getline - glob - hash - ignore-value - manywarnings - mkdtemp - netdb - openat - perror - pread - read-file - readlink - select - sleep - socket - strchrnul - strndup - symlinkat - sys_select - sys_wait - vasprintf - warnings -]) -gl_AVOID([]) -gl_SOURCE_BASE([lib]) -gl_M4_BASE([m4]) -gl_PO_BASE([]) -gl_DOC_BASE([doc]) -gl_TESTS_BASE([tests]) -gl_WITH_TESTS -gl_LIB([libgnu]) -gl_MAKEFILE_NAME([]) -gl_MACRO_PREFIX([gl]) -gl_PO_DOMAIN([]) diff --git a/m4/.gitignore b/m4/.gitignore index 6cc68d9..e7227ed 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -199,3 +199,42 @@ xsize.m4 /ungetc.m4 /wcrtomb.m4 /wctomb.m4 +/byteswap.m4 +/clock_time.m4 +/fnmatch.m4 +/fsusage.m4 +/futimens.m4 +/getaddrinfo.m4 +/getdelim.m4 +/getline.m4 +/getlogin_r.m4 +/gettime.m4 +/gettimeofday.m4 +/glob.m4 +/hostent.m4 +/inet_ntop.m4 +/inet_pton.m4 +/ioctl.m4 +/mbsrtowcs.m4 +/mkdtemp.m4 +/netdb_h.m4 +/perror.m4 +/pipe.m4 +/pread.m4 +/read-file.m4 +/select.m4 +/servent.m4 +/socketlib.m4 +/sockets.m4 +/strerror_r.m4 +/symlinkat.m4 +/sys_ioctl_h.m4 +/sys_select_h.m4 +/sys_time_h.m4 +/sys_wait_h.m4 +/tempname.m4 +/timespec.m4 +/utimbuf.m4 +/utimecmp.m4 +/utimens.m4 +/utimes.m4 diff --git a/src/guestfs.c b/src/guestfs.c index 1fa3c0a..002418a 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -433,14 +433,8 @@ guestfs_perrorf (guestfs_h *g, const char *fs, ...) if (err < 0) return; -#if !defined(_GNU_SOURCE) || defined(__APPLE__) char buf[256]; strerror_r (errnum, buf, sizeof buf); -#else - char _buf[256]; - char *buf; - buf = strerror_r (errnum, _buf, sizeof _buf); -#endif msg = safe_realloc (g, msg, strlen (msg) + 2 + strlen (buf) + 1); strcat (msg, ": "); -- 1.8.3.1