Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 01/12] configure: Add -nographic command line option to qemu.
Without this option, configure will fail when there is no display. Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index de8a064..61d6f69 100644 --- a/configure.ac +++ b/configure.ac @@ -593,16 +593,16 @@ working. AC_MSG_FAILURE([$QEMU version must be >= 1.0.]) fi - AC_MSG_CHECKING([that $QEMU -machine accel=kvm:tcg -device ? works]) - if $QEMU -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then + AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works]) + if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) - AC_MSG_FAILURE([$QEMU -machine accel=kvm:tcg -device ? doesn't work.]) + AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't work.]) fi AC_MSG_CHECKING([for virtio-serial support in $QEMU]) - if $QEMU $QEMU_OPTIONS -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then + if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 02/12] configure: Use $(PERL) instead of perl
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- configure.ac | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 61d6f69..1d07b0e 100644 --- a/configure.ac +++ b/configure.ac @@ -460,22 +460,27 @@ AC_CHECK_PROG([GPERF],[gperf],[gperf],[no]) test "x$GPERF" = "xno" && AC_MSG_ERROR([gperf must be installed]) +dnl Check for perl. +AC_CHECK_PROG([PERL],[perl],[perl],[no]) +test "x$PERL" = "xno" && + AC_MSG_ERROR([perl must be installed]) + dnl Check for Pod::Man, Pod::Simple. AC_MSG_CHECKING([for Pod::Man]) -if ! perl -MPod::Man -e1 >&AS_MESSAGE_LOG_FD 2>&1; then +if ! $PERL -MPod::Man -e1 >&AS_MESSAGE_LOG_FD 2>&1; then AC_MSG_ERROR([perl Pod::Man must be installed]) else AC_MSG_RESULT([yes]) fi AC_MSG_CHECKING([for Pod::Simple]) -if ! perl -MPod::Simple -e1 >&AS_MESSAGE_LOG_FD 2>&1; then +if ! $PERL -MPod::Simple -e1 >&AS_MESSAGE_LOG_FD 2>&1; then AC_MSG_ERROR([perl Pod::Simple must be installed]) else AC_MSG_RESULT([yes]) fi dnl Define the path to the podwrapper program. -PODWRAPPER="$(pwd)/podwrapper.pl" +PODWRAPPER="$PERL $(pwd)/podwrapper.pl" AC_SUBST([PODWRAPPER]) dnl Check for genisoimage/mkisofs @@ -869,22 +874,17 @@ AM_CONDITIONAL([HAVE_OCAML_GETTEXT], [test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && test "x$OCAML_PKG_gettext" != "xno" && test "x$OCAML_GETTEXT" != "xno"]) dnl Check for Perl (optional, for Perl bindings and Perl tools). -PERL=no AC_ARG_ENABLE([perl], AS_HELP_STRING([--disable-perl], [Disable Perl language bindings]), [], [enable_perl=yes]) -AS_IF([test "x$enable_perl" != "xno"], - [ - PERL- AC_CHECK_PROG([PERL],[perl],[perl],[no]) - +AS_IF([test "x$enable_perl" != "xno"],[ dnl Check for Perl modules that must be present to compile and dnl test the Perl bindings. missing_perl_modules=no for pm in Test::More ExtUtils::MakeMaker; do AC_MSG_CHECKING([for $pm]) - if ! perl -M$pm -e1 >&AS_MESSAGE_LOG_FD 2>&1; then + if ! $PERL -M$pm -e1 >&AS_MESSAGE_LOG_FD 2>&1; then AC_MSG_RESULT([no]) missing_perl_modules=yes else -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 03/12] Mac OS X: Use gnulib memmem module explicitly.
m4/.gitignore: Update. Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- bootstrap | 1 + m4/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/bootstrap b/bootstrap index 6b1fb3f..64473d2 100755 --- a/bootstrap +++ b/bootstrap @@ -65,6 +65,7 @@ ignore-value lock maintainer-makefile manywarnings +memmem mkdtemp netdb netinet_in diff --git a/m4/.gitignore b/m4/.gitignore index 7fa447d..4dd4163 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -124,6 +124,7 @@ /malloca.m4 /malloc.m4 /manywarnings.m4 +/memmem.m4 /math_h.m4 /mbrtowc.m4 /mbsinit.m4 -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 04/12] Mac OS X: Use gnulib fstatat module explicitly.
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- bootstrap | 1 + m4/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/bootstrap b/bootstrap index 64473d2..ccd3e30 100755 --- a/bootstrap +++ b/bootstrap @@ -47,6 +47,7 @@ connect dup3 error filevercmp +fstatat fsusage fts full-read diff --git a/m4/.gitignore b/m4/.gitignore index 4dd4163..4993529 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -54,6 +54,7 @@ /freading.m4 /fseeko.m4 /fstat.m4 +/fstatat.m4 /fsusage.m4 /ftell.m4 /ftello.m4 -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 05/12] Mac OS X: Added check of #include <endian.h>
Mac OS X doesn't have endian.h Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- src/dbdump.c | 3 +++ src/inspect-apps.c | 3 +++ src/inspect-fs-cd.c | 3 +++ src/inspect-fs-unix.c | 3 +++ src/inspect-fs-windows.c | 3 +++ src/inspect-fs.c | 3 +++ src/inspect.c | 3 +++ 7 files changed, 21 insertions(+) diff --git a/src/dbdump.c b/src/dbdump.c index 8242dee..ac20b67 100644 --- a/src/dbdump.c +++ b/src/dbdump.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> diff --git a/src/inspect-apps.c b/src/inspect-apps.c index 0ee3954..1b0b5a5 100644 --- a/src/inspect-apps.c +++ b/src/inspect-apps.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> diff --git a/src/inspect-fs-cd.c b/src/inspect-fs-cd.c index 12c1a6d..6fec8a5 100644 --- a/src/inspect-fs-cd.c +++ b/src/inspect-fs-cd.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index 6d57429..433ef5c 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c index 1a34192..d04024b 100644 --- a/src/inspect-fs-windows.c +++ b/src/inspect-fs-windows.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> diff --git a/src/inspect-fs.c b/src/inspect-fs.c index 0859a2b..0050067 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> diff --git a/src/inspect.c b/src/inspect.c index 117f57a..e43f7e7 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -27,7 +27,10 @@ #include <string.h> #include <sys/stat.h> #include <errno.h> + +#ifdef HAVE_ENDIAN_H #include <endian.h> +#endif #include <pcre.h> -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 06/12] Mac OS X: #define UNIX_PATH_MAX 104
See http://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man4/unix.4.html Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- src/guestfs-internal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 5a2e9ba..3752606 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -76,7 +76,11 @@ char var[strlen (ttos_tmpdir) + 32]; \ sprintf (var, "%s/libguestfsXXXXXX", ttos_tmpdir) \ +#ifdef __APPLE__ +#define UNIX_PATH_MAX 104 +#else #define UNIX_PATH_MAX 108 +#endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 07/12] Mac OS X: don't check glibc-style extended printf formatters unless --enable-daemon
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- configure.ac | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 1d07b0e..af01e53 100644 --- a/configure.ac +++ b/configure.ac @@ -253,21 +253,23 @@ AC_CHECK_LIB([ncurses], [UP], [], [ ]) LIBS="$old_LIBS" -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]) +if test "x$enable_daemon" = "xyes"; then + 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_MSG_FAILURE( + 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.])])]) +fi dnl GNU gettext tools (optional). AC_CHECK_PROG([XGETTEXT],[xgettext],[xgettext],[no]) -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 08/12] Mac OS X: Use real files for gtk-doc (not the symlink)
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- gobject/docs/gtk-doc.make | 281 +++++++++++++++++++++++++++++++++++++++++++++- m4/gtk-doc.m4 | 68 ++++++++++- 2 files changed, 347 insertions(+), 2 deletions(-) mode change 120000 => 100644 gobject/docs/gtk-doc.make mode change 120000 => 100644 m4/gtk-doc.m4 diff --git a/gobject/docs/gtk-doc.make b/gobject/docs/gtk-doc.make deleted file mode 120000 index 0870846..0000000 --- a/gobject/docs/gtk-doc.make +++ /dev/null @@ -1 +0,0 @@ -/usr/share/gtk-doc/data/gtk-doc.make \ No newline at end of file diff --git a/gobject/docs/gtk-doc.make b/gobject/docs/gtk-doc.make new file mode 100644 index 0000000..6664c16 --- /dev/null +++ b/gobject/docs/gtk-doc.make @@ -0,0 +1,280 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +SETUP_FILES = \ + $(content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +EXTRA_DIST = \ + $(HTML_IMAGES) \ + $(SETUP_FILES) + +DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + tmpl.stamp sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) + +if ENABLE_GTK_DOC +if GTK_DOC_BUILD_HTML +HTML_BUILD_STAMP=html-build.stamp +else +HTML_BUILD_STAMP+endif +if GTK_DOC_BUILD_PDF +PDF_BUILD_STAMP=pdf-build.stamp +else +PDF_BUILD_STAMP+endif + +all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +else +all-local: +endif + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### setup #### + +setup-build.stamp: + - at if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + echo ' DOC Preparing build'; \ + files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + test -f $(abs_srcdir)/$$file && \ + cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ + done; \ + fi; \ + test -d $(abs_srcdir)/tmpl && \ + { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ + chmod -R u+w $(abs_builddir)/tmpl; } \ + fi + @touch setup-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo ' DOC Scanning header files' + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + echo " DOC Introspecting gobjects"; \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo ' DOC Rebuilding template files' + @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + if test -w $(abs_srcdir) ; then \ + cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ + fi \ + fi + @touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +$(srcdir)/tmpl/*.sgml: + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo ' DOC Building XML' + @-chmod -R u+w $(srcdir) + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + - at test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + if test -f $(abs_srcdir)/$$file ; then \ + cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + fi; \ + if test -f $(abs_builddir)/$$file ; then \ + cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + fi; \ + done; + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +#### pdf #### + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building PDF' + @rm -f $(DOC_MODULE).pdf + @mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + @touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ + rm -rf tmpl; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: docs +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + @mkdir $(distdir)/tmpl + @mkdir $(distdir)/html + @-cp ./tmpl/*.sgml $(distdir)/tmpl + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 deleted file mode 120000 index d214c6a..0000000 --- a/m4/gtk-doc.m4 +++ /dev/null @@ -1 +0,0 @@ -/usr/share/aclocal/gtk-doc.m4 \ No newline at end of file diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 new file mode 100644 index 0000000..0ada151 --- /dev/null +++ b/m4/gtk-doc.m4 @@ -0,0 +1,67 @@ +dnl -*- mode: autoconf -*- + +# serial 1 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + dnl check for tools we added during development + AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + if test x$enable_gtk_doc = xyes; then + ifelse([$1],[], + [PKG_CHECK_EXISTS([gtk-doc],, + AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], + [PKG_CHECK_EXISTS([gtk-doc >= $1],, + AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) + fi + fi + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) + AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) +]) -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 09/12] lib: Use <sys/socket.h> and <sys/un.h> for sockaddr_un
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- src/launch-appliance.c | 2 ++ src/launch-unix.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/launch-appliance.c b/src/launch-appliance.c index a955360..328cd19 100644 --- a/src/launch-appliance.c +++ b/src/launch-appliance.c @@ -28,6 +28,8 @@ #include <sys/types.h> #include <sys/wait.h> #include <signal.h> +#include <sys/socket.h> +#include <sys/un.h> #include "guestfs.h" #include "guestfs-internal.h" diff --git a/src/launch-unix.c b/src/launch-unix.c index f09ecde..b971cac 100644 --- a/src/launch-unix.c +++ b/src/launch-unix.c @@ -22,6 +22,8 @@ #include <stdlib.h> #include <unistd.h> #include <fcntl.h> +#include <sys/socket.h> +#include <sys/un.h> #include "guestfs.h" #include "guestfs-internal.h" -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 10/12] Mac OS X: Use gnulib stat-time module explicitly.
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- bootstrap | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap b/bootstrap index ccd3e30..be0dfe4 100755 --- a/bootstrap +++ b/bootstrap @@ -81,6 +81,7 @@ select setenv sleep socket +stat-time strchrnul strerror strndup -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 11/12] Mac OS X: Use libtool --mode=execute instead of LD_LIBRARY_PATH
because Mac OS X doesn't support LD_LIBRARY_PATH Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- ocaml/Makefile.am | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index d91eb5c..8264574 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -106,7 +106,7 @@ noinst_DATA += \ bindtests.bc: bindtests.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ bindtests.opt: bindtests.cmx mlguestfs.cmxa @@ -115,7 +115,7 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa @@ -124,7 +124,7 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa @@ -133,7 +133,7 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa @@ -142,7 +142,7 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa @@ -151,7 +151,7 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa @@ -160,7 +160,7 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa @@ -169,7 +169,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa t/guestfs_500_mount_local.bc: t/guestfs_500_mount_local.cmo mlguestfs.cma mkdir -p t - LD_LIBRARY_PATH=../src/.libs \ + $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ $(OCAMLFIND) ocamlc -custom $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ t/guestfs_500_mount_local.opt: t/guestfs_500_mount_local.cmx mlguestfs.cmxa -- 1.7.11.1
Masami HIRATA
2012-Jul-24 14:10 UTC
[Libguestfs] [PATCH 12/12] Mac OS X: Use u_int64_t/uint64_t instead of unsigned hyper in .x file
Signed-off-by: Masami HIRATA <msmhrt at gmail.com> --- configure.ac | 8 ++++++++ fish/Makefile.am | 13 +++++++++++-- generator/generator_xdr.ml | 31 +++++++++++++++++++++++-------- src/Makefile.am | 13 +++++++++++-- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index af01e53..b76b3ac1 100644 --- a/configure.ac +++ b/configure.ac @@ -405,6 +405,14 @@ AM_CONDITIONAL([HAVE_RPCGEN],[test "x$RPCGEN" != "xno"]) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) ]) +AC_SEARCH_LIBS([xdr_u_int64_t],[portablexdr rpc xdr nsl],[ + AC_DEFINE([HAVE_XDR_U_INT64_T],[1],[Define to 1 if xdr_u_int64_t() exists]) + ]) +AC_SEARCH_LIBS([xdr_uint64_t],[portablexdr rpc xdr nsl],[ + AC_DEFINE([HAVE_XDR_UINT64_T],[1],[Define to 1 if xdr_uint64_t() exists]) + ]) +AM_CONDITIONAL([HAVE_XDR_U_INT64_T],[test "x$ac_cv_search_xdr_u_int64_t" != "xno"]) +AM_CONDITIONAL([HAVE_XDR_UINT64_T],[test "x$ac_cv_search_xdr_uint64_t" != "xno"]) dnl Check for Augeas (optional). PKG_CHECK_MODULES([AUGEAS], [augeas], diff --git a/fish/Makefile.am b/fish/Makefile.am index c7c1867..27015f6 100644 --- a/fish/Makefile.am +++ b/fish/Makefile.am @@ -138,16 +138,25 @@ noinst_LTLIBRARIES = libcmds.la librc_protocol.la guestfish_LDADD += libcmds.la librc_protocol.la ../gnulib/lib/libgnu.la if HAVE_RPCGEN +RPCGEN_DEFS +if HAVE_XDR_U_INT64_T +RPCGEN_DEFS += -DHAVE_XDR_U_INT64_T=1 +else +if HAVE_XDR_UINT64_T +RPCGEN_DEFS += -DHAVE_XDR_UINT64_T=1 +endif +endif + rc_protocol.c: rc_protocol.x rm -f $@-t $@-t2 - $(RPCGEN) -c -o $@-t $< + $(RPCGEN) $(RPCGEN_DEFS) -c -o $@-t $< sed 's,\.\./\(\.\./\)*fish,.,' < $@-t > $@-t2 rm $@-t mv $@-t2 $@ rc_protocol.h: rc_protocol.x rm -f $@-t - $(RPCGEN) -h -o $@-t $< + $(RPCGEN) $(RPCGEN_DEFS) -h -o $@-t $< mv $@-t $@ endif diff --git a/generator/generator_xdr.ml b/generator/generator_xdr.ml index b7b2db2..ec44e8c 100644 --- a/generator/generator_xdr.ml +++ b/generator/generator_xdr.ml @@ -39,6 +39,21 @@ open Generator_structs let generate_xdr () generate_header CStyle LGPLv2plus; + (* This has to be defined to get around a limitation in Mac OS X's rpcgen. *) + pr "#if HAVE_XDR_U_INT64_T\n"; + pr "#define uint64_t u_int64_t\n"; + pr "%%#if HAVE_XDR_UINT64_T\n"; + pr "%%#define xdr_u_int64_t xdr_uint64_t\n"; + pr "%%#define u_int64_t uint64_t\n"; + pr "%%#endif\n"; + pr "#else\n"; + pr "%%#if HAVE_XDR_U_INT64_T\n"; + pr "%%#define xdr_uint64_t xdr_u_int64_t\n"; + pr "%%#define uint64_t u_int64_t\n"; + pr "%%#endif\n"; + pr "#endif\n"; + pr "\n"; + (* This has to be defined to get around a limitation in Sun's rpcgen. *) pr "typedef string guestfs_str<>;\n"; pr "\n"; @@ -55,8 +70,8 @@ let generate_xdr () | name, FUUID -> pr " opaque %s[32];\n" name | name, FInt32 -> pr " int %s;\n" name | name, FUInt32 -> pr " unsigned int %s;\n" name - | name, (FInt64|FBytes) -> pr " hyper %s;\n" name - | name, FUInt64 -> pr " unsigned hyper %s;\n" name + | name, (FInt64|FBytes) -> pr " int64_t %s;\n" name + | name, FUInt64 -> pr " uint64_t %s;\n" name | name, FOptPercent -> pr " float %s;\n" name ) cols; pr "};\n"; @@ -86,7 +101,7 @@ let generate_xdr () | StringList n | DeviceList n -> pr " guestfs_str %s<>;\n" n | Bool n -> pr " bool %s;\n" n | Int n -> pr " int %s;\n" n - | Int64 n -> pr " hyper %s;\n" n + | Int64 n -> pr " int64_t %s;\n" n | BufferIn n -> pr " opaque %s<>;\n" n | FileIn _ | FileOut _ -> () @@ -102,7 +117,7 @@ let generate_xdr () pr "};\n\n" | RInt64 n -> pr "struct %s_ret {\n" name; - pr " hyper %s;\n" n; + pr " int64_t %s;\n" n; pr "};\n\n" | RBool n -> pr "struct %s_ret {\n" name; @@ -199,8 +214,8 @@ struct guestfs_message_header { guestfs_procedure proc; /* GUESTFS_PROC_x */ guestfs_message_direction direction; unsigned serial; /* message serial number */ - unsigned hyper progress_hint; /* upload hint for progress bar */ - unsigned hyper optargs_bitmask; /* bitmask for optional args */ + uint64_t progress_hint; /* upload hint for progress bar */ + uint64_t optargs_bitmask; /* bitmask for optional args */ guestfs_message_status status; }; @@ -230,8 +245,8 @@ struct guestfs_chunk { struct guestfs_progress { guestfs_procedure proc; /* @0: GUESTFS_PROC_x */ unsigned serial; /* @4: message serial number */ - unsigned hyper position; /* @8: 0 <= position <= total */ - unsigned hyper total; /* @16: total size of operation */ + uint64_t position; /* @8: 0 <= position <= total */ + uint64_t total; /* @16: total size of operation */ /* @24: size of structure */ }; " diff --git a/src/Makefile.am b/src/Makefile.am index 95042f8..750c07b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -180,16 +180,25 @@ libguestfs_la_LIBADD += $(FUSE_LIBS) -lulockmgr endif if HAVE_RPCGEN +RPCGEN_DEFS +if HAVE_XDR_U_INT64_T +RPCGEN_DEFS += -DHAVE_XDR_U_INT64_T=1 +else +if HAVE_XDR_UINT64_T +RPCGEN_DEFS += -DHAVE_XDR_UINT64_T=1 +endif +endif + guestfs_protocol.c: guestfs_protocol.x rm -f $@-t $@-t2 - $(RPCGEN) -c -o $@-t $(srcdir)/$< + $(RPCGEN) $(RPCGEN_DEFS) -c -o $@-t $(srcdir)/$< sed 's,\.\./\(\.\./\)*src,.,' < $@-t > $@-t2 rm $@-t mv $@-t2 $@ guestfs_protocol.h: guestfs_protocol.x rm -f $@-t - $(RPCGEN) -h -o $@-t $(srcdir)/$< + $(RPCGEN) $(RPCGEN_DEFS) -h -o $@-t $(srcdir)/$< mv $@-t $@ endif -- 1.7.11.1
Possibly Parallel Threads
- [PATCH v3 0/3] gobject: Remove gtk-doc.
- [PATCH v4 0/3] gobject: Remove gtk-doc (RHBZ#1465665).
- [PATCH v5 0/3] gobject: Remove gtk-doc (RHBZ#1465665).
- [PATCH v2 0/3] Remove gtk-doc.
- [PATCH 0/3] gobject: Remove gtk-doc and replace with guestfs-gobject(3) manual page.