Work with Solaris gettext (#341988, Laszlo Peter)

2007-03-06  Matthias Clasen  <mclasen@redhat.com>

        Work with Solaris gettext (#341988, Laszlo Peter)

        * m4macros/glib-gettext.m4: Make GLIB_WITH_NLS define
        MSGFMT_OPTS if msgfmt supports -c.

        * po/Makefile.in.in: Use MSGFMT_OPTS when calling
        msgfmt.


svn path=/trunk/; revision=5369
This commit is contained in:
Matthias Clasen 2007-03-06 05:23:26 +00:00 committed by Matthias Clasen
parent 085042c6d7
commit 04b0520e09
3 changed files with 44 additions and 2 deletions

View File

@ -1,4 +1,14 @@
2007-03-06 Matthias Clasen <mclasen@Redhat.com>
2007-03-06 Matthias Clasen <mclasen@redhat.com>
Work with Solaris gettext (#341988, Laszlo Peter)
* m4macros/glib-gettext.m4: Make GLIB_WITH_NLS define
MSGFMT_OPTS if msgfmt supports -c.
* po/Makefile.in.in: Use MSGFMT_OPTS when calling
msgfmt.
2007-03-06 Matthias Clasen <mclasen@redhat.com>
* tests/Makefile.am: Apply a patch by Loïc Minier
to fix building with -Wl,-z,defs. (#149144)

View File

@ -206,6 +206,20 @@ glib_DEFUN([GLIB_WITH_NLS],
glib_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
AC_CHECK_FUNCS(dcgettext)
MSGFMT_OPTS=
AC_MSG_CHECKING([if msgfmt accepts -c])
GLIB_RUN_PROG([msgfmt -c -o /dev/null],[
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: test 1.0\n"
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
"Last-Translator: test <foo@bar.xx>\n"
"Language-Team: C <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
AC_SUBST(MSGFMT_OPTS)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
@ -400,3 +414,20 @@ ifdef(glib_configure_in,[],[
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
])dnl
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
#
# Create a temporary file with TEST-FILE as its contents and pass the
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
# 0 and perform ACTION-IF-FAIL for any other exit status.
AC_DEFUN([GLIB_RUN_PROG],
[cat >conftest.foo <<_ACEOF
$2
_ACEOF
if AC_RUN_LOG([$1 conftest.foo]); then
m4_ifval([$3], [$3], [:])
m4_ifvaln([$4], [else $4])dnl
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
fi])

View File

@ -41,6 +41,7 @@ CC = @CC@
GENCAT = @GENCAT@
GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
MSGFMT_OPTS = @MSGFMT_OPTS@
XGETTEXT = @XGETTEXT@
MSGMERGE = msgmerge
@ -79,7 +80,7 @@ INSTOBJEXT = @INSTOBJEXT@
.po.gmo:
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
&& rm -f $$file && $(GMSGFMT) -c -o $$file $<
&& rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $<
.po.cat:
sed -f ../intl/po2msg.sed < $< > $*.msg \