Skip to content

Commit

Permalink
configure: add checks for xgettext and msgmerge
Browse files Browse the repository at this point in the history
  • Loading branch information
perexg committed Jun 20, 2015
1 parent d1469c5 commit bad281a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ BUNDLE_FLAGS = ${BUNDLE_FLAGS-yes}
#

MKBUNDLE = $(PYTHON) $(ROOTDIR)/support/mkbundle
XGETTEXT ?= xgettext --language=C -k_ -kN_ -s
XGETTEXT2 ?= $(XGETTEXT) --language=C -k_ -kN_ -s
MSGMERGE ?= msgmerge
MSGFMT ?= msgfmt

#
# Debug/Output
Expand Down Expand Up @@ -528,7 +527,8 @@ ${BUILDDIR}/%.so: ${SRCS_EXTRA}

# Clean
clean:
rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundle* ${BUILDDIR}/build.o ${BUILDDIR}/timestamp.*
rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundle* ${BUILDDIR}/build.o ${BUILDDIR}/timestamp.* \
src/tvh_locale_inc.c
find . -name "*~" | xargs rm -f
$(MAKE) -f Makefile.webui clean

Expand Down Expand Up @@ -571,7 +571,7 @@ $(BUILDDIR)/build.o: $(BUILDDIR)/build.c
.PHONY: intl
intl:
@printf "Building tvheadend.pot\n"
@$(XGETTEXT) -o intl/tvheadend.pot.new $(I18N-C)
@$(XGETTEXT2) -o intl/tvheadend.pot.new $(I18N-C)
@mv intl/tvheadend.pot.new intl/tvheadend.pot
$(MAKE) -f Makefile.webui LANGUAGES="$(LANGUAGES)" WEBUI=std intl
$(MAKE)
Expand Down
4 changes: 2 additions & 2 deletions Makefile.webui
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CSS_PY = PYTHONIOENCODING=utf-8 $(PYTHON) support/css.py
RUN_JS = PYTHONIOENCODING=utf-8 $(PYTHON) vendor/rjsmin-1.0.10/rjsmin.py
RUN_CSS = PYTHONIOENCODING=utf-8 $(PYTHON) vendor/rcssmin-1.0.5/rcssmin.py
GZIPCMD += -n
XGETTEXT ?= xgettext --language=JavaScript --from-code=utf-8 -k_ -kN_ -s
XGETTEXT2 ?= $(XGETTEXT) --language=JavaScript --from-code=utf-8 -k_ -kN_ -s
MSGMERGE ?= msgmerge
POJS_PY = PYTHONIOENCODING=utf-8 $(PYTHON) support/pojs.py

Expand Down Expand Up @@ -248,7 +248,7 @@ compile-debug: $(WEBDIR)/extjs-debug.c $(WEBDIR)/extjs-tv-debug.c
.PHONY: intl
intl:
@printf "Building intl/js/tvheadend.js.pot\n"
@$(XGETTEXT) -o intl/js/tvheadend.js.pot.new $(JAVASCRIPT_SRC)
@$(XGETTEXT2) -o intl/js/tvheadend.js.pot.new $(JAVASCRIPT_SRC)
@mv intl/js/tvheadend.js.pot.new intl/js/tvheadend.js.pot

intl/js/tvheadend.js.pot:
Expand Down
2 changes: 2 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ check_py_import gzip
#
# Binaries
#
check_bin ${XGETTEXT} || die 'WARN: no gettext binaries found'
check_bin ${MSGMERGE} || die 'WARN: no gettext binaries found'
check_bin ${GZIPCMD} || die 'WARN: no gzip binary found'
check_bin ${BZIP2} || echo 'WARN: no bzip2 binary found'

Expand Down
4 changes: 4 additions & 0 deletions support/configure.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ CONFIGURE_ARGS="$*"
[ -z "$PYTHON" ] && PYTHON=python
[ -z "$GZIPCMD" ] && GZIPCMD=gzip
[ -z "$BZIP2" ] && BZIP2=bzip2
[ -z "$XGETTEXT" ] && XGETTEXT=xgettext
[ -z "$MSGMERGE" ] && MSGMERGE=msgmerge

# Paths
[ -z "$prefix" ] && prefix=/usr/local
Expand Down Expand Up @@ -461,6 +463,8 @@ endif
PYTHON ?= ${PYTHON}
GZIPCMD ?= ${GZIPCMD}
BZIP2 ?= ${BZIP2}
XGETTEXT ?= ${XGETTEXT}
MSGMERGE ?= ${MSGMERGE}
CFLAGS += ${CFLAGS}
LDFLAGS += ${LDFLAGS}
prefix = ${prefix}
Expand Down

0 comments on commit bad281a

Please sign in to comment.