Skip to content

Commit

Permalink
use autoconf to detect msgfmt version
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Mar 11, 2024
1 parent c5df96e commit ebd2978
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/auto/configure
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
LINK_AS_NEEDED
DEPEND_CFLAGS_FILTER
MSGFMTCMD
MSGFMT_DESKTOP
MAKEMO
MSGFMT
Expand Down Expand Up @@ -15964,6 +15965,18 @@ printf "%s\n" "yes" >&6; }
printf "%s\n" "no" >&6; }
fi

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if msgfmt supports --no-convert" >&5
printf %s "checking if msgfmt supports --no-convert... " >&6; }
if "$MSGFMT" --help | grep -q -- '--no-convert' >/dev/null; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt --no-convert -v"
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt -v"
fi

fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no \"po/Makefile\" - disabled" >&5
Expand Down
1 change: 1 addition & 0 deletions src/config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ OS_EXTRA_OBJ = @OS_EXTRA_OBJ@
MAKEMO = @MAKEMO@

MSGFMT = @MSGFMT@
MSGFMTCMD = @MSGFMTCMD@
MSGFMT_DESKTOP = @MSGFMT_DESKTOP@

### set if $SOURCE_DATE_EPOCH was set when running configure
Expand Down
9 changes: 9 additions & 0 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4523,6 +4523,15 @@ if test "$enable_nls" = "yes"; then
AC_MSG_RESULT([no])
fi
AC_SUBST(MSGFMT_DESKTOP)
AC_MSG_CHECKING([if msgfmt supports --no-convert])
if "$MSGFMT" --help | grep -q -- '--no-convert' >/dev/null; then
AC_MSG_RESULT([yes])
MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt --no-convert -v"
else
AC_MSG_RESULT([no])
MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt -v"
fi
AC_SUBST(MSGFMTCMD)
fi
else
AC_MSG_RESULT([no "po/Makefile" - disabled]);
Expand Down
5 changes: 3 additions & 2 deletions src/po/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ SED = LANG=C sed
# tools 0.10.37, which use a slightly different .po file format that is not
# compatible with Solaris (and old gettext implementations) unless these are
# set. gettext 0.10.36 will not work!
MSGFMTC != if $(MSGFMT) --help |grep -q -- --no-convert ; then echo msgfmt -v --no-convert; else echo msgfmt -v; fi
MSGFMTCMD = OLD_PO_FILE_INPUT=yes $(MSGFMTC)

# MSGFMTCMD is defined by Configure in ../auto/config.mk
# MSGFMTCMD = OLD_PO_FILE_INPUT=yes $(MSGFMT) -v
XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext
MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge

Expand Down

0 comments on commit ebd2978

Please sign in to comment.