Skip to content

Commit 6c10990

Browse files
Jojo-Schmitzgitster
authored andcommitted
Port to HP NonStop
Includes the addition of some new defines and their description for others to use. Signed-off-by: Joachim Schmitz <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a677294 commit 6c10990

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

Makefile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ all::
145145
#
146146
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
147147
#
148+
# Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv.
149+
#
150+
# Define NO_INTPTR_T if you don't have intptr_t nor uintptr_t.
151+
#
152+
# Define NO_UINTMAX_T if you don't have uintmax_t.
153+
#
148154
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
149155
# Patrick Mauritz).
150156
#
@@ -1320,6 +1326,61 @@ ifeq ($(uname_S),Minix)
13201326
NO_CURL =
13211327
NO_EXPAT =
13221328
endif
1329+
ifeq ($(uname_S),NONSTOP_KERNEL)
1330+
# Needs some C99 features, "inline" is just one of them.
1331+
# INLINE='' would just replace one set of warnings with another and
1332+
# still not compile in c89 mode, due to non-const array initializations.
1333+
CC = cc -c99
1334+
# Disable all optimization, seems to result in bad code, with -O or -O2
1335+
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
1336+
# abends on "git push". Needs more investigation.
1337+
CFLAGS = -g -O0
1338+
# We'd want it to be here.
1339+
prefix = /usr/local
1340+
# Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
1341+
PERL_PATH = ${prefix}/bin/perl
1342+
PYTHON_PATH = ${prefix}/bin/python
1343+
1344+
# As detected by './configure'.
1345+
# Missdetected, hence commented out, see below.
1346+
#NO_CURL = YesPlease
1347+
# Added manually, see above.
1348+
NEEDS_SSL_WITH_CURL = YesPlease
1349+
HAVE_LIBCHARSET_H = YesPlease
1350+
NEEDS_LIBICONV = YesPlease
1351+
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
1352+
NO_SYS_SELECT_H = UnfortunatelyYes
1353+
NO_D_TYPE_IN_DIRENT = YesPlease
1354+
NO_HSTRERROR = YesPlease
1355+
NO_STRCASESTR = YesPlease
1356+
NO_FNMATCH_CASEFOLD = YesPlease
1357+
NO_MEMMEM = YesPlease
1358+
NO_STRLCPY = YesPlease
1359+
NO_SETENV = YesPlease
1360+
NO_UNSETENV = YesPlease
1361+
NO_MKDTEMP = YesPlease
1362+
NO_MKSTEMPS = YesPlease
1363+
# Currently libiconv-1.9.1.
1364+
OLD_ICONV = UnfortunatelyYes
1365+
NO_REGEX = YesPlease
1366+
NO_PTHREADS = UnfortunatelyYes
1367+
1368+
# Not detected (nor checked for) by './configure'.
1369+
# We don't have SA_RESTART on NonStop, unfortunalety.
1370+
COMPAT_CFLAGS += -DSA_RESTART=0
1371+
# Apparently needed in compat/fnmatch/fnmatch.c.
1372+
COMPAT_CFLAGS += -DHAVE_STRING_H=1
1373+
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
1374+
NO_NSEC = YesPlease
1375+
NO_PREAD = YesPlease
1376+
NO_MMAP = YesPlease
1377+
NO_POLL = YesPlease
1378+
NO_INTPTR_T = UnfortunatelyYes
1379+
# Bug report 10-120822-4477 submitted to HP NonStop development.
1380+
MKDIR_WO_TRAILING_SLASH = YesPlease
1381+
# RFE 10-120912-4693 submitted to HP NonStop development.
1382+
NO_SETITIMER = UnfortunatelyYes
1383+
endif
13231384
ifneq (,$(findstring MINGW,$(uname_S)))
13241385
pathsep = ;
13251386
NO_PREAD = YesPlease
@@ -1556,6 +1617,9 @@ ifdef NEEDS_LIBICONV
15561617
else
15571618
ICONV_LINK =
15581619
endif
1620+
ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
1621+
ICONV_LINK += -lintl
1622+
endif
15591623
EXTLIBS += $(ICONV_LINK) -liconv
15601624
endif
15611625
ifdef NEEDS_LIBGEN
@@ -1716,6 +1780,9 @@ endif
17161780
ifdef NO_IPV6
17171781
BASIC_CFLAGS += -DNO_IPV6
17181782
endif
1783+
ifdef NO_INTPTR_T
1784+
COMPAT_CFLAGS += -DNO_INTPTR_T
1785+
endif
17191786
ifdef NO_UINTMAX_T
17201787
BASIC_CFLAGS += -Duintmax_t=uint32_t
17211788
endif

git-compat-util.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
# define _XOPEN_SOURCE 500
7575
# endif
7676
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
77-
!defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__)
77+
!defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
78+
!defined(__TANDEM)
7879
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
7980
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
8081
#endif
@@ -98,6 +99,9 @@
9899
#include <stdlib.h>
99100
#include <stdarg.h>
100101
#include <string.h>
102+
#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */
103+
#include <strings.h> /* for strcasecmp() */
104+
#endif
101105
#include <errno.h>
102106
#include <limits.h>
103107
#include <sys/param.h>
@@ -141,6 +145,17 @@
141145
#else
142146
#include <stdint.h>
143147
#endif
148+
#ifdef NO_INTPTR_T
149+
/*
150+
* On I16LP32, ILP32 and LP64 "long" is the save bet, however
151+
* on LLP86, IL33LLP64 and P64 it needs to be "long long",
152+
* while on IP16 and IP16L32 it is "int" (resp. "short")
153+
* Size needs to match (or exceed) 'sizeof(void *)'.
154+
* We can't take "long long" here as not everybody has it.
155+
*/
156+
typedef long intptr_t;
157+
typedef unsigned long uintptr_t;
158+
#endif
144159
#if defined(__CYGWIN__)
145160
#undef _XOPEN_SOURCE
146161
#include <grp.h>

0 commit comments

Comments
 (0)