]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - newlib-patches/newlib-1.16.0/newlib-1.16.0-rtems4.9-20090324.diff
ce08abf00a6a8e3d6861e4629c80e567c2891cce
[rtems-devel.git] / newlib-patches / newlib-1.16.0 / newlib-1.16.0-rtems4.9-20090324.diff
1 diff -Naur newlib-1.16.0.orig/newlib/ChangeLog.rtems newlib-1.16.0/newlib/ChangeLog.rtems
2 --- newlib-1.16.0.orig/newlib/ChangeLog.rtems   1970-01-01 01:00:00.000000000 +0100
3 +++ newlib-1.16.0/newlib/ChangeLog.rtems        2009-03-24 04:29:55.000000000 +0100
4 @@ -0,0 +1,5 @@
5 +2009-03-09     Ralf Corsépius <ralf.corsepius@rtems.org>
6 +
7 +       * libc/machine/powerpc/times.c: Remove.
8 +       * libc/machine/powerpc/Makefile.am: Remove times.c.
9 +       * libc/machine/powerpc/Makefile.in: Regenerate.
10 diff -Naur newlib-1.16.0.orig/newlib/configure.host newlib-1.16.0/newlib/configure.host
11 --- newlib-1.16.0.orig/newlib/configure.host    2007-11-07 22:42:24.000000000 +0100
12 +++ newlib-1.16.0/newlib/configure.host 2009-03-24 04:29:55.000000000 +0100
13 @@ -528,6 +528,7 @@
14  #  NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
15    *-*-rtems*)
16         default_newlib_io_long_long="yes"
17 +       default_newlib_io_c99_formats="yes"
18         newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL"
19         ;;
20  # VxWorks supplies its own version of malloc, and the newlib one
21 diff -Naur newlib-1.16.0.orig/newlib/libc/include/getopt.h newlib-1.16.0/newlib/libc/include/getopt.h
22 --- newlib-1.16.0.orig/newlib/libc/include/getopt.h     2006-01-04 22:21:52.000000000 +0100
23 +++ newlib-1.16.0/newlib/libc/include/getopt.h  2009-03-24 04:29:55.000000000 +0100
24 @@ -89,31 +89,40 @@
25  
26  /* include files needed by this include file */
27  
28 -/* macros defined by this include file */
29 -#define NO_ARG          0
30 -#define REQUIRED_ARG    1
31 -#define OPTIONAL_ARG    2
32 -
33 -/* types defined by this include file */
34 -
35 -struct option
36 -{
37 -  char *name;                   /* the name of the long option */
38 -  int has_arg;                  /* one of the above macros */
39 -  int *flag;                    /* determines if getopt_long() returns a
40 -                                 * value for a long option; if it is
41 -                                 * non-NULL, 0 is returned as a function
42 -                                 * value and the value of val is stored in
43 -                                 * the area pointed to by flag.  Otherwise,
44 -                                 * val is returned. */
45 -  int val;                      /* determines the value to return if flag is
46 -                                 * NULL. */
47 -};
48 +  /* These #defines are to keep the namespace clear... */
49 +#define getopt_r               __getopt_r
50 +#define getopt_long_r          __getopt_long_r
51 +#define getopt_long_only_r     __getopt_long_only_r
52  
53  #ifdef __cplusplus
54  extern "C"
55  {
56 -#endif
57 +
58 +#endif                         /* __cplusplus */
59 +
60 +/* types defined by this include file */
61 +  struct option
62 +  {
63 +    char *name;                        /* the name of the long option */
64 +    int has_arg;               /* one of the above macros */
65 +    int *flag;                 /* determines if getopt_long() returns a
66 +                                * value for a long option; if it is
67 +                                * non-NULL, 0 is returned as a function
68 +                                * value and the value of val is stored in
69 +                                * the area pointed to by flag.  Otherwise,
70 +                                * val is returned. */
71 +    int val;                   /* determines the value to return if flag is
72 +                                * NULL. */
73 +
74 +  };
75 +
76 +  /* The getopt_data structure is for reentrancy. Its members are similar to
77 +     the externally-defined variables.  */
78 +  typedef struct getopt_data
79 +  {
80 +    char *optarg;
81 +    int optind, opterr, optopt, optwhere;
82 +  } getopt_data;
83  
84    /* externally-defined variables */
85    extern char *optarg;
86 @@ -122,14 +131,35 @@
87    extern int optopt;
88  
89    /* function prototypes */
90 -  int _EXFUN (getopt, (int __argc, char *const __argv[], const char *__optstring));
91 -  int _EXFUN (getopt_long, (int __argc, char *const __argv[], const char *__shortopts, const struct option *__longopts, int *__longind));
92 -  int _EXFUN (getopt_long_only, (int __argc, char *const __argv[], const char *__shortopts, const struct option *__longopts, int *__longind));
93 +  int _EXFUN (getopt,
94 +             (int __argc, char *const __argv[], const char *__optstring));
95 +
96 +  int _EXFUN (getopt_long,
97 +             (int __argc, char *const __argv[], const char *__shortopts,
98 +              const struct option * __longopts, int *__longind));
99 +
100 +  int _EXFUN (getopt_long_only,
101 +             (int __argc, char *const __argv[], const char *__shortopts,
102 +              const struct option * __longopts, int *__longind));
103 +
104 +  int _EXFUN (__getopt_r,
105 +             (int __argc, char *const __argv[], const char *__optstring,
106 +              struct getopt_data * __data));
107 +
108 +  int _EXFUN (__getopt_long_r,
109 +             (int __argc, char *const __argv[], const char *__shortopts,
110 +              const struct option * __longopts, int *__longind,
111 +              struct getopt_data * __data));
112 +
113 +  int _EXFUN (__getopt_long_only_r,
114 +             (int __argc, char *const __argv[], const char *__shortopts,
115 +              const struct option * __longopts, int *__longind,
116 +              struct getopt_data * __data));
117  
118  #ifdef __cplusplus
119  };
120  
121 -#endif
122 +#endif /* __cplusplus  */
123  
124  #endif /* GETOPT_H */
125  
126 diff -Naur newlib-1.16.0.orig/newlib/libc/include/inttypes.h newlib-1.16.0/newlib/libc/include/inttypes.h
127 --- newlib-1.16.0.orig/newlib/libc/include/inttypes.h   2005-12-16 20:03:12.000000000 +0100
128 +++ newlib-1.16.0/newlib/libc/include/inttypes.h        2009-03-24 04:29:55.000000000 +0100
129 @@ -242,9 +242,12 @@
130  #define SCNxMAX                __SCNMAX(x)
131  
132  /* ptr types */
133 -#if __have_longlong64
134 -#define __PRIPTR(x) __STRINGIFY(ll##x)
135 -#define __SCNPTR(x) __STRINGIFY(ll##x)
136 +#if __ptrint_t_long_defined
137 +#define __PRIPTR(x) __STRINGIFY(l##x)
138 +#define __SCNPTR(x) __STRINGIFY(l##x)
139 +#elif __ptrint_t_int_defined
140 +#define __PRIPTR(x) __STRINGIFY(x)
141 +#define __SCNPTR(x) __STRINGIFY(x)
142  #elif __have_long64
143  #define __PRIPTR(x) __STRINGIFY(l##x)
144  #define __SCNPTR(x) __STRINGIFY(l##x)
145 diff -Naur newlib-1.16.0.orig/newlib/libc/include/machine/ieeefp.h newlib-1.16.0/newlib/libc/include/machine/ieeefp.h
146 --- newlib-1.16.0.orig/newlib/libc/include/machine/ieeefp.h     2007-11-07 22:42:24.000000000 +0100
147 +++ newlib-1.16.0/newlib/libc/include/machine/ieeefp.h  2009-03-24 04:29:55.000000000 +0100
148 @@ -62,8 +62,12 @@
149  #  define __IEEE_BIG_ENDIAN
150  # endif
151  #else
152 -# define __IEEE_BIG_ENDIAN
153  # ifdef __ARMEL__
154 +#  define __IEEE_LITTLE_ENDIAN
155 +# else
156 +#  define __IEEE_BIG_ENDIAN
157 +# endif
158 +# ifdef __ARMWEL__
159  #  define __IEEE_BYTES_LITTLE_ENDIAN
160  # endif
161  #endif
162 diff -Naur newlib-1.16.0.orig/newlib/libc/include/machine/setjmp.h newlib-1.16.0/newlib/libc/include/machine/setjmp.h
163 --- newlib-1.16.0.orig/newlib/libc/include/machine/setjmp.h     2007-11-07 22:42:24.000000000 +0100
164 +++ newlib-1.16.0/newlib/libc/include/machine/setjmp.h  2009-03-24 04:29:55.000000000 +0100
165 @@ -27,7 +27,7 @@
166  
167  /* necv70 was 9 as well. */
168  
169 -#ifdef __mc68000__
170 +#if defined(__m68k__) || defined(__mc68000__)
171  /*
172   * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
173   * fp2-fp7     for 68881.
174 @@ -268,6 +268,12 @@
175  # define _CYGWIN_WORKING_SIGSETJMP
176  #endif
177  
178 +#ifdef _POSIX_THREADS
179 +#define __SIGMASK_FUNC pthread_sigmask
180 +#else
181 +#define __SIGMASK_FUNC sigprocmask
182 +#endif
183 +
184  #if defined(__GNUC__)
185  
186  #define sigsetjmp(env, savemask) \
187 @@ -275,7 +281,7 @@
188              ({ \
189                sigjmp_buf *_sjbuf = &(env); \
190                ((*_sjbuf)[_SAVEMASK] = savemask,\
191 -              sigprocmask (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\
192 +              __SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\
193                setjmp (*_sjbuf)); \
194              })
195  
196 @@ -284,7 +290,7 @@
197              ({ \
198                sigjmp_buf *_sjbuf = &(env); \
199                ((((*_sjbuf)[_SAVEMASK]) ? \
200 -               sigprocmask (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\
201 +               __SIGMASK_FUNC (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\
202                 : 0), \
203                 longjmp (*_sjbuf, val)); \
204              })
205 @@ -292,15 +298,21 @@
206  #else /* !__GNUC__ */
207  
208  #define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
209 -               sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
210 +               __SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
211                 setjmp (env))
212  
213  #define siglongjmp(env, val) ((((env)[_SAVEMASK])?\
214 -               sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
215 +               __SIGMASK_FUNC (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
216                 longjmp (env, val))
217  
218  #endif
219  
220 +/* POSIX _setjmp/_longjmp macros, maintained for XSI compatibility.  These
221 +   are equivalent to sigsetjmp/siglongjmp when not saving the signal mask.
222 +   New applications should use sigsetjmp/siglongjmp instead. */
223 +#define _setjmp(env)           sigsetjmp ((env), 0)
224 +#define _longjmp(env, val)     siglongjmp ((env), (val))
225 +
226  #ifdef __cplusplus
227  }
228  #endif
229 diff -Naur newlib-1.16.0.orig/newlib/libc/include/pthread.h newlib-1.16.0/newlib/libc/include/pthread.h
230 --- newlib-1.16.0.orig/newlib/libc/include/pthread.h    2006-09-14 00:09:27.000000000 +0200
231 +++ newlib-1.16.0/newlib/libc/include/pthread.h 2009-03-24 04:29:55.000000000 +0100
232 @@ -283,14 +283,6 @@
233  int    _EXFUN(pthread_getcpuclockid,
234         (pthread_t __pthread_id, clockid_t *__clock_id));
235   
236 -/* CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59 */
237 -
238 -int    _EXFUN(pthread_attr_setcputime,
239 -       (pthread_attr_t *__attr, int __clock_allowed));
240 -
241 -int    _EXFUN(pthread_attr_getcputime,
242 -       (pthread_attr_t *__attr, int *__clock_allowed));
243 -
244  #endif /* defined(_POSIX_THREAD_CPUTIME) */
245  
246  
247 diff -Naur newlib-1.16.0.orig/newlib/libc/include/sched.h newlib-1.16.0/newlib/libc/include/sched.h
248 --- newlib-1.16.0.orig/newlib/libc/include/sched.h      2007-09-21 23:02:15.000000000 +0200
249 +++ newlib-1.16.0/newlib/libc/include/sched.h   1970-01-01 01:00:00.000000000 +0100
250 @@ -1,14 +0,0 @@
251 -#ifndef _SCHED_H_
252 -#define _SCHED_H_
253 -
254 -#ifdef __cplusplus
255 -extern "C" {
256 -#endif
257 -
258 -#include <sys/sched.h>
259 -
260 -#ifdef __cplusplus
261 -}
262 -#endif
263 -
264 -#endif /* _SCHED_H_ */
265 diff -Naur newlib-1.16.0.orig/newlib/libc/include/stdint.h newlib-1.16.0/newlib/libc/include/stdint.h
266 --- newlib-1.16.0.orig/newlib/libc/include/stdint.h     2006-08-16 23:39:43.000000000 +0200
267 +++ newlib-1.16.0/newlib/libc/include/stdint.h  2009-03-24 04:29:55.000000000 +0100
268 @@ -348,8 +348,7 @@
269  #endif
270  
271  /* This must match size_t in stddef.h, currently long unsigned int */
272 -#define SIZE_MIN (-__STDINT_EXP(LONG_MAX) - 1L)
273 -#define SIZE_MAX __STDINT_EXP(LONG_MAX)
274 +#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
275  
276  /* This must match sig_atomic_t in <signal.h> (currently int) */
277  #define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1)
278 @@ -393,6 +392,9 @@
279  #define UINTMAX_C(x)   x##UL
280  #endif
281  
282 +#ifdef __rtems__
283 +#include <machine/stdint.h>
284 +#endif
285  
286  #ifdef __cplusplus
287  }
288 diff -Naur newlib-1.16.0.orig/newlib/libc/include/sys/features.h newlib-1.16.0/newlib/libc/include/sys/features.h
289 --- newlib-1.16.0.orig/newlib/libc/include/sys/features.h       2007-12-19 19:51:19.000000000 +0100
290 +++ newlib-1.16.0/newlib/libc/include/sys/features.h    2009-03-24 04:29:55.000000000 +0100
291 @@ -38,11 +38,12 @@
292  #define _POSIX_MEMLOCK_RANGE           1
293  #define _POSIX_MEMORY_PROTECTION       1
294  #define _POSIX_MESSAGE_PASSING         1
295 +#define _POSIX_MONOTONIC_CLOCK         200112L
296  #define _POSIX_PRIORITIZED_IO          1
297  #define _POSIX_PRIORITY_SCHEDULING     1
298  #define _POSIX_REALTIME_SIGNALS                1
299  #define _POSIX_SEMAPHORES              1
300 -#define _POSIX_SHARED_MEMORY_OBJECTS   1
301 +/* #define _POSIX_SHARED_MEMORY_OBJECTS        1 */
302  #define _POSIX_SYNCHRONIZED_IO         1
303  #define _POSIX_TIMERS                  1
304  #define _POSIX_BARRIERS                 200112L
305 diff -Naur newlib-1.16.0.orig/newlib/libc/include/sys/_types.h newlib-1.16.0/newlib/libc/include/sys/_types.h
306 --- newlib-1.16.0.orig/newlib/libc/include/sys/_types.h 2007-09-18 22:05:17.000000000 +0200
307 +++ newlib-1.16.0/newlib/libc/include/sys/_types.h      2009-03-24 04:29:55.000000000 +0100
308 @@ -84,4 +84,7 @@
309  typedef void *_iconv_t;
310  #endif
311  
312 +typedef long * __intptr_t;
313 +typedef unsigned long* __uintptr_t;
314 +
315  #endif /* _SYS__TYPES_H */
316 diff -Naur newlib-1.16.0.orig/newlib/libc/include/sys/unistd.h newlib-1.16.0/newlib/libc/include/sys/unistd.h
317 --- newlib-1.16.0.orig/newlib/libc/include/sys/unistd.h 2007-11-08 17:20:12.000000000 +0100
318 +++ newlib-1.16.0/newlib/libc/include/sys/unistd.h      2009-03-24 04:29:55.000000000 +0100
319 @@ -157,7 +157,7 @@
320  pid_t   _EXFUN(tcgetpgrp, (int __fildes ));
321  int     _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
322  char    _EXFUN(*ttyname, (int __fildes ));
323 -#if defined(__CYGWIN__)
324 +#if defined(__CYGWIN__) || defined(__rtems__)
325  int     _EXFUN(ttyname_r, (int, char *, size_t)); 
326  #endif
327  int     _EXFUN(unlink, (const char *__path ));
328 @@ -219,13 +219,11 @@
329  char * _EXFUN(mktemp, (char *));
330  #endif
331  
332 -#if defined(__CYGWIN__) || defined(__SPU__)
333 +#if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__)
334  void    _EXFUN(sync, (void));
335 -#elif defined(__rtems__)
336 -int     _EXFUN(sync, (void));
337  #endif
338  
339 -int     _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
340 +ssize_t _EXFUN(readlink, (const char *__path, char *__buf, size_t __buflen));
341  int     _EXFUN(symlink, (const char *__name1, const char *__name2));
342  
343  #define        F_OK    0
344 diff -Naur newlib-1.16.0.orig/newlib/libc/include/_syslist.h newlib-1.16.0/newlib/libc/include/_syslist.h
345 --- newlib-1.16.0.orig/newlib/libc/include/_syslist.h   2005-08-22 23:13:35.000000000 +0200
346 +++ newlib-1.16.0/newlib/libc/include/_syslist.h        2009-03-24 04:29:55.000000000 +0100
347 @@ -11,6 +11,7 @@
348  #define _fstat fstat
349  #define _getpid getpid
350  #define _gettimeofday gettimeofday
351 +#define _isatty isatty
352  #define _kill kill
353  #define _link link
354  #define _lseek lseek
355 diff -Naur newlib-1.16.0.orig/newlib/libc/include/time.h newlib-1.16.0/newlib/libc/include/time.h
356 --- newlib-1.16.0.orig/newlib/libc/include/time.h       2005-11-18 16:57:24.000000000 +0100
357 +++ newlib-1.16.0/newlib/libc/include/time.h    2009-03-24 04:29:55.000000000 +0100
358 @@ -226,6 +226,16 @@
359  
360  #endif
361  
362 +#if defined(_POSIX_MONOTONIC_CLOCK)
363 +
364 +/*  The identifier for the system-wide monotonic clock, which is defined
365 +    as a clock whose value cannot be set via clock_settime() and which 
366 +    cannot have backward clock jumps. */
367 +
368 +#define CLOCK_MONOTONIC (clockid_t)4
369 +
370 +#endif
371 +
372  #if defined(_POSIX_CPUTIME)
373  
374  /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */
375 diff -Naur newlib-1.16.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.16.0/newlib/libc/machine/arm/machine/endian.h
376 --- newlib-1.16.0.orig/newlib/libc/machine/arm/machine/endian.h 2004-05-07 22:29:24.000000000 +0200
377 +++ newlib-1.16.0/newlib/libc/machine/arm/machine/endian.h      1970-01-01 01:00:00.000000000 +0100
378 @@ -1,12 +0,0 @@
379 -/* ARM configuration file */
380 -
381 -#ifndef _MACHINE_ENDIAN_H
382 -# define _MACHINE_ENDIAN_H
383 -
384 -#ifdef __ARMEB__
385 -#define BYTE_ORDER BIG_ENDIAN
386 -#else
387 -#define BYTE_ORDER LITTLE_ENDIAN
388 -#endif
389 -
390 -#endif
391 diff -Naur newlib-1.16.0.orig/newlib/libc/machine/powerpc/Makefile.am newlib-1.16.0/newlib/libc/machine/powerpc/Makefile.am
392 --- newlib-1.16.0.orig/newlib/libc/machine/powerpc/Makefile.am  2007-05-24 19:33:35.000000000 +0200
393 +++ newlib-1.16.0/newlib/libc/machine/powerpc/Makefile.am       2009-03-24 04:29:55.000000000 +0100
394 @@ -10,7 +10,7 @@
395  
396  AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
397  
398 -lib_a_SOURCES = setjmp.S times.c
399 +lib_a_SOURCES = setjmp.S
400  lib_a_CCASFLAGS=$(AM_CCASFLAGS)
401  lib_a_CFLAGS=$(AM_CFLAGS)
402  lib_a_LIBADD = @extra_objs@
403 diff -Naur newlib-1.16.0.orig/newlib/libc/machine/powerpc/Makefile.in newlib-1.16.0/newlib/libc/machine/powerpc/Makefile.in
404 --- newlib-1.16.0.orig/newlib/libc/machine/powerpc/Makefile.in  2007-12-19 23:36:34.000000000 +0100
405 +++ newlib-1.16.0/newlib/libc/machine/powerpc/Makefile.in       2009-03-24 04:29:55.000000000 +0100
406 @@ -39,8 +39,7 @@
407  DIST_COMMON = $(srcdir)/../../../../config.guess \
408         $(srcdir)/../../../../config.sub $(srcdir)/Makefile.in \
409         $(srcdir)/Makefile.am $(top_srcdir)/configure \
410 -       $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs \
411 -       $(srcdir)/../../../../compile
412 +       $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs
413  subdir = .
414  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
415  am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
416 @@ -54,7 +53,7 @@
417  LIBRARIES = $(noinst_LIBRARIES)
418  ARFLAGS = cru
419  lib_a_AR = $(AR) $(ARFLAGS)
420 -am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)
421 +am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
422  lib_a_OBJECTS = $(am_lib_a_OBJECTS)
423  DEFAULT_INCLUDES = -I. -I$(srcdir)
424  depcomp =
425 @@ -184,7 +183,7 @@
426  AM_CCASFLAGS = $(INCLUDES)
427  noinst_LIBRARIES = lib.a
428  AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
429 -lib_a_SOURCES = setjmp.S times.c
430 +lib_a_SOURCES = setjmp.S
431  lib_a_CCASFLAGS = $(AM_CCASFLAGS)
432  lib_a_CFLAGS = $(AM_CFLAGS)
433  lib_a_LIBADD = @extra_objs@
434 @@ -195,7 +194,7 @@
435  all: all-am
436  
437  .SUFFIXES:
438 -.SUFFIXES: .S .c .o .obj
439 +.SUFFIXES: .S .o .obj
440  am--refresh:
441         @:
442  $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
443 @@ -254,18 +253,6 @@
444  
445  lib_a-setjmp.obj: setjmp.S
446         $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
447 -
448 -.c.o:
449 -       $(COMPILE) -c $<
450 -
451 -.c.obj:
452 -       $(COMPILE) -c `$(CYGPATH_W) '$<'`
453 -
454 -lib_a-times.o: times.c
455 -       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c
456 -
457 -lib_a-times.obj: times.c
458 -       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`
459  uninstall-info-am:
460  
461  ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
462 diff -Naur newlib-1.16.0.orig/newlib/libc/machine/powerpc/times.c newlib-1.16.0/newlib/libc/machine/powerpc/times.c
463 --- newlib-1.16.0.orig/newlib/libc/machine/powerpc/times.c      2002-07-22 22:26:51.000000000 +0200
464 +++ newlib-1.16.0/newlib/libc/machine/powerpc/times.c   1970-01-01 01:00:00.000000000 +0100
465 @@ -1,36 +0,0 @@
466 -/* Time support routines for PowerPC.
467 - *
468 - * Written by Aldy Hernandez.
469 - */
470 -
471 -#include <_ansi.h>
472 -#include <reent.h>
473 -#include <sys/time.h>
474 -#include <sys/times.h>
475 -#include <sys/resource.h>
476 -
477 -clock_t
478 -times (struct tms *tp)
479 -{
480 -  struct rusage usage;
481 -  union {
482 -    struct rusage r;
483 -    /* Newlib's rusage has only 2 fields.  We need to make room for
484 -       when we call the system's rusage.  This should be enough.  */
485 -    int filler[32];
486 -  } host_ru;
487 -
488 -  getrusage (RUSAGE_SELF, (void *)&host_ru);
489 -
490 -  if (tp)
491 -    {
492 -      tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000
493 -       + host_ru.r.ru_utime.tv_usec;
494 -      tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000
495 -       + host_ru.r.ru_stime.tv_usec;
496 -      tp->tms_cutime = 0;      /* user time, children */
497 -      tp->tms_cstime = 0;      /* system time, children */
498 -    }
499 -
500 -  return tp->tms_utime;
501 -}
502 diff -Naur newlib-1.16.0.orig/newlib/libc/stdlib/getopt.c newlib-1.16.0/newlib/libc/stdlib/getopt.c
503 --- newlib-1.16.0.orig/newlib/libc/stdlib/getopt.c      2007-05-29 23:26:59.000000000 +0200
504 +++ newlib-1.16.0/newlib/libc/stdlib/getopt.c   2009-03-24 04:29:55.000000000 +0100
505 @@ -90,6 +90,9 @@
506  #include <getopt.h>
507  
508  /* macros */
509 +#define NO_ARG                 0
510 +#define REQUIRED_ARG           1
511 +#define OPTIONAL_ARG           2
512  
513  /* types */
514  typedef enum GETOPT_ORDERING_T
515 @@ -100,16 +103,19 @@
516  } GETOPT_ORDERING_T;
517  
518  /* globally-defined variables */
519 -char *optarg = NULL;
520 +char *optarg = 0;
521  int optind = 0;
522  int opterr = 1;
523  int optopt = '?';
524  
525 +/* static variables */
526 +static int optwhere = 0;
527 +
528  /* functions */
529  
530  /* reverse_argv_elements:  reverses num elements starting at argv */
531  static void
532 -reverse_argv_elements (char ** argv, int num)
533 +reverse_argv_elements (char **argv, int num)
534  {
535    int i;
536    char *tmp;
537 @@ -126,281 +132,346 @@
538  static void
539  permute (char *const argv[], int len1, int len2)
540  {
541 -  reverse_argv_elements ((char **)argv, len1);
542 -  reverse_argv_elements ((char **)argv, len1 + len2);
543 -  reverse_argv_elements ((char **)argv, len2);
544 +  reverse_argv_elements ((char **) argv, len1);
545 +  reverse_argv_elements ((char **) argv, len1 + len2);
546 +  reverse_argv_elements ((char **) argv, len2);
547  }
548  
549  /* is_option: is this argv-element an option or the end of the option list? */
550  static int
551  is_option (char *argv_element, int only)
552  {
553 -  return ((argv_element == NULL)
554 -          || (argv_element[0] == '-') || (only && argv_element[0] == '+'));
555 +  return ((argv_element == 0)
556 +         || (argv_element[0] == '-') || (only && argv_element[0] == '+'));
557 +}
558 +
559 +/* read_globals: read the values from the globals into a getopt_data 
560 +   structure */
561 +static void
562 +read_globals (struct getopt_data *data)
563 +{
564 +  data->optarg = optarg;
565 +  data->optind = optind;
566 +  data->opterr = opterr;
567 +  data->optopt = optopt;
568 +  data->optwhere = optwhere;
569 +}
570 +
571 +/* write_globals: write the values into the globals from a getopt_data
572 +   structure */
573 +static void
574 +write_globals (struct getopt_data *data)
575 +{
576 +  optarg = data->optarg;
577 +  optind = data->optind;
578 +  opterr = data->opterr;
579 +  optopt = data->optopt;
580 +  optwhere = data->optwhere;
581  }
582  
583  /* getopt_internal:  the function that does all the dirty work */
584  static int
585  getopt_internal (int argc, char *const argv[], const char *shortopts,
586 -                 const struct option *longopts, int *longind, int only)
587 +                const struct option *longopts, int *longind, int only,
588 +                struct getopt_data *data)
589  {
590    GETOPT_ORDERING_T ordering = PERMUTE;
591 -  static size_t optwhere = 0;
592    size_t permute_from = 0;
593    int num_nonopts = 0;
594    int optindex = 0;
595    size_t match_chars = 0;
596 -  char *possible_arg = NULL;
597 +  char *possible_arg = 0;
598    int longopt_match = -1;
599    int has_arg = -1;
600 -  char *cp = NULL;
601 +  char *cp = 0;
602    int arg_next = 0;
603  
604    /* first, deal with silly parameters and easy stuff */
605 -  if (argc == 0 || argv == NULL || (shortopts == NULL && longopts == NULL))
606 -    return EOF;
607 -  if (optind >= argc || argv[optind] == NULL)
608 +  if (argc == 0 || argv == 0 || (shortopts == 0 && longopts == 0)
609 +      || data->optind >= argc || argv[data->optind] == 0)
610      return EOF;
611 -  if (strcmp (argv[optind], "--") == 0)
612 +  if (strcmp (argv[data->optind], "--") == 0)
613      {
614 -      optind++;
615 +      data->optind++;
616        return EOF;
617      }
618 +
619    /* if this is our first time through */
620 -  if (optind == 0)
621 -    optind = optwhere = 1;
622 +  if (data->optind == 0)
623 +    data->optind = data->optwhere = 1;
624  
625    /* define ordering */
626 -  if (shortopts != NULL && (*shortopts == '-' || *shortopts == '+'))
627 +  if (shortopts != 0 && (*shortopts == '-' || *shortopts == '+'))
628      {
629        ordering = (*shortopts == '-') ? RETURN_IN_ORDER : REQUIRE_ORDER;
630        shortopts++;
631      }
632    else
633 -    ordering = (getenv ("POSIXLY_CORRECT") != NULL) ? REQUIRE_ORDER : PERMUTE;
634 +    ordering = (getenv ("POSIXLY_CORRECT") != 0) ? REQUIRE_ORDER : PERMUTE;
635  
636    /*
637     * based on ordering, find our next option, if we're at the beginning of
638     * one
639     */
640 -  if (optwhere == 1)
641 +  if (data->optwhere == 1)
642      {
643        switch (ordering)
644 -        {
645 -        case PERMUTE:
646 -          permute_from = optind;
647 -          num_nonopts = 0;
648 -          while (!is_option (argv[optind], only))
649 -            {
650 -              optind++;
651 -              num_nonopts++;
652 -            }
653 -          if (argv[optind] == NULL)
654 -            {
655 -              /* no more options */
656 -              optind = permute_from;
657 -              return EOF;
658 -            }
659 -          else if (strcmp (argv[optind], "--") == 0)
660 -            {
661 -              /* no more options, but have to get `--' out of the way */
662 -              permute (argv + permute_from, num_nonopts, 1);
663 -              optind = permute_from + 1;
664 -              return EOF;
665 -            }
666 -          break;
667 -        case RETURN_IN_ORDER:
668 -          if (!is_option (argv[optind], only))
669 -            {
670 -              optarg = argv[optind++];
671 -              return (optopt = 1);
672 -            }
673 -          break;
674 -        case REQUIRE_ORDER:
675 -          if (!is_option (argv[optind], only))
676 -            return EOF;
677 -          break;
678 -        }
679 +       {
680 +       default:                /* shouldn't happen */
681 +       case PERMUTE:
682 +         permute_from = data->optind;
683 +         num_nonopts = 0;
684 +         while (!is_option (argv[data->optind], only))
685 +           {
686 +             data->optind++;
687 +             num_nonopts++;
688 +           }
689 +         if (argv[data->optind] == 0)
690 +           {
691 +             /* no more options */
692 +             data->optind = permute_from;
693 +             return EOF;
694 +           }
695 +         else if (strcmp (argv[data->optind], "--") == 0)
696 +           {
697 +             /* no more options, but have to get `--' out of the way */
698 +             permute (argv + permute_from, num_nonopts, 1);
699 +             data->optind = permute_from + 1;
700 +             return EOF;
701 +           }
702 +         break;
703 +       case RETURN_IN_ORDER:
704 +         if (!is_option (argv[data->optind], only))
705 +           {
706 +             data->optarg = argv[data->optind++];
707 +             return (data->optopt = 1);
708 +           }
709 +         break;
710 +       case REQUIRE_ORDER:
711 +         if (!is_option (argv[data->optind], only))
712 +           return EOF;
713 +         break;
714 +       }
715      }
716    /* we've got an option, so parse it */
717  
718    /* first, is it a long option? */
719 -  if (longopts != NULL
720 -      && (memcmp (argv[optind], "--", 2) == 0
721 -          || (only && argv[optind][0] == '+')) && optwhere == 1)
722 +  if (longopts != 0
723 +      && (memcmp (argv[data->optind], "--", 2) == 0
724 +         || (only && argv[data->optind][0] == '+')) && data->optwhere == 1)
725      {
726        /* handle long options */
727 -      if (memcmp (argv[optind], "--", 2) == 0)
728 -        optwhere = 2;
729 +      if (memcmp (argv[data->optind], "--", 2) == 0)
730 +       data->optwhere = 2;
731        longopt_match = -1;
732 -      possible_arg = strchr (argv[optind] + optwhere, '=');
733 -      if (possible_arg == NULL)
734 -        {
735 -          /* no =, so next argv might be arg */
736 -          match_chars = strlen (argv[optind]);
737 -          possible_arg = argv[optind] + match_chars;
738 -          match_chars = match_chars - optwhere;
739 -        }
740 +      possible_arg = strchr (argv[data->optind] + data->optwhere, '=');
741 +      if (possible_arg == 0)
742 +       {
743 +         /* no =, so next argv might be arg */
744 +         match_chars = strlen (argv[data->optind]);
745 +         possible_arg = argv[data->optind] + match_chars;
746 +         match_chars = match_chars - data->optwhere;
747 +       }
748        else
749 -        match_chars = (possible_arg - argv[optind]) - optwhere;
750 -      for (optindex = 0; longopts[optindex].name != NULL; optindex++)
751 -        {
752 -          if (memcmp (argv[optind] + optwhere,
753 -                      longopts[optindex].name, match_chars) == 0)
754 -            {
755 -              /* do we have an exact match? */
756 -              if (match_chars == (int) (strlen (longopts[optindex].name)))
757 -                {
758 -                  longopt_match = optindex;
759 -                  break;
760 -                }
761 -              /* do any characters match? */
762 -              else
763 -                {
764 -                  if (longopt_match < 0)
765 -                    longopt_match = optindex;
766 -                  else
767 -                    {
768 -                      /* we have ambiguous options */
769 -                      if (opterr)
770 -                        fprintf (stderr, "%s: option `%s' is ambiguous "
771 -                                 "(could be `--%s' or `--%s')\n",
772 -                                 argv[0],
773 -                                 argv[optind],
774 -                                 longopts[longopt_match].name,
775 -                                 longopts[optindex].name);
776 -                      return (optopt = '?');
777 -                    }
778 -                }
779 -            }
780 -        }
781 +       match_chars = (possible_arg - argv[data->optind]) - data->optwhere;
782 +      for (optindex = 0; longopts[optindex].name != 0; ++optindex)
783 +       {
784 +         if (memcmp
785 +             (argv[data->optind] + data->optwhere, longopts[optindex].name,
786 +              match_chars) == 0)
787 +           {
788 +             /* do we have an exact match? */
789 +             if (match_chars == (int) (strlen (longopts[optindex].name)))
790 +               {
791 +                 longopt_match = optindex;
792 +                 break;
793 +               }
794 +             /* do any characters match? */
795 +             else
796 +               {
797 +                 if (longopt_match < 0)
798 +                   longopt_match = optindex;
799 +                 else
800 +                   {
801 +                     /* we have ambiguous options */
802 +                     if (data->opterr)
803 +                       fprintf (stderr, "%s: option `%s' is ambiguous "
804 +                                "(could be `--%s' or `--%s')\n",
805 +                                argv[0],
806 +                                argv[data->optind],
807 +                                longopts[longopt_match].name,
808 +                                longopts[optindex].name);
809 +                     return (data->optopt = '?');
810 +                   }
811 +               }
812 +           }
813 +       }
814        if (longopt_match >= 0)
815 -        has_arg = longopts[longopt_match].has_arg;
816 +       has_arg = longopts[longopt_match].has_arg;
817      }
818 +
819    /* if we didn't find a long option, is it a short option? */
820 -  if (longopt_match < 0 && shortopts != NULL)
821 +  if (longopt_match < 0 && shortopts != 0)
822      {
823 -      cp = strchr (shortopts, argv[optind][optwhere]);
824 -      if (cp == NULL)
825 -        {
826 -          /* couldn't find option in shortopts */
827 -          if (opterr)
828 -            fprintf (stderr,
829 -                     "%s: invalid option -- `-%c'\n",
830 -                     argv[0], argv[optind][optwhere]);
831 -          optwhere++;
832 -          if (argv[optind][optwhere] == '\0')
833 -            {
834 -              optind++;
835 -              optwhere = 1;
836 -            }
837 -          return (optopt = '?');
838 -        }
839 +      cp = strchr (shortopts, argv[data->optind][data->optwhere]);
840 +      if (cp == 0)
841 +       {
842 +         /* couldn't find option in shortopts */
843 +         if (data->opterr)
844 +           fprintf (stderr,
845 +                    "%s: invalid option -- `-%c'\n",
846 +                    argv[0], argv[data->optind][data->optwhere]);
847 +         data->optwhere++;
848 +         if (argv[data->optind][data->optwhere] == '\0')
849 +           {
850 +             data->optind++;
851 +             data->optwhere = 1;
852 +           }
853 +         return (data->optopt = '?');
854 +       }
855        has_arg = ((cp[1] == ':')
856 -                 ? ((cp[2] == ':') ? OPTIONAL_ARG : REQUIRED_ARG) : NO_ARG);
857 -      possible_arg = argv[optind] + optwhere + 1;
858 -      optopt = *cp;
859 +                ? ((cp[2] == ':') ? OPTIONAL_ARG : REQUIRED_ARG) : NO_ARG);
860 +      possible_arg = argv[data->optind] + data->optwhere + 1;
861 +      data->optopt = *cp;
862      }
863 -  /* get argument and reset optwhere */
864 +
865 +  /* get argument and reset data->optwhere */
866    arg_next = 0;
867    switch (has_arg)
868      {
869      case OPTIONAL_ARG:
870        if (*possible_arg == '=')
871 -        possible_arg++;
872 -      if (*possible_arg != '\0')
873 -        {
874 -          optarg = possible_arg;
875 -          optwhere = 1;
876 -        }
877 -      else
878 -        optarg = NULL;
879 +       possible_arg++;
880 +      data->optarg = (*possible_arg != '\0') ? possible_arg : 0;
881 +      data->optwhere = 1;
882        break;
883      case REQUIRED_ARG:
884        if (*possible_arg == '=')
885 -        possible_arg++;
886 +       possible_arg++;
887        if (*possible_arg != '\0')
888 -        {
889 -          optarg = possible_arg;
890 -          optwhere = 1;
891 -        }
892 -      else if (optind + 1 >= argc)
893 -        {
894 -          if (opterr)
895 -            {
896 -              fprintf (stderr, "%s: argument required for option `", argv[0]);
897 -              if (longopt_match >= 0)
898 -                fprintf (stderr, "--%s'\n", longopts[longopt_match].name);
899 -              else
900 -                fprintf (stderr, "-%c'\n", *cp);
901 -            }
902 -          optind++;
903 -          return (optopt = ':');
904 -        }
905 +       {
906 +         data->optarg = possible_arg;
907 +         data->optwhere = 1;
908 +       }
909 +      else if (data->optind + 1 >= argc)
910 +       {
911 +         if (data->opterr)
912 +           {
913 +             fprintf (stderr, "%s: argument required for option `", argv[0]);
914 +             if (longopt_match >= 0)
915 +               fprintf (stderr, "--%s'\n", longopts[longopt_match].name);
916 +             else
917 +               fprintf (stderr, "-%c'\n", *cp);
918 +           }
919 +         data->optind++;
920 +         return (data->optopt = ':');
921 +       }
922        else
923 -        {
924 -          optarg = argv[optind + 1];
925 -          arg_next = 1;
926 -          optwhere = 1;
927 -        }
928 +       {
929 +         data->optarg = argv[data->optind + 1];
930 +         arg_next = 1;
931 +         data->optwhere = 1;
932 +       }
933        break;
934 +    default:                   /* shouldn't happen */
935      case NO_ARG:
936        if (longopt_match < 0)
937 -        {
938 -          optwhere++;
939 -          if (argv[optind][optwhere] == '\0')
940 -            optwhere = 1;
941 -        }
942 +       {
943 +         data->optwhere++;
944 +         if (argv[data->optind][data->optwhere] == '\0')
945 +           data->optwhere = 1;
946 +       }
947        else
948 -        optwhere = 1;
949 -      optarg = NULL;
950 +       data->optwhere = 1;
951 +      data->optarg = 0;
952        break;
953      }
954  
955 -  /* do we have to permute or otherwise modify optind? */
956 -  if (ordering == PERMUTE && optwhere == 1 && num_nonopts != 0)
957 +  /* do we have to permute or otherwise modify data->optind? */
958 +  if (ordering == PERMUTE && data->optwhere == 1 && num_nonopts != 0)
959      {
960        permute (argv + permute_from, num_nonopts, 1 + arg_next);
961 -      optind = permute_from + 1 + arg_next;
962 +      data->optind = permute_from + 1 + arg_next;
963      }
964 -  else if (optwhere == 1)
965 -    optind = optind + 1 + arg_next;
966 +  else if (data->optwhere == 1)
967 +    data->optind = data->optind + 1 + arg_next;
968  
969    /* finally return */
970    if (longopt_match >= 0)
971      {
972 -      if (longind != NULL)
973 -        *longind = longopt_match;
974 -      if (longopts[longopt_match].flag != NULL)
975 -        {
976 -          *(longopts[longopt_match].flag) = longopts[longopt_match].val;
977 -          return 0;
978 -        }
979 +      if (longind != 0)
980 +       *longind = longopt_match;
981 +      if (longopts[longopt_match].flag != 0)
982 +       {
983 +         *(longopts[longopt_match].flag) = longopts[longopt_match].val;
984 +         return 0;
985 +       }
986        else
987 -        return longopts[longopt_match].val;
988 +       return longopts[longopt_match].val;
989      }
990    else
991 -    return optopt;
992 +    return data->optopt;
993  }
994  
995  int
996  getopt (int argc, char *const argv[], const char *optstring)
997  {
998 -  return getopt_internal (argc, argv, optstring, NULL, NULL, 0);
999 +  struct getopt_data data;
1000 +  int r;
1001 +
1002 +  read_globals (&data);
1003 +  r = getopt_internal (argc, argv, optstring, 0, 0, 0, &data);
1004 +  write_globals (&data);
1005 +  return r;
1006  }
1007  
1008  int
1009  getopt_long (int argc, char *const argv[], const char *shortopts,
1010 -             const struct option *longopts, int *longind)
1011 +            const struct option *longopts, int *longind)
1012  {
1013 -  return getopt_internal (argc, argv, shortopts, longopts, longind, 0);
1014 +  struct getopt_data data;
1015 +  int r;
1016 +
1017 +  read_globals (&data);
1018 +  r = getopt_internal (argc, argv, shortopts, longopts, longind, 0, &data);
1019 +  write_globals (&data);
1020 +  return r;
1021  }
1022  
1023  int
1024  getopt_long_only (int argc, char *const argv[], const char *shortopts,
1025 -                  const struct option *longopts, int *longind)
1026 +                 const struct option *longopts, int *longind)
1027 +{
1028 +  struct getopt_data data;
1029 +  int r;
1030 +
1031 +  read_globals (&data);
1032 +  r = getopt_internal (argc, argv, shortopts, longopts, longind, 1, &data);
1033 +  write_globals (&data);
1034 +  return r;
1035 +}
1036 +
1037 +int
1038 +__getopt_r (int argc, char *const argv[], const char *optstring,
1039 +           struct getopt_data *data)
1040 +{
1041 +  return getopt_internal (argc, argv, optstring, 0, 0, 0, data);
1042 +}
1043 +
1044 +int
1045 +__getopt_long_r (int argc, char *const argv[], const char *shortopts,
1046 +                const struct option *longopts, int *longind,
1047 +                struct getopt_data *data)
1048 +{
1049 +  return getopt_internal (argc, argv, shortopts, longopts, longind, 0, data);
1050 +}
1051 +
1052 +int
1053 +__getopt_long_only_r (int argc, char *const argv[], const char *shortopts,
1054 +                     const struct option *longopts, int *longind,
1055 +                     struct getopt_data *data)
1056  {
1057 -  return getopt_internal (argc, argv, shortopts, longopts, longind, 1);
1058 +  return getopt_internal (argc, argv, shortopts, longopts, longind, 1, data);
1059  }
1060  
1061  /* end of file GETOPT.C */
1062 diff -Naur newlib-1.16.0.orig/newlib/libc/sys/rtems/machine/stdint.h newlib-1.16.0/newlib/libc/sys/rtems/machine/stdint.h
1063 --- newlib-1.16.0.orig/newlib/libc/sys/rtems/machine/stdint.h   1970-01-01 01:00:00.000000000 +0100
1064 +++ newlib-1.16.0/newlib/libc/sys/rtems/machine/stdint.h        2009-03-24 04:29:55.000000000 +0100
1065 @@ -0,0 +1,35 @@
1066 +/*
1067 + *
1068 + */
1069 +#ifndef _MACHINE_STDINT_H
1070 +#define _MACHINE_STDINT_H
1071 +
1072 +#ifndef _STDINT_H
1073 +#error machine/stdint.h is an internal file and must not be directly included
1074 +#endif
1075 +
1076 +#ifndef __rtems__
1077 +#error machine/stdint.h is an RTEMS specific internal file and must not be used otherwise
1078 +#endif
1079 +
1080 +#if defined(__sparc__) \
1081 +  || defined(__powerpc__) || defined(__PPC__) \
1082 +  || defined(__mips__) \
1083 +  || defined(__sh__) \
1084 +  || defined(__AVR__) \
1085 +  || defined(_C4x) || defined(_C3x) \
1086 +  || defined(__H8300__)
1087 +/* PTRDIFF_TYPE = int */
1088 +#define __ptrint_t_int_defined 1
1089 +#endif
1090 +
1091 +#if defined(__i386__) \
1092 +  || defined(__m68k__) \
1093 +  || defined(__bfin__) \
1094 +  || defined(__arm__) \
1095 +  || defined(__H8300S__) || defined(__H8300H__)
1096 +/* PTRDIFF_TYPE = long */
1097 +#define __ptrint_t_long_defined 1
1098 +#endif
1099 +
1100 +#endif
1101 diff -Naur newlib-1.16.0.orig/newlib/libc/sys/rtems/sys/param.h newlib-1.16.0/newlib/libc/sys/rtems/sys/param.h
1102 --- newlib-1.16.0.orig/newlib/libc/sys/rtems/sys/param.h        2004-05-07 22:29:24.000000000 +0200
1103 +++ newlib-1.16.0/newlib/libc/sys/rtems/sys/param.h     2009-03-24 04:29:55.000000000 +0100
1104 @@ -93,7 +93,6 @@
1105  #include <sys/resource.h>
1106  #include <sys/ucred.h>
1107  #include <sys/uio.h>
1108 -#include <sys/rtprio.h>
1109  
1110  #ifndef FALSE
1111  #define        FALSE   0
1112 diff -Naur newlib-1.16.0.orig/newlib/Makefile.am newlib-1.16.0/newlib/Makefile.am
1113 --- newlib-1.16.0.orig/newlib/Makefile.am       2007-05-24 19:33:29.000000000 +0200
1114 +++ newlib-1.16.0/newlib/Makefile.am    2009-03-24 04:29:55.000000000 +0100
1115 @@ -81,7 +81,7 @@
1116         libc.a
1117  endif
1118  
1119 -noinst_DATA = stmp-targ-include
1120 +BUILT_SOURCES = stmp-targ-include
1121  
1122  toollib_DATA = $(CRT0) $(CRT1)
1123  
1124 @@ -186,9 +186,6 @@
1125  
1126  $(CRT1_DIR)$(CRT1): ; @true
1127  
1128 -
1129 -all-recursive: stmp-targ-include
1130 -
1131  # The targ-include directory just holds the includes files for the
1132  # particular system and machine we have been configured for.  It is
1133  # used while building.
1134 diff -Naur newlib-1.16.0.orig/newlib/Makefile.in newlib-1.16.0/newlib/Makefile.in
1135 --- newlib-1.16.0.orig/newlib/Makefile.in       2007-12-19 23:36:26.000000000 +0100
1136 +++ newlib-1.16.0/newlib/Makefile.in    2009-03-24 04:29:55.000000000 +0100
1137 @@ -105,7 +105,7 @@
1138         pdf-recursive ps-recursive uninstall-info-recursive \
1139         uninstall-recursive
1140  toollibDATA_INSTALL = $(INSTALL_DATA)
1141 -DATA = $(noinst_DATA) $(toollib_DATA)
1142 +DATA = $(toollib_DATA)
1143  ETAGS = etags
1144  CTAGS = ctags
1145  DEJATOOL = $(PACKAGE)
1146 @@ -339,7 +339,7 @@
1147  @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
1148  @USE_LIBTOOL_FALSE@    libc.a
1149  
1150 -noinst_DATA = stmp-targ-include
1151 +BUILT_SOURCES = stmp-targ-include
1152  toollib_DATA = $(CRT0) $(CRT1)
1153  
1154  # The functions ldexp, frexp and modf are traditionally supplied in
1155 @@ -398,7 +398,7 @@
1156  
1157  # dejagnu support
1158  RUNTESTFLAGS = 
1159 -all: newlib.h
1160 +all: $(BUILT_SOURCES) newlib.h
1161         $(MAKE) $(AM_MAKEFLAGS) all-recursive
1162  
1163  .SUFFIXES:
1164 @@ -703,14 +703,16 @@
1165         done
1166  check-am:
1167         $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
1168 -check: check-recursive
1169 +check: $(BUILT_SOURCES)
1170 +       $(MAKE) $(AM_MAKEFLAGS) check-recursive
1171  all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
1172  installdirs: installdirs-recursive
1173  installdirs-am:
1174         for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
1175           test -z "$$dir" || $(mkdir_p) "$$dir"; \
1176         done
1177 -install: install-recursive
1178 +install: $(BUILT_SOURCES)
1179 +       $(MAKE) $(AM_MAKEFLAGS) install-recursive
1180  install-exec: install-exec-recursive
1181  install-data: install-data-recursive
1182  uninstall: uninstall-recursive
1183 @@ -735,6 +737,7 @@
1184  maintainer-clean-generic:
1185         @echo "This command is intended for maintainers to use"
1186         @echo "it deletes files that may require special tools to rebuild."
1187 +       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
1188  clean: clean-recursive
1189  
1190  clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
1191 @@ -853,8 +856,6 @@
1192  
1193  $(CRT1_DIR)$(CRT1): ; @true
1194  
1195 -all-recursive: stmp-targ-include
1196 -
1197  # The targ-include directory just holds the includes files for the
1198  # particular system and machine we have been configured for.  It is
1199  # used while building.