git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] Replace hard-coded path with one from <paths.h>

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 15, 2010, 12:27 UTC
Message-ID
<m3d3y0gath.fsf@localhost.localdomain>
In-Reply-To
<7vsk6zt93s.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 27 quoted lines
> Chris Webb <chris@arachsys.com> writes:
> 
> > In exec_cmd.c, git hard-codes a default path of
> > /usr/local/bin:/usr/bin:/bin.  Get an appropriate value for the system
> > from <paths.h> if possible instead. We only try to include <paths.h> on
> > Linux, FreeBSD, NetBSD, OpenBSD and GNU where it is known to exist.
> >
> > Signed-off-by: Chris Webb <chris@arachsys.com>
> > ---
> >  Makefile          |   10 ++++++++++
> >  exec_cmd.c        |    2 +-
> >  git-compat-util.h |    6 ++++++
> >  3 files changed, 17 insertions(+), 1 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 910f471..f4fe941 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -735,10 +735,12 @@ EXTLIBS =
> >  ifeq ($(uname_S),Linux)
> >  	NO_STRLCPY = YesPlease
> >  	NO_MKSTEMPS = YesPlease
> > +	HAVE_PATHS_H = YesPlease
> >  endif
> 
> Ok.  Somebody else may want to add an autoconf support on top of this, but
> this is good as-is, I think.
Something like that?
-- >8 --
Subject: [PATCH] autoconf: Check if <paths.h> exists
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 config.mak.in |    1 +
 configure.ac  |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index e8d96e8..f0aeb8e 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -31,6 +31,7 @@ NO_OPENSSL=@NO_OPENSSL@
 NO_CURL=@NO_CURL@
 NO_EXPAT=@NO_EXPAT@
 NO_LIBGEN_H=@NO_LIBGEN_H@
+HAVE_PATHS_H=@HAVE_PATHS_H@
 NEEDS_LIBICONV=@NEEDS_LIBICONV@
 NEEDS_SOCKET=@NEEDS_SOCKET@
 NO_SYS_SELECT_H=@NO_SYS_SELECT_H@
diff --git a/configure.ac b/configure.ac
index 108a97f..9dc0320 100644
--- a/configure.ac
+++ b/configure.ac
@@ -633,6 +633,12 @@ AC_CHECK_HEADER([libgen.h],
 [NO_LIBGEN_H=YesPlease])
 AC_SUBST(NO_LIBGEN_H)
 #
+# Define HAVE_PATHS_H if you have paths.h.
+AC_CHECK_HEADER([paths.h],
+[HAVE_PATHS_H=YesPlease],
+[HAVE_PATHS_H=])
+AC_SUBST(HAVE_PATHS_H)
+#
 # Define NO_STRCASESTR if you don't have strcasestr.
 GIT_CHECK_FUNC(strcasestr,
 [NO_STRCASESTR=],
-- 
1.7.0.1
Previous: Chris WebbNext: Junio C Hamano
Message 16 of 24 in “Replace hard-coded path with one configurable at make time”
  1. Replace hard-coded path with one configurable at make timeChris Webb, Apr 4, 2010
  2. Junio C HamanoApr 4, 2010
  3. Chris WebbApr 4, 2010
  4. Chris WebbApr 6, 2010
  5. Replace hard-coded path with one from <paths.h>Chris Webb, Apr 6, 2010
  6. Erik Faye-LundApr 7, 2010
  7. Chris WebbApr 8, 2010
  8. Erik Faye-LundApr 8, 2010
  9. Replace hard-coded path with one from <paths.h>Chris Webb, Apr 8, 2010
  10. Erik Faye-LundApr 8, 2010
  11. Chris WebbApr 9, 2010
  12. Chris WebbApr 13, 2010
  13. Replace hard-coded path with one from <paths.h>Chris Webb, Apr 13, 2010
  14. Junio C HamanoApr 13, 2010
  15. Chris WebbApr 14, 2010
  16. Jakub NarebskiApr 15, 2010
  17. Junio C HamanoApr 15, 2010
  18. Jakub NarebskiApr 15, 2010
  19. Chris WebbApr 15, 2010
  20. Jakub NarebskiApr 15, 2010
  21. Chris WebbApr 15, 2010
  22. Replace hard-coded path with one from <paths.h>Chris Webb, Apr 15, 2010
  23. TaitApr 9, 2010
  24. git-instaweb: pass through invoking user's path to gitweb CGI scriptChris Webb, Apr 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.