git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected.
@ 2013-02-25  8:39 Mike Gorchak
  2013-02-25 17:34 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Gorchak @ 2013-02-25  8:39 UTC (permalink / raw)
  To: git

Add pthread support in QNX. Do not declare NO_ macros if they can be
autodetected.

From: Mike Gorchak <mike.gorchak.qnx@gmail.com>
Signed-off-by: Mike Gorchak <mike.gorchak.qnx@gmail.com>
---
 config.mak.uname | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 8743a6d..d33aac6 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -527,14 +527,22 @@ ifeq ($(uname_S),QNX)
 	HAVE_STRINGS_H = YesPlease
 	NEEDS_SOCKET = YesPlease
 	NO_FNMATCH_CASEFOLD = YesPlease
-	NO_GETPAGESIZE = YesPlease
-	NO_ICONV = YesPlease
 	NO_MEMMEM = YesPlease
-	NO_MKDTEMP = YesPlease
-	NO_MKSTEMPS = YesPlease
 	NO_NSEC = YesPlease
-	NO_PTHREADS = YesPlease
 	NO_R_TO_GCC_LINKER = YesPlease
-	NO_STRCASESTR = YesPlease
-	NO_STRLCPY = YesPlease
+	# All QNX 6.x versions have pthread functions in libc
+	# and getpagesize. Leave mkstemps/mkdtemp/strcasestr/
+	# strlcpy for autodetection.
+	ifeq ($(shell expr "$(uname_R)" : '6\.[0-9]\.[0-9]'),5)
+		PTHREAD_LIBS = ""
+	else
+		NO_PTHREADS = YesPlease
+		NO_GETPAGESIZE = YesPlease
+		NO_STRCASESTR = YesPlease
+		NO_MKSTEMPS = YesPlease
+		NO_MKDTEMP = YesPlease
+		NO_STRLCPY = YesPlease
+		NO_ICONV = YesPlease
+		NO_GETTEXT = YesPlease
+	endif
 endif
-- 
1.8.2-rc0

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

