This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] include libintl.h and locale.h only if ENABLE_NLS
- From: groleo at gmail dot com
- To: systemtap at sourceware dot org
- Cc: Adrian Marius Negreanu <adrian dot m dot negreanu at intel dot com>
- Date: Thu, 21 Mar 2013 22:58:02 +0200
- Subject: [PATCH] include libintl.h and locale.h only if ENABLE_NLS
From: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
---
main.cxx | 2 ++
nsscommon.h | 4 +++-
session.h | 2 ++
staprun/stapio.c | 4 ++--
staprun/staprun.h | 8 ++++++--
util.h | 2 ++
6 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/main.cxx b/main.cxx
index e1e864e..f9f6b3f 100644
--- a/main.cxx
+++ b/main.cxx
@@ -26,8 +26,10 @@
#include "tapsets.h"
#include "setupdwfl.h"
+#if ENABLE_NLS
#include <libintl.h>
#include <locale.h>
+#endif
#include "stap-probe.h"
diff --git a/nsscommon.h b/nsscommon.h
index 483cbea..729ebee 100644
--- a/nsscommon.h
+++ b/nsscommon.h
@@ -14,9 +14,11 @@ extern "C" {
#endif
#include <pk11func.h>
+#include "config.h"
+#if ENABLE_NLS
#include <libintl.h>
#include <locale.h>
-#include "config.h"
+#endif
#if ENABLE_NLS
#define _(string) gettext(string)
diff --git a/session.h b/session.h
index 5e65beb..019b7b3 100644
--- a/session.h
+++ b/session.h
@@ -10,8 +10,10 @@
#define SESSION_H
#include "config.h"
+#if ENABLE_NLS
#include <libintl.h>
#include <locale.h>
+#endif
#include <list>
#include <string>
diff --git a/staprun/stapio.c b/staprun/stapio.c
index e8daf0e..1dc6119 100644
--- a/staprun/stapio.c
+++ b/staprun/stapio.c
@@ -25,11 +25,11 @@ char *__name__ = "stapio";
int main(int argc, char **argv)
{
-
+#if ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
-
+#endif
setup_signals();
parse_args(argc, argv);
diff --git a/staprun/staprun.h b/staprun/staprun.h
index 39cbcae..0dfe4a1 100644
--- a/staprun/staprun.h
+++ b/staprun/staprun.h
@@ -37,13 +37,17 @@
#include <sys/wait.h>
#include <sys/statfs.h>
#include <syslog.h>
-#include <libintl.h>
-#include <locale.h>
/* Include config.h to pick up dependency for --prefix usage. */
#include "../config.h"
#include "../privilege.h"
+#if ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#endif
+
+
/* define gettext options if NLS is set */
#if ENABLE_NLS
#define _(string) gettext(string)
diff --git a/util.h b/util.h
index eb35106..8ffd02f 100644
--- a/util.h
+++ b/util.h
@@ -15,8 +15,10 @@
#include <iomanip>
#include <map>
extern "C" {
+#if ENABLE_NLS
#include <libintl.h>
#include <locale.h>
+#endif
#include <signal.h>
#include <stdint.h>
#include <spawn.h>
--
1.8.0