Skip to content

Commit 40036be

Browse files
Matt Kraaigitster
authored andcommitted
Port to QNX
Signed-off-by: Matt Kraai <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9dacffc commit 40036be

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ all::
8080
#
8181
# Define NO_MEMMEM if you don't have memmem.
8282
#
83+
# Define NO_GETPAGESIZE if you don't have getpagesize.
84+
#
8385
# Define NO_STRLCPY if you don't have strlcpy.
8486
#
8587
# Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the
@@ -1446,6 +1448,22 @@ else
14461448
NO_CURL = YesPlease
14471449
endif
14481450
endif
1451+
ifeq ($(uname_S),QNX)
1452+
COMPAT_CFLAGS += -DSA_RESTART=0
1453+
HAVE_STRINGS_H = YesPlease
1454+
NEEDS_SOCKET = YesPlease
1455+
NO_FNMATCH_CASEFOLD = YesPlease
1456+
NO_GETPAGESIZE = YesPlease
1457+
NO_ICONV = YesPlease
1458+
NO_MEMMEM = YesPlease
1459+
NO_MKDTEMP = YesPlease
1460+
NO_MKSTEMPS = YesPlease
1461+
NO_NSEC = YesPlease
1462+
NO_PTHREADS = YesPlease
1463+
NO_R_TO_GCC_LINKER = YesPlease
1464+
NO_STRCASESTR = YesPlease
1465+
NO_STRLCPY = YesPlease
1466+
endif
14491467

14501468
-include config.mak.autogen
14511469
-include config.mak
@@ -1863,6 +1881,9 @@ ifdef NO_MEMMEM
18631881
COMPAT_CFLAGS += -DNO_MEMMEM
18641882
COMPAT_OBJS += compat/memmem.o
18651883
endif
1884+
ifdef NO_GETPAGESIZE
1885+
COMPAT_CFLAGS += -DNO_GETPAGESIZE
1886+
endif
18661887
ifdef INTERNAL_QSORT
18671888
COMPAT_CFLAGS += -DINTERNAL_QSORT
18681889
COMPAT_OBJS += compat/qsort.o

git-compat-util.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
# endif
7676
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
7777
!defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
78-
!defined(__TANDEM)
78+
!defined(__TANDEM) && !defined(__QNX__)
7979
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
8080
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
8181
#endif
@@ -413,6 +413,10 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
413413
const void *needle, size_t needlelen);
414414
#endif
415415

416+
#ifdef NO_GETPAGESIZE
417+
#define getpagesize() sysconf(_SC_PAGESIZE)
418+
#endif
419+
416420
#ifdef FREAD_READS_DIRECTORIES
417421
#ifdef fopen
418422
#undef fopen

0 commit comments

Comments
 (0)