[Libguestfs] [PATCH 4/4] Mac OS X: Detect bindtextdomain.

Richard W.M. Jones rjones at redhat.com
Sun Mar 21 19:51:13 UTC 2010


Updated patch.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-------------- next part --------------
>From bb91d736c932c6644d9d4601fc6d6a16519e5a1a Mon Sep 17 00:00:00 2001
From: Richard Jones <rich at koneko.home.annexia.org>
Date: Sun, 21 Mar 2010 19:30:52 +0000
Subject: [PATCH] Mac OS X: Detect bindtextdomain.

These are missing on Mac OS X.  I think you would need to install
a gettext package to get these.
---
 configure.ac          |    2 +-
 fish/fish.c           |    2 ++
 test-tool/test-tool.c |    2 ++
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 086b00c..4a492b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,7 +135,7 @@ dnl Headers.
 AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h endian.h byteswap.h])
 
 dnl Functions.
-AC_CHECK_FUNCS([posix_fallocate])
+AC_CHECK_FUNCS([bindtextdomain posix_fallocate])
 
 dnl Build the daemon?
 AC_MSG_CHECKING([if we should build the daemon])
diff --git a/fish/fish.c b/fish/fish.c
index 2022ee3..5fbf290 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -141,8 +141,10 @@ main (int argc, char *argv[])
   atexit (close_stdout);
 
   setlocale (LC_ALL, "");
+#ifdef HAVE_BINDTEXTDOMAIN
   bindtextdomain (PACKAGE, LOCALEBASEDIR);
   textdomain (PACKAGE);
+#endif
 
   enum { HELP_OPTION = CHAR_MAX + 1 };
 
diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c
index 5423374..57de78f 100644
--- a/test-tool/test-tool.c
+++ b/test-tool/test-tool.c
@@ -87,8 +87,10 @@ int
 main (int argc, char *argv[])
 {
   setlocale (LC_ALL, "");
+#ifdef HAVE_BINDTEXTDOMAIN
   bindtextdomain (PACKAGE, LOCALEBASEDIR);
   textdomain (PACKAGE);
+#endif
 
   static const char *options = "t:?";
   static const struct option long_options[] = {
-- 
1.6.4.1



More information about the Libguestfs mailing list