[tasque/xbuild] [build] Switch po build to xbuild.
- From: Antonius Riha <antoniusri src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tasque/xbuild] [build] Switch po build to xbuild.
- Date: Sat, 1 Sep 2012 14:43:41 +0000 (UTC)
commit 79ecf45a52feaa34b06cdfa2c2bbe6d06efda08e
Author: Antonius Riha <antoniusriha gmail com>
Date: Sat Sep 1 16:40:02 2012 +0200
[build] Switch po build to xbuild.
* po/po.mdproj:
- Added target "Dist", "DistClean" and "Check" and resp. item groups
"DistFile" and DistCleanFile" (no special item group for Check)
- Added properties SrcDir (points to compile sources) and
DestDir (points to temp intall path)
* po/Makefile.in:
- contains targets that relay to the resp. xbuild targets.
- accounts for the copied name of po.mdproj (which is po.mdp)
* po/LINGUAS: is not needed anymore.
* configure.ac:
- Configure now produces a Makefile from po/Makefile.am
- Configure now copies po.mdproj to build directory
- The macro IT_PROG_INTLTOOL([0.35]) has been dropped, since
it interfered with the new way of compiling i18n files.
- Added checks for intltool-update and intltool-merge, which
previously where done by IT_PROG_INTLTOOL([0.35]).
- Added variable "POMDPROJ", which holds the name of the
xbuild file after being copied to the build dir. Note: Usually xbuild
doesn't do substitution like configure (Makefile.in -> Makfile). But
since automake is the master build engine, xbuild has to play by its
rules and let itself being copied to the build dir. With the exception of
the file name, which changes from po.mdproj to po.mdp, the copy
process doesn't do anything to the xbuild content.
* data/Makefile.am: INTLTOOL_DESKTOP_RULE has been
replaced by its "normal" substitution in the configure process. Note:
This will soon be replaced by xbuild.
* Makefile.am: Removed obsolete files.
.gitignore | 3 ++-
Makefile.am | 8 --------
configure.ac | 30 ++++++++++++++++++++++++++++--
data/Makefile.am | 4 ++--
po/LINGUAS | 36 ------------------------------------
po/Makefile.in | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
po/po.mdproj | 30 +++++++++++++++++++++++++-----
7 files changed, 109 insertions(+), 54 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5cc0ce8..8c9f648 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,7 +60,6 @@ Makefile.in
# /po
/po/*.gmo
/po/POTFILES
-/po/stamp-it
/po/Makefile.in.in
/po/cat-id-tbl.c
/po/.intltool-merge-cache
@@ -71,6 +70,8 @@ Makefile.in
/po/po2tbl.sed.*
/po/*.pot
/po/stamp-cat-id
+/po/po.mdp
+!/po/Makefile.in
# /src/Gtk.Tasque/
/src/Gtk.Tasque/*.dll
diff --git a/Makefile.am b/Makefile.am
index c45b13b..6997af0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,19 +4,11 @@ pkgdata_DATA = $(DLL_REFERENCES)
DLL_REFERENCES =
EXTRA_DIST = \
$(DLL_REFERENCES) \
- \
- intltool-extract.in \
- intltool-merge.in \
- intltool-update.in \
- \
MAINTAINERS \
TRANSLATORS
DISTCLEANFILES = \
\
- intltool-extract \
- intltool-merge \
- intltool-update \
po/.intltool-merge-cache
DISTCHECK_CONFIGURE_FLAGS = --disable-schemas-install --disable-scrollkeeper
diff --git a/configure.ac b/configure.ac
index eee9fdf..0c55341 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,6 @@ AM_MAINTAINER_MODE
GNOME_COMMON_INIT
AC_PROG_INSTALL
-IT_PROG_INTLTOOL([0.35])
AC_PROG_LIBTOOL
dnl pkg-config
@@ -22,6 +21,26 @@ if test "x$DMCS" = "xno"; then
fi
#
+# Setup xbuild
+#
+AC_PATH_PROG(XBUILD, xbuild, no)
+if test "x$XBUILD" = "xno"; then
+ AC_MSG_ERROR([xbuild not found])
+fi
+
+#
+# Setup i18n tools
+#
+AC_PATH_PROG(INTLTOOL_MERGE, intltool-merge, no)
+if test "xINTLTOOL_MERGE" = "xno"; then
+ AC_MSG_ERROR([intltool-merge not found])
+fi
+AC_PATH_PROG(INTLTOOL_UPDATE, intltool-update, no)
+if test "xINTLTOOL_UPDATE" = "xno"; then
+ AC_MSG_ERROR([intltool-update not found])
+fi
+
+#
# Setup GETTEXT
#
@@ -243,6 +262,12 @@ AC_SUBST(GACUTIL_FLAGS)
### End GAC tool ###
+#
+# Setup po.mdproj
+#
+POMDPROJ=po.mdp
+AC_SUBST(POMDPROJ)
+
AC_CONFIG_FILES([
Makefile
src/Makefile
@@ -261,7 +286,8 @@ src/Addins/Backends/Sqlite/Makefile
data/Makefile
data/images/Makefile
data/sounds/Makefile
-po/Makefile.in
+po/Makefile
+po/${POMDPROJ}:po/po.mdproj
])
AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
index 67741a2..fd80191 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,11 +1,11 @@
SUBDIRS = images sounds
- INTLTOOL_DESKTOP_RULE@
-
desktop_in_files = tasque.desktop.in
desktop_files = $(desktop_in_files:.desktop.in=.desktop)
+%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+
desktopdir = $(datadir)/applications
desktop_DATA = $(desktop_files)
diff --git a/po/Makefile.in b/po/Makefile.in
new file mode 100644
index 0000000..3270843
--- /dev/null
+++ b/po/Makefile.in
@@ -0,0 +1,52 @@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+
+prefix = @prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+
+XBUILD = @XBUILD@
+MSGFMT = @MSGFMT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+
+POMDPROJ = @POMDPROJ@
+
+PROPERTIES = \
+ /property:SrcDir=$(srcdir) \
+ /property:Prefix=$(prefix) \
+ /property:DataDir=$(datadir) \
+ /property:LocaleDir=$(localedir) \
+ /property:MsgFmt=$(MSGFMT) \
+ /property:IntlToolUpdate=$(INTLTOOL_UPDATE) \
+ /property:DistDir=../$(PACKAGE)-$(VERSION)/po \
+ /property:DestDir=$(DESTDIR)
+
+all:
+ $(XBUILD) $(PROPERTIES) $(POMDPROJ)
+
+clean:
+ $(XBUILD) $(PROPERTIES) /target:clean $(POMDPROJ)
+
+install:
+ $(XBUILD) $(PROPERTIES) /target:install $(POMDPROJ)
+
+uninstall:
+ $(XBUILD) $(PROPERTIES) /target:uninstall $(POMDPROJ)
+
+update-po:
+ $(XBUILD) $(PROPERTIES) /target:update $(POMDPROJ)
+
+dist distdir:
+ $(XBUILD) $(PROPERTIES) /target:dist $(POMDPROJ)
+
+distclean:
+ $(XBUILD) $(PROPERTIES) /target:distclean $(POMDPROJ)
+
+check:
+ $(XBUILD) $(PROPERTIES) /target:check $(POMDPROJ)
+
+dvi installcheck:
diff --git a/po/po.mdproj b/po/po.mdproj
index f7df1c5..6c049ba 100644
--- a/po/po.mdproj
+++ b/po/po.mdproj
@@ -99,14 +99,23 @@
<GettextTranslation Include="zh_TW.po" />
</ItemGroup>
<ItemGroup>
- <!-- Required by intltool-update -->
- <PotfilesIn Include="POTFILES.in" />
+ <DistFile Include="@(GettextTranslation)" />
+ <DistFile Include="POTFILES.in" />
+ <DistFile Include="po.mdproj" />
+ </ItemGroup>
+ <ItemGroup>
+ <DistCleanFile Include="POTFILES" />
+ <DistCleanFile Include="Makefile" />
+ <DistCleanFile Include="po.mdp" />
+ <DistCleanFile Include="*.gmo" />
</ItemGroup>
<PropertyGroup>
+ <SrcDir Condition=" '$(SrcDir)' == '' ">.</SrcDir>
<Prefix Condition=" '$(Prefix)' == '' ">..\build\bin</Prefix>
<DataDir Condition=" '$(DataDir)' == '' ">$(Prefix)\share</DataDir>
<LocaleDir Condition=" '$(LocaleDir)' == '' ">$(DataDir)\locale</LocaleDir>
+ <DestDir Condition=" '$(DestDir)' != '' And !HasTrailingSlash('$(DestDir)')">$(DestDir)\</DestDir>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(MSBuildProgramFiles32)\GnuWin32\bin\msgfmt.exe')">
@@ -126,16 +135,16 @@
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<Target Name="Build">
- <Exec Command="$(MsgFmt) -o %(FileName).gmo @(GettextTranslation)" />
+ <Exec Command="$(MsgFmt) -o %(FileName).gmo $(SrcDir)\@(GettextTranslation)" />
</Target>
<Target Name="Clean">
<Delete Files="%(GettextTranslation.FileName).gmo" />
</Target>
<Target Name="Install">
- <Copy SourceFiles="%(GettextTranslation.FileName).gmo" DestinationFiles="$(LocaleDir)\%(GettextTranslation.FileName)\LC_MESSAGES\tasque.mo" />
+ <Copy SourceFiles="%(GettextTranslation.FileName).gmo" DestinationFiles="$(DestDir)$(LocaleDir)\%(GettextTranslation.FileName)\LC_MESSAGES\tasque.mo" />
</Target>
<Target Name="Uninstall">
- <Delete Files="$(LocaleDir)\%(GettextTranslation.FileName)\LC_MESSAGES\tasque.mo" />
+ <Delete Files="$(DestDir)$(LocaleDir)\%(GettextTranslation.FileName)\LC_MESSAGES\tasque.mo" />
</Target>
<Target Name="Update">
<Exec Command="$(IntlToolUpdate) --gettext-package tasque --pot" />
@@ -143,4 +152,15 @@
<Copy SourceFiles="%(FileName).new.po" DestinationFiles="@(GettextTranslation)" />
<Delete Files="%(GettextTranslation.FileName).new.po" />
</Target>
+ <Target Name="Dist">
+ <Copy SourceFiles="$(SrcDir)\%(DistFile.Identity)" DestinationFolder="$(DistDir)" SkipUnchangedFiles="true" />
+ </Target>
+ <Target Name="DistClean" DependsOnTargets="Clean">
+ <Delete Files="@(DistCleanFile)" />
+ </Target>
+ <Target Name="Check">
+ <Delete Files="missing;notexist" />
+ <Exec Command="srcdir=$(SrcDir) $(IntlToolUpdate) -m" />
+ <Error Condition="Exists('missing') Or Exists('notexist')" Text="Some files which should have been listed in POTFILES.in or POTFILES.skip have been left out." />
+ </Target>
</Project>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]