{"thread":{"id":"29607","subject":"[PATCH/RFC] Auto detection in Makefile if msgfmt is not available","startedAt":"2012-02-12T12:42:24Z","lastAt":"2012-02-12T19:09:09Z","messageCount":4,"participants":["Torsten Bögershausen","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"184508","messageId":"201202121342.25113.tboegi@web.de","threadId":"29607","inReplyTo":null,"subject":"[PATCH/RFC] Auto detection in Makefile if msgfmt is not available","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-02-12T12:42:24Z","receivedAt":"2012-02-12T12:42:24Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Since commit 5e9637c629702e3d41ad01d95956d1835d7338e0\n\"i18n: add infrastructure for translating Git with gettext\"\nthe Makefile demands the existance of msgfmt, unless NO_GETTEXT is defined.\n\nThis breaks the build on systems where msgfmt is not installed.\n\nAdded a simple auto-detection and switch to NO_GETTEXT when\nmsgfmt could not be found on the system\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n Makefile |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 87fb30a..23e1e77 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -353,7 +353,11 @@ RPMBUILD = rpmbuild\n TCL_PATH = tclsh\n TCLTK_PATH = wish\n XGETTEXT = xgettext\n-MSGFMT = msgfmt\n+ifeq ($(shell msgfmt --help 2>/dev/null && echo y),y)\n+\tMSGFMT = msgfmt\n+else\n+\tNO_GETTEXT=UnfortunatelyYes\n+endif\n PTHREAD_LIBS = -lpthread\n PTHREAD_CFLAGS =\n GCOV = gcov\n-- \n1.7.8.3.1.g75d1cf.dirty\n"},{"id":"184514","messageId":"CACBZZX4W0onNOstQqNethDBv1tZSijt8Q_HDrcuWr+Z8WYV90w@mail.gmail.com","threadId":"29607","inReplyTo":"201202121342.25113.tboegi@web.de","subject":"Re: [PATCH/RFC] Auto detection in Makefile if msgfmt is not available","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-02-12T15:22:06Z","receivedAt":"2012-02-12T15:22:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"2012/2/12 Torsten Bögershausen <tboegi@web.de>:\n> Added a simple auto-detection and switch to NO_GETTEXT when\n> msgfmt could not be found on the system\n\nOh look, a start at our very own autoconf replacement :)\n"},{"id":"184523","messageId":"7vr4y0j79w.fsf@alter.siamese.dyndns.org","threadId":"29607","inReplyTo":"CACBZZX4W0onNOstQqNethDBv1tZSijt8Q_HDrcuWr+Z8WYV90w@mail.gmail.com","subject":"Re: [PATCH/RFC] Auto detection in Makefile if msgfmt is not available","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-12T17:22:51Z","receivedAt":"2012-02-12T17:22:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> 2012/2/12 Torsten Bögershausen <tboegi@web.de>:\n>> Added a simple auto-detection and switch to NO_GETTEXT when\n>> msgfmt could not be found on the system\n>\n> Oh look, a start at our very own autoconf replacement :)\n\nIt is a bad idea for the Makefile to silently decide to flip NO_GETTEXT\nwhen the system happens to be missing msgfmt without letting the user know\nwhat is happening.  Current behaviour to error out will at least give an\nopportunity to stop and think if installing gettext suite on the system\nmakes sense before proceeding.\n\nGiven that the Makefile only has this to say:\n\n    # Define NO_GETTEXT if you don't want Git output to be translated.\n    # A translated Git requires GNU libintl or another gettext implementation,\n    # plus libintl-perl at runtime.\n\nexpecting that \"msgfmt: no such command\" clicks \"Ah, I do not have gettext\nsuite\" for anybody who attempts to build (and fail) Git, it however is\nalso a bit unfair and unhelpful.\n\nPerhaps something like this is necessary and sufficient.\n\n    # Define NO_GETTEXT if you don't want Git output to be translated or if\n    # you do not have gettext suite (e.g. \"msgfmt\" and \"gettext\" commands).\n    # A translated Git requires GNU libintl or another gettext implementation,\n    # plus libintl-perl at runtime.\n"},{"id":"184529","messageId":"DA8341B0-2A4F-40D8-A5CB-F8159E087C98@web.de","threadId":"29607","inReplyTo":"7vr4y0j79w.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] Auto detection in Makefile if msgfmt is not available","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-02-12T19:09:09Z","receivedAt":"2012-02-12T19:09:09Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\nAm 12.02.2012 um 18:22 schrieb Junio C Hamano:\n\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n> \n>> 2012/2/12 Torsten Bögershausen <tboegi@web.de>:\n>>> Added a simple auto-detection and switch to NO_GETTEXT when\n>>> msgfmt could not be found on the system\n>> \n>> Oh look, a start at our very own autoconf replacement :)\n> \n> It is a bad idea for the Makefile to silently decide to flip NO_GETTEXT\n> when the system happens to be missing msgfmt without letting the user know\n> what is happening.  Current behaviour to error out will at least give an\n> opportunity to stop and think if installing gettext suite on the system\n> makes sense before proceeding.\n> \n> Given that the Makefile only has this to say:\n> \n>    # Define NO_GETTEXT if you don't want Git output to be translated.\n>    # A translated Git requires GNU libintl or another gettext implementation,\n>    # plus libintl-perl at runtime.\n> \n> expecting that \"msgfmt: no such command\" clicks \"Ah, I do not have gettext\n> suite\" for anybody who attempts to build (and fail) Git, it however is\n> also a bit unfair and unhelpful.\n> \n> Perhaps something like this is necessary and sufficient.\n> \n>    # Define NO_GETTEXT if you don't want Git output to be translated or if\n>    # you do not have gettext suite (e.g. \"msgfmt\" and \"gettext\" commands).\n>    # A translated Git requires GNU libintl or another gettext implementation,\n>    # plus libintl-perl at runtime.\n\nThanks all!\na)  the problem was fixed by \"sudo apt-get install gettext\", which leads to\nb) The comment was very helpful  ( As I didn't know which package to install) and the final question:\nc) Should I send a new patch ?\n/Torsten\n"}]}