Skip to content

Commit

Permalink
Fix building of msis-msgfmt.
Browse files Browse the repository at this point in the history
* po/Rules-nsis (nsis-msgfmt): Use detected build compiler.
* po/build-cc.in: New.
* configure.ac (BUILD_CC): New ac_subst.
  • Loading branch information
dd9jn committed May 10, 2013
1 parent 066177b commit 4bbc4f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ src/mingwm10.dll

/src/libgcc_s_sjlj-1.dll-x
/src/libstdc++-6.dll-x
/po/build-cc
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ AC_CHECK_PROGS(SHA1SUM, sha1sum)
AC_CHECK_PROGS(MSGFMT, msgfmt)
AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog,
[build-aux/gitlog-to-changelog])
AC_CHECK_PROGS(BUILD_CC, gcc cc)
AC_PROG_INSTALL

missing_tools=
for i in DLLTOOL MAKE UNZIP TAR MKDIR CP RM STOW MAKENSIS ZCAT TEXI2DVI \
DVIPDF CONVERT SHA1SUM MSGFMT ; do
DVIPDF CONVERT SHA1SUM MSGFMT BUILD_CC; do
eval tmp='$'$i
if test -z "$tmp"; then
missing_tools="$missing_tools `echo $i | tr 'A-Z' 'a-z'`"
Expand Down Expand Up @@ -410,6 +411,7 @@ chmod +x patches/gnupg2/01-version.patch

AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(packages/Makefile include/Makefile src/Makefile po/Makefile.in)
AC_CONFIG_FILES(po/build-cc)
AC_CONFIG_FILES(include/config.nsi src/gpg4win.mk)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(doc/logo/Makefile)
Expand Down
20 changes: 9 additions & 11 deletions po/Rules-nsis
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# Rules-nsis - Special Makefile rules for NSIS msg catalogs. -*- Makefile -*-
# Copyright (C) 2007 g10 Code GmbH
#
#
# This file is part of GPG4Win.
#
#
# GPG4Win is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# GPG4Win is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

NSIFILES = $(GMOFILES:.gmo=.nsi)
DISTFILES.extra1 = nsis-xgettext.sh nsis-xgettext.awk nsis-msgfmt.c $(NSIFILES) \
Rules-nsis README.nsis
DISTFILES.extra1 = nsis-xgettext.sh nsis-xgettext.awk nsis-msgfmt.c \
$(NSIFILES) Rules-nsis build-cc.in README.nsis

.SUFFIXES: .nsi

# We build this little utility on the BUILD architecture! FIXME: It
# would not be unreasonable to use $(BUILD_CC) and corresponding tests
# in configure.
# We build this little utility on the BUILD architecture!
nsis-msgfmt: nsis-msgfmt.c
$(CC) -o nsis-msgfmt $(srcdir)/nsis-msgfmt.c -lgettextpo
$$(cat $(srcdir)/build-cc) -o nsis-msgfmt $(srcdir)/nsis-msgfmt.c -lgettextpo

# We extend the GMO file mechanism to also handle NSIS files.
$(GMOFILES): %.gmo: %.nsi

%.nsi : %.po
%.nsi : %.po
$(MAKE) nsis-msgfmt
@lang=`echo $* | sed -e 's,.*/,,'`; \
test "$(srcdir)" = . && dir="" || dir="$(srcdir)/"; \
Expand Down
1 change: 1 addition & 0 deletions po/build-cc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@BUILD_CC@

0 comments on commit 4bbc4f0

Please sign in to comment.