1 diff -urN STLport-4.5.3/Makefile STLport-4.5.3-devel/Makefile
2 --- STLport-4.5.3/Makefile Wed Dec 31 17:00:00 1969
3 +++ STLport-4.5.3-devel/Makefile Tue Jan 7 15:28:08 2003
5 +# Makefile to compile stlport with uClibc
7 +# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
9 +# This program is free software; you can redistribute it and/or modify
10 +# it under the terms of the GNU General Public License as published by
11 +# the Free Software Foundation; either version 2 of the License, or
12 +# (at your option) any later version.
14 +# This program is distributed in the hope that it will be useful,
15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 +# General Public License for more details.
19 +# You should have received a copy of the GNU General Public License
20 +# along with this program; if not, write to the Free Software
21 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 +PREFIX:=/usr/$(ARCH)-linux-uclibc
25 +CROSS:= $(PREFIX)/../bin/$(ARCH)-linux-uclibc-
29 +STRIP = $(CROSS)strip --remove-section=.comment --remove-section=.note --strip-unneeded
30 +.EXPORT_ALL_VARIABLES:
34 + make -C src -f gcc-uClibc.mak all
35 + (cd lib; rm -f libstdc++_debug.so; \
36 + ln -fs libstdc++.so.4.5 libstdc++.so; \
37 + ln -fs libstdc++.so.4.5 libstdc++.so.0;)
38 + $(STRIP) lib/libstdc++.so.4.5;
41 + make -C src -f gcc-uClibc.mak clean
46 + cp -a libstdc++.a $(PREFIX)/lib; \
47 + cp -a libstdc++.so libstdc++.so.0 libstdc++.so.4.5 $(PREFIX)/lib;)
48 + cp -a stlport $(PREFIX)/include/c++
49 diff -urN STLport-4.5.3/src/dll_main.cpp STLport-4.5.3-devel/src/dll_main.cpp
50 --- STLport-4.5.3/src/dll_main.cpp Sat Feb 2 16:11:56 2002
51 +++ STLport-4.5.3-devel/src/dll_main.cpp Tue Jan 7 15:28:08 2003
56 -# if defined (_STLP_UNIX)
57 +# if defined (_STLP_UNIX) && defined (_STLP_PTHREADS) && ! defined (_STLP_USE_UCLIBC)
58 # define _STLP_HAS_PERTHREAD_ALLOCATOR
59 # include <stl/_pthread_alloc.h>
61 diff -urN STLport-4.5.3/src/gcc-uClibc.mak STLport-4.5.3-devel/src/gcc-uClibc.mak
62 --- STLport-4.5.3/src/gcc-uClibc.mak Wed Dec 31 17:00:00 1969
63 +++ STLport-4.5.3-devel/src/gcc-uClibc.mak Tue Jan 7 15:28:08 2003
66 +# Basename for libraries
68 +LIB_BASENAME:=libstdc++
69 +LIB_SHAREDNAME:=$(LIB_BASENAME).so
70 +LIB_SHAREDNAME_FULL:=$(LIB_SHAREDNAME).0
73 +# guts for common stuff
77 +#DYN_LINK:=$(CC) -fno-exceptions -lpthread -lm -shared -Wl,-soname=$(LIB_SHAREDNAME_FULL) -o
78 +DYN_LINK:=$(CC) -fno-exceptions -shared -Wl,-soname=$(LIB_SHAREDNAME_FULL) -o
87 +INSTALL_STEP = install_unix
89 +all: release_dynamic release_static
90 +#all: all_dynamic all_static symbolic_links
92 +include common_macros.mak
93 +STLDEBUG_NAME:=$(LIB_BASENAME).debug
95 +# Lets disable exception support, since this saves over 200k...
96 +DEFINE_FLAGS:= -fno-exceptions
97 +#DEFINE_FLAGS:= -D_STLP_NO_EXCEPTIONS -fno-exceptions -DSTL_NO_EXCEPTIONS
99 +#DEFINE_FLAGS+= -D_STLP_USE_UCLIBC -D_STLP_NO_WCHAR_T \
100 +# -DUSE_SPRINTF_INSTEAD -D_ISOC99_SOURCE
102 +WARNING_FLAGS:= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
103 +INCLUDE_FLAGS = -I${STLPORT_DIR}
104 +CXXFLAGS_COMMON = $(WARNING_FLAGS) $(DEFINE_FLAGS) $(INCLUDE_FLAGS)
106 +CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -Os
107 +CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -Os -fPIC
109 +CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
110 +CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
112 +CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
113 +CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
115 +include common_percent_rules.mak
116 +include common_rules.mak
120 +# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
123 +# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
126 diff -urN STLport-4.5.3/src/num_put_float.cpp STLport-4.5.3-devel/src/num_put_float.cpp
127 --- STLport-4.5.3/src/num_put_float.cpp Fri Jan 18 15:06:52 2002
128 +++ STLport-4.5.3-devel/src/num_put_float.cpp Tue Jan 7 15:28:08 2003
133 +# if defined(_STLP_USE_UCLIBC)
134 +# define __USE_ISOC99 1
141 #if defined (_MSC_VER) || defined (__MINGW32__) || defined (__BORLANDC__) || defined (__DJGPP) || defined (_STLP_SCO_OPENSERVER) || defined (__NCR_SVR)
144 #ifdef USE_SPRINTF_INSTEAD
146 -#elif defined (__hpux) || defined (__DJGPP) || ( defined(_STLP_USE_GLIBC) && ! defined (__MSL__) )
147 +#elif defined (__hpux) || defined (__DJGPP) || ( defined(_STLP_USE_GLIBC) && ! defined (__MSL__) ) || defined (_STLP_USE_UCLIBC)
148 # if defined (isfinite)
149 inline bool _Stl_is_nan_or_inf(double x) { return !isfinite(x); }
153 inline bool _Stl_is_neg_inf(double x) { return _fpclass(x) == _FPCLASS_NINF; }
154 inline bool _Stl_is_neg_nan(double x) { return _isnan(x) && _copysign(1., x) < 0 ; }
155 -#elif defined(__MRC__) || defined(__SC__) //*TY 02/24/2000 - added support for MPW
156 +#elif defined(__MRC__) || defined(__SC__)
157 bool _Stl_is_nan_or_inf(double x) { return isnan(x) || !isfinite(x); }
158 bool _Stl_is_inf(double x) { return !isfinite(x); }
159 bool _Stl_is_neg_inf(double x) { return !isfinite(x) && signbit(x); }
161 inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
162 { return fcvtbuf(x, n, pt, sign, buf); }
164 -#elif defined (_STLP_USE_GLIBC)
165 +#elif defined (_STLP_USE_GLIBC) || defined(_STLP_USE_UCLIBC)
166 inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
167 { return buf + ecvt_r(x, n, pt, sign, buf, NDIG+2); }
168 inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
169 diff -urN STLport-4.5.3/src/stdio_streambuf.cpp STLport-4.5.3-devel/src/stdio_streambuf.cpp
170 --- STLport-4.5.3/src/stdio_streambuf.cpp Thu Jan 10 11:41:52 2002
171 +++ STLport-4.5.3-devel/src/stdio_streambuf.cpp Tue Jan 7 15:28:08 2003
173 _STLP_VENDOR_CSTD::fgetpos(_M_file, &pos);
174 // added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
175 // of a primitive type
176 -#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
177 +#if defined(_STLP_USE_UCLIBC) || (defined(__GLIBC__) && defined(_STLP_USE_GLIBC) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
178 return pos_type((streamoff)pos.__pos);
179 #elif defined(__ISCPP__) || defined(__MVS__) || (__OS400__)
180 return pos_type(pos.__fpos_elem[ 0 ]);
181 @@ -101,13 +101,16 @@
183 // added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
184 // of a primitive type
185 -#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
186 +#if (defined(__GLIBC__) && defined(_STLP_USE_GLIBC) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
189 memset( &(p.__state), 0, sizeof(p.__state) );
190 #elif defined(__MVS__) || (__OS400__)
192 p.__fpos_elem[0] = pos;
193 +#elif defined(_STLP_USE_UCLIBC)
199 diff -urN STLport-4.5.3/stlport/config/_prolog.h STLport-4.5.3-devel/stlport/config/_prolog.h
200 --- STLport-4.5.3/stlport/config/_prolog.h Sun Oct 28 13:26:44 2001
201 +++ STLport-4.5.3-devel/stlport/config/_prolog.h Tue Jan 7 15:28:08 2003
203 +/* Evil hack to make sure everything behaves itself */
204 +#define _STLP_USE_UCLIBC
205 +//#define _STLP_NO_WCHAR_T
206 +//#define _ISOC99_SOURCE
207 +//#define USE_SPRINTF_INSTEAD
209 #if defined (_STLP_MSVC) || defined (__ICL) || defined (__BORLANDC__)
211 diff -urN STLport-4.5.3/stlport/config/stl_gcc.h STLport-4.5.3-devel/stlport/config/stl_gcc.h
212 --- STLport-4.5.3/stlport/config/stl_gcc.h Thu Jan 10 11:41:58 2002
213 +++ STLport-4.5.3-devel/stlport/config/stl_gcc.h Tue Jan 7 15:28:08 2003
217 /* Systems having GLIBC installed have different traits */
218 -#if ! defined (_STLP_USE_GLIBC) && ( defined (__linux__) || defined (__CYGWIN__) )
219 +#if ! defined (_STLP_USE_GLIBC) && ! defined (_STLP_USE_UCLIBC) && ( defined (__linux__) || defined (__CYGWIN__) )
220 # define _STLP_USE_GLIBC
223 diff -urN STLport-4.5.3/stlport/cstdlib STLport-4.5.3-devel/stlport/cstdlib
224 --- STLport-4.5.3/stlport/cstdlib Thu Aug 23 15:51:54 2001
225 +++ STLport-4.5.3-devel/stlport/cstdlib Tue Jan 7 15:28:08 2003
227 using _STLP_VENDOR_CSTD::atof;
228 using _STLP_VENDOR_CSTD::atoi;
229 using _STLP_VENDOR_CSTD::atol;
230 +# ifndef _STLP_USE_UCLIBC
231 using _STLP_VENDOR_CSTD::mblen;
232 using _STLP_VENDOR_CSTD::mbstowcs;
233 using _STLP_VENDOR_CSTD::mbtowc;
235 using _STLP_VENDOR_CSTD::strtod;
236 using _STLP_VENDOR_CSTD::strtol;
237 using _STLP_VENDOR_CSTD::strtoul;
238 diff -urN STLport-4.5.3/stlport/stl/_config.h STLport-4.5.3-devel/stlport/stl/_config.h
239 --- STLport-4.5.3/stlport/stl/_config.h Fri Jan 18 15:08:36 2002
240 +++ STLport-4.5.3-devel/stlport/stl/_config.h Tue Jan 7 15:28:08 2003
242 #ifndef _STLP_CONFIG_H
243 # define _STLP_CONFIG_H
245 +/* Make the STLport headers provide uClibc support by default */
246 +#define _STLP_NO_EXCEPTIONS 1
247 +#define STL_NO_EXCEPTIONS 1
248 +#define _STLP_USE_UCLIBC 1
249 +//#define _STLP_NO_WCHAR_T 1
250 +#define _STLP_NO_LONG_DOUBLE 1
251 +#define USE_SPRINTF_INSTEAD 1
252 +#define _ISOC99_SOURCE 1
253 +#define _STLP_NO_ANACHRONISMS 1
256 * Purpose of this file :
259 /* Operating system recognition (basic) */
260 # if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX) || defined (__NetBSD__) || defined (__Lynx__)
261 # define _STLP_UNIX 1
262 -# if defined (__linux__) && ! defined (_STLP_USE_GLIBC)
263 +# if defined (__linux__) && ! defined (_STLP_USE_GLIBC) && ! defined (_STLP_USE_UCLIBC)
264 # define _STLP_USE_GLIBC 1
266 # elif defined(macintosh) || defined (_MAC)
267 diff -urN STLport-4.5.3/stlport/stl/_stdio_file.h STLport-4.5.3-devel/stlport/stl/_stdio_file.h
268 --- STLport-4.5.3/stlport/stl/_stdio_file.h Fri Jan 18 15:07:00 2002
269 +++ STLport-4.5.3-devel/stlport/stl/_stdio_file.h Tue Jan 7 15:28:08 2003
270 @@ -634,6 +634,112 @@
272 # define _STLP_FILE_I_O_IDENTICAL
274 +#elif defined(_STLP_USE_UCLIBC)
276 +#if defined(__MASK_READING)
278 +inline int _FILE_fd(const FILE *__f) { return __f->__filedes; }
280 +// Returns a pointer to the beginning of the buffer.
281 +inline char* _FILE_I_begin(const FILE *__f) { return (char*) __f->__bufstart; }
283 +// Returns the current read/write position within the buffer.
284 +inline char* _FILE_I_next(const FILE *__f) { return (char*) __f->__bufpos; }
286 +// Returns a pointer immediately past the end of the buffer.
287 +inline char* _FILE_I_end(const FILE *__f) { return (char*)__f->__bufend; }
289 +// Returns the number of characters remaining in the buffer, i.e.
290 +// _FILE_[IO]_end(__f) - _FILE_[IO]_next(__f).
291 +inline ptrdiff_t _FILE_I_avail(const FILE *__f)
292 + { return __f->__bufgetc_u - __f->__bufpos; }
294 +// Increments the current read/write position by 1, returning the
295 +// character at the old position.
296 +inline char& _FILE_I_preincr(FILE *__f) { return *(char*)(++__f->__bufpos); }
298 +// Increments the current read/write position by 1, returning the
299 +// character at the old position.
300 +inline char& _FILE_I_postincr(FILE *__f) { return *(char*)(__f->__bufpos++); }
302 +// Decrements the current read/write position by 1, returning the
303 +// character at the old position.
304 +inline char& _FILE_I_predecr(FILE *__f) { return *(char*)(--__f->__bufpos); }
306 +// Decrements the current read/write position by 1, returning the
307 +// character at the old position.
308 +inline char& _FILE_I_postdecr(FILE *__f) { return *(char*)(__f->__bufpos--); }
310 +// Increments the current read/write position by __n.
311 +inline void _FILE_I_bump(FILE *__f, int __n) { __f->__bufpos += __n; }
313 +// Sets the beginning of the bufer to __begin, the current read/write
314 +// position to __next, and the buffer's past-the-end pointer to __end.
315 +// If any of those pointers is null, then all of them must be null.
316 +inline void _FILE_I_set(FILE *__f, char* __begin, char* __next, char* __end)
318 + __f->__bufstart = (unsigned char*)__begin;
319 + __f->__bufpos = (unsigned char*)__next;
320 + __f->__bufend = (unsigned char*)__end;
321 + __f->__bufgetc_u = (unsigned char*)__begin;
322 + __f->__bufputc_u = (unsigned char*)__end;
325 +# define _STLP_FILE_I_O_IDENTICAL
327 +#else // Support old stdio for a little while.
329 +inline int _FILE_fd(const FILE *__f) { return __f->filedes; }
331 +// Returns a pointer to the beginning of the buffer.
332 +inline char* _FILE_I_begin(const FILE *__f) { return (char*) __f->bufstart; }
334 +// Returns the current read/write position within the buffer.
335 +inline char* _FILE_I_next(const FILE *__f) { return (char*) __f->bufpos; }
337 +// Returns a pointer immediately past the end of the buffer.
338 +inline char* _FILE_I_end(const FILE *__f) { return (char*)__f->bufend; }
340 +// Returns the number of characters remaining in the buffer, i.e.
341 +// _FILE_[IO]_end(__f) - _FILE_[IO]_next(__f).
342 +inline ptrdiff_t _FILE_I_avail(const FILE *__f)
343 + { return __f->bufgetc - __f->bufpos; }
345 +// Increments the current read/write position by 1, returning the
346 +// character at the old position.
347 +inline char& _FILE_I_preincr(FILE *__f) { return *(char*)(++__f->bufpos); }
349 +// Increments the current read/write position by 1, returning the
350 +// character at the old position.
351 +inline char& _FILE_I_postincr(FILE *__f) { return *(char*)(__f->bufpos++); }
353 +// Decrements the current read/write position by 1, returning the
354 +// character at the old position.
355 +inline char& _FILE_I_predecr(FILE *__f) { return *(char*)(--__f->bufpos); }
357 +// Decrements the current read/write position by 1, returning the
358 +// character at the old position.
359 +inline char& _FILE_I_postdecr(FILE *__f) { return *(char*)(__f->bufpos--); }
361 +// Increments the current read/write position by __n.
362 +inline void _FILE_I_bump(FILE *__f, int __n) { __f->bufpos += __n; }
364 +// Sets the beginning of the bufer to __begin, the current read/write
365 +// position to __next, and the buffer's past-the-end pointer to __end.
366 +// If any of those pointers is null, then all of them must be null.
367 +inline void _FILE_I_set(FILE *__f, char* __begin, char* __next, char* __end)
369 + __f->bufstart = (unsigned char*)__begin;
370 + __f->bufpos = (unsigned char*)__next;
371 + __f->bufend = (unsigned char*)__end;
372 + __f->bufgetc = (unsigned char*)__begin;
373 + __f->bufputc = (unsigned char*)__end;
376 +# define _STLP_FILE_I_O_IDENTICAL
380 #else /* A C library that we don't have an implementation for. */
382 # error The C++ I/O library is not configured for this compiler
383 diff -urN STLport-4.5.3/stlport/stl/c_locale.h STLport-4.5.3-devel/stlport/stl/c_locale.h
384 --- STLport-4.5.3/stlport/stl/c_locale.h Fri Jan 18 15:07:00 2002
385 +++ STLport-4.5.3-devel/stlport/stl/c_locale.h Wed Jan 8 10:58:10 2003
387 # define _Locale_SPACE _S
388 # define _Locale_PRINT (_P | _U | _L | _N | _B)
389 # define _Locale_ALPHA (_U | _L)
391 +# elif defined(_STLP_USE_UCLIBC) /* linux, using the gnu compiler */
393 +# define _Locale_CNTRL _IScntrl
394 +# define _Locale_UPPER _ISupper
395 +# define _Locale_LOWER _ISlower
396 +# define _Locale_DIGIT _ISdigit
397 +# define _Locale_XDIGIT _ISxdigit
398 +# define _Locale_PUNCT _ISpunct
399 +# define _Locale_SPACE _ISspace
400 +# define _Locale_PRINT _ISprint
401 +# define _Locale_ALPHA _ISalpha
404 +# error Unknown Locale
407 # endif /* _STLP_C_LOCALE_H */