* [PATCH] Makefile: add NO_CLOCK_GETTIME check
@ 2014-09-03 19:14 Reuben Hawkins
2014-09-03 19:45 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Reuben Hawkins @ 2014-09-03 19:14 UTC (permalink / raw)
To: git; +Cc: reubenhwk, karsten.blees
Some really old platforms, rhel3, which don't define CLOCK_MONOTONIC, still
need a way to build git. Some high resolution timer code was added Jul 12,
2014 to aid debugging performance issues. That code uses clock_gettime and
CLOCK_MONOTONIC. That change breaks building git on ancient platforms which
don't support CLOCK_MONOTONIC, so a way to disable that code is needed.
To use this feature...
$ make NO_CLOCK_GETTIME=1
This change amends the commit...
commit 148d6771bf5e00aa1d7fa2221507a3dfe4c1e37f
Author: Karsten Blees <karsten.blees@gmail.com>
Date: Sat Jul 12 02:05:42 2014 +0200
trace: add high resolution timer function to debug performance issues
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index 9f984a9..0c1c8cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1502,10 +1502,12 @@ ifdef GMTIME_UNRELIABLE_ERRORS
BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
endif
+ifndef NO_CLOCK_GETTIME
ifdef HAVE_CLOCK_GETTIME
BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
EXTLIBS += -lrt
endif
+endif
ifeq ($(TCLTK_PATH),)
NO_TCLTK = NoThanks
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile: add NO_CLOCK_GETTIME check
2014-09-03 19:14 [PATCH] Makefile: add NO_CLOCK_GETTIME check Reuben Hawkins
@ 2014-09-03 19:45 ` Junio C Hamano
2014-09-03 20:58 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2014-09-03 19:45 UTC (permalink / raw)
To: Reuben Hawkins; +Cc: git, karsten.blees
Reuben Hawkins <reubenhwk@gmail.com> writes:
> Some really old platforms, rhel3, which don't define CLOCK_MONOTONIC, still
> need a way to build git. Some high resolution timer code was added Jul 12,
> 2014 to aid debugging performance issues. That code uses clock_gettime and
> CLOCK_MONOTONIC. That change breaks building git on ancient platforms which
> don't support CLOCK_MONOTONIC, so a way to disable that code is needed.
>
> To use this feature...
>
> $ make NO_CLOCK_GETTIME=1
>
> This change amends the commit...
>
> commit 148d6771bf5e00aa1d7fa2221507a3dfe4c1e37f
> Author: Karsten Blees <karsten.blees@gmail.com>
> Date: Sat Jul 12 02:05:42 2014 +0200
>
> trace: add high resolution timer function to debug performance issues
> ---
> Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 9f984a9..0c1c8cf 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1502,10 +1502,12 @@ ifdef GMTIME_UNRELIABLE_ERRORS
> BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
> endif
>
> +ifndef NO_CLOCK_GETTIME
> ifdef HAVE_CLOCK_GETTIME
> BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
> EXTLIBS += -lrt
> endif
> +endif
I am not sure why you even need this change. Wouldn't you get
exactly the same result if you did not define HAVE_CLOCK_GETTIME
when building?
>
> ifeq ($(TCLTK_PATH),)
> NO_TCLTK = NoThanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile: add NO_CLOCK_GETTIME check
2014-09-03 19:45 ` Junio C Hamano
@ 2014-09-03 20:58 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2014-09-03 20:58 UTC (permalink / raw)
To: Reuben Hawkins; +Cc: git, karsten.blees
Junio C Hamano <gitster@pobox.com> writes:
>> +ifndef NO_CLOCK_GETTIME
>> ifdef HAVE_CLOCK_GETTIME
>> BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
>> EXTLIBS += -lrt
>> endif
>> +endif
>
> I am not sure why you even need this change. Wouldn't you get
> exactly the same result if you did not define HAVE_CLOCK_GETTIME
> when building?
That is, doing something like:
$ make HAVE_CLOCK_GETTIME= V=1
would show lines like:
cc -o credential-store.o -c -MF ./.depend/credential-store.o.d
-MQ credential-store.o -MMD -MP -O2 -Wall -Wvla
-Wdeclaration-after-statement -Wno-format-zero-length -g
-I. -DHAVE_ALLOCA_H -DHAVE_PATHS_H -DHAVE_DEV_TTY
-DXDL_FAST_HASH -DSHA1_HEADER='"block-sha1/sha1.h"'
-DNO_STRLCPY -DNO_MKSTEMPS -DSHELL_PATH='"/bin/sh"' credential-store.c
that does not have -DHAVE_CLOCK_GETTIME on the command line, no?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-03 20:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03 19:14 [PATCH] Makefile: add NO_CLOCK_GETTIME check Reuben Hawkins
2014-09-03 19:45 ` Junio C Hamano
2014-09-03 20:58 ` Junio C Hamano
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).