Index: trunk/tools/trickle/rdcp.c |
— | — | @@ -15,7 +15,10 @@ |
16 | 16 | #ifdef T_STDINT |
17 | 17 | # include <stdint.h> |
18 | 18 | #endif |
19 | | - |
| 19 | +#include "t_xti.h" |
| 20 | +#ifdef T_XTI |
| 21 | +# include <xti.h> |
| 22 | +#endif |
20 | 23 | #include "rdcp.h" |
21 | 24 | |
22 | 25 | #define F_CLOSED 1 |
— | — | @@ -40,7 +43,7 @@ |
41 | 44 | return write(fd, data, size); |
42 | 45 | } |
43 | 46 | |
44 | | -#ifdef RDCP_SVR4 |
| 47 | +#ifdef T_XTI |
45 | 48 | static int |
46 | 49 | rdcp_internal_send_xti(fd, data, size) |
47 | 50 | const void *data; |
— | — | @@ -58,7 +61,7 @@ |
59 | 62 | return read(fd, data, size); |
60 | 63 | } |
61 | 64 | |
62 | | -#ifdef RDCP_SVR4 |
| 65 | +#ifdef T_XTI |
63 | 66 | static int |
64 | 67 | rdcp_internal_recv_xti(fd, data, size) |
65 | 68 | void *data; |
— | — | @@ -109,7 +112,7 @@ |
110 | 113 | if ((handle = malloc(sizeof(struct rdcp_handle))) == NULL) |
111 | 114 | return NULL; |
112 | 115 | memset(handle, 0, sizeof(*handle)); |
113 | | -#ifdef RDCP_SVR4 |
| 116 | +#ifdef T_XTI |
114 | 117 | handle->sendf = rdcp_internal_send_xti; |
115 | 118 | handle->recvf = rdcp_internal_recv_xti; |
116 | 119 | #endif |
— | — | @@ -127,7 +130,7 @@ |
128 | 131 | if (type == ROPT_RDWR) { |
129 | 132 | handle->sendf = rdcp_internal_send_rdwr; |
130 | 133 | handle->recvf = rdcp_internal_recv_rdwr; |
131 | | -#ifdef RDCP_SVR4 |
| 134 | +#ifdef T_XTI |
132 | 135 | } else if (type == ROPT_XTI) { |
133 | 136 | handle->sendf = rdcp_internal_send_xti; |
134 | 137 | handle->recvf = rdcp_internal_recv_xti; |
Index: trunk/tools/trickle/Makefile |
— | — | @@ -1,22 +1,23 @@ |
2 | 2 | # @(#) $Header$ |
3 | 3 | |
| 4 | +CFGHDRS=t_stdint.h t_xti.h |
4 | 5 | trickle: trickle.o tar.o proto.o util.o rdcp.o ldflags |
5 | 6 | cc -O -g trickle.o tar.o proto.o util.o rdcp.o -o $@ `cat ldflags` |
6 | | -%.o: %.c Makefile $< t_stdint.h |
| 7 | +%.o: %.c Makefile $< $(CFGHDRS) |
7 | 8 | cc -O -g -D_FILE_OFFSET_BITS=64 -c $< |
8 | 9 | clean: |
9 | | - rm -f trickle trickle.o tar.o util.o rdcp.o proto.o ldflags t_stdint.h |
| 10 | + rm -f trickle trickle.o tar.o util.o rdcp.o proto.o ldflags $(CFGHDRS) |
10 | 11 | t_stdint.h: |
11 | | - rm -f t_stdint.h |
12 | | - touch t_stdint.h |
13 | 12 | echo "#include <stdint.h>" >test.c |
14 | | - -cc -c -o /dev/null test.c && echo "#define T_STDINT 1" >>t_stdint.h |
| 13 | + -(cc -c -o /dev/null test.c && echo "#define T_STDINT 1") >t_stdint.h |
15 | 14 | rm -f test.c |
| 15 | +t_xti.h: |
| 16 | + echo "#include <xti.h>" >test.c |
| 17 | + -(cc -c -o /dev/null test.c && echo "#define T_XTI 1") >t_xti.h |
| 18 | + rm -f test.c |
16 | 19 | ldflags: |
17 | | - rm -f ldflags |
18 | | - touch ldflags |
19 | | - echo "main(){}" > test.c |
20 | | - -cc test.c -lsocket -lnsl -o /dev/null && echo -lsocket -lnsl >>ldflags |
| 20 | + echo "int main() { return 0; }" > test.c |
| 21 | + -(cc test.c -lsocket -lnsl -o /dev/null && echo -lsocket -lnsl) >ldflags |
21 | 22 | rm -f test.c |
22 | 23 | dist: |
23 | 24 | mkdir trickle-cvs1 |
Index: trunk/tools/trickle/rdcp.h |
— | — | @@ -9,8 +9,7 @@ |
10 | 10 | |
11 | 11 | #include <sys/types.h> |
12 | 12 | |
13 | | -#if defined(__SVR4) || defined(__svr4__) |
14 | | -# define RDCP_SVR4 |
| 13 | +#ifdef T_XTI |
15 | 14 | # include <xti.h> |
16 | 15 | #endif |
17 | 16 | |
— | — | @@ -54,8 +53,8 @@ |
55 | 54 | * Options. |
56 | 55 | */ |
57 | 56 | #define ROPT_RDWR 1 |
58 | | -#ifdef RDCP_SVR4 |
59 | | -#define ROPT_XTI 2 |
| 57 | +#ifdef T_XTI |
| 58 | +# define ROPT_XTI 2 |
60 | 59 | #endif |
61 | 60 | |
62 | 61 | /* |