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

[PATCH] version 0001 Port to 12 other Platforms.

From
BGBoyd Lynn Gerber <gerberb@zenez.com>
Date
Jun 8, 2008, 21:36 UTC
Message-ID
<Pine.LNX.4.64.0806081535080.18454@xenau.zenez.com>
In-Reply-To
<7v8wxfiq01.fsf@gitster.siamese.dyndns.org>

This patch adds support to compile and run git on 12 additional platforms. The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base. The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X, OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.

This is from

The problem is that git source has blocked some typedefs by excluding certain <sys/types.h> content.

Looking at the the various platform header, I see around line 450
     && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)

which hides u_short and other typedefs that other header files on these platforms dependon. With _XOPEN_SOURCE defined, sources that include system header files that depend on the typedefs such as u_short cannot be compiled on these platforms.

They all lead back to about line 66 in git-compat-util.h
I had to make the following changes
ned(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 fo
r S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif

The _XOPEN_SOURCE hides many typedefs. __USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived compiler and/or some SysV based OS's.

__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases of the SCO OS's. It is used just like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined.

This is with suggestions and modifications from

Daniel Barkalow <barkalow@iabervon.org> Junio C Hamano <gitster@pobox.com> Thomas Harning <harningt@gmail.com> Jeremy Maitin-Shepard <jbms@cmu.edu>

Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

---
        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

--- git-compat-util.h

__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived compiler and/or some SysV based OS's.

__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases of the SCO OS's. It is used just like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined.

diff --git a/Makefile b/Makefile
index cce5a6e..026de2f 100644
--- a/Makefile
+++ b/Makefile
@@ -564,6 +564,45 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+		CFLAGS = -O2
+	endif
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS += -Kthread
+	endif
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..c04e8ba 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,7 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
-- 
1.5.2.4
Previous: Junio C HamanoNext: Boyd Lynn Gerber
Message 13 of 15 in “Port to 12 other Platforms.”
  1. Port to 12 other Platforms.Boyd Lynn Gerber, Jun 8, 2008
  2. Jakub NarebskiJun 8, 2008
  3. Boyd Lynn GerberJun 8, 2008
  4. Matthieu MoyJun 8, 2008
  5. Boyd Lynn GerberJun 8, 2008
  6. Jakub NarebskiJun 8, 2008
  7. Boyd Lynn GerberJun 8, 2008
  8. Boyd Lynn GerberJun 8, 2008
  9. Junio C HamanoJun 8, 2008
  10. Boyd Lynn GerberJun 8, 2008
  11. Boyd Lynn GerberJun 8, 2008
  12. Junio C HamanoJun 8, 2008
  13. version 0001 Port to 12 other Platforms.Boyd Lynn Gerber, Jun 8, 2008
  14. progress.c: avoid use of dynamic-sized arrayBoyd Lynn Gerber, Jun 8, 2008
  15. Boyd Lynn GerberJun 8, 2008

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.