From efdc50c175198e4aece46b6952e58e23227721a8 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 29 Aug 2001 13:13:24 +0000 Subject: [PATCH] fix build --- ext/gettext/config.m4 | 21 ++++++++++++++++----- ext/gettext/gettext.c | 14 ++++++++++++++ ext/gettext/php_gettext.h | 6 ++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 index c48b696c12b..da184397d93 100644 --- a/ext/gettext/config.m4 +++ b/ext/gettext/config.m4 @@ -22,11 +22,17 @@ if test "$PHP_GETTEXT" != "no"; then O_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR" - AC_CHECK_LIB(intl, bindtextdomain, GETTEXT_LIBS=intl,[ - AC_CHECK_LIB(c, bindtextdomain, GETTEXT_LIBS= ,[ - AC_MSG_ERROR(Unable to find required gettext library) - ]) - ]) + AC_CHECK_LIB(intl, bindtextdomain, [ + GETTEXT_LIBS=intl + GETTEXT_CHECK_IN_LIB=intl + ], + AC_CHECK_LIB(c, bindtextdomain, [ + GETTEXT_LIBS= + GETTEXT_CHECK_IN_LIB=c + ],[ + AC_MSG_ERROR(Unable to find required gettext library) + ]) + ) LDFLAGS=$O_LDFLAGS AC_DEFINE(HAVE_LIBINTL,1,[ ]) @@ -38,4 +44,9 @@ if test "$PHP_GETTEXT" != "no"; then fi PHP_ADD_INCLUDE($GETTEXT_INCDIR) + + AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])]) + AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])]) + AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])]) + fi diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 6d61da97cfc..eca1d20f784 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -40,9 +40,15 @@ function_entry php_gettext_functions[] = { PHP_FE(dgettext, NULL) PHP_FE(dcgettext, NULL) PHP_FE(bindtextdomain, NULL) +#if HAVE_NGETTEXT PHP_FE(ngettext, NULL) +#endif +#if HAVE_DNGETTEXT PHP_FE(dngettext, NULL) +#endif +#if HAVE_DCNGETTEXT PHP_FE(dcngettext, NULL) +#endif {NULL, NULL, NULL} }; /* }}} */ @@ -177,6 +183,7 @@ PHP_FUNCTION(bindtextdomain) } /* }}} */ +#if HAVE_NGETTEXT /* {{{ proto string ngettext(string MSGID1, string MSGID2, int N) Plural version of gettext() */ PHP_FUNCTION(ngettext) @@ -200,7 +207,9 @@ PHP_FUNCTION(ngettext) } } /* }}} */ +#endif +#if HAVE_DNGETTEXT /* {{{ proto string dngettext (string domain, string msgid1, string msgid2, long count) Plural version of dgettext() */ PHP_FUNCTION(dngettext) @@ -226,7 +235,9 @@ PHP_FUNCTION(dngettext) } } /* }}} */ +#endif +#if HAVE_DCNGETTEXT /* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, long n, int category) Plural version of dcgettext() */ PHP_FUNCTION(dcngettext) @@ -253,6 +264,8 @@ PHP_FUNCTION(dcngettext) } } } +/* }}} */ +#endif #endif /* HAVE_LIBINTL */ @@ -264,3 +277,4 @@ PHP_FUNCTION(dcngettext) * vim600: sw=4 ts=4 tw=78 fdm=marker * vim<600: sw=4 ts=4 tw=78 */ + diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h index 1cfa68f09c4..8a2faf9f7c9 100644 --- a/ext/gettext/php_gettext.h +++ b/ext/gettext/php_gettext.h @@ -36,9 +36,15 @@ PHP_FUNCTION(gettext); PHP_FUNCTION(dgettext); PHP_FUNCTION(dcgettext); PHP_FUNCTION(bindtextdomain); +#if HAVE_NGETTEXT PHP_FUNCTION(ngettext); +#endif +#if HAVE_DNGETTEXT PHP_FUNCTION(dngettext); +#endif +#if HAVE_DCNGETTEXT PHP_FUNCTION(dcngettext); +#endif #else #define gettext_module_ptr NULL