From 818ff14582961d248d430cba4644202a50b1d878 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 13 Jan 2002 13:48:08 +0000 Subject: [PATCH] make all now compiles .mo catalogs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 15 +++++++------ configure | 22 +++++++++--------- configure.in | 3 ++- locale/Makefile | 50 ----------------------------------------- locale/Makefile.in | 56 ++++++++++++++++++++++++++++++++++++++++++++++ wxBase.spec | 2 -- wxGTK.spec | 2 -- wxMotif.spec | 2 -- 8 files changed, 78 insertions(+), 74 deletions(-) delete mode 100644 locale/Makefile create mode 100644 locale/Makefile.in diff --git a/Makefile.in b/Makefile.in index 1c5479b269..9e1f4d77d1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -132,7 +132,7 @@ DISTDIR=./_dist_dir/$(DISTDIRNAME) ############################## Files ################################## -WX_LINGUAS = `cd $(top_srcdir)/locale && ls *.mo 2> /dev/null | sed -n 's/\.mo//p'` +WX_LINGUAS = `cd $(top_builddir)/locale; ls *.mo 2> /dev/null | sed -n 's/\.mo//p'` # this line will include a file which defines ALL_SOURCES, ALL_OBJECTS, # ALL_DEPFILES and ALL_HEADERS variables with the complete list of .cpp, .o, @@ -312,7 +312,7 @@ IODBCOBJS = \ SONAME_FLAGS = @SONAME_FLAGS@ SONAME_FLAGS_GL = @SONAME_FLAGS_GL@ -all: @WX_ALL@ +all: @WX_ALL@ locale_files $(build_libdir)/@WX_LIBRARY_NAME_STATIC@: $(OBJECTS) @$(INSTALL) -d $(build_libdir) @@ -377,6 +377,8 @@ lexer.c: $(COMMDIR)/lexer.l -include $(OBJECTS:.o=.d) +locale_files: + @(cd locale && $(MAKE)) CREATE_INSTALLED_LINKS: preinstall $(RM) $(libdir)/@WX_LIBRARY_LINK1@ @@ -450,8 +452,8 @@ preinstall: $(build_libdir)/@WX_TARGET_LIBRARY@ $(top_builddir)/wx@TOOLCHAIN_NAM @for p in $(WX_LINGUAS); do \ if test ! -d $(localedir)/$$p; then $(INSTALL) -d $(localedir)/$$p; fi;\ if test ! -d $(localedir)/$$p/LC_MESSAGES; then $(INSTALL) -d $(localedir)/$$p/LC_MESSAGES; fi;\ - $(INSTALL_DATA) $(top_srcdir)/locale/$$p.mo $(localedir)/$$p/LC_MESSAGES/wxstd.mo; \ - echo "$(INSTALL_DATA) $(top_srcdir)/locale/$$p.mo $(localedir)/$$p/LC_MESSAGES/wxstd.mo"; \ + $(INSTALL_DATA) locale/$$p.mo $(localedir)/$$p/LC_MESSAGES/wxstd.mo; \ + echo "$(INSTALL_DATA) locale/$$p.mo $(localedir)/$$p/LC_MESSAGES/wxstd.mo"; \ done preinstall_res: $(build_libdir)/@WX_RESOURCES_MACOSX_COMPILED@ @@ -1288,11 +1290,10 @@ MISC_DIST: ALL_GUI_DIST mkdir $(DISTDIR)/misc/gs_afm cp $(MISCDIR)/gs_afm/*.afm $(DISTDIR)/misc/gs_afm -INTL_DIST: +INTL_DIST: locale_files mkdir $(DISTDIR)/locale - cp $(INTLDIR)/Makefile $(DISTDIR)/locale + cp $(INTLDIR)/Makefile.in $(DISTDIR)/locale cp $(INTLDIR)/*.po $(DISTDIR)/locale - -cp $(INTLDIR)/*.mo $(DISTDIR)/locale MANUAL_DIST: mkdir $(DISTDIR)/docs diff --git a/configure b/configure index 3fcf04b582..c100599b8b 100755 --- a/configure +++ b/configure @@ -8369,17 +8369,17 @@ fi fi - echo $ac_n "checking for --enable-ico_cur""... $ac_c" 1>&6 -echo "configure:8374: checking for --enable-ico_cur" >&5 + echo $ac_n "checking for --enable-icocur""... $ac_c" 1>&6 +echo "configure:8374: checking for --enable-icocur" >&5 no_cache=0 - # Check whether --enable-ico_cur or --disable-ico_cur was given. -if test "${enable_ico_cur+set}" = set; then - enableval="$enable_ico_cur" + # Check whether --enable-icocur or --disable-icocur was given. +if test "${enable_icocur+set}" = set; then + enableval="$enable_icocur" if test "$enableval" = yes; then - ac_cv_use_ico_cur='wxUSE_ICO_CUR=yes' + ac_cv_use_icocur='wxUSE_ICO_CUR=yes' else - ac_cv_use_ico_cur='wxUSE_ICO_CUR=no' + ac_cv_use_icocur='wxUSE_ICO_CUR=no' fi else @@ -8391,14 +8391,14 @@ else no_cache=1 fi - ac_cv_use_ico_cur='wxUSE_ICO_CUR='$DEFAULT_wxUSE_ICO_CUR + ac_cv_use_icocur='wxUSE_ICO_CUR='$DEFAULT_wxUSE_ICO_CUR fi - eval "$ac_cv_use_ico_cur" + eval "$ac_cv_use_icocur" if test "$no_cache" != 1; then - echo $ac_cv_use_ico_cur >> ${wx_arg_cache_file}.tmp + echo $ac_cv_use_icocur >> ${wx_arg_cache_file}.tmp fi if test "$wxUSE_ICO_CUR" = yes; then @@ -19782,6 +19782,7 @@ trap 'rm -fr `echo " src/makeprog.env src/makelib.env Makefile + locale/Makefile setup.h:setup.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index 1e5be7dee3..2b1e3ebeea 100644 --- a/configure.in +++ b/configure.in @@ -1360,7 +1360,7 @@ WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file f WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX) WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM) WX_ARG_ENABLE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM) -WX_ARG_ENABLE(ico_cur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR) +WX_ARG_ENABLE(icocur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR) fi dnl for GUI only @@ -5048,6 +5048,7 @@ AC_OUTPUT([ src/makeprog.env src/makelib.env Makefile + locale/Makefile ], [ dnl This test is required to make the following idempotent. diff --git a/locale/Makefile b/locale/Makefile deleted file mode 100644 index 8d4123a65e..0000000000 --- a/locale/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# this is the makefile for generating wxstd.po message catalog file and -# building lang.mo files from the translated lang.po catalogs - -# this makefile may be invoked to build either wxstd.po or any lang.mo - -# Autodetect the languages we support. Currently this relies on make -# being called with this dir as the cwd, but if we generate this file -# with configure an explicit path should be specified -- RL. - -WX_LINGUAS := `ls *.po 2> /dev/null | sed -n 's/\(wxstd\)\?\.po//p'` - -# the programs we use (TODO: use configure to detect them) -MSGFMT=msgfmt --verbose -MSGMERGE=msgmerge -XGETTEXT=xgettext -XARGS=xargs - -# common xgettext args: C++ syntax, use the specified macro names as markers -XGETTEXT_ARGS=-C -k_ -kwxGetTranslation -kwxTRANSLATE -s -j - -# implicit rules -%.mo: %.po - $(MSGFMT) -o $@ $< - -# a PO file must be updated from wxstd.po to include new translations -%.po: wxstd.po - if [ -f $@ ]; then $(MSGMERGE) $@ wxstd.po > $@.new && mv $@.new $@; else cp wxstd.po $@; fi - -wxstd.po: - touch $@ - find ../include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po - find ../src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po - find ../contrib/include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po - find ../contrib/src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po - -allpo: force-update - @-for t in $(WX_LINGUAS); do $(MAKE) $$t.po; done - -allmo: - @for t in $(WX_LINGUAS); do $(MAKE) $$t.mo; done - -force-update: - $(RM) wxstd.po - -# targets depending on this one will be always remade -FORCE: - -.PHONY: allpo allmo force-update - -# $Id$ diff --git a/locale/Makefile.in b/locale/Makefile.in new file mode 100644 index 0000000000..8323f238d6 --- /dev/null +++ b/locale/Makefile.in @@ -0,0 +1,56 @@ +# this is the makefile for generating wxstd.po message catalog file and +# building lang.mo files from the translated lang.po catalogs + +# this makefile may be invoked to build either wxstd.po or any lang.mo + +# Autodetect the languages we support. Currently this relies on make +# being called with this dir as the cwd, but if we generate this file +# with configure an explicit path should be specified -- RL. + +WX_LINGUAS := `cd @srcdir@ ; ls *.po 2> /dev/null | sed -n 's/\(wxstd\)\?\.po//p'` +LINGUAS_TARGETS := $(shell cd @srcdir@ ; ls *.po 2> /dev/null | sed -e 's/wxstd\.po//' | sed -e 's/po/mo/') + +# the programs we use (TODO: use configure to detect them) +MSGFMT=msgfmt --verbose +MSGMERGE=msgmerge +XGETTEXT=xgettext +XARGS=xargs + +# common xgettext args: C++ syntax, use the specified macro names as markers +XGETTEXT_ARGS=-C -k_ -kwxGetTranslation -kwxTRANSLATE -s -j + +# default target +all: allmo + +clean: + $(RM) $(LINGUAS_TARGETS) + +# implicit rules +%.mo: @srcdir@/%.po + $(MSGFMT) -o $@ $< + +# a PO file must be updated from wxstd.po to include new translations +@srcdir@/%.po: @srcdir@/wxstd.po + if [ -f $@ ]; then $(MSGMERGE) $@ @srcdir@/wxstd.po > $@.new && mv $@.new $@; else cp @srcdir@/wxstd.po $@; fi + +@srcdir@/wxstd.po: + touch $@ + find @top_srcdir@/include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o $@ + find @top_srcdir@/src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o $@ + find @top_srcdir@/contrib/include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o $@ + find @top_srcdir@/contrib/src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o $@ + +allpo: force-update + @-for t in $(WX_LINGUAS); do $(MAKE) @srcdir@/$$t.po; done + +allmo: $(LINGUAS_TARGETS) + +force-update: + $(RM) @srcdir@/wxstd.po + +# targets depending on this one will be always remade +FORCE: + +.PHONY: all allpo allmo force-update + +# $Id$ diff --git a/wxBase.spec b/wxBase.spec index ab50528572..5b38f95a9b 100644 --- a/wxBase.spec +++ b/wxBase.spec @@ -49,8 +49,6 @@ else export MAKE="make" fi -(cd locale; make allmo) - mkdir obj-shared cd obj-shared ../configure --prefix=%{pref} --enable-soname --disable-gui --disable-std_iostreams diff --git a/wxGTK.spec b/wxGTK.spec index b740aa0a35..a979aaaa88 100644 --- a/wxGTK.spec +++ b/wxGTK.spec @@ -63,8 +63,6 @@ else export MAKE="make" fi -(cd locale; make allmo) - mkdir obj-shared cd obj-shared ../configure --prefix=%{pref} --enable-soname --with-odbc --with-opengl diff --git a/wxMotif.spec b/wxMotif.spec index 7eb069c3e2..a943405f05 100644 --- a/wxMotif.spec +++ b/wxMotif.spec @@ -62,8 +62,6 @@ else export MAKE="make" fi -(cd locale; make allmo) - mkdir obj-shared cd obj-shared ../configure --prefix=%{pref} --enable-soname --with-odbc --with-opengl --with-motif -- 2.45.2