2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
1999-04-22 01:26:16 +08:00
|
|
|
dnl $Id$
|
2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
1999-04-22 01:26:16 +08:00
|
|
|
|
2001-12-01 03:00:13 +08:00
|
|
|
PHP_ARG_WITH(gettext,for GNU gettext support,
|
2005-05-30 07:17:16 +08:00
|
|
|
[ --with-gettext[=DIR] Include GNU gettext support])
|
2000-05-24 06:26:51 +08:00
|
|
|
|
|
|
|
if test "$PHP_GETTEXT" != "no"; then
|
2003-10-01 10:53:23 +08:00
|
|
|
for i in $PHP_GETTEXT /usr/local /usr; do
|
|
|
|
test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
|
2000-05-24 06:26:51 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$GETTEXT_DIR"; then
|
|
|
|
AC_MSG_ERROR(Cannot locate header file libintl.h)
|
|
|
|
fi
|
1999-04-22 01:26:16 +08:00
|
|
|
|
2004-11-03 22:32:52 +08:00
|
|
|
GETTEXT_LIBDIR=$GETTEXT_DIR/$PHP_LIBDIR
|
2000-05-24 06:26:51 +08:00
|
|
|
GETTEXT_INCDIR=$GETTEXT_DIR/include
|
|
|
|
|
2001-05-12 19:09:05 +08:00
|
|
|
O_LDFLAGS=$LDFLAGS
|
2000-05-24 06:26:51 +08:00
|
|
|
LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
|
2001-08-29 21:13:24 +08:00
|
|
|
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)
|
|
|
|
])
|
|
|
|
)
|
2001-05-12 19:09:05 +08:00
|
|
|
LDFLAGS=$O_LDFLAGS
|
1999-04-22 01:26:16 +08:00
|
|
|
|
2000-05-24 06:26:51 +08:00
|
|
|
AC_DEFINE(HAVE_LIBINTL,1,[ ])
|
2002-03-13 00:44:00 +08:00
|
|
|
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
|
2000-05-24 06:26:51 +08:00
|
|
|
PHP_SUBST(GETTEXT_SHARED_LIBADD)
|
1999-04-22 01:26:16 +08:00
|
|
|
|
2000-05-24 06:26:51 +08:00
|
|
|
if test -n "$GETTEXT_LIBS"; then
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($GETTEXT_LIBS, $GETTEXT_LIBDIR, GETTEXT_SHARED_LIBADD)
|
1999-04-22 01:26:16 +08:00
|
|
|
fi
|
2000-05-24 06:26:51 +08:00
|
|
|
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_ADD_INCLUDE($GETTEXT_INCDIR)
|
2001-08-29 21:13:24 +08:00
|
|
|
|
|
|
|
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, [ ])])
|
2001-11-10 00:27:09 +08:00
|
|
|
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
|
2001-08-29 21:13:24 +08:00
|
|
|
|
2000-05-24 06:26:51 +08:00
|
|
|
fi
|