* Re: [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected.
  2013-02-25  8:39 [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected Mike Gorchak
@ 2013-02-25 17:34 ` Junio C Hamano
  2013-02-25 18:19   ` Mike Gorchak
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2013-02-25 17:34 UTC (permalink / raw)
  To: Mike Gorchak; +Cc: git

Mike Gorchak <mike.gorchak.qnx@gmail.com> writes:

> Add pthread support in QNX. Do not declare NO_ macros if they can be
> autodetected.
>
> From: Mike Gorchak <mike.gorchak.qnx@gmail.com>
> Signed-off-by: Mike Gorchak <mike.gorchak.qnx@gmail.com>

One procedural nit.  Please drop that "From:" immediately before
S-o-b: from future submissions (I'll remove it locally for this
patch and others you already posted when I apply, so this alone is
not a reason to resend them).  If you are forwarding somebody else's
patch, you would want "From:" in body, but the correct place to do
so is before everything else, i.e.

	... your e-mail headers ...
        From: Mike Gorchak <your.email@address.xz>
        Subject: [PATCH] title of the patch

        ... your e-mail body ...
	From: A U Thor <real.author@address.xz>

	The first line of the commit log message and
        the second line of it.

	Signed-off-by: A U Thor <real.author@address.xz>
        Signed-off-by: Mike Gorchak <your.email@address.xz>

Also, please leave the "autodetection" out.  If it is common to have
strcasestr (or any other) on a newer QNX, then not defining the
symbol NO_STRCASESTR in this file may still be the right thing to
do, but the justification for such a change should not be because we
rely on "autodetection".  The defaults given in config.mak.uname is
primarily for people who do not use the optional ./configure script,
so pick the default to help the most common configuration for the
platform.

I'd rewrite the patch like the attached, and tentatively queue the
patch to 'pu', but I do not use or have access to QNX myself, so you
may have to adjust the default set of symbols and the log message
and in such a case, please do re-submit a fixed version.

Specifically, I do not know if "... and others are also supported"
is universally true with QNX 6; if not, we need to define NO_* for
them to help people who build without using the ./configure script.

Thanks.

-- >8 --
From: Mike Gorchak <mike.gorchak.qnx@gmail.com>
Date: Mon, 25 Feb 2013 10:39:27 +0200
Subject: [PATCH] QNX: newer QNX 6.x.x is not so crippled

The initial port to QNX declared that the platform does not have
support for pthreads, getpagesize, strcasestr, mkstemps, mkdtemp,
strlcpy, and iconv, but QNX 6.x.x does support these.

On the other hand, older QNX lack gettext support, so define
NO_GETTEXT for them.

Also newer QNX do not need to link to any special library to enable
pthreads; define PTHREAD_LIBS to an empty string.

Signed-off-by: Mike Gorchak <mike.gorchak.qnx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 config.mak.uname | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 8743a6d..ce2832b 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -527,14 +527,21 @@ ifeq ($(uname_S),QNX)
 	HAVE_STRINGS_H = YesPlease
 	NEEDS_SOCKET = YesPlease
 	NO_FNMATCH_CASEFOLD = YesPlease
-	NO_GETPAGESIZE = YesPlease
-	NO_ICONV = YesPlease
 	NO_MEMMEM = YesPlease
-	NO_MKDTEMP = YesPlease
-	NO_MKSTEMPS = YesPlease
 	NO_NSEC = YesPlease
-	NO_PTHREADS = YesPlease
 	NO_R_TO_GCC_LINKER = YesPlease
-	NO_STRCASESTR = YesPlease
-	NO_STRLCPY = YesPlease
+	# All QNX 6.x versions have pthread functions in libc;
+	# getpagesize and others are also supported.
+	ifeq ($(shell expr "$(uname_R)" : '6\.[0-9]\.[0-9]'),5)
+		PTHREAD_LIBS = ""
+	else
+		NO_PTHREADS = YesPlease
+		NO_GETPAGESIZE = YesPlease
+		NO_STRCASESTR = YesPlease
+		NO_MKSTEMPS = YesPlease
+		NO_MKDTEMP = YesPlease
+		NO_STRLCPY = YesPlease
+		NO_ICONV = YesPlease
+		NO_GETTEXT = YesPlease
+	endif
 endif
-- 
1.8.2.rc0.167.gd8ba4de

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

* Re: [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected.
  2013-02-25 17:34 ` Junio C Hamano
@ 2013-02-25 18:19   ` Mike Gorchak
  2013-02-26 18:01     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Gorchak @ 2013-02-25 18:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

> Also, please leave the "autodetection" out.  If it is common to have
> strcasestr (or any other) on a newer QNX, then not defining the
> symbol NO_STRCASESTR in this file may still be the right thing to
> do, but the justification for such a change should not be because we
> rely on "autodetection".  The defaults given in config.mak.uname is
> primarily for people who do not use the optional ./configure script,
> so pick the default to help the most common configuration for the
> platform.

I see. I thought configure is the only legal way to build the git and
config.mak.uname is used to override settings produced by configure.
But it works vice versa configure settings override config.mak.uname
settings. Please do not commit this patch. This patch brokes QNX 6.3.2
build.

> I'd rewrite the patch like the attached, and tentatively queue the
> patch to 'pu', but I do not use or have access to QNX myself, so you
> may have to adjust the default set of symbols and the log message
> and in such a case, please do re-submit a fixed version.

I will re-do the patch.

> Specifically, I do not know if "... and others are also supported"
> is universally true with QNX 6; if not, we need to define NO_* for
> them to help people who build without using the ./configure script.

Ok.

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

* Re: [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected.
  2013-02-25 18:19   ` Mike Gorchak
@ 2013-02-26 18:01     ` Junio C Hamano
  2013-02-26 18:38       ` Mike Gorchak
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2013-02-26 18:01 UTC (permalink / raw)
  To: Mike Gorchak; +Cc: git, Matt Kraai

Mike Gorchak <mike.gorchak.qnx@gmail.com> writes:

>> Also, please leave the "autodetection" out.  If it is common to have
>> strcasestr (or any other) on a newer QNX, then not defining the
>> symbol NO_STRCASESTR in this file may still be the right thing to
>> do, but the justification for such a change should not be because we
>> rely on "autodetection".  The defaults given in config.mak.uname is
>> primarily for people who do not use the optional ./configure script,
>> so pick the default to help the most common configuration for the
>> platform.
>
> I see. I thought configure is the only legal way to build the git and
> config.mak.uname is used to override settings produced by configure.
> But it works vice versa configure settings override config.mak.uname
> settings. Please do not commit this patch. This patch brokes QNX 6.3.2
> build.
>
>> I'd rewrite the patch like the attached, and tentatively queue the
>> patch to 'pu', but I do not use or have access to QNX myself, so you
>> may have to adjust the default set of symbols and the log message
>> and in such a case, please do re-submit a fixed version.
>
> I will re-do the patch.
>
>> Specifically, I do not know if "... and others are also supported"
>> is universally true with QNX 6; if not, we need to define NO_* for
>> them to help people who build without using the ./configure script.
>
> Ok.

I saw Matt has comment on this patch, so I'll keep the patch out of
'next' for now and let you two figure it out.

Thanks.

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

* Re: [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected.
  2013-02-26 18:01     ` Junio C Hamano
@ 2013-02-26 18:38       ` Mike Gorchak
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Gorchak @ 2013-02-26 18:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Matt Kraai

> I saw Matt has comment on this patch, so I'll keep the patch out of
> 'next' for now and let you two figure it out.

Anyway in current form this patch is broken. Junio, may I ask you
about the rest patches in a separate posts, have you applied any of
them?

Thanks.

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

end of thread, other threads:[~2013-02-26 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25  8:39 [PATCH 1/1] Add pthread support in QNX. Do not declare NO_ macros if they can be autodetected Mike Gorchak
2013-02-25 17:34 ` Junio C Hamano
2013-02-25 18:19   ` Mike Gorchak
2013-02-26 18:01     ` Junio C Hamano
2013-02-26 18:38       ` Mike Gorchak

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).