* [PATCH 0/1] Make libintl in libc detection more robust
@ 2012-02-18 19:38 John Szakmeister
2012-02-18 19:38 ` [PATCH 1/1] Don't append -lintl when there is no gettext support John Szakmeister
2012-02-20 8:34 ` [PATCH 0/1] Make libintl in libc detection more robust Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: John Szakmeister @ 2012-02-18 19:38 UTC (permalink / raw)
To: git; +Cc: John Szakmeister
When building the latest release, I noticed that pthreads support
was disabled. It turns out that the libintl in libc support is
adding "-lintl" to LIBS, even though I don't have that library on my
Mac. This patch fixes the issue by moving the check for libintl.h
closer to the checks for libintl in libc, and only adding "-lintl"
when NO_GETTEXT is empty.
This is my first time submitting a patch to git. I hope I've done
things correctly!
John Szakmeister (1):
Don't append -lintl when there is no gettext support
configure.ac | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
--
1.7.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] Don't append -lintl when there is no gettext support
2012-02-18 19:38 [PATCH 0/1] Make libintl in libc detection more robust John Szakmeister
@ 2012-02-18 19:38 ` John Szakmeister
2012-02-20 8:34 ` [PATCH 0/1] Make libintl in libc detection more robust Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: John Szakmeister @ 2012-02-18 19:38 UTC (permalink / raw)
To: git; +Cc: John Szakmeister
The check for libintl in a C library incorrectly assumes that if it's
not builtin then it must exist externally. Instead, let's check for
the existence of libintl.h first. If libintl.h exists, and libintl is
not in libc, then we append the library.
Signed-off-by: John Szakmeister <john@szakmeister.net>
---
configure.ac | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 630dbdd..8471f5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -640,7 +640,18 @@ AC_CHECK_LIB([c], [gettext],
[LIBC_CONTAINS_LIBINTL=YesPlease],
[LIBC_CONTAINS_LIBINTL=])
AC_SUBST(LIBC_CONTAINS_LIBINTL)
-test -n "$LIBC_CONTAINS_LIBINTL" || LIBS="$LIBS -lintl"
+
+#
+# Define NO_GETTEXT if you don't want Git output to be translated.
+# A translated Git requires GNU libintl or another gettext implementation
+AC_CHECK_HEADER([libintl.h],
+[NO_GETTEXT=],
+[NO_GETTEXT=YesPlease])
+AC_SUBST(NO_GETTEXT)
+
+if test -z "$NO_GETTEXT"; then
+ test -n "$LIBC_CONTAINS_LIBINTL" || LIBS="$LIBS -lintl"
+fi
## Checks for header files.
AC_MSG_NOTICE([CHECKS for header files])
@@ -824,13 +835,6 @@ AC_CHECK_HEADER([paths.h],
[HAVE_PATHS_H=])
AC_SUBST(HAVE_PATHS_H)
#
-# Define NO_GETTEXT if you don't want Git output to be translated.
-# A translated Git requires GNU libintl or another gettext implementation
-AC_CHECK_HEADER([libintl.h],
-[NO_GETTEXT=],
-[NO_GETTEXT=YesPlease])
-AC_SUBST(NO_GETTEXT)
-#
# Define HAVE_LIBCHARSET_H if have libcharset.h
AC_CHECK_HEADER([libcharset.h],
[HAVE_LIBCHARSET_H=YesPlease],
--
1.7.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/1] Make libintl in libc detection more robust
2012-02-18 19:38 [PATCH 0/1] Make libintl in libc detection more robust John Szakmeister
2012-02-18 19:38 ` [PATCH 1/1] Don't append -lintl when there is no gettext support John Szakmeister
@ 2012-02-20 8:34 ` Junio C Hamano
2012-02-20 13:40 ` John Szakmeister
1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-02-20 8:34 UTC (permalink / raw)
To: John Szakmeister; +Cc: git
John Szakmeister <john@szakmeister.net> writes:
> This is my first time submitting a patch to git. I hope I've done
> things correctly!
Looks good, except for the subject line that would have been better to say
something like:
configure: don't use -lintl when there is no gettext support
I'll tweak the log message and queue.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/1] Make libintl in libc detection more robust
2012-02-20 8:34 ` [PATCH 0/1] Make libintl in libc detection more robust Junio C Hamano
@ 2012-02-20 13:40 ` John Szakmeister
0 siblings, 0 replies; 4+ messages in thread
From: John Szakmeister @ 2012-02-20 13:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Mon, Feb 20, 2012 at 3:34 AM, Junio C Hamano <gitster@pobox.com> wrote:
> John Szakmeister <john@szakmeister.net> writes:
>
>> This is my first time submitting a patch to git. I hope I've done
>> things correctly!
>
> Looks good, except for the subject line that would have been better to say
> something like:
>
> configure: don't use -lintl when there is no gettext support
You're right, that's much better. I'll keep your feedback in mind for
next time.
> I'll tweak the log message and queue.
Thanks Junio!
-John
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-20 13:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-18 19:38 [PATCH 0/1] Make libintl in libc detection more robust John Szakmeister
2012-02-18 19:38 ` [PATCH 1/1] Don't append -lintl when there is no gettext support John Szakmeister
2012-02-20 8:34 ` [PATCH 0/1] Make libintl in libc detection more robust Junio C Hamano
2012-02-20 13:40 ` John Szakmeister
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).