Browse Source

fix build

experimental/apache_hooks
Wez Furlong 25 years ago
parent
commit
efdc50c175
  1. 21
      ext/gettext/config.m4
  2. 14
      ext/gettext/gettext.c
  3. 6
      ext/gettext/php_gettext.h

21
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

14
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
*/

6
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

Loading…
Cancel
Save