diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-07-17 12:36:54 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-07-17 12:36:54 +0000 |
commit | adc68058bd8f88d6a9c59493468f734fdf3af895 (patch) | |
tree | 2426dd7e1041b403f6b80c4ca6fb82eceed958c4 | |
parent | 67dec9f5a82ac4a2e3d6adf92c9450c58688179a (diff) |
Rewrite translation handling in the build system.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27311 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | configure | 55 |
2 files changed, 36 insertions, 25 deletions
@@ -819,8 +819,8 @@ install-dirs: install-%: %$(EXESUF) install-dirs $(INSTALL) -m 755 $(INSTALLSTRIP) $< $(BINDIR) -install-mplayer-man: $(foreach lang,$(MAN_LANG),install-mplayer-man-$(lang)) -install-mencoder-man: $(foreach lang,$(MAN_LANG),install-mencoder-man-$(lang)) +install-mplayer-man: $(foreach lang,$(MAN_LANGS),install-mplayer-man-$(lang)) +install-mencoder-man: $(foreach lang,$(MAN_LANGS),install-mencoder-man-$(lang)) install-mplayer-man-en: $(INSTALL) -d $(MANDIR)/man1 @@ -856,7 +856,7 @@ uninstall: rm -f $(prefix)/share/pixmaps/mplayer.xpm rm -f $(prefix)/share/applications/mplayer.desktop rm -f $(MANDIR)/man1/mplayer.1 $(MANDIR)/man1/mencoder.1 - rm -f $(foreach lang,$(MAN_LANG),$(foreach man,mplayer.1 mencoder.1,$(MANDIR)/$(lang)/man1/$(man))) + rm -f $(foreach lang,$(MAN_LANGS),$(foreach man,mplayer.1 mencoder.1,$(MANDIR)/$(lang)/man1/$(man))) clean: rm -f $(foreach dir,$(DIRS),$(foreach suffix,/*.o /*.a /*.ho /*~, $(addsuffix $(suffix),$(dir)))) @@ -191,9 +191,9 @@ case `echo -n` in *) _echo_n='-n ' _echo_c= ;; # BSD echo esac -msg_langs=`echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g"` -man_langs=`echo DOCS/man/??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g"` -doc_langs=`echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g"` +msg_lang_all=`echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g"` +man_lang_all=`echo DOCS/man/??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g"` +doc_lang_all=`echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g"` show_help(){ cat << EOF @@ -419,7 +419,7 @@ Miscellaneous options: translated man pages, the first language is used for messages and the GUI (the environment variable \$LINGUAS is also honored) [en] - (Available: all $msg_langs) + (Available: all $msg_lang_all) --with-install=PATH path to a custom install program Advanced options: @@ -2604,28 +2604,38 @@ echores "$_langinfo" echocheck "language" test -z "$_language" && _language=$LINGUAS _language=`echo $_language | tr , " "` -echo $_language | grep -q all || msg_langs="$_language en" +if $(echo $_language | grep -q all) ; then + doc_lang=en ; doc_langs=$doc_lang_all + man_lang=en ; man_langs=$man_lang_all + msg_lang=en +else + for lang in $_language ; do + if test -d DOCS/man/$lang ; then + tmp_man_langs="$tmp_man_langs $lang" + fi + if test -d DOCS/xml/$lang ; then + tmp_doc_langs="$tmp_doc_langs $lang" + fi + done + man_langs=$tmp_man_langs + doc_langs=$tmp_man_langs for lang in $_language ; do - test "$lang" = all && lang=en if test -f "help/help_mp-${lang}.h" ; then - _language=$lang + msg_lang=$lang break else echo ${_echo_n} "$lang not found, ${_echo_c}" _language=`echo $_language | sed "s/$lang *//"` fi done -test -z "$_language" && _language=en -_mp_help="help/help_mp-${_language}.h" -for lang in $msg_langs ; do - if test -f "DOCS/man/$lang/mplayer.1" ; then - MAN_LANG_ALL="$lang $MAN_LANG_ALL" - fi -done -MAN_LANG="$(echo $MAN_LANG_ALL | sed 's/en//')" -doc_lang=$_language -test -d DOCS/xml/$doc_lang || doc_lang=en -echores "using $_language (man pages: $MAN_LANG_ALL)" +fi +test -z "$doc_langs" && doc_langs=en +test -z "$man_langs" && man_langs=en +test -z "$doc_lang" && doc_lang=$(echo $doc_langs | cut -f1 -d" ") +test -z "$man_lang" && man_lang=$(echo $man_langs | cut -f1 -d" ") +test -z "$msg_lang" && msg_lang=en +_mp_help="help/help_mp-${_msg_lang}.h" +echores "messages: $msg_lang - man pages: $man_langs - documentation: $doc_langs" echocheck "enable sighandler" @@ -7609,8 +7619,9 @@ cat > config.mak << EOF # Ensure that locale settings do not interfere with shell commands. export LC_ALL = C -MAN_LANG = $MAN_LANG -MAN_LANG_ALL = $MAN_LANG_ALL +MAN_LANG = $man_lang +MAN_LANGS = $man_langs +MAN_LANG_ALL = $man_lang_all DESTDIR = prefix = \$(DESTDIR)$_prefix @@ -8604,8 +8615,8 @@ Config files successfully generated by ./configure $_configuration ! Optimizing for: $_optimizing Languages: - Messages/GUI: $_language - Manual pages: $MAN_LANG_ALL + Messages/GUI: $msg_lang + Manual pages: $man_langs Enabled optional drivers: Input: $_inputmodules |