daemon: use gnulib
authorJim Meyering <meyering@redhat.com>
Mon, 3 Aug 2009 10:44:51 +0000 (11:44 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 6 Aug 2009 10:28:04 +0000 (12:28 +0200)
* daemon/Makefile.am (SUBDIRS): Define.
(AM_CPPFLAGS): Define, to include from gnulib's lib/
(LDADD): Define, to link with gnulib's libgnu.a.
* daemon/configure.ac: Use AC_CONFIG_AUX_DIR([build-aux]),
gl_EARLY and gl_INIT.
(AC_CONFIG_FILES): Add lib/Makefile and tests/Makefile
* daemon/m4/gnulib-cache.m4: New file, generated by running
../.gnulib/gnulib-tool --import --with-tests hash
* daemon/.gitignore: Ignore all of the imported files.
build: tell bootstrap about daemon/
* bootstrap: Run gnulib-tool --update in daemon/.
Remove bootstrap's --gnulib-srcdir option, because it probably
didn't work, and even if it did, we've discovered that using
a separate git repo like that can lead to subtle mix-ups.

bootstrap
daemon/.gitignore [new file with mode: 0644]
daemon/Makefile.am
daemon/configure.ac
daemon/m4/gnulib-cache.m4 [new file with mode: 0644]

index d46b3be..0f14038 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -78,6 +78,8 @@ sed '
 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
 <$gnulib_tool || exit
 
 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
 <$gnulib_tool || exit
 
+(cd daemon && $GNULIB_SRCDIR/../gnulib-tool --update)
+
 modules='
 gitlog-to-changelog
 gnu-make
 modules='
 gitlog-to-changelog
 gnu-make
diff --git a/daemon/.gitignore b/daemon/.gitignore
new file mode 100644 (file)
index 0000000..7f60faf
--- /dev/null
@@ -0,0 +1,29 @@
+build-aux
+lib
+link-warning.h
+m4/00gnulib.m4
+m4/errno_h.m4
+m4/error.m4
+m4/exitfail.m4
+m4/extensions.m4
+m4/gnulib-common.m4
+m4/gnulib-comp.m4
+m4/gnulib-tool.m4
+m4/hash.m4
+m4/include_next.m4
+m4/inline.m4
+m4/inttostr.m4
+m4/longlong.m4
+m4/multiarch.m4
+m4/onceonly.m4
+m4/stdbool.m4
+m4/stdint.m4
+m4/stdlib_h.m4
+m4/strerror.m4
+m4/string_h.m4
+m4/unistd_h.m4
+m4/wchar.m4
+m4/wchar_t.m4
+m4/wint_t.m4
+m4/xalloc.m4
+tests
index 024c097..43cc752 100644 (file)
@@ -17,6 +17,8 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
 
 ACLOCAL_AMFLAGS = -I m4
 
+SUBDIRS = lib tests .
+
 noinst_PROGRAMS = guestfsd
 guestfsd_SOURCES = \
        actions.h \
 noinst_PROGRAMS = guestfsd
 guestfsd_SOURCES = \
        actions.h \
@@ -76,4 +78,6 @@ guestfsd_SOURCES = \
        $(top_builddir)/../src/guestfs_protocol.h \
        $(top_builddir)/../src/guestfs_protocol.c
 
        $(top_builddir)/../src/guestfs_protocol.h \
        $(top_builddir)/../src/guestfs_protocol.c
 
+AM_CPPFLAGS = -I$(srcdir)/lib -Ilib
 guestfsd_CFLAGS = -Wall
 guestfsd_CFLAGS = -Wall
+LDADD = lib/libgnu.a
index 3bfd2ed..126e125 100644 (file)
@@ -16,6 +16,7 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 AC_INIT([libguestfs-daemon],[1.0.0])
 # 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])
 
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign])
 
 AC_CONFIG_MACRO_DIR([m4])
@@ -41,6 +42,9 @@ AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_CPP
 
 AC_PROG_INSTALL
 AC_PROG_CPP
 
+gl_EARLY
+gl_INIT
+
 AC_C_PROTOTYPES
 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
 
 AC_C_PROTOTYPES
 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
 
@@ -86,5 +90,5 @@ AC_CHECK_HEADERS([attr/xattr.h sys/xattr.h])
 
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
 
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile lib/Makefile tests/Makefile])
 AC_OUTPUT
 AC_OUTPUT
diff --git a/daemon/m4/gnulib-cache.m4 b/daemon/m4/gnulib-cache.m4
new file mode 100644 (file)
index 0000000..8aa504a
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) 2002-2009 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 using CVS, this file is meant to be stored in CVS,
+# 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-libtool --macro-prefix=gl hash
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_LOCAL_DIR([])
+gl_MODULES([
+  hash
+])
+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([])