wip update. only undefine select/connect where strictly necessary. make sure the...
[AROS-Contrib.git] / development / scm / git / v2.12.2-aros.diff
blobb626cc795fb374f86c2ff21512d206d5bf065700
1 diff -ruN -X ./exclude.patterns git-2.12.2/compat/poll/poll.c git-2.12.2.aros/compat/poll/poll.c
2 --- git-2.12.2/compat/poll/poll.c 2017-03-24 19:59:15.000000000 +0000
3 +++ git-2.12.2.aros/compat/poll/poll.c 2017-04-30 01:16:52.401864090 +0100
4 @@ -48,6 +48,9 @@
5 # include <stdio.h>
6 # include <conio.h>
7 #else
8 +# if defined(__AROS__)
9 +# include <proto/socket.h>
10 +# endif
11 # include <sys/time.h>
12 # include <sys/socket.h>
13 # ifndef NO_SYS_SELECT_H
14 diff -ruN -X ./exclude.patterns git-2.12.2/config.mak.uname git-2.12.2.aros/config.mak.uname
15 --- git-2.12.2/config.mak.uname 2017-03-24 19:59:15.000000000 +0000
16 +++ git-2.12.2.aros/config.mak.uname 2017-04-30 01:05:47.127436790 +0100
17 @@ -1,11 +1,13 @@
18 # Platform specific Makefile tweaks based on uname detection
20 -uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
21 -uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
22 -uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
23 -uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
24 -uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
25 -uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
26 +UNAME ?= uname
28 +uname_S := $(shell sh -c '$(UNAME) -s 2>/dev/null || echo not')
29 +uname_M := $(shell sh -c '$(UNAME) -m 2>/dev/null || echo not')
30 +uname_O := $(shell sh -c '$(UNAME) -o 2>/dev/null || echo not')
31 +uname_R := $(shell sh -c '$(UNAME) -r 2>/dev/null || echo not')
32 +uname_P := $(shell sh -c '$(UNAME) -p 2>/dev/null || echo not')
33 +uname_V := $(shell sh -c '$(UNAME) -v 2>/dev/null || echo not')
35 ifdef MSVC
36 # avoid the MingW and Cygwin configuration sections
37 @@ -17,6 +19,21 @@
38 # because maintaining the nesting to match is a pain. If
39 # we had "elif" things would have been much nicer...
41 +ifeq ($(uname_S),AROS)
42 + BASIC_CFLAGS += -D__BSD_VISIBLE
43 + NO_CURL = YesPlease
44 + BLK_SHA1 = YesPlease
45 + NO_LIBGEN_H = YesPlease
46 + # Copied from Windows
47 + NO_REGEX = YesPlease
48 + NO_GETTEXT = YesPlease
49 + NO_PYTHON = YesPlease
50 + # Copied from NONSTOP_KERNEL
51 + NO_NSEC = YesPlease
52 + NO_PREAD = YesPlease
53 + NO_MMAP = YesPlease
54 + NO_POLL = YesPlease
55 +endif
56 ifeq ($(uname_S),OSF1)
57 # Need this for u_short definitions et al
58 BASIC_CFLAGS += -D_OSF_SOURCE
59 diff -ruN -X ./exclude.patterns git-2.12.2/configure.ac git-2.12.2.aros/configure.ac
60 --- git-2.12.2/configure.ac 2017-03-24 19:59:15.000000000 +0000
61 +++ git-2.12.2.aros/configure.ac 2017-04-30 01:05:47.127436790 +0100
62 @@ -707,17 +707,17 @@
63 test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen"
65 AC_CHECK_LIB([c], [gettext],
66 -[LIBC_CONTAINS_LIBINTL=YesPlease],
67 -[LIBC_CONTAINS_LIBINTL=])
68 -GIT_CONF_SUBST([LIBC_CONTAINS_LIBINTL])
69 +[NO_GETTEXT=],
70 +[NO_GETTEXT=YesPlease])
71 +GIT_CONF_SUBST([NO_GETTEXT])
74 # Define NO_GETTEXT if you don't want Git output to be translated.
75 # A translated Git requires GNU libintl or another gettext implementation
76 AC_CHECK_HEADER([libintl.h],
77 -[NO_GETTEXT=],
78 -[NO_GETTEXT=YesPlease])
79 -GIT_CONF_SUBST([NO_GETTEXT])
80 +[LIBC_CONTAINS_LIBINTL=YesPlease],
81 +[LIBC_CONTAINS_LIBINTL=])
82 +GIT_CONF_SUBST([LIBC_CONTAINS_LIBINTL])
84 if test -z "$NO_GETTEXT"; then
85 test -n "$LIBC_CONTAINS_LIBINTL" || LIBS="$LIBS -lintl"
86 diff -ruN -X ./exclude.patterns git-2.12.2/git-compat-util.h git-2.12.2.aros/git-compat-util.h
87 --- git-2.12.2/git-compat-util.h 2017-03-24 19:59:15.000000000 +0000
88 +++ git-2.12.2.aros/git-compat-util.h 2017-04-30 01:23:31.348318769 +0100
89 @@ -180,11 +180,13 @@
90 #include <regex.h>
91 #include <utime.h>
92 #include <syslog.h>
93 +#ifndef __AROS__
94 #ifndef NO_SYS_POLL_H
95 #include <sys/poll.h>
96 #else
97 #include <poll.h>
98 #endif
99 +#endif /* !__AROS__ */
100 #ifdef HAVE_BSD_SYSCTL
101 #include <sys/sysctl.h>
102 #endif
103 @@ -231,6 +233,21 @@
104 #define _ALL_SOURCE 1
105 #endif
107 +#ifdef __AROS__
108 +#include <proto/socket.h>
110 +#define fork vfork
111 +#define getpagesize() PAGE_SIZE
113 +#define POLLIN 0x1
114 +#define POLLOUT 0x4
115 +struct pollfd {
116 + int fd;
117 + int events;
119 +#define poll(pfd, a, b)
120 +#endif
122 /* used on Mac OS X */
123 #ifdef PRECOMPOSE_UNICODE
124 #include "compat/precompose_utf8.h"
125 diff -ruN -X ./exclude.patterns git-2.12.2/refs/iterator.c git-2.12.2.aros/refs/iterator.c
126 --- git-2.12.2/refs/iterator.c 2017-03-24 19:59:15.000000000 +0000
127 +++ git-2.12.2.aros/refs/iterator.c 2017-04-30 01:24:21.413877812 +0100
128 @@ -8,6 +8,12 @@
129 #include "refs/refs-internal.h"
130 #include "iterator.h"
132 +#ifdef __AROS__
133 +#ifdef select
134 +#undef select
135 +#endif
136 +#endif
138 int ref_iterator_advance(struct ref_iterator *ref_iterator)
140 return ref_iterator->vtable->advance(ref_iterator);
141 diff -ruN -X ./exclude.patterns git-2.12.2/run-command.c git-2.12.2.aros/run-command.c
142 --- git-2.12.2/run-command.c 2017-03-24 19:59:15.000000000 +0000
143 +++ git-2.12.2.aros/run-command.c 2017-04-30 01:05:47.127436790 +0100
144 @@ -913,6 +913,7 @@
145 return ret;
148 +#ifndef __AROS__
149 struct io_pump {
150 /* initialized by caller */
151 int fd;
152 @@ -1385,3 +1386,4 @@
153 pp_cleanup(&pp);
154 return 0;
156 +#endif
157 diff -ruN -X ./exclude.patterns git-2.12.2/transport.c git-2.12.2.aros/transport.c
158 --- git-2.12.2/transport.c 2017-03-24 19:59:15.000000000 +0000
159 +++ git-2.12.2.aros/transport.c 2017-04-30 01:23:53.252563356 +0100
160 @@ -17,6 +17,12 @@
161 #include "sha1-array.h"
162 #include "sigchain.h"
164 +#ifdef __AROS__
165 +#ifdef connect
166 +#undef connect
167 +#endif
168 +#endif
170 static void set_upstreams(struct transport *transport, struct ref *refs,
171 int pretend)