From a71d278498ffef2051c8430dd67795a157b8290e Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Mon, 7 Jun 2004 21:29:10 +0000 Subject: [PATCH] Disable nls support if glib is pre 2.4 (OSX) git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1379 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- configure.ac | 37 +++++++++++++++++++++++-------------- src/Makefile.am | 2 +- src/ncmpc.h | 4 +++- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 94e0562..c708b7f 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,6 @@ dnl ======================================================= set -- $CFLAGS - dnl dnl Check for types dnl @@ -61,23 +60,31 @@ AC_CHECK_LIB([popt], AC_MSG_ERROR([Missing popt command line parsing library])) -dnl Check for glib-2 +dnl Check for glib-2.4 PKG_CHECK_MODULES([GLIB], - [glib-2.0 >= 2.2], - , - AC_MSG_ERROR([glib-2.2 is required])) + [glib-2.0 >= 2.4], + glib24=yes, + AC_MSG_WARN([glib-2.4 is required for NLS support!])) +if test "x$glib24" != "xyes"; then + PKG_CHECK_MODULES([GLIB], + [glib-2.0 >= 2.2], + nls=no, + AC_MSG_ERROR([glib-2.2 is required])) +fi + dnl i18n -ALL_LINGUAS="" -AC_MSG_CHECKING([whether to include NLS support]) -AC_ARG_ENABLE([nls], - AC_HELP_STRING([--enable-nls], - [include natural language support @<:@default=yes@:>@]), - [nls="$enableval"], - [nls=yes]) -AC_MSG_RESULT([$nls]) +ALL_LINGUAS="sv" + +AM_NLS +if test "x$glib24" = "xyes"; then + nls=$USE_NLS +else + USE_NLS=no + AC_SUBST(USE_NLS) +fi + if test "x$nls" = "xyes"; then - ALL_LINGUAS="sv" AM_GLIB_GNU_GETTEXT GETTEXT_PACKAGE=$PACKAGE AC_SUBST(GETTEXT_PACKAGE) @@ -85,6 +92,8 @@ if test "x$nls" = "xyes"; then ["${GETTEXT_PACKAGE}"], [gettext domain]) nls=$gt_cv_have_gettext +else + AM_PO_SUBDIRS fi diff --git a/src/Makefile.am b/src/Makefile.am index 79822f0..0554098 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,7 +11,7 @@ AM_CPPFLAGS = $(GLIB_CFLAGS) -DLOCALE_DIR=\""$(datadir)/locale"\" -DSYSCONFDIR=\ ncmpc_headers = libmpdclient.h mpc.h options.h conf.h command.h screen.h \ screen_utils.h screen_play.h screen_file.h screen_search.h \ - screen_clock.h screen_help.h list_window.h colors.h support.h \ + screen_help.h list_window.h colors.h support.h \ wreadln.h ncmpc.h ncmpc_SOURCES = libmpdclient.c main.c mpc.c options.c conf.c command.c \ diff --git a/src/ncmpc.h b/src/ncmpc.h index bc6c913..2708aac 100644 --- a/src/ncmpc.h +++ b/src/ncmpc.h @@ -12,8 +12,10 @@ #endif /* i18n */ -#ifdef ENABLE_NLS +#ifdef HAVE_LOCALE_H #include +#endif +#ifdef ENABLE_NLS #include #include #else -- 2.30.2