git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] Auto detection in Makefile if msgfmt is not available
@ 2012-02-12 12:42 Torsten Bögershausen
  2012-02-12 15:22 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Torsten Bögershausen @ 2012-02-12 12:42 UTC (permalink / raw)
  To: avarab, git; +Cc: tboegi

Since commit 5e9637c629702e3d41ad01d95956d1835d7338e0
"i18n: add infrastructure for translating Git with gettext"
the Makefile demands the existance of msgfmt, unless NO_GETTEXT is defined.

This breaks the build on systems where msgfmt is not installed.

Added a simple auto-detection and switch to NO_GETTEXT when
msgfmt could not be found on the system

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 87fb30a..23e1e77 100644
--- a/Makefile
+++ b/Makefile
@@ -353,7 +353,11 @@ RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
 XGETTEXT = xgettext
-MSGFMT = msgfmt
+ifeq ($(shell msgfmt --help 2>/dev/null && echo y),y)
+	MSGFMT = msgfmt
+else
+	NO_GETTEXT=UnfortunatelyYes
+endif
 PTHREAD_LIBS = -lpthread
 PTHREAD_CFLAGS =
 GCOV = gcov
-- 
1.7.8.3.1.g75d1cf.dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] Auto detection in Makefile if msgfmt is not available
  2012-02-12 12:42 [PATCH/RFC] Auto detection in Makefile if msgfmt is not available Torsten Bögershausen
@ 2012-02-12 15:22 ` Ævar Arnfjörð Bjarmason
  2012-02-12 17:22   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-02-12 15:22 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: git

2012/2/12 Torsten Bögershausen <tboegi@web.de>:
> Added a simple auto-detection and switch to NO_GETTEXT when
> msgfmt could not be found on the system

Oh look, a start at our very own autoconf replacement :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] Auto detection in Makefile if msgfmt is not available
  2012-02-12 15:22 ` Ævar Arnfjörð Bjarmason
@ 2012-02-12 17:22   ` Junio C Hamano
  2012-02-12 19:09     ` Torsten Bögershausen
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-02-12 17:22 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Torsten Bögershausen, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> 2012/2/12 Torsten Bögershausen <tboegi@web.de>:
>> Added a simple auto-detection and switch to NO_GETTEXT when
>> msgfmt could not be found on the system
>
> Oh look, a start at our very own autoconf replacement :)

It is a bad idea for the Makefile to silently decide to flip NO_GETTEXT
when the system happens to be missing msgfmt without letting the user know
what is happening.  Current behaviour to error out will at least give an
opportunity to stop and think if installing gettext suite on the system
makes sense before proceeding.

Given that the Makefile only has this to say:

    # Define NO_GETTEXT if you don't want Git output to be translated.
    # A translated Git requires GNU libintl or another gettext implementation,
    # plus libintl-perl at runtime.

expecting that "msgfmt: no such command" clicks "Ah, I do not have gettext
suite" for anybody who attempts to build (and fail) Git, it however is
also a bit unfair and unhelpful.

Perhaps something like this is necessary and sufficient.

    # Define NO_GETTEXT if you don't want Git output to be translated or if
    # you do not have gettext suite (e.g. "msgfmt" and "gettext" commands).
    # A translated Git requires GNU libintl or another gettext implementation,
    # plus libintl-perl at runtime.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] Auto detection in Makefile if msgfmt is not available
  2012-02-12 17:22   ` Junio C Hamano
@ 2012-02-12 19:09     ` Torsten Bögershausen
  0 siblings, 0 replies; 4+ messages in thread
From: Torsten Bögershausen @ 2012-02-12 19:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Ævar Arnfjörð Bjarmason, git


Am 12.02.2012 um 18:22 schrieb Junio C Hamano:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> 
>> 2012/2/12 Torsten Bögershausen <tboegi@web.de>:
>>> Added a simple auto-detection and switch to NO_GETTEXT when
>>> msgfmt could not be found on the system
>> 
>> Oh look, a start at our very own autoconf replacement :)
> 
> It is a bad idea for the Makefile to silently decide to flip NO_GETTEXT
> when the system happens to be missing msgfmt without letting the user know
> what is happening.  Current behaviour to error out will at least give an
> opportunity to stop and think if installing gettext suite on the system
> makes sense before proceeding.
> 
> Given that the Makefile only has this to say:
> 
>    # Define NO_GETTEXT if you don't want Git output to be translated.
>    # A translated Git requires GNU libintl or another gettext implementation,
>    # plus libintl-perl at runtime.
> 
> expecting that "msgfmt: no such command" clicks "Ah, I do not have gettext
> suite" for anybody who attempts to build (and fail) Git, it however is
> also a bit unfair and unhelpful.
> 
> Perhaps something like this is necessary and sufficient.
> 
>    # Define NO_GETTEXT if you don't want Git output to be translated or if
>    # you do not have gettext suite (e.g. "msgfmt" and "gettext" commands).
>    # A translated Git requires GNU libintl or another gettext implementation,
>    # plus libintl-perl at runtime.

Thanks all!
a)  the problem was fixed by "sudo apt-get install gettext", which leads to
b) The comment was very helpful  ( As I didn't know which package to install) and the final question:
c) Should I send a new patch ?
/Torsten

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-12 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-12 12:42 [PATCH/RFC] Auto detection in Makefile if msgfmt is not available Torsten Bögershausen
2012-02-12 15:22 ` Ævar Arnfjörð Bjarmason
2012-02-12 17:22   ` Junio C Hamano
2012-02-12 19:09     ` Torsten Bögershausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).