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

Re: [PATCH] Build on Debian GNU/Hurd

From
Junio C Hamano <junkio@cox.net>
Date
Sep 16, 2006, 05:35 UTC
Message-ID
<7vr6yce5ky.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060915125846.10469.qmail@ccc765dd61a02d.315fe32.mid.smarden.org>
Gerrit Pape <pape@smarden.org> writes:
Show 11 quoted lines
> Patch from Cyril Brulebois to make the build process detect and support the
> Debian GNU/Hurd architecture, see
>  http://bugs.debian.org/379841
>
> Signed-off-by: Gerrit Pape <pape@smarden.org>
>
> +ifeq ($(uname_S),GNU)
> +       # GNU stands for GNU/Hurd
> +       NO_STRLCPY = YesPlease
> +       ALL_CFLAGS += -DPATH_MAX=4096
> +endif

Two questions come to mind. (1) Does GNU stand for GNU/Hurd and nobody else? (2) Does everybody else have PATH_MAX?

Adding NO_STRLCPY I do not have much problems with, but something like the attached may be cleaner to deal with PATH_MAX; of course now there is an issue of what the appropriate value for that symbol should be.

Would including git-compat-util.h in builtin.h break somebody?

-- >8 -- Define fallback PATH_MAX on systems that do not define one in <limits.h>

Notably GNU/Hurd, as reported by Gerrit Pape.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/git-compat-util.h b/git-compat-util.h
index 552b8ec..0272d04 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -26,6 +26,13 @@ #include <netinet/in.h>
 #include <sys/types.h>
 #include <dirent.h>
 
+/* On most systems <limits.h> would have given us this, but
+ * not on some systems (e.g. GNU/Hurd).
+ */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #ifdef __GNUC__
 #define NORETURN __attribute__((__noreturn__))
 #else
diff --git a/builtin.h b/builtin.h
index 34ed7b9..1d41f83 100644
--- a/builtin.h
+++ b/builtin.h
@@ -1,8 +1,7 @@
 #ifndef BUILTIN_H
 #define BUILTIN_H
 
-#include <stdio.h>
-#include <limits.h>
+#include "git-compat-util.h"
 
 extern const char git_version_string[];
 extern const char git_usage_string[];
Previous: Martin WaitzNext: Gerrit Pape
Message 3 of 7 in “Build on Debian GNU/Hurd”
  1. Build on Debian GNU/HurdGerrit Pape, Sep 15, 2006
  2. Martin WaitzSep 15, 2006
  3. Junio C HamanoSep 16, 2006
  4. Gerrit PapeSep 19, 2006
  5. Ramsay JonesSep 21, 2006
  6. Linus TorvaldsSep 21, 2006
  7. Ramsay JonesSep 22, 2006

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.